diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2005-07-30 15:49:58 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-30 18:17:22 -0400 |
commit | 0cd545d6ba0e0138782eb0ec287d0eb3db529b69 (patch) | |
tree | 0039836752d1ae1a3d3aab8b514e9159573fd146 /drivers/net/wireless/hostap/hostap_hw.c | |
parent | 0ef79ee22cf5c1b177184c18b6525889bcc6681f (diff) |
[PATCH] hostap update
Create sysfs "device" files for hostap
I was writing some scripts to automatically build kismet source lines,
and I noticed that hostap devices don't have device files, unlike my
prism54 and ipw2200 cards:
$ ls -l /sys/class/net/eth0/device
/sys/class/net/eth0/device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:01.0
$ ls -l /sys/class/net/wifi0
ls: /sys/class/net/wifi0/device: No such file or directory
$ ls -l /sys/class/net/wlan0
ls: /sys/class/net/wlan0/device: No such file or directory
The following (quite small) patch makes sure that both the wlan and wifi
net devices have that pointer to the bus device.
This way, I can do things like
for i in /sys/class/net/*; do
if ! [ -e $i/device/drive ]; then
continue;
fi;
driver=$(basename $(readlink $i/device/driver))
case $driver in
hostap*)
echo -- hostap,$i,$i-$driver
break;
ipw2?00)
echo -- $driver,$i,$i-$driver
break;
prism54)
echo prism54g,$i
esac
done
Which should generate a working set of source lines for kismet no matter
what order I plug the cards in.
It might also be handy to have a link between the two net devices, but
that's a patch for another day.
That patch is against 2.6.13-rc1-mm1.
-- Dave
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 039ef7f61bee..7572050db32d 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -3268,7 +3268,8 @@ static void prism2_clear_set_tim_queue(local_info_t *local) | |||
3268 | 3268 | ||
3269 | 3269 | ||
3270 | static struct net_device * | 3270 | static struct net_device * |
3271 | prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx) | 3271 | prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, |
3272 | struct device *sdev) | ||
3272 | { | 3273 | { |
3273 | struct net_device *dev; | 3274 | struct net_device *dev; |
3274 | struct hostap_interface *iface; | 3275 | struct hostap_interface *iface; |
@@ -3439,6 +3440,7 @@ while (0) | |||
3439 | 3440 | ||
3440 | rtnl_lock(); | 3441 | rtnl_lock(); |
3441 | ret = dev_alloc_name(dev, "wifi%d"); | 3442 | ret = dev_alloc_name(dev, "wifi%d"); |
3443 | SET_NETDEV_DEV(dev, sdev); | ||
3442 | if (ret >= 0) | 3444 | if (ret >= 0) |
3443 | ret = register_netdevice(dev); | 3445 | ret = register_netdevice(dev); |
3444 | rtnl_unlock(); | 3446 | rtnl_unlock(); |