aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-01-13 22:10:03 +0100
committerFelix Fietkau <nbd@nbd.name>2020-01-14 14:57:13 +0100
commitb1a1c222c93bb4e8f2d2e13f50fe6329e523ae3b (patch)
tree7c8335445d227ac6c26f632cbf0c0a1633a53564 /package
parent9501469e1146c6d76b7dde6391479314897ba4d8 (diff)
downloadupstream-b1a1c222c93bb4e8f2d2e13f50fe6329e523ae3b.tar.gz
upstream-b1a1c222c93bb4e8f2d2e13f50fe6329e523ae3b.tar.bz2
upstream-b1a1c222c93bb4e8f2d2e13f50fe6329e523ae3b.zip
mac80211: fix list_phy_interfaces for multiple wiphys on the same device
Network interfaces are looked up based on the device behind a phy, so the phy needs to be checked separately Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index f1882ec509..b0fc5fb37b 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -983,7 +983,7 @@ drv_mac80211_setup() {
wireless_set_up
}
-list_phy_interfaces() {
+_list_phy_interfaces() {
local phy="$1"
if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then
ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null;
@@ -992,6 +992,15 @@ list_phy_interfaces() {
fi
}
+list_phy_interfaces() {
+ local phy="$1"
+
+ for dev in $(_list_phy_interfaces "$phy"); do
+ readlink "/sys/class/net/${dev}/phy80211" | grep -q "/${phy}\$" || continue
+ echo "$dev"
+ done
+}
+
drv_mac80211_teardown() {
wireless_process_kill_all