aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2018-10-26 10:05:39 -0700
committerJohn Crispin <john@phrozen.org>2018-11-26 12:05:45 +0100
commit38167cb7f41b316fcc6d6bbcab993a2f42f30c0e (patch)
tree34ebf9fa1b295fee912249f72bbde20e91ddb916 /target/linux/ipq806x
parent41770add03ad77a0ce41ed424ad050238f7d9272 (diff)
downloadupstream-38167cb7f41b316fcc6d6bbcab993a2f42f30c0e.tar.gz
upstream-38167cb7f41b316fcc6d6bbcab993a2f42f30c0e.tar.bz2
upstream-38167cb7f41b316fcc6d6bbcab993a2f42f30c0e.zip
hotplug: Allow configuring radio name.
This way the radio (phy) name can be the same through module reloads. To set the desired name: uci set wireless.@wifi-device[0].phyname=wiphy0 I guess this only works on ipq6086 boards as I could not find a more generic place to put this. Maybe someone can improve it. Signed-off-by: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'target/linux/ipq806x')
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index afa425f075..8956bbd74a 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -35,3 +35,24 @@ case "$board" in
*)
;;
esac
+
+OPATH=${DEVPATH##/devices/platform/}
+OPATH=${OPATH%%/ieee*}
+
+# 10 radios is enough for anyone!
+for i in `seq 0 9`;
+ do
+ BUS=`uci get wireless.@wifi-device[$i].path`
+ if [ "$BUS " == "$OPATH " ]
+ then
+ PHYNAME=${DEVPATH##*ieee80211/}
+ NPHYNAME=`uci get wireless.@wifi-device[$i].phyname`
+ if [ "$NPHYNAME " != " " ]
+ then
+ if [ "$PHYNAME " != "$NPHYNAME " ]
+ then
+ iw $PHYNAME set name $NPHYNAME
+ fi
+ fi
+ fi
+done