ath10k: merge some more pending upstream fixes
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 930-ath10k_add_tpt_led_trigger.patch
1 --- a/drivers/net/wireless/ath/ath10k/mac.c
2 +++ b/drivers/net/wireless/ath/ath10k/mac.c
3 @@ -7717,6 +7717,21 @@ struct ath10k_vif *ath10k_get_arvif(stru
4 return arvif_iter.arvif;
5 }
6
7 +#ifdef CPTCFG_MAC80211_LEDS
8 +static const struct ieee80211_tpt_blink ath10k_tpt_blink[] = {
9 + { .throughput = 0 * 1024, .blink_time = 334 },
10 + { .throughput = 1 * 1024, .blink_time = 260 },
11 + { .throughput = 2 * 1024, .blink_time = 220 },
12 + { .throughput = 5 * 1024, .blink_time = 190 },
13 + { .throughput = 10 * 1024, .blink_time = 170 },
14 + { .throughput = 25 * 1024, .blink_time = 150 },
15 + { .throughput = 54 * 1024, .blink_time = 130 },
16 + { .throughput = 120 * 1024, .blink_time = 110 },
17 + { .throughput = 265 * 1024, .blink_time = 80 },
18 + { .throughput = 586 * 1024, .blink_time = 50 },
19 +};
20 +#endif
21 +
22 int ath10k_mac_register(struct ath10k *ar)
23 {
24 static const u32 cipher_suites[] = {
25 @@ -7941,6 +7956,12 @@ int ath10k_mac_register(struct ath10k *a
26 ar->hw->wiphy->cipher_suites = cipher_suites;
27 ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
28
29 +#if CPTCFG_MAC80211_LEDS
30 + ieee80211_create_tpt_led_trigger(ar->hw,
31 + IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
32 + ARRAY_SIZE(ath10k_tpt_blink));
33 +#endif
34 +
35 ret = ieee80211_register_hw(ar->hw);
36 if (ret) {
37 ath10k_err(ar, "failed to register ieee80211: %d\n", ret);