2022-09-16 23:33:30 +00:00
|
|
|
From 208be6e22eba13408a0a3eb4c02256bc9ddfaf48 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Daniel Golle <daniel@makrotopia.org>
|
2019-12-30 00:52:59 +00:00
|
|
|
Date: Mon, 16 Dec 2019 20:47:06 +0100
|
2022-09-16 23:33:30 +00:00
|
|
|
Subject: [PATCH 02/16] rt2x00: add throughput LED trigger
|
|
|
|
To: linux-wireless@vger.kernel.org,
|
|
|
|
Stanislaw Gruszka <stf_xl@wp.pl>,
|
|
|
|
Helmut Schaa <helmut.schaa@googlemail.com>
|
|
|
|
Cc: Kalle Valo <kvalo@kernel.org>,
|
|
|
|
David S. Miller <davem@davemloft.net>,
|
|
|
|
Eric Dumazet <edumazet@google.com>,
|
|
|
|
Jakub Kicinski <kuba@kernel.org>,
|
|
|
|
Paolo Abeni <pabeni@redhat.com>,
|
|
|
|
Johannes Berg <johannes.berg@intel.com>
|
|
|
|
|
|
|
|
From: David Bauer <mail@david-bauer.net>
|
2019-12-30 00:52:59 +00:00
|
|
|
|
|
|
|
This adds a (currently missing) throughput LED trigger for the rt2x00
|
|
|
|
driver. Previously, LED triggers had to be assigned to the netdev, which
|
|
|
|
was limited to a single VAP.
|
|
|
|
|
|
|
|
Tested-by: Christoph Krapp <achterin@googlemail.com>
|
2022-09-16 23:33:30 +00:00
|
|
|
Signed-off-by: David Bauer <mail@david-bauer.net>
|
2022-09-12 20:21:05 +00:00
|
|
|
---
|
2022-09-16 23:33:30 +00:00
|
|
|
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 18 ++++++++++++++++++
|
|
|
|
1 file changed, 18 insertions(+)
|
2019-12-30 00:52:59 +00:00
|
|
|
|
|
|
|
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
|
|
|
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
2021-10-04 21:48:20 +00:00
|
|
|
@@ -1125,6 +1125,19 @@ static void rt2x00lib_remove_hw(struct r
|
2019-12-30 00:52:59 +00:00
|
|
|
kfree(rt2x00dev->spec.channels_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
|
|
|
|
+ { .throughput = 0 * 1024, .blink_time = 334 },
|
|
|
|
+ { .throughput = 1 * 1024, .blink_time = 260 },
|
|
|
|
+ { .throughput = 2 * 1024, .blink_time = 220 },
|
|
|
|
+ { .throughput = 5 * 1024, .blink_time = 190 },
|
|
|
|
+ { .throughput = 10 * 1024, .blink_time = 170 },
|
|
|
|
+ { .throughput = 25 * 1024, .blink_time = 150 },
|
|
|
|
+ { .throughput = 54 * 1024, .blink_time = 130 },
|
|
|
|
+ { .throughput = 120 * 1024, .blink_time = 110 },
|
|
|
|
+ { .throughput = 265 * 1024, .blink_time = 80 },
|
|
|
|
+ { .throughput = 586 * 1024, .blink_time = 50 },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
|
|
|
{
|
|
|
|
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
2022-09-16 23:33:30 +00:00
|
|
|
@@ -1206,6 +1219,11 @@ static int rt2x00lib_probe_hw(struct rt2
|
2019-12-30 00:52:59 +00:00
|
|
|
|
|
|
|
#undef RT2X00_TASKLET_INIT
|
|
|
|
|
|
|
|
+ ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
|
2022-09-16 23:33:30 +00:00
|
|
|
+ IEEE80211_TPT_LEDTRIG_FL_RADIO,
|
|
|
|
+ rt2x00_tpt_blink,
|
|
|
|
+ ARRAY_SIZE(rt2x00_tpt_blink));
|
2019-12-30 00:52:59 +00:00
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Register HW.
|
|
|
|
*/
|