[OpenWrt-Devel] [PATCH] netgear r7800: Fix mac address of radios.

greearb at candelatech.com greearb at candelatech.com
Thu Oct 25 17:08:02 EDT 2018


From: Ben Greear <greearb at candelatech.com>

Reloading the driver causes the phyX to change, and that caused
the MAC address to change.  Instead, match on pci-bus which should
be immutable.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 .../ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 afa425f..fef8205 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
@@ -19,8 +19,14 @@ case "$board" in
 		echo $(macaddr_add $(mtd_get_mac_binary PRODUCTDATA 12) $((1 - $PHYNBR)) ) > /sys${DEVPATH}/macaddress
 		;;
 	netgear,d7800 |\
-	netgear,r7500v2 |\
+	netgear,r7500v2)
+		echo $(macaddr_add $(mtd_get_mac_binary art 6)  $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
+		;;
 	netgear,r7800)
+	        # Match off of pci-bus, it is less mutable than the phy name since phy name
+	        # changes on module reload.
+	        grep PCI_SLOT_NAME=0000:01:00.0 /sys${DEVPATH}/device/uevent && PHYNBR=0
+	        grep PCI_SLOT_NAME=0001:01:00.0 /sys${DEVPATH}/device/uevent && PHYNBR=1
 		echo $(macaddr_add $(mtd_get_mac_binary art 6)  $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
 		;;
 	tplink,c2600)
-- 
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