Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Nov 2013 13:29:13 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org, Nomad Esst <noname.esst@yahoo.com>
Subject:   Re: Change order of modules loading in kernel
Message-ID:  <201311121329.13602.jhb@freebsd.org>
In-Reply-To: <1383818164.21969.YahooMailNeo@web162703.mail.bf1.yahoo.com>
References:  <1383818164.21969.YahooMailNeo@web162703.mail.bf1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311121329.13602.jhb>