01_leds 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. #!/bin/sh
  2. . /lib/functions/uci-defaults-new.sh
  3. . /lib/ramips.sh
  4. set_usb_led() {
  5. ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
  6. }
  7. set_wifi_led() {
  8. ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
  9. }
  10. board=$(ramips_board_name)
  11. board_config_update
  12. case $board in
  13. 3g-6200n)
  14. set_wifi_led "edimax:amber:wlan"
  15. set_usb_led "edimax:blue:3g"
  16. ;;
  17. 3g-6200nl)
  18. set_wifi_led "edimax:green:wlan"
  19. ;;
  20. 3g150b |\
  21. 3g300m)
  22. set_usb_led "tenda:blue:3g"
  23. ;;
  24. ai-br100)
  25. ucidef_set_led_netdev "wan" "wan" "aigale:blue:wan" "eth0.2"
  26. set_wifi_led "aigale:blue:wlan"
  27. ;;
  28. a5-v11)
  29. ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
  30. ;;
  31. air3gii)
  32. set_wifi_led "airlive:green:wlan"
  33. set_usb_led "airlive:green:mobile"
  34. ;;
  35. all0256n)
  36. ucidef_set_rssimon "wlan0" "40000" "1"
  37. ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
  38. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
  39. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
  40. set_wifi_led "rt2800pci-phy0::radio"
  41. ;;
  42. ar670w|\
  43. ar725w|\
  44. awapn2403)
  45. set_wifi_led "rt2800soc-phy0::radio"
  46. ;;
  47. asl26555)
  48. ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
  49. ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
  50. set_wifi_led "asl26555:green:wlan"
  51. set_usb_led "asl26555:green:3g"
  52. ;;
  53. bc2)
  54. set_usb_led "bc2:blue:usb"
  55. ;;
  56. br6425)
  57. set_wifi_led "edimax:orange:wlan"
  58. ;;
  59. br-6475nd)
  60. set_wifi_led "edimax:amber:wlan"
  61. ;;
  62. broadway)
  63. set_usb_led "red:diskmounted"
  64. set_wifi_led "red:wps_active"
  65. ;;
  66. br6524n)
  67. set_wifi_led "edimax:blue:wlan"
  68. ;;
  69. cf-wr800n)
  70. ucidef_set_led_netdev "lan" "lan" "comfast:white:ethernet" eth0.1
  71. set_wifi_led "comfast:white:wifi"
  72. ;;
  73. cy-swr1100)
  74. ucidef_set_led_default "wps" "WPS" "samsung:blue:wps" "0"
  75. set_usb_led "samsung:blue:usb"
  76. ;;
  77. d105)
  78. ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
  79. set_usb_led "d105:green:usb"
  80. ;;
  81. dcs-930l-b1)
  82. ucidef_set_led_default "power" "POWER" "d-link:red:power" "1"
  83. ucidef_set_led_netdev "wifi" "WiFi" "d-link:blue:wps"
  84. ;;
  85. dir-300-b1|\
  86. dir-600-b1|\
  87. dir-600-b2|\
  88. dir-620-a1)
  89. # ANDed with vlan switch port 4 led state
  90. ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
  91. set_wifi_led "rt2800pci-phy0::radio"
  92. ;;
  93. dir-615-d|\
  94. dir-615-h1)
  95. ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
  96. set_wifi_led "rt2800pci-phy0::radio"
  97. ;;
  98. dir-620-d1)
  99. set_wifi_led "d-link:green:wifi"
  100. ;;
  101. dir-810l)
  102. ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
  103. ;;
  104. dir-610-a1 |\
  105. dir-300-b7 |\
  106. dir-320-b1 |\
  107. esr-9753)
  108. set_wifi_led "rt2800pci-phy0::radio"
  109. ;;
  110. ex2700)
  111. ucidef_set_led_default "power_r" "POWER (red)" "ex2700:red:power" "0"
  112. set_wifi_led "ex2700:green:router"
  113. ;;
  114. f5d8235-v1)
  115. set_usb_led "f5d8235-v1:blue:storage"
  116. ;;
  117. f5d8235-v2)
  118. set_usb_led "f5d8235v2:blue:storage"
  119. ;;
  120. fonera20n)
  121. set_usb_led "fonera20n:orange:usb"
  122. set_wifi_led "fonera20n:orange:wifi"
  123. ;;
  124. hlk-rm04)
  125. set_wifi_led "rt2800pci-phy0::radio"
  126. ;;
  127. ht-tm02)
  128. ucidef_set_led_netdev "eth" "Ethernet" "ht-tm02:green:lan" "eth0"
  129. set_wifi_led "ht-tm02:blue:wlan"
  130. ;;
  131. all0239-3g|\
  132. hw550-3g)
  133. set_usb_led "hw550-3g:green:usb"
  134. ;;
  135. mlw221|\
  136. mlwg2)
  137. set_wifi_led "kingston:blue:wifi"
  138. ucidef_set_led_default "system" "system" "kingston:blue:system" "1"
  139. ;;
  140. mofi3500-3gn)
  141. set_usb_led "mofi3500-3gn:green:usb"
  142. ;;
  143. mpr-a1)
  144. set_wifi_led "hame:blue:system"
  145. ;;
  146. mpr-a2)
  147. set_wifi_led "hame:blue:system"
  148. ;;
  149. mr-102n)
  150. set_wifi_led "mr-102n:green:wlan"
  151. set_usb_led "mr-102n:green:usb"
  152. ;;
  153. mzk-w300nh2)
  154. set_wifi_led "mzkw300nh2:amber:wlan"
  155. ;;
  156. na930)
  157. set_usb_led "na930:blue:status"
  158. ;;
  159. nw718)
  160. set_usb_led "nw718:amber:usb"
  161. ;;
  162. m2m)
  163. set_wifi_led "m2m:blue:wifi"
  164. ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
  165. ;;
  166. omni-emb-hpm)
  167. ucidef_set_led_default "power" "POWER" "emb:orange:power" "1"
  168. ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0"
  169. set_wifi_led "emb:green:wifi"
  170. ;;
  171. omni-plug)
  172. set_wifi_led "miniplug:green:wlan"
  173. set_usb_led "miniplug:green:mobile"
  174. ;;
  175. px4885)
  176. set_wifi_led "7links:orange:wifi"
  177. set_usb_led "7links:blue:storage"
  178. ;;
  179. pbr-m1)
  180. ucidef_set_led_netdev "internet" "internet" "pbr-m1:green:internet" "eth0.2"
  181. ucidef_set_led_default "power" "power" "pbr-m1:green:power" "1"
  182. ucidef_set_led_default "sys" "sys" "pbr-m1:green:sys" "1"
  183. ;;
  184. sl-r7205)
  185. set_wifi_led "rt2800pci-phy0::radio"
  186. ;;
  187. v11st-fe)
  188. set_wifi_led "rt2800pci-phy0::radio"
  189. ;;
  190. vocore)
  191. ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
  192. set_wifi_led "vocore:green:status"
  193. ;;
  194. w306r-v20)
  195. set_wifi_led "rt2800pci-phy0::radio"
  196. ;;
  197. w502u)
  198. set_usb_led "alfa:blue:usb"
  199. set_wifi_led "rt2800pci-phy0::radio"
  200. ;;
  201. wcr-150gn)
  202. set_usb_led "wcr150gn:amber:user"
  203. ;;
  204. hg255d)
  205. set_wifi_led "hg255d:wlan"
  206. set_usb_led "hg255d:usb"
  207. ucidef_set_led_interface "lan" "hg255d:internet"
  208. ;;
  209. wnce2001)
  210. set_wifi_led "netgear:green:wlan"
  211. ;;
  212. re6500)
  213. ucidef_set_led_default "power" "power" "linksys:white:power" "1"
  214. ucidef_set_led_default "wifi" "wifi" "linksys:orange:wifi" "1"
  215. ;;
  216. rt-n14u)
  217. ucidef_set_led_default "power" "power" "asus:blue:power" "1"
  218. ucidef_set_led_netdev "lan" "lan" "asus:blue:lan" eth0.1
  219. ucidef_set_led_netdev "wan" "wan" "asus:blue:wan" eth0.2
  220. set_wifi_led "asus:blue:air"
  221. set_usb_led "asus:blue:usb"
  222. ;;
  223. rp-n53)
  224. ucidef_set_led_netdev "eth" "Network" "asus:white:back" "eth0"
  225. set_wifi_led "asus:blue:wifi"
  226. ;;
  227. whr-300hp2 |\
  228. whr-600d |\
  229. whr-1166d)
  230. ucidef_set_led_default "power" "power" "buffalo:green:power" "1"
  231. ucidef_set_led_default "router" "router" "buffalo:green:router" "1"
  232. ;;
  233. zbt-wa05)
  234. ucidef_set_led_default "power" "power" "zbtlink:blue:power" "1"
  235. set_wifi_led "zbtlink:blue:air"
  236. set_usb_led "zbtlink:blue:usb"
  237. ;;
  238. wr8305rt)
  239. ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
  240. set_usb_led "wr8305rt:usb"
  241. set_wifi_led "wr8305rt:wifi"
  242. ;;
  243. wt1520)
  244. set_wifi_led "rt2800pci-phy0::radio"
  245. ;;
  246. wt3020)
  247. ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
  248. ;;
  249. xiaomi-miwifi-mini)
  250. ucidef_set_led_default "power" "power" "xiaomi:red:status" "1"
  251. ;;
  252. y1 |\
  253. y1s)
  254. ucidef_set_led_default "power" "power" "lenovo:blue:power" "1"
  255. set_usb_led "lenovo:blue:usb"
  256. set_wifi_led "lenovo:blue:wifi"
  257. ;;
  258. zbt-wg2626)
  259. ucidef_set_led_default "power" "power" "zbt-wg2626:green:power" "1"
  260. set_wifi_led "zbt-wg2626:green:air"
  261. set_usb_led "zbt-wg2626:green:usb"
  262. ;;
  263. zte-q7)
  264. set_wifi_led "zte:blue:status"
  265. ;;
  266. esac
  267. board_config_flush
  268. exit 0