Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.bin/config

> That there should be a way to inject cfdata at run-time (well, along
> with loading a module), yes.


> That anything should be moved back to drivers' .c file, not really.  The
> information carried by a line like "device pci { dev = -1,
> function = -1 }" is no different to a function prototype in a .h.

Yes, it's an interface.

What I'm thinking of now is to make interfaces (struct cfiattrdata) modules.
For the pci case, the pci interface is only used by pci itself.  In cases
like mii or ata, one interface is provided by multiple devices.  To consistently
deal with these cases, always separate device and interface.  Changing

        device pci { ... }


        define pciif { ... }
        device pci: pciif

Interfaces (like pciif) will end up in a single module, like pciif.kmod.

pci.kmod depends on pciif.kmod.  AND pci.kmod provides an interface, pciif.
When pci.kmod is loaded, it in turn loads pciif.kmod, meaning pci.kmod depends
on pciif.kmod.  When a pci device kmod (say, if_fxp_pci.kmod) is loaded &
configured, it will look up pciif and attaches to a pci device, which is a
pci device, not pciif.

        pci.kmod -> pciif.kmod
        if_fxp_pci.kmod -> pci.kmod

(This means we need some changes to module framework to deal with interface
modules specially.)


Home | Main Index | Thread Index | Old Index