From 9f3403679d823f3b7d4eb2e2918db58b1a0b8fff Mon Sep 17 00:00:00 2001 From: nbd Date: Mon, 18 Jun 2012 01:26:36 +0000 Subject: [PATCH] mac80211: update to wireless-testing 2012-06-14 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32420 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/mac80211/Makefile | 4 +- .../mac80211/patches/001-disable_b44.patch | 2 +- .../mac80211/patches/002-disable_rfkill.patch | 2 +- .../patches/005-disable_ssb_build.patch | 6 +- .../patches/006-disable_bcma_build.patch | 2 +- .../patches/007-remove_misc_drivers.patch | 4 +- package/mac80211/patches/010-no_pcmcia.patch | 2 +- package/mac80211/patches/011-no_sdio.patch | 2 +- .../patches/013-disable_b43_nphy.patch | 2 +- .../patches/015-remove-rt2x00-options.patch | 4 +- .../patches/022-remove_crc8_and_cordic.patch | 2 +- .../patches/071-add_codel_ifdef.patch | 14 +- .../patches/110-disable_usb_compat.patch | 2 +- .../mac80211/patches/300-pending_work.patch | 1561 +++++++++++++---- ...h9k-fix-invalid-mac-address-handling.patch | 2 +- .../410-ath9k_allow_adhoc_and_ap.patch | 36 +- .../412-mac80211_allow_adhoc_and_ap.patch | 2 +- .../patches/500-ath9k_eeprom_debugfs.patch | 4 +- .../patches/501-ath9k-eeprom_endianess.patch | 2 +- .../mac80211/patches/502-ath9k_ahb_init.patch | 2 +- .../510-ath9k_intr_mitigation_tweak.patch | 4 +- .../patches/512-ath9k_channelbw_debugfs.patch | 16 +- .../513-mac80211_reduce_txqueuelen.patch | 2 +- .../patches/520-mac80211_cur_txpower.patch | 2 +- .../patches/521-ath9k_cur_txpower.patch | 4 +- .../522-ath9k_per_chain_signal_strength.patch | 79 +- .../patches/530-ath9k_limit_qlen.patch | 12 +- .../patches/540-ath9k_extra_leds.patch | 12 +- .../550-mac80211_optimize_mcs_rate_mask.patch | 12 +- ...-ath9k_optimize_interrupt_mitigation.patch | 2 +- .../patches/570-ath9k_remove_noiseFloor.patch | 52 - .../patches/571-ath9k_ani_fix_weak_sig.patch | 30 - ...ath9k_ani_cleanup_weak_signal_detect.patch | 192 -- .../573-ath9k_ani_fix_mode_checks.patch | 49 - .../patches/574-ath9k_remove_old_ani.patch | 627 ------- .../patches/575-ath9k_ani_cleanup.patch | 320 ---- .../576-ath9k_ani_remove_mib_int.patch | 114 -- .../577-ath9k_fix_noise_immunity.patch | 69 - .../578-ath9k_cleanup_ani_ofdm_trig.patch | 41 - .../603-rt2x00-introduce-rt2x00eeprom.patch | 14 +- ...-add-CONFIG_RT2X00_LIB_EEPROM-option.patch | 2 +- ...isabling_bands_through_platform_data.patch | 2 +- .../608-add_platform_data_mac_addr.patch | 2 +- .../800-b43-gpio-mask-module-option.patch | 2 +- .../patches/820-b43-add-antenna-control.patch | 16 +- .../830-b43-workaround-pcie-bcm4716.patch | 2 +- .../patches/840-brcmsmac-remove-PCIE.patch | 4 +- .../841-brcmsmac-remove-PCI_FORCEHT.patch | 6 +- ...ai_get_buscoretype-and-ai_get_buscor.patch | 2 +- ...mac-use-container_of-instead-of-cast.patch | 12 +- .../844-brcmsmac-remove-ai_findcore.patch | 10 +- ...ome-conditions-for-the-bcm4716-again.patch | 6 +- ...ice-found-on-some-SoCs-like-the-bcm4.patch | 4 +- ...start-adding-support-for-core-rev-28.patch | 4 +- 54 files changed, 1421 insertions(+), 1963 deletions(-) delete mode 100644 package/mac80211/patches/570-ath9k_remove_noiseFloor.patch delete mode 100644 package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch delete mode 100644 package/mac80211/patches/572-ath9k_ani_cleanup_weak_signal_detect.patch delete mode 100644 package/mac80211/patches/573-ath9k_ani_fix_mode_checks.patch delete mode 100644 package/mac80211/patches/574-ath9k_remove_old_ani.patch delete mode 100644 package/mac80211/patches/575-ath9k_ani_cleanup.patch delete mode 100644 package/mac80211/patches/576-ath9k_ani_remove_mib_int.patch delete mode 100644 package/mac80211/patches/577-ath9k_fix_noise_immunity.patch delete mode 100644 package/mac80211/patches/578-ath9k_cleanup_ani_ofdm_trig.patch diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 8ad134fa1..5d40e7e33 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2012-05-29 +PKG_VERSION:=2012-06-14 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_MD5SUM:=a98eedfcb1690405626217e040deec1a +PKG_MD5SUM:=009fd7aa420693e30df9090cee9ea189 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) diff --git a/package/mac80211/patches/001-disable_b44.patch b/package/mac80211/patches/001-disable_b44.patch index aaebab1af..aae8ef956 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 -@@ -370,8 +370,8 @@ export CONFIG_B43_BCMA_EXTRA=y +@@ -371,8 +371,8 @@ export CONFIG_B43_BCMA_EXTRA=y export CONFIG_P54_PCI=m diff --git a/package/mac80211/patches/002-disable_rfkill.patch b/package/mac80211/patches/002-disable_rfkill.patch index 1bd9fc3fe..4660909b2 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") -@@ -675,10 +675,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 +@@ -683,10 +683,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 996d7b14a..23ce92440 100644 --- a/package/mac80211/patches/005-disable_ssb_build.patch +++ b/package/mac80211/patches/005-disable_ssb_build.patch @@ -19,7 +19,7 @@ else include $(KLIB_BUILD)/.config endif -@@ -346,7 +346,8 @@ export CONFIG_IPW2200_QOS=y +@@ -347,7 +347,8 @@ export CONFIG_IPW2200_QOS=y # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface endif #CONFIG_WIRELESS_EXT @@ -29,7 +29,7 @@ # Sonics Silicon Backplane export CONFIG_SSB_SPROM=y -@@ -359,7 +360,7 @@ endif #CONFIG_PCMCIA +@@ -360,7 +361,7 @@ endif #CONFIG_PCMCIA # export CONFIG_SSB_DEBUG=y export CONFIG_SSB_DRIVER_PCICORE=y export CONFIG_B43_SSB=y @@ -38,7 +38,7 @@ export CONFIG_BCMA=m export CONFIG_BCMA_BLOCKIO=y -@@ -574,7 +575,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv +@@ -577,7 +578,7 @@ 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 fd05385f0..a0265ac79 100644 --- a/package/mac80211/patches/006-disable_bcma_build.patch +++ b/package/mac80211/patches/006-disable_bcma_build.patch @@ -10,7 +10,7 @@ ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),) --- a/config.mk +++ b/config.mk -@@ -362,12 +362,12 @@ export CONFIG_SSB_DRIVER_PCICORE=y +@@ -363,12 +363,12 @@ export CONFIG_SSB_DRIVER_PCICORE=y export CONFIG_B43_SSB=y endif #__CONFIG_SSB diff --git a/package/mac80211/patches/007-remove_misc_drivers.patch b/package/mac80211/patches/007-remove_misc_drivers.patch index f5bd351a4..b89089d98 100644 --- a/package/mac80211/patches/007-remove_misc_drivers.patch +++ b/package/mac80211/patches/007-remove_misc_drivers.patch @@ -9,7 +9,7 @@ endif #CONFIG_STAGING # mac80211 test driver -@@ -399,15 +399,15 @@ endif #CONFIG_CRC_ITU_T +@@ -400,15 +400,15 @@ endif #CONFIG_CRC_ITU_T export CONFIG_MWL8K=m # Ethernet drivers go here @@ -32,7 +32,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_28 ifdef CONFIG_WIRELESS_EXT -@@ -468,21 +468,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 +@@ -469,21 +469,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/010-no_pcmcia.patch b/package/mac80211/patches/010-no_pcmcia.patch index 9d94b8dbf..e9b5ab734 100644 --- a/package/mac80211/patches/010-no_pcmcia.patch +++ b/package/mac80211/patches/010-no_pcmcia.patch @@ -9,7 +9,7 @@ # export CONFIG_SSB=m else include $(KLIB_BUILD)/.config -@@ -297,7 +297,7 @@ export CONFIG_B43=m +@@ -298,7 +298,7 @@ export CONFIG_B43=m export CONFIG_B43_HWRNG=y export 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 58c3ba96b..380074754 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 -@@ -576,7 +576,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv +@@ -579,7 +579,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv ifdef CONFIG_MMC # export CONFIG_SSB_SDIOHOST=y diff --git a/package/mac80211/patches/013-disable_b43_nphy.patch b/package/mac80211/patches/013-disable_b43_nphy.patch index 10ee79405..ae5be9ff6 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 -@@ -303,8 +303,8 @@ ifdef CONFIG_MAC80211_LEDS +@@ -304,8 +304,8 @@ ifdef CONFIG_MAC80211_LEDS export CONFIG_B43_LEDS=y endif #CONFIG_MAC80211_LEDS export CONFIG_B43_PHY_LP=y diff --git a/package/mac80211/patches/015-remove-rt2x00-options.patch b/package/mac80211/patches/015-remove-rt2x00-options.patch index bd2791339..5b029c41d 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 -@@ -378,7 +378,7 @@ export CONFIG_RTL8180=m +@@ -379,7 +379,7 @@ export CONFIG_RTL8180=m export CONFIG_ADM8211=m @@ -9,7 +9,7 @@ export CONFIG_RT2400PCI=m export CONFIG_RT2500PCI=m ifdef CONFIG_CRC_CCITT -@@ -524,7 +524,7 @@ export CONFIG_RT2800USB_RT35XX=y +@@ -525,7 +525,7 @@ export CONFIG_RT2800USB_RT35XX=y export CONFIG_RT2800USB_RT53XX=y export CONFIG_RT2800USB_UNKNOWN=y endif #CONFIG_CRC_CCITT diff --git a/package/mac80211/patches/022-remove_crc8_and_cordic.patch b/package/mac80211/patches/022-remove_crc8_and_cordic.patch index 56721f3c1..86bbfe67a 100644 --- a/package/mac80211/patches/022-remove_crc8_and_cordic.patch +++ b/package/mac80211/patches/022-remove_crc8_and_cordic.patch @@ -1,6 +1,6 @@ --- a/compat/Makefile +++ b/compat/Makefile -@@ -43,8 +43,6 @@ compat-$(CONFIG_COMPAT_KERNEL_3_3) += \ +@@ -44,8 +44,6 @@ compat-$(CONFIG_COMPAT_KERNEL_3_3) += \ flow_dissector.o compat-$(CONFIG_COMPAT_KERNEL_3_4) += compat-3.4.o diff --git a/package/mac80211/patches/071-add_codel_ifdef.patch b/package/mac80211/patches/071-add_codel_ifdef.patch index b69fdd78b..45a599c4f 100644 --- a/package/mac80211/patches/071-add_codel_ifdef.patch +++ b/package/mac80211/patches/071-add_codel_ifdef.patch @@ -1,19 +1,19 @@ --- a/include/linux/compat-3.5.h +++ b/include/linux/compat-3.5.h -@@ -10,6 +10,8 @@ +@@ -8,6 +8,8 @@ - #include + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) +#ifndef TCA_CODEL_MAX + /* * This backports: * -@@ -107,6 +109,7 @@ struct tc_fq_codel_xstats { - }; - }; +@@ -106,6 +108,7 @@ struct vga_switcheroo_client_ops { + + #define SIZE_MAX (~(size_t)0) +#endif /* TCA_CODEL_MAX */ - /* Backports tty_lock: Localise the lock */ - #define tty_lock(__tty) tty_lock() + #include + diff --git a/package/mac80211/patches/110-disable_usb_compat.patch b/package/mac80211/patches/110-disable_usb_compat.patch index 610898962..6f674008f 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 -@@ -506,7 +506,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 +@@ -507,7 +507,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/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index 9044396dc..cb219c914 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -1,63 +1,1221 @@ ---- a/drivers/net/wireless/ath/ath5k/base.c -+++ b/drivers/net/wireless/ath/ath5k/base.c -@@ -2417,6 +2417,22 @@ ath5k_tx_complete_poll_work(struct work_ - * Initialization routines * - \*************************/ +--- a/drivers/net/wireless/ath/ath9k/ani.c ++++ b/drivers/net/wireless/ath/ath9k/ani.c +@@ -104,11 +104,6 @@ static const struct ani_cck_level_entry + #define ATH9K_ANI_CCK_DEF_LEVEL \ + 2 /* default level - matches the INI settings */ -+static const struct ieee80211_iface_limit if_limits[] = { -+ { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) }, -+ { .max = 4, .types = -+#ifdef CONFIG_MAC80211_MESH -+ BIT(NL80211_IFTYPE_MESH_POINT) | -+#endif -+ BIT(NL80211_IFTYPE_AP) }, -+}; -+ -+static const struct ieee80211_iface_combination if_comb = { -+ .limits = if_limits, -+ .n_limits = ARRAY_SIZE(if_limits), -+ .max_interfaces = 2048, -+ .num_different_channels = 1, -+}; -+ - int __devinit - ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops) +-static bool use_new_ani(struct ath_hw *ah) +-{ +- return AR_SREV_9300_20_OR_LATER(ah) || modparam_force_new_ani; +-} +- + static void ath9k_hw_update_mibstats(struct ath_hw *ah, + struct ath9k_mib_stats *stats) { -@@ -2438,6 +2454,9 @@ ath5k_init_ah(struct ath5k_hw *ah, const - BIT(NL80211_IFTYPE_ADHOC) | - BIT(NL80211_IFTYPE_MESH_POINT); +@@ -122,8 +117,6 @@ static void ath9k_hw_update_mibstats(str + static void ath9k_ani_restart(struct ath_hw *ah) + { + struct ar5416AniState *aniState; +- struct ath_common *common = ath9k_hw_common(ah); +- u32 ofdm_base = 0, cck_base = 0; -+ hw->wiphy->iface_combinations = &if_comb; -+ hw->wiphy->n_iface_combinations = 1; + if (!DO_ANI(ah)) + return; +@@ -131,18 +124,10 @@ static void ath9k_ani_restart(struct ath + aniState = &ah->curchan->ani; + aniState->listenTime = 0; + +- if (!use_new_ani(ah)) { +- ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; +- cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; +- } +- +- ath_dbg(common, ANI, "Writing ofdmbase=%u cckbase=%u\n", +- ofdm_base, cck_base); +- + ENABLE_REGWRITE_BUFFER(ah); + +- REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); +- REG_WRITE(ah, AR_PHY_ERR_2, cck_base); ++ REG_WRITE(ah, AR_PHY_ERR_1, 0); ++ REG_WRITE(ah, AR_PHY_ERR_2, 0); + REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); + REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); + +@@ -154,110 +139,6 @@ static void ath9k_ani_restart(struct ath + aniState->cckPhyErrCount = 0; + } + +-static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah) +-{ +- struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; +- struct ar5416AniState *aniState; +- int32_t rssi; +- +- aniState = &ah->curchan->ani; +- +- if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { +- if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, +- aniState->noiseImmunityLevel + 1)) { +- return; +- } +- } +- +- if (aniState->spurImmunityLevel < HAL_SPUR_IMMUNE_MAX) { +- if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, +- aniState->spurImmunityLevel + 1)) { +- return; +- } +- } +- +- if (ah->opmode == NL80211_IFTYPE_AP) { +- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel + 1); +- } +- return; +- } +- rssi = BEACON_RSSI(ah); +- if (rssi > aniState->rssiThrHigh) { +- if (!aniState->ofdmWeakSigDetectOff) { +- if (ath9k_hw_ani_control(ah, +- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- false)) { +- ath9k_hw_ani_control(ah, +- ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); +- return; +- } +- } +- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel + 1); +- return; +- } +- } else if (rssi > aniState->rssiThrLow) { +- if (aniState->ofdmWeakSigDetectOff) +- ath9k_hw_ani_control(ah, +- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- true); +- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel + 1); +- return; +- } else { +- if ((conf->channel->band == IEEE80211_BAND_2GHZ) && +- !conf_is_ht(conf)) { +- if (!aniState->ofdmWeakSigDetectOff) +- ath9k_hw_ani_control(ah, +- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- false); +- if (aniState->firstepLevel > 0) +- ath9k_hw_ani_control(ah, +- ATH9K_ANI_FIRSTEP_LEVEL, 0); +- return; +- } +- } +-} +- +-static void ath9k_hw_ani_cck_err_trigger_old(struct ath_hw *ah) +-{ +- struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; +- struct ar5416AniState *aniState; +- int32_t rssi; +- +- aniState = &ah->curchan->ani; +- if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { +- if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, +- aniState->noiseImmunityLevel + 1)) { +- return; +- } +- } +- if (ah->opmode == NL80211_IFTYPE_AP) { +- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel + 1); +- } +- return; +- } +- rssi = BEACON_RSSI(ah); +- if (rssi > aniState->rssiThrLow) { +- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel + 1); +- } else { +- if ((conf->channel->band == IEEE80211_BAND_2GHZ) && +- !conf_is_ht(conf)) { +- if (aniState->firstepLevel > 0) +- ath9k_hw_ani_control(ah, +- ATH9K_ANI_FIRSTEP_LEVEL, 0); +- } +- } +-} +- + /* Adjust the OFDM Noise Immunity Level */ + static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel) + { +@@ -265,18 +146,15 @@ static void ath9k_hw_set_ofdm_nil(struct + struct ath_common *common = ath9k_hw_common(ah); + const struct ani_ofdm_level_entry *entry_ofdm; + const struct ani_cck_level_entry *entry_cck; +- +- aniState->noiseFloor = BEACON_RSSI(ah); ++ bool weak_sig; + + ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", + aniState->ofdmNoiseImmunityLevel, +- immunityLevel, aniState->noiseFloor, ++ immunityLevel, BEACON_RSSI(ah), + aniState->rssiThrLow, aniState->rssiThrHigh); + + if (aniState->update_ani) +- aniState->ofdmNoiseImmunityLevel = +- (immunityLevel > ATH9K_ANI_OFDM_DEF_LEVEL) ? +- immunityLevel : ATH9K_ANI_OFDM_DEF_LEVEL; ++ aniState->ofdmNoiseImmunityLevel = immunityLevel; + + entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; + entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; +@@ -292,12 +170,22 @@ static void ath9k_hw_set_ofdm_nil(struct + ATH9K_ANI_FIRSTEP_LEVEL, + entry_ofdm->fir_step_level); + +- if ((aniState->noiseFloor >= aniState->rssiThrHigh) && +- (!aniState->ofdmWeakSigDetectOff != +- entry_ofdm->ofdm_weak_signal_on)) { ++ weak_sig = entry_ofdm->ofdm_weak_signal_on; ++ if (ah->opmode == NL80211_IFTYPE_STATION && ++ BEACON_RSSI(ah) <= aniState->rssiThrHigh) ++ weak_sig = true; + - /* SW support for IBSS_RSN is provided by mac80211 */ - hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; ++ if (aniState->ofdmWeakSigDetect != weak_sig) + ath9k_hw_ani_control(ah, + ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, + entry_ofdm->ofdm_weak_signal_on); ++ ++ if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) { ++ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; ++ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI; ++ } else { ++ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI; ++ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; + } + } + +@@ -308,11 +196,6 @@ static void ath9k_hw_ani_ofdm_err_trigge + if (!DO_ANI(ah)) + return; + +- if (!use_new_ani(ah)) { +- ath9k_hw_ani_ofdm_err_trigger_old(ah); +- return; +- } +- + aniState = &ah->curchan->ani; + + if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) +@@ -329,22 +212,18 @@ static void ath9k_hw_set_cck_nil(struct + const struct ani_ofdm_level_entry *entry_ofdm; + const struct ani_cck_level_entry *entry_cck; + +- aniState->noiseFloor = BEACON_RSSI(ah); + ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", + aniState->cckNoiseImmunityLevel, immunityLevel, +- aniState->noiseFloor, aniState->rssiThrLow, ++ BEACON_RSSI(ah), aniState->rssiThrLow, + aniState->rssiThrHigh); + +- if ((ah->opmode == NL80211_IFTYPE_STATION || +- ah->opmode == NL80211_IFTYPE_ADHOC) && +- aniState->noiseFloor <= aniState->rssiThrLow && ++ if (ah->opmode == NL80211_IFTYPE_STATION && ++ BEACON_RSSI(ah) <= aniState->rssiThrLow && + immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) + immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; + + if (aniState->update_ani) +- aniState->cckNoiseImmunityLevel = +- (immunityLevel > ATH9K_ANI_CCK_DEF_LEVEL) ? +- immunityLevel : ATH9K_ANI_CCK_DEF_LEVEL; ++ aniState->cckNoiseImmunityLevel = immunityLevel; + + entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; + entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; +@@ -372,70 +251,12 @@ static void ath9k_hw_ani_cck_err_trigger + if (!DO_ANI(ah)) + return; + +- if (!use_new_ani(ah)) { +- ath9k_hw_ani_cck_err_trigger_old(ah); +- return; +- } +- + aniState = &ah->curchan->ani; + + if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) + ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1); + } + +-static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah) +-{ +- struct ar5416AniState *aniState; +- int32_t rssi; +- +- aniState = &ah->curchan->ani; +- +- if (ah->opmode == NL80211_IFTYPE_AP) { +- if (aniState->firstepLevel > 0) { +- if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel - 1)) +- return; +- } +- } else { +- rssi = BEACON_RSSI(ah); +- if (rssi > aniState->rssiThrHigh) { +- /* XXX: Handle me */ +- } else if (rssi > aniState->rssiThrLow) { +- if (aniState->ofdmWeakSigDetectOff) { +- if (ath9k_hw_ani_control(ah, +- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- true)) +- return; +- } +- if (aniState->firstepLevel > 0) { +- if (ath9k_hw_ani_control(ah, +- ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel - 1)) +- return; +- } +- } else { +- if (aniState->firstepLevel > 0) { +- if (ath9k_hw_ani_control(ah, +- ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel - 1)) +- return; +- } +- } +- } +- +- if (aniState->spurImmunityLevel > 0) { +- if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, +- aniState->spurImmunityLevel - 1)) +- return; +- } +- +- if (aniState->noiseImmunityLevel > 0) { +- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, +- aniState->noiseImmunityLevel - 1); +- return; +- } +-} +- + /* + * only lower either OFDM or CCK errors per turn + * we lower the other one next time +@@ -446,11 +267,6 @@ static void ath9k_hw_ani_lower_immunity( + + aniState = &ah->curchan->ani; + +- if (!use_new_ani(ah)) { +- ath9k_hw_ani_lower_immunity_old(ah); +- return; +- } +- + /* lower OFDM noise immunity */ + if (aniState->ofdmNoiseImmunityLevel > 0 && + (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) { +@@ -463,72 +279,6 @@ static void ath9k_hw_ani_lower_immunity( + ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1); + } + +-static void ath9k_ani_reset_old(struct ath_hw *ah, bool is_scanning) +-{ +- struct ar5416AniState *aniState; +- struct ath9k_channel *chan = ah->curchan; +- struct ath_common *common = ath9k_hw_common(ah); +- +- if (!DO_ANI(ah)) +- return; +- +- aniState = &ah->curchan->ani; +- +- if (ah->opmode != NL80211_IFTYPE_STATION +- && ah->opmode != NL80211_IFTYPE_ADHOC) { +- ath_dbg(common, ANI, "Reset ANI state opmode %u\n", ah->opmode); +- ah->stats.ast_ani_reset++; +- +- if (ah->opmode == NL80211_IFTYPE_AP) { +- /* +- * ath9k_hw_ani_control() will only process items set on +- * ah->ani_function +- */ +- if (IS_CHAN_2GHZ(chan)) +- ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | +- ATH9K_ANI_FIRSTEP_LEVEL); +- else +- ah->ani_function = 0; +- } +- +- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); +- ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); +- ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- !ATH9K_ANI_USE_OFDM_WEAK_SIG); +- ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, +- ATH9K_ANI_CCK_WEAK_SIG_THR); +- +- ath9k_ani_restart(ah); +- return; +- } +- +- if (aniState->noiseImmunityLevel != 0) +- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, +- aniState->noiseImmunityLevel); +- if (aniState->spurImmunityLevel != 0) +- ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, +- aniState->spurImmunityLevel); +- if (aniState->ofdmWeakSigDetectOff) +- ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, +- !aniState->ofdmWeakSigDetectOff); +- if (aniState->cckWeakSigThreshold) +- ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, +- aniState->cckWeakSigThreshold); +- if (aniState->firstepLevel != 0) +- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, +- aniState->firstepLevel); +- +- ath9k_ani_restart(ah); +- +- ENABLE_REGWRITE_BUFFER(ah); +- +- REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); +- REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); +- +- REGWRITE_BUFFER_FLUSH(ah); +-} +- + /* + * Restore the ANI parameters in the HAL and reset the statistics. + * This routine should be called for every hardware reset and for +@@ -539,13 +289,11 @@ void ath9k_ani_reset(struct ath_hw *ah, + struct ar5416AniState *aniState = &ah->curchan->ani; + struct ath9k_channel *chan = ah->curchan; + struct ath_common *common = ath9k_hw_common(ah); ++ int ofdm_nil, cck_nil; + + if (!DO_ANI(ah)) + return; + +- if (!use_new_ani(ah)) +- return ath9k_ani_reset_old(ah, is_scanning); +- + BUG_ON(aniState == NULL); + ah->stats.ast_ani_reset++; + +@@ -563,6 +311,11 @@ void ath9k_ani_reset(struct ath_hw *ah, + /* always allow mode (on/off) to be controlled */ + ah->ani_function |= ATH9K_ANI_MODE; + ++ ofdm_nil = max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL, ++ aniState->ofdmNoiseImmunityLevel); ++ cck_nil = max_t(int, ATH9K_ANI_CCK_DEF_LEVEL, ++ aniState->cckNoiseImmunityLevel); ++ + if (is_scanning || + (ah->opmode != NL80211_IFTYPE_STATION && + ah->opmode != NL80211_IFTYPE_ADHOC)) { +@@ -586,8 +339,8 @@ void ath9k_ani_reset(struct ath_hw *ah, + aniState->cckNoiseImmunityLevel); + + aniState->update_ani = false; +- ath9k_hw_set_ofdm_nil(ah, ATH9K_ANI_OFDM_DEF_LEVEL); +- ath9k_hw_set_cck_nil(ah, ATH9K_ANI_CCK_DEF_LEVEL); ++ ofdm_nil = ATH9K_ANI_OFDM_DEF_LEVEL; ++ cck_nil = ATH9K_ANI_CCK_DEF_LEVEL; + } + } else { + /* +@@ -603,11 +356,9 @@ void ath9k_ani_reset(struct ath_hw *ah, + aniState->cckNoiseImmunityLevel); + + aniState->update_ani = true; +- ath9k_hw_set_ofdm_nil(ah, +- aniState->ofdmNoiseImmunityLevel); +- ath9k_hw_set_cck_nil(ah, +- aniState->cckNoiseImmunityLevel); + } ++ ath9k_hw_set_ofdm_nil(ah, ofdm_nil); ++ ath9k_hw_set_cck_nil(ah, cck_nil); + + /* + * enable phy counters if hw supports or if not, enable phy +@@ -627,9 +378,6 @@ static bool ath9k_hw_ani_read_counters(s + { + struct ath_common *common = ath9k_hw_common(ah); + struct ar5416AniState *aniState = &ah->curchan->ani; +- u32 ofdm_base = 0; +- u32 cck_base = 0; +- u32 ofdmPhyErrCnt, cckPhyErrCnt; + u32 phyCnt1, phyCnt2; + int32_t listenTime; + +@@ -642,11 +390,6 @@ static bool ath9k_hw_ani_read_counters(s + return false; + } + +- if (!use_new_ani(ah)) { +- ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; +- cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; +- } +- + aniState->listenTime += listenTime; + + ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); +@@ -654,35 +397,12 @@ static bool ath9k_hw_ani_read_counters(s + phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); + phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); + +- if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) { +- if (phyCnt1 < ofdm_base) { +- ath_dbg(common, ANI, +- "phyCnt1 0x%x, resetting counter value to 0x%x\n", +- phyCnt1, ofdm_base); +- REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); +- REG_WRITE(ah, AR_PHY_ERR_MASK_1, +- AR_PHY_ERR_OFDM_TIMING); +- } +- if (phyCnt2 < cck_base) { +- ath_dbg(common, ANI, +- "phyCnt2 0x%x, resetting counter value to 0x%x\n", +- phyCnt2, cck_base); +- REG_WRITE(ah, AR_PHY_ERR_2, cck_base); +- REG_WRITE(ah, AR_PHY_ERR_MASK_2, +- AR_PHY_ERR_CCK_TIMING); +- } +- return false; +- } ++ ah->stats.ast_ani_ofdmerrs += phyCnt1 - aniState->ofdmPhyErrCount; ++ aniState->ofdmPhyErrCount = phyCnt1; ++ ++ ah->stats.ast_ani_cckerrs += phyCnt2 - aniState->cckPhyErrCount; ++ aniState->cckPhyErrCount = phyCnt2; + +- ofdmPhyErrCnt = phyCnt1 - ofdm_base; +- ah->stats.ast_ani_ofdmerrs += +- ofdmPhyErrCnt - aniState->ofdmPhyErrCount; +- aniState->ofdmPhyErrCount = ofdmPhyErrCnt; +- +- cckPhyErrCnt = phyCnt2 - cck_base; +- ah->stats.ast_ani_cckerrs += +- cckPhyErrCnt - aniState->cckPhyErrCount; +- aniState->cckPhyErrCount = cckPhyErrCnt; + return true; + } + +@@ -716,21 +436,10 @@ void ath9k_hw_ani_monitor(struct ath_hw + + if (aniState->listenTime > ah->aniperiod) { + if (cckPhyErrRate < ah->config.cck_trig_low && +- ((ofdmPhyErrRate < ah->config.ofdm_trig_low && +- aniState->ofdmNoiseImmunityLevel < +- ATH9K_ANI_OFDM_DEF_LEVEL) || +- (ofdmPhyErrRate < ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI && +- aniState->ofdmNoiseImmunityLevel >= +- ATH9K_ANI_OFDM_DEF_LEVEL))) { ++ ofdmPhyErrRate < ah->config.ofdm_trig_low) { + ath9k_hw_ani_lower_immunity(ah); + aniState->ofdmsTurn = !aniState->ofdmsTurn; +- } else if ((ofdmPhyErrRate > ah->config.ofdm_trig_high && +- aniState->ofdmNoiseImmunityLevel >= +- ATH9K_ANI_OFDM_DEF_LEVEL) || +- (ofdmPhyErrRate > +- ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI && +- aniState->ofdmNoiseImmunityLevel < +- ATH9K_ANI_OFDM_DEF_LEVEL)) { ++ } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) { + ath9k_hw_ani_ofdm_err_trigger(ah); + aniState->ofdmsTurn = false; + } else if (cckPhyErrRate > ah->config.cck_trig_high) { +@@ -778,49 +487,6 @@ void ath9k_hw_disable_mib_counters(struc + } + EXPORT_SYMBOL(ath9k_hw_disable_mib_counters); + +-/* +- * Process a MIB interrupt. We may potentially be invoked because +- * any of the MIB counters overflow/trigger so don't assume we're +- * here because a PHY error counter triggered. +- */ +-void ath9k_hw_proc_mib_event(struct ath_hw *ah) +-{ +- u32 phyCnt1, phyCnt2; +- +- /* Reset these counters regardless */ +- REG_WRITE(ah, AR_FILT_OFDM, 0); +- REG_WRITE(ah, AR_FILT_CCK, 0); +- if (!(REG_READ(ah, AR_SLP_MIB_CTRL) & AR_SLP_MIB_PENDING)) +- REG_WRITE(ah, AR_SLP_MIB_CTRL, AR_SLP_MIB_CLEAR); +- +- /* Clear the mib counters and save them in the stats */ +- ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); +- +- if (!DO_ANI(ah)) { +- /* +- * We must always clear the interrupt cause by +- * resetting the phy error regs. +- */ +- REG_WRITE(ah, AR_PHY_ERR_1, 0); +- REG_WRITE(ah, AR_PHY_ERR_2, 0); +- return; +- } +- +- /* NB: these are not reset-on-read */ +- phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); +- phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); +- if (((phyCnt1 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK) || +- ((phyCnt2 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK)) { +- +- if (!use_new_ani(ah)) +- ath9k_hw_ani_read_counters(ah); +- +- /* NB: always restart to insure the h/w counters are reset */ +- ath9k_ani_restart(ah); +- } +-} +-EXPORT_SYMBOL(ath9k_hw_proc_mib_event); +- + void ath9k_hw_ani_setup(struct ath_hw *ah) + { + int i; +@@ -845,50 +511,31 @@ void ath9k_hw_ani_init(struct ath_hw *ah + + ath_dbg(common, ANI, "Initialize ANI\n"); + +- if (use_new_ani(ah)) { +- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW; +- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW; ++ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; ++ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; + +- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW; +- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW; +- } else { +- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD; +- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD; +- +- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD; +- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD; +- } ++ ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH; ++ ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW; + + for (i = 0; i < ARRAY_SIZE(ah->channels); i++) { + struct ath9k_channel *chan = &ah->channels[i]; + struct ar5416AniState *ani = &chan->ani; + +- if (use_new_ani(ah)) { +- ani->spurImmunityLevel = +- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; ++ ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; + +- ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; ++ ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; + +- if (AR_SREV_9300_20_OR_LATER(ah)) +- ani->mrcCCKOff = +- !ATH9K_ANI_ENABLE_MRC_CCK; +- else +- ani->mrcCCKOff = true; +- +- ani->ofdmsTurn = true; +- } else { +- ani->spurImmunityLevel = +- ATH9K_ANI_SPUR_IMMUNE_LVL_OLD; +- ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_OLD; ++ if (AR_SREV_9300_20_OR_LATER(ah)) ++ ani->mrcCCKOff = ++ !ATH9K_ANI_ENABLE_MRC_CCK; ++ else ++ ani->mrcCCKOff = true; + +- ani->cckWeakSigThreshold = +- ATH9K_ANI_CCK_WEAK_SIG_THR; +- } ++ ani->ofdmsTurn = true; + + ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; + ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; +- ani->ofdmWeakSigDetectOff = +- !ATH9K_ANI_USE_OFDM_WEAK_SIG; ++ ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; + ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; + ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; + ani->update_ani = false; +@@ -898,13 +545,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah + * since we expect some ongoing maintenance on the tables, let's sanity + * check here default level should not modify INI setting. + */ +- if (use_new_ani(ah)) { +- ah->aniperiod = ATH9K_ANI_PERIOD_NEW; +- ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW; +- } else { +- ah->aniperiod = ATH9K_ANI_PERIOD_OLD; +- ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_OLD; +- } ++ ah->aniperiod = ATH9K_ANI_PERIOD; ++ ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL; + + if (ah->config.enable_ani) + ah->proc_phyerr |= HAL_PROCESS_ANI; +--- a/drivers/net/wireless/ath/ath9k/ani.h ++++ b/drivers/net/wireless/ath/ath9k/ani.h +@@ -24,42 +24,34 @@ + #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi) + + /* units are errors per second */ +-#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500 +-#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW 3500 ++#define ATH9K_ANI_OFDM_TRIG_HIGH 3500 + #define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000 + + /* units are errors per second */ +-#define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200 +-#define ATH9K_ANI_OFDM_TRIG_LOW_NEW 400 ++#define ATH9K_ANI_OFDM_TRIG_LOW 400 + #define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900 + + /* units are errors per second */ +-#define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200 +-#define ATH9K_ANI_CCK_TRIG_HIGH_NEW 600 ++#define ATH9K_ANI_CCK_TRIG_HIGH 600 + + /* units are errors per second */ +-#define ATH9K_ANI_CCK_TRIG_LOW_OLD 100 +-#define ATH9K_ANI_CCK_TRIG_LOW_NEW 300 ++#define ATH9K_ANI_CCK_TRIG_LOW 300 + + #define ATH9K_ANI_NOISE_IMMUNE_LVL 4 + #define ATH9K_ANI_USE_OFDM_WEAK_SIG true + #define ATH9K_ANI_CCK_WEAK_SIG_THR false + +-#define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD 7 +-#define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW 3 ++#define ATH9K_ANI_SPUR_IMMUNE_LVL 3 + +-#define ATH9K_ANI_FIRSTEP_LVL_OLD 0 +-#define ATH9K_ANI_FIRSTEP_LVL_NEW 2 ++#define ATH9K_ANI_FIRSTEP_LVL 2 + + #define ATH9K_ANI_RSSI_THR_HIGH 40 + #define ATH9K_ANI_RSSI_THR_LOW 7 + +-#define ATH9K_ANI_PERIOD_OLD 100 +-#define ATH9K_ANI_PERIOD_NEW 300 ++#define ATH9K_ANI_PERIOD 300 + + /* in ms */ +-#define ATH9K_ANI_POLLINTERVAL_OLD 100 +-#define ATH9K_ANI_POLLINTERVAL_NEW 1000 ++#define ATH9K_ANI_POLLINTERVAL 1000 + + #define HAL_NOISE_IMMUNE_MAX 4 + #define HAL_SPUR_IMMUNE_MAX 7 +@@ -122,13 +114,12 @@ struct ar5416AniState { + u8 mrcCCKOff; + u8 spurImmunityLevel; + u8 firstepLevel; +- u8 ofdmWeakSigDetectOff; ++ u8 ofdmWeakSigDetect; + u8 cckWeakSigThreshold; + bool update_ani; + u32 listenTime; + int32_t rssiThrLow; + int32_t rssiThrHigh; +- u32 noiseFloor; + u32 ofdmPhyErrCount; + u32 cckPhyErrCount; + int16_t pktRssi[2]; +--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c ++++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +@@ -995,141 +995,6 @@ static u32 ar5008_hw_compute_pll_control + return pll; + } + +-static bool ar5008_hw_ani_control_old(struct ath_hw *ah, +- enum ath9k_ani_cmd cmd, +- int param) +-{ +- struct ar5416AniState *aniState = &ah->curchan->ani; +- struct ath_common *common = ath9k_hw_common(ah); +- +- switch (cmd & ah->ani_function) { +- case ATH9K_ANI_NOISE_IMMUNITY_LEVEL:{ +- u32 level = param; +- +- if (level >= ARRAY_SIZE(ah->totalSizeDesired)) { +- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", +- level, ARRAY_SIZE(ah->totalSizeDesired)); +- return false; +- } +- +- REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, +- AR_PHY_DESIRED_SZ_TOT_DES, +- ah->totalSizeDesired[level]); +- REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, +- AR_PHY_AGC_CTL1_COARSE_LOW, +- ah->coarse_low[level]); +- REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, +- AR_PHY_AGC_CTL1_COARSE_HIGH, +- ah->coarse_high[level]); +- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, +- AR_PHY_FIND_SIG_FIRPWR, +- ah->firpwr[level]); +- +- if (level > aniState->noiseImmunityLevel) +- ah->stats.ast_ani_niup++; +- else if (level < aniState->noiseImmunityLevel) +- ah->stats.ast_ani_nidown++; +- aniState->noiseImmunityLevel = level; +- break; +- } +- case ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION:{ +- u32 on = param ? 1 : 0; +- +- if (on) +- REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, +- AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); +- else +- REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, +- AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); +- +- if (!on != aniState->ofdmWeakSigDetectOff) { +- if (on) +- ah->stats.ast_ani_ofdmon++; +- else +- ah->stats.ast_ani_ofdmoff++; +- aniState->ofdmWeakSigDetectOff = !on; +- } +- break; +- } +- case ATH9K_ANI_CCK_WEAK_SIGNAL_THR:{ +- static const int weakSigThrCck[] = { 8, 6 }; +- u32 high = param ? 1 : 0; +- +- REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT, +- AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, +- weakSigThrCck[high]); +- if (high != aniState->cckWeakSigThreshold) { +- if (high) +- ah->stats.ast_ani_cckhigh++; +- else +- ah->stats.ast_ani_ccklow++; +- aniState->cckWeakSigThreshold = high; +- } +- break; +- } +- case ATH9K_ANI_FIRSTEP_LEVEL:{ +- static const int firstep[] = { 0, 4, 8 }; +- u32 level = param; +- +- if (level >= ARRAY_SIZE(firstep)) { +- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", +- level, ARRAY_SIZE(firstep)); +- return false; +- } +- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, +- AR_PHY_FIND_SIG_FIRSTEP, +- firstep[level]); +- if (level > aniState->firstepLevel) +- ah->stats.ast_ani_stepup++; +- else if (level < aniState->firstepLevel) +- ah->stats.ast_ani_stepdown++; +- aniState->firstepLevel = level; +- break; +- } +- case ATH9K_ANI_SPUR_IMMUNITY_LEVEL:{ +- static const int cycpwrThr1[] = { 2, 4, 6, 8, 10, 12, 14, 16 }; +- u32 level = param; +- +- if (level >= ARRAY_SIZE(cycpwrThr1)) { +- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", +- level, ARRAY_SIZE(cycpwrThr1)); +- return false; +- } +- REG_RMW_FIELD(ah, AR_PHY_TIMING5, +- AR_PHY_TIMING5_CYCPWR_THR1, +- cycpwrThr1[level]); +- if (level > aniState->spurImmunityLevel) +- ah->stats.ast_ani_spurup++; +- else if (level < aniState->spurImmunityLevel) +- ah->stats.ast_ani_spurdown++; +- aniState->spurImmunityLevel = level; +- break; +- } +- case ATH9K_ANI_PRESENT: +- break; +- default: +- ath_dbg(common, ANI, "invalid cmd %u\n", cmd); +- return false; +- } +- +- ath_dbg(common, ANI, "ANI parameters:\n"); +- ath_dbg(common, ANI, +- "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n", +- aniState->noiseImmunityLevel, +- aniState->spurImmunityLevel, +- !aniState->ofdmWeakSigDetectOff); +- ath_dbg(common, ANI, +- "cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n", +- aniState->cckWeakSigThreshold, +- aniState->firstepLevel, +- aniState->listenTime); +- ath_dbg(common, ANI, "ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n", +- aniState->ofdmPhyErrCount, +- aniState->cckPhyErrCount); +- +- return true; +-} +- + static bool ar5008_hw_ani_control_new(struct ath_hw *ah, + enum ath9k_ani_cmd cmd, + int param) +@@ -1206,18 +1071,18 @@ static bool ar5008_hw_ani_control_new(st + REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, + AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + +- if (!on != aniState->ofdmWeakSigDetectOff) { ++ if (on != aniState->ofdmWeakSigDetect) { + ath_dbg(common, ANI, + "** ch %d: ofdm weak signal: %s=>%s\n", + chan->channel, +- !aniState->ofdmWeakSigDetectOff ? ++ aniState->ofdmWeakSigDetect ? + "on" : "off", + on ? "on" : "off"); + if (on) + ah->stats.ast_ani_ofdmon++; + else + ah->stats.ast_ani_ofdmoff++; +- aniState->ofdmWeakSigDetectOff = !on; ++ aniState->ofdmWeakSigDetect = on; + } + break; + } +@@ -1236,7 +1101,7 @@ static bool ar5008_hw_ani_control_new(st + * from INI file & cap value + */ + value = firstep_table[level] - +- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + ++ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + + aniState->iniDef.firstep; + if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) + value = ATH9K_SIG_FIRSTEP_SETTING_MIN; +@@ -1251,7 +1116,7 @@ static bool ar5008_hw_ani_control_new(st + * from INI file & cap value + */ + value2 = firstep_table[level] - +- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + ++ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + + aniState->iniDef.firstepLow; + if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) + value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; +@@ -1267,7 +1132,7 @@ static bool ar5008_hw_ani_control_new(st + chan->channel, + aniState->firstepLevel, + level, +- ATH9K_ANI_FIRSTEP_LVL_NEW, ++ ATH9K_ANI_FIRSTEP_LVL, + value, + aniState->iniDef.firstep); + ath_dbg(common, ANI, +@@ -1275,7 +1140,7 @@ static bool ar5008_hw_ani_control_new(st + chan->channel, + aniState->firstepLevel, + level, +- ATH9K_ANI_FIRSTEP_LVL_NEW, ++ ATH9K_ANI_FIRSTEP_LVL, + value2, + aniState->iniDef.firstepLow); + if (level > aniState->firstepLevel) +@@ -1300,7 +1165,7 @@ static bool ar5008_hw_ani_control_new(st + * from INI file & cap value + */ + value = cycpwrThr1_table[level] - +- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + ++ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + + aniState->iniDef.cycpwrThr1; + if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) + value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; +@@ -1316,7 +1181,7 @@ static bool ar5008_hw_ani_control_new(st + * from INI file & cap value + */ + value2 = cycpwrThr1_table[level] - +- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + ++ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + + aniState->iniDef.cycpwrThr1Ext; + if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) + value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; +@@ -1331,7 +1196,7 @@ static bool ar5008_hw_ani_control_new(st + chan->channel, + aniState->spurImmunityLevel, + level, +- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, ++ ATH9K_ANI_SPUR_IMMUNE_LVL, + value, + aniState->iniDef.cycpwrThr1); + ath_dbg(common, ANI, +@@ -1339,7 +1204,7 @@ static bool ar5008_hw_ani_control_new(st + chan->channel, + aniState->spurImmunityLevel, + level, +- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, ++ ATH9K_ANI_SPUR_IMMUNE_LVL, + value2, + aniState->iniDef.cycpwrThr1Ext); + if (level > aniState->spurImmunityLevel) +@@ -1367,7 +1232,7 @@ static bool ar5008_hw_ani_control_new(st + ath_dbg(common, ANI, + "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", + aniState->spurImmunityLevel, +- !aniState->ofdmWeakSigDetectOff ? "on" : "off", ++ aniState->ofdmWeakSigDetect ? "on" : "off", + aniState->firstepLevel, + !aniState->mrcCCKOff ? "on" : "off", + aniState->listenTime, +@@ -1454,9 +1319,9 @@ static void ar5008_hw_ani_cache_ini_regs + AR_PHY_EXT_TIMING5_CYCPWR_THR1); + + /* these levels just got reset to defaults by the INI */ +- aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; +- aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; +- aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; ++ aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; ++ aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; ++ aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; + aniState->mrcCCKOff = true; /* not available on pre AR9003 */ + } + +@@ -1545,11 +1410,8 @@ void ar5008_hw_attach_phy_ops(struct ath + priv_ops->do_getnf = ar5008_hw_do_getnf; + priv_ops->set_radar_params = ar5008_hw_set_radar_params; + +- if (modparam_force_new_ani) { +- priv_ops->ani_control = ar5008_hw_ani_control_new; +- priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; +- } else +- priv_ops->ani_control = ar5008_hw_ani_control_old; ++ priv_ops->ani_control = ar5008_hw_ani_control_new; ++ priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; + + if (AR_SREV_9100(ah) || AR_SREV_9160_10_OR_LATER(ah)) + priv_ops->compute_pll_control = ar9160_hw_compute_pll_control; +--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c ++++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c +@@ -21,10 +21,6 @@ + #include "ar9002_initvals.h" + #include "ar9002_phy.h" + +-int modparam_force_new_ani; +-module_param_named(force_new_ani, modparam_force_new_ani, int, 0444); +-MODULE_PARM_DESC(force_new_ani, "Force new ANI for AR5008, AR9001, AR9002"); +- + /* General hardware code for the A5008/AR9001/AR9002 hadware families */ + + static void ar9002_hw_init_mode_regs(struct ath_hw *ah) +--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c +@@ -825,18 +825,18 @@ static bool ar9003_hw_ani_control(struct + REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, + AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + +- if (!on != aniState->ofdmWeakSigDetectOff) { ++ if (on != aniState->ofdmWeakSigDetect) { + ath_dbg(common, ANI, + "** ch %d: ofdm weak signal: %s=>%s\n", + chan->channel, +- !aniState->ofdmWeakSigDetectOff ? ++ aniState->ofdmWeakSigDetect ? + "on" : "off", + on ? "on" : "off"); + if (on) + ah->stats.ast_ani_ofdmon++; + else + ah->stats.ast_ani_ofdmoff++; +- aniState->ofdmWeakSigDetectOff = !on; ++ aniState->ofdmWeakSigDetect = on; + } + break; + } +@@ -855,7 +855,7 @@ static bool ar9003_hw_ani_control(struct + * from INI file & cap value + */ + value = firstep_table[level] - +- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + ++ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + + aniState->iniDef.firstep; + if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) + value = ATH9K_SIG_FIRSTEP_SETTING_MIN; +@@ -870,7 +870,7 @@ static bool ar9003_hw_ani_control(struct + * from INI file & cap value + */ + value2 = firstep_table[level] - +- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + ++ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + + aniState->iniDef.firstepLow; + if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) + value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; +@@ -886,7 +886,7 @@ static bool ar9003_hw_ani_control(struct + chan->channel, + aniState->firstepLevel, + level, +- ATH9K_ANI_FIRSTEP_LVL_NEW, ++ ATH9K_ANI_FIRSTEP_LVL, + value, + aniState->iniDef.firstep); + ath_dbg(common, ANI, +@@ -894,7 +894,7 @@ static bool ar9003_hw_ani_control(struct + chan->channel, + aniState->firstepLevel, + level, +- ATH9K_ANI_FIRSTEP_LVL_NEW, ++ ATH9K_ANI_FIRSTEP_LVL, + value2, + aniState->iniDef.firstepLow); + if (level > aniState->firstepLevel) +@@ -919,7 +919,7 @@ static bool ar9003_hw_ani_control(struct + * from INI file & cap value + */ + value = cycpwrThr1_table[level] - +- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + ++ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + + aniState->iniDef.cycpwrThr1; + if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) + value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; +@@ -935,7 +935,7 @@ static bool ar9003_hw_ani_control(struct + * from INI file & cap value + */ + value2 = cycpwrThr1_table[level] - +- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + ++ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + + aniState->iniDef.cycpwrThr1Ext; + if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) + value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; +@@ -950,7 +950,7 @@ static bool ar9003_hw_ani_control(struct + chan->channel, + aniState->spurImmunityLevel, + level, +- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, ++ ATH9K_ANI_SPUR_IMMUNE_LVL, + value, + aniState->iniDef.cycpwrThr1); + ath_dbg(common, ANI, +@@ -958,7 +958,7 @@ static bool ar9003_hw_ani_control(struct + chan->channel, + aniState->spurImmunityLevel, + level, +- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, ++ ATH9K_ANI_SPUR_IMMUNE_LVL, + value2, + aniState->iniDef.cycpwrThr1Ext); + if (level > aniState->spurImmunityLevel) +@@ -1002,7 +1002,7 @@ static bool ar9003_hw_ani_control(struct + ath_dbg(common, ANI, + "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", + aniState->spurImmunityLevel, +- !aniState->ofdmWeakSigDetectOff ? "on" : "off", ++ aniState->ofdmWeakSigDetect ? "on" : "off", + aniState->firstepLevel, + !aniState->mrcCCKOff ? "on" : "off", + aniState->listenTime, +@@ -1111,9 +1111,9 @@ static void ar9003_hw_ani_cache_ini_regs + AR_PHY_EXT_CYCPWR_THR1); + + /* these levels just got reset to defaults by the INI */ +- aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; +- aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; +- aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; ++ aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; ++ aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; ++ aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; + aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; + } + +--- a/drivers/net/wireless/ath/ath9k/debug.c ++++ b/drivers/net/wireless/ath/ath9k/debug.c +@@ -348,8 +348,6 @@ void ath_debug_stat_interrupt(struct ath + sc->debug.stats.istats.txok++; + if (status & ATH9K_INT_TXURN) + sc->debug.stats.istats.txurn++; +- if (status & ATH9K_INT_MIB) +- sc->debug.stats.istats.mib++; + if (status & ATH9K_INT_RXPHY) + sc->debug.stats.istats.rxphyerr++; + if (status & ATH9K_INT_RXKCM) +--- a/drivers/net/wireless/ath/ath9k/hw.h ++++ b/drivers/net/wireless/ath/ath9k/hw.h +@@ -1019,16 +1019,8 @@ void ar9002_hw_attach_ops(struct ath_hw + void ar9003_hw_attach_ops(struct ath_hw *ah); + + void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan); +-/* +- * ANI work can be shared between all families but a next +- * generation implementation of ANI will be used only for AR9003 only +- * for now as the other families still need to be tested with the same +- * next generation ANI. Feel free to start testing it though for the +- * older families (AR5008, AR9001, AR9002) by using modparam_force_new_ani. +- */ +-extern int modparam_force_new_ani; ++ + void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning); +-void ath9k_hw_proc_mib_event(struct ath_hw *ah); + void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); + + #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -516,24 +516,6 @@ irqreturn_t ath_isr(int irq, void *dev) + ath9k_hw_set_interrupts(ah); + } + +- if (status & ATH9K_INT_MIB) { +- /* +- * Disable interrupts until we service the MIB +- * interrupt; otherwise it will continue to +- * fire. +- */ +- ath9k_hw_disable_interrupts(ah); +- /* +- * Let the hal handle the event. We assume +- * it will clear whatever condition caused +- * the interrupt. +- */ +- spin_lock(&common->cc_lock); +- ath9k_hw_proc_mib_event(ah); +- spin_unlock(&common->cc_lock); +- ath9k_hw_enable_interrupts(ah); +- } +- + if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) + if (status & ATH9K_INT_TIM_TIMER) { + if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) +@@ -959,14 +941,10 @@ static void ath9k_calculate_summary_stat + /* + * Enable MIB interrupts when there are hardware phy counters. + */ +- if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) { +- if (ah->config.enable_ani) +- ah->imask |= ATH9K_INT_MIB; ++ if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) + ah->imask |= ATH9K_INT_TSFOOR; +- } else { +- ah->imask &= ~ATH9K_INT_MIB; ++ else + ah->imask &= ~ATH9K_INT_TSFOOR; +- } + + ath9k_hw_set_interrupts(ah); --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c -@@ -145,15 +145,20 @@ static void sta_rx_agg_session_timer_exp - struct tid_ampdu_rx *tid_rx; - unsigned long timeout; - -+ rcu_read_lock(); - tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[*ptid]); -- if (!tid_rx) -+ if (!tid_rx) { -+ rcu_read_unlock(); - return; -+ } - - timeout = tid_rx->last_rx + TU_TO_JIFFIES(tid_rx->timeout); - if (time_is_after_jiffies(timeout)) { - mod_timer(&tid_rx->session_timer, timeout); -+ rcu_read_unlock(); - return; - } -+ rcu_read_unlock(); - - #ifdef CONFIG_MAC80211_HT_DEBUG - printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid); -@@ -200,6 +205,8 @@ static void ieee80211_send_addba_resp(st +@@ -201,6 +201,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); @@ -78,7 +1236,7 @@ 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); -@@ -490,6 +491,7 @@ int ieee80211_start_tx_ba_session(struct +@@ -456,6 +457,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 && @@ -141,7 +1299,7 @@ /* * set_multicast_list will be invoked by the networking core * which will check whether any increments here were done in -@@ -642,6 +619,8 @@ static void ieee80211_do_stop(struct iee +@@ -639,6 +616,8 @@ static void ieee80211_do_stop(struct iee ieee80211_configure_filter(local); break; default: @@ -150,7 +1308,7 @@ flush_work(&sdata->work); /* * When we get here, the interface is marked down. -@@ -848,6 +827,72 @@ static void ieee80211_if_setup(struct ne +@@ -845,6 +824,72 @@ static void ieee80211_if_setup(struct ne dev->destructor = free_netdev; } @@ -223,7 +1381,7 @@ static void ieee80211_iface_work(struct work_struct *work) { struct ieee80211_sub_if_data *sdata = -@@ -952,6 +997,9 @@ static void ieee80211_iface_work(struct +@@ -949,6 +994,9 @@ static void ieee80211_iface_work(struct break; ieee80211_mesh_rx_queued_mgmt(sdata, skb); break; @@ -235,7 +1393,7 @@ break; --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2284,6 +2284,7 @@ ieee80211_rx_h_action(struct ieee80211_r +@@ -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 && @@ -243,7 +1401,7 @@ sdata->vif.type != NL80211_IFTYPE_ADHOC) break; -@@ -2498,14 +2499,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ +@@ -2495,14 +2496,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ if (!ieee80211_vif_is_mesh(&sdata->vif) && sdata->vif.type != NL80211_IFTYPE_ADHOC && @@ -261,13 +1419,13 @@ break; case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP): case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP): -@@ -2839,10 +2841,16 @@ static int prepare_for_handlers(struct i +@@ -2833,10 +2835,16 @@ static int prepare_for_handlers(struct i } break; case NL80211_IFTYPE_WDS: - if (bssid || !ieee80211_is_data(hdr->frame_control)) - return 0; - if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) + if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2)) return 0; + + if (ieee80211_is_data(hdr->frame_control) || @@ -298,238 +1456,13 @@ WLAN_STA_CLEAR_PS_FILT, WLAN_STA_MFP, WLAN_STA_BLOCK_BA, ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -804,7 +804,7 @@ void ieee80211_set_wmm_default(struct ie - struct ieee80211_local *local = sdata->local; - struct ieee80211_tx_queue_params qparam; - int ac; -- bool use_11b; -+ bool use_11b, enable_qos; - int aCWmin, aCWmax; - - if (!local->ops->conf_tx) -@@ -818,6 +818,13 @@ void ieee80211_set_wmm_default(struct ie - use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) && - !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE); - -+ /* -+ * By default disable QoS in STA mode for old access points, which do -+ * not support 802.11e. New APs will provide proper queue parameters, -+ * that we will configure later. -+ */ -+ enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION); -+ - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { - /* Set defaults according to 802.11-2007 Table 7-37 */ - aCWmax = 1023; -@@ -826,38 +833,47 @@ void ieee80211_set_wmm_default(struct ie - else - aCWmin = 15; - -- switch (ac) { -- case IEEE80211_AC_BK: -- qparam.cw_max = aCWmax; -- qparam.cw_min = aCWmin; -- qparam.txop = 0; -- qparam.aifs = 7; -- break; -- default: /* never happens but let's not leave undefined */ -- case IEEE80211_AC_BE: -+ if (enable_qos) { -+ switch (ac) { -+ case IEEE80211_AC_BK: -+ qparam.cw_max = aCWmax; -+ qparam.cw_min = aCWmin; -+ qparam.txop = 0; -+ qparam.aifs = 7; -+ break; -+ /* never happens but let's not leave undefined */ -+ default: -+ case IEEE80211_AC_BE: -+ qparam.cw_max = aCWmax; -+ qparam.cw_min = aCWmin; -+ qparam.txop = 0; -+ qparam.aifs = 3; -+ break; -+ case IEEE80211_AC_VI: -+ qparam.cw_max = aCWmin; -+ qparam.cw_min = (aCWmin + 1) / 2 - 1; -+ if (use_11b) -+ qparam.txop = 6016/32; -+ else -+ qparam.txop = 3008/32; -+ qparam.aifs = 2; -+ break; -+ case IEEE80211_AC_VO: -+ qparam.cw_max = (aCWmin + 1) / 2 - 1; -+ qparam.cw_min = (aCWmin + 1) / 4 - 1; -+ if (use_11b) -+ qparam.txop = 3264/32; -+ else -+ qparam.txop = 1504/32; -+ qparam.aifs = 2; -+ break; -+ } -+ } else { -+ /* Confiure old 802.11b/g medium access rules. */ - qparam.cw_max = aCWmax; - qparam.cw_min = aCWmin; - qparam.txop = 0; -- qparam.aifs = 3; -- break; -- case IEEE80211_AC_VI: -- qparam.cw_max = aCWmin; -- qparam.cw_min = (aCWmin + 1) / 2 - 1; -- if (use_11b) -- qparam.txop = 6016/32; -- else -- qparam.txop = 3008/32; - qparam.aifs = 2; -- break; -- case IEEE80211_AC_VO: -- qparam.cw_max = (aCWmin + 1) / 2 - 1; -- qparam.cw_min = (aCWmin + 1) / 4 - 1; -- if (use_11b) -- qparam.txop = 3264/32; -- else -- qparam.txop = 1504/32; -- qparam.aifs = 2; -- break; - } - - qparam.uapsd = false; -@@ -866,12 +882,8 @@ void ieee80211_set_wmm_default(struct ie - drv_conf_tx(local, sdata, ac, &qparam); - } - -- /* after reinitialize QoS TX queues setting to default, -- * disable QoS at all */ -- - if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { -- sdata->vif.bss_conf.qos = -- sdata->vif.type != NL80211_IFTYPE_STATION; -+ sdata->vif.bss_conf.qos = enable_qos; - if (bss_notify) - ieee80211_bss_info_change_notify(sdata, - BSS_CHANGED_QOS); ---- a/drivers/net/wireless/ath/ath9k/beacon.c -+++ b/drivers/net/wireless/ath/ath9k/beacon.c -@@ -48,7 +48,10 @@ int ath_beaconq_config(struct ath_softc - txq = sc->tx.txq_map[WME_AC_BE]; - ath9k_hw_get_txq_props(ah, txq->axq_qnum, &qi_be); - qi.tqi_aifs = qi_be.tqi_aifs; -- qi.tqi_cwmin = 4*qi_be.tqi_cwmin; -+ if (ah->slottime == ATH9K_SLOT_TIME_20) -+ qi.tqi_cwmin = 2*qi_be.tqi_cwmin; -+ else -+ qi.tqi_cwmin = 4*qi_be.tqi_cwmin; - qi.tqi_cwmax = qi_be.tqi_cwmax; - } - ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -1220,6 +1220,22 @@ static void ieee80211_sta_wmm_params(str - sdata->vif.bss_conf.qos = true; - } - -+static void __ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) -+{ -+ lockdep_assert_held(&sdata->local->mtx); -+ -+ sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | -+ IEEE80211_STA_BEACON_POLL); -+ ieee80211_run_deferred_scan(sdata->local); -+} -+ -+static void ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) -+{ -+ mutex_lock(&sdata->local->mtx); -+ __ieee80211_stop_poll(sdata); -+ mutex_unlock(&sdata->local->mtx); -+} -+ - static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, - u16 capab, bool erp_valid, u8 erp) - { -@@ -1285,8 +1301,7 @@ static void ieee80211_set_associated(str - sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE; - - /* just to be sure */ -- sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | -- IEEE80211_STA_BEACON_POLL); -+ ieee80211_stop_poll(sdata); - - ieee80211_led_assoc(local, 1); - -@@ -1456,8 +1471,7 @@ static void ieee80211_reset_ap_probe(str - return; - } - -- ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL | -- IEEE80211_STA_BEACON_POLL); -+ __ieee80211_stop_poll(sdata); - - mutex_lock(&local->iflist_mtx); - ieee80211_recalc_ps(local, -1); -@@ -1477,7 +1491,6 @@ static void ieee80211_reset_ap_probe(str - round_jiffies_up(jiffies + - IEEE80211_CONNECTION_IDLE_TIME)); - out: -- ieee80211_run_deferred_scan(local); - mutex_unlock(&local->mtx); - } - -@@ -2413,7 +2426,11 @@ static void ieee80211_rx_mgmt_beacon(str - "to a received beacon\n", sdata->name); - } - #endif -+ mutex_lock(&local->mtx); - ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; -+ ieee80211_run_deferred_scan(local); -+ mutex_unlock(&local->mtx); -+ - mutex_lock(&local->iflist_mtx); - ieee80211_recalc_ps(local, -1); - mutex_unlock(&local->iflist_mtx); -@@ -2600,8 +2617,7 @@ static void ieee80211_sta_connection_los - struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; - u8 frame_buf[DEAUTH_DISASSOC_LEN]; - -- ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL | -- IEEE80211_STA_BEACON_POLL); -+ ieee80211_stop_poll(sdata); - - ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, - false, frame_buf); -@@ -2879,8 +2895,7 @@ static void ieee80211_restart_sta_timer( - u32 flags; - - if (sdata->vif.type == NL80211_IFTYPE_STATION) { -- sdata->u.mgd.flags &= ~(IEEE80211_STA_BEACON_POLL | -- IEEE80211_STA_CONNECTION_POLL); -+ __ieee80211_stop_poll(sdata); - - /* let's probe the connection once */ - flags = sdata->local->hw.flags; -@@ -2949,7 +2964,10 @@ void ieee80211_sta_restart(struct ieee80 - if (test_and_clear_bit(TMR_RUNNING_CHANSW, &ifmgd->timers_running)) - add_timer(&ifmgd->chswitch_timer); - ieee80211_sta_reset_beacon_monitor(sdata); -+ -+ mutex_lock(&sdata->local->mtx); - ieee80211_restart_sta_timer(sdata); -+ mutex_unlock(&sdata->local->mtx); - } - #endif - --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -214,6 +214,7 @@ struct ath_frame_info { enum ath9k_key_type keytype; u8 keyix; u8 retries; -+ bool short_preamble; ++ u8 rtscts_rate; }; struct ath_buf_state { @@ -543,33 +1476,71 @@ int i; u8 rix = 0; -@@ -957,8 +958,7 @@ static void ath_buf_set_rate(struct ath_ - rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); - info->rtscts_rate = rate->hw_value; +@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_ + /* set dur_update_en for l-sig computation except for PS-Poll frames */ + info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); +- +- /* +- * We check if Short Preamble is needed for the CTS rate by +- * checking the BSS's global flag. +- * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. +- */ +- rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); +- info->rtscts_rate = rate->hw_value; +- - if (tx_info->control.vif && - tx_info->control.vif->bss_conf.use_short_preamble) -+ if (fi->short_preamble) - info->rtscts_rate |= rate->hw_value_short; +- info->rtscts_rate |= rate->hw_value_short; ++ info->rtscts_rate = fi->rtscts_rate; for (i = 0; i < 4; i++) { -@@ -1779,6 +1779,11 @@ static void setup_frame_info(struct ieee + bool is_40, is_sgi, is_sp; +@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_ + } + + /* legacy rates */ ++ rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; + if ((tx_info->band == IEEE80211_BAND_2GHZ) && + !(rate->flags & IEEE80211_RATE_ERP_G)) + phy = WLAN_RC_PHY_CCK; + else + phy = WLAN_RC_PHY_OFDM; + +- rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; + info->rates[i].Rate = rate->hw_value; + if (rate->hw_value_short) { + if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) +@@ -1776,10 +1766,22 @@ static void setup_frame_info(struct ieee + struct ieee80211_sta *sta = tx_info->control.sta; + struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; ++ const struct ieee80211_rate *rate; struct ath_frame_info *fi = get_frame_info(skb); struct ath_node *an = NULL; enum ath9k_key_type keytype; + bool short_preamble = false; + ++ /* ++ * We check if Short Preamble is needed for the CTS rate by ++ * checking the BSS's global flag. ++ * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. ++ */ + if (tx_info->control.vif && + tx_info->control.vif->bss_conf.use_short_preamble) + short_preamble = true; ++ rate = ieee80211_get_rts_cts_rate(hw, tx_info); keytype = ath9k_cmn_get_hw_crypto_keytype(skb); -@@ -1794,6 +1799,7 @@ static void setup_frame_info(struct ieee + if (sta) +@@ -1794,6 +1796,9 @@ static void setup_frame_info(struct ieee fi->keyix = ATH9K_TXKEYIX_INVALID; fi->keytype = keytype; fi->framelen = framelen; -+ fi->short_preamble = short_preamble; ++ fi->rtscts_rate = rate->hw_value; ++ if (short_preamble) ++ fi->rtscts_rate |= rate->hw_value_short; } u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) diff --git a/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch b/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch index c78b51a25..7c59e1f10 100644 --- a/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch +++ b/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch @@ -8,7 +8,7 @@ #include #include "hw.h" -@@ -531,8 +532,16 @@ static int ath9k_hw_init_macaddr(struct +@@ -523,8 +524,16 @@ static int ath9k_hw_init_macaddr(struct common->macaddr[2 * i] = eeval >> 8; common->macaddr[2 * i + 1] = eeval & 0xff; } 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 0a5f6944f..9834f1e54 100644 --- a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +++ b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch @@ -1,40 +1,6 @@ ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1443,15 +1443,6 @@ static int ath9k_add_interface(struct ie - } - } - -- if ((ah->opmode == NL80211_IFTYPE_ADHOC) || -- ((vif->type == NL80211_IFTYPE_ADHOC) && -- sc->nvifs > 0)) { -- ath_err(common, "Cannot create ADHOC interface when other" -- " interfaces already exist.\n"); -- ret = -EINVAL; -- goto out; -- } -- - ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); - - sc->nvifs++; -@@ -1476,15 +1467,6 @@ static int ath9k_change_interface(struct - mutex_lock(&sc->mutex); - ath9k_ps_wakeup(sc); - -- /* See if new interface type is valid. */ -- if ((new_type == NL80211_IFTYPE_ADHOC) && -- (sc->nvifs > 1)) { -- ath_err(common, "When using ADHOC, it must be the only" -- " interface.\n"); -- ret = -EINVAL; -- goto out; -- } -- - if (ath9k_uses_beacons(new_type) && - !ath9k_uses_beacons(vif->type)) { - if (sc->nbcnvifs >= ATH_BCBUF) { --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -656,6 +656,7 @@ static const struct ieee80211_iface_limi +@@ -666,6 +666,7 @@ static const struct ieee80211_iface_limi #ifdef CONFIG_MAC80211_MESH BIT(NL80211_IFTYPE_MESH_POINT) | #endif diff --git a/package/mac80211/patches/412-mac80211_allow_adhoc_and_ap.patch b/package/mac80211/patches/412-mac80211_allow_adhoc_and_ap.patch index 6f30be5b9..2f23096c6 100644 --- a/package/mac80211/patches/412-mac80211_allow_adhoc_and_ap.patch +++ b/package/mac80211/patches/412-mac80211_allow_adhoc_and_ap.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -771,17 +771,11 @@ int ieee80211_register_hw(struct ieee802 +@@ -776,17 +776,11 @@ int ieee80211_register_hw(struct ieee802 */ for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { const struct ieee80211_iface_combination *c; diff --git a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch index 49e80ca3e..ed50ea4e1 100644 --- a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch +++ b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1532,6 +1532,53 @@ static const struct file_operations fops +@@ -1533,6 +1533,53 @@ static const struct file_operations fops #endif @@ -54,7 +54,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1595,5 +1642,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1596,5 +1643,8 @@ 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/501-ath9k-eeprom_endianess.patch b/package/mac80211/patches/501-ath9k-eeprom_endianess.patch index 4571fe261..710ca7bad 100644 --- a/package/mac80211/patches/501-ath9k-eeprom_endianess.patch +++ b/package/mac80211/patches/501-ath9k-eeprom_endianess.patch @@ -81,7 +81,7 @@ struct ath_ops reg_ops; --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -535,6 +535,8 @@ static int ath9k_init_softc(u16 devid, s +@@ -536,6 +536,8 @@ static int ath9k_init_softc(u16 devid, s ah->is_clk_25mhz = pdata->is_clk_25mhz; ah->get_mac_revision = pdata->get_mac_revision; ah->external_reset = pdata->external_reset; diff --git a/package/mac80211/patches/502-ath9k_ahb_init.patch b/package/mac80211/patches/502-ath9k_ahb_init.patch index d2e7331a0..e819d5213 100644 --- a/package/mac80211/patches/502-ath9k_ahb_init.patch +++ b/package/mac80211/patches/502-ath9k_ahb_init.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -905,23 +905,23 @@ static int __init ath9k_init(void) +@@ -907,23 +907,23 @@ static int __init ath9k_init(void) goto err_out; } diff --git a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch index 429d44318..9ff77812e 100644 --- a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch +++ b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch @@ -1,7 +1,7 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1939,8 +1939,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st - REG_WRITE(ah, AR_OBS, 8); +@@ -1928,8 +1928,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st + REG_WRITE(ah, AR_OBS, 8); if (ah->config.rx_intr_mitigation) { - REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500); diff --git a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch index 6410a6e2b..7feed482b 100644 --- a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch +++ b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -621,6 +621,7 @@ struct ath_softc { +@@ -641,6 +641,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; @@ -8,7 +8,7 @@ struct survey_info *cur_survey; struct survey_info survey[ATH9K_NUM_CHANNELS]; -@@ -688,6 +689,7 @@ struct ath_softc { +@@ -709,6 +710,7 @@ struct ath_softc { struct dfs_pattern_detector *dfs_detector; }; @@ -18,7 +18,7 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1579,6 +1579,50 @@ static const struct file_operations fops +@@ -1580,6 +1580,50 @@ static const struct file_operations fops .owner = THIS_MODULE }; @@ -69,7 +69,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1645,5 +1689,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1646,5 +1690,8 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_eeprom); @@ -80,7 +80,7 @@ } --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1551,7 +1551,7 @@ static void ath9k_disable_ps(struct ath_ +@@ -1122,7 +1122,7 @@ static void ath9k_disable_ps(struct ath_ ath_dbg(common, PS, "PowerSave disabled\n"); } @@ -89,7 +89,7 @@ { struct ath_softc *sc = hw->priv; struct ath_hw *ah = sc->sc_ah; -@@ -1602,9 +1602,11 @@ static int ath9k_config(struct ieee80211 +@@ -1173,9 +1173,11 @@ static int ath9k_config(struct ieee80211 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { struct ieee80211_channel *curchan = hw->conf.channel; @@ -101,7 +101,7 @@ if (ah->curchan) old_pos = ah->curchan - &ah->channels[0]; -@@ -1652,7 +1654,23 @@ static int ath9k_config(struct ieee80211 +@@ -1218,7 +1220,23 @@ static int ath9k_config(struct ieee80211 memset(&sc->survey[pos], 0, sizeof(struct survey_info)); } @@ -125,4 +125,4 @@ + if (ath_set_channel(sc, hw, hchan) < 0) { ath_err(common, "Unable to set channel\n"); mutex_unlock(&sc->mutex); - return -EINVAL; + ath9k_ps_restore(sc); diff --git a/package/mac80211/patches/513-mac80211_reduce_txqueuelen.patch b/package/mac80211/patches/513-mac80211_reduce_txqueuelen.patch index c18a146c3..11f0215f8 100644 --- a/package/mac80211/patches/513-mac80211_reduce_txqueuelen.patch +++ b/package/mac80211/patches/513-mac80211_reduce_txqueuelen.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -817,6 +817,7 @@ static const struct net_device_ops ieee8 +@@ -814,6 +814,7 @@ static const struct net_device_ops ieee8 static void ieee80211_if_setup(struct net_device *dev) { ether_setup(dev); diff --git a/package/mac80211/patches/520-mac80211_cur_txpower.patch b/package/mac80211/patches/520-mac80211_cur_txpower.patch index e8893fb50..9bb2ce8ae 100644 --- a/package/mac80211/patches/520-mac80211_cur_txpower.patch +++ b/package/mac80211/patches/520-mac80211_cur_txpower.patch @@ -11,7 +11,7 @@ u16 listen_interval; --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1936,7 +1936,7 @@ static int ieee80211_get_tx_power(struct +@@ -1940,7 +1940,7 @@ static int ieee80211_get_tx_power(struct { struct ieee80211_local *local = wiphy_priv(wiphy); diff --git a/package/mac80211/patches/521-ath9k_cur_txpower.patch b/package/mac80211/patches/521-ath9k_cur_txpower.patch index 24437accd..f5d359bb2 100644 --- a/package/mac80211/patches/521-ath9k_cur_txpower.patch +++ b/package/mac80211/patches/521-ath9k_cur_txpower.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1676,6 +1676,8 @@ int ath9k_config(struct ieee80211_hw *hw +@@ -1243,6 +1243,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 -@@ -1690,6 +1692,7 @@ int ath9k_config(struct ieee80211_hw *hw +@@ -1257,6 +1259,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/522-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch index 7aa72ab58..40f4e62c7 100644 --- a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch +++ b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch @@ -23,7 +23,7 @@ int antenna; --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -320,6 +320,11 @@ struct sta_info { +@@ -325,6 +325,11 @@ struct sta_info { unsigned long rx_dropped; int last_signal; struct ewma avg_signal; @@ -78,7 +78,7 @@ kfree(sta); --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -522,6 +522,8 @@ struct station_parameters { +@@ -527,6 +527,8 @@ struct station_parameters { * @STATION_INFO_STA_FLAGS: @sta_flags filled * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled * @STATION_INFO_T_OFFSET: @t_offset filled @@ -87,7 +87,7 @@ */ enum station_info_flags { STATION_INFO_INACTIVE_TIME = 1<<0, -@@ -545,6 +547,8 @@ enum station_info_flags { +@@ -550,6 +552,8 @@ enum station_info_flags { STATION_INFO_STA_FLAGS = 1<<18, STATION_INFO_BEACON_LOSS_COUNT = 1<<19, STATION_INFO_T_OFFSET = 1<<20, @@ -96,7 +96,7 @@ }; /** -@@ -626,6 +630,9 @@ struct sta_bss_parameters { +@@ -631,6 +635,9 @@ struct sta_bss_parameters { NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. * @signal_avg: avg signal strength, type depends on the wiphy's signal_type NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. @@ -106,7 +106,7 @@ * @txrate: current unicast bitrate from this station * @rxrate: current unicast bitrate to this station * @rx_packets: packets received from this station -@@ -658,6 +665,11 @@ struct station_info { +@@ -663,6 +670,11 @@ struct station_info { u8 plink_state; s8 signal; s8 signal_avg; @@ -137,7 +137,7 @@ u8 rs_num_delims; --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -988,6 +988,7 @@ static int ath9k_rx_skb_preprocess(struc +@@ -951,6 +951,7 @@ static int ath9k_rx_skb_preprocess(struc bool *decrypt_error) { struct ath_hw *ah = common->ah; @@ -145,7 +145,7 @@ /* * everything but the rate is checked here, the rate check is done -@@ -1013,6 +1014,20 @@ static int ath9k_rx_skb_preprocess(struc +@@ -976,6 +977,20 @@ static int ath9k_rx_skb_preprocess(struc if (rx_stats->rs_moreaggr) rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; @@ -166,28 +166,9 @@ return 0; } -@@ -1543,14 +1558,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; -- int main_rssi = rs->rs_rssi_ctl0; -- int alt_rssi = rs->rs_rssi_ctl1; -+ int main_rssi = rs->rs_rssi_ctl[0]; -+ int alt_rssi = rs->rs_rssi_ctl[1]; - int rx_ant_conf, main_ant_conf; - bool short_scan = false; - -- rx_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_CURRENT_SHIFT) & -+ rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) & - ATH_ANT_RX_MASK; -- main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) & -+ main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) & - ATH_ANT_RX_MASK; - - /* 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 -@@ -455,12 +455,12 @@ int ath9k_hw_process_rxdesc_edma(struct +@@ -458,12 +458,12 @@ int ath9k_hw_process_rxdesc_edma(struct /* XXX: Keycache */ rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined); @@ -248,7 +229,7 @@ if (ads.ds_rxstatus8 & AR_RxKeyIdxValid) --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -997,12 +997,12 @@ void ath_debug_stat_rx(struct ath_softc +@@ -998,12 +998,12 @@ void ath_debug_stat_rx(struct ath_softc #ifdef CONFIG_ATH9K_MAC_DEBUG spin_lock(&sc->debug.samp_lock); RX_SAMP_DBG(jiffies) = jiffies; @@ -269,7 +250,7 @@ RX_SAMP_DBG(rate) = rs->rs_rate; --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h -@@ -1695,6 +1695,8 @@ enum nl80211_sta_bss_param { +@@ -1699,6 +1699,8 @@ enum nl80211_sta_bss_param { * @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_T_OFFSET: timing offset with respect to this STA (s64) @@ -278,7 +259,7 @@ * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ -@@ -1719,6 +1721,8 @@ enum nl80211_sta_info { +@@ -1723,6 +1725,8 @@ enum nl80211_sta_info { NL80211_STA_INFO_STA_FLAGS, NL80211_STA_INFO_BEACON_LOSS, NL80211_STA_INFO_T_OFFSET, @@ -289,7 +270,7 @@ __NL80211_STA_INFO_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -2467,6 +2467,33 @@ nla_put_failure: +@@ -2523,6 +2523,33 @@ nla_put_failure: return false; } @@ -323,7 +304,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, int flags, struct cfg80211_registered_device *rdev, -@@ -2528,6 +2555,18 @@ static int nl80211_send_station(struct s +@@ -2584,6 +2611,18 @@ static int nl80211_send_station(struct s default: break; } @@ -370,3 +351,37 @@ sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate); +--- a/drivers/net/wireless/ath/ath9k/dfs.c ++++ b/drivers/net/wireless/ath/ath9k/dfs.c +@@ -164,8 +164,8 @@ void ath9k_dfs_process_phyerr(struct ath + return; + } + +- ard.rssi = rs->rs_rssi_ctl0; +- ard.ext_rssi = rs->rs_rssi_ext0; ++ ard.rssi = rs->rs_rssi_ctl[0]; ++ ard.ext_rssi = rs->rs_rssi_ext[0]; + + /* + * hardware stores this as 8 bit signed value. +--- a/drivers/net/wireless/ath/ath9k/antenna.c ++++ b/drivers/net/wireless/ath/ath9k/antenna.c +@@ -529,14 +529,14 @@ void ath_ant_comb_scan(struct ath_softc + 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; +- int main_rssi = rs->rs_rssi_ctl0; +- int alt_rssi = rs->rs_rssi_ctl1; ++ int main_rssi = rs->rs_rssi_ctl[0]; ++ int alt_rssi = rs->rs_rssi_ctl[1]; + int rx_ant_conf, main_ant_conf; + bool short_scan = false; + +- rx_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_CURRENT_SHIFT) & ++ rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) & + ATH_ANT_RX_MASK; +- main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) & ++ main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) & + ATH_ANT_RX_MASK; + + /* Record packet only when both main_rssi and alt_rssi is positive */ diff --git a/package/mac80211/patches/530-ath9k_limit_qlen.patch b/package/mac80211/patches/530-ath9k_limit_qlen.patch index f4eb51e97..b66289bda 100644 --- a/package/mac80211/patches/530-ath9k_limit_qlen.patch +++ b/package/mac80211/patches/530-ath9k_limit_qlen.patch @@ -20,7 +20,7 @@ spinlock_t txbuflock; --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1646,6 +1646,10 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1647,6 +1647,10 @@ int ath9k_init_debug(struct ath_hw *ah) &fops_interrupt); debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_xmit); @@ -65,7 +65,7 @@ __skb_unlink(skb, &tid->buf_q); list_add_tail(&bf->list, bf_q); if (bf_prev) -@@ -1738,6 +1749,8 @@ static void ath_tx_send_ampdu(struct ath +@@ -1728,6 +1739,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; -@@ -1879,22 +1892,11 @@ error: +@@ -1878,22 +1891,11 @@ error: /* FIXME: tx power */ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb, @@ -99,7 +99,7 @@ if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) { /* -@@ -1926,6 +1928,7 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1925,6 +1927,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; @@ -107,7 +107,7 @@ int padpos, padsize; int frmlen = skb->len + FCS_LEN; int q; -@@ -1968,6 +1971,24 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1967,6 +1970,24 @@ int ath_tx_start(struct ieee80211_hw *hw setup_frame_info(hw, skb, frmlen); @@ -132,7 +132,7 @@ /* * 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. -@@ -1982,7 +2003,7 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -1981,7 +2002,7 @@ int ath_tx_start(struct ieee80211_hw *hw txq->stopped = true; } diff --git a/package/mac80211/patches/540-ath9k_extra_leds.patch b/package/mac80211/patches/540-ath9k_extra_leds.patch index 250e9cf31..c0a731716 100644 --- a/package/mac80211/patches/540-ath9k_extra_leds.patch +++ b/package/mac80211/patches/540-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -508,6 +508,9 @@ static inline u16 ath9k_btcoex_aggr_limi +@@ -523,6 +523,9 @@ static inline u16 ath9k_btcoex_aggr_limi #ifdef CONFIG_MAC80211_LEDS void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); @@ -10,7 +10,7 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -621,6 +624,13 @@ struct ath9k_vif_iter_data { +@@ -641,6 +644,13 @@ struct ath9k_vif_iter_data { int nadhocs; /* number of adhoc vifs */ }; @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -662,9 +672,8 @@ struct ath_softc { +@@ -682,9 +692,8 @@ struct ath_softc { struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; #ifdef CONFIG_MAC80211_LEDS @@ -171,7 +171,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -782,7 +782,7 @@ int ath9k_init_device(u16 devid, struct +@@ -792,7 +792,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CONFIG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ @@ -182,7 +182,7 @@ #endif --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1255,6 +1255,61 @@ static const struct file_operations fops +@@ -1256,6 +1256,61 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -244,7 +244,7 @@ #ifdef CONFIG_ATH9K_MAC_DEBUG void ath9k_debug_samp_bb_mac(struct ath_softc *sc) -@@ -1684,6 +1739,11 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1685,6 +1740,11 @@ int ath9k_init_debug(struct ath_hw *ah) &fops_samps); #endif diff --git a/package/mac80211/patches/550-mac80211_optimize_mcs_rate_mask.patch b/package/mac80211/patches/550-mac80211_optimize_mcs_rate_mask.patch index f7f66be0e..ea066a843 100644 --- a/package/mac80211/patches/550-mac80211_optimize_mcs_rate_mask.patch +++ b/package/mac80211/patches/550-mac80211_optimize_mcs_rate_mask.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -726,6 +726,8 @@ struct ieee80211_sub_if_data { +@@ -702,6 +702,8 @@ struct ieee80211_sub_if_data { /* bitmap of allowed (non-MCS) rate indexes for rate control */ u32 rc_rateidx_mask[IEEE80211_NUM_BANDS]; @@ -11,7 +11,7 @@ union { --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2112,9 +2112,20 @@ static int ieee80211_set_bitrate_mask(st +@@ -2119,9 +2119,20 @@ static int ieee80211_set_bitrate_mask(st } for (i = 0; i < IEEE80211_NUM_BANDS; i++) { @@ -34,7 +34,7 @@ return 0; --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -3672,7 +3672,7 @@ void ieee80211_send_bar(struct ieee80211 +@@ -3676,7 +3676,7 @@ void ieee80211_send_bar(struct ieee80211 * (deprecated; this will be removed once drivers get updated to use * rate_idx_mask) * @rate_idx_mask: user-requested (legacy) rate mask @@ -43,7 +43,7 @@ * @bss: whether this frame is sent out in AP or IBSS mode */ struct ieee80211_tx_rate_control { -@@ -3684,7 +3684,7 @@ struct ieee80211_tx_rate_control { +@@ -3688,7 +3688,7 @@ struct ieee80211_tx_rate_control { bool rts, short_preamble; u8 max_rate_idx; u32 rate_idx_mask; @@ -54,7 +54,7 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -642,9 +642,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 +@@ -637,9 +637,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 txrc.max_rate_idx = -1; else txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1; @@ -69,7 +69,7 @@ txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || tx->sdata->vif.type == NL80211_IFTYPE_ADHOC); -@@ -2480,8 +2482,6 @@ struct sk_buff *ieee80211_beacon_get_tim +@@ -2475,8 +2477,6 @@ struct sk_buff *ieee80211_beacon_get_tim txrc.max_rate_idx = -1; else txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1; diff --git a/package/mac80211/patches/551-ath9k_optimize_interrupt_mitigation.patch b/package/mac80211/patches/551-ath9k_optimize_interrupt_mitigation.patch index 5674fbb9d..2afc4deb4 100644 --- a/package/mac80211/patches/551-ath9k_optimize_interrupt_mitigation.patch +++ b/package/mac80211/patches/551-ath9k_optimize_interrupt_mitigation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -@@ -237,21 +237,19 @@ static bool ar9003_hw_get_isr(struct ath +@@ -240,21 +240,19 @@ static bool ar9003_hw_get_isr(struct ath *masked = isr & ATH9K_INT_COMMON; diff --git a/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch b/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch deleted file mode 100644 index fb17dc566..000000000 --- a/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.h -+++ b/drivers/net/wireless/ath/ath9k/ani.h -@@ -128,7 +128,6 @@ struct ar5416AniState { - u32 listenTime; - int32_t rssiThrLow; - int32_t rssiThrHigh; -- u32 noiseFloor; - u32 ofdmPhyErrCount; - u32 cckPhyErrCount; - int16_t pktRssi[2]; ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -266,11 +266,9 @@ static void ath9k_hw_set_ofdm_nil(struct - const struct ani_ofdm_level_entry *entry_ofdm; - const struct ani_cck_level_entry *entry_cck; - -- aniState->noiseFloor = BEACON_RSSI(ah); -- - ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", - aniState->ofdmNoiseImmunityLevel, -- immunityLevel, aniState->noiseFloor, -+ immunityLevel, BEACON_RSSI(ah), - aniState->rssiThrLow, aniState->rssiThrHigh); - - if (aniState->update_ani) -@@ -292,7 +290,7 @@ static void ath9k_hw_set_ofdm_nil(struct - ATH9K_ANI_FIRSTEP_LEVEL, - entry_ofdm->fir_step_level); - -- if ((aniState->noiseFloor >= aniState->rssiThrHigh) && -+ if (BEACON_RSSI(ah) >= aniState->rssiThrHigh && - (!aniState->ofdmWeakSigDetectOff != - entry_ofdm->ofdm_weak_signal_on)) { - ath9k_hw_ani_control(ah, -@@ -329,15 +327,14 @@ static void ath9k_hw_set_cck_nil(struct - const struct ani_ofdm_level_entry *entry_ofdm; - const struct ani_cck_level_entry *entry_cck; - -- aniState->noiseFloor = BEACON_RSSI(ah); - ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", - aniState->cckNoiseImmunityLevel, immunityLevel, -- aniState->noiseFloor, aniState->rssiThrLow, -+ BEACON_RSSI(ah), aniState->rssiThrLow, - aniState->rssiThrHigh); - - if ((ah->opmode == NL80211_IFTYPE_STATION || - ah->opmode == NL80211_IFTYPE_ADHOC) && -- aniState->noiseFloor <= aniState->rssiThrLow && -+ BEACON_RSSI(ah) <= aniState->rssiThrLow && - immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) - immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; - diff --git a/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch b/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch deleted file mode 100644 index 12d7cda59..000000000 --- a/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -265,6 +265,7 @@ static void ath9k_hw_set_ofdm_nil(struct - struct ath_common *common = ath9k_hw_common(ah); - const struct ani_ofdm_level_entry *entry_ofdm; - const struct ani_cck_level_entry *entry_cck; -+ bool weak_sig; - - ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", - aniState->ofdmNoiseImmunityLevel, -@@ -290,13 +291,15 @@ static void ath9k_hw_set_ofdm_nil(struct - ATH9K_ANI_FIRSTEP_LEVEL, - entry_ofdm->fir_step_level); - -- if (BEACON_RSSI(ah) >= aniState->rssiThrHigh && -- (!aniState->ofdmWeakSigDetectOff != -- entry_ofdm->ofdm_weak_signal_on)) { -+ weak_sig = entry_ofdm->ofdm_weak_signal_on; -+ if (ah->opmode == NL80211_IFTYPE_STATION && -+ BEACON_RSSI(ah) <= aniState->rssiThrHigh) -+ weak_sig = true; -+ -+ if (!aniState->ofdmWeakSigDetectOff != weak_sig) - ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - entry_ofdm->ofdm_weak_signal_on); -- } - } - - static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) diff --git a/package/mac80211/patches/572-ath9k_ani_cleanup_weak_signal_detect.patch b/package/mac80211/patches/572-ath9k_ani_cleanup_weak_signal_detect.patch deleted file mode 100644 index 2e071817f..000000000 --- a/package/mac80211/patches/572-ath9k_ani_cleanup_weak_signal_detect.patch +++ /dev/null @@ -1,192 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -185,7 +185,7 @@ static void ath9k_hw_ani_ofdm_err_trigge - } - rssi = BEACON_RSSI(ah); - if (rssi > aniState->rssiThrHigh) { -- if (!aniState->ofdmWeakSigDetectOff) { -+ if (aniState->ofdmWeakSigDetect) { - if (ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - false)) { -@@ -200,7 +200,7 @@ static void ath9k_hw_ani_ofdm_err_trigge - return; - } - } else if (rssi > aniState->rssiThrLow) { -- if (aniState->ofdmWeakSigDetectOff) -+ if (!aniState->ofdmWeakSigDetect) - ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - true); -@@ -211,7 +211,7 @@ static void ath9k_hw_ani_ofdm_err_trigge - } else { - if ((conf->channel->band == IEEE80211_BAND_2GHZ) && - !conf_is_ht(conf)) { -- if (!aniState->ofdmWeakSigDetectOff) -+ if (aniState->ofdmWeakSigDetect) - ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - false); -@@ -296,7 +296,7 @@ static void ath9k_hw_set_ofdm_nil(struct - BEACON_RSSI(ah) <= aniState->rssiThrHigh) - weak_sig = true; - -- if (!aniState->ofdmWeakSigDetectOff != weak_sig) -+ if (aniState->ofdmWeakSigDetect != weak_sig) - ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - entry_ofdm->ofdm_weak_signal_on); -@@ -401,7 +401,7 @@ static void ath9k_hw_ani_lower_immunity_ - if (rssi > aniState->rssiThrHigh) { - /* XXX: Handle me */ - } else if (rssi > aniState->rssiThrLow) { -- if (aniState->ofdmWeakSigDetectOff) { -+ if (!aniState->ofdmWeakSigDetect) { - if (ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - true)) -@@ -509,9 +509,9 @@ static void ath9k_ani_reset_old(struct a - if (aniState->spurImmunityLevel != 0) - ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, - aniState->spurImmunityLevel); -- if (aniState->ofdmWeakSigDetectOff) -+ if (!aniState->ofdmWeakSigDetect) - ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- !aniState->ofdmWeakSigDetectOff); -+ aniState->ofdmWeakSigDetect); - if (aniState->cckWeakSigThreshold) - ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, - aniState->cckWeakSigThreshold); -@@ -887,8 +887,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah - - ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; - ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; -- ani->ofdmWeakSigDetectOff = -- !ATH9K_ANI_USE_OFDM_WEAK_SIG; -+ ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; - ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; - ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; - ani->update_ani = false; ---- a/drivers/net/wireless/ath/ath9k/ani.h -+++ b/drivers/net/wireless/ath/ath9k/ani.h -@@ -122,7 +122,7 @@ struct ar5416AniState { - u8 mrcCCKOff; - u8 spurImmunityLevel; - u8 firstepLevel; -- u8 ofdmWeakSigDetectOff; -+ u8 ofdmWeakSigDetect; - u8 cckWeakSigThreshold; - bool update_ani; - u32 listenTime; ---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c -@@ -1042,12 +1042,12 @@ static bool ar5008_hw_ani_control_old(st - REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, - AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); - -- if (!on != aniState->ofdmWeakSigDetectOff) { -+ if (on != aniState->ofdmWeakSigDetect) { - if (on) - ah->stats.ast_ani_ofdmon++; - else - ah->stats.ast_ani_ofdmoff++; -- aniState->ofdmWeakSigDetectOff = !on; -+ aniState->ofdmWeakSigDetect = on; - } - break; - } -@@ -1114,10 +1114,10 @@ static bool ar5008_hw_ani_control_old(st - - ath_dbg(common, ANI, "ANI parameters:\n"); - ath_dbg(common, ANI, -- "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n", -+ "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetect=%d\n", - aniState->noiseImmunityLevel, - aniState->spurImmunityLevel, -- !aniState->ofdmWeakSigDetectOff); -+ aniState->ofdmWeakSigDetect); - ath_dbg(common, ANI, - "cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n", - aniState->cckWeakSigThreshold, -@@ -1206,18 +1206,18 @@ static bool ar5008_hw_ani_control_new(st - REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, - AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); - -- if (!on != aniState->ofdmWeakSigDetectOff) { -+ if (on != aniState->ofdmWeakSigDetect) { - ath_dbg(common, ANI, - "** ch %d: ofdm weak signal: %s=>%s\n", - chan->channel, -- !aniState->ofdmWeakSigDetectOff ? -+ aniState->ofdmWeakSigDetect ? - "on" : "off", - on ? "on" : "off"); - if (on) - ah->stats.ast_ani_ofdmon++; - else - ah->stats.ast_ani_ofdmoff++; -- aniState->ofdmWeakSigDetectOff = !on; -+ aniState->ofdmWeakSigDetect = on; - } - break; - } -@@ -1367,7 +1367,7 @@ static bool ar5008_hw_ani_control_new(st - ath_dbg(common, ANI, - "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", - aniState->spurImmunityLevel, -- !aniState->ofdmWeakSigDetectOff ? "on" : "off", -+ aniState->ofdmWeakSigDetect ? "on" : "off", - aniState->firstepLevel, - !aniState->mrcCCKOff ? "on" : "off", - aniState->listenTime, -@@ -1456,7 +1456,7 @@ static void ar5008_hw_ani_cache_ini_regs - /* these levels just got reset to defaults by the INI */ - aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; - aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -- aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; -+ aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; - aniState->mrcCCKOff = true; /* not available on pre AR9003 */ - } - ---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c -@@ -821,18 +821,18 @@ static bool ar9003_hw_ani_control(struct - REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, - AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); - -- if (!on != aniState->ofdmWeakSigDetectOff) { -+ if (on != aniState->ofdmWeakSigDetect) { - ath_dbg(common, ANI, - "** ch %d: ofdm weak signal: %s=>%s\n", - chan->channel, -- !aniState->ofdmWeakSigDetectOff ? -+ aniState->ofdmWeakSigDetect ? - "on" : "off", - on ? "on" : "off"); - if (on) - ah->stats.ast_ani_ofdmon++; - else - ah->stats.ast_ani_ofdmoff++; -- aniState->ofdmWeakSigDetectOff = !on; -+ aniState->ofdmWeakSigDetect = on; - } - break; - } -@@ -998,7 +998,7 @@ static bool ar9003_hw_ani_control(struct - ath_dbg(common, ANI, - "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", - aniState->spurImmunityLevel, -- !aniState->ofdmWeakSigDetectOff ? "on" : "off", -+ aniState->ofdmWeakSigDetect ? "on" : "off", - aniState->firstepLevel, - !aniState->mrcCCKOff ? "on" : "off", - aniState->listenTime, -@@ -1109,7 +1109,7 @@ static void ar9003_hw_ani_cache_ini_regs - /* these levels just got reset to defaults by the INI */ - aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; - aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -- aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; -+ aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; - aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; - } - diff --git a/package/mac80211/patches/573-ath9k_ani_fix_mode_checks.patch b/package/mac80211/patches/573-ath9k_ani_fix_mode_checks.patch deleted file mode 100644 index 759699614..000000000 --- a/package/mac80211/patches/573-ath9k_ani_fix_mode_checks.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -176,7 +176,7 @@ static void ath9k_hw_ani_ofdm_err_trigge - } - } - -- if (ah->opmode == NL80211_IFTYPE_AP) { -+ if (ah->opmode != NL80211_IFTYPE_STATION) { - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel + 1); -@@ -236,7 +236,7 @@ static void ath9k_hw_ani_cck_err_trigger - return; - } - } -- if (ah->opmode == NL80211_IFTYPE_AP) { -+ if (ah->opmode != NL80211_IFTYPE_STATION) { - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel + 1); -@@ -335,8 +335,7 @@ static void ath9k_hw_set_cck_nil(struct - BEACON_RSSI(ah), aniState->rssiThrLow, - aniState->rssiThrHigh); - -- if ((ah->opmode == NL80211_IFTYPE_STATION || -- ah->opmode == NL80211_IFTYPE_ADHOC) && -+ if (ah->opmode == NL80211_IFTYPE_STATION && - BEACON_RSSI(ah) <= aniState->rssiThrLow && - immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) - immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; -@@ -390,7 +389,7 @@ static void ath9k_hw_ani_lower_immunity_ - - aniState = &ah->curchan->ani; - -- if (ah->opmode == NL80211_IFTYPE_AP) { -+ if (ah->opmode != NL80211_IFTYPE_STATION) { - if (aniState->firstepLevel > 0) { - if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel - 1)) -@@ -474,8 +473,7 @@ static void ath9k_ani_reset_old(struct a - - aniState = &ah->curchan->ani; - -- if (ah->opmode != NL80211_IFTYPE_STATION -- && ah->opmode != NL80211_IFTYPE_ADHOC) { -+ if (ah->opmode != NL80211_IFTYPE_STATION) { - ath_dbg(common, ANI, "Reset ANI state opmode %u\n", ah->opmode); - ah->stats.ast_ani_reset++; - diff --git a/package/mac80211/patches/574-ath9k_remove_old_ani.patch b/package/mac80211/patches/574-ath9k_remove_old_ani.patch deleted file mode 100644 index e90e48c7d..000000000 --- a/package/mac80211/patches/574-ath9k_remove_old_ani.patch +++ /dev/null @@ -1,627 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -104,11 +104,6 @@ static const struct ani_cck_level_entry - #define ATH9K_ANI_CCK_DEF_LEVEL \ - 2 /* default level - matches the INI settings */ - --static bool use_new_ani(struct ath_hw *ah) --{ -- return AR_SREV_9300_20_OR_LATER(ah) || modparam_force_new_ani; --} -- - static void ath9k_hw_update_mibstats(struct ath_hw *ah, - struct ath9k_mib_stats *stats) - { -@@ -131,11 +126,6 @@ static void ath9k_ani_restart(struct ath - aniState = &ah->curchan->ani; - aniState->listenTime = 0; - -- if (!use_new_ani(ah)) { -- ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; -- cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; -- } -- - ath_dbg(common, ANI, "Writing ofdmbase=%u cckbase=%u\n", - ofdm_base, cck_base); - -@@ -154,110 +144,6 @@ static void ath9k_ani_restart(struct ath - aniState->cckPhyErrCount = 0; - } - --static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah) --{ -- struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; -- struct ar5416AniState *aniState; -- int32_t rssi; -- -- aniState = &ah->curchan->ani; -- -- if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { -- if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, -- aniState->noiseImmunityLevel + 1)) { -- return; -- } -- } -- -- if (aniState->spurImmunityLevel < HAL_SPUR_IMMUNE_MAX) { -- if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, -- aniState->spurImmunityLevel + 1)) { -- return; -- } -- } -- -- if (ah->opmode != NL80211_IFTYPE_STATION) { -- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel + 1); -- } -- return; -- } -- rssi = BEACON_RSSI(ah); -- if (rssi > aniState->rssiThrHigh) { -- if (aniState->ofdmWeakSigDetect) { -- if (ath9k_hw_ani_control(ah, -- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- false)) { -- ath9k_hw_ani_control(ah, -- ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); -- return; -- } -- } -- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel + 1); -- return; -- } -- } else if (rssi > aniState->rssiThrLow) { -- if (!aniState->ofdmWeakSigDetect) -- ath9k_hw_ani_control(ah, -- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- true); -- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel + 1); -- return; -- } else { -- if ((conf->channel->band == IEEE80211_BAND_2GHZ) && -- !conf_is_ht(conf)) { -- if (aniState->ofdmWeakSigDetect) -- ath9k_hw_ani_control(ah, -- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- false); -- if (aniState->firstepLevel > 0) -- ath9k_hw_ani_control(ah, -- ATH9K_ANI_FIRSTEP_LEVEL, 0); -- return; -- } -- } --} -- --static void ath9k_hw_ani_cck_err_trigger_old(struct ath_hw *ah) --{ -- struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; -- struct ar5416AniState *aniState; -- int32_t rssi; -- -- aniState = &ah->curchan->ani; -- if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { -- if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, -- aniState->noiseImmunityLevel + 1)) { -- return; -- } -- } -- if (ah->opmode != NL80211_IFTYPE_STATION) { -- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel + 1); -- } -- return; -- } -- rssi = BEACON_RSSI(ah); -- if (rssi > aniState->rssiThrLow) { -- if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel + 1); -- } else { -- if ((conf->channel->band == IEEE80211_BAND_2GHZ) && -- !conf_is_ht(conf)) { -- if (aniState->firstepLevel > 0) -- ath9k_hw_ani_control(ah, -- ATH9K_ANI_FIRSTEP_LEVEL, 0); -- } -- } --} -- - /* Adjust the OFDM Noise Immunity Level */ - static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel) - { -@@ -309,11 +195,6 @@ static void ath9k_hw_ani_ofdm_err_trigge - if (!DO_ANI(ah)) - return; - -- if (!use_new_ani(ah)) { -- ath9k_hw_ani_ofdm_err_trigger_old(ah); -- return; -- } -- - aniState = &ah->curchan->ani; - - if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) -@@ -371,70 +252,12 @@ static void ath9k_hw_ani_cck_err_trigger - if (!DO_ANI(ah)) - return; - -- if (!use_new_ani(ah)) { -- ath9k_hw_ani_cck_err_trigger_old(ah); -- return; -- } -- - aniState = &ah->curchan->ani; - - if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) - ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1); - } - --static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah) --{ -- struct ar5416AniState *aniState; -- int32_t rssi; -- -- aniState = &ah->curchan->ani; -- -- if (ah->opmode != NL80211_IFTYPE_STATION) { -- if (aniState->firstepLevel > 0) { -- if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel - 1)) -- return; -- } -- } else { -- rssi = BEACON_RSSI(ah); -- if (rssi > aniState->rssiThrHigh) { -- /* XXX: Handle me */ -- } else if (rssi > aniState->rssiThrLow) { -- if (!aniState->ofdmWeakSigDetect) { -- if (ath9k_hw_ani_control(ah, -- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- true)) -- return; -- } -- if (aniState->firstepLevel > 0) { -- if (ath9k_hw_ani_control(ah, -- ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel - 1)) -- return; -- } -- } else { -- if (aniState->firstepLevel > 0) { -- if (ath9k_hw_ani_control(ah, -- ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel - 1)) -- return; -- } -- } -- } -- -- if (aniState->spurImmunityLevel > 0) { -- if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, -- aniState->spurImmunityLevel - 1)) -- return; -- } -- -- if (aniState->noiseImmunityLevel > 0) { -- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, -- aniState->noiseImmunityLevel - 1); -- return; -- } --} -- - /* - * only lower either OFDM or CCK errors per turn - * we lower the other one next time -@@ -445,11 +268,6 @@ static void ath9k_hw_ani_lower_immunity( - - aniState = &ah->curchan->ani; - -- if (!use_new_ani(ah)) { -- ath9k_hw_ani_lower_immunity_old(ah); -- return; -- } -- - /* lower OFDM noise immunity */ - if (aniState->ofdmNoiseImmunityLevel > 0 && - (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) { -@@ -462,71 +280,6 @@ static void ath9k_hw_ani_lower_immunity( - ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1); - } - --static void ath9k_ani_reset_old(struct ath_hw *ah, bool is_scanning) --{ -- struct ar5416AniState *aniState; -- struct ath9k_channel *chan = ah->curchan; -- struct ath_common *common = ath9k_hw_common(ah); -- -- if (!DO_ANI(ah)) -- return; -- -- aniState = &ah->curchan->ani; -- -- if (ah->opmode != NL80211_IFTYPE_STATION) { -- ath_dbg(common, ANI, "Reset ANI state opmode %u\n", ah->opmode); -- ah->stats.ast_ani_reset++; -- -- if (ah->opmode == NL80211_IFTYPE_AP) { -- /* -- * ath9k_hw_ani_control() will only process items set on -- * ah->ani_function -- */ -- if (IS_CHAN_2GHZ(chan)) -- ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | -- ATH9K_ANI_FIRSTEP_LEVEL); -- else -- ah->ani_function = 0; -- } -- -- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); -- ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); -- ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- !ATH9K_ANI_USE_OFDM_WEAK_SIG); -- ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, -- ATH9K_ANI_CCK_WEAK_SIG_THR); -- -- ath9k_ani_restart(ah); -- return; -- } -- -- if (aniState->noiseImmunityLevel != 0) -- ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, -- aniState->noiseImmunityLevel); -- if (aniState->spurImmunityLevel != 0) -- ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, -- aniState->spurImmunityLevel); -- if (!aniState->ofdmWeakSigDetect) -- ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, -- aniState->ofdmWeakSigDetect); -- if (aniState->cckWeakSigThreshold) -- ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, -- aniState->cckWeakSigThreshold); -- if (aniState->firstepLevel != 0) -- ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, -- aniState->firstepLevel); -- -- ath9k_ani_restart(ah); -- -- ENABLE_REGWRITE_BUFFER(ah); -- -- REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); -- REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); -- -- REGWRITE_BUFFER_FLUSH(ah); --} -- - /* - * Restore the ANI parameters in the HAL and reset the statistics. - * This routine should be called for every hardware reset and for -@@ -541,9 +294,6 @@ void ath9k_ani_reset(struct ath_hw *ah, - if (!DO_ANI(ah)) - return; - -- if (!use_new_ani(ah)) -- return ath9k_ani_reset_old(ah, is_scanning); -- - BUG_ON(aniState == NULL); - ah->stats.ast_ani_reset++; - -@@ -640,11 +390,6 @@ static bool ath9k_hw_ani_read_counters(s - return false; - } - -- if (!use_new_ani(ah)) { -- ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; -- cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; -- } -- - aniState->listenTime += listenTime; - - ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); -@@ -652,26 +397,6 @@ static bool ath9k_hw_ani_read_counters(s - phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); - phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); - -- if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) { -- if (phyCnt1 < ofdm_base) { -- ath_dbg(common, ANI, -- "phyCnt1 0x%x, resetting counter value to 0x%x\n", -- phyCnt1, ofdm_base); -- REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); -- REG_WRITE(ah, AR_PHY_ERR_MASK_1, -- AR_PHY_ERR_OFDM_TIMING); -- } -- if (phyCnt2 < cck_base) { -- ath_dbg(common, ANI, -- "phyCnt2 0x%x, resetting counter value to 0x%x\n", -- phyCnt2, cck_base); -- REG_WRITE(ah, AR_PHY_ERR_2, cck_base); -- REG_WRITE(ah, AR_PHY_ERR_MASK_2, -- AR_PHY_ERR_CCK_TIMING); -- } -- return false; -- } -- - ofdmPhyErrCnt = phyCnt1 - ofdm_base; - ah->stats.ast_ani_ofdmerrs += - ofdmPhyErrCnt - aniState->ofdmPhyErrCount; -@@ -810,9 +535,6 @@ void ath9k_hw_proc_mib_event(struct ath_ - if (((phyCnt1 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK) || - ((phyCnt2 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK)) { - -- if (!use_new_ani(ah)) -- ath9k_hw_ani_read_counters(ah); -- - /* NB: always restart to insure the h/w counters are reset */ - ath9k_ani_restart(ah); - } -@@ -843,45 +565,28 @@ void ath9k_hw_ani_init(struct ath_hw *ah - - ath_dbg(common, ANI, "Initialize ANI\n"); - -- if (use_new_ani(ah)) { -- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW; -- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW; -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW; -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW; - -- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW; -- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW; -- } else { -- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD; -- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD; -- -- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD; -- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD; -- } -+ ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW; -+ ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW; - - for (i = 0; i < ARRAY_SIZE(ah->channels); i++) { - struct ath9k_channel *chan = &ah->channels[i]; - struct ar5416AniState *ani = &chan->ani; - -- if (use_new_ani(ah)) { -- ani->spurImmunityLevel = -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; -+ ani->spurImmunityLevel = -+ ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; - -- ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -+ ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; - -- if (AR_SREV_9300_20_OR_LATER(ah)) -- ani->mrcCCKOff = -- !ATH9K_ANI_ENABLE_MRC_CCK; -- else -- ani->mrcCCKOff = true; -- -- ani->ofdmsTurn = true; -- } else { -- ani->spurImmunityLevel = -- ATH9K_ANI_SPUR_IMMUNE_LVL_OLD; -- ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_OLD; -+ if (AR_SREV_9300_20_OR_LATER(ah)) -+ ani->mrcCCKOff = -+ !ATH9K_ANI_ENABLE_MRC_CCK; -+ else -+ ani->mrcCCKOff = true; - -- ani->cckWeakSigThreshold = -- ATH9K_ANI_CCK_WEAK_SIG_THR; -- } -+ ani->ofdmsTurn = true; - - ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; - ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; -@@ -895,13 +600,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah - * since we expect some ongoing maintenance on the tables, let's sanity - * check here default level should not modify INI setting. - */ -- if (use_new_ani(ah)) { -- ah->aniperiod = ATH9K_ANI_PERIOD_NEW; -- ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW; -- } else { -- ah->aniperiod = ATH9K_ANI_PERIOD_OLD; -- ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_OLD; -- } -+ ah->aniperiod = ATH9K_ANI_PERIOD_NEW; -+ ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW; - - if (ah->config.enable_ani) - ah->proc_phyerr |= HAL_PROCESS_ANI; ---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c -@@ -995,141 +995,6 @@ static u32 ar5008_hw_compute_pll_control - return pll; - } - --static bool ar5008_hw_ani_control_old(struct ath_hw *ah, -- enum ath9k_ani_cmd cmd, -- int param) --{ -- struct ar5416AniState *aniState = &ah->curchan->ani; -- struct ath_common *common = ath9k_hw_common(ah); -- -- switch (cmd & ah->ani_function) { -- case ATH9K_ANI_NOISE_IMMUNITY_LEVEL:{ -- u32 level = param; -- -- if (level >= ARRAY_SIZE(ah->totalSizeDesired)) { -- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", -- level, ARRAY_SIZE(ah->totalSizeDesired)); -- return false; -- } -- -- REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, -- AR_PHY_DESIRED_SZ_TOT_DES, -- ah->totalSizeDesired[level]); -- REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, -- AR_PHY_AGC_CTL1_COARSE_LOW, -- ah->coarse_low[level]); -- REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, -- AR_PHY_AGC_CTL1_COARSE_HIGH, -- ah->coarse_high[level]); -- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, -- AR_PHY_FIND_SIG_FIRPWR, -- ah->firpwr[level]); -- -- if (level > aniState->noiseImmunityLevel) -- ah->stats.ast_ani_niup++; -- else if (level < aniState->noiseImmunityLevel) -- ah->stats.ast_ani_nidown++; -- aniState->noiseImmunityLevel = level; -- break; -- } -- case ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION:{ -- u32 on = param ? 1 : 0; -- -- if (on) -- REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, -- AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); -- else -- REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, -- AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); -- -- if (on != aniState->ofdmWeakSigDetect) { -- if (on) -- ah->stats.ast_ani_ofdmon++; -- else -- ah->stats.ast_ani_ofdmoff++; -- aniState->ofdmWeakSigDetect = on; -- } -- break; -- } -- case ATH9K_ANI_CCK_WEAK_SIGNAL_THR:{ -- static const int weakSigThrCck[] = { 8, 6 }; -- u32 high = param ? 1 : 0; -- -- REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT, -- AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, -- weakSigThrCck[high]); -- if (high != aniState->cckWeakSigThreshold) { -- if (high) -- ah->stats.ast_ani_cckhigh++; -- else -- ah->stats.ast_ani_ccklow++; -- aniState->cckWeakSigThreshold = high; -- } -- break; -- } -- case ATH9K_ANI_FIRSTEP_LEVEL:{ -- static const int firstep[] = { 0, 4, 8 }; -- u32 level = param; -- -- if (level >= ARRAY_SIZE(firstep)) { -- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", -- level, ARRAY_SIZE(firstep)); -- return false; -- } -- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, -- AR_PHY_FIND_SIG_FIRSTEP, -- firstep[level]); -- if (level > aniState->firstepLevel) -- ah->stats.ast_ani_stepup++; -- else if (level < aniState->firstepLevel) -- ah->stats.ast_ani_stepdown++; -- aniState->firstepLevel = level; -- break; -- } -- case ATH9K_ANI_SPUR_IMMUNITY_LEVEL:{ -- static const int cycpwrThr1[] = { 2, 4, 6, 8, 10, 12, 14, 16 }; -- u32 level = param; -- -- if (level >= ARRAY_SIZE(cycpwrThr1)) { -- ath_dbg(common, ANI, "level out of range (%u > %zu)\n", -- level, ARRAY_SIZE(cycpwrThr1)); -- return false; -- } -- REG_RMW_FIELD(ah, AR_PHY_TIMING5, -- AR_PHY_TIMING5_CYCPWR_THR1, -- cycpwrThr1[level]); -- if (level > aniState->spurImmunityLevel) -- ah->stats.ast_ani_spurup++; -- else if (level < aniState->spurImmunityLevel) -- ah->stats.ast_ani_spurdown++; -- aniState->spurImmunityLevel = level; -- break; -- } -- case ATH9K_ANI_PRESENT: -- break; -- default: -- ath_dbg(common, ANI, "invalid cmd %u\n", cmd); -- return false; -- } -- -- ath_dbg(common, ANI, "ANI parameters:\n"); -- ath_dbg(common, ANI, -- "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetect=%d\n", -- aniState->noiseImmunityLevel, -- aniState->spurImmunityLevel, -- aniState->ofdmWeakSigDetect); -- ath_dbg(common, ANI, -- "cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n", -- aniState->cckWeakSigThreshold, -- aniState->firstepLevel, -- aniState->listenTime); -- ath_dbg(common, ANI, "ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n", -- aniState->ofdmPhyErrCount, -- aniState->cckPhyErrCount); -- -- return true; --} -- - static bool ar5008_hw_ani_control_new(struct ath_hw *ah, - enum ath9k_ani_cmd cmd, - int param) -@@ -1545,11 +1410,8 @@ void ar5008_hw_attach_phy_ops(struct ath - priv_ops->do_getnf = ar5008_hw_do_getnf; - priv_ops->set_radar_params = ar5008_hw_set_radar_params; - -- if (modparam_force_new_ani) { -- priv_ops->ani_control = ar5008_hw_ani_control_new; -- priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; -- } else -- priv_ops->ani_control = ar5008_hw_ani_control_old; -+ priv_ops->ani_control = ar5008_hw_ani_control_new; -+ priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; - - if (AR_SREV_9100(ah) || AR_SREV_9160_10_OR_LATER(ah)) - priv_ops->compute_pll_control = ar9160_hw_compute_pll_control; ---- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c -+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c -@@ -21,10 +21,6 @@ - #include "ar9002_initvals.h" - #include "ar9002_phy.h" - --int modparam_force_new_ani; --module_param_named(force_new_ani, modparam_force_new_ani, int, 0444); --MODULE_PARM_DESC(force_new_ani, "Force new ANI for AR5008, AR9001, AR9002"); -- - /* General hardware code for the A5008/AR9001/AR9002 hadware families */ - - static void ar9002_hw_init_mode_regs(struct ath_hw *ah) ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -1021,14 +1021,7 @@ void ar9002_hw_attach_ops(struct ath_hw - void ar9003_hw_attach_ops(struct ath_hw *ah); - - void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan); --/* -- * ANI work can be shared between all families but a next -- * generation implementation of ANI will be used only for AR9003 only -- * for now as the other families still need to be tested with the same -- * next generation ANI. Feel free to start testing it though for the -- * older families (AR5008, AR9001, AR9002) by using modparam_force_new_ani. -- */ --extern int modparam_force_new_ani; -+ - void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning); - void ath9k_hw_proc_mib_event(struct ath_hw *ah); - void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); diff --git a/package/mac80211/patches/575-ath9k_ani_cleanup.patch b/package/mac80211/patches/575-ath9k_ani_cleanup.patch deleted file mode 100644 index 1cd85b3d3..000000000 --- a/package/mac80211/patches/575-ath9k_ani_cleanup.patch +++ /dev/null @@ -1,320 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -117,8 +117,6 @@ static void ath9k_hw_update_mibstats(str - static void ath9k_ani_restart(struct ath_hw *ah) - { - struct ar5416AniState *aniState; -- struct ath_common *common = ath9k_hw_common(ah); -- u32 ofdm_base = 0, cck_base = 0; - - if (!DO_ANI(ah)) - return; -@@ -126,13 +124,10 @@ static void ath9k_ani_restart(struct ath - aniState = &ah->curchan->ani; - aniState->listenTime = 0; - -- ath_dbg(common, ANI, "Writing ofdmbase=%u cckbase=%u\n", -- ofdm_base, cck_base); -- - ENABLE_REGWRITE_BUFFER(ah); - -- REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); -- REG_WRITE(ah, AR_PHY_ERR_2, cck_base); -+ REG_WRITE(ah, AR_PHY_ERR_1, 0); -+ REG_WRITE(ah, AR_PHY_ERR_2, 0); - REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); - REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); - -@@ -375,9 +370,6 @@ static bool ath9k_hw_ani_read_counters(s - { - struct ath_common *common = ath9k_hw_common(ah); - struct ar5416AniState *aniState = &ah->curchan->ani; -- u32 ofdm_base = 0; -- u32 cck_base = 0; -- u32 ofdmPhyErrCnt, cckPhyErrCnt; - u32 phyCnt1, phyCnt2; - int32_t listenTime; - -@@ -397,15 +389,12 @@ static bool ath9k_hw_ani_read_counters(s - phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); - phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); - -- ofdmPhyErrCnt = phyCnt1 - ofdm_base; -- ah->stats.ast_ani_ofdmerrs += -- ofdmPhyErrCnt - aniState->ofdmPhyErrCount; -- aniState->ofdmPhyErrCount = ofdmPhyErrCnt; -- -- cckPhyErrCnt = phyCnt2 - cck_base; -- ah->stats.ast_ani_cckerrs += -- cckPhyErrCnt - aniState->cckPhyErrCount; -- aniState->cckPhyErrCount = cckPhyErrCnt; -+ ah->stats.ast_ani_ofdmerrs += phyCnt1 - aniState->ofdmPhyErrCount; -+ aniState->ofdmPhyErrCount = phyCnt1; -+ -+ ah->stats.ast_ani_cckerrs += phyCnt2 - aniState->cckPhyErrCount; -+ aniState->cckPhyErrCount = phyCnt2; -+ - return true; - } - -@@ -565,20 +554,19 @@ void ath9k_hw_ani_init(struct ath_hw *ah - - ath_dbg(common, ANI, "Initialize ANI\n"); - -- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW; -- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW; -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; - -- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW; -- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW; -+ ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH; -+ ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW; - - for (i = 0; i < ARRAY_SIZE(ah->channels); i++) { - struct ath9k_channel *chan = &ah->channels[i]; - struct ar5416AniState *ani = &chan->ani; - -- ani->spurImmunityLevel = -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; -+ ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; - -- ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -+ ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; - - if (AR_SREV_9300_20_OR_LATER(ah)) - ani->mrcCCKOff = -@@ -600,8 +588,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah - * since we expect some ongoing maintenance on the tables, let's sanity - * check here default level should not modify INI setting. - */ -- ah->aniperiod = ATH9K_ANI_PERIOD_NEW; -- ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW; -+ ah->aniperiod = ATH9K_ANI_PERIOD; -+ ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL; - - if (ah->config.enable_ani) - ah->proc_phyerr |= HAL_PROCESS_ANI; ---- a/drivers/net/wireless/ath/ath9k/ani.h -+++ b/drivers/net/wireless/ath/ath9k/ani.h -@@ -24,42 +24,34 @@ - #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi) - - /* units are errors per second */ --#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500 --#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW 3500 -+#define ATH9K_ANI_OFDM_TRIG_HIGH 3500 - #define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000 - - /* units are errors per second */ --#define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200 --#define ATH9K_ANI_OFDM_TRIG_LOW_NEW 400 -+#define ATH9K_ANI_OFDM_TRIG_LOW 400 - #define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900 - - /* units are errors per second */ --#define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200 --#define ATH9K_ANI_CCK_TRIG_HIGH_NEW 600 -+#define ATH9K_ANI_CCK_TRIG_HIGH 600 - - /* units are errors per second */ --#define ATH9K_ANI_CCK_TRIG_LOW_OLD 100 --#define ATH9K_ANI_CCK_TRIG_LOW_NEW 300 -+#define ATH9K_ANI_CCK_TRIG_LOW 300 - - #define ATH9K_ANI_NOISE_IMMUNE_LVL 4 - #define ATH9K_ANI_USE_OFDM_WEAK_SIG true - #define ATH9K_ANI_CCK_WEAK_SIG_THR false - --#define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD 7 --#define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW 3 -+#define ATH9K_ANI_SPUR_IMMUNE_LVL 3 - --#define ATH9K_ANI_FIRSTEP_LVL_OLD 0 --#define ATH9K_ANI_FIRSTEP_LVL_NEW 2 -+#define ATH9K_ANI_FIRSTEP_LVL 2 - - #define ATH9K_ANI_RSSI_THR_HIGH 40 - #define ATH9K_ANI_RSSI_THR_LOW 7 - --#define ATH9K_ANI_PERIOD_OLD 100 --#define ATH9K_ANI_PERIOD_NEW 300 -+#define ATH9K_ANI_PERIOD 300 - - /* in ms */ --#define ATH9K_ANI_POLLINTERVAL_OLD 100 --#define ATH9K_ANI_POLLINTERVAL_NEW 1000 -+#define ATH9K_ANI_POLLINTERVAL 1000 - - #define HAL_NOISE_IMMUNE_MAX 4 - #define HAL_SPUR_IMMUNE_MAX 7 ---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c -@@ -1101,7 +1101,7 @@ static bool ar5008_hw_ani_control_new(st - * from INI file & cap value - */ - value = firstep_table[level] - -- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + -+ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + - aniState->iniDef.firstep; - if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) - value = ATH9K_SIG_FIRSTEP_SETTING_MIN; -@@ -1116,7 +1116,7 @@ static bool ar5008_hw_ani_control_new(st - * from INI file & cap value - */ - value2 = firstep_table[level] - -- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + -+ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + - aniState->iniDef.firstepLow; - if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) - value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; -@@ -1132,7 +1132,7 @@ static bool ar5008_hw_ani_control_new(st - chan->channel, - aniState->firstepLevel, - level, -- ATH9K_ANI_FIRSTEP_LVL_NEW, -+ ATH9K_ANI_FIRSTEP_LVL, - value, - aniState->iniDef.firstep); - ath_dbg(common, ANI, -@@ -1140,7 +1140,7 @@ static bool ar5008_hw_ani_control_new(st - chan->channel, - aniState->firstepLevel, - level, -- ATH9K_ANI_FIRSTEP_LVL_NEW, -+ ATH9K_ANI_FIRSTEP_LVL, - value2, - aniState->iniDef.firstepLow); - if (level > aniState->firstepLevel) -@@ -1165,7 +1165,7 @@ static bool ar5008_hw_ani_control_new(st - * from INI file & cap value - */ - value = cycpwrThr1_table[level] - -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + -+ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + - aniState->iniDef.cycpwrThr1; - if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) - value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; -@@ -1181,7 +1181,7 @@ static bool ar5008_hw_ani_control_new(st - * from INI file & cap value - */ - value2 = cycpwrThr1_table[level] - -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + -+ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + - aniState->iniDef.cycpwrThr1Ext; - if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) - value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; -@@ -1196,7 +1196,7 @@ static bool ar5008_hw_ani_control_new(st - chan->channel, - aniState->spurImmunityLevel, - level, -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, -+ ATH9K_ANI_SPUR_IMMUNE_LVL, - value, - aniState->iniDef.cycpwrThr1); - ath_dbg(common, ANI, -@@ -1204,7 +1204,7 @@ static bool ar5008_hw_ani_control_new(st - chan->channel, - aniState->spurImmunityLevel, - level, -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, -+ ATH9K_ANI_SPUR_IMMUNE_LVL, - value2, - aniState->iniDef.cycpwrThr1Ext); - if (level > aniState->spurImmunityLevel) -@@ -1319,8 +1319,8 @@ static void ar5008_hw_ani_cache_ini_regs - AR_PHY_EXT_TIMING5_CYCPWR_THR1); - - /* these levels just got reset to defaults by the INI */ -- aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; -- aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -+ aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; -+ aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; - aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; - aniState->mrcCCKOff = true; /* not available on pre AR9003 */ - } ---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c -@@ -851,7 +851,7 @@ static bool ar9003_hw_ani_control(struct - * from INI file & cap value - */ - value = firstep_table[level] - -- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + -+ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + - aniState->iniDef.firstep; - if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) - value = ATH9K_SIG_FIRSTEP_SETTING_MIN; -@@ -866,7 +866,7 @@ static bool ar9003_hw_ani_control(struct - * from INI file & cap value - */ - value2 = firstep_table[level] - -- firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + -+ firstep_table[ATH9K_ANI_FIRSTEP_LVL] + - aniState->iniDef.firstepLow; - if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) - value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; -@@ -882,7 +882,7 @@ static bool ar9003_hw_ani_control(struct - chan->channel, - aniState->firstepLevel, - level, -- ATH9K_ANI_FIRSTEP_LVL_NEW, -+ ATH9K_ANI_FIRSTEP_LVL, - value, - aniState->iniDef.firstep); - ath_dbg(common, ANI, -@@ -890,7 +890,7 @@ static bool ar9003_hw_ani_control(struct - chan->channel, - aniState->firstepLevel, - level, -- ATH9K_ANI_FIRSTEP_LVL_NEW, -+ ATH9K_ANI_FIRSTEP_LVL, - value2, - aniState->iniDef.firstepLow); - if (level > aniState->firstepLevel) -@@ -915,7 +915,7 @@ static bool ar9003_hw_ani_control(struct - * from INI file & cap value - */ - value = cycpwrThr1_table[level] - -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + -+ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + - aniState->iniDef.cycpwrThr1; - if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) - value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; -@@ -931,7 +931,7 @@ static bool ar9003_hw_ani_control(struct - * from INI file & cap value - */ - value2 = cycpwrThr1_table[level] - -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + -+ cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + - aniState->iniDef.cycpwrThr1Ext; - if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) - value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; -@@ -946,7 +946,7 @@ static bool ar9003_hw_ani_control(struct - chan->channel, - aniState->spurImmunityLevel, - level, -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, -+ ATH9K_ANI_SPUR_IMMUNE_LVL, - value, - aniState->iniDef.cycpwrThr1); - ath_dbg(common, ANI, -@@ -954,7 +954,7 @@ static bool ar9003_hw_ani_control(struct - chan->channel, - aniState->spurImmunityLevel, - level, -- ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, -+ ATH9K_ANI_SPUR_IMMUNE_LVL, - value2, - aniState->iniDef.cycpwrThr1Ext); - if (level > aniState->spurImmunityLevel) -@@ -1107,8 +1107,8 @@ static void ar9003_hw_ani_cache_ini_regs - AR_PHY_EXT_CYCPWR_THR1); - - /* these levels just got reset to defaults by the INI */ -- aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; -- aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; -+ aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; -+ aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; - aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; - aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; - } diff --git a/package/mac80211/patches/576-ath9k_ani_remove_mib_int.patch b/package/mac80211/patches/576-ath9k_ani_remove_mib_int.patch deleted file mode 100644 index d071e0ca5..000000000 --- a/package/mac80211/patches/576-ath9k_ani_remove_mib_int.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -490,46 +490,6 @@ void ath9k_hw_disable_mib_counters(struc - } - EXPORT_SYMBOL(ath9k_hw_disable_mib_counters); - --/* -- * Process a MIB interrupt. We may potentially be invoked because -- * any of the MIB counters overflow/trigger so don't assume we're -- * here because a PHY error counter triggered. -- */ --void ath9k_hw_proc_mib_event(struct ath_hw *ah) --{ -- u32 phyCnt1, phyCnt2; -- -- /* Reset these counters regardless */ -- REG_WRITE(ah, AR_FILT_OFDM, 0); -- REG_WRITE(ah, AR_FILT_CCK, 0); -- if (!(REG_READ(ah, AR_SLP_MIB_CTRL) & AR_SLP_MIB_PENDING)) -- REG_WRITE(ah, AR_SLP_MIB_CTRL, AR_SLP_MIB_CLEAR); -- -- /* Clear the mib counters and save them in the stats */ -- ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); -- -- if (!DO_ANI(ah)) { -- /* -- * We must always clear the interrupt cause by -- * resetting the phy error regs. -- */ -- REG_WRITE(ah, AR_PHY_ERR_1, 0); -- REG_WRITE(ah, AR_PHY_ERR_2, 0); -- return; -- } -- -- /* NB: these are not reset-on-read */ -- phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); -- phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); -- if (((phyCnt1 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK) || -- ((phyCnt2 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK)) { -- -- /* NB: always restart to insure the h/w counters are reset */ -- ath9k_ani_restart(ah); -- } --} --EXPORT_SYMBOL(ath9k_hw_proc_mib_event); -- - void ath9k_hw_ani_setup(struct ath_hw *ah) - { - int i; ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -1023,7 +1023,6 @@ void ar9003_hw_attach_ops(struct ath_hw - void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan); - - void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning); --void ath9k_hw_proc_mib_event(struct ath_hw *ah); - void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); - - #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -827,24 +827,6 @@ irqreturn_t ath_isr(int irq, void *dev) - ath9k_hw_set_interrupts(ah); - } - -- if (status & ATH9K_INT_MIB) { -- /* -- * Disable interrupts until we service the MIB -- * interrupt; otherwise it will continue to -- * fire. -- */ -- ath9k_hw_disable_interrupts(ah); -- /* -- * Let the hal handle the event. We assume -- * it will clear whatever condition caused -- * the interrupt. -- */ -- spin_lock(&common->cc_lock); -- ath9k_hw_proc_mib_event(ah); -- spin_unlock(&common->cc_lock); -- ath9k_hw_enable_interrupts(ah); -- } -- - if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) - if (status & ATH9K_INT_TIM_TIMER) { - if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) -@@ -1347,14 +1329,10 @@ static void ath9k_calculate_summary_stat - /* - * Enable MIB interrupts when there are hardware phy counters. - */ -- if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) { -- if (ah->config.enable_ani) -- ah->imask |= ATH9K_INT_MIB; -+ if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) - ah->imask |= ATH9K_INT_TSFOOR; -- } else { -- ah->imask &= ~ATH9K_INT_MIB; -+ else - ah->imask &= ~ATH9K_INT_TSFOOR; -- } - - ath9k_hw_set_interrupts(ah); - ---- a/drivers/net/wireless/ath/ath9k/debug.c -+++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -348,8 +348,6 @@ void ath_debug_stat_interrupt(struct ath - sc->debug.stats.istats.txok++; - if (status & ATH9K_INT_TXURN) - sc->debug.stats.istats.txurn++; -- if (status & ATH9K_INT_MIB) -- sc->debug.stats.istats.mib++; - if (status & ATH9K_INT_RXPHY) - sc->debug.stats.istats.rxphyerr++; - if (status & ATH9K_INT_RXKCM) diff --git a/package/mac80211/patches/577-ath9k_fix_noise_immunity.patch b/package/mac80211/patches/577-ath9k_fix_noise_immunity.patch deleted file mode 100644 index d6ef67826..000000000 --- a/package/mac80211/patches/577-ath9k_fix_noise_immunity.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -154,9 +154,7 @@ static void ath9k_hw_set_ofdm_nil(struct - aniState->rssiThrLow, aniState->rssiThrHigh); - - if (aniState->update_ani) -- aniState->ofdmNoiseImmunityLevel = -- (immunityLevel > ATH9K_ANI_OFDM_DEF_LEVEL) ? -- immunityLevel : ATH9K_ANI_OFDM_DEF_LEVEL; -+ aniState->ofdmNoiseImmunityLevel = immunityLevel; - - entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; - entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; -@@ -217,9 +215,7 @@ static void ath9k_hw_set_cck_nil(struct - immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; - - if (aniState->update_ani) -- aniState->cckNoiseImmunityLevel = -- (immunityLevel > ATH9K_ANI_CCK_DEF_LEVEL) ? -- immunityLevel : ATH9K_ANI_CCK_DEF_LEVEL; -+ aniState->cckNoiseImmunityLevel = immunityLevel; - - entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; - entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; -@@ -285,6 +281,7 @@ void ath9k_ani_reset(struct ath_hw *ah, - struct ar5416AniState *aniState = &ah->curchan->ani; - struct ath9k_channel *chan = ah->curchan; - struct ath_common *common = ath9k_hw_common(ah); -+ int ofdm_nil, cck_nil; - - if (!DO_ANI(ah)) - return; -@@ -306,6 +303,11 @@ void ath9k_ani_reset(struct ath_hw *ah, - /* always allow mode (on/off) to be controlled */ - ah->ani_function |= ATH9K_ANI_MODE; - -+ ofdm_nil = max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL, -+ aniState->ofdmNoiseImmunityLevel); -+ cck_nil = max_t(int, ATH9K_ANI_CCK_DEF_LEVEL, -+ aniState->cckNoiseImmunityLevel); -+ - if (is_scanning || - (ah->opmode != NL80211_IFTYPE_STATION && - ah->opmode != NL80211_IFTYPE_ADHOC)) { -@@ -329,8 +331,8 @@ void ath9k_ani_reset(struct ath_hw *ah, - aniState->cckNoiseImmunityLevel); - - aniState->update_ani = false; -- ath9k_hw_set_ofdm_nil(ah, ATH9K_ANI_OFDM_DEF_LEVEL); -- ath9k_hw_set_cck_nil(ah, ATH9K_ANI_CCK_DEF_LEVEL); -+ ofdm_nil = ATH9K_ANI_OFDM_DEF_LEVEL; -+ cck_nil = ATH9K_ANI_CCK_DEF_LEVEL; - } - } else { - /* -@@ -346,11 +348,9 @@ void ath9k_ani_reset(struct ath_hw *ah, - aniState->cckNoiseImmunityLevel); - - aniState->update_ani = true; -- ath9k_hw_set_ofdm_nil(ah, -- aniState->ofdmNoiseImmunityLevel); -- ath9k_hw_set_cck_nil(ah, -- aniState->cckNoiseImmunityLevel); - } -+ ath9k_hw_set_ofdm_nil(ah, ofdm_nil); -+ ath9k_hw_set_cck_nil(ah, cck_nil); - - /* - * enable phy counters if hw supports or if not, enable phy diff --git a/package/mac80211/patches/578-ath9k_cleanup_ani_ofdm_trig.patch b/package/mac80211/patches/578-ath9k_cleanup_ani_ofdm_trig.patch deleted file mode 100644 index 9b4b9910f..000000000 --- a/package/mac80211/patches/578-ath9k_cleanup_ani_ofdm_trig.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ani.c -+++ b/drivers/net/wireless/ath/ath9k/ani.c -@@ -179,6 +179,14 @@ static void ath9k_hw_set_ofdm_nil(struct - ath9k_hw_ani_control(ah, - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, - entry_ofdm->ofdm_weak_signal_on); -+ -+ if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) { -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI; -+ } else { -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI; -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; -+ } - } - - static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) -@@ -428,21 +436,10 @@ void ath9k_hw_ani_monitor(struct ath_hw - - if (aniState->listenTime > ah->aniperiod) { - if (cckPhyErrRate < ah->config.cck_trig_low && -- ((ofdmPhyErrRate < ah->config.ofdm_trig_low && -- aniState->ofdmNoiseImmunityLevel < -- ATH9K_ANI_OFDM_DEF_LEVEL) || -- (ofdmPhyErrRate < ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI && -- aniState->ofdmNoiseImmunityLevel >= -- ATH9K_ANI_OFDM_DEF_LEVEL))) { -+ ofdmPhyErrRate < ah->config.ofdm_trig_low) { - ath9k_hw_ani_lower_immunity(ah); - aniState->ofdmsTurn = !aniState->ofdmsTurn; -- } else if ((ofdmPhyErrRate > ah->config.ofdm_trig_high && -- aniState->ofdmNoiseImmunityLevel >= -- ATH9K_ANI_OFDM_DEF_LEVEL) || -- (ofdmPhyErrRate > -- ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI && -- aniState->ofdmNoiseImmunityLevel < -- ATH9K_ANI_OFDM_DEF_LEVEL)) { -+ } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) { - ath9k_hw_ani_ofdm_err_trigger(ah); - aniState->ofdmsTurn = false; - } else if (cckPhyErrRate > ah->config.cck_trig_high) { diff --git a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch index eca2edfd9..abfd41b64 100644 --- a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch @@ -101,7 +101,7 @@ +} --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h -@@ -560,6 +560,7 @@ struct rt2x00lib_ops { +@@ -559,6 +559,7 @@ struct rt2x00lib_ops { const u8 *data, const size_t len); int (*load_firmware) (struct rt2x00_dev *rt2x00dev, const u8 *data, const size_t len); @@ -109,7 +109,7 @@ /* * Device initialization/deinitialization handlers. -@@ -721,6 +722,7 @@ enum rt2x00_capability_flags { +@@ -720,6 +721,7 @@ enum rt2x00_capability_flags { REQUIRE_SW_SEQNO, REQUIRE_HT_TX_DESC, REQUIRE_PS_AUTOWAKE, @@ -117,7 +117,7 @@ /* * Capabilities -@@ -976,6 +978,11 @@ struct rt2x00_dev { +@@ -975,6 +977,11 @@ struct rt2x00_dev { const struct firmware *fw; /* @@ -239,9 +239,9 @@ .get_entry_state = rt2800pci_get_entry_state, --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c -@@ -1161,6 +1161,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de - BIT(NL80211_IFTYPE_MESH_POINT) | - BIT(NL80211_IFTYPE_WDS); +@@ -1163,6 +1163,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de + + rt2x00dev->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + retval = rt2x00lib_load_eeprom_file(rt2x00dev); + if (retval) @@ -250,7 +250,7 @@ /* * Initialize work. */ -@@ -1285,6 +1289,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ +@@ -1287,6 +1291,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ */ if (rt2x00dev->drv_data) kfree(rt2x00dev->drv_data); 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 d76651038..d310f33bc 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 -@@ -614,6 +614,7 @@ export CONFIG_RT2X00=y +@@ -619,6 +619,7 @@ export CONFIG_RT2X00=y export CONFIG_RT2X00_LIB=m export CONFIG_RT2800_LIB=m export CONFIG_RT2X00_LIB_FIRMWARE=y diff --git a/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch index 57abb07ab..3fc1b3f09 100644 --- a/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch +++ b/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch @@ -37,7 +37,7 @@ num_rates += 4; --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h -@@ -425,6 +425,7 @@ struct hw_mode_spec { +@@ -424,6 +424,7 @@ struct hw_mode_spec { unsigned int supported_bands; #define SUPPORT_BAND_2GHZ 0x00000001 #define SUPPORT_BAND_5GHZ 0x00000002 diff --git a/package/mac80211/patches/608-add_platform_data_mac_addr.patch b/package/mac80211/patches/608-add_platform_data_mac_addr.patch index 5008180f7..17ca7381c 100644 --- a/package/mac80211/patches/608-add_platform_data_mac_addr.patch +++ b/package/mac80211/patches/608-add_platform_data_mac_addr.patch @@ -31,7 +31,7 @@ { --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h -@@ -1280,6 +1280,7 @@ static inline void rt2x00debug_dump_fram +@@ -1279,6 +1279,7 @@ static inline void rt2x00debug_dump_fram */ u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif); 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 f746cc9e1..01f270ff8 100644 --- a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch +++ b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch @@ -22,7 +22,7 @@ static int modparam_bad_frames_preempt; module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444); MODULE_PARM_DESC(bad_frames_preempt, -@@ -2689,10 +2694,10 @@ static int b43_gpio_init(struct b43_wlde +@@ -2690,10 +2695,10 @@ static int b43_gpio_init(struct b43_wlde u32 mask, set; b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_GPOUTSMSK, 0); diff --git a/package/mac80211/patches/820-b43-add-antenna-control.patch b/package/mac80211/patches/820-b43-add-antenna-control.patch index be6b68391..1cd2171db 100644 --- a/package/mac80211/patches/820-b43-add-antenna-control.patch +++ b/package/mac80211/patches/820-b43-add-antenna-control.patch @@ -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. */ -@@ -3045,8 +3045,8 @@ static int b43_chip_init(struct b43_wlde +@@ -3046,8 +3046,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); -@@ -3789,7 +3789,6 @@ static int b43_op_config(struct ieee8021 +@@ -3790,7 +3790,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; -@@ -3843,11 +3842,9 @@ static int b43_op_config(struct ieee8021 +@@ -3844,11 +3843,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) { -@@ -4940,6 +4937,47 @@ static int b43_op_get_survey(struct ieee +@@ -4941,6 +4938,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, -@@ -4961,6 +4999,8 @@ static const struct ieee80211_ops b43_hw +@@ -4962,6 +5000,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. -@@ -5207,6 +5247,8 @@ static int b43_one_core_attach(struct b4 +@@ -5208,6 +5248,8 @@ static int b43_one_core_attach(struct b4 if (!wldev) goto out; @@ -108,7 +108,7 @@ wldev->use_pio = b43_modparam_pio; wldev->dev = dev; wldev->wl = wl; -@@ -5297,6 +5339,9 @@ static struct b43_wl *b43_wireless_init( +@@ -5298,6 +5340,9 @@ static struct b43_wl *b43_wireless_init( hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; @@ -117,7 +117,7 @@ + hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1; wl->mac80211_initially_registered_queues = hw->queues; - hw->max_rates = 2; + wl->hw_registred = false; --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h @@ -804,6 +804,8 @@ struct b43_wldev { diff --git a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch index 287be2542..d3131d407 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 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h -@@ -1047,6 +1047,32 @@ static inline bool b43_using_pio_transfe +@@ -1051,6 +1051,32 @@ static inline bool b43_using_pio_transfe return dev->__using_pio_transfers; } diff --git a/package/mac80211/patches/840-brcmsmac-remove-PCIE.patch b/package/mac80211/patches/840-brcmsmac-remove-PCIE.patch index de8b46c94..ccb6fd09b 100644 --- a/package/mac80211/patches/840-brcmsmac-remove-PCIE.patch +++ b/package/mac80211/patches/840-brcmsmac-remove-PCIE.patch @@ -11,7 +11,7 @@ #ifdef DEBUG #define SI_MSG(fmt, ...) pr_debug(fmt, ##__VA_ARGS__) -@@ -777,7 +775,7 @@ void ai_pci_up(struct si_pub *sih) +@@ -776,7 +774,7 @@ void ai_pci_up(struct si_pub *sih) bcma_core_set_clockmode(cc, BCMA_CLKMODE_FAST); } @@ -20,7 +20,7 @@ bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true); } -@@ -795,7 +793,7 @@ void ai_pci_down(struct si_pub *sih) +@@ -794,7 +792,7 @@ void ai_pci_down(struct si_pub *sih) bcma_core_set_clockmode(cc, BCMA_CLKMODE_DYNAMIC); } diff --git a/package/mac80211/patches/841-brcmsmac-remove-PCI_FORCEHT.patch b/package/mac80211/patches/841-brcmsmac-remove-PCI_FORCEHT.patch index 04d74d73f..0777a7822 100644 --- a/package/mac80211/patches/841-brcmsmac-remove-PCI_FORCEHT.patch +++ b/package/mac80211/patches/841-brcmsmac-remove-PCI_FORCEHT.patch @@ -9,7 +9,7 @@ #ifdef DEBUG #define SI_MSG(fmt, ...) pr_debug(fmt, ##__VA_ARGS__) #else -@@ -755,9 +753,6 @@ bool ai_clkctl_cc(struct si_pub *sih, en +@@ -754,9 +752,6 @@ bool ai_clkctl_cc(struct si_pub *sih, en sii = (struct si_info *)sih; @@ -19,7 +19,7 @@ cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0); bcma_core_set_clockmode(cc, mode); return mode == BCMA_CLKMODE_FAST; -@@ -766,15 +761,9 @@ bool ai_clkctl_cc(struct si_pub *sih, en +@@ -765,15 +760,9 @@ bool ai_clkctl_cc(struct si_pub *sih, en void ai_pci_up(struct si_pub *sih) { struct si_info *sii; @@ -35,7 +35,7 @@ if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true); } -@@ -783,16 +772,9 @@ void ai_pci_up(struct si_pub *sih) +@@ -782,16 +771,9 @@ void ai_pci_up(struct si_pub *sih) void ai_pci_down(struct si_pub *sih) { struct si_info *sii; diff --git a/package/mac80211/patches/842-brcmsmac-remove-ai_get_buscoretype-and-ai_get_buscor.patch b/package/mac80211/patches/842-brcmsmac-remove-ai_get_buscoretype-and-ai_get_buscor.patch index 80c6fc966..6d98defdd 100644 --- a/package/mac80211/patches/842-brcmsmac-remove-ai_get_buscoretype-and-ai_get_buscor.patch +++ b/package/mac80211/patches/842-brcmsmac-remove-ai_get_buscoretype-and-ai_get_buscor.patch @@ -10,7 +10,7 @@ return true; } -@@ -807,15 +804,3 @@ bool ai_deviceremoved(struct si_pub *sih +@@ -806,15 +803,3 @@ bool ai_deviceremoved(struct si_pub *sih return false; } diff --git a/package/mac80211/patches/843-brcmsmac-use-container_of-instead-of-cast.patch b/package/mac80211/patches/843-brcmsmac-use-container_of-instead-of-cast.patch index ba12eda12..a90f7043b 100644 --- a/package/mac80211/patches/843-brcmsmac-use-container_of-instead-of-cast.patch +++ b/package/mac80211/patches/843-brcmsmac-use-container_of-instead-of-cast.patch @@ -18,7 +18,7 @@ found = 0; -@@ -622,7 +622,7 @@ uint ai_cc_reg(struct si_pub *sih, uint +@@ -622,7 +622,7 @@ uint ai_cc_reg(struct si_pub *sih, uint u32 w; struct si_info *sii; @@ -27,7 +27,7 @@ cc = sii->icbus->drv_cc.core; /* mask and set */ -@@ -716,7 +716,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si +@@ -715,7 +715,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si uint slowminfreq; u16 fpdelay; @@ -36,7 +36,7 @@ if (ai_get_cccaps(sih) & CC_CAP_PMU) { fpdelay = si_pmu_fast_pwrup_delay(sih); return fpdelay; -@@ -748,7 +748,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en +@@ -747,7 +747,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en struct si_info *sii; struct bcma_device *cc; @@ -45,7 +45,7 @@ cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0); bcma_core_set_clockmode(cc, mode); -@@ -759,7 +759,7 @@ void ai_pci_up(struct si_pub *sih) +@@ -758,7 +758,7 @@ void ai_pci_up(struct si_pub *sih) { struct si_info *sii; @@ -54,7 +54,7 @@ if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true); -@@ -770,7 +770,7 @@ void ai_pci_down(struct si_pub *sih) +@@ -769,7 +769,7 @@ void ai_pci_down(struct si_pub *sih) { struct si_info *sii; @@ -63,7 +63,7 @@ if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, false); -@@ -793,7 +793,7 @@ bool ai_deviceremoved(struct si_pub *sih +@@ -792,7 +792,7 @@ bool ai_deviceremoved(struct si_pub *sih u32 w; struct si_info *sii; diff --git a/package/mac80211/patches/844-brcmsmac-remove-ai_findcore.patch b/package/mac80211/patches/844-brcmsmac-remove-ai_findcore.patch index 3fc914f90..0e8750de4 100644 --- a/package/mac80211/patches/844-brcmsmac-remove-ai_findcore.patch +++ b/package/mac80211/patches/844-brcmsmac-remove-ai_findcore.patch @@ -28,7 +28,7 @@ /* * read/modify chipcommon core register. */ -@@ -689,12 +668,13 @@ ai_clkctl_setdelay(struct si_pub *sih, s +@@ -688,12 +667,13 @@ ai_clkctl_setdelay(struct si_pub *sih, s /* initialize power control delay registers */ void ai_clkctl_init(struct si_pub *sih) { @@ -43,7 +43,7 @@ if (cc == NULL) return; -@@ -726,7 +706,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si +@@ -725,7 +705,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si return 0; fpdelay = 0; @@ -52,7 +52,7 @@ if (cc) { slowminfreq = ai_slowclk_freq(sih, false, cc); fpdelay = (((bcma_read32(cc, CHIPCREGOFFS(pll_on_delay)) + 2) -@@ -750,7 +730,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en +@@ -749,7 +729,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en sii = container_of(sih, struct si_info, pub); @@ -61,7 +61,7 @@ bcma_core_set_clockmode(cc, mode); return mode == BCMA_CLKMODE_FAST; } -@@ -779,9 +759,10 @@ void ai_pci_down(struct si_pub *sih) +@@ -778,9 +758,10 @@ void ai_pci_down(struct si_pub *sih) /* Enable BT-COEX & Ex-PA for 4313 */ void ai_epa_4313war(struct si_pub *sih) { @@ -134,7 +134,7 @@ struct bcma_device *core; u32 alp_khz; -@@ -335,7 +339,7 @@ u32 si_pmu_measure_alpclk(struct si_pub +@@ -335,7 +339,7 @@ u32 si_pmu_measure_alpclk(struct si_pub return 0; /* Remember original core before switch to chipc */ diff --git a/package/mac80211/patches/847-brcmsmac-add-suome-conditions-for-the-bcm4716-again.patch b/package/mac80211/patches/847-brcmsmac-add-suome-conditions-for-the-bcm4716-again.patch index ecf41b559..40ccde90b 100644 --- a/package/mac80211/patches/847-brcmsmac-add-suome-conditions-for-the-bcm4716-again.patch +++ b/package/mac80211/patches/847-brcmsmac-add-suome-conditions-for-the-bcm4716-again.patch @@ -32,7 +32,7 @@ } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5; } else { -@@ -19256,8 +19259,14 @@ static void wlc_phy_spurwar_nphy(struct +@@ -19256,8 +19259,14 @@ static void wlc_phy_spurwar_nphy(struct case 38: case 102: case 118: @@ -49,7 +49,7 @@ break; case 134: nphy_adj_tone_id_buf[0] = 32; -@@ -20697,12 +20706,22 @@ wlc_phy_chanspec_radio2056_setup(struct +@@ -20697,12 +20706,22 @@ wlc_phy_chanspec_radio2056_setup(struct write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | RADIO_2056_SYN, 0x1f); @@ -78,7 +78,7 @@ } } -@@ -20749,24 +20768,33 @@ wlc_phy_chanspec_radio2056_setup(struct +@@ -20749,24 +20768,33 @@ wlc_phy_chanspec_radio2056_setup(struct WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, PADG_IDAC, 0xcc); diff --git a/package/mac80211/patches/849-brcmsmac-add-device-found-on-some-SoCs-like-the-bcm4.patch b/package/mac80211/patches/849-brcmsmac-add-device-found-on-some-SoCs-like-the-bcm4.patch index 9cef6975a..2d09dff1c 100644 --- a/package/mac80211/patches/849-brcmsmac-add-device-found-on-some-SoCs-like-the-bcm4.patch +++ b/package/mac80211/patches/849-brcmsmac-add-device-found-on-some-SoCs-like-the-bcm4.patch @@ -10,7 +10,7 @@ BCMA_CORETABLE_END --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c -@@ -751,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct +@@ -751,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs); /* do band-specific ucode IHR, SHM, and SCR inits */ @@ -19,7 +19,7 @@ if (BRCMS_ISNPHY(wlc_hw->band)) brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); else -@@ -2276,7 +2276,7 @@ static void brcms_ucode_download(struct +@@ -2276,7 +2276,7 @@ static void brcms_ucode_download(struct if (wlc_hw->ucode_loaded) return; diff --git a/package/mac80211/patches/851-brcmsmac-start-adding-support-for-core-rev-28.patch b/package/mac80211/patches/851-brcmsmac-start-adding-support-for-core-rev-28.patch index 1b64f56cc..dd50eb294 100644 --- a/package/mac80211/patches/851-brcmsmac-start-adding-support-for-core-rev-28.patch +++ b/package/mac80211/patches/851-brcmsmac-start-adding-support-for-core-rev-28.patch @@ -10,7 +10,7 @@ MODULE_DEVICE_TABLE(bcma, brcms_coreid_table); --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c -@@ -751,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct +@@ -751,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs); /* do band-specific ucode IHR, SHM, and SCR inits */ @@ -19,7 +19,7 @@ if (BRCMS_ISNPHY(wlc_hw->band)) brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); else -@@ -2276,7 +2276,7 @@ static void brcms_ucode_download(struct +@@ -2276,7 +2276,7 @@ static void brcms_ucode_download(struct if (wlc_hw->ucode_loaded) return;