diff options
Diffstat (limited to 'package/mac80211/patches')
64 files changed, 186 insertions, 3075 deletions
diff --git a/package/mac80211/patches/000-disable_ethernet.patch b/package/mac80211/patches/000-disable_ethernet.patch index f89fa53..be1f4bd 100644 --- a/package/mac80211/patches/000-disable_ethernet.patch +++ b/package/mac80211/patches/000-disable_ethernet.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -29,9 +29,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += +@@ -32,9 +32,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ diff --git a/package/mac80211/patches/001-disable_b44.patch b/package/mac80211/patches/001-disable_b44.patch index 52564d1..d624258 100644 --- a/package/mac80211/patches/001-disable_b44.patch +++ b/package/mac80211/patches/001-disable_b44.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -378,8 +378,8 @@ CONFIG_B43_BCMA_PIO=y +@@ -380,8 +380,8 @@ CONFIG_B43_BCMA_EXTRA=y CONFIG_P54_PCI=m diff --git a/package/mac80211/patches/002-disable_rfkill.patch b/package/mac80211/patches/002-disable_rfkill.patch index 82f31ae..4380d93 100644 --- a/package/mac80211/patches/002-disable_rfkill.patch +++ b/package/mac80211/patches/002-disable_rfkill.patch @@ -9,7 +9,7 @@ ifeq ($(CONFIG_MAC80211),y) $(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") -@@ -671,10 +671,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 +@@ -684,10 +684,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 # We need the backported rfkill module on kernel < 2.6.31. # In more recent kernel versions use the in kernel rfkill module. ifdef CONFIG_COMPAT_KERNEL_2_6_31 diff --git a/package/mac80211/patches/005-disable_ssb_build.patch b/package/mac80211/patches/005-disable_ssb_build.patch index 8e89814..a67168a 100644 --- a/package/mac80211/patches/005-disable_ssb_build.patch +++ b/package/mac80211/patches/005-disable_ssb_build.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -29,7 +29,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += +@@ -32,7 +32,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ @@ -18,7 +18,7 @@ else include $(KLIB_BUILD)/.config endif -@@ -354,7 +353,8 @@ CONFIG_IPW2200_QOS=y +@@ -356,7 +355,8 @@ CONFIG_IPW2200_QOS=y # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface endif #CONFIG_WIRELESS_EXT @@ -28,7 +28,7 @@ # Sonics Silicon Backplane CONFIG_SSB_SPROM=y -@@ -367,7 +367,7 @@ endif #CONFIG_PCMCIA +@@ -369,7 +369,7 @@ endif #CONFIG_PCMCIA # CONFIG_SSB_DEBUG=y CONFIG_SSB_DRIVER_PCICORE=y CONFIG_B43_SSB=y @@ -37,7 +37,7 @@ CONFIG_BCMA=m CONFIG_BCMA_BLOCKIO=y -@@ -574,7 +574,6 @@ endif #CONFIG_SPI_MASTER end of SPI driv +@@ -578,7 +578,6 @@ endif #CONFIG_SPI_MASTER end of SPI driv ifdef CONFIG_MMC diff --git a/package/mac80211/patches/006-disable_bcma_build.patch b/package/mac80211/patches/006-disable_bcma_build.patch index 2d8cdd8..9ac0f0e 100644 --- a/package/mac80211/patches/006-disable_bcma_build.patch +++ b/package/mac80211/patches/006-disable_bcma_build.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -29,7 +29,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += +@@ -32,7 +32,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ @@ -10,7 +10,7 @@ ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),) --- a/config.mk +++ b/config.mk -@@ -369,12 +369,12 @@ CONFIG_SSB_DRIVER_PCICORE=y +@@ -371,12 +371,12 @@ CONFIG_SSB_DRIVER_PCICORE=y CONFIG_B43_SSB=y endif #__CONFIG_SSB @@ -22,9 +22,9 @@ +# CONFIG_BCMA_HOST_PCI=y # CONFIG_BCMA_DEBUG=y -CONFIG_B43_BCMA=y --CONFIG_B43_BCMA_PIO=y +-CONFIG_B43_BCMA_EXTRA=y +# CONFIG_B43_BCMA=y -+# CONFIG_B43_BCMA_PIO=y ++# CONFIG_B43_BCMA_EXTRA=y CONFIG_P54_PCI=m diff --git a/package/mac80211/patches/007-remove_misc_drivers.patch b/package/mac80211/patches/007-remove_misc_drivers.patch index 1181c42..b8c7853 100644 --- a/package/mac80211/patches/007-remove_misc_drivers.patch +++ b/package/mac80211/patches/007-remove_misc_drivers.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -252,7 +252,7 @@ $(warning "WARNING: CONFIG_CFG80211_WEXT +@@ -254,7 +254,7 @@ $(warning "WARNING: CONFIG_CFG80211_WEXT endif #CONFIG_WIRELESS_EXT ifdef CONFIG_STAGING @@ -9,7 +9,7 @@ endif #CONFIG_STAGING # mac80211 test driver -@@ -406,13 +406,13 @@ endif #CONFIG_CRC_ITU_T +@@ -408,13 +408,13 @@ endif #CONFIG_CRC_ITU_T CONFIG_MWL8K=m # Ethernet drivers go here @@ -28,7 +28,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 ifdef CONFIG_WIRELESS_EXT -@@ -471,21 +471,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 +@@ -475,21 +475,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 # Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER # it also requires new RNDIS_HOST and CDC_ETHER modules which we add ifdef CONFIG_COMPAT_KERNEL_2_6_29 diff --git a/package/mac80211/patches/008-disable_mesh.patch b/package/mac80211/patches/008-disable_mesh.patch index 3c00938..bdefe20 100644 --- a/package/mac80211/patches/008-disable_mesh.patch +++ b/package/mac80211/patches/008-disable_mesh.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -188,7 +188,7 @@ CONFIG_MAC80211_LEDS=y +@@ -192,7 +192,7 @@ CONFIG_MAC80211_LEDS=y endif #CONFIG_LEDS_TRIGGERS # enable mesh networking too diff --git a/package/mac80211/patches/010-no_pcmcia.patch b/package/mac80211/patches/010-no_pcmcia.patch index 4cb88a9..ce833cf 100644 --- a/package/mac80211/patches/010-no_pcmcia.patch +++ b/package/mac80211/patches/010-no_pcmcia.patch @@ -9,7 +9,7 @@ else include $(KLIB_BUILD)/.config endif -@@ -286,7 +286,7 @@ CONFIG_B43=m +@@ -289,7 +289,7 @@ CONFIG_B43=m CONFIG_B43_HWRNG=y CONFIG_B43_PCI_AUTOSELECT=y ifdef CONFIG_PCMCIA diff --git a/package/mac80211/patches/011-no_sdio.patch b/package/mac80211/patches/011-no_sdio.patch index 919f1ac..b1ee2cb 100644 --- a/package/mac80211/patches/011-no_sdio.patch +++ b/package/mac80211/patches/011-no_sdio.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -557,7 +557,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv +@@ -561,7 +561,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv ifdef CONFIG_MMC diff --git a/package/mac80211/patches/013-disable_b43_nphy.patch b/package/mac80211/patches/013-disable_b43_nphy.patch index 287285f..0ff2992 100644 --- a/package/mac80211/patches/013-disable_b43_nphy.patch +++ b/package/mac80211/patches/013-disable_b43_nphy.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -292,8 +292,8 @@ ifdef CONFIG_MAC80211_LEDS +@@ -295,8 +295,8 @@ ifdef CONFIG_MAC80211_LEDS CONFIG_B43_LEDS=y endif #CONFIG_MAC80211_LEDS CONFIG_B43_PHY_LP=y @@ -9,5 +9,5 @@ +# CONFIG_B43_PHY_N=y +# CONFIG_B43_PHY_HT=y # CONFIG_B43_PHY_LCN=y - # CONFIG_B43_FORCE_PIO=y # CONFIG_B43_DEBUG=y + diff --git a/package/mac80211/patches/015-remove-rt2x00-options.patch b/package/mac80211/patches/015-remove-rt2x00-options.patch index fdf34c3..ecad731 100644 --- a/package/mac80211/patches/015-remove-rt2x00-options.patch +++ b/package/mac80211/patches/015-remove-rt2x00-options.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -368,7 +368,7 @@ CONFIG_RTL8180=m +@@ -370,7 +370,7 @@ CONFIG_RTL8180=m CONFIG_ADM8211=m @@ -9,8 +9,8 @@ CONFIG_RT2400PCI=m CONFIG_RT2500PCI=m ifdef CONFIG_CRC_CCITT -@@ -506,7 +506,7 @@ CONFIG_RT2800USB_RT35XX=y - # CONFIG_RT2800USB_RT53XX=y +@@ -510,7 +510,7 @@ CONFIG_RT2800USB_RT35XX=y + CONFIG_RT2800USB_RT53XX=y CONFIG_RT2800USB_UNKNOWN=y endif #CONFIG_CRC_CCITT -CONFIG_RT2X00_LIB_USB=m diff --git a/package/mac80211/patches/016-remove_pid_algo.patch b/package/mac80211/patches/016-remove_pid_algo.patch index 9d22e75..2035d60 100644 --- a/package/mac80211/patches/016-remove_pid_algo.patch +++ b/package/mac80211/patches/016-remove_pid_algo.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -163,7 +163,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +@@ -167,7 +167,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y # This is the one used by our compat-wireless net/mac80211/rate.c # in case you have and old kernel which is overriding this to pid. CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht diff --git a/package/mac80211/patches/017-remove_ath9k_rc.patch b/package/mac80211/patches/017-remove_ath9k_rc.patch index ad1f146..7fef47f 100644 --- a/package/mac80211/patches/017-remove_ath9k_rc.patch +++ b/package/mac80211/patches/017-remove_ath9k_rc.patch @@ -1,11 +1,11 @@ --- a/config.mk +++ b/config.mk -@@ -259,7 +259,7 @@ CONFIG_ATH9K_COMMON=m +@@ -261,7 +261,7 @@ CONFIG_ATH9K_COMMON=m # as default once we get minstrel properly tested and blessed by # our systems engineering team. CCK rates also need to be used # for long range considerations. -CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_RATE_CONTROL=y - # PCI Drivers - ifdef CONFIG_PCI + CONFIG_ATH9K_BTCOEX_SUPPORT=y + diff --git a/package/mac80211/patches/018-revert_printk_va_format.patch b/package/mac80211/patches/018-revert_printk_va_format.patch index 646ed1c..fa2237c 100644 --- a/package/mac80211/patches/018-revert_printk_va_format.patch +++ b/package/mac80211/patches/018-revert_printk_va_format.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c -@@ -339,83 +339,59 @@ static int b43_ratelimit(struct b43_wl * +@@ -341,83 +341,59 @@ static int b43_ratelimit(struct b43_wl * void b43info(struct b43_wl *wl, const char *fmt, ...) { diff --git a/package/mac80211/patches/019-remove_ath5k_pci_option.patch b/package/mac80211/patches/019-remove_ath5k_pci_option.patch index 513d435..a11d625 100644 --- a/package/mac80211/patches/019-remove_ath5k_pci_option.patch +++ b/package/mac80211/patches/019-remove_ath5k_pci_option.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -264,7 +264,7 @@ CONFIG_ATH9K_COMMON=m +@@ -268,7 +268,7 @@ CONFIG_ATH9K_BTCOEX_SUPPORT=y # PCI Drivers ifdef CONFIG_PCI diff --git a/package/mac80211/patches/060-fix_compat_security.patch b/package/mac80211/patches/060-fix_compat_security.patch index 1942499..dca0e90 100644 --- a/package/mac80211/patches/060-fix_compat_security.patch +++ b/package/mac80211/patches/060-fix_compat_security.patch @@ -1,8 +1,8 @@ --- a/include/linux/compat-3.1.h +++ b/include/linux/compat-3.1.h -@@ -5,6 +5,8 @@ +@@ -7,6 +7,8 @@ - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) + #include <linux/security.h> +#include <linux/security.h> + diff --git a/package/mac80211/patches/070-deactivate_mac80211_tracing.patch b/package/mac80211/patches/070-deactivate_mac80211_tracing.patch deleted file mode 100644 index feff5eb..0000000 --- a/package/mac80211/patches/070-deactivate_mac80211_tracing.patch +++ /dev/null @@ -1,44 +0,0 @@ -Do not activate the mac80211 tracing by default as it does not work with -kernel <= 2.6.32. Compat also includes include/trace/define_trace.h over -include/trace/events/module.h which makes this not compiling any more. - ---- a/net/mac80211/Makefile -+++ b/net/mac80211/Makefile -@@ -24,8 +24,7 @@ mac80211-y := \ - util.o \ - wme.o \ - event.o \ -- chan.o \ -- driver-trace.o -+ chan.o - - mac80211-$(CONFIG_MAC80211_LEDS) += led.o - mac80211-$(CONFIG_MAC80211_DEBUGFS) += \ -@@ -42,6 +41,7 @@ mac80211-$(CONFIG_MAC80211_MESH) += \ - - mac80211-$(CONFIG_PM) += pm.o - -+mac80211-$(CONFIG_MAC80211_DRIVER_API_TRACER) += driver-trace.o - CFLAGS_driver-trace.o := -I$(src) - - # objects for PID algorithm ---- a/net/mac80211/driver-trace.h -+++ b/net/mac80211/driver-trace.h -@@ -5,6 +5,17 @@ - #include <net/mac80211.h> - #include "ieee80211_i.h" - -+#if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__) -+#undef TRACE_EVENT -+#define TRACE_EVENT(name, proto, ...) \ -+static inline void trace_ ## name(proto) {} -+#undef DECLARE_EVENT_CLASS -+#define DECLARE_EVENT_CLASS(...) -+#undef DEFINE_EVENT -+#define DEFINE_EVENT(evt_class, name, proto, ...) \ -+static inline void trace_ ## name(proto) {} -+#endif -+ - #undef TRACE_SYSTEM - #define TRACE_SYSTEM mac80211 - diff --git a/package/mac80211/patches/110-disable_usb_compat.patch b/package/mac80211/patches/110-disable_usb_compat.patch index 67a5527..9700fb3 100644 --- a/package/mac80211/patches/110-disable_usb_compat.patch +++ b/package/mac80211/patches/110-disable_usb_compat.patch @@ -33,7 +33,7 @@ #endif --- a/config.mk +++ b/config.mk -@@ -492,7 +492,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 +@@ -496,7 +496,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 # This activates a threading fix for usb urb. # this is mainline commit: b3e670443b7fb8a2d29831b62b44a039c283e351 # This fix will be included in some stable releases. diff --git a/package/mac80211/patches/120-pr_fmt_warnings.patch b/package/mac80211/patches/120-pr_fmt_warnings.patch index 44c1f3c..5fde762 100644 --- a/package/mac80211/patches/120-pr_fmt_warnings.patch +++ b/package/mac80211/patches/120-pr_fmt_warnings.patch @@ -70,7 +70,7 @@ #include <linux/err.h> --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -33,6 +33,7 @@ +@@ -42,6 +42,7 @@ * */ diff --git a/package/mac80211/patches/140-mesh_pathtbl_backport.patch b/package/mac80211/patches/140-mesh_pathtbl_backport.patch index 817060d..bc4b40a 100644 --- a/package/mac80211/patches/140-mesh_pathtbl_backport.patch +++ b/package/mac80211/patches/140-mesh_pathtbl_backport.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c -@@ -826,7 +826,6 @@ static void table_flush_by_iface(struct +@@ -828,7 +828,6 @@ static void table_flush_by_iface(struct struct hlist_node *p; int i; diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index eb09e03..83edd7e 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -1,537 +1,9 @@ ---- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c -+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c -@@ -203,7 +203,7 @@ static void ar9002_hw_iqcalibrate(struct - i); - - ath_dbg(common, ATH_DBG_CALIBRATE, -- "Orignal: Chn %diq_corr_meas = 0x%08x\n", -+ "Original: Chn %d iq_corr_meas = 0x%08x\n", - i, ah->totalIqCorrMeas[i]); - - iqCorrNeg = 0; ---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c -@@ -226,7 +226,7 @@ static void ar9003_hw_iqcalibrate(struct - i); - - ath_dbg(common, ATH_DBG_CALIBRATE, -- "Orignal: Chn %diq_corr_meas = 0x%08x\n", -+ "Original: Chn %d iq_corr_meas = 0x%08x\n", - i, ah->totalIqCorrMeas[i]); - - iqCorrNeg = 0; ---- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c -@@ -808,7 +808,8 @@ void ath9k_htc_ani_work(struct work_stru - } - - /* Verify whether we must check ANI */ -- if ((timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) { -+ if (ah->config.enable_ani && -+ (timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) { - aniflag = true; - common->ani.checkani_timer = timestamp; - } ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -504,7 +504,7 @@ static int ath9k_hw_post_init(struct ath - return ecode; - } - -- if (!AR_SREV_9100(ah) && !AR_SREV_9340(ah)) { -+ if (ah->config.enable_ani) { - ath9k_hw_ani_setup(ah); - ath9k_hw_ani_init(ah); - } -@@ -610,6 +610,10 @@ static int __ath9k_hw_init(struct ath_hw - if (!AR_SREV_9300_20_OR_LATER(ah)) - ah->ani_function &= ~ATH9K_ANI_MRC_CCK; - -+ /* disable ANI for 9340 */ -+ if (AR_SREV_9340(ah)) -+ ah->config.enable_ani = false; -+ - ath9k_hw_init_mode_regs(ah); - - if (!ah->is_pciexpress) ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -118,7 +118,7 @@ void ath9k_ps_restore(struct ath_softc * - if (--sc->ps_usecount != 0) - goto unlock; - -- if (sc->ps_idle) -+ if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK)) - mode = ATH9K_PM_FULL_SLEEP; - else if (sc->ps_enabled && - !(sc->ps_flags & (PS_WAIT_FOR_BEACON | -@@ -286,7 +286,7 @@ static bool ath_complete_reset(struct at - ath_start_ani(common); - } - -- if (ath9k_hw_ops(ah)->antdiv_comb_conf_get && sc->ant_rx != 3) { -+ if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) { - struct ath_hw_antcomb_conf div_ant_conf; - u8 lna_conf; - -@@ -332,7 +332,8 @@ static int ath_reset_internal(struct ath - hchan = ah->curchan; - } - -- if (fastcc && !ath9k_hw_check_alive(ah)) -+ if (fastcc && (ah->chip_fullsleep || -+ !ath9k_hw_check_alive(ah))) - fastcc = false; - - if (!ath_prepare_reset(sc, retry_tx, flush)) -@@ -561,7 +562,6 @@ void ath_ani_calibrate(unsigned long dat - /* Long calibration runs independently of short calibration. */ - if ((timestamp - common->ani.longcal_timer) >= long_cal_interval) { - longcal = true; -- ath_dbg(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies); - common->ani.longcal_timer = timestamp; - } - -@@ -569,8 +569,6 @@ void ath_ani_calibrate(unsigned long dat - if (!common->ani.caldone) { - if ((timestamp - common->ani.shortcal_timer) >= short_cal_interval) { - shortcal = true; -- ath_dbg(common, ATH_DBG_ANI, -- "shortcal @%lu\n", jiffies); - common->ani.shortcal_timer = timestamp; - common->ani.resetcal_timer = timestamp; - } -@@ -584,8 +582,9 @@ void ath_ani_calibrate(unsigned long dat - } - - /* Verify whether we must check ANI */ -- if ((timestamp - common->ani.checkani_timer) >= -- ah->config.ani_poll_interval) { -+ if (sc->sc_ah->config.enable_ani -+ && (timestamp - common->ani.checkani_timer) >= -+ ah->config.ani_poll_interval) { - aniflag = true; - common->ani.checkani_timer = timestamp; - } -@@ -605,6 +604,11 @@ void ath_ani_calibrate(unsigned long dat - ah->rxchainmask, longcal); - } - -+ ath_dbg(common, ATH_DBG_ANI, -+ "Calibration @%lu finished: %s %s %s, caldone: %s\n", jiffies, -+ longcal ? "long" : "", shortcal ? "short" : "", -+ aniflag ? "ani" : "", common->ani.caldone ? "true" : "false"); -+ - ath9k_ps_restore(sc); - - set_timer: -@@ -886,82 +890,6 @@ chip_reset: - #undef SCHED_INTR - } - --static void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw) --{ -- struct ath_hw *ah = sc->sc_ah; -- struct ath_common *common = ath9k_hw_common(ah); -- struct ieee80211_channel *channel = hw->conf.channel; -- int r; -- -- ath9k_ps_wakeup(sc); -- spin_lock_bh(&sc->sc_pcu_lock); -- atomic_set(&ah->intr_ref_cnt, -1); -- -- ath9k_hw_configpcipowersave(ah, false); -- -- if (!ah->curchan) -- ah->curchan = ath9k_cmn_get_curchannel(sc->hw, ah); -- -- r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); -- if (r) { -- ath_err(common, -- "Unable to reset channel (%u MHz), reset status %d\n", -- channel->center_freq, r); -- } -- -- ath_complete_reset(sc, true); -- -- /* Enable LED */ -- ath9k_hw_cfg_output(ah, ah->led_pin, -- AR_GPIO_OUTPUT_MUX_AS_OUTPUT); -- ath9k_hw_set_gpio(ah, ah->led_pin, 0); -- -- spin_unlock_bh(&sc->sc_pcu_lock); -- -- ath9k_ps_restore(sc); --} -- --void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) --{ -- struct ath_hw *ah = sc->sc_ah; -- struct ieee80211_channel *channel = hw->conf.channel; -- int r; -- -- ath9k_ps_wakeup(sc); -- -- ath_cancel_work(sc); -- -- spin_lock_bh(&sc->sc_pcu_lock); -- -- /* -- * Keep the LED on when the radio is disabled -- * during idle unassociated state. -- */ -- if (!sc->ps_idle) { -- ath9k_hw_set_gpio(ah, ah->led_pin, 1); -- ath9k_hw_cfg_gpio_input(ah, ah->led_pin); -- } -- -- ath_prepare_reset(sc, false, true); -- -- if (!ah->curchan) -- ah->curchan = ath9k_cmn_get_curchannel(hw, ah); -- -- r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); -- if (r) { -- ath_err(ath9k_hw_common(sc->sc_ah), -- "Unable to reset channel (%u MHz), reset status %d\n", -- channel->center_freq, r); -- } -- -- ath9k_hw_phy_disable(ah); -- -- ath9k_hw_configpcipowersave(ah, true); -- -- spin_unlock_bh(&sc->sc_pcu_lock); -- ath9k_ps_restore(sc); --} -- - static int ath_reset(struct ath_softc *sc, bool retry_tx) - { - int r; -@@ -1097,6 +1025,9 @@ static int ath9k_start(struct ieee80211_ - * and then setup of the interrupt mask. - */ - spin_lock_bh(&sc->sc_pcu_lock); -+ -+ atomic_set(&ah->intr_ref_cnt, -1); -+ - r = ath9k_hw_reset(ah, init_channel, ah->caldata, false); - if (r) { - ath_err(common, -@@ -1138,6 +1069,18 @@ static int ath9k_start(struct ieee80211_ - goto mutex_unlock; - } - -+ if (ah->led_pin >= 0) { -+ ath9k_hw_cfg_output(ah, ah->led_pin, -+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); -+ ath9k_hw_set_gpio(ah, ah->led_pin, 0); -+ } -+ -+ /* -+ * Reset key cache to sane defaults (all entries cleared) instead of -+ * semi-random values after suspend/resume. -+ */ -+ ath9k_cmn_init_crypto(sc->sc_ah); -+ - spin_unlock_bh(&sc->sc_pcu_lock); - - if ((ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) && -@@ -1183,6 +1126,13 @@ static void ath9k_tx(struct ieee80211_hw - } - } - -+ /* -+ * Cannot tx while the hardware is in full sleep, it first needs a full -+ * chip reset to recover from that -+ */ -+ if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_FULL_SLEEP)) -+ goto exit; -+ - if (unlikely(sc->sc_ah->power_mode != ATH9K_PM_AWAKE)) { - /* - * We are using PS-Poll and mac80211 can request TX while in -@@ -1229,6 +1179,7 @@ static void ath9k_stop(struct ieee80211_ - struct ath_softc *sc = hw->priv; - struct ath_hw *ah = sc->sc_ah; - struct ath_common *common = ath9k_hw_common(ah); -+ bool prev_idle; - - mutex_lock(&sc->mutex); - -@@ -1259,35 +1210,45 @@ static void ath9k_stop(struct ieee80211_ - * before setting the invalid flag. */ - ath9k_hw_disable_interrupts(ah); - -- if (!(sc->sc_flags & SC_OP_INVALID)) { -- ath_drain_all_txq(sc, false); -- ath_stoprecv(sc); -- ath9k_hw_phy_disable(ah); -- } else -- sc->rx.rxlink = NULL; -+ spin_unlock_bh(&sc->sc_pcu_lock); -+ -+ /* we can now sync irq and kill any running tasklets, since we already -+ * disabled interrupts and not holding a spin lock */ -+ synchronize_irq(sc->irq); -+ tasklet_kill(&sc->intr_tq); -+ tasklet_kill(&sc->bcon_tasklet); -+ -+ prev_idle = sc->ps_idle; -+ sc->ps_idle = true; -+ -+ spin_lock_bh(&sc->sc_pcu_lock); -+ -+ if (ah->led_pin >= 0) { -+ ath9k_hw_set_gpio(ah, ah->led_pin, 1); -+ ath9k_hw_cfg_gpio_input(ah, ah->led_pin); -+ } -+ -+ ath_prepare_reset(sc, false, true); - - if (sc->rx.frag) { - dev_kfree_skb_any(sc->rx.frag); - sc->rx.frag = NULL; - } - -- /* disable HAL and put h/w to sleep */ -- ath9k_hw_disable(ah); -+ if (!ah->curchan) -+ ah->curchan = ath9k_cmn_get_curchannel(hw, ah); - -- spin_unlock_bh(&sc->sc_pcu_lock); -+ ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); -+ ath9k_hw_phy_disable(ah); - -- /* we can now sync irq and kill any running tasklets, since we already -- * disabled interrupts and not holding a spin lock */ -- synchronize_irq(sc->irq); -- tasklet_kill(&sc->intr_tq); -- tasklet_kill(&sc->bcon_tasklet); -+ ath9k_hw_configpcipowersave(ah, true); - -- ath9k_ps_restore(sc); -+ spin_unlock_bh(&sc->sc_pcu_lock); - -- sc->ps_idle = true; -- ath_radio_disable(sc, hw); -+ ath9k_ps_restore(sc); - - sc->sc_flags |= SC_OP_INVALID; -+ sc->ps_idle = prev_idle; - - mutex_unlock(&sc->mutex); - -@@ -1627,8 +1588,8 @@ static int ath9k_config(struct ieee80211 - struct ath_hw *ah = sc->sc_ah; - struct ath_common *common = ath9k_hw_common(ah); - struct ieee80211_conf *conf = &hw->conf; -- bool disable_radio = false; - -+ ath9k_ps_wakeup(sc); - mutex_lock(&sc->mutex); - - /* -@@ -1639,13 +1600,8 @@ static int ath9k_config(struct ieee80211 - */ - if (changed & IEEE80211_CONF_CHANGE_IDLE) { - sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); -- if (!sc->ps_idle) { -- ath_radio_enable(sc, hw); -- ath_dbg(common, ATH_DBG_CONFIG, -- "not-idle: enabling radio\n"); -- } else { -- disable_radio = true; -- } -+ if (sc->ps_idle) -+ ath_cancel_work(sc); - } - - /* -@@ -1678,7 +1634,6 @@ static int ath9k_config(struct ieee80211 - - if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { - struct ieee80211_channel *curchan = hw->conf.channel; -- struct ath9k_channel old_chan; - int pos = curchan->hw_value; - int old_pos = -1; - unsigned long flags; -@@ -1704,11 +1659,8 @@ static int ath9k_config(struct ieee80211 - * Preserve the current channel values, before updating - * the same channel - */ -- if (old_pos == pos) { -- memcpy(&old_chan, &sc->sc_ah->channels[pos], -- sizeof(struct ath9k_channel)); -- ah->curchan = &old_chan; -- } -+ if (ah->curchan && (old_pos == pos)) -+ ath9k_hw_getnf(ah, ah->curchan); - - ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos], - curchan, conf->channel_type); -@@ -1752,18 +1704,12 @@ static int ath9k_config(struct ieee80211 - ath_dbg(common, ATH_DBG_CONFIG, - "Set power: %d\n", conf->power_level); - sc->config.txpowlimit = 2 * conf->power_level; -- ath9k_ps_wakeup(sc); - ath9k_cmn_update_txpow(ah, sc->curtxpow, - sc->config.txpowlimit, &sc->curtxpow); -- ath9k_ps_restore(sc); -- } -- -- if (disable_radio) { -- ath_dbg(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); -- ath_radio_disable(sc, hw); - } - - mutex_unlock(&sc->mutex); -+ ath9k_ps_restore(sc); - - return 0; - } -@@ -2331,9 +2277,6 @@ static void ath9k_flush(struct ieee80211 - return; - } - -- if (drop) -- timeout = 1; -- - for (j = 0; j < timeout; j++) { - bool npend = false; - -@@ -2351,21 +2294,22 @@ static void ath9k_flush(struct ieee80211 - } - - if (!npend) -- goto out; -+ break; - } - -- ath9k_ps_wakeup(sc); -- spin_lock_bh(&sc->sc_pcu_lock); -- drain_txq = ath_drain_all_txq(sc, false); -- spin_unlock_bh(&sc->sc_pcu_lock); -+ if (drop) { -+ ath9k_ps_wakeup(sc); -+ spin_lock_bh(&sc->sc_pcu_lock); -+ drain_txq = ath_drain_all_txq(sc, false); -+ spin_unlock_bh(&sc->sc_pcu_lock); - -- if (!drain_txq) -- ath_reset(sc, false); -+ if (!drain_txq) -+ ath_reset(sc, false); - -- ath9k_ps_restore(sc); -- ieee80211_wake_queues(hw); -+ ath9k_ps_restore(sc); -+ ieee80211_wake_queues(hw); -+ } - --out: - ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); - mutex_unlock(&sc->mutex); - } ---- a/drivers/net/wireless/ath/ath9k/pci.c -+++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -307,12 +307,11 @@ static int ath_pci_suspend(struct device - struct ieee80211_hw *hw = pci_get_drvdata(pdev); - struct ath_softc *sc = hw->priv; - -- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); -- - /* The device has to be moved to FULLSLEEP forcibly. - * Otherwise the chip never moved to full sleep, - * when no interface is up. - */ -+ ath9k_hw_disable(sc->sc_ah); - ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); - - return 0; -@@ -334,22 +333,6 @@ static int ath_pci_resume(struct device - if ((val & 0x0000ff00) != 0) - pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); - -- ath9k_ps_wakeup(sc); -- /* Enable LED */ -- ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin, -- AR_GPIO_OUTPUT_MUX_AS_OUTPUT); -- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0); -- -- /* -- * Reset key cache to sane defaults (all entries cleared) instead of -- * semi-random values after suspend/resume. -- */ -- ath9k_cmn_init_crypto(sc->sc_ah); -- ath9k_ps_restore(sc); -- -- sc->ps_idle = true; -- ath_radio_disable(sc, hw); -- - return 0; - } - ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1954,7 +1954,7 @@ static void ath_tx_complete(struct ath_s - skb_pull(skb, padsize); - } - -- if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) { -+ if ((sc->ps_flags & PS_WAIT_FOR_TX_ACK) && !txq->axq_depth) { - sc->ps_flags &= ~PS_WAIT_FOR_TX_ACK; - ath_dbg(common, ATH_DBG_PS, - "Going back to sleep after having received TX status (0x%lx)\n", ---- a/include/linux/nl80211.h -+++ b/include/linux/nl80211.h -@@ -2785,9 +2785,11 @@ enum nl80211_ap_sme_features { - * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back - * TX status to the socket error queue when requested with the - * socket option. -+ * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. - */ - enum nl80211_feature_flags { - NL80211_FEATURE_SK_TX_STATUS = 1 << 0, -+ NL80211_FEATURE_HT_IBSS = 1 << 1, - }; - - /** ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -1149,6 +1149,7 @@ struct cfg80211_ibss_params { - u8 *ssid; - u8 *bssid; - struct ieee80211_channel *channel; -+ enum nl80211_channel_type channel_type; - u8 *ie; - u8 ssid_len, ie_len; - u16 beacon_interval; -@@ -3270,6 +3271,16 @@ void cfg80211_report_obss_beacon(struct - const u8 *frame, size_t len, - int freq, gfp_t gfp); - -+/* -+ * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used -+ * @wiphy: the wiphy -+ * @chan: main channel -+ * @channel_type: HT mode -+ */ -+int cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, -+ struct ieee80211_channel *chan, -+ enum nl80211_channel_type channel_type); -+ - /* Logging, debugging and troubleshooting/diagnostic helpers. */ - - /* wiphy_printk helpers, similar to dev_printk */ --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c -@@ -185,6 +185,10 @@ static void ieee80211_send_addba_resp(st - memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); - else if (sdata->vif.type == NL80211_IFTYPE_STATION) +@@ -187,6 +187,8 @@ static void ieee80211_send_addba_resp(st memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); -+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) -+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN); + else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) + memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN); + else if (sdata->vif.type == NL80211_IFTYPE_WDS) + memcpy(mgmt->bssid, da, ETH_ALEN); @@ -539,16 +11,7 @@ IEEE80211_STYPE_ACTION); --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c -@@ -55,6 +55,8 @@ - * @ampdu_action function will be called with the action - * %IEEE80211_AMPDU_TX_STOP. In this case, the call must not fail, - * and the driver must later call ieee80211_stop_tx_ba_cb_irqsafe(). -+ * Note that the sta can get destroyed before the BA tear down is -+ * complete. - */ - - static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, -@@ -79,10 +81,13 @@ static void ieee80211_send_addba_request +@@ -81,7 +81,8 @@ static void ieee80211_send_addba_request memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); if (sdata->vif.type == NL80211_IFTYPE_AP || sdata->vif.type == NL80211_IFTYPE_AP_VLAN || @@ -558,186 +21,22 @@ memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); else if (sdata->vif.type == NL80211_IFTYPE_STATION) memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); -+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) -+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN); - - mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | - IEEE80211_STYPE_ACTION); -@@ -319,6 +324,38 @@ ieee80211_wake_queue_agg(struct ieee8021 - __release(agg_queue); - } - -+/* -+ * splice packets from the STA's pending to the local pending, -+ * requires a call to ieee80211_agg_splice_finish later -+ */ -+static void __acquires(agg_queue) -+ieee80211_agg_splice_packets(struct ieee80211_local *local, -+ struct tid_ampdu_tx *tid_tx, u16 tid) -+{ -+ int queue = ieee80211_ac_from_tid(tid); -+ unsigned long flags; -+ -+ ieee80211_stop_queue_agg(local, tid); -+ -+ if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates" -+ " from the pending queue\n", tid)) -+ return; -+ -+ if (!skb_queue_empty(&tid_tx->pending)) { -+ spin_lock_irqsave(&local->queue_stop_reason_lock, flags); -+ /* copy over remaining packets */ -+ skb_queue_splice_tail_init(&tid_tx->pending, -+ &local->pending[queue]); -+ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -+ } -+} -+ -+static void __releases(agg_queue) -+ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid) -+{ -+ ieee80211_wake_queue_agg(local, tid); -+} -+ - void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) - { - struct tid_ampdu_tx *tid_tx; -@@ -330,19 +367,17 @@ void ieee80211_tx_ba_session_handle_star - tid_tx = rcu_dereference_protected_tid_tx(sta, tid); - - /* -- * While we're asking the driver about the aggregation, -- * stop the AC queue so that we don't have to worry -- * about frames that came in while we were doing that, -- * which would require us to put them to the AC pending -- * afterwards which just makes the code more complex. -+ * Start queuing up packets for this aggregation session. -+ * We're going to release them once the driver is OK with -+ * that. - */ -- ieee80211_stop_queue_agg(local, tid); -- - clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); - - /* -- * make sure no packets are being processed to get -- * valid starting sequence number -+ * Make sure no packets are being processed. This ensures that -+ * we have a valid starting sequence number and that in-flight -+ * packets have been flushed out and no packets for this TID -+ * will go into the driver during the ampdu_action call. - */ - synchronize_net(); - -@@ -356,10 +391,11 @@ void ieee80211_tx_ba_session_handle_star - " tid %d\n", tid); - #endif - spin_lock_bh(&sta->lock); -+ ieee80211_agg_splice_packets(local, tid_tx, tid); - ieee80211_assign_tid_tx(sta, tid, NULL); -+ ieee80211_agg_splice_finish(local, tid); - spin_unlock_bh(&sta->lock); - -- ieee80211_wake_queue_agg(local, tid); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40)) - kfree_rcu(tid_tx, rcu_head); - #else -@@ -368,9 +404,6 @@ void ieee80211_tx_ba_session_handle_star - return; - } - -- /* we can take packets again now */ -- ieee80211_wake_queue_agg(local, tid); -- - /* activate the timer for the recipient's addBA response */ - mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); - #ifdef CONFIG_MAC80211_HT_DEBUG -@@ -437,7 +470,9 @@ int ieee80211_start_tx_ba_session(struct - if (sdata->vif.type != NL80211_IFTYPE_STATION && +@@ -471,6 +472,7 @@ int ieee80211_start_tx_ba_session(struct sdata->vif.type != NL80211_IFTYPE_MESH_POINT && sdata->vif.type != NL80211_IFTYPE_AP_VLAN && -- sdata->vif.type != NL80211_IFTYPE_AP) -+ sdata->vif.type != NL80211_IFTYPE_AP && + sdata->vif.type != NL80211_IFTYPE_AP && + sdata->vif.type != NL80211_IFTYPE_WDS && -+ sdata->vif.type != NL80211_IFTYPE_ADHOC) - return -EINVAL; - - if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { -@@ -448,6 +483,27 @@ int ieee80211_start_tx_ba_session(struct + sdata->vif.type != NL80211_IFTYPE_ADHOC) return -EINVAL; - } - -+ /* -+ * 802.11n-2009 11.5.1.1: If the initiating STA is an HT STA, is a -+ * member of an IBSS, and has no other existing Block Ack agreement -+ * with the recipient STA, then the initiating STA shall transmit a -+ * Probe Request frame to the recipient STA and shall not transmit an -+ * ADDBA Request frame unless it receives a Probe Response frame -+ * from the recipient within dot11ADDBAFailureTimeout. -+ * -+ * The probe request mechanism for ADDBA is currently not implemented, -+ * but we only build up Block Ack session with HT STAs. This information -+ * is set when we receive a bss info from a probe response or a beacon. -+ */ -+ if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && -+ !sta->sta.ht_cap.ht_supported) { -+#ifdef CONFIG_MAC80211_HT_DEBUG -+ printk(KERN_DEBUG "BA request denied - IBSS STA %pM" -+ "does not advertise HT support\n", pubsta->addr); -+#endif /* CONFIG_MAC80211_HT_DEBUG */ -+ return -EINVAL; -+ } -+ - spin_lock_bh(&sta->lock); - /* we have tried too many times, receiver does not want A-MPDU */ -@@ -508,38 +564,6 @@ int ieee80211_start_tx_ba_session(struct - } - EXPORT_SYMBOL(ieee80211_start_tx_ba_session); - --/* -- * splice packets from the STA's pending to the local pending, -- * requires a call to ieee80211_agg_splice_finish later -- */ --static void __acquires(agg_queue) --ieee80211_agg_splice_packets(struct ieee80211_local *local, -- struct tid_ampdu_tx *tid_tx, u16 tid) --{ -- int queue = ieee80211_ac_from_tid(tid); -- unsigned long flags; -- -- ieee80211_stop_queue_agg(local, tid); -- -- if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates" -- " from the pending queue\n", tid)) -- return; -- -- if (!skb_queue_empty(&tid_tx->pending)) { -- spin_lock_irqsave(&local->queue_stop_reason_lock, flags); -- /* copy over remaining packets */ -- skb_queue_splice_tail_init(&tid_tx->pending, -- &local->pending[queue]); -- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); -- } --} -- --static void __releases(agg_queue) --ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid) --{ -- ieee80211_wake_queue_agg(local, tid); --} -- - static void ieee80211_agg_tx_operational(struct ieee80211_local *local, - struct sta_info *sta, u16 tid) - { --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -63,11 +63,11 @@ static ssize_t sta_flags_read(struct fil test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : "" int res = scnprintf(buf, sizeof(buf), -- "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", -+ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", +- "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", ++ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", TEST(AUTH), TEST(ASSOC), TEST(PS_STA), TEST(PS_DRIVER), TEST(AUTHORIZED), TEST(SHORT_PREAMBLE), @@ -745,219 +44,7 @@ + TEST(WME), TEST(CLEAR_PS_FILT), TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), - TEST(TDLS_PEER_AUTH)); ---- a/net/mac80211/ht.c -+++ b/net/mac80211/ht.c -@@ -47,7 +47,9 @@ void ieee80211_apply_htcap_overrides(str - int i; - - if (sdata->vif.type != NL80211_IFTYPE_STATION) { -- WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION); -+ /* AP interfaces call this code when adding new stations, -+ * so just silently ignore non station interfaces. -+ */ - return; - } - -@@ -282,6 +284,8 @@ void ieee80211_send_delba(struct ieee802 - memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); - else if (sdata->vif.type == NL80211_IFTYPE_STATION) - memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); -+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) -+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN); - - mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | - IEEE80211_STYPE_ACTION); ---- a/net/mac80211/ibss.c -+++ b/net/mac80211/ibss.c -@@ -77,6 +77,7 @@ static void __ieee80211_sta_join_ibss(st - struct cfg80211_bss *bss; - u32 bss_change; - u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; -+ enum nl80211_channel_type channel_type; - - lockdep_assert_held(&ifibss->mtx); - -@@ -105,8 +106,16 @@ static void __ieee80211_sta_join_ibss(st - - sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; - -- local->oper_channel = chan; -- WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT)); -+ channel_type = ifibss->channel_type; -+ if (channel_type > NL80211_CHAN_HT20 && -+ !cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type)) -+ channel_type = NL80211_CHAN_HT20; -+ if (!ieee80211_set_channel_type(local, sdata, channel_type)) { -+ /* can only fail due to HT40+/- mismatch */ -+ channel_type = NL80211_CHAN_HT20; -+ WARN_ON(!ieee80211_set_channel_type(local, sdata, -+ NL80211_CHAN_HT20)); -+ } - ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); - - sband = local->hw.wiphy->bands[chan->band]; -@@ -172,6 +181,19 @@ static void __ieee80211_sta_join_ibss(st - memcpy(skb_put(skb, ifibss->ie_len), - ifibss->ie, ifibss->ie_len); - -+ /* add HT capability and information IEs */ -+ if (channel_type && sband->ht_cap.ht_supported) { -+ pos = skb_put(skb, 4 + -+ sizeof(struct ieee80211_ht_cap) + -+ sizeof(struct ieee80211_ht_info)); -+ pos = ieee80211_ie_build_ht_cap(pos, &sband->ht_cap, -+ sband->ht_cap.cap); -+ pos = ieee80211_ie_build_ht_info(pos, -+ &sband->ht_cap, -+ chan, -+ channel_type); -+ } -+ - if (local->hw.queues >= 4) { - pos = skb_put(skb, 9); - *pos++ = WLAN_EID_VENDOR_SPECIFIC; -@@ -195,6 +217,7 @@ static void __ieee80211_sta_join_ibss(st - bss_change |= BSS_CHANGED_BEACON; - bss_change |= BSS_CHANGED_BEACON_ENABLED; - bss_change |= BSS_CHANGED_BASIC_RATES; -+ bss_change |= BSS_CHANGED_HT; - bss_change |= BSS_CHANGED_IBSS; - sdata->vif.bss_conf.ibss_joined = true; - ieee80211_bss_info_change_notify(sdata, bss_change); -@@ -268,6 +291,8 @@ static void ieee80211_rx_bss_info(struct - u64 beacon_timestamp, rx_timestamp; - u32 supp_rates = 0; - enum ieee80211_band band = rx_status->band; -+ struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; -+ bool rates_updated = false; - - if (elems->ds_params && elems->ds_params_len == 1) - freq = ieee80211_channel_to_frequency(elems->ds_params[0], -@@ -307,7 +332,7 @@ static void ieee80211_rx_bss_info(struct - prev_rates, - sta->sta.supp_rates[band]); - #endif -- rate_control_rate_init(sta); -+ rates_updated = true; - } - } else - sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid, -@@ -318,6 +343,39 @@ static void ieee80211_rx_bss_info(struct - if (sta && elems->wmm_info) - set_sta_flag(sta, WLAN_STA_WME); - -+ if (sta && elems->ht_info_elem && elems->ht_cap_elem && -+ sdata->u.ibss.channel_type != NL80211_CHAN_NO_HT) { -+ /* we both use HT */ -+ struct ieee80211_sta_ht_cap sta_ht_cap_new; -+ enum nl80211_channel_type channel_type = -+ ieee80211_ht_info_to_channel_type( -+ elems->ht_info_elem); -+ -+ ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, -+ elems->ht_cap_elem, -+ &sta_ht_cap_new); -+ -+ /* -+ * fall back to HT20 if we don't use or use -+ * the other extension channel -+ */ -+ if ((channel_type == NL80211_CHAN_HT40MINUS || -+ channel_type == NL80211_CHAN_HT40PLUS) && -+ channel_type != sdata->u.ibss.channel_type) -+ sta_ht_cap_new.cap &= -+ ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; -+ -+ if (memcmp(&sta->sta.ht_cap, &sta_ht_cap_new, -+ sizeof(sta_ht_cap_new))) { -+ memcpy(&sta->sta.ht_cap, &sta_ht_cap_new, -+ sizeof(sta_ht_cap_new)); -+ rates_updated = true; -+ } -+ } -+ -+ if (sta && rates_updated) -+ rate_control_rate_init(sta); -+ - rcu_read_unlock(); - } - -@@ -896,12 +954,18 @@ int ieee80211_ibss_join(struct ieee80211 - struct cfg80211_ibss_params *params) - { - struct sk_buff *skb; -+ u32 changed = 0; - - skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom + -- 36 /* bitrates */ + -- 34 /* SSID */ + -- 3 /* DS params */ + -- 4 /* IBSS params */ + -+ sizeof(struct ieee80211_hdr_3addr) + -+ 12 /* struct ieee80211_mgmt.u.beacon */ + -+ 2 + IEEE80211_MAX_SSID_LEN /* max SSID */ + -+ 2 + 8 /* max Supported Rates */ + -+ 3 /* max DS params */ + -+ 4 /* IBSS params */ + -+ 2 + (IEEE80211_MAX_SUPP_RATES - 8) + -+ 2 + sizeof(struct ieee80211_ht_cap) + -+ 2 + sizeof(struct ieee80211_ht_info) + - params->ie_len); - if (!skb) - return -ENOMEM; -@@ -922,13 +986,15 @@ int ieee80211_ibss_join(struct ieee80211 - sdata->vif.bss_conf.beacon_int = params->beacon_interval; - - sdata->u.ibss.channel = params->channel; -+ sdata->u.ibss.channel_type = params->channel_type; - sdata->u.ibss.fixed_channel = params->channel_fixed; - - /* fix ourselves to that channel now already */ - if (params->channel_fixed) { - sdata->local->oper_channel = params->channel; -- WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata, -- NL80211_CHAN_NO_HT)); -+ if (!ieee80211_set_channel_type(sdata->local, sdata, -+ params->channel_type)) -+ return -EINVAL; - } - - if (params->ie) { -@@ -951,6 +1017,23 @@ int ieee80211_ibss_join(struct ieee80211 - ieee80211_recalc_idle(sdata->local); - mutex_unlock(&sdata->local->mtx); - -+ /* -+ * 802.11n-2009 9.13.3.1: In an IBSS, the HT Protection field is -+ * reserved, but an HT STA shall protect HT transmissions as though -+ * the HT Protection field were set to non-HT mixed mode. -+ * -+ * In an IBSS, the RIFS Mode field of the HT Operation element is -+ * also reserved, but an HT STA shall operate as though this field -+ * were set to 1. -+ */ -+ -+ sdata->vif.bss_conf.ht_operation_mode |= -+ IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED -+ | IEEE80211_HT_PARAM_RIFS_MODE; -+ -+ changed |= BSS_CHANGED_HT; -+ ieee80211_bss_info_change_notify(sdata, changed); -+ - ieee80211_queue_work(&sdata->local->hw, &sdata->work); - - return 0; ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -474,6 +474,7 @@ struct ieee80211_if_ibss { - u8 ssid_len, ie_len; - u8 *ie; - struct ieee80211_channel *channel; -+ enum nl80211_channel_type channel_type; - - unsigned long ibss_join_req; - /* probe response/beacon for IBSS */ + TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT), --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -178,7 +178,6 @@ static int ieee80211_do_open(struct net_ @@ -968,7 +55,7 @@ u32 changed = 0; int res; u32 hw_reconf_flags = 0; -@@ -309,27 +308,6 @@ static int ieee80211_do_open(struct net_ +@@ -309,28 +308,6 @@ static int ieee80211_do_open(struct net_ set_bit(SDATA_STATE_RUNNING, &sdata->state); @@ -981,8 +68,9 @@ - goto err_del_interface; - } - -- /* no atomic bitop required since STA is not live yet */ -- set_sta_flag(sta, WLAN_STA_AUTHORIZED); +- sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); +- sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); +- sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); - - res = sta_info_insert(sta); - if (res) { @@ -996,7 +84,7 @@ /* * set_multicast_list will be invoked by the networking core * which will check whether any increments here were done in -@@ -356,8 +334,7 @@ static int ieee80211_do_open(struct net_ +@@ -357,8 +334,7 @@ static int ieee80211_do_open(struct net_ netif_tx_start_all_queues(dev); return 0; @@ -1006,7 +94,7 @@ err_stop: if (!local->open_count) drv_stop(local); -@@ -719,6 +696,70 @@ static void ieee80211_if_setup(struct ne +@@ -720,6 +696,70 @@ static void ieee80211_if_setup(struct ne dev->destructor = free_netdev; } @@ -1077,7 +165,7 @@ static void ieee80211_iface_work(struct work_struct *work) { struct ieee80211_sub_if_data *sdata = -@@ -823,6 +864,9 @@ static void ieee80211_iface_work(struct +@@ -824,6 +864,9 @@ static void ieee80211_iface_work(struct break; ieee80211_mesh_rx_queued_mgmt(sdata, skb); break; @@ -1087,32 +175,17 @@ default: WARN(1, "frame for unexpected interface type"); break; ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -574,7 +574,8 @@ struct ieee80211_hw *ieee80211_alloc_hw( - WIPHY_FLAG_OFFCHAN_TX | - WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; - -- wiphy->features = NL80211_FEATURE_SK_TX_STATUS; -+ wiphy->features = NL80211_FEATURE_SK_TX_STATUS | -+ NL80211_FEATURE_HT_IBSS; - - if (!ops->set_key) - wiphy->flags |= WIPHY_FLAG_IBSS_RSN; --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2237,7 +2237,9 @@ ieee80211_rx_h_action(struct ieee80211_r - if (sdata->vif.type != NL80211_IFTYPE_STATION && +@@ -2281,6 +2281,7 @@ ieee80211_rx_h_action(struct ieee80211_r sdata->vif.type != NL80211_IFTYPE_MESH_POINT && sdata->vif.type != NL80211_IFTYPE_AP_VLAN && -- sdata->vif.type != NL80211_IFTYPE_AP) -+ sdata->vif.type != NL80211_IFTYPE_AP && + sdata->vif.type != NL80211_IFTYPE_AP && + sdata->vif.type != NL80211_IFTYPE_WDS && -+ sdata->vif.type != NL80211_IFTYPE_ADHOC) + sdata->vif.type != NL80211_IFTYPE_ADHOC) break; - /* verify action_code is present */ -@@ -2452,13 +2454,14 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ +@@ -2491,14 +2492,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ if (!ieee80211_vif_is_mesh(&sdata->vif) && sdata->vif.type != NL80211_IFTYPE_ADHOC && @@ -1122,33 +195,15 @@ return RX_DROP_MONITOR; switch (stype) { + case cpu_to_le16(IEEE80211_STYPE_AUTH): case cpu_to_le16(IEEE80211_STYPE_BEACON): case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP): - /* process for all: mesh, mlme, ibss */ + /* process for all: mesh, mlme, ibss, wds */ break; - case cpu_to_le16(IEEE80211_STYPE_DEAUTH): - case cpu_to_le16(IEEE80211_STYPE_DISASSOC): -@@ -2796,19 +2799,32 @@ static int prepare_for_handlers(struct i - return 0; - } else if (!ieee80211_bssid_match(bssid, - sdata->vif.addr)) { -+ /* -+ * Accept public action frames even when the -+ * BSSID doesn't match, this is used for P2P -+ * and location updates. Note that mac80211 -+ * itself never looks at these frames. -+ */ - if (!(status->rx_flags & IEEE80211_RX_IN_SCAN) && -- !ieee80211_is_beacon(hdr->frame_control) && -- !(ieee80211_is_action(hdr->frame_control) && -- sdata->vif.p2p)) -+ ieee80211_is_public_action(hdr, skb->len)) -+ return 1; -+ if (!(status->rx_flags & IEEE80211_RX_IN_SCAN) && -+ !ieee80211_is_beacon(hdr->frame_control)) - return 0; - status->rx_flags &= ~IEEE80211_RX_RA_MATCH; + case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP): + case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP): +@@ -2852,10 +2854,16 @@ static int prepare_for_handlers(struct i } break; case NL80211_IFTYPE_WDS: @@ -1167,6 +222,19 @@ break; default: /* should never get here */ +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1379,8 +1379,10 @@ int sta_info_move_state(struct sta_info + return -EINVAL; + } + ++#ifdef CONFIG_MAC80211_VERBOSE_DEBUG + printk(KERN_DEBUG "%s: moving STA %pM to state %d\n", + sta->sdata->name, sta->sta.addr, new_state); ++#endif + + /* + * notify the driver before the actual changes so it can --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -31,7 +31,6 @@ @@ -1177,7 +245,7 @@ * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next * frame to this station is transmitted. -@@ -60,7 +59,6 @@ enum ieee80211_sta_info_flags { +@@ -62,7 +61,6 @@ enum ieee80211_sta_info_flags { WLAN_STA_AUTHORIZED, WLAN_STA_SHORT_PREAMBLE, WLAN_STA_WME, @@ -1185,197 +253,3 @@ WLAN_STA_CLEAR_PS_FILT, WLAN_STA_MFP, WLAN_STA_BLOCK_BA, ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -1612,6 +1612,11 @@ u8 *ieee80211_ie_build_ht_info(u8 *pos, - } - if (ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) - ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY; -+ -+ /* -+ * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and -+ * RIFS Mode are reserved in IBSS mode, therefore keep them at 0 -+ */ - ht_info->operation_mode = 0x0000; - ht_info->stbc_param = 0x0000; - ---- a/net/wireless/chan.c -+++ b/net/wireless/chan.c -@@ -6,6 +6,7 @@ - * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> - */ - -+#include <linux/export.h> - #include <net/cfg80211.h> - #include "core.h" - -@@ -44,9 +45,9 @@ rdev_freq_to_chan(struct cfg80211_regist - return chan; - } - --static bool can_beacon_sec_chan(struct wiphy *wiphy, -- struct ieee80211_channel *chan, -- enum nl80211_channel_type channel_type) -+int cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, -+ struct ieee80211_channel *chan, -+ enum nl80211_channel_type channel_type) - { - struct ieee80211_channel *sec_chan; - int diff; -@@ -75,6 +76,7 @@ static bool can_beacon_sec_chan(struct w - - return true; - } -+EXPORT_SYMBOL(cfg80211_can_beacon_sec_chan); - - int cfg80211_set_freq(struct cfg80211_registered_device *rdev, - struct wireless_dev *wdev, int freq, -@@ -109,8 +111,8 @@ int cfg80211_set_freq(struct cfg80211_re - switch (channel_type) { - case NL80211_CHAN_HT40PLUS: - case NL80211_CHAN_HT40MINUS: -- if (!can_beacon_sec_chan(&rdev->wiphy, chan, -- channel_type)) { -+ if (!cfg80211_can_beacon_sec_chan(&rdev->wiphy, chan, -+ channel_type)) { - printk(KERN_DEBUG - "cfg80211: Secondary channel not " - "allowed to initiate communication\n"); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -4684,13 +4684,41 @@ static int nl80211_join_ibss(struct sk_b - ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); - } - -- ibss.channel = ieee80211_get_channel(wiphy, -- nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); -+ if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) { -+ enum nl80211_channel_type channel_type; -+ -+ channel_type = nla_get_u32( -+ info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]); -+ if (channel_type != NL80211_CHAN_NO_HT && -+ channel_type != NL80211_CHAN_HT20 && -+ channel_type != NL80211_CHAN_HT40MINUS && -+ channel_type != NL80211_CHAN_HT40PLUS) -+ return -EINVAL; -+ -+ if (channel_type != NL80211_CHAN_NO_HT && -+ !(wiphy->features & NL80211_FEATURE_HT_IBSS)) -+ return -EINVAL; -+ -+ ibss.channel_type = channel_type; -+ } else { -+ ibss.channel_type = NL80211_CHAN_NO_HT; -+ } -+ -+ ibss.channel = rdev_freq_to_chan(rdev, -+ nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]), -+ ibss.channel_type); - if (!ibss.channel || - ibss.channel->flags & IEEE80211_CHAN_NO_IBSS || - ibss.channel->flags & IEEE80211_CHAN_DISABLED) - return -EINVAL; - -+ /* Both channels should be able to initiate communication */ -+ if ((ibss.channel_type == NL80211_CHAN_HT40PLUS || -+ ibss.channel_type == NL80211_CHAN_HT40MINUS) && -+ !cfg80211_can_beacon_sec_chan(&rdev->wiphy, ibss.channel, -+ ibss.channel_type)) -+ return -EINVAL; -+ - ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED]; - ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY]; - ---- a/include/linux/ieee80211.h -+++ b/include/linux/ieee80211.h -@@ -1695,6 +1695,23 @@ static inline bool ieee80211_is_robust_m - } - - /** -+ * ieee80211_is_public_action - check if frame is a public action frame -+ * @hdr: the frame -+ * @len: length of the frame -+ */ -+static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, -+ size_t len) -+{ -+ struct ieee80211_mgmt *mgmt = (void *)hdr; -+ -+ if (len < 25) -+ return false; -+ if (!ieee80211_is_action(hdr->frame_control)) -+ return false; -+ return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC; -+} -+ -+/** - * ieee80211_fhss_chan_to_freq - get channel frequency - * @channel: the FHSS channel - * ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1332,8 +1332,11 @@ static int invoke_tx_handlers(struct iee - if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)) - CALL_TXH(ieee80211_tx_h_rate_ctrl); - -- if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) -+ if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) { -+ __skb_queue_tail(&tx->skbs, tx->skb); -+ tx->skb = NULL; - goto txh_done; -+ } - - CALL_TXH(ieee80211_tx_h_michael_mic_add); - CALL_TXH(ieee80211_tx_h_sequence); ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -851,6 +851,7 @@ static int __must_check __sta_info_destr - struct ieee80211_sub_if_data *sdata; - unsigned long flags; - int ret, i, ac; -+ struct tid_ampdu_tx *tid_tx; - - might_sleep(); - -@@ -949,6 +950,30 @@ static int __must_check __sta_info_destr - } - #endif - -+ /* There could be some memory leaks because of ampdu tx pending queue -+ * not being freed before destroying the station info. -+ * -+ * Make sure that such queues are purged before freeing the station -+ * info. -+ * TODO: We have to somehow postpone the full destruction -+ * until the aggregation stop completes. Refer -+ * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936 -+ */ -+ for (i = 0; i < STA_TID_NUM; i++) { -+ if (!sta->ampdu_mlme.tid_tx[i]) -+ continue; -+ tid_tx = sta->ampdu_mlme.tid_tx[i]; -+ if (skb_queue_len(&tid_tx->pending)) { -+#ifdef CONFIG_MAC80211_HT_DEBUG -+ wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d " -+ "packets for tid=%d\n", -+ skb_queue_len(&tid_tx->pending), i); -+#endif /* CONFIG_MAC80211_HT_DEBUG */ -+ __skb_queue_purge(&tid_tx->pending); -+ } -+ kfree_rcu(tid_tx, rcu_head); -+ } -+ - __sta_info_free(local, sta); - - return 0; ---- a/drivers/net/wireless/ath/ath9k/calib.c -+++ b/drivers/net/wireless/ath/ath9k/calib.c -@@ -402,6 +402,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s - ah->noise = ath9k_hw_getchan_noise(ah, chan); - return true; - } -+EXPORT_SYMBOL(ath9k_hw_getnf); - - void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah, - struct ath9k_channel *chan) diff --git a/package/mac80211/patches/400-ath_move_debug_code.patch b/package/mac80211/patches/400-ath_move_debug_code.patch index c322dd3..69bb0f6 100644 --- a/package/mac80211/patches/400-ath_move_debug_code.patch +++ b/package/mac80211/patches/400-ath_move_debug_code.patch @@ -1,17 +1,18 @@ --- a/drivers/net/wireless/ath/Makefile +++ b/drivers/net/wireless/ath/Makefile -@@ -8,6 +8,5 @@ obj-$(CONFIG_ATH_COMMON) += ath.o +@@ -8,7 +8,7 @@ obj-$(CONFIG_ATH_COMMON) += ath.o ath-objs := main.o \ regd.o \ hw.o \ - key.o -- --ath-$(CONFIG_ATH_DEBUG) += debug.o + key.o \ + debug.o + +-ath-$(CONFIG_ATH_DEBUG) += debug.o + ccflags-y += -D__CHECK_ENDIAN__ --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h -@@ -272,13 +272,6 @@ void ath_dbg(struct ath_common *common, +@@ -281,13 +281,6 @@ void _ath_dbg(struct ath_common *common, #endif /* CONFIG_ATH_DEBUG */ /** Returns string describing opmode, or NULL if unknown mode. */ diff --git a/package/mac80211/patches/404-ath_regd_optional.patch b/package/mac80211/patches/404-ath_regd_optional.patch index 2cae823..bb97647 100644 --- a/package/mac80211/patches/404-ath_regd_optional.patch +++ b/package/mac80211/patches/404-ath_regd_optional.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c -@@ -194,6 +194,10 @@ ath_reg_apply_beaconing_flags(struct wip +@@ -196,6 +196,10 @@ ath_reg_apply_beaconing_flags(struct wip u32 bandwidth = 0; int r; @@ -11,7 +11,7 @@ for (band = 0; band < IEEE80211_NUM_BANDS; band++) { if (!wiphy->bands[band]) -@@ -253,6 +257,10 @@ ath_reg_apply_active_scan_flags(struct w +@@ -255,6 +259,10 @@ ath_reg_apply_active_scan_flags(struct w u32 bandwidth = 0; int r; @@ -22,7 +22,7 @@ sband = wiphy->bands[IEEE80211_BAND_2GHZ]; if (!sband) return; -@@ -302,6 +310,10 @@ static void ath_reg_apply_radar_flags(st +@@ -304,6 +312,10 @@ static void ath_reg_apply_radar_flags(st struct ieee80211_channel *ch; unsigned int i; @@ -33,7 +33,7 @@ if (!wiphy->bands[IEEE80211_BAND_5GHZ]) return; -@@ -469,6 +481,10 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -510,6 +522,10 @@ ath_regd_init_wiphy(struct ath_regulator { const struct ieee80211_regdomain *regd; diff --git a/package/mac80211/patches/405-world_regd_fixup.patch b/package/mac80211/patches/405-world_regd_fixup.patch index 48dc3fd..027b55c 100644 --- a/package/mac80211/patches/405-world_regd_fixup.patch +++ b/package/mac80211/patches/405-world_regd_fixup.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c -@@ -38,7 +38,8 @@ +@@ -40,7 +40,8 @@ static int __ath_regd_init(struct ath_re NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM) /* We allow IBSS on these on a case by case basis by regulatory domain */ @@ -10,7 +10,7 @@ NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) #define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 40, 0, 30,\ NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) -@@ -56,57 +57,56 @@ +@@ -58,57 +59,56 @@ static int __ath_regd_init(struct ath_re #define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \ ATH9K_5GHZ_5725_5850 diff --git a/package/mac80211/patches/406-regd_no_assoc_hints.patch b/package/mac80211/patches/406-regd_no_assoc_hints.patch index 8ed03c6..29da3b2 100644 --- a/package/mac80211/patches/406-regd_no_assoc_hints.patch +++ b/package/mac80211/patches/406-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -1672,6 +1672,8 @@ void regulatory_hint_11d(struct wiphy *w +@@ -1690,6 +1690,8 @@ void regulatory_hint_11d(struct wiphy *w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request; @@ -9,7 +9,7 @@ mutex_lock(®_mutex); if (unlikely(!last_request)) -@@ -1878,6 +1880,8 @@ static void restore_regulatory_settings( +@@ -1925,6 +1927,8 @@ static void restore_regulatory_settings( void regulatory_hint_disconnect(void) { diff --git a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch index 09522cd..242c40e 100644 --- a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +++ b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1458,15 +1458,6 @@ static int ath9k_add_interface(struct ie +@@ -1454,15 +1454,6 @@ static int ath9k_add_interface(struct ie } } @@ -13,10 +13,10 @@ - goto out; - } - - ath_dbg(common, ATH_DBG_CONFIG, - "Attach a VIF of type: %d\n", vif->type); + ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); -@@ -1492,15 +1483,6 @@ static int ath9k_change_interface(struct + sc->nvifs++; +@@ -1487,15 +1478,6 @@ static int ath9k_change_interface(struct mutex_lock(&sc->mutex); ath9k_ps_wakeup(sc); diff --git a/package/mac80211/patches/430-ath5k_disable_fast_cc.patch b/package/mac80211/patches/430-ath5k_disable_fast_cc.patch index 1948714..68d5db0 100644 --- a/package/mac80211/patches/430-ath5k_disable_fast_cc.patch +++ b/package/mac80211/patches/430-ath5k_disable_fast_cc.patch @@ -13,6 +13,6 @@ if (fast && (ah->ah_radio != AR5K_RF2413) && (ah->ah_radio != AR5K_RF5413)) +#endif - fast = 0; + fast = false; /* Disable sleep clock operation diff --git a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch index 91ef8c4..354598e 100644 --- a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch +++ b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch @@ -54,7 +54,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1674,6 +1721,9 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1677,6 +1724,9 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); diff --git a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch index 87e695b..82f5866 100644 --- a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch +++ b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1795,8 +1795,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -1794,8 +1794,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st REG_WRITE(ah, AR_OBS, 8); if (ah->config.rx_intr_mitigation) { diff --git a/package/mac80211/patches/511-ath9k_increase_bcbuf.patch b/package/mac80211/patches/511-ath9k_increase_bcbuf.patch index b7bc7d2..6d54d7a 100644 --- a/package/mac80211/patches/511-ath9k_increase_bcbuf.patch +++ b/package/mac80211/patches/511-ath9k_increase_bcbuf.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -366,7 +366,7 @@ struct ath_vif { +@@ -370,7 +370,7 @@ struct ath_vif { * number of beacon intervals, the game's up. */ #define BSTUCK_THRESH 9 diff --git a/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch index ae65b60..fe225cd 100644 --- a/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch +++ b/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -591,6 +591,7 @@ struct ath_softc { +@@ -595,6 +595,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; @@ -8,7 +8,7 @@ int chan_idx; int chan_is_ht; struct survey_info *cur_survey; -@@ -655,6 +656,7 @@ struct ath_softc { +@@ -659,6 +660,7 @@ struct ath_softc { u8 ant_tx, ant_rx; }; @@ -69,7 +69,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1724,6 +1768,9 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1727,6 +1771,9 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_eeprom); @@ -81,7 +81,7 @@ sc->debug.sampidx = 0; --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1564,7 +1564,7 @@ static void ath9k_disable_ps(struct ath_ +@@ -1559,7 +1559,7 @@ static void ath9k_disable_ps(struct ath_ } @@ -90,7 +90,7 @@ { struct ath_softc *sc = hw->priv; struct ath_hw *ah = sc->sc_ah; -@@ -1616,9 +1616,11 @@ static int ath9k_config(struct ieee80211 +@@ -1609,9 +1609,11 @@ static int ath9k_config(struct ieee80211 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { struct ieee80211_channel *curchan = hw->conf.channel; @@ -102,7 +102,7 @@ if (ah->curchan) old_pos = ah->curchan - &ah->channels[0]; -@@ -1667,7 +1669,23 @@ static int ath9k_config(struct ieee80211 +@@ -1659,7 +1661,23 @@ static int ath9k_config(struct ieee80211 memset(&sc->survey[pos], 0, sizeof(struct survey_info)); } @@ -129,7 +129,7 @@ return -EINVAL; --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1609,6 +1609,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -1608,6 +1608,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st caldata->rtt_hist.num_readings) allow_fbs = true; diff --git a/package/mac80211/patches/520-mac80211_ht_change_rate_update.patch b/package/mac80211/patches/520-mac80211_ht_change_rate_update.patch index 3ffa31d..341e487 100644 --- a/package/mac80211/patches/520-mac80211_ht_change_rate_update.patch +++ b/package/mac80211/patches/520-mac80211_ht_change_rate_update.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -196,7 +196,9 @@ void ieee80211_bss_info_change_notify(st +@@ -197,7 +197,9 @@ void ieee80211_bss_info_change_notify(st u32 changed) { struct ieee80211_local *local = sdata->local; @@ -10,7 +10,7 @@ if (!changed) return; -@@ -226,6 +228,22 @@ void ieee80211_bss_info_change_notify(st +@@ -219,6 +221,22 @@ void ieee80211_bss_info_change_notify(st switch (sdata->vif.type) { case NL80211_IFTYPE_AP: diff --git a/package/mac80211/patches/522-mac80211_reduce_txqueuelen.patch b/package/mac80211/patches/521-mac80211_reduce_txqueuelen.patch index 4e4dcb8..4e4dcb8 100644 --- a/package/mac80211/patches/522-mac80211_reduce_txqueuelen.patch +++ b/package/mac80211/patches/521-mac80211_reduce_txqueuelen.patch diff --git a/package/mac80211/patches/530-mac80211_cur_txpower.patch b/package/mac80211/patches/530-mac80211_cur_txpower.patch index 8ed9216..f342674 100644 --- a/package/mac80211/patches/530-mac80211_cur_txpower.patch +++ b/package/mac80211/patches/530-mac80211_cur_txpower.patch @@ -11,7 +11,7 @@ u16 listen_interval; --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1696,7 +1696,7 @@ static int ieee80211_get_tx_power(struct +@@ -1739,7 +1739,7 @@ static int ieee80211_get_tx_power(struct { struct ieee80211_local *local = wiphy_priv(wiphy); @@ -22,7 +22,7 @@ } --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -167,6 +167,7 @@ int ieee80211_hw_config(struct ieee80211 +@@ -168,6 +168,7 @@ int ieee80211_hw_config(struct ieee80211 if (local->hw.conf.power_level != power) { changed |= IEEE80211_CONF_CHANGE_POWER; diff --git a/package/mac80211/patches/531-ath9k_cur_txpower.patch b/package/mac80211/patches/531-ath9k_cur_txpower.patch index adc5292..8fdd436 100644 --- a/package/mac80211/patches/531-ath9k_cur_txpower.patch +++ b/package/mac80211/patches/531-ath9k_cur_txpower.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1691,6 +1691,8 @@ int ath9k_config(struct ieee80211_hw *hw +@@ -1683,6 +1683,8 @@ int ath9k_config(struct ieee80211_hw *hw return -EINVAL; } @@ -9,7 +9,7 @@ /* * The most recent snapshot of channel->noisefloor for the old * channel is only available after the hardware reset. Copy it to -@@ -1706,6 +1708,7 @@ int ath9k_config(struct ieee80211_hw *hw +@@ -1697,6 +1699,7 @@ int ath9k_config(struct ieee80211_hw *hw sc->config.txpowlimit = 2 * conf->power_level; ath9k_cmn_update_txpow(ah, sc->curtxpow, sc->config.txpowlimit, &sc->curtxpow); diff --git a/package/mac80211/patches/540-ath9k_limit_qlen.patch b/package/mac80211/patches/540-ath9k_limit_qlen.patch index 237966e..737591f 100644 --- a/package/mac80211/patches/540-ath9k_limit_qlen.patch +++ b/package/mac80211/patches/540-ath9k_limit_qlen.patch @@ -1,14 +1,14 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -238,6 +238,7 @@ struct ath_atx_tid { +@@ -242,6 +242,7 @@ struct ath_atx_tid { struct ath_node *an; struct ath_atx_ac *ac; unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)]; + int buf_pending; + int bar_index; u16 seq_start; u16 seq_next; - u16 baw_size; -@@ -284,6 +285,9 @@ struct ath_tx_control { +@@ -288,6 +289,9 @@ struct ath_tx_control { * (axq_qnum). */ struct ath_tx { @@ -20,7 +20,7 @@ spinlock_t txbuflock; --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1729,6 +1729,10 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1732,6 +1732,10 @@ int ath9k_init_debug(struct ath_hw *ah) sc, &fops_wiphy); debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_xmit); @@ -33,7 +33,7 @@ debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -355,6 +355,14 @@ static void ath_tx_count_frames(struct a +@@ -392,6 +392,14 @@ static void ath_tx_count_frames(struct a } } @@ -48,7 +48,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf, struct list_head *bf_q, -@@ -443,6 +451,8 @@ static void ath_tx_complete_aggr(struct +@@ -486,6 +494,8 @@ static void ath_tx_complete_aggr(struct __skb_queue_head_init(&bf_pending); ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad); @@ -57,7 +57,7 @@ while (bf) { u16 seqno = bf->bf_state.seqno; -@@ -823,6 +833,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_ +@@ -885,6 +895,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_ ath_tx_addto_baw(sc, tid, seqno); bf->bf_state.ndelim = ndelim; @@ -65,7 +65,7 @@ __skb_unlink(skb, &tid->buf_q); list_add_tail(&bf->list, bf_q); if (bf_prev) -@@ -1682,6 +1693,8 @@ static void ath_tx_send_ampdu(struct ath +@@ -1740,6 +1751,8 @@ static void ath_tx_send_ampdu(struct ath /* Add sub-frame to BAW */ ath_tx_addto_baw(sc, tid, bf->bf_state.seqno); @@ -74,7 +74,7 @@ /* Queue to h/w without aggregation */ TX_STAT_INC(txctl->txq->axq_qnum, a_queued_hw); bf->bf_lastbf = bf; -@@ -1810,23 +1823,13 @@ error: +@@ -1864,22 +1877,11 @@ error: /* FIXME: tx power */ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb, @@ -87,8 +87,7 @@ - struct ath_atx_tid *tid = NULL; struct ath_buf *bf; - u8 tidno; - - spin_lock_bh(&txctl->txq->axq_lock); +- - if ((sc->sc_flags & SC_OP_TXAGGR) && txctl->an && - ieee80211_is_data_qos(hdr->frame_control)) { - tidno = ieee80211_get_qos_ctl(hdr)[0] & @@ -100,7 +99,7 @@ if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) { /* -@@ -1861,6 +1864,7 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1911,6 +1913,7 @@ int ath_tx_start(struct ieee80211_hw *hw struct ieee80211_vif *vif = info->control.vif; struct ath_softc *sc = hw->priv; struct ath_txq *txq = txctl->txq; @@ -108,7 +107,7 @@ int padpos, padsize; int frmlen = skb->len + FCS_LEN; int q; -@@ -1903,6 +1907,24 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1953,6 +1956,24 @@ int ath_tx_start(struct ieee80211_hw *hw setup_frame_info(hw, skb, frmlen); @@ -133,12 +132,12 @@ /* * At this point, the vif, hw_key and sta pointers in the tx control * info are no longer valid (overwritten by the ath_frame_info data. -@@ -1917,7 +1939,7 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1967,7 +1988,7 @@ int ath_tx_start(struct ieee80211_hw *hw + txq->stopped = true; } - spin_unlock_bh(&txq->axq_lock); - ath_tx_start_dma(sc, skb, txctl); + ath_tx_start_dma(sc, skb, txctl, tid); - return 0; - } + + ath_txq_unlock(sc, txq); diff --git a/package/mac80211/patches/542-ath9k_ar9280_cold_reset.patch b/package/mac80211/patches/541-ath9k_ar9280_cold_reset.patch index 70889d6..70889d6 100644 --- a/package/mac80211/patches/542-ath9k_ar9280_cold_reset.patch +++ b/package/mac80211/patches/541-ath9k_ar9280_cold_reset.patch diff --git a/package/mac80211/patches/541-ath9k_sw_retry_reduce.patch b/package/mac80211/patches/541-ath9k_sw_retry_reduce.patch deleted file mode 100644 index d83b663..0000000 --- a/package/mac80211/patches/541-ath9k_sw_retry_reduce.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -264,14 +264,17 @@ static void ath_tid_drain(struct ath_sof - } - - static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, -- struct sk_buff *skb) -+ struct sk_buff *skb, int count) - { - struct ath_frame_info *fi = get_frame_info(skb); - struct ath_buf *bf = fi->bf; - struct ieee80211_hdr *hdr; -+ int prev = fi->retries; - - TX_STAT_INC(txq->axq_qnum, a_retries); -- if (fi->retries++ > 0) -+ fi->retries += count; -+ -+ if (prev > 0) - return; - - hdr = (struct ieee80211_hdr *)skb->data; -@@ -387,6 +390,7 @@ static void ath_tx_complete_aggr(struct - int nframes; - u8 tidno; - bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); -+ int i, retries; - - skb = bf->bf_mpdu; - hdr = (struct ieee80211_hdr *)skb->data; -@@ -395,6 +399,10 @@ static void ath_tx_complete_aggr(struct - - memcpy(rates, tx_info->control.rates, sizeof(rates)); - -+ retries = ts->ts_longretry + 1; -+ for (i = 0; i < ts->ts_rateindex; i++) -+ retries += rates[i].count; -+ - rcu_read_lock(); - - sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2); -@@ -481,7 +489,8 @@ static void ath_tx_complete_aggr(struct - txpending = 1; - } else if (fi->retries < ATH_MAX_SW_RETRIES) { - if (txok || !an->sleeping) -- ath_tx_set_retry(sc, txq, bf->bf_mpdu); -+ ath_tx_set_retry(sc, txq, bf->bf_mpdu, -+ retries); - - txpending = 1; - } else { ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -546,7 +546,7 @@ struct ath_ant_comb { - #define DEFAULT_CACHELINE 32 - #define ATH_REGCLASSIDS_MAX 10 - #define ATH_CABQ_READY_TIME 80 /* % of beacon interval */ --#define ATH_MAX_SW_RETRIES 10 -+#define ATH_MAX_SW_RETRIES 20 - #define ATH_CHAN_MAX 255 - - #define ATH_TXPOWER_MAX 100 /* .5 dBm units */ diff --git a/package/mac80211/patches/543-ath9k_fix_half_quarter_rx_latency.patch b/package/mac80211/patches/542-ath9k_fix_half_quarter_rx_latency.patch index 45246ea..8b1e043 100644 --- a/package/mac80211/patches/543-ath9k_fix_half_quarter_rx_latency.patch +++ b/package/mac80211/patches/542-ath9k_fix_half_quarter_rx_latency.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1006,16 +1006,26 @@ void ath9k_hw_init_global_settings(struc +@@ -1005,16 +1005,26 @@ void ath9k_hw_init_global_settings(struc if (IS_CHAN_HALF_RATE(chan)) { eifs = 175; diff --git a/package/mac80211/patches/544-ath9k_fix_half_quarter_sifs.patch b/package/mac80211/patches/543-ath9k_fix_half_quarter_sifs.patch index 6bde765..3f2b360 100644 --- a/package/mac80211/patches/544-ath9k_fix_half_quarter_sifs.patch +++ b/package/mac80211/patches/543-ath9k_fix_half_quarter_sifs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1007,31 +1007,35 @@ void ath9k_hw_init_global_settings(struc +@@ -1006,31 +1006,35 @@ void ath9k_hw_init_global_settings(struc if (IS_CHAN_HALF_RATE(chan)) { eifs = 175; diff --git a/package/mac80211/patches/550-ath9k_debug_remove_packet_rssi.patch b/package/mac80211/patches/550-ath9k_debug_remove_packet_rssi.patch index 4bd3d55..087757d 100644 --- a/package/mac80211/patches/550-ath9k_debug_remove_packet_rssi.patch +++ b/package/mac80211/patches/550-ath9k_debug_remove_packet_rssi.patch @@ -54,7 +54,7 @@ RX_SAMP_DBG(rssi_ctl0) = rs->rs_rssi_ctl0; --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -164,13 +164,6 @@ struct ath_rx_stats { +@@ -165,13 +165,6 @@ struct ath_rx_stats { u32 post_delim_crc_err; u32 decrypt_busy_err; u32 phy_err_stats[ATH9K_PHYERR_MAX]; diff --git a/package/mac80211/patches/551-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/551-ath9k_per_chain_signal_strength.patch index 4040f86..fd607dd 100644 --- a/package/mac80211/patches/551-ath9k_per_chain_signal_strength.patch +++ b/package/mac80211/patches/551-ath9k_per_chain_signal_strength.patch @@ -23,7 +23,7 @@ int antenna; --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -302,6 +302,11 @@ struct sta_info { +@@ -312,6 +312,11 @@ struct sta_info { unsigned long rx_dropped; int last_signal; struct ewma avg_signal; @@ -37,7 +37,7 @@ --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -1267,6 +1267,7 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1269,6 +1269,7 @@ ieee80211_rx_h_sta_process(struct ieee80 struct sk_buff *skb = rx->skb; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -45,7 +45,7 @@ if (!sta) return RX_CONTINUE; -@@ -1309,6 +1310,19 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1311,6 +1312,19 @@ ieee80211_rx_h_sta_process(struct ieee80 sta->last_signal = status->signal; ewma_add(&sta->avg_signal, -status->signal); @@ -67,7 +67,7 @@ * exchange sequence. --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -304,6 +304,8 @@ struct sta_info *sta_info_alloc(struct i +@@ -255,6 +255,8 @@ struct sta_info *sta_info_alloc(struct i do_posix_clock_monotonic_gettime(&uptime); sta->last_connected = uptime.tv_sec; ewma_init(&sta->avg_signal, 1024, 8); @@ -78,27 +78,27 @@ kfree(sta); --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -505,6 +505,8 @@ struct station_parameters { - * @STATION_INFO_CONNECTED_TIME: @connected_time filled +@@ -508,6 +508,8 @@ struct station_parameters { * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled * @STATION_INFO_STA_FLAGS: @sta_flags filled + * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled + * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled + * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled */ enum station_info_flags { STATION_INFO_INACTIVE_TIME = 1<<0, -@@ -525,7 +527,9 @@ enum station_info_flags { - STATION_INFO_BSS_PARAM = 1<<15, +@@ -529,7 +531,9 @@ enum station_info_flags { STATION_INFO_CONNECTED_TIME = 1<<16, STATION_INFO_ASSOC_REQ_IES = 1<<17, -- STATION_INFO_STA_FLAGS = 1<<18 -+ STATION_INFO_STA_FLAGS = 1<<18, -+ STATION_INFO_CHAIN_SIGNAL = 1<<19, -+ STATION_INFO_CHAIN_SIGNAL_AVG = 1<<20, + STATION_INFO_STA_FLAGS = 1<<18, +- STATION_INFO_BEACON_LOSS_COUNT = 1<<19 ++ STATION_INFO_BEACON_LOSS_COUNT = 1<<19, ++ STATION_INFO_CHAIN_SIGNAL = 1<<20, ++ STATION_INFO_CHAIN_SIGNAL_AVG = 1<<21, }; /** -@@ -605,6 +609,9 @@ struct sta_bss_parameters { +@@ -609,6 +613,9 @@ struct sta_bss_parameters { * @plink_state: mesh peer link state * @signal: signal strength of last received packet in dBm * @signal_avg: signal strength average in dBm @@ -108,7 +108,7 @@ * @txrate: current unicast bitrate from this station * @rxrate: current unicast bitrate to this station * @rx_packets: packets received from this station -@@ -635,6 +642,11 @@ struct station_info { +@@ -640,6 +647,11 @@ struct station_info { u8 plink_state; s8 signal; s8 signal_avg; @@ -139,7 +139,7 @@ u8 rs_num_delims; --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -980,6 +980,7 @@ static int ath9k_rx_skb_preprocess(struc +@@ -987,6 +987,7 @@ static int ath9k_rx_skb_preprocess(struc bool *decrypt_error) { struct ath_hw *ah = common->ah; @@ -147,7 +147,7 @@ memset(rx_status, 0, sizeof(struct ieee80211_rx_status)); -@@ -1005,6 +1006,20 @@ static int ath9k_rx_skb_preprocess(struc +@@ -1012,6 +1013,20 @@ static int ath9k_rx_skb_preprocess(struc rx_status->antenna = rx_stats->rs_antenna; rx_status->flag |= RX_FLAG_MACTIME_MPDU; @@ -168,7 +168,7 @@ return 0; } -@@ -1535,14 +1550,14 @@ static void ath_ant_comb_scan(struct ath +@@ -1542,14 +1557,14 @@ static void ath_ant_comb_scan(struct ath struct ath_ant_comb *antcomb = &sc->ant_comb; int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set; int curr_main_set; @@ -189,7 +189,7 @@ /* Record packet only when both main_rssi and alt_rssi is positive */ --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -@@ -484,12 +484,12 @@ int ath9k_hw_process_rxdesc_edma(struct +@@ -483,12 +483,12 @@ int ath9k_hw_process_rxdesc_edma(struct /* XXX: Keycache */ rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined); @@ -210,7 +210,7 @@ rxs->rs_keyix = MS(rxsp->status11, AR_KeyIdx); --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c -@@ -559,25 +559,25 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a +@@ -556,25 +556,25 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a if (ads.ds_rxstatus8 & AR_PostDelimCRCErr) { rs->rs_rssi = ATH9K_RSSI_BAD; @@ -271,19 +271,19 @@ RX_SAMP_DBG(rate) = rs->rs_rate; --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h -@@ -1651,6 +1651,8 @@ enum nl80211_sta_bss_param { - * containing info as possible, see &enum nl80211_sta_bss_param +@@ -1657,6 +1657,8 @@ enum nl80211_sta_bss_param { * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. + * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) + * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU + * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ -@@ -1673,6 +1675,8 @@ enum nl80211_sta_info { - NL80211_STA_INFO_BSS_PARAM, +@@ -1680,6 +1682,8 @@ enum nl80211_sta_info { NL80211_STA_INFO_CONNECTED_TIME, NL80211_STA_INFO_STA_FLAGS, + NL80211_STA_INFO_BEACON_LOSS, + NL80211_STA_INFO_CHAIN_SIGNAL, + NL80211_STA_INFO_CHAIN_SIGNAL_AVG, @@ -291,7 +291,7 @@ __NL80211_STA_INFO_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -2322,6 +2322,33 @@ nla_put_failure: +@@ -2347,6 +2347,33 @@ nla_put_failure: return false; } @@ -325,7 +325,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, int flags, struct net_device *dev, const u8 *mac_addr, struct station_info *sinfo) -@@ -2368,6 +2395,18 @@ static int nl80211_send_station(struct s +@@ -2393,6 +2420,18 @@ static int nl80211_send_station(struct s if (sinfo->filled & STATION_INFO_SIGNAL_AVG) NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG, sinfo->signal_avg); @@ -354,7 +354,7 @@ sinfo->generation = sdata->local->sta_generation; -@@ -375,6 +376,17 @@ static void sta_set_sinfo(struct sta_inf +@@ -377,6 +378,17 @@ static void sta_set_sinfo(struct sta_inf sinfo->signal = (s8)sta->last_signal; sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal); } diff --git a/package/mac80211/patches/580-ath9k_extra_leds.patch b/package/mac80211/patches/560-ath9k_extra_leds.patch index 9569b70..adf2a0e 100644 --- a/package/mac80211/patches/580-ath9k_extra_leds.patch +++ b/package/mac80211/patches/560-ath9k_extra_leds.patch @@ -171,7 +171,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -803,7 +803,7 @@ int ath9k_init_device(u16 devid, struct +@@ -817,7 +817,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CONFIG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ @@ -244,7 +244,7 @@ void ath9k_debug_samp_bb_mac(struct ath_softc *sc) { #define ATH_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].c) -@@ -1725,6 +1780,11 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1728,6 +1783,11 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("samples", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_samps); diff --git a/package/mac80211/patches/560-ath9k_rework_send_bar.patch b/package/mac80211/patches/560-ath9k_rework_send_bar.patch deleted file mode 100644 index 9176713..0000000 --- a/package/mac80211/patches/560-ath9k_rework_send_bar.patch +++ /dev/null @@ -1,240 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -159,6 +159,9 @@ void ath_descdma_cleanup(struct ath_soft - /* return block-ack bitmap index given sequence and starting sequence */ - #define ATH_BA_INDEX(_st, _seq) (((_seq) - (_st)) & (IEEE80211_SEQ_MAX - 1)) - -+/* return the seqno for _start + _offset */ -+#define ATH_BA_INDEX2SEQ(_seq, _offset) (((_seq) + (_offset)) & (IEEE80211_SEQ_MAX - 1)) -+ - /* returns delimiter padding required given the packet length */ - #define ATH_AGGR_GET_NDELIM(_len) \ - (((_len) >= ATH_AGGR_MINPLEN) ? 0 : \ -@@ -253,9 +256,9 @@ struct ath_atx_tid { - struct ath_node { - #ifdef CONFIG_ATH9K_DEBUGFS - struct list_head list; /* for sc->nodes */ -+#endif - struct ieee80211_sta *sta; /* station struct we're part of */ - struct ieee80211_vif *vif; /* interface with which we're associated */ --#endif - struct ath_atx_tid tid[WME_NUM_TID]; - struct ath_atx_ac ac[WME_NUM_AC]; - int ps_key; -@@ -277,7 +280,6 @@ struct ath_tx_control { - }; - - #define ATH_TX_ERROR 0x01 --#define ATH_TX_BAR 0x02 - - /** - * @txq_map: Index is mac80211 queue number. This is ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -644,9 +644,9 @@ static void ath_node_attach(struct ath_s - spin_lock(&sc->nodes_lock); - list_add(&an->list, &sc->nodes); - spin_unlock(&sc->nodes_lock); -+#endif - an->sta = sta; - an->vif = vif; --#endif - if (sc->sc_flags & SC_OP_TXAGGR) { - ath_tx_node_init(sc, an); - an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -53,7 +53,7 @@ static void ath_tx_complete(struct ath_s - int tx_flags, struct ath_txq *txq); - static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, - struct ath_txq *txq, struct list_head *bf_q, -- struct ath_tx_status *ts, int txok, int sendbar); -+ struct ath_tx_status *ts, int txok); - static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, - struct list_head *head, bool internal); - static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf, -@@ -150,6 +150,12 @@ static struct ath_frame_info *get_frame_ - return (struct ath_frame_info *) &tx_info->rate_driver_data[0]; - } - -+static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno) -+{ -+ ieee80211_send_bar(tid->an->vif, tid->an->sta->addr, tid->tidno, -+ seqno << IEEE80211_SEQ_SEQ_SHIFT); -+} -+ - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) - { - struct ath_txq *txq = tid->ac->txq; -@@ -158,6 +164,7 @@ static void ath_tx_flush_tid(struct ath_ - struct list_head bf_head; - struct ath_tx_status ts; - struct ath_frame_info *fi; -+ bool sendbar = false; - - INIT_LIST_HEAD(&bf_head); - -@@ -172,7 +179,8 @@ static void ath_tx_flush_tid(struct ath_ - if (bf && fi->retries) { - list_add_tail(&bf->list, &bf_head); - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); -- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1); -+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); -+ sendbar = true; - } else { - ath_tx_send_normal(sc, txq, NULL, skb); - } -@@ -185,6 +193,9 @@ static void ath_tx_flush_tid(struct ath_ - } - - spin_unlock_bh(&txq->axq_lock); -+ -+ if (sendbar) -+ ath_send_bar(tid, tid->seq_start); - } - - static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, -@@ -255,7 +266,7 @@ static void ath_tid_drain(struct ath_sof - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); - - spin_unlock(&txq->axq_lock); -- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0); -+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); - spin_lock(&txq->axq_lock); - } - -@@ -381,7 +392,7 @@ static void ath_tx_complete_aggr(struct - struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; - struct list_head bf_head; - struct sk_buff_head bf_pending; -- u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0; -+ u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0, seq_first; - u32 ba[WME_BA_BMP_SIZE >> 5]; - int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; - bool rc_update = true; -@@ -391,6 +402,7 @@ static void ath_tx_complete_aggr(struct - u8 tidno; - bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); - int i, retries; -+ int bar_index = -1; - - skb = bf->bf_mpdu; - hdr = (struct ieee80211_hdr *)skb->data; -@@ -416,8 +428,7 @@ static void ath_tx_complete_aggr(struct - if (!bf->bf_stale || bf_next != NULL) - list_move_tail(&bf->list, &bf_head); - -- ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, -- 0, 0); -+ ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0); - - bf = bf_next; - } -@@ -427,6 +438,7 @@ static void ath_tx_complete_aggr(struct - an = (struct ath_node *)sta->drv_priv; - tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK; - tid = ATH_AN_2_TID(an, tidno); -+ seq_first = tid->seq_start; - - /* - * The hardware occasionally sends a tx status for the wrong TID. -@@ -495,8 +507,9 @@ static void ath_tx_complete_aggr(struct - txpending = 1; - } else { - txfail = 1; -- sendbar = 1; - txfail_cnt++; -+ bar_index = max_t(int, bar_index, -+ ATH_BA_INDEX(seq_first, seqno)); - } - } - -@@ -525,7 +538,7 @@ static void ath_tx_complete_aggr(struct - } - - ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, -- !txfail, sendbar); -+ !txfail); - } else { - /* retry the un-acked ones */ - if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) { -@@ -545,8 +558,10 @@ static void ath_tx_complete_aggr(struct - - ath_tx_complete_buf(sc, bf, txq, - &bf_head, -- ts, 0, -- !flush); -+ ts, 0); -+ bar_index = max_t(int, bar_index, -+ ATH_BA_INDEX(seq_first, -+ seqno)); - break; - } - -@@ -564,6 +579,9 @@ static void ath_tx_complete_aggr(struct - bf = bf_next; - } - -+ if (bar_index >= 0) -+ ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1)); -+ - /* prepend un-acked frames to the beginning of the pending frame queue */ - if (!skb_queue_empty(&bf_pending)) { - if (an->sleeping) -@@ -1452,7 +1470,7 @@ static void ath_drain_txq_list(struct at - ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0, - retry_tx); - else -- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0); -+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); - spin_lock_bh(&txq->axq_lock); - } - } -@@ -1967,9 +1985,6 @@ static void ath_tx_complete(struct ath_s - - ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb); - -- if (tx_flags & ATH_TX_BAR) -- tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; -- - if (!(tx_flags & ATH_TX_ERROR)) - /* Frame was ACKed */ - tx_info->flags |= IEEE80211_TX_STAT_ACK; -@@ -2013,16 +2028,13 @@ static void ath_tx_complete(struct ath_s - - static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, - struct ath_txq *txq, struct list_head *bf_q, -- struct ath_tx_status *ts, int txok, int sendbar) -+ struct ath_tx_status *ts, int txok) - { - struct sk_buff *skb = bf->bf_mpdu; - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - unsigned long flags; - int tx_flags = 0; - -- if (sendbar) -- tx_flags = ATH_TX_BAR; -- - if (!txok) - tx_flags |= ATH_TX_ERROR; - -@@ -2129,7 +2141,7 @@ static void ath_tx_process_buffer(struct - - if (!bf_isampdu(bf)) { - ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); -- ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0); -+ ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); - } else - ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true); - ---- a/drivers/net/wireless/ath/ath9k/debug.c -+++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -856,7 +856,7 @@ void ath_debug_stat_tx(struct ath_softc - sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len; - - if (bf_isampdu(bf)) { -- if (flags & ATH_TX_BAR) -+ if (flags & ATH_TX_ERROR) - TX_STAT_INC(qnum, a_xretries); - else - TX_STAT_INC(qnum, a_completed); diff --git a/package/mac80211/patches/581-ath9k_extra_platform_leds.patch b/package/mac80211/patches/561-ath9k_extra_platform_leds.patch index 3834d43..3834d43 100644 --- a/package/mac80211/patches/581-ath9k_extra_platform_leds.patch +++ b/package/mac80211/patches/561-ath9k_extra_platform_leds.patch diff --git a/package/mac80211/patches/561-ath9k_reduce_indentation.patch b/package/mac80211/patches/561-ath9k_reduce_indentation.patch deleted file mode 100644 index 08ff157..0000000 --- a/package/mac80211/patches/561-ath9k_reduce_indentation.patch +++ /dev/null @@ -1,159 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -490,27 +490,25 @@ static void ath_tx_complete_aggr(struct - } else if (!isaggr && txok) { - /* transmit completion */ - acked_cnt++; -+ } else if ((tid->state & AGGR_CLEANUP) || !retry) { -+ /* -+ * cleanup in progress, just fail -+ * the un-acked sub-frames -+ */ -+ txfail = 1; -+ } else if (flush) { -+ txpending = 1; -+ } else if (fi->retries < ATH_MAX_SW_RETRIES) { -+ if (txok || !an->sleeping) -+ ath_tx_set_retry(sc, txq, bf->bf_mpdu, -+ retries); -+ -+ txpending = 1; - } else { -- if ((tid->state & AGGR_CLEANUP) || !retry) { -- /* -- * cleanup in progress, just fail -- * the un-acked sub-frames -- */ -- txfail = 1; -- } else if (flush) { -- txpending = 1; -- } else if (fi->retries < ATH_MAX_SW_RETRIES) { -- if (txok || !an->sleeping) -- ath_tx_set_retry(sc, txq, bf->bf_mpdu, -- retries); -- -- txpending = 1; -- } else { -- txfail = 1; -- txfail_cnt++; -- bar_index = max_t(int, bar_index, -- ATH_BA_INDEX(seq_first, seqno)); -- } -+ txfail = 1; -+ txfail_cnt++; -+ bar_index = max_t(int, bar_index, -+ ATH_BA_INDEX(seq_first, seqno)); - } - - /* -@@ -541,32 +539,29 @@ static void ath_tx_complete_aggr(struct - !txfail); - } else { - /* retry the un-acked ones */ -- if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) { -- if (bf->bf_next == NULL && bf_last->bf_stale) { -- struct ath_buf *tbf; -- -- tbf = ath_clone_txbuf(sc, bf_last); -- /* -- * Update tx baw and complete the -- * frame with failed status if we -- * run out of tx buf. -- */ -- if (!tbf) { -- spin_lock_bh(&txq->axq_lock); -- ath_tx_update_baw(sc, tid, seqno); -- spin_unlock_bh(&txq->axq_lock); -- -- ath_tx_complete_buf(sc, bf, txq, -- &bf_head, -- ts, 0); -- bar_index = max_t(int, bar_index, -- ATH_BA_INDEX(seq_first, -- seqno)); -- break; -- } -+ if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) && -+ bf->bf_next == NULL && bf_last->bf_stale) { -+ struct ath_buf *tbf; - -- fi->bf = tbf; -+ tbf = ath_clone_txbuf(sc, bf_last); -+ /* -+ * Update tx baw and complete the -+ * frame with failed status if we -+ * run out of tx buf. -+ */ -+ if (!tbf) { -+ spin_lock_bh(&txq->axq_lock); -+ ath_tx_update_baw(sc, tid, seqno); -+ spin_unlock_bh(&txq->axq_lock); -+ -+ ath_tx_complete_buf(sc, bf, txq, -+ &bf_head, ts, 0); -+ bar_index = max_t(int, bar_index, -+ ATH_BA_INDEX(seq_first, seqno)); -+ break; - } -+ -+ fi->bf = tbf; - } - - /* -@@ -654,24 +649,26 @@ static u32 ath_lookup_rate(struct ath_so - max_4ms_framelen = ATH_AMPDU_LIMIT_MAX; - - for (i = 0; i < 4; i++) { -- if (rates[i].count) { -- int modeidx; -- if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) { -- legacy = 1; -- break; -- } -- -- if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) -- modeidx = MCS_HT40; -- else -- modeidx = MCS_HT20; -+ int modeidx; - -- if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) -- modeidx++; -+ if (!rates[i].count) -+ continue; - -- frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; -- max_4ms_framelen = min(max_4ms_framelen, frmlen); -+ if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) { -+ legacy = 1; -+ break; - } -+ -+ if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) -+ modeidx = MCS_HT40; -+ else -+ modeidx = MCS_HT20; -+ -+ if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) -+ modeidx++; -+ -+ frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; -+ max_4ms_framelen = min(max_4ms_framelen, frmlen); - } - - /* -@@ -1598,11 +1595,9 @@ void ath_txq_schedule(struct ath_softc * - break; - } - -- if (!list_empty(&ac->tid_q)) { -- if (!ac->sched) { -- ac->sched = true; -- list_add_tail(&ac->list, &txq->axq_acq); -- } -+ if (!list_empty(&ac->tid_q) && !ac->sched) { -+ ac->sched = true; -+ list_add_tail(&ac->list, &txq->axq_acq); - } - - if (ac == last_ac || diff --git a/package/mac80211/patches/562-ath9k_remove_seq_incr.patch b/package/mac80211/patches/562-ath9k_remove_seq_incr.patch deleted file mode 100644 index a89d0a5..0000000 --- a/package/mac80211/patches/562-ath9k_remove_seq_incr.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1742,10 +1742,6 @@ static void ath_tx_send_normal(struct at - list_add_tail(&bf->list, &bf_head); - bf->bf_state.bf_type = 0; - -- /* update starting sequence number for subsequent ADDBA request */ -- if (tid) -- INCR(tid->seq_start, IEEE80211_SEQ_MAX); -- - bf->bf_lastbf = bf; - ath_tx_fill_desc(sc, bf, txq, fi->framelen); - ath_tx_txqaddbuf(sc, txq, &bf_head, false); diff --git a/package/mac80211/patches/563-ath9k_simplify_tx_locking.patch b/package/mac80211/patches/563-ath9k_simplify_tx_locking.patch deleted file mode 100644 index 93aa33d..0000000 --- a/package/mac80211/patches/563-ath9k_simplify_tx_locking.patch +++ /dev/null @@ -1,214 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -169,13 +169,11 @@ static void ath_tx_flush_tid(struct ath_ - INIT_LIST_HEAD(&bf_head); - - memset(&ts, 0, sizeof(ts)); -- spin_lock_bh(&txq->axq_lock); - - while ((skb = __skb_dequeue(&tid->buf_q))) { - fi = get_frame_info(skb); - bf = fi->bf; - -- spin_unlock_bh(&txq->axq_lock); - if (bf && fi->retries) { - list_add_tail(&bf->list, &bf_head); - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); -@@ -184,7 +182,6 @@ static void ath_tx_flush_tid(struct ath_ - } else { - ath_tx_send_normal(sc, txq, NULL, skb); - } -- spin_lock_bh(&txq->axq_lock); - } - - if (tid->baw_head == tid->baw_tail) { -@@ -192,8 +189,6 @@ static void ath_tx_flush_tid(struct ath_ - tid->state &= ~AGGR_CLEANUP; - } - -- spin_unlock_bh(&txq->axq_lock); -- - if (sendbar) - ath_send_bar(tid, tid->seq_start); - } -@@ -254,9 +249,7 @@ static void ath_tid_drain(struct ath_sof - bf = fi->bf; - - if (!bf) { -- spin_unlock(&txq->axq_lock); - ath_tx_complete(sc, skb, ATH_TX_ERROR, txq); -- spin_lock(&txq->axq_lock); - continue; - } - -@@ -265,9 +258,7 @@ static void ath_tid_drain(struct ath_sof - if (fi->retries) - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); - -- spin_unlock(&txq->axq_lock); - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); -- spin_lock(&txq->axq_lock); - } - - tid->seq_next = tid->seq_start; -@@ -525,9 +516,7 @@ static void ath_tx_complete_aggr(struct - * complete the acked-ones/xretried ones; update - * block-ack window - */ -- spin_lock_bh(&txq->axq_lock); - ath_tx_update_baw(sc, tid, seqno); -- spin_unlock_bh(&txq->axq_lock); - - if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { - memcpy(tx_info->control.rates, rates, sizeof(rates)); -@@ -550,9 +539,7 @@ static void ath_tx_complete_aggr(struct - * run out of tx buf. - */ - if (!tbf) { -- spin_lock_bh(&txq->axq_lock); - ath_tx_update_baw(sc, tid, seqno); -- spin_unlock_bh(&txq->axq_lock); - - ath_tx_complete_buf(sc, bf, txq, - &bf_head, ts, 0); -@@ -582,7 +569,6 @@ static void ath_tx_complete_aggr(struct - if (an->sleeping) - ieee80211_sta_set_buffered(sta, tid->tidno, true); - -- spin_lock_bh(&txq->axq_lock); - skb_queue_splice(&bf_pending, &tid->buf_q); - if (!an->sleeping) { - ath_tx_queue_tid(txq, tid); -@@ -590,7 +576,6 @@ static void ath_tx_complete_aggr(struct - if (ts->ts_status & ATH9K_TXERR_FILT) - tid->ac->clear_ps_filter = true; - } -- spin_unlock_bh(&txq->axq_lock); - } - - if (tid->state & AGGR_CLEANUP) -@@ -1190,9 +1175,9 @@ void ath_tx_aggr_stop(struct ath_softc * - txtid->state |= AGGR_CLEANUP; - else - txtid->state &= ~AGGR_ADDBA_COMPLETE; -- spin_unlock_bh(&txq->axq_lock); - - ath_tx_flush_tid(sc, txtid); -+ spin_unlock_bh(&txq->axq_lock); - } - - void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, -@@ -1434,8 +1419,6 @@ static bool bf_is_ampdu_not_probing(stru - - static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq, - struct list_head *list, bool retry_tx) -- __releases(txq->axq_lock) -- __acquires(txq->axq_lock) - { - struct ath_buf *bf, *lastbf; - struct list_head bf_head; -@@ -1462,13 +1445,11 @@ static void ath_drain_txq_list(struct at - if (bf_is_ampdu_not_probing(bf)) - txq->axq_ampdu_depth--; - -- spin_unlock_bh(&txq->axq_lock); - if (bf_isampdu(bf)) - ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0, - retry_tx); - else - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); -- spin_lock_bh(&txq->axq_lock); - } - } - -@@ -1847,8 +1828,6 @@ static void ath_tx_start_dma(struct ath_ - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - struct ath_buf *bf; - -- spin_lock_bh(&txctl->txq->axq_lock); -- - if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) { - /* - * Try aggregation if it's a unicast data frame -@@ -1858,7 +1837,7 @@ static void ath_tx_start_dma(struct ath_ - } else { - bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); - if (!bf) -- goto out; -+ return; - - bf->bf_state.bfs_paprd = txctl->paprd; - -@@ -1867,9 +1846,6 @@ static void ath_tx_start_dma(struct ath_ - - ath_tx_send_normal(sc, txctl->txq, tid, skb); - } -- --out: -- spin_unlock_bh(&txctl->txq->axq_lock); - } - - /* Upon failure caller should free skb */ -@@ -1949,15 +1925,19 @@ int ath_tx_start(struct ieee80211_hw *hw - */ - - q = skb_get_queue_mapping(skb); -+ - spin_lock_bh(&txq->axq_lock); -+ - if (txq == sc->tx.txq_map[q] && - ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) { - ieee80211_stop_queue(sc->hw, q); - txq->stopped = 1; - } -- spin_unlock_bh(&txq->axq_lock); - - ath_tx_start_dma(sc, skb, txctl, tid); -+ -+ spin_unlock_bh(&txq->axq_lock); -+ - return 0; - } - -@@ -2003,7 +1983,6 @@ static void ath_tx_complete(struct ath_s - - q = skb_get_queue_mapping(skb); - if (txq == sc->tx.txq_map[q]) { -- spin_lock_bh(&txq->axq_lock); - if (WARN_ON(--txq->pending_frames < 0)) - txq->pending_frames = 0; - -@@ -2011,7 +1990,6 @@ static void ath_tx_complete(struct ath_s - ieee80211_wake_queue(sc->hw, q); - txq->stopped = 0; - } -- spin_unlock_bh(&txq->axq_lock); - } - - ieee80211_tx_status(hw, skb); -@@ -2117,8 +2095,6 @@ static void ath_tx_rc_status(struct ath_ - static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, - struct ath_tx_status *ts, struct ath_buf *bf, - struct list_head *bf_head) -- __releases(txq->axq_lock) -- __acquires(txq->axq_lock) - { - int txok; - -@@ -2128,16 +2104,12 @@ static void ath_tx_process_buffer(struct - if (bf_is_ampdu_not_probing(bf)) - txq->axq_ampdu_depth--; - -- spin_unlock_bh(&txq->axq_lock); -- - if (!bf_isampdu(bf)) { - ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); - ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); - } else - ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true); - -- spin_lock_bh(&txq->axq_lock); -- - if (sc->sc_flags & SC_OP_TXAGGR) - ath_txq_schedule(sc, txq); - } diff --git a/package/mac80211/patches/564-ath9k_track_last_bar.patch b/package/mac80211/patches/564-ath9k_track_last_bar.patch deleted file mode 100644 index 34a4dd1..0000000 --- a/package/mac80211/patches/564-ath9k_track_last_bar.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -242,6 +242,7 @@ struct ath_atx_tid { - struct ath_atx_ac *ac; - unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)]; - int buf_pending; -+ int bar_index; - u16 seq_start; - u16 seq_next; - u16 baw_size; ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -206,6 +206,8 @@ static void ath_tx_update_baw(struct ath - while (tid->baw_head != tid->baw_tail && !test_bit(tid->baw_head, tid->tx_buf)) { - INCR(tid->seq_start, IEEE80211_SEQ_MAX); - INCR(tid->baw_head, ATH_TID_MAX_BUFS); -+ if (tid->bar_index >= 0) -+ tid->bar_index--; - } - } - -@@ -263,6 +265,7 @@ static void ath_tid_drain(struct ath_sof - - tid->seq_next = tid->seq_start; - tid->baw_tail = tid->baw_head; -+ tid->bar_index = -1; - } - - static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, -@@ -561,8 +564,12 @@ static void ath_tx_complete_aggr(struct - bf = bf_next; - } - -- if (bar_index >= 0) -+ if (bar_index >= 0) { -+ u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index); - ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1)); -+ if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq)) -+ tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq); -+ } - - /* prepend un-acked frames to the beginning of the pending frame queue */ - if (!skb_queue_empty(&bf_pending)) { -@@ -789,8 +796,6 @@ static enum ATH_AGGR_STATUS ath_tx_form_ - - bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR; - seqno = bf->bf_state.seqno; -- if (!bf_first) -- bf_first = bf; - - /* do not step over block-ack window */ - if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) { -@@ -798,6 +803,21 @@ static enum ATH_AGGR_STATUS ath_tx_form_ - break; - } - -+ if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno)) { -+ struct ath_tx_status ts = {}; -+ struct list_head bf_head; -+ -+ INIT_LIST_HEAD(&bf_head); -+ list_add(&bf->list, &bf_head); -+ __skb_unlink(skb, &tid->buf_q); -+ ath_tx_update_baw(sc, tid, seqno); -+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); -+ continue; -+ } -+ -+ if (!bf_first) -+ bf_first = bf; -+ - if (!rl) { - aggr_limit = ath_lookup_rate(sc, bf, tid); - rl = 1; -@@ -1141,6 +1161,7 @@ int ath_tx_aggr_start(struct ath_softc * - txtid->state |= AGGR_ADDBA_PROGRESS; - txtid->paused = true; - *ssn = txtid->seq_start = txtid->seq_next; -+ txtid->bar_index = -1; - - memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); - txtid->baw_head = txtid->baw_tail = 0; diff --git a/package/mac80211/patches/565-ath9k_fix_lockup.patch b/package/mac80211/patches/565-ath9k_fix_lockup.patch deleted file mode 100644 index 6bc9171..0000000 --- a/package/mac80211/patches/565-ath9k_fix_lockup.patch +++ /dev/null @@ -1,299 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -104,6 +104,29 @@ static int ath_max_4ms_framelen[4][32] = - /* Aggregation logic */ - /*********************/ - -+static void ath_txq_lock(struct ath_softc *sc, struct ath_txq *txq) -+{ -+ spin_lock_bh(&txq->axq_lock); -+} -+ -+static void ath_txq_unlock(struct ath_softc *sc, struct ath_txq *txq) -+{ -+ spin_unlock_bh(&txq->axq_lock); -+} -+ -+static void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq) -+{ -+ struct sk_buff_head q; -+ struct sk_buff *skb; -+ -+ __skb_queue_head_init(&q); -+ skb_queue_splice_init(&txq->complete_q, &q); -+ spin_unlock_bh(&txq->axq_lock); -+ -+ while ((skb = __skb_dequeue(&q))) -+ ieee80211_tx_status(sc->hw, skb); -+} -+ - static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid) - { - struct ath_atx_ac *ac = tid->ac; -@@ -130,7 +153,7 @@ static void ath_tx_resume_tid(struct ath - - WARN_ON(!tid->paused); - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - tid->paused = false; - - if (skb_queue_empty(&tid->buf_q)) -@@ -139,7 +162,7 @@ static void ath_tx_resume_tid(struct ath - ath_tx_queue_tid(txq, tid); - ath_txq_schedule(sc, txq); - unlock: -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - - static struct ath_frame_info *get_frame_info(struct sk_buff *skb) -@@ -189,8 +212,11 @@ static void ath_tx_flush_tid(struct ath_ - tid->state &= ~AGGR_CLEANUP; - } - -- if (sendbar) -+ if (sendbar) { -+ ath_txq_unlock(sc, txq); - ath_send_bar(tid, tid->seq_start); -+ ath_txq_lock(sc, txq); -+ } - } - - static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, -@@ -564,13 +590,6 @@ static void ath_tx_complete_aggr(struct - bf = bf_next; - } - -- if (bar_index >= 0) { -- u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index); -- ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1)); -- if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq)) -- tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq); -- } -- - /* prepend un-acked frames to the beginning of the pending frame queue */ - if (!skb_queue_empty(&bf_pending)) { - if (an->sleeping) -@@ -585,6 +604,17 @@ static void ath_tx_complete_aggr(struct - } - } - -+ if (bar_index >= 0) { -+ u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index); -+ -+ if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq)) -+ tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq); -+ -+ ath_txq_unlock(sc, txq); -+ ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1)); -+ ath_txq_lock(sc, txq); -+ } -+ - if (tid->state & AGGR_CLEANUP) - ath_tx_flush_tid(sc, tid); - -@@ -1183,7 +1213,7 @@ void ath_tx_aggr_stop(struct ath_softc * - return; - } - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - txtid->paused = true; - - /* -@@ -1198,7 +1228,7 @@ void ath_tx_aggr_stop(struct ath_softc * - txtid->state &= ~AGGR_ADDBA_COMPLETE; - - ath_tx_flush_tid(sc, txtid); -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - - void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, -@@ -1219,7 +1249,7 @@ void ath_tx_aggr_sleep(struct ieee80211_ - ac = tid->ac; - txq = ac->txq; - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - - buffered = !skb_queue_empty(&tid->buf_q); - -@@ -1231,7 +1261,7 @@ void ath_tx_aggr_sleep(struct ieee80211_ - list_del(&ac->list); - } - -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock(sc, txq); - - ieee80211_sta_set_buffered(sta, tidno, buffered); - } -@@ -1250,7 +1280,7 @@ void ath_tx_aggr_wakeup(struct ath_softc - ac = tid->ac; - txq = ac->txq; - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - ac->clear_ps_filter = true; - - if (!skb_queue_empty(&tid->buf_q) && !tid->paused) { -@@ -1258,7 +1288,7 @@ void ath_tx_aggr_wakeup(struct ath_softc - ath_txq_schedule(sc, txq); - } - -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - } - -@@ -1358,6 +1388,7 @@ struct ath_txq *ath_txq_setup(struct ath - txq->axq_qnum = axq_qnum; - txq->mac80211_qnum = -1; - txq->axq_link = NULL; -+ __skb_queue_head_init(&txq->complete_q); - INIT_LIST_HEAD(&txq->axq_q); - INIT_LIST_HEAD(&txq->axq_acq); - spin_lock_init(&txq->axq_lock); -@@ -1482,7 +1513,8 @@ static void ath_drain_txq_list(struct at - */ - void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx) - { -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); -+ - if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { - int idx = txq->txq_tailidx; - -@@ -1503,7 +1535,7 @@ void ath_draintxq(struct ath_softc *sc, - if ((sc->sc_flags & SC_OP_TXAGGR) && !retry_tx) - ath_txq_drain_pending_buffers(sc, txq); - -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - - bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) -@@ -1947,7 +1979,7 @@ int ath_tx_start(struct ieee80211_hw *hw - - q = skb_get_queue_mapping(skb); - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - - if (txq == sc->tx.txq_map[q] && - ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) { -@@ -1957,7 +1989,7 @@ int ath_tx_start(struct ieee80211_hw *hw - - ath_tx_start_dma(sc, skb, txctl, tid); - -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock(sc, txq); - - return 0; - } -@@ -1969,7 +2001,6 @@ int ath_tx_start(struct ieee80211_hw *hw - static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, - int tx_flags, struct ath_txq *txq) - { -- struct ieee80211_hw *hw = sc->hw; - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); - struct ath_common *common = ath9k_hw_common(sc->sc_ah); - struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; -@@ -2013,7 +2044,7 @@ static void ath_tx_complete(struct ath_s - } - } - -- ieee80211_tx_status(hw, skb); -+ __skb_queue_tail(&txq->complete_q, skb); - } - - static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, -@@ -2149,7 +2180,7 @@ static void ath_tx_processq(struct ath_s - txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), - txq->axq_link); - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - for (;;) { - if (work_pending(&sc->hw_reset_work)) - break; -@@ -2208,7 +2239,7 @@ static void ath_tx_processq(struct ath_s - - ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); - } -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - - static void ath_tx_complete_poll_work(struct work_struct *work) -@@ -2225,17 +2256,17 @@ static void ath_tx_complete_poll_work(st - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) - if (ATH_TXQ_SETUP(sc, i)) { - txq = &sc->tx.txq[i]; -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - if (txq->axq_depth) { - if (txq->axq_tx_inprogress) { - needreset = true; -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock(sc, txq); - break; - } else { - txq->axq_tx_inprogress = true; - } - } -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - - if (needreset) { -@@ -2293,10 +2324,10 @@ void ath_tx_edma_tasklet(struct ath_soft - - txq = &sc->tx.txq[ts.qid]; - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - - if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) { -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock(sc, txq); - return; - } - -@@ -2322,7 +2353,7 @@ void ath_tx_edma_tasklet(struct ath_soft - } - - ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock_complete(sc, txq); - } - } - -@@ -2460,7 +2491,7 @@ void ath_tx_node_cleanup(struct ath_soft - ac = tid->ac; - txq = ac->txq; - -- spin_lock_bh(&txq->axq_lock); -+ ath_txq_lock(sc, txq); - - if (tid->sched) { - list_del(&tid->list); -@@ -2476,6 +2507,6 @@ void ath_tx_node_cleanup(struct ath_soft - tid->state &= ~AGGR_ADDBA_COMPLETE; - tid->state &= ~AGGR_CLEANUP; - -- spin_unlock_bh(&txq->axq_lock); -+ ath_txq_unlock(sc, txq); - } - } ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -196,6 +196,7 @@ struct ath_txq { - u8 txq_headidx; - u8 txq_tailidx; - int pending_frames; -+ struct sk_buff_head complete_q; - }; - - struct ath_atx_ac { diff --git a/package/mac80211/patches/566-ath9k_fix_keymiss.patch b/package/mac80211/patches/566-ath9k_fix_keymiss.patch deleted file mode 100644 index d939e59..0000000 --- a/package/mac80211/patches/566-ath9k_fix_keymiss.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -@@ -558,10 +558,11 @@ int ath9k_hw_process_rxdesc_edma(struct - rxs->rs_status |= ATH9K_RXERR_DECRYPT; - else if (rxsp->status11 & AR_MichaelErr) - rxs->rs_status |= ATH9K_RXERR_MIC; -- if (rxsp->status11 & AR_KeyMiss) -- rxs->rs_status |= ATH9K_RXERR_KEYMISS; - } - -+ if (rxsp->status11 & AR_KeyMiss) -+ rxs->rs_status |= ATH9K_RXERR_KEYMISS; -+ - return 0; - } - EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); ---- a/drivers/net/wireless/ath/ath9k/mac.c -+++ b/drivers/net/wireless/ath/ath9k/mac.c -@@ -621,10 +621,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a - rs->rs_status |= ATH9K_RXERR_DECRYPT; - else if (ads.ds_rxstatus8 & AR_MichaelErr) - rs->rs_status |= ATH9K_RXERR_MIC; -- if (ads.ds_rxstatus8 & AR_KeyMiss) -- rs->rs_status |= ATH9K_RXERR_KEYMISS; - } - -+ if (ads.ds_rxstatus8 & AR_KeyMiss) -+ rs->rs_status |= ATH9K_RXERR_KEYMISS; -+ - return 0; - } - EXPORT_SYMBOL(ath9k_hw_rxprocdesc); diff --git a/package/mac80211/patches/568-ath9k_fix_wep.patch b/package/mac80211/patches/568-ath9k_fix_wep.patch deleted file mode 100644 index f18553f..0000000 --- a/package/mac80211/patches/568-ath9k_fix_wep.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/recv.c -+++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -823,6 +823,14 @@ static bool ath9k_rx_accept(struct ath_c - (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC | - ATH9K_RXERR_KEYMISS)); - -+ /* -+ * Key miss events are only relevant for pairwise keys where the -+ * descriptor does contain a valid key index. This has been observed -+ * mostly with CCMP encryption. -+ */ -+ if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) -+ rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; -+ - if (!rx_stats->rs_datalen) - return false; - /* diff --git a/package/mac80211/patches/569-ath9k_fix_cts.patch b/package/mac80211/patches/569-ath9k_fix_cts.patch deleted file mode 100644 index fefa065..0000000 --- a/package/mac80211/patches/569-ath9k_fix_cts.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1061,13 +1061,16 @@ void ath9k_hw_init_global_settings(struc - - /* - * Workaround for early ACK timeouts, add an offset to match the -- * initval's 64us ack timeout value. -+ * initval's 64us ack timeout value. Use 48us for the CTS timeout. - * This was initially only meant to work around an issue with delayed - * BA frames in some implementations, but it has been found to fix ACK - * timeout issues in other cases as well. - */ -- if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) -+ if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) { - acktimeout += 64 - sifstime - ah->slottime; -+ ctstimeout += 48 - sifstime - ah->slottime; -+ } -+ - - ath9k_hw_set_sifs_time(ah, sifstime); - ath9k_hw_setslottime(ah, slottime); diff --git a/package/mac80211/patches/567-ath9k_fix_initvals.patch b/package/mac80211/patches/570-ath9k_fix_initvals.patch index 664fa1e..664fa1e 100644 --- a/package/mac80211/patches/567-ath9k_fix_initvals.patch +++ b/package/mac80211/patches/570-ath9k_fix_initvals.patch diff --git a/package/mac80211/patches/570-ath9k_mci_static.patch b/package/mac80211/patches/570-ath9k_mci_static.patch deleted file mode 100644 index 9a337c0..0000000 --- a/package/mac80211/patches/570-ath9k_mci_static.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/mci.c -+++ b/drivers/net/wireless/ath/ath9k/mci.c -@@ -234,8 +234,8 @@ static void ath_mci_cal_msg(struct ath_s - } - } - --void ath_mci_process_profile(struct ath_softc *sc, -- struct ath_mci_profile_info *info) -+static void ath_mci_process_profile(struct ath_softc *sc, -+ struct ath_mci_profile_info *info) - { - struct ath_common *common = ath9k_hw_common(sc->sc_ah); - struct ath_btcoex *btcoex = &sc->btcoex; -@@ -261,8 +261,8 @@ void ath_mci_process_profile(struct ath_ - ath_mci_update_scheme(sc); - } - --void ath_mci_process_status(struct ath_softc *sc, -- struct ath_mci_profile_status *status) -+static void ath_mci_process_status(struct ath_softc *sc, -+ struct ath_mci_profile_status *status) - { - struct ath_common *common = ath9k_hw_common(sc->sc_ah); - struct ath_btcoex *btcoex = &sc->btcoex; ---- a/drivers/net/wireless/ath/ath9k/mci.h -+++ b/drivers/net/wireless/ath/ath9k/mci.h -@@ -128,10 +128,6 @@ struct ath_mci_coex { - }; - - void ath_mci_flush_profile(struct ath_mci_profile *mci); --void ath_mci_process_profile(struct ath_softc *sc, -- struct ath_mci_profile_info *info); --void ath_mci_process_status(struct ath_softc *sc, -- struct ath_mci_profile_status *status); - int ath_mci_setup(struct ath_softc *sc); - void ath_mci_cleanup(struct ath_softc *sc); - void ath_mci_intr(struct ath_softc *sc); diff --git a/package/mac80211/patches/571-ath9k_btcoex_optional.patch b/package/mac80211/patches/571-ath9k_btcoex_optional.patch deleted file mode 100644 index 046a357..0000000 --- a/package/mac80211/patches/571-ath9k_btcoex_optional.patch +++ /dev/null @@ -1,544 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/Kconfig -+++ b/drivers/net/wireless/ath/ath9k/Kconfig -@@ -59,6 +59,14 @@ config ATH9K_RATE_CONTROL - Say Y, if you want to use the ath9k specific rate control - module instead of minstrel_ht. - -+config ATH9K_BTCOEX_SUPPORT -+ bool "Atheros ath9k bluetooth coexistence support" -+ depends on ATH9K -+ default y -+ ---help--- -+ Say Y, if you want to use the ath9k radios together with -+ Bluetooth modules in the same system. -+ - config ATH9K_HTC - tristate "Atheros HTC based wireless cards support" - depends on USB && MAC80211 ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -210,7 +210,11 @@ enum ath9k_hw_caps { - ATH9K_HW_CAP_5GHZ = BIT(14), - ATH9K_HW_CAP_APM = BIT(15), - ATH9K_HW_CAP_RTT = BIT(16), -+#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT - ATH9K_HW_CAP_MCI = BIT(17), -+#else -+ ATH9K_HW_CAP_MCI = 0, -+#endif - }; - - struct ath9k_hw_capabilities { -@@ -1229,6 +1233,16 @@ void ar9003_mci_sync_bt_state(struct ath - void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, - u32 *rx_msg_intr); - -+#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT -+static inline enum ath_btcoex_scheme -+ath9k_hw_get_btcoex_scheme(struct ath_hw *ah) -+{ -+ return ah->btcoex_hw.scheme; -+} -+#else -+#define ath9k_hw_get_btcoex_scheme(...) ATH_BTCOEX_CFG_NONE -+#endif -+ - #define ATH9K_CLOCK_RATE_CCK 22 - #define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 - #define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -411,7 +411,7 @@ static int ath9k_init_btcoex(struct ath_ - struct ath_hw *ah = sc->sc_ah; - int r; - -- switch (sc->sc_ah->btcoex_hw.scheme) { -+ switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) { - case ATH_BTCOEX_CFG_NONE: - break; - case ATH_BTCOEX_CFG_2WIRE: -@@ -866,10 +866,10 @@ static void ath9k_deinit_softc(struct at - kfree(sc->sbands[IEEE80211_BAND_5GHZ].channels); - - if ((sc->btcoex.no_stomp_timer) && -- sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) -+ ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE) - ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer); - -- if (sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_MCI) -+ if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI) - ath_mci_cleanup(sc); - - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) ---- a/drivers/net/wireless/ath/ath9k/pci.c -+++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -121,7 +121,7 @@ static void ath_pci_aspm_init(struct ath - if (!parent) - return; - -- if (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) { -+ if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { - /* Bluetooth coexistance requires disabling ASPM. */ - pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &aspm); - aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); ---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c -@@ -610,7 +610,7 @@ static void ath9k_init_btcoex(struct ath - { - int qnum; - -- switch (priv->ah->btcoex_hw.scheme) { -+ switch (ath9k_hw_get_btcoex_scheme(priv->ah)) { - case ATH_BTCOEX_CFG_NONE: - break; - case ATH_BTCOEX_CFG_3WIRE: -@@ -704,7 +704,8 @@ static int ath9k_init_priv(struct ath9k_ - - if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { - ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; -- ath9k_init_btcoex(priv); -+ if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) -+ ath9k_init_btcoex(priv); - } - - return 0; ---- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c -@@ -958,7 +958,7 @@ static int ath9k_htc_start(struct ieee80 - mod_timer(&priv->tx.cleanup_timer, - jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL)); - -- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) { -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) { - ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, - AR_STOMP_LOW_WLAN_WGHT); - ath9k_hw_btcoex_enable(ah); -@@ -1010,7 +1010,8 @@ static void ath9k_htc_stop(struct ieee80 - - mutex_lock(&priv->mutex); - -- if (ah->btcoex_hw.enabled) { -+ if (ah->btcoex_hw.enabled && -+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { - ath9k_hw_btcoex_disable(ah); - if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) - ath_htc_cancel_btcoex_work(priv); ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -742,11 +742,11 @@ void ath9k_tasklet(unsigned long data) - ath_tx_tasklet(sc); - } - -- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) - if (status & ATH9K_INT_GENTIMER) - ath_gen_timer_isr(sc->sc_ah); - -- if (status & ATH9K_INT_MCI) -+ if ((status & ATH9K_INT_MCI) && ATH9K_HW_CAP_MCI) - ath_mci_intr(sc); - - out: -@@ -1083,14 +1083,14 @@ static int ath9k_start(struct ieee80211_ - - spin_unlock_bh(&sc->sc_pcu_lock); - -- if ((ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) && -+ if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && - !ah->btcoex_hw.enabled) { - if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI)) - ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, - AR_STOMP_LOW_WLAN_WGHT); - ath9k_hw_btcoex_enable(ah); - -- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) - ath9k_btcoex_timer_resume(sc); - } - -@@ -1194,9 +1194,10 @@ static void ath9k_stop(struct ieee80211_ - /* Ensure HW is awake when we try to shut it down. */ - ath9k_ps_wakeup(sc); - -- if (ah->btcoex_hw.enabled) { -+ if (ah->btcoex_hw.enabled && -+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { - ath9k_hw_btcoex_disable(ah); -- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) - ath9k_btcoex_timer_pause(sc); - ath_mci_flush_profile(&sc->btcoex.mci); - } ---- a/drivers/net/wireless/ath/ath9k/gpio.c -+++ b/drivers/net/wireless/ath/ath9k/gpio.c -@@ -253,6 +253,9 @@ int ath_init_btcoex_timer(struct ath_sof - { - struct ath_btcoex *btcoex = &sc->btcoex; - -+ if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_NONE) -+ return 0; -+ - btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD * 1000; - btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) * - btcoex->btcoex_period / 100; -@@ -286,6 +289,9 @@ void ath9k_btcoex_timer_resume(struct at - ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX, - "Starting btcoex timers\n"); - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - /* make sure duty cycle timer is also stopped when resuming */ - if (btcoex->hw_timer_enabled) - ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); -@@ -306,6 +312,9 @@ void ath9k_btcoex_timer_pause(struct ath - struct ath_btcoex *btcoex = &sc->btcoex; - struct ath_hw *ah = sc->sc_ah; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - del_timer_sync(&btcoex->period_timer); - - if (btcoex->hw_timer_enabled) ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1932,7 +1932,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st - #endif - } - -- if (ah->btcoex_hw.enabled) -+ if (ah->btcoex_hw.enabled && -+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) - ath9k_hw_btcoex_enable(ah); - - if (mci && mci_hw->ready) { ---- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c -@@ -116,6 +116,9 @@ void ath_htc_init_btcoex_work(struct ath - { - struct ath_btcoex *btcoex = &priv->btcoex; - -+ if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD; - btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) * - btcoex->btcoex_period / 100; -@@ -134,6 +137,9 @@ void ath_htc_resume_btcoex_work(struct a - struct ath_btcoex *btcoex = &priv->btcoex; - struct ath_hw *ah = priv->ah; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX, "Starting btcoex work\n"); - - btcoex->bt_priority_cnt = 0; -@@ -148,6 +154,9 @@ void ath_htc_resume_btcoex_work(struct a - */ - void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv) - { -+ if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - cancel_delayed_work_sync(&priv->coex_period_work); - cancel_delayed_work_sync(&priv->duty_cycle_work); - } ---- a/drivers/net/wireless/ath/ath9k/btcoex.c -+++ b/drivers/net/wireless/ath/ath9k/btcoex.c -@@ -68,6 +68,9 @@ void ath9k_hw_init_btcoex_hw(struct ath_ - u32 i, idx; - bool rxclear_polarity = ath_bt_config.bt_rxclear_polarity; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - if (AR_SREV_9300_20_OR_LATER(ah)) - rxclear_polarity = !ath_bt_config.bt_rxclear_polarity; - -@@ -99,6 +102,9 @@ void ath9k_hw_btcoex_init_2wire(struct a - { - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - /* connect bt_active to baseband */ - REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, - (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | -@@ -121,6 +127,9 @@ void ath9k_hw_btcoex_init_3wire(struct a - { - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - /* btcoex 3-wire */ - REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, - (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB | -@@ -147,6 +156,9 @@ static void ath9k_hw_btcoex_enable_2wire - { - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - /* Configure the desired GPIO port for TX_FRAME output */ - ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio, - AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); -@@ -158,6 +170,9 @@ void ath9k_hw_btcoex_set_weight(struct a - { - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - btcoex_hw->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) | - SM(wlan_weight, AR_BTCOEX_WL_WGHT); - } -@@ -219,9 +234,9 @@ void ath9k_hw_btcoex_enable(struct ath_h - { - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - -- switch (btcoex_hw->scheme) { -+ switch (ath9k_hw_get_btcoex_scheme(ah)) { - case ATH_BTCOEX_CFG_NONE: -- break; -+ return; - case ATH_BTCOEX_CFG_2WIRE: - ath9k_hw_btcoex_enable_2wire(ah); - break; -@@ -246,6 +261,9 @@ void ath9k_hw_btcoex_disable(struct ath_ - struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; - int i; - -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - btcoex_hw->enabled = false; - if (btcoex_hw->scheme == ATH_BTCOEX_CFG_MCI) { - ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE); -@@ -294,6 +312,9 @@ static void ar9003_btcoex_bt_stomp(struc - void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah, - enum ath_stomp_type stomp_type) - { -+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE) -+ return; -+ - if (AR_SREV_9300_20_OR_LATER(ah)) { - ar9003_btcoex_bt_stomp(ah, stomp_type); - return; ---- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c -@@ -85,6 +85,9 @@ void ar9003_mci_remote_reset(struct ath_ - { - u32 payload[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00}; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ar9003_mci_send_message(ah, MCI_REMOTE_RESET, 0, payload, 16, - wait_done, false); - udelay(5); -@@ -94,6 +97,9 @@ void ar9003_mci_send_lna_transfer(struct - { - u32 payload = 0x00000000; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ar9003_mci_send_message(ah, MCI_LNA_TRANS, 0, &payload, 1, - wait_done, false); - } -@@ -107,6 +113,9 @@ static void ar9003_mci_send_req_wake(str - - void ar9003_mci_send_sys_waking(struct ath_hw *ah, bool wait_done) - { -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ar9003_mci_send_message(ah, MCI_SYS_WAKING, MCI_FLAG_DISABLE_TIMESTAMP, - NULL, 0, wait_done, false); - } -@@ -221,6 +230,9 @@ void ar9003_mci_send_coex_halt_bt_gpm(st - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - u32 payload[4] = {0, 0, 0, 0}; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ath_dbg(common, ATH_DBG_MCI, "MCI Send Coex %s BT GPM.\n", - (halt) ? "halt" : "unhalt"); - -@@ -381,12 +393,17 @@ static void ar9003_mci_prep_interface(st - - void ar9003_mci_disable_interrupt(struct ath_hw *ah) - { -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - REG_WRITE(ah, AR_MCI_INTERRUPT_EN, 0); - REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, 0); - } - - void ar9003_mci_enable_interrupt(struct ath_hw *ah) - { -+ if (!ATH9K_HW_CAP_MCI) -+ return; - - REG_WRITE(ah, AR_MCI_INTERRUPT_EN, AR_MCI_INTERRUPT_DEFAULT); - REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, -@@ -397,6 +414,9 @@ bool ar9003_mci_check_int(struct ath_hw - { - u32 intr; - -+ if (!ATH9K_HW_CAP_MCI) -+ return false; -+ - intr = REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW); - return ((intr & ints) == ints); - } -@@ -405,6 +425,10 @@ void ar9003_mci_get_interrupt(struct ath - u32 *rx_msg_intr) - { - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; -+ -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - *raw_intr = mci->raw_intr; - *rx_msg_intr = mci->rx_msg_intr; - -@@ -418,6 +442,9 @@ void ar9003_mci_2g5g_changed(struct ath_ - { - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - if (!mci->update_2g5g && - (mci->is_2g != is_2g)) - mci->update_2g5g = true; -@@ -531,6 +558,9 @@ void ar9003_mci_reset(struct ath_hw *ah, - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - u32 regval, thresh; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ath_dbg(common, ATH_DBG_MCI, "MCI full_sleep = %d, is_2g = %d\n", - is_full_sleep, is_2g); - -@@ -661,6 +691,9 @@ void ar9003_mci_mute_bt(struct ath_hw *a - { - struct ath_common *common = ath9k_hw_common(ah); - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - /* disable all MCI messages */ - REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0xffff0000); - REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0xffffffff); -@@ -693,6 +726,9 @@ void ar9003_mci_sync_bt_state(struct ath - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - u32 cur_bt_state; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL); - - if (mci->bt_state != cur_bt_state) { -@@ -857,6 +893,9 @@ void ar9003_mci_2g5g_switch(struct ath_h - struct ath_common *common = ath9k_hw_common(ah); - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - if (mci->update_2g5g) { - if (mci->is_2g) { - -@@ -908,6 +947,9 @@ bool ar9003_mci_send_message(struct ath_ - u32 saved_mci_int_en; - int i; - -+ if (!ATH9K_HW_CAP_MCI) -+ return false; -+ - saved_mci_int_en = REG_READ(ah, AR_MCI_INTERRUPT_EN); - regval = REG_READ(ah, AR_BTCOEX_CTRL); - -@@ -973,6 +1015,9 @@ void ar9003_mci_setup(struct ath_hw *ah, - struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; - void *sched_buf = (void *)((char *) gpm_buf + (sched_addr - gpm_addr)); - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - mci->gpm_addr = gpm_addr; - mci->gpm_buf = gpm_buf; - mci->gpm_len = len; -@@ -987,6 +1032,9 @@ void ar9003_mci_cleanup(struct ath_hw *a - { - struct ath_common *common = ath9k_hw_common(ah); - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - /* Turn off MCI and Jupiter mode. */ - REG_WRITE(ah, AR_BTCOEX_CTRL, 0x00); - ath_dbg(common, ATH_DBG_MCI, "MCI ar9003_mci_cleanup\n"); -@@ -1056,6 +1104,9 @@ u32 ar9003_mci_wait_for_gpm(struct ath_h - u8 recv_type = 0, recv_opcode = 0; - bool b_is_bt_cal_done = (gpm_type == MCI_GPM_BT_CAL_DONE); - -+ if (!ATH9K_HW_CAP_MCI) -+ return 0; -+ - more_data = time_out ? MCI_GPM_NOMORE : MCI_GPM_MORE; - - while (time_out > 0) { -@@ -1188,6 +1239,9 @@ u32 ar9003_mci_state(struct ath_hw *ah, - u32 value = 0, more_gpm = 0, gpm_ptr; - u8 query_type; - -+ if (!ATH9K_HW_CAP_MCI) -+ return 0; -+ - switch (state_type) { - case MCI_STATE_ENABLE: - if (mci->ready) { ---- a/drivers/net/wireless/ath/ath9k/mci.c -+++ b/drivers/net/wireless/ath/ath9k/mci.c -@@ -425,6 +425,9 @@ int ath_mci_setup(struct ath_softc *sc) - struct ath_mci_coex *mci = &sc->mci_coex; - int error = 0; - -+ if (!ATH9K_HW_CAP_MCI) -+ return 0; -+ - mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE; - - if (ath_mci_buf_alloc(sc, &mci->sched_buf)) { -@@ -458,6 +461,9 @@ void ath_mci_cleanup(struct ath_softc *s - struct ath_hw *ah = sc->sc_ah; - struct ath_mci_coex *mci = &sc->mci_coex; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - /* - * both schedule and gpm buffers will be released - */ -@@ -476,6 +482,9 @@ void ath_mci_intr(struct ath_softc *sc) - u32 more_data = MCI_GPM_MORE; - bool skip_gpm = false; - -+ if (!ATH9K_HW_CAP_MCI) -+ return; -+ - ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); - - if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) { diff --git a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch index 0fb42f9..d15b07d 100644 --- a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch @@ -229,7 +229,7 @@ * Initialization functions. */ static bool rt2800pci_get_entry_state(struct queue_entry *entry) -@@ -1052,6 +1056,7 @@ static const struct rt2x00lib_ops rt2800 +@@ -1040,6 +1044,7 @@ static const struct rt2x00lib_ops rt2800 .get_firmware_name = rt2800pci_get_firmware_name, .check_firmware = rt2800_check_firmware, .load_firmware = rt2800_load_firmware, diff --git a/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch b/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch index 3d2b9b8..7d4e4fe 100644 --- a/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch +++ b/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -606,6 +606,7 @@ CONFIG_RT2X00=y +@@ -611,6 +611,7 @@ CONFIG_RT2X00=y CONFIG_RT2X00_LIB=m CONFIG_RT2800_LIB=m CONFIG_RT2X00_LIB_FIRMWARE=y diff --git a/package/mac80211/patches/605-rt2x00-pci-eeprom.patch b/package/mac80211/patches/605-rt2x00-pci-eeprom.patch index 088d474..51af67e 100644 --- a/package/mac80211/patches/605-rt2x00-pci-eeprom.patch +++ b/package/mac80211/patches/605-rt2x00-pci-eeprom.patch @@ -9,7 +9,7 @@ { memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE); } -@@ -938,8 +938,9 @@ static int rt2800pci_validate_eeprom(str +@@ -926,8 +926,9 @@ static int rt2800pci_validate_eeprom(str /* * Read EEPROM into buffer */ diff --git a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch index 96baa19..776d44e 100644 --- a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch +++ b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c -@@ -5193,6 +5193,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") +@@ -5297,6 +5297,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = { diff --git a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch index 08ac033..f3c278e 100644 --- a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch +++ b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h -@@ -791,6 +791,7 @@ struct b43_wldev { +@@ -803,6 +803,7 @@ struct b43_wldev { bool qos_enabled; /* TRUE, if QoS is used. */ bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */ bool use_pio; /* TRUE if next init should use PIO */ @@ -22,12 +22,12 @@ static int modparam_bad_frames_preempt; module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444); MODULE_PARM_DESC(bad_frames_preempt, -@@ -2686,10 +2691,10 @@ static int b43_gpio_init(struct b43_wlde - & ~B43_MACCTL_GPOUTSMSK); +@@ -2674,10 +2679,10 @@ static int b43_gpio_init(struct b43_wlde + u32 mask, set; - b43_write16(dev, B43_MMIO_GPIO_MASK, b43_read16(dev, B43_MMIO_GPIO_MASK) -- | 0x000F); -+ | modparam_gpiomask); + b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_GPOUTSMSK, 0); +- b43_maskset16(dev, B43_MMIO_GPIO_MASK, ~0, 0xF); ++ b43_maskset16(dev, B43_MMIO_GPIO_MASK, ~0, modparam_gpiomask); mask = 0x0000001F; - set = 0x0000000F; diff --git a/package/mac80211/patches/810-b43_no_pio.patch b/package/mac80211/patches/810-b43_no_pio.patch index be899c1..2827517 100644 --- a/package/mac80211/patches/810-b43_no_pio.patch +++ b/package/mac80211/patches/810-b43_no_pio.patch @@ -11,18 +11,19 @@ b43-$(CONFIG_B43_PCMCIA) += pcmcia.o --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c -@@ -1893,9 +1893,11 @@ static void b43_do_interrupt_thread(stru +@@ -1885,10 +1885,12 @@ static void b43_do_interrupt_thread(stru + dma_reason[0], dma_reason[1], + dma_reason[2], dma_reason[3], dma_reason[4], dma_reason[5]); ++#ifdef CONFIG_B43_PIO b43err(dev->wl, "This device does not support DMA " "on your system. It will now be switched to PIO.\n"); -+#ifdef CONFIG_B43_PIO /* Fall back to PIO transfers if we get fatal DMA errors! */ - dev->use_pio = 1; - b43_controller_restart(dev, "DMA error"); + dev->use_pio = true; +#endif + b43_controller_restart(dev, "DMA error"); return; } - if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { --- a/drivers/net/wireless/b43/pio.h +++ b/drivers/net/wireless/b43/pio.h @@ -150,7 +150,7 @@ static inline void b43_piorx_write32(str diff --git a/package/mac80211/patches/820-b43-add-antenna-control.patch b/package/mac80211/patches/820-b43-add-antenna-control.patch index fd80824..c1f7a6f 100644 --- a/package/mac80211/patches/820-b43-add-antenna-control.patch +++ b/package/mac80211/patches/820-b43-add-antenna-control.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c -@@ -1535,7 +1535,7 @@ static void b43_write_beacon_template(st +@@ -1529,7 +1529,7 @@ static void b43_write_beacon_template(st len, ram_offset, shm_size_offset, rate); /* Write the PHY TX control parameters. */ @@ -9,7 +9,7 @@ antenna = b43_antenna_to_phyctl(antenna); ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); /* We can't send beacons with short preamble. Would get PHY errors. */ -@@ -3052,8 +3052,8 @@ static int b43_chip_init(struct b43_wlde +@@ -3031,8 +3031,8 @@ static int b43_chip_init(struct b43_wlde /* Select the antennae */ if (phy->ops->set_rx_antenna) @@ -20,7 +20,7 @@ if (phy->type == B43_PHYTYPE_B) { value16 = b43_read16(dev, 0x005E); -@@ -3782,7 +3782,6 @@ static int b43_op_config(struct ieee8021 +@@ -3775,7 +3775,6 @@ static int b43_op_config(struct ieee8021 struct b43_wldev *dev; struct b43_phy *phy; struct ieee80211_conf *conf = &hw->conf; @@ -28,7 +28,7 @@ int err = 0; bool reload_bss = false; -@@ -3836,11 +3835,9 @@ static int b43_op_config(struct ieee8021 +@@ -3829,11 +3828,9 @@ static int b43_op_config(struct ieee8021 } /* Antennas for RX and management frame TX. */ @@ -42,7 +42,7 @@ if (wl->radio_enabled != phy->radio_on) { if (wl->radio_enabled) { -@@ -4910,6 +4907,47 @@ static int b43_op_get_survey(struct ieee +@@ -4905,6 +4902,47 @@ static int b43_op_get_survey(struct ieee return 0; } @@ -90,7 +90,7 @@ static const struct ieee80211_ops b43_hw_ops = { .tx = b43_op_tx, .conf_tx = b43_op_conf_tx, -@@ -4931,6 +4969,8 @@ static const struct ieee80211_ops b43_hw +@@ -4926,6 +4964,8 @@ static const struct ieee80211_ops b43_hw .sw_scan_complete = b43_op_sw_scan_complete_notifier, .get_survey = b43_op_get_survey, .rfkill_poll = b43_rfkill_poll, @@ -99,7 +99,7 @@ }; /* Hard-reset the chip. Do not call this directly. -@@ -5177,6 +5217,8 @@ static int b43_one_core_attach(struct b4 +@@ -5172,6 +5212,8 @@ static int b43_one_core_attach(struct b4 if (!wldev) goto out; @@ -108,19 +108,19 @@ wldev->use_pio = b43_modparam_pio; wldev->dev = dev; wldev->wl = wl; -@@ -5264,6 +5306,9 @@ static struct b43_wl *b43_wireless_init( +@@ -5260,6 +5302,9 @@ static struct b43_wl *b43_wireless_init( BIT(NL80211_IFTYPE_WDS) | BIT(NL80211_IFTYPE_ADHOC); + hw->wiphy->available_antennas_rx = 0x3; + hw->wiphy->available_antennas_tx = 0x3; + - hw->queues = modparam_qos ? 4 : 1; + hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1; wl->mac80211_initially_registered_queues = hw->queues; hw->max_rates = 2; --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h -@@ -792,6 +792,8 @@ struct b43_wldev { +@@ -804,6 +804,8 @@ struct b43_wldev { bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */ bool use_pio; /* TRUE if next init should use PIO */ int gpiomask; /* GPIO LED mask as a module parameter */ diff --git a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch index 7a53bbf..657329b 100644 --- a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch +++ b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch @@ -19,7 +19,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h -@@ -1016,6 +1016,32 @@ static inline bool b43_using_pio_transfe +@@ -1044,6 +1044,32 @@ static inline bool b43_using_pio_transfe return dev->__using_pio_transfers; } @@ -88,7 +88,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> dev->phy.writes_counter = 0; --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c -@@ -4104,14 +4104,14 @@ static inline void check_phyreg(struct b +@@ -4837,14 +4837,14 @@ static inline void check_phyreg(struct b static u16 b43_nphy_op_read(struct b43_wldev *dev, u16 reg) { check_phyreg(dev, reg); @@ -105,16 +105,16 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> b43_write16(dev, B43_MMIO_PHY_DATA, value); } -@@ -4119,7 +4119,7 @@ static void b43_nphy_op_maskset(struct b +@@ -4852,7 +4852,7 @@ static void b43_nphy_op_maskset(struct b u16 set) { check_phyreg(dev, reg); - b43_write16(dev, B43_MMIO_PHY_CONTROL, reg); + b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg); - b43_write16(dev, B43_MMIO_PHY_DATA, - (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set); + b43_maskset16(dev, B43_MMIO_PHY_DATA, mask, set); } -@@ -4131,7 +4131,7 @@ static u16 b43_nphy_op_radio_read(struct + +@@ -4863,7 +4863,7 @@ static u16 b43_nphy_op_radio_read(struct /* N-PHY needs 0x100 for read access */ reg |= 0x100; @@ -123,7 +123,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> return b43_read16(dev, B43_MMIO_RADIO_DATA_LOW); } -@@ -4140,7 +4140,7 @@ static void b43_nphy_op_radio_write(stru +@@ -4872,7 +4872,7 @@ static void b43_nphy_op_radio_write(stru /* Register 1 is a 32-bit register. */ B43_WARN_ON(reg == 1); |