930-ath10k_add_tpt_led_trigger.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --- a/drivers/net/wireless/ath/ath10k/mac.c
  2. +++ b/drivers/net/wireless/ath/ath10k/mac.c
  3. @@ -8003,6 +8003,21 @@ static int ath10k_mac_init_rd(struct ath
  4. return 0;
  5. }
  6. +#ifdef CPTCFG_MAC80211_LEDS
  7. +static const struct ieee80211_tpt_blink ath10k_tpt_blink[] = {
  8. + { .throughput = 0 * 1024, .blink_time = 334 },
  9. + { .throughput = 1 * 1024, .blink_time = 260 },
  10. + { .throughput = 2 * 1024, .blink_time = 220 },
  11. + { .throughput = 5 * 1024, .blink_time = 190 },
  12. + { .throughput = 10 * 1024, .blink_time = 170 },
  13. + { .throughput = 25 * 1024, .blink_time = 150 },
  14. + { .throughput = 54 * 1024, .blink_time = 130 },
  15. + { .throughput = 120 * 1024, .blink_time = 110 },
  16. + { .throughput = 265 * 1024, .blink_time = 80 },
  17. + { .throughput = 586 * 1024, .blink_time = 50 },
  18. +};
  19. +#endif
  20. +
  21. int ath10k_mac_register(struct ath10k *ar)
  22. {
  23. static const u32 cipher_suites[] = {
  24. @@ -8248,6 +8263,12 @@ int ath10k_mac_register(struct ath10k *a
  25. ar->hw->wiphy->cipher_suites = cipher_suites;
  26. ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
  27. +#ifdef CPTCFG_MAC80211_LEDS
  28. + ieee80211_create_tpt_led_trigger(ar->hw,
  29. + IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
  30. + ARRAY_SIZE(ath10k_tpt_blink));
  31. +#endif
  32. +
  33. ret = ieee80211_register_hw(ar->hw);
  34. if (ret) {
  35. ath10k_err(ar, "failed to register ieee80211: %d\n", ret);