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