Change order of modules loading in kernel

John Baldwin jhb at freebsd.org
Tue Nov 12 19:54:56 UTC 2013


On Thursday, November 07, 2013 4:56:04 am Nomad Esst wrote:
> Hi
> First thanks to Mr. John Baldwin, helped me with my previous questions.
> 
> With his helps, I made some changes in order to make em and igb driver name ports "foo".
> Now the changes are :
> "if_igb.c" : Change "igb" to "foo" in device_t structure b:
> static driver_t igb_driver = {
> "foo", igb_methods, sizeof(struct adapter),
> };
> 
> static devclass_t igb_devclass;
> DRIVER_MODULE(igb, pci, igb_driver, igb_devclass, 0, 0);
> MODULE_DEPEND(igb, pci, 1, 1, 1);
> MODULE_DEPEND(igb, ether, 1, 1, 1);
> 
> Also for "if_em.c" : Change "em" to "foo" in device_t structure b:
> 
> static driver_t em_driver = {
> "foo", em_methods, sizeof(struct adapter),
> };
> devclass_t em_devclass;
> DRIVER_MODULE(em, pci, em_driver, em_devclass, 0, 0);
> MODULE_DEPEND(em, pci, 1, 1, 1);
> MODULE_DEPEND(em, ether, 1, 1, 1);
> 
> Now, I have my interfaces like : foo0 , foo1 , foo2 , foo3 , foo4 , foo5
> The firs four interface (old "igb"s) are located at the right side of my server an the last two ones (old "em"s) are located at the left side, you 
can see the problem. I want the "em" module load before "igb". Can I do so?

You cannot force this as it depends on how your motherboard enumerates
PCI devices.  I think another person's suggestion of just renaming
the interfaces via rc.conf during boot is probably going to be simplest
for you.

> By the way! Different driver naming in device_t structure and in DRIVER_MODULE and the other two macros (as I have done) causes problems?

That should be ok.

-- 
John Baldwin


More information about the freebsd-drivers mailing list