
. /lib/functions/uci-defaults.sh

board_config_update

board=$(board_name)

case "$board" in
buffalo,whr-g301n|\
dlink,dir-615-e4|\
tplink,tl-wr740n-v1|\
tplink,tl-wr740n-v3|\
tplink,tl-wr741-v1|\
tplink,tl-wr743nd-v1|\
tplink,tl-wr841-v5|\
tplink,tl-wr941-v4)
	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
	ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02"
	ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04"
	ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08"
	ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10"
	;;
engenius,enh202-v1)
	ucidef_set_led_switch "lan" "LAN" "amber:lan" "switch0" "0x10"
	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
	ucidef_set_rssimon "wlan0" "200000" "1"
	ucidef_set_led_rssi "rssilow" "RSSILOW" "red:rssilow" "wlan0" "1"  "100"
	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100"
	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "67" "100"
	;;
netgear,wnr1000-v2|\
netgear,wnr2000-v3)
	ucidef_set_led_netdev "wan-amber" "WAN (amber)" "amber:wan" "eth0"
	ucidef_set_led_switch "lan1green" "LAN1 (green)" "green:lan1" "switch0" "0x02" "0x04"
	ucidef_set_led_switch "lan2green" "LAN2 (green)" "green:lan2" "switch0" "0x04" "0x04"
	ucidef_set_led_switch "lan3green" "LAN3 (green)" "green:lan3" "switch0" "0x08" "0x04"
	ucidef_set_led_switch "lan4green" "LAN4 (green)" "green:lan4" "switch0" "0x10" "0x04"
	ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "amber:lan1" "switch0" "0x02" "0x02"
	ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "amber:lan2" "switch0" "0x04" "0x02"
	ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "amber:lan3" "switch0" "0x08" "0x02"
	ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "amber:lan4" "switch0" "0x10" "0x02"
	;;
netgear,wnr612-v2|\
on,n150r)
	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
	ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02" "0x0f"
	ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04" "0x0f"
	;;
tplink,tl-mr3020-v1|\
tplink,tl-mr3040-v2|\
tplink,tl-wa701nd-v1|\
tplink,tl-wa730re-v1|\
tplink,tl-wa801nd-v1|\
tplink,tl-wa801nd-v3|\
tplink,tl-wa801nd-v4|\
tplink,tl-wa830re-v1|\
tplink,tl-wa860re-v1|\
tplink,tl-wa901nd-v1|\
tplink,tl-wa901nd-v3|\
tplink,tl-wa901nd-v4|\
tplink,tl-wa901nd-v5)
	ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
	;;
tplink,tl-mr3420-v2|\
tplink,tl-wr740n-v4|\
tplink,tl-wr740n-v5|\
tplink,tl-wr741nd-v4|\
tplink,tl-wr841-v8|\
tplink,tl-wr941nd-v5)
	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
	ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x04"
	ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08"
	ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x10"
	ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"
	;;
tplink,tl-mr3420-v3|\
tplink,tl-wr841-v9|\
tplink,tl-wr841-v10|\
tplink,tl-wr841-v11|\
tplink,tl-wr841-v12)
	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
	ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10"
	ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08"
	ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04"
	ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"
	;;
tplink,tl-wa850re-v1|\
tplink,tl-wa850re-v2)
	ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
	ucidef_set_rssimon "wlan0" "200000" "1"
	ucidef_set_led_rssi "rssilow" "RSSILOW" "blue:signal1" "wlan0" "1" "100"
	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "blue:signal2" "wlan0" "20" "100"
	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "blue:signal3" "wlan0" "40" "100"
	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "blue:signal4" "wlan0" "60" "100"
	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "blue:signal5" "wlan0" "80" "100"
	;;
tplink,tl-wpa8630p-v2-int|\
tplink,tl-wpa8630p-v2.0-eu|\
tplink,tl-wpa8630p-v2.1-eu)
	ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c"
	;;
tplink,tl-wr940n-v3|\
tplink,tl-wr940n-v4|\
tplink,tl-wr941nd-v6)
	ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
	ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10"
	ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x08"
	ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x04"
	ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x02"
	;;
tplink,tl-wr940n-v6)
	ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
	;;
ubnt,bullet-m-ar7240|\
ubnt,bullet-m-ar7241|\
ubnt,nanobridge-m|\
ubnt,nanostation-loco-m|\
ubnt,nanostation-m|\
ubnt,picostation-m)
	ucidef_set_rssimon "wlan0" "200000" "1"
	ucidef_set_led_rssi "rssilow" "RSSILOW" "red:link1" "wlan0" "1" "100"
	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "orange:link2" "wlan0" "26" "100"
	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:link3" "wlan0" "51" "100"
	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76" "100"
	;;
esac

board_config_flush

exit 0
