summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/files/lib/wifi/mac80211.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/mac80211/files/lib/wifi/mac80211.sh')
-rw-r--r--package/kernel/mac80211/files/lib/wifi/mac80211.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 5d3adb1511..a3b2199507 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -8,9 +8,13 @@ lookup_phy() {
local devpath
config_get devpath "$device" path
- [ -n "$devpath" -a -d "/sys/devices/$devpath/ieee80211" ] && {
- phy="$(ls /sys/devices/$devpath/ieee80211 | grep -m 1 phy)"
- [ -n "$phy" ] && return
+ [ -n "$devpath" ] && {
+ for _phy in /sys/devices/$devpath/ieee80211/phy*; do
+ [ -e "$_phy" ] && {
+ phy="${_phy##*/}"
+ return
+ }
+ done
}
local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"