D-Link DAP-1350 initial support
[openwrt/openwrt.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 3g-6200n)
12 mac=$(ramips_get_mac_binary factory 4)
13 ifconfig eth0 hw ether $mac 2>/dev/null
14 ;;
15 bc2 |\
16 esr-9753 |\
17 freestation5 |\
18 nw718 |\
19 psr-680w |\
20 rt-n56u |\
21 sl-r7205)
22 mac=$(ramips_get_mac_binary factory 4)
23 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
24 ifconfig eth0 hw ether $mac 2>/dev/null
25 ;;
26 dir-300-b1 |\
27 dir-300-b2 |\
28 dir-600-b1)
29 mac=$(ramips_get_mac_binary devdata 16388)
30 ifconfig eth0 hw ether $mac 2>/dev/null
31 ;;
32 dap-1350)
33 mac=$(ramips_get_mac_binary devdata 46)
34 ifconfig eth0 hw ether $mac 2>/dev/null
35 ;;
36 all0256n |\
37 all5002 | \
38 fonera20n |\
39 hw550-3g |\
40 nbg-419n |\
41 omni-emb |\
42 w306r-v20 |\
43 w502u |\
44 wl-330n |\
45 wl-330n3g |\
46 wr6202 |\
47 xdxrn502j)
48 mac=$(ramips_get_mac_binary factory 40)
49 ifconfig eth0 hw ether $mac 2>/dev/null
50 ;;
51 wl341v3)
52 mac=$(ramips_get_mac_binary board-nvram 65440)
53 ifconfig eth0 hw ether $mac 2>/dev/null
54 ;;
55 rt-n10-plus)
56 mac=$(ramips_get_mac_binary devconf 4)
57 ifconfig eth0 hw ether $mac 2>/dev/null
58 ;;
59 esac
60 }
61
62 boot_hook_add preinit_main preinit_set_mac_address