1 [ "$ACTION" == "add" ] || exit 0
3 PHYNBR=${DEVPATH##*/phy}
5 [ -n $PHYNBR ] || exit 0
8 . /lib/functions/system.sh
13 beeline,smartbox-flash|\
15 hw_mac_addr_ra0="$(mtd_get_mac_ascii u-boot-env ra0macaddr)"
16 hw_mac_addr_rax0="$(mtd_get_mac_ascii u-boot-env rax0macaddr)"
17 [ "$PHYNBR" = "0" ] && echo -n $hw_mac_addr_ra0 > /sys${DEVPATH}/macaddress
18 [ "$PHYNBR" = "1" ] && echo -n $hw_mac_addr_rax0 > /sys${DEVPATH}/macaddress
21 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
22 macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress
25 [ "$PHYNBR" = "0" ] && \
26 macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
27 > /sys${DEVPATH}/macaddress
31 if [ "$PHYNBR" = "0" ]; then
32 base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
33 macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
37 [ "$PHYNBR" = "1" ] && \
38 macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
41 label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
42 [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
43 echo -n "$label_mac" > /sys${DEVPATH}/macaddress
44 [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
45 macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
49 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
50 [ "$PHYNBR" = "0" ] && \
51 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 3)" > /sys${DEVPATH}/macaddress
52 [ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
55 if [ "$PHYNBR" = "1" ]; then
56 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
57 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 3)" > /sys${DEVPATH}/macaddress
61 [ "$PHYNBR" = "1" ] && \
62 macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
65 [ "$PHYNBR" = "1" ] && \
66 macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress
75 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
76 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
77 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
80 hw_mac_addr=$(mtd_get_mac_ascii Config mac)
81 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
82 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
85 if [ "$PHYNBR" = "1" ]; then
86 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
87 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 0x100000)" > /sys${DEVPATH}/macaddress
90 raisecom,msg1500-x-00)
91 [ "$PHYNBR" = "0" ] && \
92 macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \
93 > /sys${DEVPATH}/macaddress
96 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
97 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress
99 tplink,eap615-wall-v1)
100 hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"
101 macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress"
104 [ "$PHYNBR" = "1" ] && \
105 macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress
109 hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)"
110 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
111 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress