Discussion:
/proc/net/p80211 doesn't new interface name
Karl Relton
2008-01-31 20:24:34 UTC
Permalink
The p80211 driver creates an entry in /proc/net/p80211 named after the
original device name obtained in register_wlandev (p80211netdev.c).

This is all fine for probably the vast majority of users.

However, users like myself with more than one wireless card at their
disposal use a UDEV rule to rename the interface to a name of my choice,
e.g.

# Prism2 usb card - key off driver
SUBSYSTEM=="net", DRIVERS=="prism2_usb", NAME="p2wl%n"


This gives a problem when udev calls wlan-udev.sh, since it sets the
first argument to the new name. For virtually all of the execution of
wlan-udev, shared and shared.prism2 code this is what we want. However
there are a few functions in the 'shared' script which use
the /proc/net/p80211/<devname> interface, most importantly wlan_nsdname.


I believe the 'correct' way to fix this is to use
'atomic_notifier_chain_register' to register a callback that spots when
the name gets changed (which can then alter the /proc entry
accordingly). The problem is that this may only be available in more
recent kernels (not sure when really).


Another hack way round, which will work when the scripts are called from
udev, is to check the env var INTERFACE_OLD, which is set by udev to the
original name. This can then be used instead of the normal argument.


What do you guys think? I'm not sure if its worth the effort of
registering the callback (nor am I sure my coding skills are up to it).

Karl

Loading...