01_leds 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2011 OpenWrt.org
  4. # based on ar71xx
  5. #
  6. . /lib/functions/uci-defaults.sh
  7. . /lib/functions/lantiq.sh
  8. [ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tpt"
  9. [ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1"
  10. [ -e "/sys/class/leds/usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "usb2" "2-1"
  11. [ -e "/sys/class/leds/internet" ] && ucidef_set_led_netdev "internet" "internet" "internet" "pppoe-wan"
  12. board=$(lantiq_board_name)
  13. case "$board" in
  14. VG3503J)
  15. ucidef_set_led_netdev "vdsl" "vdsl" "bt:green:dsl" "ptm0"
  16. ;;
  17. BTHOMEHUBV2B)
  18. ucidef_set_led_default "power" "power" "soc:blue:power" "1"
  19. # ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0radio"
  20. ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0tpt"
  21. ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" "pppoa-wan"
  22. ucidef_set_led_usbdev "usb" "usb" "soc:blue:phone" "1-1"
  23. ;;
  24. BTHOMEHUBV3A)
  25. ucidef_set_led_default "power" "power" "soc:blue:power" "1"
  26. ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0tpt"
  27. ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" "pppoa-wan"
  28. ;;
  29. TDW8970)
  30. ucidef_set_led_wlan "wifi" "wifi" "ath9k-phy0" "phy0tpt"
  31. ;;
  32. VGV7510KW22)
  33. ucidef_set_led_default "power" "power" "power" "1"
  34. ucidef_set_led_default "power2" "power2" "power2" "0"
  35. ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0radio"
  36. ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
  37. ucidef_set_led_netdev "internet_green" "internet_green" "internet_green" "pppoe-wan"
  38. ;;
  39. VGV7519)
  40. ucidef_set_led_default "power" "power" "power" "0"
  41. ucidef_set_led_default "power2" "power2" "power2" "1"
  42. ucidef_set_led_wlan "wireless_yellow" "wireless_yellow" "wireless_yellow" "phy0radio"
  43. ucidef_set_led_netdev "internet_yellow" "internet_yellow" "internet_yellow" "nas0"
  44. ucidef_set_led_netdev "broadband_yellow" "broadband_yellow" "broadband_yellow" "pppoe-wan"
  45. ;;
  46. P2812HNUF*)
  47. ucidef_set_led_default "power" "power" "power" "0"
  48. ucidef_set_led_default "power2" "power2" "power2" "1"
  49. ucidef_set_led_wlan "wireless_green" "wireless_green" "wireless_green" "phy0radio"
  50. ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
  51. ucidef_set_led_netdev "internet_green" "internet_green" "internet_green" "pppoe-wan"
  52. ;;
  53. ARV7519RW22)
  54. ucidef_set_led_default "power" "power" "power" "1"
  55. ucidef_set_led_netdev "internet_green" "internet_green" "internet_green" "pppoe-wan"
  56. ucidef_set_led_netdev "lan" "lan" "lan" "eth0.1"
  57. ;;
  58. *)
  59. ;;
  60. esac
  61. for a in `ls /sys/class/leds/`; do
  62. grep -q "\[none\]" /sys/class/leds/$a/trigger
  63. [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness`
  64. done
  65. ucidef_commit_leds
  66. exit 0