8c8b7932bc60e7cc5ccdf698d74f067965847483
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 # There is no eeprom data for 5 GHz wlan in "art" partition
22 # which would allow to patch the macaddress
23 [ "$PHYNBR" -eq 0 ] && \
24 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
27 # There is no eeprom data for 5 GHz wlan in "art" partition
28 # which would allow to patch the macaddress
29 [ "$PHYNBR" -eq 1 ] && \
30 macaddr_add
"$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys
${DEVPATH}/macaddress
33 # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
34 [ "$PHYNBR" -eq 1 ] && \
35 k2t_get_mac
"lan_mac" > /sys
${DEVPATH}/macaddress
38 # set the 2.4G interface mac address to LAN MAC
39 [ "$PHYNBR" -eq 1 ] && \
40 mtd_get_mac_text mac
4 > /sys
${DEVPATH}/macaddress
41 # set the 5G interface mac address to WAN MAC + 1
42 [ "$PHYNBR" -eq 0 ] && \
43 macaddr_add
"$(mtd_get_mac_text mac 0x18)" 1 > /sys
${DEVPATH}/macaddress