blob: fd4e4102109320ee3db5314987ad3a7f29dfd99a [file] [log] [blame]
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1309,6 +1309,7 @@ struct ieee80211_local {
struct mutex chanctx_mtx;
#ifdef CONFIG_MAC80211_LEDS
+ int tx_led_counter, rx_led_counter;
struct led_trigger tx_led, rx_led, assoc_led, radio_led;
struct led_trigger tpt_led;
atomic_t tx_led_active, rx_led_active, assoc_led_active;
--- a/net/mac80211/led.h
+++ b/net/mac80211/led.h
@@ -16,22 +16,36 @@
static inline void ieee80211_led_rx(struct ieee80211_local *local)
{
#ifdef CONFIG_MAC80211_LEDS
- unsigned long led_delay = MAC80211_BLINK_DELAY;
+ unsigned long led_delay __maybe_unused = MAC80211_BLINK_DELAY;
if (!atomic_read(&local->rx_led_active))
return;
+#if LINUX_VERSION_IS_GEQ(3,6,0)
led_trigger_blink_oneshot(&local->rx_led, &led_delay, &led_delay, 0);
+#else
+ if (local->rx_led_counter++ % 2 == 0)
+ led_trigger_event(&local->rx_led, LED_OFF);
+ else
+ led_trigger_event(&local->rx_led, LED_FULL);
+#endif
#endif
}
static inline void ieee80211_led_tx(struct ieee80211_local *local)
{
#ifdef CONFIG_MAC80211_LEDS
- unsigned long led_delay = MAC80211_BLINK_DELAY;
+ unsigned long led_delay __maybe_unused = MAC80211_BLINK_DELAY;
if (!atomic_read(&local->tx_led_active))
return;
+#if LINUX_VERSION_IS_GEQ(3,6,0)
led_trigger_blink_oneshot(&local->tx_led, &led_delay, &led_delay, 0);
+#else
+ if (local->tx_led_counter++ % 2 == 0)
+ led_trigger_event(&local->tx_led, LED_OFF);
+ else
+ led_trigger_event(&local->tx_led, LED_FULL);
+#endif
#endif
}