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
22 addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
23 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
24 # addresses on multiple VIFs with the other radio. Set LA bit and increment
25 # mac-address instead.
26 [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
27 [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
30 addr=$(cat /sys/class/net/eth0/address)
31 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
32 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
35 addr=$(mtd_get_mac_binary "art" 0)
36 [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
37 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress
40 case "$(cmdline_get_var root)" in
42 addr=$(mmc_get_mac_binary factory 0xa)
45 addr=$(mtd_get_mac_binary factory 0xa)
48 [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
51 addr=$(mtd_get_mac_binary bdinfo 0xde00)
52 # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
53 # addresses on multiple VIFs with the other radio. Set LA bit and increment
54 # mac-address instead.
55 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
56 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
59 addr=$(mmc_get_mac_binary factory 0x04)
60 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
61 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
64 addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
65 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
66 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
69 # Originally, phy1 is phy0 mac with LA bit set. However, this would conflict
70 # addresses on multiple VIFs with the other radio. Use label mac to set LA bit.
71 [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress
74 addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
75 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
76 [ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress
79 hw_mac_addr=$(mtd_get_mac_ascii u-boot-env mac)
80 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
81 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
84 addr=$(mtd_get_mac_ascii factory lanMac)
85 [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
86 [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
91 [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress
94 addr=$(mtd_get_mac_binary EEPROM 0x6)
95 [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
96 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
101 addr=$(mtd_get_mac_binary "Factory" 0x4)
102 [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
105 hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)"
106 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
107 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress