lantiq: complete AVM FRITZ!Box 3370 support
[openwrt/openwrt.git] / target / linux / lantiq / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2015 OpenWrt.org
4 # based on ar71xx
5 #
6
7 . /lib/functions/leds.sh
8 . /lib/functions/uci-defaults.sh
9
10 board_config_update
11
12 led_wifi="$(get_dt_led wifi)"
13 [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
14
15 led_usb="$(get_dt_led usb)"
16 [ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
17
18 led_usb2="$(get_dt_led usb2)"
19 [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
20
21 led_dsl="$(get_dt_led dsl)"
22 [ -n "$led_dsl" ] && {
23 led_internet="$(get_dt_led internet)"
24 if [ -n "$led_internet" ]; then
25 ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0"
26 ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan"
27 else
28 ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0"
29 fi
30 }
31
32 board=$(board_name)
33
34 case "$board" in
35 allnet,all0333cj)
36 ucidef_set_led_netdev "lan" "lan" "all0333cj:green:lan" "eth0.1"
37 ;;
38 arcadyan,arv4525pw)
39 ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0"
40 ;;
41 arcadyan,arv7506pw11)
42 ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio"
43 ;;
44 arcadyan,arv7519rw22)
45 ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
46 ;;
47 arcadyan,arv752dpw22)
48 ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
49 ;;
50 bt,homehub-v5a)
51 ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
52 ;;
53 netgear,dm200)
54 ucidef_set_led_netdev "lan" "lan" "dm200:green:lan" "eth0"
55 ;;
56 avm,fritz3370-rev2-hynix|\
57 avm,fritz3370-rev2-micron)
58 ucidef_set_led_switch "lan" "LAN" "fritz3370:green:lan" "switch0" "0x17"
59 ;;
60 avm,fritz7320)
61 ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0"
62 ;;
63 zyxel,p-2812hnu-f1|\
64 zyxel,p-2812hnu-f3)
65 ucidef_set_led_wlan "wifi" "wifi" "p2812hnufx:green:wlan" "phy0radio"
66 ;;
67 arcadyan,vgv7510kw22-nor|\
68 arcadyan,vgv7510kw22-brn)
69 ucidef_set_led_wlan "wifi" "wifi" "vgv7510kw22:green:wlan" "phy0radio"
70 ;;
71 arcadyan,vgv7519-nor|\
72 arcadyan,vgv7519-brn)
73 ucidef_set_led_wlan "wifi" "wifi" "vgv7519:green:wireless" "phy0radio"
74 ;;
75 buffalo,wbmr-300hpd)
76 ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08"
77 ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04"
78 ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10"
79 ucidef_set_led_switch "lan3" "LAN3" "wbmr300:green:lan3" "switch0" "0x20"
80 ucidef_set_led_default "router" "router" "wbmr300:green:router" "1"
81 ;;
82 *)
83 ;;
84 esac
85
86 board_config_flush
87
88 exit 0