All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 02/15] rt2x00: add throughput LED trigger
@ 2022-09-16 23:04 Daniel Golle
  2022-09-17 12:30 ` Stanislaw Gruszka
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Golle @ 2022-09-16 23:04 UTC (permalink / raw)
  To: linux-wireless, Stanislaw Gruszka, Helmut Schaa
  Cc: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Johannes Berg

From: David Bauer <mail@david-bauer.net>

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>
Signed-off-by: David Bauer <mail@david-bauer.net>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index e95c101c271113..3a035afcf7f99c 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -1093,6 +1093,19 @@ static void rt2x00lib_remove_hw(struct rt2x00_dev *rt2x00dev)
 	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;
@@ -1174,6 +1187,11 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
 
 #undef RT2X00_TASKLET_INIT
 
+	ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
+					 IEEE80211_TPT_LEDTRIG_FL_RADIO,
+					 rt2x00_tpt_blink,
+					 ARRAY_SIZE(rt2x00_tpt_blink));
+
 	/*
 	 * Register HW.
 	 */
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 02/15] rt2x00: add throughput LED trigger
  2022-09-16 23:04 [PATCH 02/15] rt2x00: add throughput LED trigger Daniel Golle
@ 2022-09-17 12:30 ` Stanislaw Gruszka
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2022-09-17 12:30 UTC (permalink / raw)
  To: Daniel Golle
  Cc: linux-wireless, Helmut Schaa, Kalle Valo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Johannes Berg

On Sat, Sep 17, 2022 at 12:04:38AM +0100, Daniel Golle wrote:
> From: David Bauer <mail@david-bauer.net>
> 
> 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>
> Signed-off-by: David Bauer <mail@david-bauer.net>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-17 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 23:04 [PATCH 02/15] rt2x00: add throughput LED trigger Daniel Golle
2022-09-17 12:30 ` Stanislaw Gruszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.