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