brcm63xx: move preinit ifname detection to the preinit script
[openwrt.git] / target / linux / brcm63xx / base-files / lib / preinit / 05_init_interfaces_brcm63xx
index b7cbecd..a8bf6c6 100644 (file)
@@ -1,26 +1,46 @@
 #!/bin/sh
 
-set_preinit_iface() {
-       ifname=eth1
-
-       . /lib/brcm63xx.sh      
-
-       ifconfig $ifname 0.0.0.0 up
-}
+. /lib/brcm63xx.sh
 
-check_module () {
-  module="$1"; shift; params="$*"
-
-  insmod "$module" "$params"
-  sleep 1
-  grep "^$module" /proc/modules
-  return $?
-}
-
-init_iface() {
-       insmod switch-core
-       check_module switch-robo || check_module switch-adm || rmmod switch-core
+set_preinit_iface() {
+       case "$(brcm63xx_board_name)" in
+       a4001n |\
+       a4001n1 |\
+       ar-5381u |\
+       ar-5387un |\
+       bcm963281tan |\
+       bcm96328avng |\
+       cpva642 |\
+       ct536_ct5621 |\
+       cvg834g |\
+       dgnd3700v1_dgnd3800b |\
+       dsl-2640b-b |\
+       dsl-274xb-c |\
+       dsl-275xb-d |\
+       fast2504n |\
+       fast2704v2 |\
+       hg553 |\
+       hg556a_* |\
+       hg520 |\
+       neufbox6 |\
+       p870hw-51a_v2 |\
+       rta770bw |\
+       rta770w |\
+       spw303v |\
+       spw500v |\
+       v2110 |\
+       vr-3025un |\
+       vr-3025u |\
+       wap-5813n)
+               ifname=eth0
+               ;;
+       bcm96348gw |\
+       bcm96348gw-11 |\
+       gw6000 |\
+       gw6200)
+               ifname=eth1
+               ;;
+       esac
 }
 
 boot_hook_add preinit_main set_preinit_iface
-boot_hook_add preinit_main init_iface