OpenWrt – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #!/bin/sh |
2 | # |
||
3 | # Copyright (c) 2015 The Linux Foundation. All rights reserved. |
||
4 | # Copyright (c) 2011-2015 OpenWrt.org |
||
5 | # |
||
6 | |||
7 | . /lib/functions/uci-defaults.sh |
||
8 | . /lib/functions/system.sh |
||
9 | |||
10 | ipq40xx_setup_interfaces() |
||
11 | { |
||
12 | local board="$1" |
||
13 | |||
14 | case "$board" in |
||
15 | 8dev,jalapeno|\ |
||
16 | alfa-network,ap120c-ac) |
||
17 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
||
18 | ;; |
||
19 | asus,map-ac2200|\ |
||
20 | openmesh,a42|\ |
||
21 | openmesh,a62) |
||
22 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
||
23 | ;; |
||
24 | asus,rt-ac58u|\ |
||
25 | zyxel,nbg6617) |
||
26 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
||
27 | ucidef_add_switch "switch0" \ |
||
28 | "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" |
||
29 | ;; |
||
30 | avm,fritzbox-4040|\ |
||
31 | linksys,ea6350v3) |
||
32 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
||
33 | ucidef_add_switch "switch0" \ |
||
34 | "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" |
||
35 | ;; |
||
36 | avm,fritzbox-7530) |
||
37 | ucidef_add_switch "switch0" \ |
||
38 | "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" |
||
39 | ;; |
||
40 | compex,wpj428) |
||
41 | ucidef_set_interface_lan "eth0 eth1" |
||
42 | ;; |
||
43 | engenius,eap1300|\ |
||
44 | meraki,mr33|\ |
||
45 | netgear,ex6100v2|\ |
||
46 | netgear,ex6150v2|\ |
||
47 | zyxel,wre6606) |
||
48 | ucidef_set_interface_lan "eth0" |
||
49 | ;; |
||
50 | glinet,gl-b1300) |
||
51 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
||
52 | ucidef_add_switch "switch0" \ |
||
53 | "0u@eth0" "3:lan" "4:lan" |
||
54 | ;; |
||
55 | qxwlan,e2600ac-c1 |\ |
||
56 | qxwlan,e2600ac-c2) |
||
57 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
||
58 | ucidef_add_switch "switch0" \ |
||
59 | "0u@eth0" "3:lan" "4:lan" "0u@eth1" "5:wan" |
||
60 | ;; |
||
61 | *) |
||
62 | echo "Unsupported hardware. Network interfaces not initialized" |
||
63 | ;; |
||
64 | esac |
||
65 | } |
||
66 | |||
67 | ipq40xx_setup_macs() |
||
68 | { |
||
69 | local board="$1" |
||
70 | |||
71 | case "$board" in |
||
72 | asus,rt-ac58u) |
||
73 | CI_UBIPART=UBI_DEV |
||
74 | wan_mac=$(mtd_get_mac_binary_ubi Factory 20486) |
||
75 | lan_mac=$(mtd_get_mac_binary_ubi Factory 4102) |
||
76 | ;; |
||
77 | linksys,ea6350v3) |
||
78 | wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) |
||
79 | lan_mac=$(macaddr_add "$wan_mac" 1) |
||
80 | ;; |
||
81 | esac |
||
82 | |||
83 | [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac |
||
84 | [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac |
||
85 | } |
||
86 | |||
87 | board_config_update |
||
88 | board=$(board_name) |
||
89 | ipq40xx_setup_interfaces $board |
||
90 | ipq40xx_setup_macs $board |
||
91 | board_config_flush |
||
92 | |||
93 | exit 0 |