ar71xx: set mib-poll-interval on devices with ar8xxx switch
authorPetr Štetiar <ynezz@true.cz>
Fri, 17 May 2019 08:56:33 +0000 (10:56 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 May 2019 19:19:48 +0000 (21:19 +0200)
Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which are using
ar8xxx switch LEDs trigger, as the same value was set for built in
switches in 443fc9ac35 ("ath79: use ar8216 for builtin switch").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/ar71xx/base-files/etc/board.d/02_network

index 79f9e5505e57d353afa02f9eb61431d0ecfedc64..1fcfa43c4b5aaba2cc5c41652797f711c45b5248 100755 (executable)
@@ -651,10 +651,60 @@ ar71xx_setup_macs()
        [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
 }
 
+ar71xx_setup_ar8xxx_switch()
+{
+       local board="$1"
+
+       case $board in
+       ap147-010|\
+       archer-c25-v1|\
+       archer-c58-v1|\
+       archer-c59-v1|\
+       archer-c59-v2|\
+       archer-c60-v1|\
+       archer-c60-v2|\
+       archer-c7-v4|\
+       archer-c7-v5|\
+       cf-e375ac|\
+       cf-e385ac|\
+       cr3000|\
+       dhp-1565-a1|\
+       mynet-n600|\
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uas-2hnd|\
+       rb-2011uias|\
+       rb-2011uias-2hnd|\
+       rb-2011uias-2hnd-r2|\
+       rb-750|\
+       rb-750p-pbr2|\
+       rb-750-r2|\
+       rb-750up-r2|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd|\
+       rb-map-2nd|\
+       tl-wr1043nd-v4|\
+       tl-wr1043n-v5|\
+       wndr3700v4|\
+       wndr3700v4|\
+       wndr4300|\
+       wnr1000-v2|\
+       wnr2000-v3|\
+       wnr2200|\
+       wnr612-v2|\
+       wpn824n)
+               ucidef_set_ar8xxx_switch_mib "switch0" 0 500
+               ;;
+       esac
+}
+
 board_config_update
 board=$(board_name)
 ar71xx_setup_interfaces $board
 ar71xx_setup_macs $board
+ar71xx_setup_ar8xxx_switch $board
 board_config_flush
 
 exit 0