hostapd: fix frequency selection for ap+sta
[openwrt/staging/mkresin.git] / package / kernel / mac80211 / patches / 070-mac80211-led-blink-api.patch
1 backports: use old led api on old kernel versions.
2
3 Usage of a new led api was introduced in mac80211, this patch make
4 backports use the old api on older kernel versions. This could cause a
5 problem with the led, the transmit led could stay on if nothing is
6 transfered.
7
8 This backports the following upstream commit:
9 commit e47f2509e5f182f4df144406de6f2bc78179d57e
10 Author: Fabio Baltieri <fabio.baltieri@gmail.com>
11 Date: Thu Jul 25 12:00:26 2013 +0200
12
13 mac80211: use oneshot blink API for LED triggers
14
15 --- a/net/mac80211/ieee80211_i.h
16 +++ b/net/mac80211/ieee80211_i.h
17 @@ -1122,6 +1122,9 @@ struct ieee80211_local {
18 u32 dot11TransmittedFrameCount;
19
20 #ifdef CPTCFG_MAC80211_LEDS
21 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
22 + int tx_led_counter, rx_led_counter;
23 +#endif
24 struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
25 struct tpt_led_trigger *tpt_led_trigger;
26 char tx_led_name[32], rx_led_name[32],
27 --- a/net/mac80211/led.c
28 +++ b/net/mac80211/led.c
29 @@ -16,18 +16,36 @@
30
31 void ieee80211_led_rx(struct ieee80211_local *local)
32 {
33 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
34 unsigned long led_delay = MAC80211_BLINK_DELAY;
35 +#endif
36 if (unlikely(!local->rx_led))
37 return;
38 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
39 led_trigger_blink_oneshot(local->rx_led, &led_delay, &led_delay, 0);
40 +#else
41 + if (local->rx_led_counter++ % 2 == 0)
42 + led_trigger_event(local->rx_led, LED_OFF);
43 + else
44 + led_trigger_event(local->rx_led, LED_FULL);
45 +#endif
46 }
47
48 void ieee80211_led_tx(struct ieee80211_local *local)
49 {
50 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
51 unsigned long led_delay = MAC80211_BLINK_DELAY;
52 +#endif
53 if (unlikely(!local->tx_led))
54 return;
55 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
56 led_trigger_blink_oneshot(local->tx_led, &led_delay, &led_delay, 0);
57 +#else
58 + if (local->tx_led_counter++ % 2 == 0)
59 + led_trigger_event(local->tx_led, LED_OFF);
60 + else
61 + led_trigger_event(local->tx_led, LED_FULL);
62 +#endif
63 }
64
65 void ieee80211_led_assoc(struct ieee80211_local *local, bool associated)