mac80211: rt2x00: prune more unnecessary exports
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / rt2x00 / 612-rt2x00-led-tpt-trigger-support.patch
1 From: David Bauer <mail@david-bauer.net>
2 Date: Mon, 16 Dec 2019 20:47:06 +0100
3 Subject: [PATCH] rt2x00: add throughput LED trigger
4
5 This adds a (currently missing) throughput LED trigger for the rt2x00
6 driver. Previously, LED triggers had to be assigned to the netdev, which
7 was limited to a single VAP.
8
9 Signed-off-by: David Bauer <mail@david-bauer.net>
10 Tested-by: Christoph Krapp <achterin@googlemail.com>
11
12 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
13 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
14 @@ -1129,6 +1129,19 @@ static void rt2x00lib_remove_hw(struct r
15 kfree(rt2x00dev->spec.channels_info);
16 }
17
18 +static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
19 + { .throughput = 0 * 1024, .blink_time = 334 },
20 + { .throughput = 1 * 1024, .blink_time = 260 },
21 + { .throughput = 2 * 1024, .blink_time = 220 },
22 + { .throughput = 5 * 1024, .blink_time = 190 },
23 + { .throughput = 10 * 1024, .blink_time = 170 },
24 + { .throughput = 25 * 1024, .blink_time = 150 },
25 + { .throughput = 54 * 1024, .blink_time = 130 },
26 + { .throughput = 120 * 1024, .blink_time = 110 },
27 + { .throughput = 265 * 1024, .blink_time = 80 },
28 + { .throughput = 586 * 1024, .blink_time = 50 },
29 +};
30 +
31 static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
32 {
33 struct hw_mode_spec *spec = &rt2x00dev->spec;
34 @@ -1211,6 +1224,10 @@ static int rt2x00lib_probe_hw(struct rt2
35
36 #undef RT2X00_TASKLET_INIT
37
38 + ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
39 + IEEE80211_TPT_LEDTRIG_FL_RADIO, rt2x00_tpt_blink,
40 + ARRAY_SIZE(rt2x00_tpt_blink));
41 +
42 /*
43 * Register HW.
44 */