1 [ "$ACTION" == "add" ] || exit 0
3 PHYNBR=${DEVPATH##*/phy}
5 [ -n $PHYNBR ] || exit 0
8 . /lib/functions/system.sh
15 addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
16 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
17 # addresses on multiple VIFs with the other radio. Set LA bit and increment
18 # mac-address instead.
19 [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
20 [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
23 addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
24 [ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
25 [ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
28 addr=$(mtd_get_mac_binary bdinfo 0xde00)
29 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
30 # addresses on multiple VIFs with the other radio. Set LA bit and increment
31 # mac-address instead.
32 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
33 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
36 addr=$(mtd_get_mac_ascii factory lanMac)
37 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
38 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
43 [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress
46 addr=$(mtd_get_mac_binary "Factory" 0x4)
47 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress