summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-10-09 09:04:24 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-10-09 09:04:24 +0000
commitfbe1b7ecdf0d8ef1275276eab9b74c244c9a0f14 (patch)
tree15129204d9f2430b960364b46e8d91e90af9bff8 /package
parentaad6cb99cfca296a3d5fe53f408ccd9ce55e58ea (diff)
downloadmtk-20170518-fbe1b7ecdf0d8ef1275276eab9b74c244c9a0f14.zip
mtk-20170518-fbe1b7ecdf0d8ef1275276eab9b74c244c9a0f14.tar.gz
mtk-20170518-fbe1b7ecdf0d8ef1275276eab9b74c244c9a0f14.tar.bz2
mac80211: remove error from detect script
Signed-off-by: Michel Stam <m.stam@fugro.nl> SVN-Revision: 42861
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/files/lib/wifi/mac80211.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index a3b2199..0b662eb 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -19,9 +19,11 @@ lookup_phy() {
local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
[ -n "$macaddr" ] && {
- for _phy in $(ls /sys/class/ieee80211 2>/dev/null); do
- [ "$macaddr" = "$(cat /sys/class/ieee80211/${_phy}/macaddress)" ] || continue
- phy="$_phy"
+ for _phy in /sys/class/ieee80211/*; do
+ [ -e "$_phy" ] || continue
+
+ [ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
+ phy="${_phy##*/}"
return
done
}
@@ -65,7 +67,12 @@ detect_mac80211() {
[ -n "$type" ] || break
devidx=$(($devidx + 1))
done
- for dev in $(ls /sys/class/ieee80211); do
+
+ for _dev in /sys/class/ieee80211/*; do
+ [ -e "$_dev" ] || continue
+
+ dev="${_dev##*/}"
+
found=0
config_foreach check_mac80211_device wifi-device
[ "$found" -gt 0 ] && continue