01_leds 10 KB

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