mac80211: update to wireless-testing 2010-08-31
[openwrt/openwrt.git] / package / mac80211 / patches / 800-nuke_led_code.patch
1 ---
2 config.mk | 14 +++++++-------
3 drivers/net/wireless/ath/ath9k/ath9k.h | 4 ++++
4 drivers/net/wireless/ath/ath9k/gpio.c | 2 ++
5 drivers/net/wireless/ath/ath9k/init.c | 6 ++++++
6 drivers/net/wireless/ath/ath9k/main.c | 6 ++++++
7 drivers/net/wireless/ath/ath9k/pci.c | 4 ++++
8 include/linux/compat-2.6.25.h | 2 ++
9 net/mac80211/iface.c | 4 ++++
10 net/mac80211/main.c | 8 ++++++++
11 net/mac80211/mlme.c | 6 ++++++
12 net/mac80211/pm.c | 2 ++
13 net/mac80211/rx.c | 4 ++++
14 net/mac80211/status.c | 4 ++++
15 net/mac80211/tx.c | 4 ++++
16 net/mac80211/util.c | 6 ++++++
17 15 files changed, 69 insertions(+), 7 deletions(-)
18
19 --- a/config.mk
20 +++ b/config.mk
21 @@ -115,7 +115,7 @@ CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstr
22 # CONFIG_MAC80211_RC_PID=y
23 CONFIG_MAC80211_RC_MINSTREL=y
24 CONFIG_MAC80211_RC_MINSTREL_HT=y
25 -CONFIG_MAC80211_LEDS=y
26 +# CONFIG_MAC80211_LEDS=y
27
28 # enable mesh networking too
29 CONFIG_MAC80211_MESH=y
30 @@ -218,7 +218,7 @@ CONFIG_B43_PCI_AUTOSELECT=y
31 ifneq ($(CONFIG_PCMCIA),)
32 # CONFIG_B43_PCMCIA=y
33 endif
34 -CONFIG_B43_LEDS=y
35 +# CONFIG_B43_LEDS=y
36 CONFIG_B43_PHY_LP=y
37 # CONFIG_B43_NPHY is not set
38 # CONFIG_B43_FORCE_PIO=y
39 @@ -227,7 +227,7 @@ CONFIG_B43_PHY_LP=y
40 CONFIG_B43LEGACY=m
41 CONFIG_B43LEGACY_HWRNG=y
42 CONFIG_B43LEGACY_PCI_AUTOSELECT=y
43 -CONFIG_B43LEGACY_LEDS=y
44 +# CONFIG_B43LEGACY_LEDS=y
45 # CONFIG_B43LEGACY_DEBUG=y
46 CONFIG_B43LEGACY_DMA=y
47 CONFIG_B43LEGACY_PIO=y
48 @@ -499,7 +499,7 @@ endif
49
50 # p54
51 CONFIG_P54_COMMON=m
52 -CONFIG_P54_LEDS=y
53 +# CONFIG_P54_LEDS=y
54
55 # Atheros
56 CONFIG_ATH_COMMON=m
57 --- a/include/linux/compat-2.6.25.h
58 +++ b/include/linux/compat-2.6.25.h
59 @@ -148,10 +148,12 @@ static inline void __hwrng_unregister(st
60 hwrng_unregister(rng);
61 }
62
63 +#ifdef CONFIG_MAC80211_LEDS
64 static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
65 {
66 led_classdev_unregister(lcd);
67 }
68 +#endif
69
70 /**
71 * The following things are out of ./include/linux/kernel.h
72 --- a/drivers/net/wireless/ath/ath9k/gpio.c
73 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
74 @@ -20,6 +20,7 @@
75 /* LED functions */
76 /********************************/
77
78 +#ifdef CONFIG_MAC80211_LEDS
79 static void ath_led_blink_work(struct work_struct *work)
80 {
81 struct ath_softc *sc = container_of(work, struct ath_softc,
82 @@ -194,6 +195,7 @@ fail:
83 cancel_delayed_work_sync(&sc->ath_led_blink_work);
84 ath_deinit_leds(sc);
85 }
86 +#endif
87
88 /*******************/
89 /* Rfkill */
90 --- a/drivers/net/wireless/ath/ath9k/pci.c
91 +++ b/drivers/net/wireless/ath/ath9k/pci.c
92 @@ -273,7 +273,9 @@ static int ath_pci_suspend(struct pci_de
93 struct ath_wiphy *aphy = hw->priv;
94 struct ath_softc *sc = aphy->sc;
95
96 +#ifdef CONFIG_MAC80211_LEDS
97 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
98 +#endif
99
100 pci_save_state(pdev);
101 pci_disable_device(pdev);
102 @@ -305,10 +307,12 @@ static int ath_pci_resume(struct pci_dev
103 if ((val & 0x0000ff00) != 0)
104 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
105
106 +#ifdef CONFIG_MAC80211_LEDS
107 /* Enable LED */
108 ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
109 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
110 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
111 +#endif
112
113 return 0;
114 }
115 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
116 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
117 @@ -457,6 +457,7 @@ void ath9k_btcoex_timer_pause(struct ath
118 /********************/
119 /* LED Control */
120 /********************/
121 +#ifdef CONFIG_MAC80211_LEDS
122
123 #define ATH_LED_PIN_DEF 1
124 #define ATH_LED_PIN_9287 8
125 @@ -481,6 +482,7 @@ struct ath_led {
126
127 void ath_init_leds(struct ath_softc *sc);
128 void ath_deinit_leds(struct ath_softc *sc);
129 +#endif
130
131 /********************/
132 /* Main driver core */
133 @@ -578,6 +580,7 @@ struct ath_softc {
134 enum wireless_mode cur_rate_mode;
135 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
136
137 +#ifdef CONFIG_MAC80211_LEDS
138 struct ath_led radio_led;
139 struct ath_led assoc_led;
140 struct ath_led tx_led;
141 @@ -587,6 +590,7 @@ struct ath_softc {
142 int led_off_duration;
143 int led_on_cnt;
144 int led_off_cnt;
145 +#endif
146
147 int beacon_interval;
148
149 --- a/drivers/net/wireless/ath/ath9k/init.c
150 +++ b/drivers/net/wireless/ath/ath9k/init.c
151 @@ -757,7 +757,9 @@ int ath9k_init_device(u16 devid, struct
152 INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
153 sc->wiphy_scheduler_int = msecs_to_jiffies(500);
154
155 +#ifdef CONFIG_MAC80211_LEDS
156 ath_init_leds(sc);
157 +#endif
158 ath_start_rfkill_poll(sc);
159
160 return 0;
161 @@ -810,7 +812,9 @@ void ath9k_deinit_device(struct ath_soft
162 ath9k_ps_wakeup(sc);
163
164 wiphy_rfkill_stop_polling(sc->hw->wiphy);
165 +#ifdef CONFIG_MAC80211_LEDS
166 ath_deinit_leds(sc);
167 +#endif
168
169 for (i = 0; i < sc->num_sec_wiphy; i++) {
170 struct ath_wiphy *aphy = sc->sec_wiphy[i];
171 --- a/drivers/net/wireless/ath/ath9k/main.c
172 +++ b/drivers/net/wireless/ath/ath9k/main.c
173 @@ -869,9 +869,11 @@ void ath_radio_enable(struct ath_softc *
174 ath9k_hw_set_interrupts(ah, ah->imask);
175
176 /* Enable LED */
177 +#ifdef CONFIG_MAC80211_LEDS
178 ath9k_hw_cfg_output(ah, ah->led_pin,
179 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
180 ath9k_hw_set_gpio(ah, ah->led_pin, 0);
181 +#endif
182
183 ieee80211_wake_queues(hw);
184 ath9k_ps_restore(sc);
185 @@ -890,10 +892,12 @@ void ath_radio_disable(struct ath_softc
186 * Keep the LED on when the radio is disabled
187 * during idle unassociated state.
188 */
189 +#ifdef CONFIG_MAC80211_LEDS
190 if (!sc->ps_idle) {
191 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
192 ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
193 }
194 +#endif
195
196 /* Disable interrupts */
197 ath9k_hw_set_interrupts(ah, 0);
198 @@ -1304,8 +1308,10 @@ static void ath9k_stop(struct ieee80211_
199
200 aphy->state = ATH_WIPHY_INACTIVE;
201
202 +#ifdef CONFIG_MAC80211_LEDS
203 if (led_blink)
204 cancel_delayed_work_sync(&sc->ath_led_blink_work);
205 +#endif
206
207 cancel_delayed_work_sync(&sc->tx_complete_work);
208 cancel_work_sync(&sc->paprd_work);
209 --- a/net/mac80211/iface.c
210 +++ b/net/mac80211/iface.c
211 @@ -21,7 +21,9 @@
212 #include "sta_info.h"
213 #include "debugfs_netdev.h"
214 #include "mesh.h"
215 +#ifdef CONFIG_MAC80211_LEDS
216 #include "led.h"
217 +#endif
218 #include "driver-ops.h"
219 #include "wme.h"
220
221 @@ -201,7 +203,9 @@ static int ieee80211_do_open(struct net_
222 napi_enable(&local->napi);
223 /* we're brought up, everything changes */
224 hw_reconf_flags = ~0;
225 +#ifdef CONFIG_MAC80211_LEDS
226 ieee80211_led_radio(local, true);
227 +#endif
228 }
229
230 /*
231 --- a/net/mac80211/main.c
232 +++ b/net/mac80211/main.c
233 @@ -29,7 +29,9 @@
234 #include "rate.h"
235 #include "mesh.h"
236 #include "wep.h"
237 +#ifdef CONFIG_MAC80211_LEDS
238 #include "led.h"
239 +#endif
240 #include "cfg.h"
241 #include "debugfs.h"
242
243 @@ -778,7 +780,9 @@ int ieee80211_register_hw(struct ieee802
244
245 rtnl_unlock();
246
247 +#ifdef CONFIG_MAC80211_LEDS
248 ieee80211_led_init(local);
249 +#endif
250
251 local->network_latency_notifier.notifier_call =
252 ieee80211_max_network_latency;
253 @@ -808,7 +812,9 @@ int ieee80211_register_hw(struct ieee802
254 rtnl_lock();
255 #endif
256 fail_pm_qos:
257 +#ifdef CONFIG_MAC80211_LEDS
258 ieee80211_led_exit(local);
259 +#endif
260 ieee80211_remove_interfaces(local);
261 fail_rate:
262 rtnl_unlock();
263 @@ -872,7 +878,9 @@ void ieee80211_unregister_hw(struct ieee
264 destroy_workqueue(local->workqueue);
265 wiphy_unregister(local->hw.wiphy);
266 ieee80211_wep_free(local);
267 +#ifdef CONFIG_MAC80211_LEDS
268 ieee80211_led_exit(local);
269 +#endif
270 kfree(local->int_scan_req);
271 }
272 EXPORT_SYMBOL(ieee80211_unregister_hw);
273 --- a/net/mac80211/mlme.c
274 +++ b/net/mac80211/mlme.c
275 @@ -26,7 +26,9 @@
276 #include "ieee80211_i.h"
277 #include "driver-ops.h"
278 #include "rate.h"
279 +#ifdef CONFIG_MAC80211_LEDS
280 #include "led.h"
281 +#endif
282
283 #define IEEE80211_MAX_PROBE_TRIES 5
284
285 @@ -879,7 +881,9 @@ static void ieee80211_set_associated(str
286 */
287 sdata->u.mgd.wmm_last_param_set = -1;
288
289 +#ifdef CONFIG_MAC80211_LEDS
290 ieee80211_led_assoc(local, 1);
291 +#endif
292
293 if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD)
294 bss_conf->dtim_period = bss->dtim_period;
295 @@ -965,7 +969,9 @@ static void ieee80211_set_disassoc(struc
296
297 changed |= ieee80211_reset_erp_info(sdata);
298
299 +#ifdef CONFIG_MAC80211_LEDS
300 ieee80211_led_assoc(local, 0);
301 +#endif
302 changed |= BSS_CHANGED_ASSOC;
303 sdata->vif.bss_conf.assoc = false;
304
305 --- a/net/mac80211/pm.c
306 +++ b/net/mac80211/pm.c
307 @@ -4,7 +4,9 @@
308 #include "ieee80211_i.h"
309 #include "mesh.h"
310 #include "driver-ops.h"
311 +#ifdef CONFIG_MAC80211_LEDS
312 #include "led.h"
313 +#endif
314
315 int __ieee80211_suspend(struct ieee80211_hw *hw)
316 {
317 --- a/net/mac80211/rx.c
318 +++ b/net/mac80211/rx.c
319 @@ -21,7 +21,9 @@
320
321 #include "ieee80211_i.h"
322 #include "driver-ops.h"
323 +#ifdef CONFIG_MAC80211_LEDS
324 #include "led.h"
325 +#endif
326 #include "mesh.h"
327 #include "wep.h"
328 #include "wpa.h"
329 @@ -1377,8 +1379,10 @@ ieee80211_rx_h_defragment(struct ieee802
330 rx->sta->rx_packets++;
331 if (is_multicast_ether_addr(hdr->addr1))
332 rx->local->dot11MulticastReceivedFrameCount++;
333 +#ifdef CONFIG_MAC80211_LEDS
334 else
335 ieee80211_led_rx(rx->local);
336 +#endif
337 return RX_CONTINUE;
338 }
339
340 --- a/net/mac80211/status.c
341 +++ b/net/mac80211/status.c
342 @@ -13,7 +13,9 @@
343 #include "ieee80211_i.h"
344 #include "rate.h"
345 #include "mesh.h"
346 +#ifdef CONFIG_MAC80211_LEDS
347 #include "led.h"
348 +#endif
349
350
351 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
352 @@ -246,7 +248,9 @@ void ieee80211_tx_status(struct ieee8021
353
354 rcu_read_unlock();
355
356 +#ifdef CONFIG_MAC80211_LEDS
357 ieee80211_led_tx(local, 0);
358 +#endif
359
360 /* SNMP counters
361 * Fragments are passed to low-level drivers as separate skbs, so these
362 --- a/net/mac80211/tx.c
363 +++ b/net/mac80211/tx.c
364 @@ -26,7 +26,9 @@
365
366 #include "ieee80211_i.h"
367 #include "driver-ops.h"
368 +#ifdef CONFIG_MAC80211_LEDS
369 #include "led.h"
370 +#endif
371 #include "mesh.h"
372 #include "wep.h"
373 #include "wpa.h"
374 @@ -1334,7 +1336,9 @@ static int __ieee80211_tx(struct ieee802
375 }
376
377 *skbp = skb = next;
378 +#ifdef CONFIG_MAC80211_LEDS
379 ieee80211_led_tx(local, 1);
380 +#endif
381 fragm = true;
382 }
383
384 --- a/net/mac80211/util.c
385 +++ b/net/mac80211/util.c
386 @@ -29,7 +29,9 @@
387 #include "rate.h"
388 #include "mesh.h"
389 #include "wme.h"
390 +#ifdef CONFIG_MAC80211_LEDS
391 #include "led.h"
392 +#endif
393 #include "wep.h"
394
395 /* privid for wiphys to determine whether they belong to us or not */
396 @@ -1110,7 +1112,9 @@ u32 ieee80211_sta_get_rates(struct ieee8
397
398 void ieee80211_stop_device(struct ieee80211_local *local)
399 {
400 +#ifdef CONFIG_MAC80211_LEDS
401 ieee80211_led_radio(local, false);
402 +#endif
403
404 cancel_work_sync(&local->reconfig_filter);
405
406 @@ -1144,7 +1148,9 @@ int ieee80211_reconfig(struct ieee80211_
407 return res;
408 }
409
410 +#ifdef CONFIG_MAC80211_LEDS
411 ieee80211_led_radio(local, true);
412 +#endif
413 }
414
415 /* add interfaces */