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 | 95965cd81349bbbfe99414a74181c07d9c42f4aa (patch) | |
tree | 2b731fe55b30ca3650c3d37b60186af348131d9a /package/kernel/mac80211/files/lib/wifi | |
parent | 59e3a4714a5154da4103f1d3d3fd8fe2f57eabd5 (diff) | |
download | upstream-95965cd81349bbbfe99414a74181c07d9c42f4aa.tar.gz upstream-95965cd81349bbbfe99414a74181c07d9c42f4aa.tar.bz2 upstream-95965cd81349bbbfe99414a74181c07d9c42f4aa.zip |
mac80211: make the path phy lookup more robust regarding config upgrades, allow partial path matching
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48425
Diffstat (limited to 'package/kernel/mac80211/files/lib/wifi')
-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 } |