Date:2010-09-01 01:34:21 (13 years 6 months ago)
Author:nbd
Commit:2cedae1d3dade3c015557fa9d45e1bea1c758b9d
Message:mac80211: update to wireless-testing 2010-08-31

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22865 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: package/mac80211/Makefile (1 diff)
package/mac80211/patches/000-compile_fix.patch (1 diff)
package/mac80211/patches/001-disable_b44.patch (1 diff)
package/mac80211/patches/002-disable_rfkill.patch (2 diffs)
package/mac80211/patches/003-disable_bt.patch (1 diff)
package/mac80211/patches/005-disable_ssb_build.patch (2 diffs)
package/mac80211/patches/007-remove_misc_drivers.patch (2 diffs)
package/mac80211/patches/010-no_pcmcia.patch (1 diff)
package/mac80211/patches/011-no_sdio.patch (1 diff)
package/mac80211/patches/013-disable_b43_nphy.patch (1 diff)
package/mac80211/patches/015-remove-rt2x00-options.patch (2 diffs)
package/mac80211/patches/030-backport_93c86_eeprom.patch (1 diff)
package/mac80211/patches/100-disable_pcmcia_compat.patch (1 diff)
package/mac80211/patches/110-disable_usb_compat.patch (2 diffs)
package/mac80211/patches/120-pm_qos_params.patch (1 diff)
package/mac80211/patches/130-printk_debug_revert.patch (2 diffs)
package/mac80211/patches/404-ath_regd_optional.patch (2 diffs)
package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch (1 diff)
package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch (1 diff)
package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch (1 diff)
package/mac80211/patches/450-add-ath5k-platform.patch (2 diffs)
package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch (5 diffs)
package/mac80211/patches/510-ath9k_handle_keymiss.patch (1 diff)
package/mac80211/patches/520-ath9k_baw_fix.patch (1 diff)
package/mac80211/patches/520-pending_work.patch (1 diff)
package/mac80211/patches/530-ath9k_aggr_start_fix.patch (1 diff)
package/mac80211/patches/530-ath9k_aggr_state_fix.patch (1 diff)
package/mac80211/patches/540-ath9k_bstuck_debug.patch (1 diff)
package/mac80211/patches/541-ath9k_nf_validate.patch (1 diff)
package/mac80211/patches/542-ath9k_bstuck_nf_calibrate.patch (1 diff)
package/mac80211/patches/543-ath9k_interference_nf_cal.patch (1 diff)
package/mac80211/patches/550-ath9k_tsf_fix.patch (1 diff)
package/mac80211/patches/560-ath9k_baw_fix.patch (1 diff)
package/mac80211/patches/570-ath9k_mic_failure_fix.patch (1 diff)
package/mac80211/patches/580-ath9k_aggr_start_fix.patch (1 diff)
package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch (1 diff)
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch (1 diff)
package/mac80211/patches/800-nuke_led_code.patch (35 diffs)
package/mac80211/patches/810-p54-fix-ps.patch (1 diff)

Change Details

package/mac80211/Makefile
1010
1111PKG_NAME:=mac80211
1212
13PKG_VERSION:=2010-07-29
13PKG_VERSION:=2010-08-31
1414PKG_RELEASE:=1
1515PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
1616# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
1717# http://wireless.kernel.org/download/compat-wireless-2.6
18PKG_MD5SUM:=fcfb757939c4718efbf9c87ca59c6932
18PKG_MD5SUM:=5d720b6d8de97ae61a4c3e4ee10a6de1
1919
2020PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
2121PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
package/mac80211/patches/000-compile_fix.patch
1--- a/config.mk
2@@ -502,7 +502,7 @@ CONFIG_ATH6KL_ENABLE_TARGET_DEBUG_PRINTS
3 # CONFIG_ATH6KL_SKIP_ABI_VERSION_CHECK is not set
4 CONFIG_ATH6KL_VIRTUAL_SCATTER_GATHER=y
5 CONFIG_ATH6K_LEGACY=m
6-endif
7+endif #CONFIG_COMPAT_KERNEL_32
8 endif
9
10
package/mac80211/patches/001-disable_b44.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -268,8 +268,8 @@ endif
3@@ -292,8 +292,8 @@ endif
44
55 CONFIG_P54_PCI=m
66
package/mac80211/patches/002-disable_rfkill.patch
99
1010 ifeq ($(CONFIG_MAC80211),y)
1111 $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
12@@ -495,8 +495,8 @@ endif
12@@ -557,8 +557,8 @@ endif #CONFIG_COMPAT_KERNEL_27
1313 # We need the backported rfkill module on kernel < 2.6.31.
1414 # In more recent kernel versions use the in kernel rfkill module.
1515 ifdef CONFIG_COMPAT_KERNEL_31
...... 
1919+# CONFIG_RFKILL_BACKPORT=m
2020+# CONFIG_RFKILL_BACKPORT_LEDS=y
2121+# CONFIG_RFKILL_BACKPORT_INPUT=y
22 endif
22 endif #CONFIG_COMPAT_KERNEL_31
2323
package/mac80211/patches/003-disable_bt.patch
99+# CONFIG_COMPAT_BLUETOOTH=y
1010+# CONFIG_COMPAT_BLUETOOTH_MODULES=m
1111 endif
12 endif # Kernel >= 2.6.26
12 endif #CONFIG_COMPAT_KERNEL_27
1313
package/mac80211/patches/005-disable_ssb_build.patch
1919 else
2020 include $(KLIB_BUILD)/.config
2121 endif
22@@ -251,21 +250,6 @@ CONFIG_IPW2200_QOS=y
22@@ -275,21 +274,6 @@ CONFIG_IPW2200_QOS=y
2323 #
2424 # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
2525
...... 
4141 CONFIG_P54_PCI=m
4242
4343 # CONFIG_B44=m
44@@ -429,7 +413,6 @@ endif # end of SPI driver list
44@@ -463,7 +447,6 @@ endif # end of SPI driver list
4545
4646 ifneq ($(CONFIG_MMC),)
4747
4848-CONFIG_SSB_SDIOHOST=y
4949 CONFIG_B43_SDIO=y
50 CONFIG_WL1251_SDIO=m
5150
51 ifneq ($(CONFIG_CRC7),)
package/mac80211/patches/007-remove_misc_drivers.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -282,13 +282,13 @@ endif
3@@ -196,7 +196,7 @@ ifneq ($(CONFIG_WIRELESS_EXT),)
4 endif
5
6 ifneq ($(CONFIG_STAGING),)
7-CONFIG_COMPAT_STAGING=m
8+# CONFIG_COMPAT_STAGING=m
9 endif
10
11 # mac80211 test driver
12@@ -306,13 +306,13 @@ endif
413 CONFIG_MWL8K=m
514
615 # Ethernet drivers go here
...... 
1322 ifdef CONFIG_COMPAT_KERNEL_27
1423-CONFIG_ATL1C=n
1524+# CONFIG_ATL1C=n
16 else
25 else #CONFIG_COMPAT_KERNEL_27
1726-CONFIG_ATL1C=m
1827+# CONFIG_ATL1C=m
19 endif
28 endif #CONFIG_COMPAT_KERNEL_27
2029
2130 CONFIG_HERMES=m
22@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
23 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
24 CONFIG_USB_NET_COMPAT_CDCETHER=n
25 else
31@@ -361,17 +361,17 @@ CONFIG_ZD1211RW=m
32 # Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
33 # it also requires new RNDIS_HOST and CDC_ETHER modules which we add
34 ifdef CONFIG_COMPAT_KERNEL_29
35-CONFIG_USB_COMPAT_USBNET=n
36-CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
37-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
38-CONFIG_USB_NET_COMPAT_CDCETHER=n
39+# CONFIG_USB_COMPAT_USBNET=n
40+# CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
41+# CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
42+# CONFIG_USB_NET_COMPAT_CDCETHER=n
43 else #CONFIG_COMPAT_KERNEL_29
2644-CONFIG_USB_COMPAT_USBNET=m
45+# CONFIG_USB_COMPAT_USBNET=m
46 ifdef CONFIG_USB_NET_CDCETHER
2747-CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
2848-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
29-CONFIG_USB_NET_COMPAT_CDCETHER=m
30+# CONFIG_USB_COMPAT_USBNET=m
3149+# CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
3250+# CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
51 endif #CONFIG_USB_NET_CDCETHER
52-CONFIG_USB_NET_COMPAT_CDCETHER=m
3353+# CONFIG_USB_NET_COMPAT_CDCETHER=m
34 endif
54 endif #CONFIG_COMPAT_KERNEL_29
3555
3656
57@@ -474,17 +474,17 @@ CONFIG_BT_MRVL_SDIO=m
58
59 ifneq ($(CONFIG_COMPAT_STAGING),)
60 ifdef CONFIG_COMPAT_KERNEL_32
61-CONFIG_ATH6KL_CFG80211=y
62-CONFIG_ATH6KL_DEBUG=y
63+# CONFIG_ATH6KL_CFG80211=y
64+# CONFIG_ATH6KL_DEBUG=y
65 # CONFIG_ATH6KL_DISABLE_TARGET_DBGLOGS is not set
66 # CONFIG_ATH6KL_ENABLE_COEXISTENCE is not set
67 # CONFIG_ATH6KL_ENABLE_HOST_DEBUG is not set
68-CONFIG_ATH6KL_ENABLE_TARGET_DEBUG_PRINTS=y
69+# CONFIG_ATH6KL_ENABLE_TARGET_DEBUG_PRINTS=y
70 # CONFIG_ATH6KL_HCI_BRIDGE is not set
71 # CONFIG_ATH6KL_HTC_RAW_INTERFACE is not set
72 # CONFIG_ATH6KL_SKIP_ABI_VERSION_CHECK is not set
73-CONFIG_ATH6KL_VIRTUAL_SCATTER_GATHER=y
74-CONFIG_ATH6K_LEGACY=m
75+# CONFIG_ATH6KL_VIRTUAL_SCATTER_GATHER=y
76+# CONFIG_ATH6K_LEGACY=m
77 endif #CONFIG_COMPAT_KERNEL_32
78 endif
79
package/mac80211/patches/010-no_pcmcia.patch
99 else
1010 include $(KLIB_BUILD)/.config
1111 endif
12@@ -192,7 +192,7 @@ CONFIG_B43=m
12@@ -216,7 +216,7 @@ CONFIG_B43=m
1313 CONFIG_B43_HWRNG=y
1414 CONFIG_B43_PCI_AUTOSELECT=y
1515 ifneq ($(CONFIG_PCMCIA),)
package/mac80211/patches/011-no_sdio.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -398,7 +398,7 @@ endif # end of SPI driver list
3@@ -432,7 +432,7 @@ endif # end of SPI driver list
44
55 ifneq ($(CONFIG_MMC),)
66
77-CONFIG_B43_SDIO=y
88+# CONFIG_B43_SDIO=y
9 CONFIG_WL1251_SDIO=m
109
11 ifndef CONFIG_COMPAT_KERNEL_32
10 ifneq ($(CONFIG_CRC7),)
11 CONFIG_WL1251_SDIO=m
package/mac80211/patches/013-disable_b43_nphy.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -196,7 +196,7 @@ ifneq ($(CONFIG_PCMCIA),)
3@@ -220,7 +220,7 @@ ifneq ($(CONFIG_PCMCIA),)
44 endif
55 CONFIG_B43_LEDS=y
66 CONFIG_B43_PHY_LP=y
package/mac80211/patches/015-remove-rt2x00-options.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -244,12 +244,12 @@ CONFIG_RTL8180=m
3@@ -268,12 +268,12 @@ CONFIG_RTL8180=m
44
55 CONFIG_ADM8211=m
66
...... 
1515 # CONFIG_RT2800PCI_RT30XX=y
1616 # CONFIG_RT2800PCI_RT35XX=y
1717 # CONFIG_RT2800PCI_SOC=y
18@@ -355,7 +355,7 @@ CONFIG_RT2800USB_RT30XX=y
18@@ -382,7 +382,7 @@ CONFIG_RT2800USB_RT30XX=y
1919 CONFIG_RT2800USB_RT35XX=y
2020 CONFIG_RT2800USB_UNKNOWN=y
2121 endif
package/mac80211/patches/030-backport_93c86_eeprom.patch
11--- a/include/linux/compat-2.6.36.h
22+++ b/include/linux/compat-2.6.36.h
3@@ -8,6 +8,8 @@
4 #define kparam_block_sysfs_write(a)
5 #define kparam_unblock_sysfs_write(a)
3@@ -15,6 +15,8 @@ struct va_format {
4
5 #define device_rename(dev, new_name) device_rename(dev, (char *)new_name)
66
77+#define PCI_EEPROM_WIDTH_93C86 8
88+
package/mac80211/patches/100-disable_pcmcia_compat.patch
11--- a/compat/compat-2.6.28.c
22+++ b/compat/compat-2.6.28.c
3@@ -87,7 +87,7 @@ EXPORT_SYMBOL_GPL(usb_poison_urb);
3@@ -89,7 +89,7 @@ EXPORT_SYMBOL_GPL(usb_poison_urb);
44 #endif
55 #endif /* CONFIG_USB */
66
package/mac80211/patches/110-disable_usb_compat.patch
11--- a/compat/compat-2.6.28.c
22+++ b/compat/compat-2.6.28.c
3@@ -166,7 +166,7 @@ EXPORT_SYMBOL(pcmcia_loop_config);
3@@ -168,7 +168,7 @@ EXPORT_SYMBOL(pcmcia_loop_config);
44
55 #endif /* CONFIG_PCMCIA */
66
...... 
1111 {
1212--- a/compat/compat-2.6.29.c
1313+++ b/compat/compat-2.6.29.c
14@@ -51,7 +51,7 @@ void netdev_attach_ops(struct net_device
14@@ -52,7 +52,7 @@ void netdev_attach_ops(struct net_device
1515 EXPORT_SYMBOL(netdev_attach_ops);
1616
1717 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
package/mac80211/patches/120-pm_qos_params.patch
1+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
2@@ -174,7 +174,9 @@ that only one external action is invoked
3 #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
4 #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
5
6+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
7 static struct pm_qos_request_list *ipw2100_pm_qos_req;
8+#endif
9
10 /* Debugging stuff */
11 #ifdef CONFIG_IPW2100_DEBUG
12@@ -1741,7 +1743,11 @@ static int ipw2100_up(struct ipw2100_pri
13     /* the ipw2100 hardware really doesn't want power management delays
14      * longer than 175usec
15      */
16+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
17     pm_qos_update_request(ipw2100_pm_qos_req, 175);
18+#else
19+ pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", 175);
20+#endif
21
22     /* If the interrupt is enabled, turn it off... */
23     spin_lock_irqsave(&priv->low_lock, flags);
24@@ -1889,7 +1895,12 @@ static void ipw2100_down(struct ipw2100_
25     ipw2100_disable_interrupts(priv);
26     spin_unlock_irqrestore(&priv->low_lock, flags);
27
28+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
29     pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE);
30+#else
31+ pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100",
32+ PM_QOS_DEFAULT_VALUE);
33+#endif
34
35     /* We have to signal any supplicant if we are disassociating */
36     if (associated)
37@@ -6669,7 +6680,11 @@ static int __init ipw2100_init(void)
38     if (ret)
39         goto out;
40
41+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
42     ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
43+#else
44+ pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100",
45+#endif
46             PM_QOS_DEFAULT_VALUE);
47 #ifdef CONFIG_IPW2100_DEBUG
48     ipw2100_debug_level = debug;
49@@ -6692,7 +6707,11 @@ static void __exit ipw2100_exit(void)
50                &driver_attr_debug_level);
51 #endif
52     pci_unregister_driver(&ipw2100_pci_driver);
53+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
54     pm_qos_remove_request(ipw2100_pm_qos_req);
55+#else
56+ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100");
57+#endif
58 }
59
60 module_init(ipw2100_init);
package/mac80211/patches/130-printk_debug_revert.patch
11--- a/include/net/cfg80211.h
22+++ b/include/net/cfg80211.h
3@@ -2443,9 +2443,8 @@ void cfg80211_cqm_rssi_notify(struct net
3@@ -2574,9 +2574,8 @@ void cfg80211_cqm_rssi_notify(struct net
44     wiphy_printk(KERN_NOTICE, wiphy, format, ##args)
55 #define wiphy_info(wiphy, format, args...) \
66     wiphy_printk(KERN_INFO, wiphy, format, ##args)
...... 
1414 #define wiphy_dbg(wiphy, format, args...) \
1515--- a/net/wireless/core.c
1616+++ b/net/wireless/core.c
17@@ -921,52 +921,3 @@ static void __exit cfg80211_exit(void)
17@@ -929,52 +929,3 @@ static void __exit cfg80211_exit(void)
1818     destroy_workqueue(cfg80211_wq);
1919 }
2020 module_exit(cfg80211_exit);
package/mac80211/patches/404-ath_regd_optional.patch
1818+#endif
1919--- a/drivers/net/wireless/ath/regd.h
2020+++ b/drivers/net/wireless/ath/regd.h
21@@ -250,6 +250,41 @@ enum CountryCode {
21@@ -249,6 +249,41 @@ enum CountryCode {
2222     CTRY_BELGIUM2 = 5002
2323 };
2424
...... 
6060 bool ath_is_world_regd(struct ath_regulatory *reg);
6161 int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
6262           int (*reg_notifier)(struct wiphy *wiphy,
63@@ -261,3 +296,5 @@ int ath_reg_notifier_apply(struct wiphy
63@@ -260,3 +295,5 @@ int ath_reg_notifier_apply(struct wiphy
6464                struct ath_regulatory *reg);
6565
6666 #endif
package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch
11--- a/drivers/net/wireless/ath/ath9k/hw.c
22+++ b/drivers/net/wireless/ath/ath9k/hw.c
3@@ -1418,7 +1418,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
3@@ -1425,7 +1425,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
44
55     if (ah->config.rx_intr_mitigation) {
66         REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch
5454                   ath9k_reg_notifier);
5555--- a/drivers/net/wireless/ath/ath9k/ath9k.h
5656+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
57@@ -596,6 +596,8 @@ struct ath_softc {
57@@ -589,6 +589,8 @@ struct ath_softc {
5858
5959     int beacon_interval;
6060
package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch
1313         sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
1414--- a/drivers/net/wireless/ath/ath9k/ath9k.h
1515+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
16@@ -467,6 +467,7 @@ void ath9k_btcoex_timer_pause(struct ath
16@@ -460,6 +460,7 @@ void ath9k_btcoex_timer_pause(struct ath
1717
1818 #define ATH_LED_PIN_DEF 1
1919 #define ATH_LED_PIN_9287 8
package/mac80211/patches/450-add-ath5k-platform.patch
1diff -Nur a/include/linux/ath5k_platform.h b/include/linux/ath5k_platform.h
2+++ b/include/linux/ath5k_platform.h 2010-06-21 00:19:52.000000000 +0200
1--- /dev/null
32@@ -0,0 +1,30 @@
43+/*
54+ * Copyright (c) 2008 Atheros Communications Inc.
...... 
3231+};
3332+
3433+#endif /* _LINUX_ATH5K_PLATFORM_H */
35
package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch
1+++ b/drivers/net/wireless/ath/ath5k/eeprom.c 2010-06-23 05:59:30.000000000 +0200
2@@ -22,6 +23,8 @@
1--- a/drivers/net/wireless/ath/ath5k/eeprom.c
2@@ -22,6 +22,8 @@
33 \*************************************/
44
55 #include <linux/slab.h>
...... 
99
1010 #include "ath5k.h"
1111 #include "reg.h"
12@@ -34,6 +37,18 @@
12@@ -34,6 +36,18 @@
1313 static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data)
1414 {
1515     u32 status, timeout;
...... 
2828
2929     /*
3030      * Initialize EEPROM access
31@@ -1788,7 +1802,7 @@
31@@ -1788,7 +1802,7 @@ ath5k_eeprom_init(struct ath5k_hw *ah)
3232 }
3333
3434 /*
...... 
3737  */
3838 int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
3939 {
40@@ -1796,6 +1810,16 @@
40@@ -1796,6 +1810,16 @@ int ath5k_eeprom_read_mac(struct ath5k_h
4141     u32 total, offset;
4242     u16 data;
4343     int octet, ret;
...... 
5454
5555     ret = ath5k_hw_eeprom_read(ah, 0x20, &data);
5656     if (ret)
57
package/mac80211/patches/510-ath9k_handle_keymiss.patch
11--- a/drivers/net/wireless/ath/ath9k/mac.c
22+++ b/drivers/net/wireless/ath/ath9k/mac.c
3@@ -713,6 +713,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
4             rs->rs_status |= ATH9K_RXERR_DECRYPT;
5         else if (ads.ds_rxstatus8 & AR_MichaelErr)
3@@ -714,6 +714,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
4         else if ((ads.ds_rxstatus8 & AR_MichaelErr) &&
5                  rs->rs_keyix != ATH9K_RXKEYIX_INVALID)
66             rs->rs_status |= ATH9K_RXERR_MIC;
77+ else if (ads.ds_rxstatus8 & AR_KeyMiss)
88+ rs->rs_status |= ATH9K_RXERR_DECRYPT;
package/mac80211/patches/520-ath9k_baw_fix.patch
1--- a/drivers/net/wireless/ath/ath9k/ath9k.h
2@@ -254,7 +254,7 @@ struct ath_atx_tid {
3     struct list_head buf_q;
4     struct ath_node *an;
5     struct ath_atx_ac *ac;
6- struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
7+ unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
8     u16 seq_start;
9     u16 seq_next;
10     u16 baw_size;
11--- a/drivers/net/wireless/ath/ath9k/xmit.c
12@@ -168,9 +168,9 @@ static void ath_tx_update_baw(struct ath
13     index = ATH_BA_INDEX(tid->seq_start, seqno);
14     cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
15
16- tid->tx_buf[cindex] = NULL;
17+ __clear_bit(cindex, tid->tx_buf);
18
19- while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) {
20+ while (tid->baw_head != tid->baw_tail && !test_bit(tid->baw_head, tid->tx_buf)) {
21         INCR(tid->seq_start, IEEE80211_SEQ_MAX);
22         INCR(tid->baw_head, ATH_TID_MAX_BUFS);
23     }
24@@ -186,9 +186,7 @@ static void ath_tx_addto_baw(struct ath_
25
26     index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
27     cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
28-
29- BUG_ON(tid->tx_buf[cindex] != NULL);
30- tid->tx_buf[cindex] = bf;
31+ __set_bit(cindex, tid->tx_buf);
32
33     if (index >= ((tid->baw_tail - tid->baw_head) &
34         (ATH_TID_MAX_BUFS - 1))) {
package/mac80211/patches/520-pending_work.patch
1+++ b/net/mac80211/main.c
2@@ -103,11 +103,13 @@ int ieee80211_hw_config(struct ieee80211
3     int ret = 0;
4     int power;
5     enum nl80211_channel_type channel_type;
6+ u32 offchannel_flag;
7
8     might_sleep();
9
10     scan_chan = local->scan_channel;
11
12+ offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
13     if (scan_chan) {
14         chan = scan_chan;
15         channel_type = NL80211_CHAN_NO_HT;
16@@ -121,8 +123,9 @@ int ieee80211_hw_config(struct ieee80211
17         channel_type = local->_oper_channel_type;
18         local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
19     }
20+ offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
21
22- if (chan != local->hw.conf.channel ||
23+ if (offchannel_flag || chan != local->hw.conf.channel ||
24         channel_type != local->hw.conf.channel_type) {
25         local->hw.conf.channel = chan;
26         local->hw.conf.channel_type = channel_type;
27+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
28@@ -63,6 +63,7 @@ static bool ar9002_hw_per_calibration(st
29                       u8 rxchainmask,
30                       struct ath9k_cal_list *currCal)
31 {
32+ struct ath9k_hw_cal_data *caldata = ah->caldata;
33     bool iscaldone = false;
34
35     if (currCal->calState == CAL_RUNNING) {
36@@ -81,14 +82,14 @@ static bool ar9002_hw_per_calibration(st
37                 }
38
39                 currCal->calData->calPostProc(ah, numChains);
40- ichan->CalValid |= currCal->calData->calType;
41+ caldata->CalValid |= currCal->calData->calType;
42                 currCal->calState = CAL_DONE;
43                 iscaldone = true;
44             } else {
45                 ar9002_hw_setup_calibration(ah, currCal);
46             }
47         }
48- } else if (!(ichan->CalValid & currCal->calData->calType)) {
49+ } else if (!(caldata->CalValid & currCal->calData->calType)) {
50         ath9k_hw_reset_calibration(ah, currCal);
51     }
52
53@@ -686,8 +687,13 @@ static bool ar9002_hw_calibrate(struct a
54 {
55     bool iscaldone = true;
56     struct ath9k_cal_list *currCal = ah->cal_list_curr;
57+ bool nfcal, nfcal_pending = false;
58
59- if (currCal &&
60+ nfcal = !!(REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF);
61+ if (ah->caldata)
62+ nfcal_pending = ah->caldata->nfcal_pending;
63+
64+ if (currCal && !nfcal &&
65         (currCal->calState == CAL_RUNNING ||
66          currCal->calState == CAL_WAITING)) {
67         iscaldone = ar9002_hw_per_calibration(ah, chan,
68@@ -703,7 +709,7 @@ static bool ar9002_hw_calibrate(struct a
69     }
70
71     /* Do NF cal only at longer intervals */
72- if (longcal) {
73+ if (longcal || nfcal_pending) {
74         /* Do periodic PAOffset Cal */
75         ar9002_hw_pa_cal(ah, false);
76         ar9002_hw_olc_temp_compensation(ah);
77@@ -712,16 +718,18 @@ static bool ar9002_hw_calibrate(struct a
78          * Get the value from the previous NF cal and update
79          * history buffer.
80          */
81- ath9k_hw_getnf(ah, chan);
82-
83- /*
84- * Load the NF from history buffer of the current channel.
85- * NF is slow time-variant, so it is OK to use a historical
86- * value.
87- */
88- ath9k_hw_loadnf(ah, ah->curchan);
89+ if (ath9k_hw_getnf(ah, chan)) {
90+ /*
91+ * Load the NF from history buffer of the current
92+ * channel.
93+ * NF is slow time-variant, so it is OK to use a
94+ * historical value.
95+ */
96+ ath9k_hw_loadnf(ah, ah->curchan);
97+ }
98
99- ath9k_hw_start_nfcal(ah);
100+ if (longcal)
101+ ath9k_hw_start_nfcal(ah, false);
102     }
103
104     return iscaldone;
105@@ -869,8 +877,10 @@ static bool ar9002_hw_init_cal(struct at
106     ar9002_hw_pa_cal(ah, true);
107
108     /* Do NF Calibration after DC offset and other calibrations */
109- REG_WRITE(ah, AR_PHY_AGC_CONTROL,
110- REG_READ(ah, AR_PHY_AGC_CONTROL) | AR_PHY_AGC_CONTROL_NF);
111+ ath9k_hw_start_nfcal(ah, true);
112+
113+ if (ah->caldata)
114+ ah->caldata->nfcal_pending = true;
115
116     ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
117
118@@ -901,7 +911,8 @@ static bool ar9002_hw_init_cal(struct at
119             ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
120     }
121
122- chan->CalValid = 0;
123+ if (ah->caldata)
124+ ah->caldata->CalValid = 0;
125
126     return true;
127 }
128+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
129@@ -68,6 +68,7 @@ static bool ar9003_hw_per_calibration(st
130                       u8 rxchainmask,
131                       struct ath9k_cal_list *currCal)
132 {
133+ struct ath9k_hw_cal_data *caldata = ah->caldata;
134     /* Cal is assumed not done until explicitly set below */
135     bool iscaldone = false;
136
137@@ -95,7 +96,7 @@ static bool ar9003_hw_per_calibration(st
138                 currCal->calData->calPostProc(ah, numChains);
139
140                 /* Calibration has finished. */
141- ichan->CalValid |= currCal->calData->calType;
142+ caldata->CalValid |= currCal->calData->calType;
143                 currCal->calState = CAL_DONE;
144                 iscaldone = true;
145             } else {
146@@ -106,7 +107,7 @@ static bool ar9003_hw_per_calibration(st
147             ar9003_hw_setup_calibration(ah, currCal);
148             }
149         }
150- } else if (!(ichan->CalValid & currCal->calData->calType)) {
151+ } else if (!(caldata->CalValid & currCal->calData->calType)) {
152         /* If current cal is marked invalid in channel, kick it off */
153         ath9k_hw_reset_calibration(ah, currCal);
154     }
155@@ -149,6 +150,12 @@ static bool ar9003_hw_calibrate(struct a
156     /* Do NF cal only at longer intervals */
157     if (longcal) {
158         /*
159+ * Get the value from the previous NF cal and update
160+ * history buffer.
161+ */
162+ ath9k_hw_getnf(ah, chan);
163+
164+ /*
165          * Load the NF from history buffer of the current channel.
166          * NF is slow time-variant, so it is OK to use a historical
167          * value.
168@@ -156,7 +163,7 @@ static bool ar9003_hw_calibrate(struct a
169         ath9k_hw_loadnf(ah, ah->curchan);
170
171         /* start NF calibration, without updating BB NF register */
172- ath9k_hw_start_nfcal(ah);
173+ ath9k_hw_start_nfcal(ah, false);
174     }
175
176     return iscaldone;
177@@ -762,6 +769,8 @@ static bool ar9003_hw_init_cal(struct at
178     /* Revert chainmasks to their original values before NF cal */
179     ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
180
181+ ath9k_hw_start_nfcal(ah, true);
182+
183     /* Initialize list pointers */
184     ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
185
186@@ -785,7 +794,8 @@ static bool ar9003_hw_init_cal(struct at
187     if (ah->cal_list_curr)
188         ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
189
190- chan->CalValid = 0;
191+ if (ah->caldata)
192+ ah->caldata->CalValid = 0;
193
194     return true;
195 }
196+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
197@@ -542,7 +542,11 @@ static void ar9003_hw_prog_ini(struct at
198         u32 reg = INI_RA(iniArr, i, 0);
199         u32 val = INI_RA(iniArr, i, column);
200
201- REG_WRITE(ah, reg, val);
202+ if (reg >= 0x16000 && reg < 0x17000)
203+ ath9k_hw_analog_shift_regwrite(ah, reg, val);
204+ else
205+ REG_WRITE(ah, reg, val);
206+
207         DO_DELAY(regWrites);
208     }
209 }
210+++ b/drivers/net/wireless/ath/ath9k/calib.c
211@@ -22,23 +22,6 @@
212 /* We can tune this as we go by monitoring really low values */
213 #define ATH9K_NF_TOO_LOW -60
214
215-/* AR5416 may return very high value (like -31 dBm), in those cases the nf
216- * is incorrect and we should use the static NF value. Later we can try to
217- * find out why they are reporting these values */
218-
219-static bool ath9k_hw_nf_in_range(struct ath_hw *ah, s16 nf)
220-{
221- if (nf > ATH9K_NF_TOO_LOW) {
222- ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
223- "noise floor value detected (%d) is "
224- "lower than what we think is a "
225- "reasonable value (%d)\n",
226- nf, ATH9K_NF_TOO_LOW);
227- return false;
228- }
229- return true;
230-}
231-
232 static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)
233 {
234     int16_t nfval;
235@@ -121,6 +104,19 @@ void ath9k_hw_reset_calibration(struct a
236     ah->cal_samples = 0;
237 }
238
239+static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
240+ struct ath9k_channel *chan)
241+{
242+ struct ath_nf_limits *limit;
243+
244+ if (!chan || IS_CHAN_2GHZ(chan))
245+ limit = &ah->nf_2g;
246+ else
247+ limit = &ah->nf_5g;
248+
249+ return limit->nominal;
250+}
251+
252 /* This is done for the currently configured channel */
253 bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
254 {
255@@ -128,7 +124,7 @@ bool ath9k_hw_reset_calvalid(struct ath_
256     struct ieee80211_conf *conf = &common->hw->conf;
257     struct ath9k_cal_list *currCal = ah->cal_list_curr;
258
259- if (!ah->curchan)
260+ if (!ah->caldata)
261         return true;
262
263     if (!AR_SREV_9100(ah) && !AR_SREV_9160_10_OR_LATER(ah))
264@@ -151,37 +147,55 @@ bool ath9k_hw_reset_calvalid(struct ath_
265           "Resetting Cal %d state for channel %u\n",
266           currCal->calData->calType, conf->channel->center_freq);
267
268- ah->curchan->CalValid &= ~currCal->calData->calType;
269+ ah->caldata->CalValid &= ~currCal->calData->calType;
270     currCal->calState = CAL_WAITING;
271
272     return false;
273 }
274 EXPORT_SYMBOL(ath9k_hw_reset_calvalid);
275
276-void ath9k_hw_start_nfcal(struct ath_hw *ah)
277+void ath9k_hw_start_nfcal(struct ath_hw *ah, bool update)
278 {
279+ if (ah->caldata)
280+ ah->caldata->nfcal_pending = true;
281+
282     REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
283             AR_PHY_AGC_CONTROL_ENABLE_NF);
284- REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
285+
286+ if (update)
287+ REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL,
288+ AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
289+ else
290+ REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
291             AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
292+
293     REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
294 }
295
296 void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
297 {
298- struct ath9k_nfcal_hist *h;
299+ struct ath9k_nfcal_hist *h = NULL;
300     unsigned i, j;
301     int32_t val;
302     u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
303     struct ath_common *common = ath9k_hw_common(ah);
304+ s16 default_nf = ath9k_hw_get_default_nf(ah, chan);
305
306- h = ah->nfCalHist;
307+ if (ah->caldata)
308+ h = ah->caldata->nfCalHist;
309
310     for (i = 0; i < NUM_NF_READINGS; i++) {
311         if (chainmask & (1 << i)) {
312+ s16 nfval;
313+
314+ if (h)
315+ nfval = h[i].privNF;
316+ else
317+ nfval = default_nf;
318+
319             val = REG_READ(ah, ah->nf_regs[i]);
320             val &= 0xFFFFFE00;
321- val |= (((u32) (h[i].privNF) << 1) & 0x1ff);
322+ val |= (((u32) nfval << 1) & 0x1ff);
323             REG_WRITE(ah, ah->nf_regs[i], val);
324         }
325     }
326@@ -277,22 +291,25 @@ static void ath9k_hw_nf_sanitize(struct
327     }
328 }
329
330-int16_t ath9k_hw_getnf(struct ath_hw *ah,
331- struct ath9k_channel *chan)
332+bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
333 {
334     struct ath_common *common = ath9k_hw_common(ah);
335     int16_t nf, nfThresh;
336     int16_t nfarray[NUM_NF_READINGS] = { 0 };
337     struct ath9k_nfcal_hist *h;
338     struct ieee80211_channel *c = chan->chan;
339+ struct ath9k_hw_cal_data *caldata = ah->caldata;
340+
341+ if (!caldata)
342+ return false;
343
344     chan->channelFlags &= (~CHANNEL_CW_INT);
345     if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
346         ath_print(common, ATH_DBG_CALIBRATE,
347               "NF did not complete in calibration window\n");
348         nf = 0;
349- chan->rawNoiseFloor = nf;
350- return chan->rawNoiseFloor;
351+ caldata->rawNoiseFloor = nf;
352+ return false;
353     } else {
354         ath9k_hw_do_getnf(ah, nfarray);
355         ath9k_hw_nf_sanitize(ah, nfarray);
356@@ -307,47 +324,40 @@ int16_t ath9k_hw_getnf(struct ath_hw *ah
357         }
358     }
359
360- h = ah->nfCalHist;
361-
362+ h = caldata->nfCalHist;
363+ caldata->nfcal_pending = false;
364     ath9k_hw_update_nfcal_hist_buffer(h, nfarray);
365- chan->rawNoiseFloor = h[0].privNF;
366-
367- return chan->rawNoiseFloor;
368+ caldata->rawNoiseFloor = h[0].privNF;
369+ return true;
370 }
371
372-void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah)
373+void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah,
374+ struct ath9k_channel *chan)
375 {
376- struct ath_nf_limits *limit;
377+ struct ath9k_nfcal_hist *h;
378+ s16 default_nf;
379     int i, j;
380
381- if (!ah->curchan || IS_CHAN_2GHZ(ah->curchan))
382- limit = &ah->nf_2g;
383- else
384- limit = &ah->nf_5g;
385+ if (!ah->caldata)
386+ return;
387
388+ h = ah->caldata->nfCalHist;
389+ default_nf = ath9k_hw_get_default_nf(ah, chan);
390     for (i = 0; i < NUM_NF_READINGS; i++) {
391- ah->nfCalHist[i].currIndex = 0;
392- ah->nfCalHist[i].privNF = limit->nominal;
393- ah->nfCalHist[i].invalidNFcount =
394- AR_PHY_CCA_FILTERWINDOW_LENGTH;
395+ h[i].currIndex = 0;
396+ h[i].privNF = default_nf;
397+ h[i].invalidNFcount = AR_PHY_CCA_FILTERWINDOW_LENGTH;
398         for (j = 0; j < ATH9K_NF_CAL_HIST_MAX; j++) {
399- ah->nfCalHist[i].nfCalBuffer[j] = limit->nominal;
400+ h[i].nfCalBuffer[j] = default_nf;
401         }
402     }
403 }
404
405 s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
406 {
407- s16 nf;
408-
409- if (chan->rawNoiseFloor == 0)
410- nf = -96;
411- else
412- nf = chan->rawNoiseFloor;
413-
414- if (!ath9k_hw_nf_in_range(ah, nf))
415- nf = ATH_DEFAULT_NOISE_FLOOR;
416+ if (!ah->caldata || !ah->caldata->rawNoiseFloor)
417+ return ath9k_hw_get_default_nf(ah, chan);
418
419- return nf;
420+ return ah->caldata->rawNoiseFloor;
421 }
422 EXPORT_SYMBOL(ath9k_hw_getchan_noise);
423+++ b/drivers/net/wireless/ath/ath9k/calib.h
424@@ -108,11 +108,11 @@ struct ath9k_pacal_info{
425 };
426
427 bool ath9k_hw_reset_calvalid(struct ath_hw *ah);
428-void ath9k_hw_start_nfcal(struct ath_hw *ah);
429+void ath9k_hw_start_nfcal(struct ath_hw *ah, bool update);
430 void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan);
431-int16_t ath9k_hw_getnf(struct ath_hw *ah,
432- struct ath9k_channel *chan);
433-void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah);
434+bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan);
435+void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah,
436+ struct ath9k_channel *chan);
437 s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan);
438 void ath9k_hw_reset_calibration(struct ath_hw *ah,
439                 struct ath9k_cal_list *currCal);
440+++ b/drivers/net/wireless/ath/ath9k/hw.c
441@@ -622,7 +622,6 @@ static int __ath9k_hw_init(struct ath_hw
442     else
443         ah->tx_trig_level = (AR_FTRIG_512B >> AR_FTRIG_S);
444
445- ath9k_init_nfcal_hist_buffer(ah);
446     ah->bb_watchdog_timeout_ms = 25;
447
448     common->state = ATH_HW_INITIALIZED;
449@@ -1195,9 +1194,6 @@ static bool ath9k_hw_channel_change(stru
450
451     ath9k_hw_spur_mitigate_freq(ah, chan);
452
453- if (!chan->oneTimeCalsDone)
454- chan->oneTimeCalsDone = true;
455-
456     return true;
457 }
458
459@@ -1230,7 +1226,7 @@ bool ath9k_hw_check_alive(struct ath_hw
460 EXPORT_SYMBOL(ath9k_hw_check_alive);
461
462 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
463- bool bChannelChange)
464+ struct ath9k_hw_cal_data *caldata, bool bChannelChange)
465 {
466     struct ath_common *common = ath9k_hw_common(ah);
467     u32 saveLedState;
468@@ -1255,9 +1251,19 @@ int ath9k_hw_reset(struct ath_hw *ah, st
469     if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
470         return -EIO;
471
472- if (curchan && !ah->chip_fullsleep)
473+ if (curchan && !ah->chip_fullsleep && ah->caldata)
474         ath9k_hw_getnf(ah, curchan);
475
476+ ah->caldata = caldata;
477+ if (caldata &&
478+ (chan->channel != caldata->channel ||
479+ (chan->channelFlags & ~CHANNEL_CW_INT) !=
480+ (caldata->channelFlags & ~CHANNEL_CW_INT))) {
481+ /* Operating channel changed, reset channel calibration data */
482+ memset(caldata, 0, sizeof(*caldata));
483+ ath9k_init_nfcal_hist_buffer(ah, chan);
484+ }
485+
486     if (bChannelChange &&
487         (ah->chip_fullsleep != true) &&
488         (ah->curchan != NULL) &&
489@@ -1268,7 +1274,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
490
491         if (ath9k_hw_channel_change(ah, chan)) {
492             ath9k_hw_loadnf(ah, ah->curchan);
493- ath9k_hw_start_nfcal(ah);
494+ ath9k_hw_start_nfcal(ah, true);
495             return 0;
496         }
497     }
498@@ -1473,11 +1479,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
499     if (ah->btcoex_hw.enabled)
500         ath9k_hw_btcoex_enable(ah);
501
502- if (AR_SREV_9300_20_OR_LATER(ah)) {
503- ath9k_hw_loadnf(ah, curchan);
504- ath9k_hw_start_nfcal(ah);
505+ if (AR_SREV_9300_20_OR_LATER(ah))
506         ar9003_hw_bb_watchdog_config(ah);
507- }
508
509     return 0;
510 }
511+++ b/drivers/net/wireless/ath/ath9k/main.c
512@@ -155,6 +155,27 @@ void ath9k_ps_restore(struct ath_softc *
513     spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
514 }
515
516+static void ath_start_ani(struct ath_common *common)
517+{
518+ struct ath_hw *ah = common->ah;
519+ unsigned long timestamp = jiffies_to_msecs(jiffies);
520+ struct ath_softc *sc = (struct ath_softc *) common->priv;
521+
522+ if (!(sc->sc_flags & SC_OP_ANI_RUN))
523+ return;
524+
525+ if (sc->sc_flags & SC_OP_OFFCHANNEL)
526+ return;
527+
528+ common->ani.longcal_timer = timestamp;
529+ common->ani.shortcal_timer = timestamp;
530+ common->ani.checkani_timer = timestamp;
531+
532+ mod_timer(&common->ani.timer,
533+ jiffies +
534+ msecs_to_jiffies((u32)ah->config.ani_poll_interval));
535+}
536+
537 /*
538  * Set/change channels. If the channel is really being changed, it's done
539  * by reseting the chip. To accomplish this we must first cleanup any pending
540@@ -163,16 +184,23 @@ void ath9k_ps_restore(struct ath_softc *
541 int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
542             struct ath9k_channel *hchan)
543 {
544+ struct ath_wiphy *aphy = hw->priv;
545     struct ath_hw *ah = sc->sc_ah;
546     struct ath_common *common = ath9k_hw_common(ah);
547     struct ieee80211_conf *conf = &common->hw->conf;
548     bool fastcc = true, stopped;
549     struct ieee80211_channel *channel = hw->conf.channel;
550+ struct ath9k_hw_cal_data *caldata = NULL;
551     int r;
552
553     if (sc->sc_flags & SC_OP_INVALID)
554         return -EIO;
555
556+ del_timer_sync(&common->ani.timer);
557+ cancel_work_sync(&sc->paprd_work);
558+ cancel_work_sync(&sc->hw_check_work);
559+ cancel_delayed_work_sync(&sc->tx_complete_work);
560+
561     ath9k_ps_wakeup(sc);
562
563     /*
564@@ -192,9 +220,12 @@ int ath_set_channel(struct ath_softc *sc
565      * to flush data frames already in queue because of
566      * changing channel. */
567
568- if (!stopped || (sc->sc_flags & SC_OP_FULL_RESET))
569+ if (!stopped || !(sc->sc_flags & SC_OP_OFFCHANNEL))
570         fastcc = false;
571
572+ if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
573+ caldata = &aphy->caldata;
574+
575     ath_print(common, ATH_DBG_CONFIG,
576           "(%u MHz) -> (%u MHz), conf_is_ht40: %d\n",
577           sc->sc_ah->curchan->channel,
578@@ -202,7 +233,7 @@ int ath_set_channel(struct ath_softc *sc
579
580     spin_lock_bh(&sc->sc_resetlock);
581
582- r = ath9k_hw_reset(ah, hchan, fastcc);
583+ r = ath9k_hw_reset(ah, hchan, caldata, fastcc);
584     if (r) {
585         ath_print(common, ATH_DBG_FATAL,
586               "Unable to reset channel (%u MHz), "
587@@ -213,8 +244,6 @@ int ath_set_channel(struct ath_softc *sc
588     }
589     spin_unlock_bh(&sc->sc_resetlock);
590
591- sc->sc_flags &= ~SC_OP_FULL_RESET;
592-
593     if (ath_startrecv(sc) != 0) {
594         ath_print(common, ATH_DBG_FATAL,
595               "Unable to restart recv logic\n");
596@@ -226,6 +255,12 @@ int ath_set_channel(struct ath_softc *sc
597     ath_update_txpow(sc);
598     ath9k_hw_set_interrupts(ah, ah->imask);
599
600+ if (!(sc->sc_flags & (SC_OP_OFFCHANNEL | SC_OP_SCANNING))) {
601+ ath_start_ani(common);
602+ ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
603+ ath_beacon_config(sc, NULL);
604+ }
605+
606  ps_restore:
607     ath9k_ps_restore(sc);
608     return r;
609@@ -234,17 +269,19 @@ int ath_set_channel(struct ath_softc *sc
610 static void ath_paprd_activate(struct ath_softc *sc)
611 {
612     struct ath_hw *ah = sc->sc_ah;
613+ struct ath9k_hw_cal_data *caldata = ah->caldata;
614     int chain;
615
616- if (!ah->curchan->paprd_done)
617+ if (!caldata || !caldata->paprd_done)
618         return;
619
620     ath9k_ps_wakeup(sc);
621+ ar9003_paprd_enable(ah, false);
622     for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
623         if (!(ah->caps.tx_chainmask & BIT(chain)))
624             continue;
625
626- ar9003_paprd_populate_single_table(ah, ah->curchan, chain);
627+ ar9003_paprd_populate_single_table(ah, caldata, chain);
628     }
629
630     ar9003_paprd_enable(ah, true);
631@@ -262,6 +299,7 @@ void ath_paprd_calibrate(struct work_str
632     int band = hw->conf.channel->band;
633     struct ieee80211_supported_band *sband = &sc->sbands[band];
634     struct ath_tx_control txctl;
635+ struct ath9k_hw_cal_data *caldata = ah->caldata;
636     int qnum, ftype;
637     int chain_ok = 0;
638     int chain;
639@@ -269,6 +307,9 @@ void ath_paprd_calibrate(struct work_str
640     int time_left;
641     int i;
642
643+ if (!caldata)
644+ return;
645+
646     skb = alloc_skb(len, GFP_KERNEL);
647     if (!skb)
648         return;
649@@ -323,7 +364,7 @@ void ath_paprd_calibrate(struct work_str
650         if (!ar9003_paprd_is_done(ah))
651             break;
652
653- if (ar9003_paprd_create_curve(ah, ah->curchan, chain) != 0)
654+ if (ar9003_paprd_create_curve(ah, caldata, chain) != 0)
655             break;
656
657         chain_ok = 1;
658@@ -331,7 +372,7 @@ void ath_paprd_calibrate(struct work_str
659     kfree_skb(skb);
660
661     if (chain_ok) {
662- ah->curchan->paprd_done = true;
663+ caldata->paprd_done = true;
664         ath_paprd_activate(sc);
665     }
666
667@@ -440,33 +481,14 @@ set_timer:
668         cal_interval = min(cal_interval, (u32)short_cal_interval);
669
670     mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval));
671- if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) &&
672- !(sc->sc_flags & SC_OP_SCANNING)) {
673- if (!sc->sc_ah->curchan->paprd_done)
674+ if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->caldata) {
675+ if (!ah->caldata->paprd_done)
676             ieee80211_queue_work(sc->hw, &sc->paprd_work);
677         else
678             ath_paprd_activate(sc);
679     }
680 }
681
682-static void ath_start_ani(struct ath_common *common)
683-{
684- struct ath_hw *ah = common->ah;
685- unsigned long timestamp = jiffies_to_msecs(jiffies);
686- struct ath_softc *sc = (struct ath_softc *) common->priv;
687-
688- if (!(sc->sc_flags & SC_OP_ANI_RUN))
689- return;
690-
691- common->ani.longcal_timer = timestamp;
692- common->ani.shortcal_timer = timestamp;
693- common->ani.checkani_timer = timestamp;
694-
695- mod_timer(&common->ani.timer,
696- jiffies +
697- msecs_to_jiffies((u32)ah->config.ani_poll_interval));
698-}
699-
700 /*
701  * Update tx/rx chainmask. For legacy association,
702  * hard code chainmask to 1x1, for 11n association, use
703@@ -478,7 +500,7 @@ void ath_update_chainmask(struct ath_sof
704     struct ath_hw *ah = sc->sc_ah;
705     struct ath_common *common = ath9k_hw_common(ah);
706
707- if ((sc->sc_flags & SC_OP_SCANNING) || is_ht ||
708+ if ((sc->sc_flags & SC_OP_OFFCHANNEL) || is_ht ||
709         (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) {
710         common->tx_chainmask = ah->caps.tx_chainmask;
711         common->rx_chainmask = ah->caps.rx_chainmask;
712@@ -818,7 +840,7 @@ void ath_radio_enable(struct ath_softc *
713         ah->curchan = ath_get_curchannel(sc, sc->hw);
714
715     spin_lock_bh(&sc->sc_resetlock);
716- r = ath9k_hw_reset(ah, ah->curchan, false);
717+ r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
718     if (r) {
719         ath_print(common, ATH_DBG_FATAL,
720               "Unable to reset channel (%u MHz), "
721@@ -878,7 +900,7 @@ void ath_radio_disable(struct ath_softc
722         ah->curchan = ath_get_curchannel(sc, hw);
723
724     spin_lock_bh(&sc->sc_resetlock);
725- r = ath9k_hw_reset(ah, ah->curchan, false);
726+ r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
727     if (r) {
728         ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
729               "Unable to reset channel (%u MHz), "
730@@ -911,7 +933,7 @@ int ath_reset(struct ath_softc *sc, bool
731     ath_flushrecv(sc);
732
733     spin_lock_bh(&sc->sc_resetlock);
734- r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false);
735+ r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
736     if (r)
737         ath_print(common, ATH_DBG_FATAL,
738               "Unable to reset hardware; reset status %d\n", r);
739@@ -1086,7 +1108,7 @@ static int ath9k_start(struct ieee80211_
740      * and then setup of the interrupt mask.
741      */
742     spin_lock_bh(&sc->sc_resetlock);
743- r = ath9k_hw_reset(ah, init_channel, false);
744+ r = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
745     if (r) {
746         ath_print(common, ATH_DBG_FATAL,
747               "Unable to reset hardware; reset status %d "
748@@ -1580,6 +1602,10 @@ static int ath9k_config(struct ieee80211
749
750         aphy->chan_idx = pos;
751         aphy->chan_is_ht = conf_is_ht(conf);
752+ if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
753+ sc->sc_flags |= SC_OP_OFFCHANNEL;
754+ else
755+ sc->sc_flags &= ~SC_OP_OFFCHANNEL;
756
757         if (aphy->state == ATH_WIPHY_SCAN ||
758             aphy->state == ATH_WIPHY_ACTIVE)
759@@ -1991,7 +2017,6 @@ static void ath9k_sw_scan_start(struct i
760 {
761     struct ath_wiphy *aphy = hw->priv;
762     struct ath_softc *sc = aphy->sc;
763- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
764
765     mutex_lock(&sc->mutex);
766     if (ath9k_wiphy_scanning(sc)) {
767@@ -2009,10 +2034,6 @@ static void ath9k_sw_scan_start(struct i
768     aphy->state = ATH_WIPHY_SCAN;
769     ath9k_wiphy_pause_all_forced(sc, aphy);
770     sc->sc_flags |= SC_OP_SCANNING;
771- del_timer_sync(&common->ani.timer);
772- cancel_work_sync(&sc->paprd_work);
773- cancel_work_sync(&sc->hw_check_work);
774- cancel_delayed_work_sync(&sc->tx_complete_work);
775     mutex_unlock(&sc->mutex);
776 }
777
778@@ -2024,15 +2045,10 @@ static void ath9k_sw_scan_complete(struc
779 {
780     struct ath_wiphy *aphy = hw->priv;
781     struct ath_softc *sc = aphy->sc;
782- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
783
784     mutex_lock(&sc->mutex);
785     aphy->state = ATH_WIPHY_ACTIVE;
786     sc->sc_flags &= ~SC_OP_SCANNING;
787- sc->sc_flags |= SC_OP_FULL_RESET;
788- ath_start_ani(common);
789- ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
790- ath_beacon_config(sc, NULL);
791     mutex_unlock(&sc->mutex);
792 }
793
794+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
795@@ -577,10 +577,11 @@ static bool create_pa_curve(u32 *data_L,
796 }
797
798 void ar9003_paprd_populate_single_table(struct ath_hw *ah,
799- struct ath9k_channel *chan, int chain)
800+ struct ath9k_hw_cal_data *caldata,
801+ int chain)
802 {
803- u32 *paprd_table_val = chan->pa_table[chain];
804- u32 small_signal_gain = chan->small_signal_gain[chain];
805+ u32 *paprd_table_val = caldata->pa_table[chain];
806+ u32 small_signal_gain = caldata->small_signal_gain[chain];
807     u32 training_power;
808     u32 reg = 0;
809     int i;
810@@ -654,17 +655,17 @@ int ar9003_paprd_setup_gain_table(struct
811 }
812 EXPORT_SYMBOL(ar9003_paprd_setup_gain_table);
813
814-int ar9003_paprd_create_curve(struct ath_hw *ah, struct ath9k_channel *chan,
815- int chain)
816+int ar9003_paprd_create_curve(struct ath_hw *ah,
817+ struct ath9k_hw_cal_data *caldata, int chain)
818 {
819- u16 *small_signal_gain = &chan->small_signal_gain[chain];
820- u32 *pa_table = chan->pa_table[chain];
821+ u16 *small_signal_gain = &caldata->small_signal_gain[chain];
822+ u32 *pa_table = caldata->pa_table[chain];
823     u32 *data_L, *data_U;
824     int i, status = 0;
825     u32 *buf;
826     u32 reg;
827
828- memset(chan->pa_table[chain], 0, sizeof(chan->pa_table[chain]));
829+ memset(caldata->pa_table[chain], 0, sizeof(caldata->pa_table[chain]));
830
831     buf = kmalloc(2 * 48 * sizeof(u32), GFP_ATOMIC);
832     if (!buf)
833+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
834@@ -511,7 +511,7 @@ void ath_deinit_leds(struct ath_softc *s
835 #define SC_OP_BEACONS BIT(1)
836 #define SC_OP_RXAGGR BIT(2)
837 #define SC_OP_TXAGGR BIT(3)
838-#define SC_OP_FULL_RESET BIT(4)
839+#define SC_OP_OFFCHANNEL BIT(4)
840 #define SC_OP_PREAMBLE_SHORT BIT(5)
841 #define SC_OP_PROTECT_ENABLE BIT(6)
842 #define SC_OP_RXFLUSH BIT(7)
843@@ -612,6 +612,7 @@ struct ath_softc {
844 struct ath_wiphy {
845     struct ath_softc *sc; /* shared for all virtual wiphys */
846     struct ieee80211_hw *hw;
847+ struct ath9k_hw_cal_data caldata;
848     enum ath_wiphy_state {
849         ATH_WIPHY_INACTIVE,
850         ATH_WIPHY_ACTIVE,
851+++ b/drivers/net/wireless/ath/ath9k/htc.h
852@@ -353,6 +353,8 @@ struct ath9k_htc_priv {
853     u16 seq_no;
854     u32 bmiss_cnt;
855
856+ struct ath9k_hw_cal_data caldata[38];
857+
858     spinlock_t beacon_lock;
859
860     bool tx_queues_stop;
861+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
862@@ -125,6 +125,7 @@ static int ath9k_htc_set_channel(struct
863     struct ieee80211_conf *conf = &common->hw->conf;
864     bool fastcc = true;
865     struct ieee80211_channel *channel = hw->conf.channel;
866+ struct ath9k_hw_cal_data *caldata;
867     enum htc_phymode mode;
868     __be16 htc_mode;
869     u8 cmd_rsp;
870@@ -149,7 +150,8 @@ static int ath9k_htc_set_channel(struct
871           priv->ah->curchan->channel,
872           channel->center_freq, conf_is_ht(conf), conf_is_ht40(conf));
873
874- ret = ath9k_hw_reset(ah, hchan, fastcc);
875+ caldata = &priv->caldata[channel->hw_value];
876+ ret = ath9k_hw_reset(ah, hchan, caldata, fastcc);
877     if (ret) {
878         ath_print(common, ATH_DBG_FATAL,
879               "Unable to reset channel (%u Mhz) "
880@@ -1028,7 +1030,7 @@ static void ath9k_htc_radio_enable(struc
881         ah->curchan = ath9k_cmn_get_curchannel(hw, ah);
882
883     /* Reset the HW */
884- ret = ath9k_hw_reset(ah, ah->curchan, false);
885+ ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
886     if (ret) {
887         ath_print(common, ATH_DBG_FATAL,
888               "Unable to reset hardware; reset status %d "
889@@ -1091,7 +1093,7 @@ static void ath9k_htc_radio_disable(stru
890         ah->curchan = ath9k_cmn_get_curchannel(hw, ah);
891
892     /* Reset the HW */
893- ret = ath9k_hw_reset(ah, ah->curchan, false);
894+ ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
895     if (ret) {
896         ath_print(common, ATH_DBG_FATAL,
897               "Unable to reset hardware; reset status %d "
898@@ -1179,7 +1181,7 @@ static int ath9k_htc_start(struct ieee80
899     ath9k_hw_configpcipowersave(ah, 0, 0);
900
901     ath9k_hw_htc_resetinit(ah);
902- ret = ath9k_hw_reset(ah, init_channel, false);
903+ ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
904     if (ret) {
905         ath_print(common, ATH_DBG_FATAL,
906               "Unable to reset hardware; reset status %d "
907+++ b/drivers/net/wireless/ath/ath9k/hw.h
908@@ -346,19 +346,25 @@ enum ath9k_int {
909      CHANNEL_HT40PLUS | \
910      CHANNEL_HT40MINUS)
911
912-struct ath9k_channel {
913- struct ieee80211_channel *chan;
914+struct ath9k_hw_cal_data {
915     u16 channel;
916     u32 channelFlags;
917- u32 chanmode;
918     int32_t CalValid;
919- bool oneTimeCalsDone;
920     int8_t iCoff;
921     int8_t qCoff;
922     int16_t rawNoiseFloor;
923     bool paprd_done;
924+ bool nfcal_pending;
925     u16 small_signal_gain[AR9300_MAX_CHAINS];
926     u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ];
927+ struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
928+};
929+
930+struct ath9k_channel {
931+ struct ieee80211_channel *chan;
932+ u16 channel;
933+ u32 channelFlags;
934+ u32 chanmode;
935 };
936
937 #define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
938@@ -669,7 +675,7 @@ struct ath_hw {
939     enum nl80211_iftype opmode;
940     enum ath9k_power_mode power_mode;
941
942- struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
943+ struct ath9k_hw_cal_data *caldata;
944     struct ath9k_pacal_info pacal_info;
945     struct ar5416Stats stats;
946     struct ath9k_tx_queue_info txq[ATH9K_NUM_TX_QUEUES];
947@@ -863,7 +869,7 @@ const char *ath9k_hw_probe(u16 vendorid,
948 void ath9k_hw_deinit(struct ath_hw *ah);
949 int ath9k_hw_init(struct ath_hw *ah);
950 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
951- bool bChannelChange);
952+ struct ath9k_hw_cal_data *caldata, bool bChannelChange);
953 int ath9k_hw_fill_cap_info(struct ath_hw *ah);
954 u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan);
955
956@@ -958,9 +964,10 @@ void ar9003_hw_bb_watchdog_read(struct a
957 void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah);
958 void ar9003_paprd_enable(struct ath_hw *ah, bool val);
959 void ar9003_paprd_populate_single_table(struct ath_hw *ah,
960- struct ath9k_channel *chan, int chain);
961-int ar9003_paprd_create_curve(struct ath_hw *ah, struct ath9k_channel *chan,
962- int chain);
963+ struct ath9k_hw_cal_data *caldata,
964+ int chain);
965+int ar9003_paprd_create_curve(struct ath_hw *ah,
966+ struct ath9k_hw_cal_data *caldata, int chain);
967 int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain);
968 int ar9003_paprd_init_table(struct ath_hw *ah);
969 bool ar9003_paprd_is_done(struct ath_hw *ah);
970+++ b/drivers/net/wireless/ath/ath9k/xmit.c
971@@ -1181,7 +1181,7 @@ void ath_drain_all_txq(struct ath_softc
972               "Failed to stop TX DMA. Resetting hardware!\n");
973
974         spin_lock_bh(&sc->sc_resetlock);
975- r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false);
976+ r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
977         if (r)
978             ath_print(common, ATH_DBG_FATAL,
979                   "Unable to reset hardware; reset status %d\n",
package/mac80211/patches/530-ath9k_aggr_start_fix.patch
1--- a/drivers/net/wireless/ath/ath9k/xmit.c
2@@ -124,7 +124,8 @@ static void ath_tx_resume_tid(struct ath
3 {
4     struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
5
6- WARN_ON(!tid->paused);
7+ if (!tid->paused)
8+ return;
9
10     spin_lock_bh(&txq->axq_lock);
11     tid->paused = false;
package/mac80211/patches/530-ath9k_aggr_state_fix.patch
1+++ b/drivers/net/wireless/ath/ath9k/xmit.c
2@@ -120,26 +120,14 @@ static void ath_tx_queue_tid(struct ath_
3     list_add_tail(&ac->list, &txq->axq_acq);
4 }
5
6-static void ath_tx_pause_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
7-{
8- struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
9-
10- spin_lock_bh(&txq->axq_lock);
11- tid->paused++;
12- spin_unlock_bh(&txq->axq_lock);
13-}
14-
15 static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
16 {
17     struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
18
19- BUG_ON(tid->paused <= 0);
20- spin_lock_bh(&txq->axq_lock);
21-
22- tid->paused--;
23+ WARN_ON(!tid->paused);
24
25- if (tid->paused > 0)
26- goto unlock;
27+ spin_lock_bh(&txq->axq_lock);
28+ tid->paused = false;
29
30     if (list_empty(&tid->buf_q))
31         goto unlock;
32@@ -157,15 +145,10 @@ static void ath_tx_flush_tid(struct ath_
33     struct list_head bf_head;
34     INIT_LIST_HEAD(&bf_head);
35
36- BUG_ON(tid->paused <= 0);
37- spin_lock_bh(&txq->axq_lock);
38+ WARN_ON(!tid->paused);
39
40- tid->paused--;
41-
42- if (tid->paused > 0) {
43- spin_unlock_bh(&txq->axq_lock);
44- return;
45- }
46+ spin_lock_bh(&txq->axq_lock);
47+ tid->paused = false;
48
49     while (!list_empty(&tid->buf_q)) {
50         bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
51@@ -811,7 +794,7 @@ void ath_tx_aggr_start(struct ath_softc
52     an = (struct ath_node *)sta->drv_priv;
53     txtid = ATH_AN_2_TID(an, tid);
54     txtid->state |= AGGR_ADDBA_PROGRESS;
55- ath_tx_pause_tid(sc, txtid);
56+ txtid->paused = true;
57     *ssn = txtid->seq_start;
58 }
59
60@@ -835,10 +818,9 @@ void ath_tx_aggr_stop(struct ath_softc *
61         return;
62     }
63
64- ath_tx_pause_tid(sc, txtid);
65-
66     /* drop all software retried frames and mark this TID */
67     spin_lock_bh(&txq->axq_lock);
68+ txtid->paused = true;
69     while (!list_empty(&txtid->buf_q)) {
70         bf = list_first_entry(&txtid->buf_q, struct ath_buf, list);
71         if (!bf_isretried(bf)) {
package/mac80211/patches/540-ath9k_bstuck_debug.patch
1+++ b/drivers/net/wireless/ath/debug.h
2@@ -36,6 +36,7 @@
3  * @ATH_DBG_PS: power save processing
4  * @ATH_DBG_HWTIMER: hardware timer handling
5  * @ATH_DBG_BTCOEX: bluetooth coexistance
6+ * @ATH_DBG_BSTUCK: stuck beacons
7  * @ATH_DBG_ANY: enable all debugging
8  *
9  * The debug level is used to control the amount and type of debugging output
10@@ -60,6 +61,7 @@ enum ATH_DEBUG {
11     ATH_DBG_HWTIMER = 0x00001000,
12     ATH_DBG_BTCOEX = 0x00002000,
13     ATH_DBG_WMI = 0x00004000,
14+ ATH_DBG_BSTUCK = 0x00008000,
15     ATH_DBG_ANY = 0xffffffff
16 };
17
18+++ b/drivers/net/wireless/ath/ath9k/beacon.c
19@@ -359,11 +359,11 @@ void ath_beacon_tasklet(unsigned long da
20         sc->beacon.bmisscnt++;
21
22         if (sc->beacon.bmisscnt < BSTUCK_THRESH) {
23- ath_print(common, ATH_DBG_BEACON,
24+ ath_print(common, ATH_DBG_BSTUCK,
25                   "missed %u consecutive beacons\n",
26                   sc->beacon.bmisscnt);
27         } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
28- ath_print(common, ATH_DBG_BEACON,
29+ ath_print(common, ATH_DBG_BSTUCK,
30                   "beacon is officially stuck\n");
31             sc->sc_flags |= SC_OP_TSF_RESET;
32             ath_reset(sc, false);
33@@ -373,7 +373,7 @@ void ath_beacon_tasklet(unsigned long da
34     }
35
36     if (sc->beacon.bmisscnt != 0) {
37- ath_print(common, ATH_DBG_BEACON,
38+ ath_print(common, ATH_DBG_BSTUCK,
39               "resume beacon xmit after %u misses\n",
40               sc->beacon.bmisscnt);
41         sc->beacon.bmisscnt = 0;
package/mac80211/patches/541-ath9k_nf_validate.patch
1+++ b/drivers/net/wireless/ath/ath9k/calib.c
2@@ -19,8 +19,7 @@
3
4 /* Common calibration code */
5
6-/* We can tune this as we go by monitoring really low values */
7-#define ATH9K_NF_TOO_LOW -60
8+#define ATH9K_NF_TOO_HIGH -60
9
10 static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)
11 {
12@@ -45,11 +44,35 @@ static int16_t ath9k_hw_get_nf_hist_mid(
13     return nfval;
14 }
15
16-static void ath9k_hw_update_nfcal_hist_buffer(struct ath9k_nfcal_hist *h,
17+static struct ath_nf_limits *ath9k_hw_get_nf_limits(struct ath_hw *ah,
18+ struct ath9k_channel *chan)
19+{
20+ struct ath_nf_limits *limit;
21+
22+ if (!chan || IS_CHAN_2GHZ(chan))
23+ limit = &ah->nf_2g;
24+ else
25+ limit = &ah->nf_5g;
26+
27+ return limit;
28+}
29+
30+static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
31+ struct ath9k_channel *chan)
32+{
33+ return ath9k_hw_get_nf_limits(ah, chan)->nominal;
34+}
35+
36+
37+static void ath9k_hw_update_nfcal_hist_buffer(struct ath_hw *ah,
38+ struct ath9k_nfcal_hist *h,
39                           int16_t *nfarray)
40 {
41+ struct ath_nf_limits *limit;
42     int i;
43
44+ limit = ath9k_hw_get_nf_limits(ah, ah->curchan);
45+
46     for (i = 0; i < NUM_NF_READINGS; i++) {
47         h[i].nfCalBuffer[h[i].currIndex] = nfarray[i];
48
49@@ -63,6 +86,9 @@ static void ath9k_hw_update_nfcal_hist_b
50             h[i].privNF =
51                 ath9k_hw_get_nf_hist_mid(h[i].nfCalBuffer);
52         }
53+
54+ if (h[i].privNF > limit->max)
55+ h[i].privNF = limit->max;
56     }
57 }
58
59@@ -104,19 +130,6 @@ void ath9k_hw_reset_calibration(struct a
60     ah->cal_samples = 0;
61 }
62
63-static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
64- struct ath9k_channel *chan)
65-{
66- struct ath_nf_limits *limit;
67-
68- if (!chan || IS_CHAN_2GHZ(chan))
69- limit = &ah->nf_2g;
70- else
71- limit = &ah->nf_5g;
72-
73- return limit->nominal;
74-}
75-
76 /* This is done for the currently configured channel */
77 bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
78 {
79@@ -277,10 +290,10 @@ static void ath9k_hw_nf_sanitize(struct
80               "NF calibrated [%s] [chain %d] is %d\n",
81               (i >= 3 ? "ext" : "ctl"), i % 3, nf[i]);
82
83- if (nf[i] > limit->max) {
84+ if (nf[i] > ATH9K_NF_TOO_HIGH) {
85             ath_print(common, ATH_DBG_CALIBRATE,
86                   "NF[%d] (%d) > MAX (%d), correcting to MAX",
87- i, nf[i], limit->max);
88+ i, nf[i], ATH9K_NF_TOO_HIGH);
89             nf[i] = limit->max;
90         } else if (nf[i] < limit->min) {
91             ath_print(common, ATH_DBG_CALIBRATE,
92@@ -326,7 +339,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
93
94     h = caldata->nfCalHist;
95     caldata->nfcal_pending = false;
96- ath9k_hw_update_nfcal_hist_buffer(h, nfarray);
97+ ath9k_hw_update_nfcal_hist_buffer(ah, h, nfarray);
98     caldata->rawNoiseFloor = h[0].privNF;
99     return true;
100 }
package/mac80211/patches/542-ath9k_bstuck_nf_calibrate.patch
1+++ b/drivers/net/wireless/ath/ath9k/beacon.c
2@@ -362,6 +362,7 @@ void ath_beacon_tasklet(unsigned long da
3             ath_print(common, ATH_DBG_BSTUCK,
4                   "missed %u consecutive beacons\n",
5                   sc->beacon.bmisscnt);
6+ ath9k_hw_bstuck_nfcal(ah);
7         } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
8             ath_print(common, ATH_DBG_BSTUCK,
9                   "beacon is officially stuck\n");
10+++ b/drivers/net/wireless/ath/ath9k/calib.c
11@@ -65,12 +65,16 @@ static s16 ath9k_hw_get_default_nf(struc
12
13
14 static void ath9k_hw_update_nfcal_hist_buffer(struct ath_hw *ah,
15- struct ath9k_nfcal_hist *h,
16+ struct ath9k_hw_cal_data *cal,
17                           int16_t *nfarray)
18 {
19+ struct ath_common *common = ath9k_hw_common(ah);
20     struct ath_nf_limits *limit;
21+ struct ath9k_nfcal_hist *h;
22+ bool high_nf_mid = false;
23     int i;
24
25+ h = cal->nfCalHist;
26     limit = ath9k_hw_get_nf_limits(ah, ah->curchan);
27
28     for (i = 0; i < NUM_NF_READINGS; i++) {
29@@ -87,9 +91,38 @@ static void ath9k_hw_update_nfcal_hist_b
30                 ath9k_hw_get_nf_hist_mid(h[i].nfCalBuffer);
31         }
32
33- if (h[i].privNF > limit->max)
34- h[i].privNF = limit->max;
35+ if (!h[i].privNF)
36+ continue;
37+
38+ if (h[i].privNF > limit->max) {
39+ high_nf_mid = true;
40+
41+ ath_print(common, ATH_DBG_CALIBRATE,
42+ "NFmid[%d] (%d) > MAX (%d), %s\n",
43+ i, h[i].privNF, limit->max,
44+ (cal->nfcal_interference ?
45+ "not corrected (due to interference)" :
46+ "correcting to MAX"));
47+
48+ /*
49+ * Normally we limit the average noise floor by the
50+ * hardware specific maximum here. However if we have
51+ * encountered stuck beacons because of interference,
52+ * we bypass this limit here in order to better deal
53+ * with our environment.
54+ */
55+ if (!cal->nfcal_interference)
56+ h[i].privNF = limit->max;
57+ }
58     }
59+
60+ /*
61+ * If the noise floor seems normal for all chains, assume that
62+ * there is no significant interference in the environment anymore.
63+ * Re-enable the enforcement of the NF maximum again.
64+ */
65+ if (!high_nf_mid)
66+ cal->nfcal_interference = false;
67 }
68
69 static bool ath9k_hw_get_nf_thresh(struct ath_hw *ah,
70@@ -339,7 +372,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
71
72     h = caldata->nfCalHist;
73     caldata->nfcal_pending = false;
74- ath9k_hw_update_nfcal_hist_buffer(ah, h, nfarray);
75+ ath9k_hw_update_nfcal_hist_buffer(ah, caldata, nfarray);
76     caldata->rawNoiseFloor = h[0].privNF;
77     return true;
78 }
79@@ -374,3 +407,28 @@ s16 ath9k_hw_getchan_noise(struct ath_hw
80     return ah->caldata->rawNoiseFloor;
81 }
82 EXPORT_SYMBOL(ath9k_hw_getchan_noise);
83+
84+void ath9k_hw_bstuck_nfcal(struct ath_hw *ah)
85+{
86+ struct ath9k_hw_cal_data *caldata = ah->caldata;
87+
88+ if (unlikely(!caldata))
89+ return;
90+
91+ /*
92+ * If beacons are stuck, the most likely cause is interference.
93+ * Triggering a noise floor calibration at this point helps the
94+ * hardware adapt to a noisy environment much faster.
95+ * To ensure that we recover from stuck beacons quickly, let
96+ * the baseband update the internal NF value itself, similar to
97+ * what is being done after a full reset.
98+ */
99+ if (!caldata->nfcal_pending)
100+ ath9k_hw_start_nfcal(ah, true);
101+ else if (!(REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF))
102+ ath9k_hw_getnf(ah, ah->curchan);
103+
104+ caldata->nfcal_interference = true;
105+}
106+EXPORT_SYMBOL(ath9k_hw_bstuck_nfcal);
107+
108+++ b/drivers/net/wireless/ath/ath9k/calib.h
109@@ -113,6 +113,7 @@ void ath9k_hw_loadnf(struct ath_hw *ah,
110 bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan);
111 void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah,
112                   struct ath9k_channel *chan);
113+void ath9k_hw_bstuck_nfcal(struct ath_hw *ah);
114 s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan);
115 void ath9k_hw_reset_calibration(struct ath_hw *ah,
116                 struct ath9k_cal_list *currCal);
117+++ b/drivers/net/wireless/ath/ath9k/hw.h
118@@ -355,6 +355,7 @@ struct ath9k_hw_cal_data {
119     int16_t rawNoiseFloor;
120     bool paprd_done;
121     bool nfcal_pending;
122+ bool nfcal_interference;
123     u16 small_signal_gain[AR9300_MAX_CHAINS];
124     u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ];
125     struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
package/mac80211/patches/543-ath9k_interference_nf_cal.patch
1+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
2@@ -423,6 +423,7 @@ int ath_beaconq_config(struct ath_softc
3 #define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */
4 #define ATH_ANI_POLLINTERVAL_OLD 100 /* 100 ms */
5 #define ATH_ANI_POLLINTERVAL_NEW 1000 /* 1000 ms */
6+#define ATH_LONG_CALINTERVAL_INT 1000 /* 1000 ms */
7 #define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
8 #define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */
9
10+++ b/drivers/net/wireless/ath/ath9k/main.c
11@@ -396,7 +396,12 @@ void ath_ani_calibrate(unsigned long dat
12     bool shortcal = false;
13     bool aniflag = false;
14     unsigned int timestamp = jiffies_to_msecs(jiffies);
15- u32 cal_interval, short_cal_interval;
16+ u32 cal_interval, short_cal_interval, long_cal_interval;
17+
18+ if (ah->caldata && ah->caldata->nfcal_interference)
19+ long_cal_interval = ATH_LONG_CALINTERVAL_INT;
20+ else
21+ long_cal_interval = ATH_LONG_CALINTERVAL;
22
23     short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ?
24         ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL;
25@@ -408,7 +413,7 @@ void ath_ani_calibrate(unsigned long dat
26     ath9k_ps_wakeup(sc);
27
28     /* Long calibration runs independently of short calibration. */
29- if ((timestamp - common->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) {
30+ if ((timestamp - common->ani.longcal_timer) >= long_cal_interval) {
31         longcal = true;
32         ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies);
33         common->ani.longcal_timer = timestamp;
package/mac80211/patches/550-ath9k_tsf_fix.patch
1ath9k_rx_skb_preprocess nulls rxs and the mactime is never set again -
2mactime is always 0. This causes problems in IBSS mode.
3
4ieee80211_rx_bss_info uses mactime to decide if an IBSS merge is needed.
5Without this patch the merge is triggered by each beacon received.
6
7This can be recognized by the "beacon TSF higher than local TSF - IBSS
8merge with BSSID" log message accompanying each beacon.
9
10This problem was not completely fixed in commit
11a6d2055b02dde1067075795274672720baadd3ca and is not a stable kernel fix.
12It is solely intended for wireless-testing.
13
14Signed-off-by: Jan Friedrich <jft@dev2day.de>
15 drivers/net/wireless/ath/ath9k/recv.c | 10 +++++-----
16 1 files changed, 5 insertions(+), 5 deletions(-)
17
18+++ b/drivers/net/wireless/ath/ath9k/recv.c
19@@ -1140,6 +1140,11 @@ int ath_rx_tasklet(struct ath_softc *sc,
20         if (flush)
21             goto requeue;
22
23+ retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
24+ rxs, &decrypt_error);
25+ if (retval)
26+ goto requeue;
27+
28         rxs->mactime = (tsf & ~0xffffffffULL) | rs.rs_tstamp;
29         if (rs.rs_tstamp > tsf_lower &&
30             unlikely(rs.rs_tstamp - tsf_lower > 0x10000000))
31@@ -1149,11 +1154,6 @@ int ath_rx_tasklet(struct ath_softc *sc,
32             unlikely(tsf_lower - rs.rs_tstamp > 0x10000000))
33             rxs->mactime += 0x100000000ULL;
34
35- retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
36- rxs, &decrypt_error);
37- if (retval)
38- goto requeue;
39-
40         /* Ensure we always have an skb to requeue once we are done
41          * processing the current buffer's skb */
42         requeue_skb = ath_rxbuf_alloc(common, common->rx_bufsize, GFP_ATOMIC);
package/mac80211/patches/560-ath9k_baw_fix.patch
1+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
2@@ -254,7 +254,7 @@ struct ath_atx_tid {
3     struct list_head buf_q;
4     struct ath_node *an;
5     struct ath_atx_ac *ac;
6- struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
7+ unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
8     u16 seq_start;
9     u16 seq_next;
10     u16 baw_size;
11+++ b/drivers/net/wireless/ath/ath9k/xmit.c
12@@ -168,9 +168,9 @@ static void ath_tx_update_baw(struct ath
13     index = ATH_BA_INDEX(tid->seq_start, seqno);
14     cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
15
16- tid->tx_buf[cindex] = NULL;
17+ __clear_bit(cindex, tid->tx_buf);
18
19- while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) {
20+ while (tid->baw_head != tid->baw_tail && !test_bit(tid->baw_head, tid->tx_buf)) {
21         INCR(tid->seq_start, IEEE80211_SEQ_MAX);
22         INCR(tid->baw_head, ATH_TID_MAX_BUFS);
23     }
24@@ -186,9 +186,7 @@ static void ath_tx_addto_baw(struct ath_
25
26     index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
27     cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
28-
29- BUG_ON(tid->tx_buf[cindex] != NULL);
30- tid->tx_buf[cindex] = bf;
31+ __set_bit(cindex, tid->tx_buf);
32
33     if (index >= ((tid->baw_tail - tid->baw_head) &
34         (ATH_TID_MAX_BUFS - 1))) {
package/mac80211/patches/570-ath9k_mic_failure_fix.patch
1+++ b/drivers/net/wireless/ath/ath.h
2@@ -119,6 +119,7 @@ struct ath_common {
3
4     u32 keymax;
5     DECLARE_BITMAP(keymap, ATH_KEYMAX);
6+ DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX);
7     u8 splitmic;
8
9     struct ath_regulatory regulatory;
10+++ b/drivers/net/wireless/ath/ath9k/common.c
11@@ -366,9 +366,13 @@ int ath9k_cmn_key_config(struct ath_comm
12     set_bit(idx, common->keymap);
13     if (key->alg == ALG_TKIP) {
14         set_bit(idx + 64, common->keymap);
15+ set_bit(idx, common->tkip_keymap);
16+ set_bit(idx + 64, common->tkip_keymap);
17         if (common->splitmic) {
18             set_bit(idx + 32, common->keymap);
19             set_bit(idx + 64 + 32, common->keymap);
20+ set_bit(idx + 32, common->tkip_keymap);
21+ set_bit(idx + 64 + 32, common->tkip_keymap);
22         }
23     }
24
25@@ -393,10 +397,17 @@ void ath9k_cmn_key_delete(struct ath_com
26         return;
27
28     clear_bit(key->hw_key_idx + 64, common->keymap);
29+
30+ clear_bit(key->hw_key_idx, common->tkip_keymap);
31+ clear_bit(key->hw_key_idx + 64, common->tkip_keymap);
32+
33     if (common->splitmic) {
34         ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
35         clear_bit(key->hw_key_idx + 32, common->keymap);
36         clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
37+
38+ clear_bit(key->hw_key_idx + 32, common->tkip_keymap);
39+ clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap);
40     }
41 }
42 EXPORT_SYMBOL(ath9k_cmn_key_delete);
43+++ b/drivers/net/wireless/ath/ath9k/recv.c
44@@ -870,15 +870,18 @@ static bool ath9k_rx_accept(struct ath_c
45         if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
46             *decrypt_error = true;
47         } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
48- if (ieee80211_is_ctl(fc))
49- /*
50- * Sometimes, we get invalid
51- * MIC failures on valid control frames.
52- * Remove these mic errors.
53- */
54- rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
55- else
56+ /*
57+ * The MIC error bit is only valid if the frame
58+ * is not a control frame or fragment, and it was
59+ * decrypted using a valid TKIP key.
60+ */
61+ if (!ieee80211_is_ctl(fc) &&
62+ !ieee80211_has_morefrags(fc) &&
63+ !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) &&
64+ test_bit(rx_stats->rs_keyix, common->tkip_keymap))
65                 rxs->flag |= RX_FLAG_MMIC_ERROR;
66+ else
67+ rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
68         }
69         /*
70          * Reject error frames with the exception of
71+++ b/drivers/net/wireless/ath/ath9k/mac.c
72@@ -711,7 +711,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
73             rs->rs_phyerr = phyerr;
74         } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
75             rs->rs_status |= ATH9K_RXERR_DECRYPT;
76- else if (ads.ds_rxstatus8 & AR_MichaelErr)
77+ else if ((ads.ds_rxstatus8 & AR_MichaelErr) &&
78+ rs->rs_keyix != ATH9K_RXKEYIX_INVALID)
79             rs->rs_status |= ATH9K_RXERR_MIC;
80         else if (ads.ds_rxstatus8 & AR_KeyMiss)
81             rs->rs_status |= ATH9K_RXERR_DECRYPT;
package/mac80211/patches/580-ath9k_aggr_start_fix.patch
1+++ b/drivers/net/wireless/ath/ath9k/xmit.c
2@@ -124,7 +124,8 @@ static void ath_tx_resume_tid(struct ath
3 {
4     struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
5
6- WARN_ON(!tid->paused);
7+ if (!tid->paused)
8+ return;
9
10     spin_lock_bh(&txq->axq_lock);
11     tid->paused = false;
package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
88 /*
99  * PCI driver handlers.
1010  */
11@@ -382,6 +383,7 @@ int rt2x00pci_resume(struct pci_dev *pci
11@@ -381,6 +382,7 @@ int rt2x00pci_resume(struct pci_dev *pci
1212 }
1313 EXPORT_SYMBOL_GPL(rt2x00pci_resume);
1414 #endif /* CONFIG_PM */
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
11--- a/drivers/net/wireless/mwl8k.c
22+++ b/drivers/net/wireless/mwl8k.c
3@@ -3884,6 +3884,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw");
3@@ -3897,6 +3897,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw");
44 MODULE_FIRMWARE("mwl8k/fmimage_8366.fw");
55
66 static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
package/mac80211/patches/800-nuke_led_code.patch
1616 net/mac80211/util.c | 6 ++++++
1717 15 files changed, 69 insertions(+), 7 deletions(-)
1818
19+++ compat-wireless-2010-07-29/config.mk
19--- a/config.mk
2020@@ -115,7 +115,7 @@ CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstr
2121 # CONFIG_MAC80211_RC_PID=y
2222 CONFIG_MAC80211_RC_MINSTREL=y
...... 
2727
2828 # enable mesh networking too
2929 CONFIG_MAC80211_MESH=y
30@@ -194,7 +194,7 @@ CONFIG_B43_PCI_AUTOSELECT=y
30@@ -218,7 +218,7 @@ CONFIG_B43_PCI_AUTOSELECT=y
3131 ifneq ($(CONFIG_PCMCIA),)
3232 # CONFIG_B43_PCMCIA=y
3333 endif
...... 
3636 CONFIG_B43_PHY_LP=y
3737 # CONFIG_B43_NPHY is not set
3838 # CONFIG_B43_FORCE_PIO=y
39@@ -203,7 +203,7 @@ CONFIG_B43_PHY_LP=y
39@@ -227,7 +227,7 @@ CONFIG_B43_PHY_LP=y
4040 CONFIG_B43LEGACY=m
4141 CONFIG_B43LEGACY_HWRNG=y
4242 CONFIG_B43LEGACY_PCI_AUTOSELECT=y
...... 
4545 # CONFIG_B43LEGACY_DEBUG=y
4646 CONFIG_B43LEGACY_DMA=y
4747 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
48@@ -499,7 +499,7 @@ endif
7449
7550 # p54
7651 CONFIG_P54_COMMON=m
...... 
7954
8055 # Atheros
8156 CONFIG_ATH_COMMON=m
82+++ compat-wireless-2010-07-29/include/linux/compat-2.6.25.h
83@@ -146,10 +146,12 @@ static inline void __hwrng_unregister(st
57--- a/include/linux/compat-2.6.25.h
58@@ -148,10 +148,12 @@ static inline void __hwrng_unregister(st
8459     hwrng_unregister(rng);
8560 }
8661
...... 
9469
9570 /**
9671  * The following things are out of ./include/linux/kernel.h
97+++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/gpio.c
72--- a/drivers/net/wireless/ath/ath9k/gpio.c
9873@@ -20,6 +20,7 @@
9974 /* LED functions */
10075 /********************************/
...... 
11287
11388 /*******************/
11489 /* Rfkill */
115+++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/pci.c
90--- a/drivers/net/wireless/ath/ath9k/pci.c
11691@@ -273,7 +273,9 @@ static int ath_pci_suspend(struct pci_de
11792     struct ath_wiphy *aphy = hw->priv;
11893     struct ath_softc *sc = aphy->sc;
...... 
137112
138113     return 0;
139114 }
140+++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/ath9k.h
141@@ -465,6 +465,7 @@ void ath9k_btcoex_timer_pause(struct ath
115--- a/drivers/net/wireless/ath/ath9k/ath9k.h
116@@ -457,6 +457,7 @@ void ath9k_btcoex_timer_pause(struct ath
142117 /********************/
143118 /* LED Control */
144119 /********************/
...... 
147122
148123 #define ATH_LED_PIN_DEF 1
149124 #define ATH_LED_PIN_9287 8
150@@ -489,6 +490,7 @@ struct ath_led {
125@@ -481,6 +482,7 @@ struct ath_led {
151126
152127 void ath_init_leds(struct ath_softc *sc);
153128 void ath_deinit_leds(struct ath_softc *sc);
...... 
155130
156131 /********************/
157132 /* Main driver core */
158@@ -586,6 +588,7 @@ struct ath_softc {
133@@ -578,6 +580,7 @@ struct ath_softc {
159134     enum wireless_mode cur_rate_mode;
160135     struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
161136
...... 
163138     struct ath_led radio_led;
164139     struct ath_led assoc_led;
165140     struct ath_led tx_led;
166@@ -595,6 +598,7 @@ struct ath_softc {
141@@ -587,6 +590,7 @@ struct ath_softc {
167142     int led_off_duration;
168143     int led_on_cnt;
169144     int led_off_cnt;
...... 
171146
172147     int beacon_interval;
173148
174+++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/init.c
175@@ -34,9 +34,11 @@ int modparam_nohwcrypt;
176 module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
177 MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
178
179+#ifdef CONFIG_MAC80211_LEDS
180 int led_blink = 1;
181 module_param_named(blink, led_blink, int, 0444);
182 MODULE_PARM_DESC(blink, "Enable LED blink on activity");
183+#endif
184
185 /* We use the hw_value as an index into our private channel structure */
186
187@@ -757,7 +759,9 @@ int ath9k_init_device(u16 devid, struct
149--- a/drivers/net/wireless/ath/ath9k/init.c
150@@ -757,7 +757,9 @@ int ath9k_init_device(u16 devid, struct
188151     INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
189152     sc->wiphy_scheduler_int = msecs_to_jiffies(500);
190153
...... 
195158     ath_start_rfkill_poll(sc);
196159
197160     return 0;
198@@ -810,7 +814,9 @@ void ath9k_deinit_device(struct ath_soft
161@@ -810,7 +812,9 @@ void ath9k_deinit_device(struct ath_soft
199162     ath9k_ps_wakeup(sc);
200163
201164     wiphy_rfkill_stop_polling(sc->hw->wiphy);
...... 
205168
206169     for (i = 0; i < sc->num_sec_wiphy; i++) {
207170         struct ath_wiphy *aphy = sc->sec_wiphy[i];
208+++ compat-wireless-2010-07-29/drivers/net/wireless/ath/ath9k/main.c
209@@ -868,9 +868,11 @@ void ath_radio_enable(struct ath_softc *
171--- a/drivers/net/wireless/ath/ath9k/main.c
172@@ -869,9 +869,11 @@ void ath_radio_enable(struct ath_softc *
210173     ath9k_hw_set_interrupts(ah, ah->imask);
211174
212175     /* Enable LED */
...... 
219182
220183     ieee80211_wake_queues(hw);
221184     ath9k_ps_restore(sc);
222@@ -889,10 +891,12 @@ void ath_radio_disable(struct ath_softc
185@@ -890,10 +892,12 @@ void ath_radio_disable(struct ath_softc
223186      * Keep the LED on when the radio is disabled
224187      * during idle unassociated state.
225188      */
...... 
232195
233196     /* Disable interrupts */
234197     ath9k_hw_set_interrupts(ah, 0);
235@@ -1303,8 +1307,10 @@ static void ath9k_stop(struct ieee80211_
198@@ -1304,8 +1308,10 @@ static void ath9k_stop(struct ieee80211_
236199
237200     aphy->state = ATH_WIPHY_INACTIVE;
238201
...... 
243206
244207     cancel_delayed_work_sync(&sc->tx_complete_work);
245208     cancel_work_sync(&sc->paprd_work);
246+++ compat-wireless-2010-07-29/net/mac80211/iface.c
209--- a/net/mac80211/iface.c
247210@@ -21,7 +21,9 @@
248211 #include "sta_info.h"
249212 #include "debugfs_netdev.h"
...... 
255218 #include "driver-ops.h"
256219 #include "wme.h"
257220
258@@ -189,7 +191,9 @@ static int ieee80211_open(struct net_dev
259             goto err_del_bss;
221@@ -201,7 +203,9 @@ static int ieee80211_do_open(struct net_
222             napi_enable(&local->napi);
260223         /* we're brought up, everything changes */
261224         hw_reconf_flags = ~0;
262225+#ifdef CONFIG_MAC80211_LEDS
...... 
265228     }
266229
267230     /*
268+++ compat-wireless-2010-07-29/net/mac80211/main.c
231--- a/net/mac80211/main.c
269232@@ -29,7 +29,9 @@
270233 #include "rate.h"
271234 #include "mesh.h"
...... 
277240 #include "cfg.h"
278241 #include "debugfs.h"
279242
280@@ -674,7 +676,9 @@ int ieee80211_register_hw(struct ieee802
243@@ -778,7 +780,9 @@ int ieee80211_register_hw(struct ieee802
281244
282245     rtnl_unlock();
283246
...... 
287250
288251     local->network_latency_notifier.notifier_call =
289252         ieee80211_max_network_latency;
290@@ -699,7 +703,9 @@ int ieee80211_register_hw(struct ieee802
291                    &local->network_latency_notifier);
253@@ -808,7 +812,9 @@ int ieee80211_register_hw(struct ieee802
292254     rtnl_lock();
255 #endif
293256  fail_pm_qos:
294257+#ifdef CONFIG_MAC80211_LEDS
295258     ieee80211_led_exit(local);
...... 
297260     ieee80211_remove_interfaces(local);
298261  fail_rate:
299262     rtnl_unlock();
300@@ -755,7 +761,9 @@ void ieee80211_unregister_hw(struct ieee
263@@ -872,7 +878,9 @@ void ieee80211_unregister_hw(struct ieee
301264     destroy_workqueue(local->workqueue);
302265     wiphy_unregister(local->hw.wiphy);
303266     ieee80211_wep_free(local);
...... 
307270     kfree(local->int_scan_req);
308271 }
309272 EXPORT_SYMBOL(ieee80211_unregister_hw);
310+++ compat-wireless-2010-07-29/net/mac80211/mlme.c
273--- a/net/mac80211/mlme.c
311274@@ -26,7 +26,9 @@
312275 #include "ieee80211_i.h"
313276 #include "driver-ops.h"
...... 
319282
320283 #define IEEE80211_MAX_PROBE_TRIES 5
321284
322@@ -872,7 +874,9 @@ static void ieee80211_set_associated(str
285@@ -879,7 +881,9 @@ static void ieee80211_set_associated(str
323286      */
324287     sdata->u.mgd.wmm_last_param_set = -1;
325288
...... 
329292
330293     if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD)
331294         bss_conf->dtim_period = bss->dtim_period;
332@@ -958,7 +962,9 @@ static void ieee80211_set_disassoc(struc
295@@ -965,7 +969,9 @@ static void ieee80211_set_disassoc(struc
333296
334297     changed |= ieee80211_reset_erp_info(sdata);
335298
...... 
339302     changed |= BSS_CHANGED_ASSOC;
340303     sdata->vif.bss_conf.assoc = false;
341304
342+++ compat-wireless-2010-07-29/net/mac80211/pm.c
305--- a/net/mac80211/pm.c
343306@@ -4,7 +4,9 @@
344307 #include "ieee80211_i.h"
345308 #include "mesh.h"
...... 
351314
352315 int __ieee80211_suspend(struct ieee80211_hw *hw)
353316 {
354+++ compat-wireless-2010-07-29/net/mac80211/rx.c
317--- a/net/mac80211/rx.c
355318@@ -21,7 +21,9 @@
356319
357320 #include "ieee80211_i.h"
...... 
363326 #include "mesh.h"
364327 #include "wep.h"
365328 #include "wpa.h"
366@@ -1342,8 +1344,10 @@ ieee80211_rx_h_defragment(struct ieee802
329@@ -1377,8 +1379,10 @@ ieee80211_rx_h_defragment(struct ieee802
367330         rx->sta->rx_packets++;
368331     if (is_multicast_ether_addr(hdr->addr1))
369332         rx->local->dot11MulticastReceivedFrameCount++;
...... 
374337     return RX_CONTINUE;
375338 }
376339
377+++ compat-wireless-2010-07-29/net/mac80211/status.c
340--- a/net/mac80211/status.c
378341@@ -13,7 +13,9 @@
379342 #include "ieee80211_i.h"
380343 #include "rate.h"
...... 
386349
387350
388351 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
389@@ -247,7 +249,9 @@ void ieee80211_tx_status(struct ieee8021
352@@ -246,7 +248,9 @@ void ieee80211_tx_status(struct ieee8021
390353
391354     rcu_read_unlock();
392355
...... 
396359
397360     /* SNMP counters
398361      * Fragments are passed to low-level drivers as separate skbs, so these
399+++ compat-wireless-2010-07-29/net/mac80211/tx.c
362--- a/net/mac80211/tx.c
400363@@ -26,7 +26,9 @@
401364
402365 #include "ieee80211_i.h"
...... 
408371 #include "mesh.h"
409372 #include "wep.h"
410373 #include "wpa.h"
411@@ -1312,7 +1314,9 @@ static int __ieee80211_tx(struct ieee802
374@@ -1334,7 +1336,9 @@ static int __ieee80211_tx(struct ieee802
412375         }
413376
414377         *skbp = skb = next;
...... 
418381         fragm = true;
419382     }
420383
421+++ compat-wireless-2010-07-29/net/mac80211/util.c
384--- a/net/mac80211/util.c
422385@@ -29,7 +29,9 @@
423386 #include "rate.h"
424387 #include "mesh.h"
...... 
430393 #include "wep.h"
431394
432395 /* privid for wiphys to determine whether they belong to us or not */
433@@ -1107,7 +1109,9 @@ u32 ieee80211_sta_get_rates(struct ieee8
396@@ -1110,7 +1112,9 @@ u32 ieee80211_sta_get_rates(struct ieee8
434397
435398 void ieee80211_stop_device(struct ieee80211_local *local)
436399 {
...... 
440403
441404     cancel_work_sync(&local->reconfig_filter);
442405
443@@ -1141,7 +1145,9 @@ int ieee80211_reconfig(struct ieee80211_
406@@ -1144,7 +1148,9 @@ int ieee80211_reconfig(struct ieee80211_
444407             return res;
445408         }
446409
package/mac80211/patches/810-p54-fix-ps.patch
1From: Christian Lamparter <chunkeey@googlemail.com>
2
3Michael reported that p54* never really entered power
4save mode, even tough it was enabled.
5
6It turned out that upon a power save mode change the
7firmware will set a special flag onto the last outgoing
8frame tx status (which in this case is almost always the
9designated PSM nullfunc frame). This flag confused the
10driver; It erroneously reported transmission failures
11to the stack, which then generated the next nullfunc.
12and so on...
13
14Cc: <stable@kernel.org>
15Reported-by: Michael Buesch <mb@bu3sch.de>
16Tested-by: Michael Buesch <mb@bu3sch.de>
17Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
18 drivers/net/wireless/p54/txrx.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21+++ compat-wireless-2010-07-29/drivers/net/wireless/p54/txrx.c
22@@ -446,7 +446,7 @@ static void p54_rx_frame_sent(struct p54
23     }
24
25     if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
26- (!payload->status))
27+ !(payload->status & P54_TX_FAILED))
28         info->flags |= IEEE80211_TX_STAT_ACK;
29     if (payload->status & P54_TX_PSM_CANCELLED)
30         info->flags |= IEEE80211_TX_STAT_TX_FILTERED;

Archive Download the corresponding diff file



interactive