brcm47xx: load pps_core and ptp before tg3 to make the interface available for failsafe.
[openwrt.git] / target / linux / brcm47xx / base-files / lib / preinit / 05_init_interfaces_brcm
index 6d43217..fd2a935 100644 (file)
@@ -4,6 +4,12 @@ set_preinit_iface() {
        ifname=eth0
 
        insmod diag
+       insmod hwmon
+       insmod pps_core
+       insmod ptp
+       insmod tg3
+       insmod b44
+       insmod bgmac
 
        # hardware specific overrides
        case "$(cat /proc/diag/model)" in
@@ -21,13 +27,11 @@ check_module () {
 
   insmod "$module" "$params"
   sleep 1
-  grep "^$module" /proc/modules > /dev/null
+  grep -q ^"$module " /proc/modules
   return $?
 }
 
 init_iface() {
-       check_module hwmon
-       check_module tg3
        insmod switch-core
        check_module switch-robo || check_module switch-adm  || {
          check_module bcm57xx activate_gpio=0x4 && cpu_port="8u*"