04992dee16311e76685943b29713c3b7743ffbb7
[openwrt/staging/wigyori.git] / target / linux / brcm47xx / base-files / lib / preinit / 05_init_interfaces_brcm
1 #!/bin/sh
2
3 set_preinit_iface() {
4 ifname=eth0
5
6 insmod diag
7 insmod hwmon
8 insmod pps_core
9 insmod ptp
10 insmod tg3
11 insmod b44
12 insmod bgmac
13
14 # hardware specific overrides
15 case "$(cat /proc/diag/model)" in
16 "Linksys WAP54G V1") ifname=eth1;;
17 "ASUS WL-HDD") ifname=eth1;;
18 "ASUS WL-300g") ifname=eth1;;
19 "ASUS (unknown, BCM4702)") ifname=eth1;;
20 "Sitecom WL-105b") ifname=eth1;;
21 esac
22 ifconfig $ifname 0.0.0.0 up
23 }
24
25 init_iface() {
26 [ -d /proc/switch/eth0 ] && [ "$ifname" = "eth0" ] && {
27 case "$(cat /proc/switch/eth0/cpuport)" in
28 "5") cpu_port="5u*";;
29 "8") cpu_port="8u*";;
30 esac
31 }
32 }
33
34 boot_hook_add preinit_main set_preinit_iface
35 boot_hook_add preinit_main init_iface