mt76: update to version 2022-12-01
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / rt2x00 / 002-v6.1-rt2x00-add-throughput-LED-trigger.patch
1 From patchwork Sat Sep 17 20:26:40 2022
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
6 X-Patchwork-Id: 12979243
7 X-Patchwork-Delegate: kvalo@adurom.com
8 Return-Path: <linux-wireless-owner@kernel.org>
9 Date: Sat, 17 Sep 2022 21:26:40 +0100
10 From: Daniel Golle <daniel@makrotopia.org>
11 To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
12 Helmut Schaa <helmut.schaa@googlemail.com>
13 Cc: Kalle Valo <kvalo@kernel.org>,
14 "David S. Miller" <davem@davemloft.net>,
15 Eric Dumazet <edumazet@google.com>,
16 Jakub Kicinski <kuba@kernel.org>,
17 Paolo Abeni <pabeni@redhat.com>,
18 Johannes Berg <johannes.berg@intel.com>
19 Subject: [PATCH v3 02/16] rt2x00: add throughput LED trigger
20 Message-ID:
21 <73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org>
22 References: <cover.1663445157.git.daniel@makrotopia.org>
23 MIME-Version: 1.0
24 Content-Disposition: inline
25 In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
26 Precedence: bulk
27 List-ID: <linux-wireless.vger.kernel.org>
28 X-Mailing-List: linux-wireless@vger.kernel.org
29
30 From: David Bauer <mail@david-bauer.net>
31
32 This adds a (currently missing) throughput LED trigger for the rt2x00
33 driver. Previously, LED triggers had to be assigned to the netdev, which
34 was limited to a single VAP.
35
36 Tested-by: Christoph Krapp <achterin@googlemail.com>
37 Signed-off-by: David Bauer <mail@david-bauer.net>
38 Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
39 ---
40 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 18 ++++++++++++++++++
41 1 file changed, 18 insertions(+)
42
43 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
44 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
45 @@ -1093,6 +1093,19 @@ static void rt2x00lib_remove_hw(struct r
46 kfree(rt2x00dev->spec.channels_info);
47 }
48
49 +static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
50 + { .throughput = 0 * 1024, .blink_time = 334 },
51 + { .throughput = 1 * 1024, .blink_time = 260 },
52 + { .throughput = 2 * 1024, .blink_time = 220 },
53 + { .throughput = 5 * 1024, .blink_time = 190 },
54 + { .throughput = 10 * 1024, .blink_time = 170 },
55 + { .throughput = 25 * 1024, .blink_time = 150 },
56 + { .throughput = 54 * 1024, .blink_time = 130 },
57 + { .throughput = 120 * 1024, .blink_time = 110 },
58 + { .throughput = 265 * 1024, .blink_time = 80 },
59 + { .throughput = 586 * 1024, .blink_time = 50 },
60 +};
61 +
62 static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
63 {
64 struct hw_mode_spec *spec = &rt2x00dev->spec;
65 @@ -1174,6 +1187,11 @@ static int rt2x00lib_probe_hw(struct rt2
66
67 #undef RT2X00_TASKLET_INIT
68
69 + ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
70 + IEEE80211_TPT_LEDTRIG_FL_RADIO,
71 + rt2x00_tpt_blink,
72 + ARRAY_SIZE(rt2x00_tpt_blink));
73 +
74 /*
75 * Register HW.
76 */