diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-21 13:28:04 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-21 13:28:04 +0000 |
commit | 67baa7498c06a22b67334c562548dc36e339b89e (patch) | |
tree | 2cba1f130d4f789e1b4e164e31077809dd8ffab6 /package/kernel/mac80211/files/lib/wifi/mac80211.sh | |
parent | c8bd3fe0c11dfc48fe914353004b41129685fb30 (diff) | |
download | master-187ad058-67baa7498c06a22b67334c562548dc36e339b89e.tar.gz master-187ad058-67baa7498c06a22b67334c562548dc36e339b89e.tar.bz2 master-187ad058-67baa7498c06a22b67334c562548dc36e339b89e.zip |
mac80211: make the path phy lookup more robust regarding config upgrades, allow partial path matching
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48425 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/files/lib/wifi/mac80211.sh')
-rw-r--r-- | package/kernel/mac80211/files/lib/wifi/mac80211.sh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index ea229d6c03..3fc39c26f2 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -10,10 +10,9 @@ lookup_phy() { config_get devpath "$device" path [ -n "$devpath" ] && { for _phy in /sys/devices/$devpath/ieee80211/phy*; do - [ -e "$_phy" ] && { - phy="${_phy##*/}" - return - } + case "$(readlink -f /sys/class/ieee80211/$_phy/device)" in + *$devpath) return 0;; + esac done } |