summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211/files/lib/netifd/wireless
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-21 13:28:04 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-21 13:28:04 +0000
commit95965cd81349bbbfe99414a74181c07d9c42f4aa (patch)
tree2b731fe55b30ca3650c3d37b60186af348131d9a /package/kernel/mac80211/files/lib/netifd/wireless
parent59e3a4714a5154da4103f1d3d3fd8fe2f57eabd5 (diff)
downloadmtk-20170518-95965cd81349bbbfe99414a74181c07d9c42f4aa.zip
mtk-20170518-95965cd81349bbbfe99414a74181c07d9c42f4aa.tar.gz
mtk-20170518-95965cd81349bbbfe99414a74181c07d9c42f4aa.tar.bz2
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/netifd/wireless')
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 29dd4de..02c195e 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -394,11 +394,10 @@ mac80211_generate_mac() {
find_phy() {
[ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0
[ -n "$path" ] && {
- for phy in /sys/devices/$path/ieee80211/phy*; do
- [ -e "$phy" ] && {
- phy="${phy##*/}"
- return 0
- }
+ for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
+ case "$(readlink -f /sys/class/ieee80211/$phy/device)" in
+ *$path) return 0;;
+ esac
done
}
[ -n "$macaddr" ] && {