ramips: rt305x: add support for Edimax 3G-6200N
[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         all0256n |\
33         fonera20n |\
34         hw550-3g |\
35         nbg-419n |\
36         omni-emb |\
37         w306r-v20 |\
38         w502u    |\
39         wl-330n |\
40         wl-330n3g |\
41         wr6202 |\
42         xdxrn502j)
43                 mac=$(ramips_get_mac_binary factory 40)
44                 ifconfig eth0 hw ether $mac 2>/dev/null
45                 ;;
46         wl341v3)
47                 mac=$(ramips_get_mac_binary board-nvram 65440)
48                 ifconfig eth0 hw ether $mac 2>/dev/null
49                 ;;
50         rt-n10-plus)
51                 mac=$(ramips_get_mac_binary devconf 4)
52                 ifconfig eth0 hw ether $mac 2>/dev/null
53                 ;;
54         esac
55 }
56
57 boot_hook_add preinit_main preinit_set_mac_address