Patch to allow specification of interface name prefix
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.
Quoting Alex Davis <[email protected]>:
Quoted 6 lines
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.
You can use ifrename from wireless tools. Use the option that checks the ethtool information.
Jean has just released Wireless Tools 29-pre12, which can read symlinks in sysfs. That would allow renaming d80211 based network devices by checking the "driver" symlinks in sysfs. I asked Jean to do that with bcm43xx_d80211 in mind.
It's not that I'm against your patch. I'm rather ambivalent. But I think using ifrename could reduce the need in kernel support for interface renaming.
--
Regards,
Pavel Roskin
Larry Finger
NAKQuoted 12 lines · Pavel Roskin
Quoting Alex Davis <[email protected]>:
Quoted 6 lines
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.You can use ifrename from wireless tools. Use the option that checks the ethtool information.
Quoted 7 lines
Jean has just released Wireless Tools 29-pre12, which can read symlinks in sysfs. That would allow renaming d80211 based network devices by checking the "driver" symlinks in sysfs. I asked Jean to do that with
bcm43xx_d80211in mind.It's not that I'm against your patch. I'm rather ambivalent. But I think using ifrename could reduce the need in kernel support for interface renaming.
NACK.
On my system (openSUSE 10.2), one sets the name in /etc/udev/rules.d/30-net_persistent_names.rule. I feel that interface renaming is handled perfectly well in userland, and kernel support is not needed.
Larry
Quoted 18 lines · On Sat, 24 Feb 2007 22:39:19 -0600 Larry Finger <[email protected]>…
Quoted 17 lines · Pavel Roskin
Quoting Alex Davis <[email protected]>:
Quoted 6 lines
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.You can use ifrename from wireless tools. Use the option that checks the ethtool information.
Jean has just released Wireless Tools 29-pre12, which can read symlinks in sysfs. That would allow renaming d80211 based network devices by checking the "driver" symlinks in sysfs. I asked Jean to do that with
bcm43xx_d80211in mind.
Quoted 8 lines
Quoted 2 lines
It's not that I'm against your patch. I'm rather ambivalent. But I think using ifrename could reduce the need in kernel support for interface renaming.
NACK.
On my system (openSUSE 10.2), one sets the name in
/etc/udev/rules.d/30-net_persistent_names.rule. I feel that interface renaming is handled perfectly well in userland, and kernel support is not needed.
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Signature · 1 line
Stephen Hemminger <[email protected]>
Quoted 4 lines · Stephen Hemminger
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Any chance you could provide a pointer to that discussion in the archives?
John
Signature · 2 lines
John W. Linville [email protected]
[removed bcm43xx-dev list]
Quoted 4 lines · Stephen Hemminger
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Decided? I remember just you and hch saying "all existing wireless drivers do that, so everybody should". When pointing out that just two drivers do that (I think ipw and prism) and everybody else use something different (wlan%d most often) there was no reply. "ipw and one other driver do that so everybody should" doesn't sound like a strong argument to me.
Wireless devices need different handling (setting SSID, etc.) than Ethernet ones. I think it's not so bad idea to show that difference by using a different default name. Everybody else who is in some kind different from Ethernet use different name than eth%d. I think we should conform to existing mainline practice by using something different than eth%d too.
Jiri
Signature · 2 lines
Jiri Benc SUSE Labs
Quoted 8 lines · On Tue, 27 Feb 2007 11:16:44 +0100 Jiri Benc <[email protected]> wrote:
[removed bcm43xx-dev list]
Quoted 4 lines · Stephen Hemminger
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Quoted 5 lines
Decided? I remember just you and hch saying "all existing wireless drivers do that, so everybody should". When pointing out that just two drivers do that (I think ipw and prism) and everybody else use something different (wlan%d most often) there was no reply. "ipw and one other driver do that so everybody should" doesn't sound like a strong argument to me.
Don't put too much stock in what I said. Really don't care about such a trivial matter as naming. Jeff and Christoph seem to care, I don't
Quoted 5 lines
Wireless devices need different handling (setting SSID, etc.) than Ethernet ones. I think it's not so bad idea to show that difference by using a different default name. Everybody else who is in some kind different from Ethernet use different name than eth%d. I think we should conform to existing mainline practice by using something different than eth%d too.
As long as the tools work it shouldn't matter. There are some tools like irqbalance that seem to have in bred assumptions.
A bigger issue for me would be getting NAPI to work right for wireless.
Signature · 1 line
Stephen Hemminger <[email protected]>
Quoted 10 lines · Stephen Hemminger
Quoted 7 lines · On Tue, 27 Feb 2007 11:16:44 +0100 Jiri Benc <[email protected]> wrote:
[removed bcm43xx-dev list]
Quoted 4 lines · Stephen Hemminger
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Quoted 8 lines
Quoted 5 lines
Decided? I remember just you and hch saying "all existing wireless drivers do that, so everybody should". When pointing out that just two drivers do that (I think ipw and prism) and everybody else use something different (wlan%d most often) there was no reply. "ipw and one other driver do that so everybody should" doesn't sound like a strong argument to me.
Don't put too much stock in what I said. Really don't care about such a trivial matter as naming. Jeff and Christoph seem to care, I don't
Regardless of the name, it would be nice to have some quick way to determine if a network device is wireless or not. This could be an IOCTL, something in /proc/ or similar. Even if you name them to be wlanX by default, folks can rename them, so applications that care about the type of the network device can't key off of names reliably...
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 6 lines · Ben Greear
Regardless of the name, it would be nice to have some quick way to determine
if a network device is wireless or not. This could be an IOCTL, something in/proc/or similar. Even if you name them to be wlanX by default, folks can rename them, so applications that care about the type of the network device can't key off of names reliably...
iwconfig can do it using ioctl. Shell scripts can do it using "wireless" directory in sysfs:
for i in /sys/class/net/*; do
if test -d $i/wireless; then
echo basename $i
fi
done
Signature · 2 lines
Regards, Pavel Roskin
Quoted 14 lines · Jiri Benc
[removed bcm43xx-dev list]
Quoted 4 lines · Stephen Hemminger
This was hashed out on netdev 2+ years ago and decided that both ethernet and wireless devices should show up as 'eth%d'. For inclusion d80211 needs to conform to existing mainline kernel practice. If this means breaking the expectation of older out of tree wireless support (ie madwifi), sorry.
Decided? I remember just you and hch saying "all existing wireless drivers do that, so everybody should". When pointing out that just two drivers do that (I think ipw and prism) and everybody else use something different (wlan%d most often) there was no reply. "ipw and one other driver do that so everybody should" doesn't sound like a strong argument to me.
Quoted 5 lines
Wireless devices need different handling (setting SSID, etc.) than Ethernet ones. I think it's not so bad idea to show that difference by using a different default name. Everybody else who is in some kind different from Ethernet use different name than eth%d. I think we should conform to existing mainline practice by using something different than eth%d too.
FWIW I remember the discussion too and it wasn't something very settling. One main reason to keep eth%d convention was the fact that the wireless net devices at that time (FullMAC) handled and managed raw ethernet frames and not wireless frames and as such its relfected with eth%d convention. This was the main reasoning for prism54 to adopt eth%d convention. With SoftMAC (mac80211) things are a bit different -- wmaster handles 802.11 frames and wlan%d handles 802.3 frames. The name does not matter much but it does imply at least that I think. As such perhaps mac80211 should change to use eth%d by default.
Luis
Quoted 2 lines · Pavel Roskin
Shell scripts can do it using
"wireless" directory in sysfs:
No, that's wrong. The 'wireless' directory there is bound to disappear since it's created by d80211. The sysfs interface is still subject to discussion.
I think (but also subject to discussion) the way we'll want to do is take note of the 'wiphy' link. But to do that globally cfg80211 will need to be taught to create that link instead of mac80211 which requires knowledge about netdevs in cfg80211 and we still haven't quite figured that out.
For legacy devices not using cfg80211, the only way will be to invoke legacy wext calls on them.
johannes
Quoted 5 lines · Luis R. Rodriguez
adopt eth%d convention. With SoftMAC (mac80211) things are a bit different -- wmaster handles 802.11 frames and wlan%d handles 802.3 frames. The name does not matter much but it does imply at least that I think. As such perhaps mac80211 should change to use eth%d by default.
Hopefully wmaster will fall off the user's radar soon. Regarding the current wlanX interfaces, most modes will be using ethernet framing, so maybe ethX is fine. What about monitor mode?
Doesn't airo use "wifiX" for its monitor interfaces? For monitor interfaces, should we adopt that convention as well?
John
Signature · 2 lines
John W. Linville [email protected]
Quoted 4 lines · John W. Linville
What about monitor mode?
Doesn't airo use "wifiX" for its monitor interfaces? For monitor interfaces, should we adopt that convention as well?
We don't need a convention for monitor mode. Either the user sets an existing interface to monitor mode (we don't touch the name) or the user creates a new monitor interface (they get to choose the name up front)
johannes
Quoted 3 lines · John W. Linville
Hopefully wmaster will fall off the user's radar soon. Regarding the current wlanX interfaces, most modes will be using ethernet framing, so maybe ethX is fine.
Why would we need to change anything now? What's wrong with wlan#?
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Quoted 1 line · Jouni Malinen
What's wrong with wlan#?
Some people are anal about changing user-visible properties when one driver replaces another.
johannes
Quoted 6 lines · Johannes Berg
Quoted 1 line · Jouni Malinen
What's wrong with wlan#?
Some people are anal about changing user-visible properties when one driver replaces another.
Nothing is wrong with it, that's perfectly fine. This is just a matter of adopting a default convention for all wireless devices and sticking to it. Old drivers used eth%d as the drivers mangled ethernet frames and not wireless frames. With mac80211 wmaster handles wireless frames directly but wlan%d handles ethernet frames. If we care more about announcing a device is a wireless device is WLAN then lets go with wlan%d, if we care more about implying what type of frames are being passed to the device then eth%d seems more appropriate.
Luis
Quoted 5 lines · Johannes Berg
Quoted 1 line · Jouni Malinen
What's wrong with wlan#?
Some people are anal about changing user-visible properties when one driver replaces another.
So? Some drivers in the current mainline kernel are using wlan#.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Quoted 7 lines · Jouni Malinen
Quoted 3 lines · John W. Linville
Hopefully wmaster will fall off the user's radar soon. Regarding the current wlanX interfaces, most modes will be using ethernet framing, so maybe ethX is fine.
Why would we need to change anything now? What's wrong with wlan#?
See the earlier parts of the thread... :-)
Signature · 2 lines
John W. Linville [email protected]
Quoted 4 lines · John W. Linville
Quoted 1 line · Jouni Malinen
Why would we need to change anything now? What's wrong with wlan#?
See the earlier parts of the thread... :-)
I've seen a somewhat vague comment about some sort of decision on this front, but no one seems to be able to point to any level of details on what was agreed on and if yes, when and by whom. I have seen number of discussions on the topic of what the interfaces should be named, but none of those seem to be going anywhere and I have not seen any consensus on this topic. As such, the best thing to do seems to be not to do anything, i.e., not rename wlan# to anything else. If someone claims that d80211 is changing the existing behavior, I would just like to point out that wlan# is already used in the current mainline kernel and that argument does not sound reasonable.
Signature · 1 line
Jouni Malinen PGP id EFC895FA