brcm47xx: fix switch handling
[openwrt/staging/yousong.git] / target / linux / brcm47xx / base-files / lib / preinit / 05_init_interfaces_brcm
index ac18e0baf2132da2e43668c1c889e63b0d80bb35..76382e5ceebaeef2b8636d81fe6d55be81e3ec8d 100644 (file)
@@ -11,7 +11,17 @@ set_preinit_iface() {
                "ASUS (unknown, BCM4702)") ifname=eth1;;
                "Sitecom WL-105b") ifname=eth1;;
        esac
+
+       # The interface has to be up to configure the switch
        ifconfig $ifname 0.0.0.0 up
+       [ -f /lib/modules/`uname -r`/switch-robo.ko ] && {
+               rmmod switch-robo
+               insmod switch-robo
+       }
+       [ -f /lib/modules/`uname -r`/switch-adm.ko ] && {
+               rmmod switch-adm
+               insmod switch-adm
+       }
 }
 
 init_iface() {