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
23 mtd_get_mac_text
"mp" 0x13 > /sys
${DEVPATH}/macaddress
27 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
33 [ "$PHYNBR" -eq 0 ] && \
34 mtd_get_mac_ascii bdcfg
"wlanmac_a" > /sys
${DEVPATH}/macaddress
35 [ "$PHYNBR" -eq 1 ] && \
36 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
39 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys
${DEVPATH}/macaddress
42 macaddr_add
"$(mtd_get_mac_text u-boot 0x3ff80 12)" $
((PHYNBR
*7+1)) > /sys
${DEVPATH}/macaddress
45 # There is no eeprom data for 5 GHz wlan in "art" partition
46 # which would allow to patch the macaddress
47 [ "$PHYNBR" -eq 0 ] && \
48 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /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 1 ] && \
54 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
57 # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
58 [ "$PHYNBR" -eq 1 ] && \
59 k2t_get_mac
"lan_mac" > /sys
${DEVPATH}/macaddress
62 mtd_get_mac_ascii cfg1 RADIOADDR
${PHYNBR} > /sys
${DEVPATH}/macaddress
65 # set the 2.4G interface mac address to LAN MAC
66 [ "$PHYNBR" -eq 1 ] && \
67 mtd_get_mac_text mac
4 > /sys
${DEVPATH}/macaddress
68 # set the 5G interface mac address to WAN MAC + 1
69 [ "$PHYNBR" -eq 0 ] && \
70 macaddr_add
"$(mtd_get_mac_text mac 0x18)" 1 > /sys
${DEVPATH}/macaddress
73 # Set mac address for 2.4g device
74 [ "$PHYNBR" -eq 1 ] && \
75 mtd_get_mac_ascii u-boot-env ethaddr
> /sys
${DEVPATH}/macaddress
78 [ "$PHYNBR" -eq 0 ] && \
79 mtd_get_mac_text mib0
0x66 > /sys
${DEVPATH}/macaddress
82 [ "$PHYNBR" -eq 1 ] && \
83 mtd_get_mac_text mib0
0x66 > /sys
${DEVPATH}/macaddress