3 [ "$ACTION" = "add" ] ||
exit 0
5 PHYNBR
=${DEVPATH##*/phy}
7 [ -n $PHYNBR ] ||
exit 0
10 .
/lib
/functions
/system.sh
11 .
/lib
/functions
/k2t.sh
18 macaddr_add
"$(mtd_get_mac_binary 'Board data' 2)" $
(($PHYNBR * 8 + 1)) > /sys
${DEVPATH}/macaddress
21 [ "$PHYNBR" -eq 0 ] && \
22 mtd_get_mac_ascii art
"protest_ath1_mac" > /sys
${DEVPATH}/macaddress
23 [ "$PHYNBR" -eq 1 ] && \
24 mtd_get_mac_ascii art
"protest_ath0_mac" > /sys
${DEVPATH}/macaddress
29 mtd_get_mac_text
"mp" 0x13 > /sys
${DEVPATH}/macaddress
33 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
39 [ "$PHYNBR" -eq 0 ] && \
40 mtd_get_mac_ascii bdcfg
"wlanmac_a" > /sys
${DEVPATH}/macaddress
41 [ "$PHYNBR" -eq 1 ] && \
42 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
48 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys
${DEVPATH}/macaddress
51 # There is no eeprom data for 5 GHz wlan in "art" partition
52 # which would allow to patch the macaddress
53 [ "$PHYNBR" -eq 0 ] && \
54 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
57 # There is no eeprom data for 5 GHz wlan in "art" partition
58 # which would allow to patch the macaddress
59 [ "$PHYNBR" -eq 1 ] && \
60 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
63 # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
64 [ "$PHYNBR" -eq 1 ] && \
65 k2t_get_mac
"lan_mac" > /sys
${DEVPATH}/macaddress
68 mtd_get_mac_ascii cfg1 RADIOADDR
${PHYNBR} > /sys
${DEVPATH}/macaddress
71 # set the 2.4G interface mac address to LAN MAC
72 [ "$PHYNBR" -eq 1 ] && \
73 mtd_get_mac_text mac
4 > /sys
${DEVPATH}/macaddress
74 # set the 5G interface mac address to WAN MAC + 1
75 [ "$PHYNBR" -eq 0 ] && \
76 macaddr_add
"$(mtd_get_mac_text mac 0x18)" 1 > /sys
${DEVPATH}/macaddress
79 # Set mac address for 2.4g device
80 [ "$PHYNBR" -eq 1 ] && \
81 mtd_get_mac_ascii u-boot-env ethaddr
> /sys
${DEVPATH}/macaddress
84 [ "$PHYNBR" -eq 0 ] && \
85 mtd_get_mac_text mib0
0x66 > /sys
${DEVPATH}/macaddress
88 [ "$PHYNBR" -eq 1 ] && \
89 mtd_get_mac_text mib0
0x66 > /sys
${DEVPATH}/macaddress