[OpenWrt-Devel] [PATCH] hotplug: Allow configuring radio name.

greearb at candelatech.com greearb at candelatech.com
Fri Oct 26 13:05:39 EDT 2018


From: Ben Greear <greearb at candelatech.com>

This way the radio (phy) name can be the same through module reloads.

To set the desired name:

uci set wireless. at 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 at candelatech.com>
---
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac         | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

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 5e5dd84..0b1f6f8 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
@@ -30,3 +30,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. at wifi-device[$i].path`
+  if [ "$BUS " == "$OPATH " ]
+      then
+      PHYNAME=${DEVPATH##*ieee80211/}
+      NPHYNAME=`uci get wireless. at wifi-device[$i].phyname`
+      if [ "$NPHYNAME " != " " ]
+          then
+          if [ "$PHYNAME " != "$NPHYNAME " ]
+              then
+              iw $PHYNAME set name $NPHYNAME
+          fi
+      fi
+  fi
+done
-- 
2.4.11


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list