From 0cd545d6ba0e0138782eb0ec287d0eb3db529b69 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Sat, 30 Jul 2005 12:49:58 -0700 Subject: [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 Signed-off-by: Jouni Malinen Signed-off-by: Jeff Garzik --- drivers/net/wireless/hostap/hostap_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/hostap/hostap_pci.c') diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index 3a208989333e..c4c7b2f2e8ac 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c @@ -308,7 +308,8 @@ static int prism2_pci_probe(struct pci_dev *pdev, pci_set_master(pdev); #endif /* PRISM2_BUS_MASTER */ - dev = prism2_init_local_data(&prism2_pci_funcs, cards_found); + dev = prism2_init_local_data(&prism2_pci_funcs, cards_found, + &pdev->dev); if (dev == NULL) goto fail; iface = netdev_priv(dev); -- cgit v1.2.3-59-g8ed1b