ramips: rt305x: add support for the Petatel PSR-680W Wireless CDMA Router
[openwrt/svn-archive/archive.git] / target / linux / ramips / base-files / lib / preinit / 06_set_iface_mac
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4
5 preinit_set_mac_address() {
6 local mac
7
8 . /lib/ramips.sh
9
10 case $(ramips_board_name) in
11 bc2 |\
12 esr-9753 |\
13 freestation5 |\
14 nw718 |\
15 psr-680w |\
16 rt-n56u |\
17 sl-r7205)
18 mac=$(ramips_get_mac_binary factory 4)
19 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
20 ifconfig eth0 hw ether $mac 2>/dev/null
21 ;;
22 dir-300-b1 |\
23 dir-300-b2 |\
24 dir-600-b1)
25 mac=$(ramips_get_mac_binary devdata 16388)
26 ifconfig eth0 hw ether $mac 2>/dev/null
27 ;;
28 all0256n |\
29 hw550-3g |\
30 nbg-419n |\
31 omni-emb |\
32 w306r-v20 |\
33 w502u |\
34 wl-330n |\
35 wl-330n3g |\
36 wr6202 |\
37 xdxrn502j)
38 mac=$(ramips_get_mac_binary factory 40)
39 ifconfig eth0 hw ether $mac 2>/dev/null
40 ;;
41 wl341v3)
42 mac=$(ramips_get_mac_binary board-nvram 65440)
43 ifconfig eth0 hw ether $mac 2>/dev/null
44 ;;
45 rt-n10-plus)
46 mac=$(ramips_get_mac_binary devconf 4)
47 ifconfig eth0 hw ether $mac 2>/dev/null
48 ;;
49 esac
50 }
51
52 boot_hook_add preinit_main preinit_set_mac_address