Date: Sun, 27 Oct 2013 05:13:00 -0700 From: John-Mark Gurney <jmg@funkthat.com> To: Nomad Esst <noname.esst@yahoo.com> Cc: freebsd-drivers@freebsd.org Subject: Re: Changing igb to foo in if_igb.c Message-ID: <20131027121300.GD58155@funkthat.com> In-Reply-To: <1382869003.10661.YahooMailBasic@web162706.mail.bf1.yahoo.com> References: <1382869003.10661.YahooMailBasic@web162706.mail.bf1.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Nomad Esst wrote this message on Sun, Oct 27, 2013 at 03:16 -0700: > Hi list > I'm new here and I want you to excuse me for newish questions. > We have to types of igb cards(fiber and Ethernet) on our systems. Both of these cards are name igb# I want to change fiber ones to foo. I have took look at if_igb.c file, how can I detect the type of cards before filling driver_t structure out? e.g. If type=bar then filling with igb as name else if type=foo then filling with foo as name. > > static device_method_t igb_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, igb_probe), > DEVMETHOD(device_attach, igb_attach), > DEVMETHOD(device_detach, igb_detach), > DEVMETHOD(device_shutdown, igb_shutdown), > DEVMETHOD(device_suspend, igb_suspend), > DEVMETHOD(device_resume, igb_resume), > {0, 0} > }; > > static driver_t igb_driver = { > "igb", 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); Why don't you use ifconfig igb0 name foo0 to do that? You can use rc.conf's ifconfig_igb0_name="foo0" to do that automaticly on boot everytime. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131027121300.GD58155>