p54: Fix powersave mode
[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 --- compat-wireless-2010-07-29.orig/config.mk
20 +++ compat-wireless-2010-07-29/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 @@ -194,7 +194,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 @@ -203,7 +203,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 @@ -336,13 +336,13 @@ endif
49
50 CONFIG_P54_USB=m
51 CONFIG_RTL8187=m
52 -CONFIG_RTL8187_LEDS=y
53 +# CONFIG_RTL8187_LEDS=y
54
55 CONFIG_AT76C50X_USB=m
56
57 ifndef CONFIG_COMPAT_KERNEL_28
58 CONFIG_AR9170_USB=m
59 -CONFIG_AR9170_LEDS=y
60 +# CONFIG_AR9170_LEDS=y
61 endif
62
63 CONFIG_ATH9K_HTC=m
64 @@ -426,7 +426,7 @@ CONFIG_RT2800_LIB=m
65 CONFIG_RT2X00_LIB_HT=y
66 CONFIG_RT2X00_LIB_FIRMWARE=y
67 CONFIG_RT2X00_LIB_CRYPTO=y
68 -CONFIG_RT2X00_LIB_LEDS=y
69 +# CONFIG_RT2X00_LIB_LEDS=y
70 # CONFIG_RT2X00_DEBUG=y
71 # CONFIG_RT2X00_LIB_DEBUGFS
72 endif
73 @@ -437,7 +437,7 @@ endif
74
75 # p54
76 CONFIG_P54_COMMON=m
77 -CONFIG_P54_LEDS=y
78 +# CONFIG_P54_LEDS=y
79
80 # Atheros
81 CONFIG_ATH_COMMON=m
82 --- compat-wireless-2010-07-29.orig/include/linux/compat-2.6.25.h
83 +++ compat-wireless-2010-07-29/include/linux/compat-2.6.25.h
84 @@ -146,10 +146,12 @@ static inline void __hwrng_unregister(st
85 hwrng_unregister(rng);
86 }
87
88 +#ifdef CONFIG_MAC80211_LEDS
89 static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
90 {
91 led_classdev_unregister(lcd);
92 }
93 +#endif
94
95 /**
96 * The following things are out of ./include/linux/kernel.h
97 --- compat-wireless-2010-07-29.orig/drivers/net/wireless/ath/ath9k/gpio.c
98 +++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/gpio.c
99 @@ -20,6 +20,7 @@
100 /* LED functions */
101 /********************************/
102
103 +#ifdef CONFIG_MAC80211_LEDS
104 static void ath_led_blink_work(struct work_struct *work)
105 {
106 struct ath_softc *sc = container_of(work, struct ath_softc,
107 @@ -194,6 +195,7 @@ fail:
108 cancel_delayed_work_sync(&sc->ath_led_blink_work);
109 ath_deinit_leds(sc);
110 }
111 +#endif
112
113 /*******************/
114 /* Rfkill */
115 --- compat-wireless-2010-07-29.orig/drivers/net/wireless/ath/ath9k/pci.c
116 +++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/pci.c
117 @@ -273,7 +273,9 @@ static int ath_pci_suspend(struct pci_de
118 struct ath_wiphy *aphy = hw->priv;
119 struct ath_softc *sc = aphy->sc;
120
121 +#ifdef CONFIG_MAC80211_LEDS
122 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
123 +#endif
124
125 pci_save_state(pdev);
126 pci_disable_device(pdev);
127 @@ -305,10 +307,12 @@ static int ath_pci_resume(struct pci_dev
128 if ((val & 0x0000ff00) != 0)
129 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
130
131 +#ifdef CONFIG_MAC80211_LEDS
132 /* Enable LED */
133 ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
134 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
135 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
136 +#endif
137
138 return 0;
139 }
140 --- compat-wireless-2010-07-29.orig/drivers/net/wireless/ath/ath9k/ath9k.h
141 +++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/ath9k.h
142 @@ -465,6 +465,7 @@ void ath9k_btcoex_timer_pause(struct ath
143 /********************/
144 /* LED Control */
145 /********************/
146 +#ifdef CONFIG_MAC80211_LEDS
147
148 #define ATH_LED_PIN_DEF 1
149 #define ATH_LED_PIN_9287 8
150 @@ -489,6 +490,7 @@ struct ath_led {
151
152 void ath_init_leds(struct ath_softc *sc);
153 void ath_deinit_leds(struct ath_softc *sc);
154 +#endif
155
156 /********************/
157 /* Main driver core */
158 @@ -586,6 +588,7 @@ struct ath_softc {
159 enum wireless_mode cur_rate_mode;
160 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
161
162 +#ifdef CONFIG_MAC80211_LEDS
163 struct ath_led radio_led;
164 struct ath_led assoc_led;
165 struct ath_led tx_led;
166 @@ -595,6 +598,7 @@ struct ath_softc {
167 int led_off_duration;
168 int led_on_cnt;
169 int led_off_cnt;
170 +#endif
171
172 int beacon_interval;
173
174 --- compat-wireless-2010-07-29.orig/drivers/net/wireless/ath/ath9k/init.c
175 +++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/init.c
176 @@ -34,9 +34,11 @@ int modparam_nohwcrypt;
177 module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
178 MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
179
180 +#ifdef CONFIG_MAC80211_LEDS
181 int led_blink = 1;
182 module_param_named(blink, led_blink, int, 0444);
183 MODULE_PARM_DESC(blink, "Enable LED blink on activity");
184 +#endif
185
186 /* We use the hw_value as an index into our private channel structure */
187
188 @@ -757,7 +759,9 @@ int ath9k_init_device(u16 devid, struct
189 INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
190 sc->wiphy_scheduler_int = msecs_to_jiffies(500);
191
192 +#ifdef CONFIG_MAC80211_LEDS
193 ath_init_leds(sc);
194 +#endif
195 ath_start_rfkill_poll(sc);
196
197 return 0;
198 @@ -810,7 +814,9 @@ void ath9k_deinit_device(struct ath_soft
199 ath9k_ps_wakeup(sc);
200
201 wiphy_rfkill_stop_polling(sc->hw->wiphy);
202 +#ifdef CONFIG_MAC80211_LEDS
203 ath_deinit_leds(sc);
204 +#endif
205
206 for (i = 0; i < sc->num_sec_wiphy; i++) {
207 struct ath_wiphy *aphy = sc->sec_wiphy[i];
208 --- compat-wireless-2010-07-29.orig/drivers/net/wireless/ath/ath9k/main.c
209 +++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/main.c
210 @@ -868,9 +868,11 @@ void ath_radio_enable(struct ath_softc *
211 ath9k_hw_set_interrupts(ah, ah->imask);
212
213 /* Enable LED */
214 +#ifdef CONFIG_MAC80211_LEDS
215 ath9k_hw_cfg_output(ah, ah->led_pin,
216 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
217 ath9k_hw_set_gpio(ah, ah->led_pin, 0);
218 +#endif
219
220 ieee80211_wake_queues(hw);
221 ath9k_ps_restore(sc);
222 @@ -889,10 +891,12 @@ void ath_radio_disable(struct ath_softc
223 * Keep the LED on when the radio is disabled
224 * during idle unassociated state.
225 */
226 +#ifdef CONFIG_MAC80211_LEDS
227 if (!sc->ps_idle) {
228 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
229 ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
230 }
231 +#endif
232
233 /* Disable interrupts */
234 ath9k_hw_set_interrupts(ah, 0);
235 @@ -1303,8 +1307,10 @@ static void ath9k_stop(struct ieee80211_
236
237 aphy->state = ATH_WIPHY_INACTIVE;
238
239 +#ifdef CONFIG_MAC80211_LEDS
240 if (led_blink)
241 cancel_delayed_work_sync(&sc->ath_led_blink_work);
242 +#endif
243
244 cancel_delayed_work_sync(&sc->tx_complete_work);
245 cancel_work_sync(&sc->paprd_work);
246 --- compat-wireless-2010-07-29.orig/net/mac80211/iface.c
247 +++ compat-wireless-2010-07-29/net/mac80211/iface.c
248 @@ -21,7 +21,9 @@
249 #include "sta_info.h"
250 #include "debugfs_netdev.h"
251 #include "mesh.h"
252 +#ifdef CONFIG_MAC80211_LEDS
253 #include "led.h"
254 +#endif
255 #include "driver-ops.h"
256 #include "wme.h"
257
258 @@ -189,7 +191,9 @@ static int ieee80211_open(struct net_dev
259 goto err_del_bss;
260 /* we're brought up, everything changes */
261 hw_reconf_flags = ~0;
262 +#ifdef CONFIG_MAC80211_LEDS
263 ieee80211_led_radio(local, true);
264 +#endif
265 }
266
267 /*
268 --- compat-wireless-2010-07-29.orig/net/mac80211/main.c
269 +++ compat-wireless-2010-07-29/net/mac80211/main.c
270 @@ -29,7 +29,9 @@
271 #include "rate.h"
272 #include "mesh.h"
273 #include "wep.h"
274 +#ifdef CONFIG_MAC80211_LEDS
275 #include "led.h"
276 +#endif
277 #include "cfg.h"
278 #include "debugfs.h"
279
280 @@ -674,7 +676,9 @@ int ieee80211_register_hw(struct ieee802
281
282 rtnl_unlock();
283
284 +#ifdef CONFIG_MAC80211_LEDS
285 ieee80211_led_init(local);
286 +#endif
287
288 local->network_latency_notifier.notifier_call =
289 ieee80211_max_network_latency;
290 @@ -699,7 +703,9 @@ int ieee80211_register_hw(struct ieee802
291 &local->network_latency_notifier);
292 rtnl_lock();
293 fail_pm_qos:
294 +#ifdef CONFIG_MAC80211_LEDS
295 ieee80211_led_exit(local);
296 +#endif
297 ieee80211_remove_interfaces(local);
298 fail_rate:
299 rtnl_unlock();
300 @@ -755,7 +761,9 @@ void ieee80211_unregister_hw(struct ieee
301 destroy_workqueue(local->workqueue);
302 wiphy_unregister(local->hw.wiphy);
303 ieee80211_wep_free(local);
304 +#ifdef CONFIG_MAC80211_LEDS
305 ieee80211_led_exit(local);
306 +#endif
307 kfree(local->int_scan_req);
308 }
309 EXPORT_SYMBOL(ieee80211_unregister_hw);
310 --- compat-wireless-2010-07-29.orig/net/mac80211/mlme.c
311 +++ compat-wireless-2010-07-29/net/mac80211/mlme.c
312 @@ -26,7 +26,9 @@
313 #include "ieee80211_i.h"
314 #include "driver-ops.h"
315 #include "rate.h"
316 +#ifdef CONFIG_MAC80211_LEDS
317 #include "led.h"
318 +#endif
319
320 #define IEEE80211_MAX_PROBE_TRIES 5
321
322 @@ -872,7 +874,9 @@ static void ieee80211_set_associated(str
323 */
324 sdata->u.mgd.wmm_last_param_set = -1;
325
326 +#ifdef CONFIG_MAC80211_LEDS
327 ieee80211_led_assoc(local, 1);
328 +#endif
329
330 if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD)
331 bss_conf->dtim_period = bss->dtim_period;
332 @@ -958,7 +962,9 @@ static void ieee80211_set_disassoc(struc
333
334 changed |= ieee80211_reset_erp_info(sdata);
335
336 +#ifdef CONFIG_MAC80211_LEDS
337 ieee80211_led_assoc(local, 0);
338 +#endif
339 changed |= BSS_CHANGED_ASSOC;
340 sdata->vif.bss_conf.assoc = false;
341
342 --- compat-wireless-2010-07-29.orig/net/mac80211/pm.c
343 +++ compat-wireless-2010-07-29/net/mac80211/pm.c
344 @@ -4,7 +4,9 @@
345 #include "ieee80211_i.h"
346 #include "mesh.h"
347 #include "driver-ops.h"
348 +#ifdef CONFIG_MAC80211_LEDS
349 #include "led.h"
350 +#endif
351
352 int __ieee80211_suspend(struct ieee80211_hw *hw)
353 {
354 --- compat-wireless-2010-07-29.orig/net/mac80211/rx.c
355 +++ compat-wireless-2010-07-29/net/mac80211/rx.c
356 @@ -21,7 +21,9 @@
357
358 #include "ieee80211_i.h"
359 #include "driver-ops.h"
360 +#ifdef CONFIG_MAC80211_LEDS
361 #include "led.h"
362 +#endif
363 #include "mesh.h"
364 #include "wep.h"
365 #include "wpa.h"
366 @@ -1342,8 +1344,10 @@ ieee80211_rx_h_defragment(struct ieee802
367 rx->sta->rx_packets++;
368 if (is_multicast_ether_addr(hdr->addr1))
369 rx->local->dot11MulticastReceivedFrameCount++;
370 +#ifdef CONFIG_MAC80211_LEDS
371 else
372 ieee80211_led_rx(rx->local);
373 +#endif
374 return RX_CONTINUE;
375 }
376
377 --- compat-wireless-2010-07-29.orig/net/mac80211/status.c
378 +++ compat-wireless-2010-07-29/net/mac80211/status.c
379 @@ -13,7 +13,9 @@
380 #include "ieee80211_i.h"
381 #include "rate.h"
382 #include "mesh.h"
383 +#ifdef CONFIG_MAC80211_LEDS
384 #include "led.h"
385 +#endif
386
387
388 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
389 @@ -247,7 +249,9 @@ void ieee80211_tx_status(struct ieee8021
390
391 rcu_read_unlock();
392
393 +#ifdef CONFIG_MAC80211_LEDS
394 ieee80211_led_tx(local, 0);
395 +#endif
396
397 /* SNMP counters
398 * Fragments are passed to low-level drivers as separate skbs, so these
399 --- compat-wireless-2010-07-29.orig/net/mac80211/tx.c
400 +++ compat-wireless-2010-07-29/net/mac80211/tx.c
401 @@ -26,7 +26,9 @@
402
403 #include "ieee80211_i.h"
404 #include "driver-ops.h"
405 +#ifdef CONFIG_MAC80211_LEDS
406 #include "led.h"
407 +#endif
408 #include "mesh.h"
409 #include "wep.h"
410 #include "wpa.h"
411 @@ -1312,7 +1314,9 @@ static int __ieee80211_tx(struct ieee802
412 }
413
414 *skbp = skb = next;
415 +#ifdef CONFIG_MAC80211_LEDS
416 ieee80211_led_tx(local, 1);
417 +#endif
418 fragm = true;
419 }
420
421 --- compat-wireless-2010-07-29.orig/net/mac80211/util.c
422 +++ compat-wireless-2010-07-29/net/mac80211/util.c
423 @@ -29,7 +29,9 @@
424 #include "rate.h"
425 #include "mesh.h"
426 #include "wme.h"
427 +#ifdef CONFIG_MAC80211_LEDS
428 #include "led.h"
429 +#endif
430 #include "wep.h"
431
432 /* privid for wiphys to determine whether they belong to us or not */
433 @@ -1107,7 +1109,9 @@ u32 ieee80211_sta_get_rates(struct ieee8
434
435 void ieee80211_stop_device(struct ieee80211_local *local)
436 {
437 +#ifdef CONFIG_MAC80211_LEDS
438 ieee80211_led_radio(local, false);
439 +#endif
440
441 cancel_work_sync(&local->reconfig_filter);
442
443 @@ -1141,7 +1145,9 @@ int ieee80211_reconfig(struct ieee80211_
444 return res;
445 }
446
447 +#ifdef CONFIG_MAC80211_LEDS
448 ieee80211_led_radio(local, true);
449 +#endif
450 }
451
452 /* add interfaces */