Changing igb to foo in if_igb.c

John-Mark Gurney jmg at funkthat.com
Sun Oct 27 12:13:01 UTC 2013


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."


More information about the freebsd-drivers mailing list