From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 12 19:54:56 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26201392 for ; Tue, 12 Nov 2013 19:54:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00B3F213D for ; Tue, 12 Nov 2013 19:54:56 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0EEB1B9A3; Tue, 12 Nov 2013 14:54:55 -0500 (EST) From: John Baldwin To: freebsd-drivers@freebsd.org, Nomad Esst Subject: Re: Change order of modules loading in kernel Date: Tue, 12 Nov 2013 13:29:13 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <1383818164.21969.YahooMailNeo@web162703.mail.bf1.yahoo.com> In-Reply-To: <1383818164.21969.YahooMailNeo@web162703.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201311121329.13602.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 12 Nov 2013 14:54:55 -0500 (EST) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Nov 2013 19:54:56 -0000 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