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
26 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
30 [ "$PHYNBR" -eq 1 ] && \
31 mtd_get_mac_ascii bdcfg
"wlanmac" > /sys
${DEVPATH}/macaddress
34 # There is no eeprom data for 5 GHz wlan in "art" partition
35 # which would allow to patch the macaddress
36 [ "$PHYNBR" -eq 0 ] && \
37 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
40 # There is no eeprom data for 5 GHz wlan in "art" partition
41 # which would allow to patch the macaddress
42 [ "$PHYNBR" -eq 1 ] && \
43 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
46 # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
47 [ "$PHYNBR" -eq 1 ] && \
48 k2t_get_mac
"lan_mac" > /sys
${DEVPATH}/macaddress
51 mtd_get_mac_ascii cfg1 RADIOADDR
${PHYNBR} > /sys
${DEVPATH}/macaddress
54 # set the 2.4G interface mac address to LAN MAC
55 [ "$PHYNBR" -eq 1 ] && \
56 mtd_get_mac_text mac
4 > /sys
${DEVPATH}/macaddress
57 # set the 5G interface mac address to WAN MAC + 1
58 [ "$PHYNBR" -eq 0 ] && \
59 macaddr_add
"$(mtd_get_mac_text mac 0x18)" 1 > /sys
${DEVPATH}/macaddress
62 # Set mac address for 2.4g device
63 [ "$PHYNBR" -eq 1 ] && \
64 mtd_get_mac_ascii u-boot-env ethaddr
> /sys
${DEVPATH}/macaddress