ramips: MSG1500 X.00: switch to mac-address-ascii dts
[openwrt/staging/dedeckeh.git] / target / linux / ramips / mt7621 / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
index ffc643f42b728cced042827d27ae90f3aa21e2fa..30a10423ad51b320836fde0c751fbe2988b65860 100644 (file)
@@ -120,6 +120,11 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
                ;;
+       mercusys,mr70x-v1|\
+       tplink,archer-ax23-v1)
+               hw_mac_addr="$(mtd_get_mac_binary config 0x8)"
+               [ "$PHYNBR" = "1" ] &&  macaddr_add "$hw_mac_addr" -1 > "/sys${DEVPATH}/macaddress"
+               ;;
        mts,wg430223)
                hw_mac_addr=$(macaddr_add $(mtd_get_mac_encrypted_arcadyan "board_data") 1)
                [ "$PHYNBR" = "0" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
@@ -136,8 +141,7 @@ case "$board" in
                ;;
        raisecom,msg1500-x-00)
                [ "$PHYNBR" = "0" ] && \
-                       macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \
-                               > /sys${DEVPATH}/macaddress
+                       macaddr_setbit_la "$(get_mac_label)" > /sys${DEVPATH}/macaddress
                ;;
        snr,snr-cpe-me2-sfp)
                hw_mac_addr="$(mtd_get_mac_binary factory 0x8004)"
@@ -147,12 +151,9 @@ case "$board" in
                hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
                [ "$PHYNBR" = "1" ] &&  macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress
                ;;
-       tplink,archer-ax23-v1)
-               hw_mac_addr="$(mtd_get_mac_binary config 0x8)"
-               # 2.4 GHz MAC is MAC in EEPROm while 5GHz is EEPROM_MAC -1
-               # However, mac80211 assigns consecutive addresses for each VAP
-               # Which leads to conflicting addresses. Set the LA bit for 5Ghz instead.
-               [ "$PHYNBR" = "1" ] &&  macaddr_setbit_la "$hw_mac_addr" > "/sys${DEVPATH}/macaddress"
+       totolink,x5000r)
+               hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
+               [ "$PHYNBR" = "1" ] &&  macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress
                ;;
        tplink,eap615-wall-v1)
                hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"