ramips: add support for D-Link DAP-1620 B1
[openwrt/staging/wigyori.git] / target / linux / ramips / mt7621 / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
index b3de1f39cf087b8e39bbd47c674428079eae11de..9db115fcae6566325f35f9cf931b3144584c63ca 100644 (file)
@@ -28,16 +28,11 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && macaddr_setbit_la $hw_mac_addr > /sys${DEVPATH}/macaddress
                ;;
        cudy,x6)
-               hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
-               macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress
-               ;;
-       dlink,dap-x1860-a1)
-               hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
-               [ "$PHYNBR" = "0" ] && \
-                       macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
+               hw_mac_addr="$(mtd_get_mac_binary bdinfo 0xde00)"
                [ "$PHYNBR" = "1" ] && \
-                       macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress
+               macaddr_setbit_la "$(macaddr_add $hw_mac_addr 0x100000)" > /sys${DEVPATH}/macaddress
                ;;
+       dlink,dap-1620-b1|\
        dlink,dir-853-a1)
                lan_mac_addr="$(mtd_get_mac_binary factory 0xe000)"
                [ "$PHYNBR" = "0" ] && \
@@ -45,6 +40,13 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && \
                        macaddr_add $lan_mac_addr 2 > /sys${DEVPATH}/macaddress
                ;;
+       dlink,dap-x1860-a1)
+               hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
+               [ "$PHYNBR" = "0" ] && \
+                       macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && \
+                       macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress
+               ;;
        dlink,dir-853-a3)
                [ "$PHYNBR" = "0" ] && \
                        macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
@@ -141,8 +143,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)"
@@ -181,4 +182,9 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
                ;;
+       zyxel,wsm20)
+               hw_mac_addr="$(mtd_get_mac_binary Factory 0x1fdfa)"
+               [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+               ;;
 esac