aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-07-06 18:53:48 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-07-06 18:53:48 +0000
commit940c4740a60b76413f3a36f605b127bdb7091970 (patch)
tree43334b246ead78ef4bb79a658a22827bc67bdca2
parentbf6dfd437dfb2c7b2122b63bd9aa45ee99985c57 (diff)
downloadupstream-940c4740a60b76413f3a36f605b127bdb7091970.tar.gz
upstream-940c4740a60b76413f3a36f605b127bdb7091970.tar.bz2
upstream-940c4740a60b76413f3a36f605b127bdb7091970.zip
mac80211: fix interface teardown for kernels >= 2.6.33
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22078 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index af8dd23270..a963db81ba 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -165,6 +165,14 @@ scan_mac80211() {
config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${sta:+$sta }${monitor:+$monitor }${mesh:+$mesh}"
}
+list_phy_interfaces() {
+ local phy="$1"
+ if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then
+ ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null;
+ else
+ ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g'
+ fi
+}
disable_mac80211() (
local device="$1"
@@ -181,7 +189,7 @@ disable_mac80211() (
done
include /lib/network
- for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do
+ for wdev in $(list_phy_interfaces "$phy"); do
[ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1
for pid in `pidof wpa_supplicant`; do
grep "$wdev" /proc/$pid/cmdline >/dev/null && \