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 pdt_data_1 ethaddr)
37 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
38 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
41 addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
42 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
43 [ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress
46 hw_mac_addr=$(mtd_get_mac_ascii u-boot-env mac)
47 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
48 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
51 addr=$(mtd_get_mac_ascii factory lanMac)
52 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
53 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
58 [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress
61 addr=$(mtd_get_mac_binary "Factory" 0x4)
62 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
65 hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)"
66 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
67 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress