[ramips] add profile for the Edimax 3g-6200NL board
[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/functions.sh
9         . /lib/ramips.sh
10
11         case $(ramips_board_name) in
12         3g-6200n |\
13         3g-6200nl |\
14         3g300m | \
15         mzk-w300nh2 |\
16         wl-330n |\
17         wl-330n3g)
18                 mac=$(mtd_get_mac_binary factory 4)
19                 ifconfig eth0 hw ether $mac 2>/dev/null
20                 ;;
21         bc2 |\
22         broadway |\
23         dir-620-a1 |\
24         esr-9753 |\
25         freestation5 |\
26         nw718 |\
27         psr-680w |\
28         rt-n56u |\
29         sl-r7205)
30                 mac=$(mtd_get_mac_binary factory 4)
31                 mac=$(macaddr_setbit_la "$mac")
32                 ifconfig eth0 hw ether $mac 2>/dev/null
33                 ;;
34         dir-300-b1 |\
35         dir-300-b2 |\
36         dir-600-b1)
37                 mac=$(mtd_get_mac_binary devdata 16388)
38                 ifconfig eth0 hw ether $mac 2>/dev/null
39                 ;;
40         dir-645)
41                 mac=$(mtd_get_mac_ascii nvram lanmac)
42                 mac=$(macaddr_setbit_la "$mac")
43                 ifconfig eth0 hw ether $mac 2>/dev/null
44                 ;;
45         dap-1350)
46                 mac=$(mtd_get_mac_binary devdata 46)
47                 ifconfig eth0 hw ether $mac 2>/dev/null
48                 ;;
49         all0239-3g |\
50         all0256n |\
51         all5002 |\
52         carambola |\
53         dir-615-h1 |\
54         fonera20n |\
55         rt-n13u |\
56         hw550-3g |\
57         nbg-419n |\
58         omni-emb |\
59         omni-emb-hpm |\
60         tew-691gr |\
61         tew-692gr |\
62         w306r-v20 |\
63         w502u    |\
64         wr6202 |\
65         xdxrn502j)
66                 mac=$(mtd_get_mac_binary factory 40)
67                 ifconfig eth0 hw ether $mac 2>/dev/null
68                 ;;
69         wl341v3)
70                 mac=$(mtd_get_mac_binary board-nvram 65440)
71                 ifconfig eth0 hw ether $mac 2>/dev/null
72                 ;;
73         rt-n10-plus)
74                 mac=$(mtd_get_mac_binary devconf 4)
75                 ifconfig eth0 hw ether $mac 2>/dev/null
76                 ;;
77         esac
78 }
79
80 boot_hook_add preinit_main preinit_set_mac_address