2
0

800-nuke_led_code.patch 12 KB

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