01_leds 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #!/bin/sh
  2. . /lib/functions/uci-defaults.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. 3g150b|\
  14. 3g300m)
  15. set_usb_led "$board:blue:3g"
  16. ;;
  17. 3g-6200n)
  18. set_wifi_led "$board:amber:wlan"
  19. set_usb_led "$board:blue:3g"
  20. ;;
  21. 3g-6200nl|\
  22. br-6475nd|\
  23. mzk-w300nh2)
  24. set_wifi_led "$board:amber:wlan"
  25. ;;
  26. a5-v11|\
  27. cs-qr10)
  28. ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
  29. ;;
  30. ai-br100)
  31. ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
  32. set_wifi_led "$board:blue:wlan"
  33. ;;
  34. air3gii)
  35. set_wifi_led "$board:green:wlan"
  36. set_usb_led "$board:green:mobile"
  37. ;;
  38. all0239-3g|\
  39. hw550-3g|\
  40. mofi3500-3gn|\
  41. sap-g3200u3|\
  42. sk-wb8|\
  43. wf-2881)
  44. set_usb_led "$board:green:usb"
  45. ;;
  46. all0256n)
  47. ucidef_set_rssimon "wlan0" "40000" "1"
  48. ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssilow" "wlan0" "1" "40" "0" "6"
  49. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssimed" "wlan0" "30" "80" "-29" "5"
  50. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
  51. set_wifi_led "rt2800pci-phy0::radio"
  52. ;;
  53. ar670w|\
  54. ar725w|\
  55. awapn2403)
  56. set_wifi_led "rt2800soc-phy0::radio"
  57. ;;
  58. asl26555)
  59. ucidef_set_led_default "power" "POWER" "$board:green:power" "1"
  60. ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
  61. set_wifi_led "$board:green:wlan"
  62. set_usb_led "$board:green:3g"
  63. ;;
  64. bc2)
  65. set_usb_led "$board:blue:usb"
  66. ;;
  67. br-6425)
  68. set_wifi_led "$board:orange:wlan"
  69. ;;
  70. broadway)
  71. set_usb_led "$board:red:diskmounted"
  72. set_wifi_led "$board:red:wps_active"
  73. ;;
  74. c50)
  75. ucidef_set_led_default "power" "power" "tp-link:blue:power" "0"
  76. ucidef_set_led_netdev "lan" "lan" "tp-link:blue:lan" "eth0.2"
  77. set_usb_led "tp-link:blue:usb"
  78. ucidef_set_led_wlan "wlan2g" "wlan2g" "tp-link:blue:wlan2g" "phy1radio"
  79. ucidef_set_led_wlan "wlan5g" "wlan5g" "tp-link:blue:wlan5g" "phy0radio"
  80. ;;
  81. cf-wr800n)
  82. ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
  83. set_wifi_led "$board:white:wifi"
  84. ;;
  85. cy-swr1100)
  86. ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
  87. set_usb_led "$board:blue:usb"
  88. ;;
  89. d105)
  90. ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
  91. set_usb_led "$board:green:usb"
  92. ;;
  93. db-wrt01)
  94. ucidef_set_led_default "power" "power" "$board:orange:power" "1"
  95. ;;
  96. dcs-930l-b1)
  97. ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
  98. ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
  99. ;;
  100. dir-300-b1|\
  101. dir-600-b1|\
  102. dir-600-b2|\
  103. dir-620-a1)
  104. ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1"
  105. set_wifi_led "rt2800pci-phy0::radio"
  106. ;;
  107. dir-300-b7|\
  108. dir-320-b1|\
  109. dir-610-a1|\
  110. esr-9753|\
  111. hlk-rm04|\
  112. sl-r7205|\
  113. v11st-fe|\
  114. w306r-v20|\
  115. wt1520)
  116. set_wifi_led "rt2800pci-phy0::radio"
  117. ;;
  118. dir-615-d|\
  119. dir-615-h1)
  120. ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0"
  121. set_wifi_led "rt2800pci-phy0::radio"
  122. ;;
  123. dir-620-d1|\
  124. mzk-ex300np)
  125. set_wifi_led "$board:green:wifi"
  126. ;;
  127. dir-810l|\
  128. mzk-750dhp|\
  129. mzk-dp150n)
  130. ucidef_set_led_default "power" "power" "$board:green:power" "1"
  131. ;;
  132. ex2700)
  133. ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
  134. set_wifi_led "$board:green:router"
  135. ;;
  136. f5d8235-v1|\
  137. f5d8235-v2)
  138. set_usb_led "$board:blue:storage"
  139. ;;
  140. fonera20n)
  141. set_usb_led "$board:orange:usb"
  142. set_wifi_led "$board:orange:wifi"
  143. ;;
  144. gl-mt300a|\
  145. gl-mt300n|\
  146. gl-mt750)
  147. set_wifi_led "$board:wlan"
  148. ;;
  149. hc5661)
  150. ucidef_set_led_default "system" "system" "$board:blue:system" "1"
  151. ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
  152. set_wifi_led "$board:blue:wlan2g"
  153. ;;
  154. hc5761)
  155. ucidef_set_led_default "system" "system" "$board:blue:system" "1"
  156. ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
  157. set_wifi_led "$board:blue:wlan2g"
  158. ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
  159. ;;
  160. hc5861)
  161. ucidef_set_led_default "system" "system" "$board:blue:system" "1"
  162. ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
  163. set_wifi_led "$board:blue:wlan2g"
  164. ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
  165. ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0"
  166. ;;
  167. hg255d)
  168. set_wifi_led "$board:green:wlan"
  169. set_usb_led "$board:green:usb"
  170. ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2"
  171. ;;
  172. hpm)
  173. ucidef_set_led_default "power" "POWER" "$board:orange:power" "1"
  174. ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
  175. set_wifi_led "$board:green:wifi"
  176. ;;
  177. ht-tm02)
  178. ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
  179. set_wifi_led "$board:blue:wlan"
  180. ;;
  181. m2m)
  182. set_wifi_led "$board:blue:wifi"
  183. ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0"
  184. ;;
  185. miniembplug)
  186. set_wifi_led "$board:red:wlan"
  187. set_usb_led "$board:green:mobile"
  188. ;;
  189. miwifi-mini|\
  190. miwifi-nano)
  191. ucidef_set_led_default "power" "power" "$board:red:status" "1"
  192. ;;
  193. miwifi-nano)
  194. ucidef_set_led_default "power" "power" "$board:red:status" "1"
  195. ucidef_set_led_wlan "radio_led" "radio" "$board:amber:radio" "phy0radio"
  196. ucidef_set_led_wlan "wifi_led" "wifi" "$board:blue:wifi" "phy0assoc"
  197. ;;
  198. mlw221|\
  199. mlwg2)
  200. set_wifi_led "$board:blue:wifi"
  201. ucidef_set_led_default "system" "system" "$board:blue:system" "1"
  202. ;;
  203. mpr-a1|\
  204. mpr-a2)
  205. set_wifi_led "$board:blue:system"
  206. ;;
  207. mr-102n)
  208. set_wifi_led "$board:green:wlan"
  209. set_usb_led "$board:green:usb"
  210. ;;
  211. mzk-ex750np)
  212. ucidef_set_led_default "power" "power" "$board:red:power" "1"
  213. set_wifi_led "$board:red:wifi"
  214. ;;
  215. na930)
  216. set_usb_led "$board:blue:status"
  217. ;;
  218. nw718)
  219. set_usb_led "$board:amber:usb"
  220. ;;
  221. oy-0001)
  222. ucidef_set_led_default "power" "power" "$board:green:power" "1"
  223. set_wifi_led "$board:green:wifi"
  224. ;;
  225. pbr-m1)
  226. ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
  227. ucidef_set_led_default "power" "power" "$board:blue:power" "1"
  228. ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1"
  229. ;;
  230. psg1208)
  231. set_wifi_led "$board:white:wlan2g"
  232. ;;
  233. psg1218)
  234. ucidef_set_led_netdev "internet" "internet" "$board:blue:status" "eth0.2"
  235. ucidef_set_led_default "power" "power" "$board:red:status" "1"
  236. ;;
  237. px-4885)
  238. set_wifi_led "$board:orange:wifi"
  239. set_usb_led "$board:blue:storage"
  240. ;;
  241. re6500)
  242. ucidef_set_led_default "power" "power" "$board:white:power" "1"
  243. ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1"
  244. ;;
  245. rp-n53)
  246. ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
  247. set_wifi_led "$board:blue:wifi"
  248. ;;
  249. rt-n14u)
  250. ucidef_set_led_default "power" "power" "$board:blue:power" "1"
  251. ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
  252. ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2
  253. set_wifi_led "$board:blue:air"
  254. set_usb_led "$board:blue:usb"
  255. ;;
  256. tiny-ac)
  257. set_wifi_led "$board:orange:wifi"
  258. set_usb_led "$board:green:usb"
  259. ;;
  260. vocore)
  261. ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
  262. set_wifi_led "$board:green:status"
  263. ;;
  264. w502u)
  265. set_usb_led "$board:blue:usb"
  266. set_wifi_led "rt2800pci-phy0::radio"
  267. ;;
  268. wcr-150gn)
  269. set_usb_led "$board:amber:user"
  270. ;;
  271. whr-1166d|\
  272. whr-300hp2|\
  273. whr-600d)
  274. ucidef_set_led_default "power" "power" "$board:green:power" "1"
  275. ucidef_set_led_default "router" "router" "$board:green:router" "1"
  276. ;;
  277. wnce2001)
  278. set_wifi_led "$board:green:wlan"
  279. ;;
  280. wrh-300cr)
  281. set_wifi_led "$board:green:wlan"
  282. ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
  283. ;;
  284. wndr3700v5)
  285. ucidef_set_led_default "power" "POWER" "$board:green:power" "0"
  286. ;;
  287. wt3020)
  288. ucidef_set_led_default "power" "power" "$board:blue:power" "0"
  289. ;;
  290. y1|\
  291. y1s)
  292. ucidef_set_led_default "power" "power" "$board:blue:power" "1"
  293. set_usb_led "$board:blue:usb"
  294. set_wifi_led "$board:blue:wifi"
  295. ;;
  296. zbt-ape522ii)
  297. ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
  298. ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx"
  299. ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx"
  300. ;;
  301. zbt-wa05)
  302. ucidef_set_led_default "power" "power" "$board:blue:power" "1"
  303. set_wifi_led "$board:blue:air"
  304. set_usb_led "$board:blue:usb"
  305. ;;
  306. zbt-we826)
  307. ucidef_set_led_default "power" "power" "$board:green:power" "1"
  308. set_wifi_led "$board:green:wifi"
  309. set_usb_led "$board:green:usb"
  310. ;;
  311. zbt-wr8305rt)
  312. ucidef_set_led_default "power" "power" "$board:green:sys" "1"
  313. set_usb_led "$board:green:usb"
  314. set_wifi_led "$board:green:wifi"
  315. ;;
  316. zte-q7)
  317. set_wifi_led "$board:blue:status"
  318. ;;
  319. youku-yk1)
  320. ucidef_set_led_default "power" "power" "$board:blue:power" "1"
  321. set_wifi_led "$board:blue:air"
  322. set_usb_led "$board:blue:usb"
  323. ;;
  324. esac
  325. board_config_flush
  326. exit 0