1 [ "$ACTION" == "add" ] || exit 0
3 PHYNBR=${DEVPATH##*/phy}
5 [ -n $PHYNBR ] || exit 0
8 . /lib/functions/system.sh
14 key_path="/var/qcidata/data"
15 [ "$PHYNBR" = "0" ] && cat $key_path/2gMAC > /sys${DEVPATH}/macaddress
16 [ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress
17 [ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress
21 addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
22 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
23 # addresses on multiple VIFs with the other radio. Set LA bit and increment
24 # mac-address instead.
25 [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
26 [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
29 addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
30 [ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
31 [ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
34 addr=$(mtd_get_mac_binary "art" 0)
35 [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
36 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress
39 addr=$(mtd_get_mac_binary bdinfo 0xde00)
40 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
41 # addresses on multiple VIFs with the other radio. Set LA bit and increment
42 # mac-address instead.
43 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
44 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
47 addr=$(mmc_get_mac_binary factory 0x04)
48 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
49 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
52 addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
53 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
54 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
57 addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
58 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
59 [ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress
62 hw_mac_addr=$(mtd_get_mac_ascii u-boot-env mac)
63 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
64 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
67 addr=$(mtd_get_mac_binary EEPROM 0x6)
68 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
69 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
72 addr=$(mtd_get_mac_ascii factory lanMac)
73 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
74 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
79 [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress
82 addr=$(mtd_get_mac_binary "Factory" 0x4)
83 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
86 hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)"
87 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
88 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress