linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch to allow specification of interface name prefix
@ 2007-02-25  4:06 Alex Davis
  2007-02-25  4:30 ` Pavel Roskin
  0 siblings, 1 reply; 19+ messages in thread
From: Alex Davis @ 2007-02-25  4:06 UTC (permalink / raw)
  To: larry.finger; +Cc: linux-wireless, bcm43xx-dev

This patch will allow you to specify the interface name prefix of wireless devices.

On my machine, the wireless devices under the bcm43xx driver are named 'ethx'; I 
would really rather have them called 'wlanx', like bcm43xx-d80211 does.

I have this as an option to bcm43xx in modprobe.conf.

Usage: modprobe bcm43xx ifprefix=wlan
Your wireless devices will now be called 'wlan0', 'wlan1', etc.

This patch is against Larry's combined-2.6.20.1.patch

Signed-off by: Alex Davis <alex14641 at yahoo dot com>

--- drivers/net/wireless/bcm43xx/bcm43xx_main.c	2007-02-24 22:22:48.000000000 -0500
+++ ../linux-2.6.20.1-lwf/drivers/net/wireless/bcm43xx/bcm43xx_main.c	2007-02-24
22:44:46.000000000 -0500
@@ -103,6 +103,9 @@
 # define modparam_fwpostfix  ""
 #endif /* CONFIG_BCM43XX_DEBUG*/
 
+static char modparam_ifprefix[IFNAMSIZ - 4];
+module_param_string(ifprefix, modparam_ifprefix, IFNAMSIZ - 4, 0444);
+MODULE_PARM_DESC(ifprefix, "Prefix for interface names (e.g; wlan).");
 
 /* If you want to debug with just a single device, enable this,
  * where the string is the pci device ID (as given by the kernel's
@@ -4123,6 +4126,10 @@
 		goto out;
 	}
 	/* initialize the net_device struct */
+	if ( strlen(modparam_ifprefix) > 0 ) {
+		strcpy(net_dev->name, modparam_ifprefix);
+		strcat(net_dev->name, "%d");
+	}
 	SET_MODULE_OWNER(net_dev);
 	SET_NETDEV_DEV(net_dev, &pdev->dev);
 

I code, therefore I am


 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-02-28 19:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-25  4:06 Patch to allow specification of interface name prefix Alex Davis
2007-02-25  4:30 ` Pavel Roskin
2007-02-25  4:39   ` Larry Finger
2007-02-26 23:02     ` Stephen Hemminger
2007-02-27  1:33       ` John W. Linville
2007-02-27 10:16       ` Jiri Benc
2007-02-27 17:41         ` Stephen Hemminger
2007-02-27 18:21           ` Ben Greear
2007-02-27 18:52             ` Pavel Roskin
2007-02-27 19:15               ` Johannes Berg
2007-02-27 18:55         ` Luis R. Rodriguez
2007-02-28  1:25           ` John W. Linville
2007-02-28  8:51             ` Johannes Berg
2007-02-28 16:44             ` Jouni Malinen
2007-02-28 16:50               ` Johannes Berg
2007-02-28 16:54                 ` Luis R. Rodriguez
2007-02-28 16:55                 ` Jouni Malinen
2007-02-28 18:35               ` John W. Linville
2007-02-28 19:21                 ` Jouni Malinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).