From 95965cd81349bbbfe99414a74181c07d9c42f4aa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 21 Jan 2016 13:28:04 +0000 Subject: mac80211: make the path phy lookup more robust regarding config upgrades, allow partial path matching Signed-off-by: Felix Fietkau SVN-Revision: 48425 --- package/kernel/mac80211/files/lib/wifi/mac80211.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'package/kernel/mac80211/files/lib/wifi') diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index ea229d6..3fc39c2 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 } -- cgit v1.1