ramips: add support for Netgear WAX202
[openwrt/openwrt.git] / target / linux / ramips / mt7621 / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
index d018c1de1b63dc85d3d51fe98474a7b1ca9d765a..4649b9e9d0a89b69cc3e4809b3b83a190a5f9362 100644 (file)
@@ -10,12 +10,17 @@ PHYNBR=${DEVPATH##*/phy}
 board=$(board_name)
 
 case "$board" in
-       beeline,smartbox-flash)
+       beeline,smartbox-flash|\
+       mts,wg430223)
                hw_mac_addr_ra0="$(mtd_get_mac_ascii u-boot-env ra0macaddr)"
                hw_mac_addr_rax0="$(mtd_get_mac_ascii u-boot-env rax0macaddr)"
                [ "$PHYNBR" = "0" ] && echo -n $hw_mac_addr_ra0 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && echo -n $hw_mac_addr_rax0 > /sys${DEVPATH}/macaddress
                ;;
+       cudy,x6)
+               hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
+               macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress
+               ;;
        dlink,dir-853-a3)
                [ "$PHYNBR" = "0" ] && \
                        macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
@@ -32,6 +37,13 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && \
                        macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
                ;;
+       hiwifi,hc5962)
+               label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+               [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
+               echo -n "$label_mac" > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
+               macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
+               ;;
        iptime,a3002mesh|\
        iptime,a3004t)
                hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
@@ -64,6 +76,17 @@ 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
                ;;
+       netgear,wax202)
+               hw_mac_addr=$(mtd_get_mac_ascii Config mac)
+               [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
+               ;;
+       oraybox,x3a)
+               if [ "$PHYNBR" = "1" ]; then
+                       hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
+                       macaddr_setbit_la "$(macaddr_add $hw_mac_addr 0x100000)" > /sys${DEVPATH}/macaddress
+               fi
+               ;;
        raisecom,msg1500-x-00)
                [ "$PHYNBR" = "0" ] && \
                        macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \
@@ -73,4 +96,12 @@ case "$board" in
                hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
                [ "$PHYNBR" = "1" ] &&  macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress
                ;;
+       tplink,eap615-wall-v1)
+               hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"
+               macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress"
+               ;;
+       yuncore,ax820)
+               [ "$PHYNBR" = "1" ] && \
+                       macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress
+               ;;
 esac