1 [ "$ACTION" == "add" ] || exit 0
3 PHYNBR=${DEVPATH##*/phy}
5 [ -n $PHYNBR ] || exit 0
8 . /lib/functions/system.sh
13 beeline,smartbox-flash)
14 hw_mac_addr_ra0="$(mtd_get_mac_ascii u-boot-env ra0macaddr)"
15 hw_mac_addr_rax0="$(mtd_get_mac_ascii u-boot-env rax0macaddr)"
16 [ "$PHYNBR" = "0" ] && echo -n $hw_mac_addr_ra0 > /sys${DEVPATH}/macaddress
17 [ "$PHYNBR" = "1" ] && echo -n $hw_mac_addr_rax0 > /sys${DEVPATH}/macaddress
20 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
21 macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress
24 [ "$PHYNBR" = "0" ] && \
25 macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
26 > /sys${DEVPATH}/macaddress
30 if [ "$PHYNBR" = "0" ]; then
31 base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
32 macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
36 [ "$PHYNBR" = "1" ] && \
37 macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
40 label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
41 [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
42 echo -n "$label_mac" > /sys${DEVPATH}/macaddress
43 [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
44 macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
48 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
49 [ "$PHYNBR" = "0" ] && \
50 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 3)" > /sys${DEVPATH}/macaddress
51 [ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
54 if [ "$PHYNBR" = "1" ]; then
55 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
56 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 3)" > /sys${DEVPATH}/macaddress
60 [ "$PHYNBR" = "1" ] && \
61 macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
64 [ "$PHYNBR" = "1" ] && \
65 macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress
74 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
75 [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
76 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
79 if [ "$PHYNBR" = "1" ]; then
80 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
81 macaddr_setbit_la "$(macaddr_add $hw_mac_addr 0x100000)" > /sys${DEVPATH}/macaddress
84 raisecom,msg1500-x-00)
85 [ "$PHYNBR" = "0" ] && \
86 macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \
87 > /sys${DEVPATH}/macaddress
90 hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
91 [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress
94 [ "$PHYNBR" = "1" ] && \
95 macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress