blob: fca1fb2cd441c6945168c67c7e8e4ea65d460f31 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: David Bauer <mail@david-bauer.net>
2Date: Mon, 16 Dec 2019 20:47:06 +0100
3Subject: [PATCH] rt2x00: add throughput LED trigger
4
5This adds a (currently missing) throughput LED trigger for the rt2x00
6driver. Previously, LED triggers had to be assigned to the netdev, which
7was limited to a single VAP.
8
9Signed-off-by: David Bauer <mail@david-bauer.net>
10Tested-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@@ -1210,6 +1223,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 */