0079-ar71xx-ramips-reduce-CPU-load-and-flickering-on-devices-using-rsslieds.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. From: Martin Weinelt <martin@darmstadt.freifunk.net>
  2. Date: Wed, 2 Nov 2016 16:10:44 +0100
  3. Subject: ar71xx, ramips: reduce CPU load and flickering on devices using rsslieds
  4. Polling every 40ms causes more than 10% CPU load on weak devices. An
  5. interval of 200ms is much more reasonable.
  6. Signed-off-by: Martin Weinelt <martin@darmstadt.freifunk.net>
  7. [Matthias Schiffer: adapt OpenWrt patch; add ramips; extend commit message]
  8. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  9. Backport of LEDE 5247ac2f805e39afe2e6e30980e439ea8b8ae7f8
  10. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  11. index 87d6fcc4d74571ca98acc53ae76ea6f305d8c8c6..2a0f9969cd22543de6e54a484052a27414c5d093 100644
  12. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  13. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  14. @@ -18,14 +18,14 @@ alfa-nx)
  15. ;;
  16. all0258n)
  17. - ucidef_set_rssimon "wlan0" "40000" "1"
  18. + ucidef_set_rssimon "wlan0" "200000" "1"
  19. ucidef_set_led_rssi "rssilow" "RSSILOW" "all0258n:red:rssilow" "wlan0" "1" "40" "0" "6"
  20. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0258n:yellow:rssimedium" "wlan0" "30" "80" "-29" "5"
  21. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0258n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
  22. ;;
  23. all0315n)
  24. - ucidef_set_rssimon "wlan0" "40000" "1"
  25. + ucidef_set_rssimon "wlan0" "200000" "1"
  26. ucidef_set_led_rssi "rssilow" "RSSILOW" "all0315n:red:rssilow" "wlan0" "1" "40" "0" "6"
  27. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0315n:yellow:rssimedium" "wlan0" "30" "80" "-29" "5"
  28. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0315n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
  29. @@ -82,7 +82,7 @@ cpe210|\
  30. cpe510)
  31. ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
  32. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
  33. - ucidef_set_rssimon "wlan0" "40000" "1"
  34. + ucidef_set_rssimon "wlan0" "200000" "1"
  35. ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
  36. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
  37. ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
  38. @@ -271,7 +271,7 @@ mynet-n600)
  39. mynet-rext)
  40. ucidef_set_led_netdev "lan" "LAN" "wd:blue:ethernet" "eth0"
  41. - ucidef_set_rssimon "wlan0" "40000" "1"
  42. + ucidef_set_rssimon "wlan0" "200000" "1"
  43. ucidef_set_led_rssi "rssilow" "RSSILOW" "wd:blue:quality1" "wlan0" "1" "40" "0" "6"
  44. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "wd:blue:quality2" "wlan0" "30" "80" "-29" "5"
  45. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "wd:blue:quality3" "wlan0" "70" "100" "-69" "8"
  46. @@ -381,7 +381,7 @@ tl-mr3420-v2)
  47. tl-wa7210n-v2)
  48. ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
  49. - ucidef_set_rssimon "wlan0" "40000" "1"
  50. + ucidef_set_rssimon "wlan0" "200000" "1"
  51. ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:signal1" "wlan0" "1" "100" "0" "13"
  52. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:signal2" "wlan0" "26" "100" "-25" "13"
  53. ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:signal3" "wlan0" "51" "100" "-50" "13"
  54. @@ -391,7 +391,7 @@ tl-wa7210n-v2)
  55. tl-wa750re)
  56. ucidef_set_led_netdev "lan" "LAN" "tp-link:orange:lan" "eth0"
  57. ucidef_set_led_wlan "wlan" "WLAN" "tp-link:orange:wlan" "phy0tpt"
  58. - ucidef_set_rssimon "wlan0" "40000" "1"
  59. + ucidef_set_rssimon "wlan0" "200000" "1"
  60. ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:orange:signal1" "wlan0" "1" "100" "0" "13"
  61. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:orange:signal2" "wlan0" "20" "100" "-19" "13"
  62. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "tp-link:orange:signal3" "wlan0" "40" "100" "-39" "13"
  63. @@ -402,7 +402,7 @@ tl-wa750re)
  64. tl-wa850re)
  65. ucidef_set_led_netdev "lan" "LAN" "tp-link:blue:lan" "eth0"
  66. ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
  67. - ucidef_set_rssimon "wlan0" "40000" "1"
  68. + ucidef_set_rssimon "wlan0" "200000" "1"
  69. ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:blue:signal1" "wlan0" "1" "100" "0" "13"
  70. ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:blue:signal2" "wlan0" "20" "100" "-19" "13"
  71. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "tp-link:blue:signal3" "wlan0" "40" "100" "-39" "13"
  72. @@ -553,7 +553,7 @@ tl-wr2543n)
  73. tube2h)
  74. ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
  75. - ucidef_set_rssimon "wlan0" "40000" "1"
  76. + ucidef_set_rssimon "wlan0" "200000" "1"
  77. ucidef_set_led_rssi "signal1" "SIGNAL1" "alfa:red:signal1" "wlan0" "1" "100" "0" "13"
  78. ucidef_set_led_rssi "signal2" "SIGNAL2" "alfa:orange:signal2" "wlan0" "26" "100" "-25" "13"
  79. ucidef_set_led_rssi "signal3" "SIGNAL3" "alfa:green:signal3" "wlan0" "51" "100" "-50" "13"
  80. diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
  81. index 5fb28a52f7632bf09e7f62ff77dcd7254a2ebcc2..2b0341d3991e03e1f95376992b840ad10c41cdf4 100755
  82. --- a/target/linux/ramips/base-files/etc/board.d/01_leds
  83. +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
  84. @@ -40,7 +40,7 @@ case $board in
  85. set_usb_led "airlive:green:mobile"
  86. ;;
  87. all0256n)
  88. - ucidef_set_rssimon "wlan0" "40000" "1"
  89. + ucidef_set_rssimon "wlan0" "200000" "1"
  90. ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
  91. ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
  92. ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"