tech-kern archive

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

Device driver attachment in autoconf when using modules(7)



Hi all,

I just have one question about how device drivers are supposed to attach when loaded as modules.
I've noticed this is the most commonly used method of attachment throught the kernel:

...
switch (cmd) {
	case MODULE_CMD_INIT:
#ifdef _MODULE
		error = config_init_component(cfdriver_ioconf_if_ath_pci,
		    cfattach_ioconf_if_ath_pci, cfdata_ioconf_if_ath_pci);
#endif
		return error;
	case MODULE_CMD_FINI:
...
And so on.
Since I rarely used modules when looking for particular drivers, I just noticed that by loading (and unloading) a module from the command line, no new device is recognized or attached.
In some cases, especially in pci drivers, just a rescan messages is shown.
So my question is: are module device drivers supposed to attach and init a real device driver instance, or are they just a method of inserting the right autoconf glue, before the autoconfiguration process take place?
Shouldn't a new device driver module also perform some kind of bus enumeration scan, and then attach a new real device instance (by calling config_attach, or config_found, etc..


Home | Main Index | Thread Index | Old Index