5a692c4fa077077b583033b31b4349591c63c3ee
[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/uci-defaults.sh
8 . /lib/functions/lantiq.sh
9
10 board_config_update
11
12 led_wifi="$(lantiq_get_dt_led wifi)"
13 [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
14
15 led_usb="$(lantiq_get_dt_led usb)"
16 [ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
17
18 led_usb2="$(lantiq_get_dt_led usb2)"
19 [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
20
21 led_dsl="$(lantiq_get_dt_led dsl)"
22 [ -n "$led_dsl" ] && {
23 interface="nas0"
24 lantiq_is_vdsl_system && interface="dsl0"
25
26 led_internet="$(lantiq_get_dt_led internet)"
27 if [ -n "$led_internet" ]; then
28 ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0"
29 ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan"
30 else
31 ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "$interface"
32 fi
33 }
34
35 board=$(board_name)
36
37 case "$board" in
38 ALL0333CJ)
39 ucidef_set_led_netdev "lan" "lan" "all0333cj:green:lan" "eth0.1"
40 ;;
41 ARV4525PW)
42 ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0"
43 ;;
44 ARV7506PW11)
45 ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio"
46 ;;
47 ARV7519RW22)
48 ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
49 ;;
50 ARV752DPW22)
51 ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
52 ;;
53 BTHOMEHUBV5A)
54 ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
55 ;;
56 DM200)
57 ucidef_set_led_netdev "lan" "lan" "dm200:green:lan" "eth0"
58 ;;
59 FRITZ7320)
60 ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0"
61 ;;
62 P2812HNUF*)
63 ucidef_set_led_wlan "wifi" "wifi" "p2812hnufx:green:wlan" "phy0radio"
64 ;;
65 VGV7510KW22*)
66 ucidef_set_led_wlan "wifi" "wifi" "vgv7510kw22:green:wlan" "phy0radio"
67 ;;
68 VGV7519*)
69 ucidef_set_led_wlan "wifi" "wifi" "vgv7519:green:wireless" "phy0radio"
70 ;;
71 WBMR300)
72 ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08"
73 ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04"
74 ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10"
75 ucidef_set_led_switch "lan3" "LAN3" "wbmr300:green:lan3" "switch0" "0x20"
76 ucidef_set_led_default "router" "router" "wbmr300:green:router" "1"
77 ;;
78 *)
79 ;;
80 esac
81
82 board_config_flush
83
84 exit 0