01_leds 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2011-2015 OpenWrt.org
  4. # based on ar71xx
  5. #
  6. . /lib/functions/uci-defaults.sh
  7. . /lib/functions/lantiq.sh
  8. board_config_update
  9. led_wifi="$(lantiq_get_dt_led wifi)"
  10. [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
  11. led_usb="$(lantiq_get_dt_led usb)"
  12. [ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
  13. led_usb2="$(lantiq_get_dt_led usb2)"
  14. [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
  15. led_internet="$(lantiq_get_dt_led internet)"
  16. [ -n "$led_internet" ] && {
  17. interface="nas0"
  18. lantiq_is_vdsl_system && interface="ptm0"
  19. led_dsl="$(lantiq_get_dt_led dsl)"
  20. [ -n "$led_dsl" ] && {
  21. interface="pppoe-wan"
  22. ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0"
  23. }
  24. ucidef_set_led_netdev "internet" "internet" "$led_internet" "$interface"
  25. }
  26. board=$(board_name)
  27. case "$board" in
  28. ARV4525PW)
  29. ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0"
  30. ;;
  31. ARV7506PW11)
  32. ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio"
  33. ;;
  34. ARV7519RW22)
  35. ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
  36. ;;
  37. ARV752DPW22)
  38. ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
  39. ;;
  40. BTHOMEHUBV5A)
  41. ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
  42. ;;
  43. FRITZ7320)
  44. ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0"
  45. ;;
  46. P2812HNUF*)
  47. ucidef_set_led_wlan "wifi" "wifi" "p2812hnufx:green:wlan" "phy0radio"
  48. ;;
  49. VGV7510KW22*)
  50. ucidef_set_led_wlan "wifi" "wifi" "vgv7510kw22:green:wlan" "phy0radio"
  51. ;;
  52. VGV7519*)
  53. ucidef_set_led_wlan "wifi" "wifi" "vgv7519:green:wireless" "phy0radio"
  54. ;;
  55. WBMR300)
  56. ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08"
  57. ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04"
  58. ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10"
  59. ucidef_set_led_switch "lan3" "LAN3" "wbmr300:green:lan3" "switch0" "0x20"
  60. ucidef_set_led_default "router" "router" "wbmr300:green:router" "1"
  61. ;;
  62. *)
  63. ;;
  64. esac
  65. board_config_flush
  66. exit 0