diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-04-22 15:39:31 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-04-22 15:39:31 +0000 |
commit | a850143071b5d5e48ce580bae1d744be2db6b6fb (patch) | |
tree | 2f92327af6db3b6ce0eb773f9879cfdf286b9b6f | |
parent | e711a7c8843438ad1d01382dca307112e5d40320 (diff) |
mac80211: update to wireless-testing 2010-04-21
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21089 3c298f89-4303-0410-b956-a3cf2f4a3e73
16 files changed, 488 insertions, 498 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index d654ffa39..d0b8976f4 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2010-04-16 +PKG_VERSION:=2010-04-21 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources # http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \ # http://wireless.kernel.org/download/compat-wireless-2.6 -PKG_MD5SUM:=49afa00f47127ec3cd5e2cc8a8c11fe4 +PKG_MD5SUM:=dfefd51780fa1045edd1084efeab8b1e PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) diff --git a/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch b/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch index 55163317b..034f00cd9 100644 --- a/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch +++ b/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch @@ -1,8 +1,8 @@ --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h -@@ -1,6 +1,8 @@ - #ifndef _COMPAT_LINUX_TRACEPOINT_H - #define _COMPAT_LINUX_TRACEPOINT_H 1 +@@ -3,6 +3,8 @@ + + #include <linux/version.h> +#include <linux/version.h> + diff --git a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch index 3f4e56e7e..c8961ba9e 100644 --- a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch +++ b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch @@ -10,7 +10,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -542,6 +542,7 @@ static int ath9k_init_softc(u16 devid, s +@@ -565,6 +565,7 @@ static int ath9k_init_softc(u16 devid, s { struct ath_hw *ah = NULL; struct ath_common *common; @@ -18,7 +18,7 @@ int ret = 0, i; int csz = 0; -@@ -553,6 +554,10 @@ static int ath9k_init_softc(u16 devid, s +@@ -576,6 +577,10 @@ static int ath9k_init_softc(u16 devid, s ah->hw_version.subsysid = subsysid; sc->sc_ah = ah; diff --git a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch index fb524b260..3192ab086 100644 --- a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch +++ b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1345,7 +1345,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -1373,7 +1373,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st if (ah->config.rx_intr_mitigation) { REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500); diff --git a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch index 1391da3c7..57a5678f8 100644 --- a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch +++ b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch @@ -8,7 +8,7 @@ #include "ath9k.h" static char *dev_info = "ath9k"; -@@ -557,6 +558,8 @@ static int ath9k_init_softc(u16 devid, s +@@ -580,6 +581,8 @@ static int ath9k_init_softc(u16 devid, s pdata = (struct ath9k_platform_data *) sc->dev->platform_data; if (!pdata) ah->ah_flags |= AH_USE_EEPROM; @@ -17,7 +17,7 @@ common = ath9k_hw_common(ah); common->ops = &ath9k_common_ops; -@@ -679,6 +682,24 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -702,6 +705,24 @@ void ath9k_set_hw_capab(struct ath_softc SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } @@ -42,7 +42,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops) { -@@ -697,6 +718,9 @@ int ath9k_init_device(u16 devid, struct +@@ -720,6 +741,9 @@ int ath9k_init_device(u16 devid, struct common = ath9k_hw_common(ah); ath9k_set_hw_capab(sc, hw); diff --git a/package/mac80211/patches/540-ath9k_use_minstrel.patch b/package/mac80211/patches/540-ath9k_use_minstrel.patch index 72de38ee4..6f1877f16 100644 --- a/package/mac80211/patches/540-ath9k_use_minstrel.patch +++ b/package/mac80211/patches/540-ath9k_use_minstrel.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -663,7 +663,11 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -686,7 +686,11 @@ void ath9k_set_hw_capab(struct ath_softc hw->sta_data_size = sizeof(struct ath_node); hw->vif_data_size = sizeof(struct ath_vif); diff --git a/package/mac80211/patches/550-ath9k_bb_fix.patch b/package/mac80211/patches/550-ath9k_bb_fix.patch deleted file mode 100644 index 13eccae7e..000000000 --- a/package/mac80211/patches/550-ath9k_bb_fix.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1172,6 +1172,34 @@ static bool ath9k_hw_channel_change(stru - return true; - } - -+bool ath9k_hw_check_alive(struct ath_hw *ah) -+{ -+ int count = 50; -+ u32 reg; -+ -+ if (AR_SREV_9285_10_OR_LATER(ah)) -+ return true; -+ -+ do { -+ reg = REG_READ(ah, AR_OBS_BUS_1); -+ -+ if ((reg & 0x7E7FFFEF) == 0x00702400) -+ continue; -+ -+ switch (reg & 0x7E000B00) { -+ case 0x1E000000: -+ case 0x52000B00: -+ case 0x18000B00: -+ continue; -+ default: -+ return true; -+ } -+ } while (count-- > 0); -+ -+ return false; -+} -+EXPORT_SYMBOL(ath9k_hw_check_alive); -+ - int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, - bool bChannelChange) - { ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -869,6 +869,7 @@ void ath9k_hw_set11nmac2040(struct ath_h - void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period); - void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah, - const struct ath9k_beacon_state *bs); -+bool ath9k_hw_check_alive(struct ath_hw *ah); - - bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); - ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -406,7 +406,8 @@ void ath9k_tasklet(unsigned long data) - - ath9k_ps_wakeup(sc); - -- if (status & ATH9K_INT_FATAL) { -+ if ((status & ATH9K_INT_FATAL) || -+ !ath9k_hw_check_alive(ah)) { - ath_reset(sc, false); - ath9k_ps_restore(sc); - return; diff --git a/package/mac80211/patches/550-ath9k_pending_work.patch b/package/mac80211/patches/550-ath9k_pending_work.patch new file mode 100644 index 000000000..1a6f06d20 --- /dev/null +++ b/package/mac80211/patches/550-ath9k_pending_work.patch @@ -0,0 +1,476 @@ +--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c ++++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c +@@ -852,7 +852,8 @@ static int ar5008_hw_process_ini(struct + + REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites); + +- if (AR_SREV_9280_20(ah) && IS_CHAN_A_5MHZ_SPACED(chan)) { ++ if (AR_SREV_9280_20(ah) && ++ (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)) { + REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, + regWrites); + } +@@ -895,7 +896,7 @@ static void ar5008_hw_set_rfmode(struct + AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; + + if ((AR_SREV_9280_20(ah) || AR_SREV_9300_20_OR_LATER(ah)) +- && IS_CHAN_A_5MHZ_SPACED(chan)) ++ && (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)) + rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); + + REG_WRITE(ah, AR_PHY_MODE, rfMode); +--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c +@@ -755,7 +755,8 @@ static bool ar9003_hw_init_cal(struct at + } + + /* Do Tx IQ Calibration */ +- ar9003_hw_tx_iq_cal(ah); ++ if (ah->config.tx_iq_calibration) ++ ar9003_hw_tx_iq_cal(ah); + + /* Revert chainmasks to their original values before NF cal */ + ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); +--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h ++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +@@ -265,7 +265,7 @@ struct cal_ctl_edge_pwr { + } __packed; + + struct cal_ctl_data_2g { +- struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G]; ++ struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G]; + } __packed; + + struct cal_ctl_data_5g { +--- a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h ++++ b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h +@@ -31,7 +31,7 @@ static const u32 ar9300_2p0_radio_postam + + static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = { + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ +- {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da}, ++ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, +@@ -545,7 +545,7 @@ static const u32 ar9300_2p0_soc_postambl + }; + + static const u32 ar9200_merlin_2p0_radio_core[][2] = { +- /* Addr common */ ++ /* Addr allmodes */ + {0x00007800, 0x00040000}, + {0x00007804, 0xdb005012}, + {0x00007808, 0x04924914}, +@@ -835,71 +835,71 @@ static const u32 ar9300_2p0_baseband_cor + + static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = { + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ +- {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da}, ++ {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9}, + {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, + {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, +- {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, +- {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200}, +- {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202}, +- {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400}, +- {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402}, +- {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404}, +- {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603}, +- {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02}, +- {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04}, +- {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20}, +- {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20}, +- {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22}, +- {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24}, +- {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640}, +- {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660}, +- {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861}, +- {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81}, +- {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83}, +- {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84}, +- {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3}, +- {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5}, +- {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9}, +- {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb}, +- {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, ++ {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, ++ {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, ++ {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, ++ {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, ++ {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, ++ {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, ++ {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, ++ {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, ++ {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, ++ {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, ++ {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20}, ++ {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22}, ++ {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24}, ++ {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640}, ++ {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660}, ++ {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861}, ++ {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81}, ++ {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83}, ++ {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84}, ++ {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3}, ++ {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5}, ++ {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9}, ++ {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb}, ++ {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec}, ++ {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec}, ++ {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, + {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, + {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, +- {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004}, +- {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200}, +- {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202}, +- {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400}, +- {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402}, +- {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404}, +- {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603}, +- {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02}, +- {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04}, +- {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20}, +- {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20}, +- {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22}, +- {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24}, +- {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640}, +- {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660}, +- {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861}, +- {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81}, +- {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83}, +- {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84}, +- {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3}, +- {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5}, +- {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9}, +- {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb}, +- {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, ++ {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, ++ {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, ++ {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, ++ {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, ++ {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, ++ {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, ++ {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, ++ {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, ++ {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, ++ {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, ++ {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20}, ++ {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22}, ++ {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24}, ++ {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640}, ++ {0x0000a5c0, 0x4c8a3065, 0x44883e46, 0x44883e46, 0x38801660}, ++ {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861}, ++ {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81}, ++ {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83}, ++ {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84}, ++ {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3}, ++ {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5}, ++ {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9}, ++ {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb}, ++ {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec}, ++ {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec}, ++ {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, + {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, + {0x00016048, 0xad241a61, 0xad241a61, 0xad241a61, 0xad241a61}, + {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, +@@ -913,71 +913,71 @@ static const u32 ar9300Modes_high_power_ + + static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = { + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ +- {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da}, ++ {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9}, + {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, + {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, +- {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, +- {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200}, +- {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202}, +- {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400}, +- {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402}, +- {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404}, +- {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603}, +- {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02}, +- {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04}, +- {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20}, +- {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20}, +- {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22}, +- {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24}, +- {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640}, +- {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660}, +- {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861}, +- {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81}, +- {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83}, +- {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84}, +- {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3}, +- {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5}, +- {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9}, +- {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb}, +- {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, +- {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, ++ {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, ++ {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, ++ {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, ++ {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, ++ {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, ++ {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, ++ {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, ++ {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, ++ {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, ++ {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, ++ {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20}, ++ {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22}, ++ {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24}, ++ {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640}, ++ {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660}, ++ {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861}, ++ {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81}, ++ {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83}, ++ {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84}, ++ {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3}, ++ {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5}, ++ {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9}, ++ {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb}, ++ {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec}, ++ {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec}, ++ {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, ++ {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, + {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, + {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, +- {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004}, +- {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200}, +- {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202}, +- {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400}, +- {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402}, +- {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404}, +- {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603}, +- {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02}, +- {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04}, +- {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20}, +- {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20}, +- {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22}, +- {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24}, +- {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640}, +- {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660}, +- {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861}, +- {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81}, +- {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83}, +- {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84}, +- {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3}, +- {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5}, +- {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9}, +- {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb}, +- {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, +- {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, ++ {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, ++ {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, ++ {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, ++ {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, ++ {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, ++ {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, ++ {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, ++ {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, ++ {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, ++ {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, ++ {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20}, ++ {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22}, ++ {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24}, ++ {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640}, ++ {0x0000a5c0, 0x44883e46, 0x44883e46, 0x38801660, 0x38801660}, ++ {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861}, ++ {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81}, ++ {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83}, ++ {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84}, ++ {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3}, ++ {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5}, ++ {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9}, ++ {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb}, ++ {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec}, ++ {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec}, ++ {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, ++ {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, + {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, + {0x00016048, 0x8c001a61, 0x8c001a61, 0x8c001a61, 0x8c001a61}, + {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, +@@ -1251,7 +1251,7 @@ static const u32 ar9300Common_rx_gain_ta + + static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = { + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ +- {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da}, ++ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, +@@ -1760,31 +1760,22 @@ static const u32 ar9300_2p0_soc_preamble + {0x00007038, 0x000004c2}, + }; + +-/* +- * PCIE-PHY programming array, to be used prior to entering +- * full sleep (holding RTC in reset, PLL is ON in L1 mode) +- */ + static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p0[][2] = { ++ /* Addr allmodes */ + {0x00004040, 0x08212e5e}, + {0x00004040, 0x0008003b}, + {0x00004044, 0x00000000}, + }; + +-/* +- * PCIE-PHY programming array, to be used when not in +- * full sleep (holding RTC in reset) +- */ + static const u32 ar9300PciePhy_clkreq_enable_L1_2p0[][2] = { ++ /* Addr allmodes */ + {0x00004040, 0x08253e5e}, + {0x00004040, 0x0008003b}, + {0x00004044, 0x00000000}, + }; + +-/* +- * PCIE-PHY programming array, to be used prior to entering +- * full sleep (holding RTC in reset) +- */ + static const u32 ar9300PciePhy_clkreq_disable_L1_2p0[][2] = { ++ /* Addr allmodes */ + {0x00004040, 0x08213e5e}, + {0x00004040, 0x0008003b}, + {0x00004044, 0x00000000}, +--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c +@@ -375,16 +375,7 @@ static u32 ar9003_hw_compute_pll_control + else if (chan && IS_CHAN_QUARTER_RATE(chan)) + pll |= SM(0x2, AR_RTC_9300_PLL_CLKSEL); + +- if (chan && IS_CHAN_5GHZ(chan)) { +- pll |= SM(0x28, AR_RTC_9300_PLL_DIV); +- +- /* +- * When doing fast clock, set PLL to 0x142c +- */ +- if (IS_CHAN_A_5MHZ_SPACED(chan)) +- pll = 0x142c; +- } else +- pll |= SM(0x2c, AR_RTC_9300_PLL_DIV); ++ pll |= SM(0x2c, AR_RTC_9300_PLL_DIV); + + return pll; + } +@@ -592,7 +583,7 @@ static int ar9003_hw_process_ini(struct + * For 5GHz channels requiring Fast Clock, apply + * different modal values. + */ +- if (IS_CHAN_A_5MHZ_SPACED(chan)) ++ if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK) + REG_WRITE_ARRAY(&ah->iniModesAdditional, + modesIndex, regWrites); + +@@ -622,7 +613,7 @@ static void ar9003_hw_set_rfmode(struct + rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) + ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; + +- if (IS_CHAN_A_5MHZ_SPACED(chan)) ++ if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK) + rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); + + REG_WRITE(ah, AR_PHY_MODE, rfMode); +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -29,6 +29,7 @@ + #define ATH9K_CLOCK_RATE_CCK 22 + #define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 + #define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 ++#define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM 44 + + static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type); + +@@ -94,7 +95,11 @@ static u32 ath9k_hw_mac_clks(struct ath_ + return usecs *ATH9K_CLOCK_RATE_CCK; + if (conf->channel->band == IEEE80211_BAND_2GHZ) + return usecs *ATH9K_CLOCK_RATE_2GHZ_OFDM; +- return usecs *ATH9K_CLOCK_RATE_5GHZ_OFDM; ++ ++ if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK) ++ return usecs * ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM; ++ else ++ return usecs * ATH9K_CLOCK_RATE_5GHZ_OFDM; + } + + static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs) +@@ -390,6 +395,12 @@ static void ath9k_hw_init_config(struct + ah->config.rx_intr_mitigation = true; + + /* ++ * Tx IQ Calibration (ah->config.tx_iq_calibration) is only ++ * used by AR9003 but it is busted right now, it will take a ++ * while to fix so this is currently disabled. ++ */ ++ ++ /* + * We need this for PCI devices only (Cardbus, PCI, miniPCI) + * _and_ if on non-uniprocessor systems (Multiprocessor/HT). + * This means we use it for all AR5416 devices, and the few +@@ -2198,7 +2209,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw + } + + if (AR_SREV_9300_20_OR_LATER(ah)) { +- pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC; ++ pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC | ++ ATH9K_HW_CAP_FASTCLOCK; + pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH; + pCap->rx_lp_qdepth = ATH9K_HW_RX_LP_QDEPTH; + pCap->rx_status_len = sizeof(struct ar9003_rxs); +--- a/drivers/net/wireless/ath/ath9k/hw.h ++++ b/drivers/net/wireless/ath/ath9k/hw.h +@@ -198,6 +198,7 @@ enum ath9k_hw_caps { + ATH9K_HW_CAP_EDMA = BIT(17), + ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18), + ATH9K_HW_CAP_LDPC = BIT(19), ++ ATH9K_HW_CAP_FASTCLOCK = BIT(20), + }; + + enum ath9k_capability_type { +@@ -261,6 +262,7 @@ struct ath9k_ops_config { + #define AR_BASE_FREQ_5GHZ 4900 + #define AR_SPUR_FEEQ_BOUND_HT40 19 + #define AR_SPUR_FEEQ_BOUND_HT20 10 ++ bool tx_iq_calibration; /* Only available for >= AR9003 */ + int spurmode; + u16 spurchans[AR_EEPROM_MODAL_SPURS][2]; + u8 max_txtrig_level; diff --git a/package/mac80211/patches/560-ath9k_tx_buf_return_cleanup.patch b/package/mac80211/patches/560-ath9k_tx_buf_return_cleanup.patch deleted file mode 100644 index a2ccf23e7..000000000 --- a/package/mac80211/patches/560-ath9k_tx_buf_return_cleanup.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -261,19 +261,40 @@ static void ath_tx_set_retry(struct ath_ - hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_RETRY); - } - --static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) -+static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc) - { -- struct ath_buf *tbf; -+ struct ath_buf *bf = NULL; - - spin_lock_bh(&sc->tx.txbuflock); -- if (WARN_ON(list_empty(&sc->tx.txbuf))) { -+ -+ if (unlikely(list_empty(&sc->tx.txbuf))) { - spin_unlock_bh(&sc->tx.txbuflock); - return NULL; - } -- tbf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); -- list_del(&tbf->list); -+ -+ bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); -+ list_del(&bf->list); -+ - spin_unlock_bh(&sc->tx.txbuflock); - -+ return bf; -+} -+ -+static void ath_tx_return_buffer(struct ath_softc *sc, struct ath_buf *bf) -+{ -+ spin_lock_bh(&sc->tx.txbuflock); -+ list_add_tail(&bf->list, &sc->tx.txbuf); -+ spin_unlock_bh(&sc->tx.txbuflock); -+} -+ -+static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) -+{ -+ struct ath_buf *tbf; -+ -+ tbf = ath_tx_get_buffer(sc); -+ if (WARN_ON(!tbf)) -+ return NULL; -+ - ATH_TXBUF_RESET(tbf); - - tbf->aphy = bf->aphy; -@@ -1081,9 +1102,7 @@ void ath_draintxq(struct ath_softc *sc, - list_del(&bf->list); - spin_unlock_bh(&txq->axq_lock); - -- spin_lock_bh(&sc->tx.txbuflock); -- list_add_tail(&bf->list, &sc->tx.txbuf); -- spin_unlock_bh(&sc->tx.txbuflock); -+ ath_tx_return_buffer(sc, bf); - continue; - } - } -@@ -1325,25 +1344,6 @@ static void ath_tx_txqaddbuf(struct ath_ - txq->axq_depth++; - } - --static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc) --{ -- struct ath_buf *bf = NULL; -- -- spin_lock_bh(&sc->tx.txbuflock); -- -- if (unlikely(list_empty(&sc->tx.txbuf))) { -- spin_unlock_bh(&sc->tx.txbuflock); -- return NULL; -- } -- -- bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); -- list_del(&bf->list); -- -- spin_unlock_bh(&sc->tx.txbuflock); -- -- return bf; --} -- - static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid, - struct list_head *bf_head, - struct ath_tx_control *txctl) -@@ -1825,9 +1825,7 @@ int ath_tx_start(struct ieee80211_hw *hw - } - spin_unlock_bh(&txq->axq_lock); - -- spin_lock_bh(&sc->tx.txbuflock); -- list_add_tail(&bf->list, &sc->tx.txbuf); -- spin_unlock_bh(&sc->tx.txbuflock); -+ ath_tx_return_buffer(sc, bf); - - return r; - } -@@ -2141,13 +2139,12 @@ static void ath_tx_processq(struct ath_s - txq->axq_depth--; - txok = !(ts.ts_status & ATH9K_TXERR_MASK); - txq->axq_tx_inprogress = false; -+ if (bf_held) -+ list_del(&bf_held->list); - spin_unlock_bh(&txq->axq_lock); - -- if (bf_held) { -- spin_lock_bh(&sc->tx.txbuflock); -- list_move_tail(&bf_held->list, &sc->tx.txbuf); -- spin_unlock_bh(&sc->tx.txbuflock); -- } -+ if (bf_held) -+ ath_tx_return_buffer(sc, bf_held); - - if (!bf_isampdu(bf)) { - /* diff --git a/package/mac80211/patches/561-ath9k_streams_init.patch b/package/mac80211/patches/561-ath9k_streams_init.patch deleted file mode 100644 index 822846661..000000000 --- a/package/mac80211/patches/561-ath9k_streams_init.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -176,6 +176,18 @@ static const struct ath_ops ath9k_common - .write = ath9k_iowrite32, - }; - -+static int count_streams(unsigned int chainmask, int max) -+{ -+ int streams = 0; -+ -+ do { -+ if (++streams == max) -+ break; -+ } while ((chainmask = chainmask & (chainmask - 1))); -+ -+ return streams; -+} -+ - /**************************/ - /* Initialization */ - /**************************/ -@@ -183,8 +195,10 @@ static const struct ath_ops ath9k_common - static void setup_ht_cap(struct ath_softc *sc, - struct ieee80211_sta_ht_cap *ht_info) - { -- struct ath_common *common = ath9k_hw_common(sc->sc_ah); -+ struct ath_hw *ah = sc->sc_ah; -+ struct ath_common *common = ath9k_hw_common(ah); - u8 tx_streams, rx_streams; -+ int i, max_streams; - - ht_info->ht_supported = true; - ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | -@@ -198,25 +212,28 @@ static void setup_ht_cap(struct ath_soft - ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; - ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; - -+ if (AR_SREV_9300_20_OR_LATER(ah)) -+ max_streams = 3; -+ else -+ max_streams = 2; -+ - /* set up supported mcs set */ - memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); -- tx_streams = !(common->tx_chainmask & (common->tx_chainmask - 1)) ? -- 1 : 2; -- rx_streams = !(common->rx_chainmask & (common->rx_chainmask - 1)) ? -- 1 : 2; -+ tx_streams = count_streams(common->tx_chainmask, max_streams); -+ rx_streams = count_streams(common->rx_chainmask, max_streams); -+ -+ ath_print(common, ATH_DBG_CONFIG, -+ "TX streams %d, RX streams: %d\n", -+ tx_streams, rx_streams); - - if (tx_streams != rx_streams) { -- ath_print(common, ATH_DBG_CONFIG, -- "TX streams %d, RX streams: %d\n", -- tx_streams, rx_streams); - ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; - ht_info->mcs.tx_params |= ((tx_streams - 1) << - IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT); - } - -- ht_info->mcs.rx_mask[0] = 0xff; -- if (rx_streams >= 2) -- ht_info->mcs.rx_mask[1] = 0xff; -+ for (i = 0; i < rx_streams; i++) -+ ht_info->mcs.rx_mask[i] = 0xff; - - ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; - } diff --git a/package/mac80211/patches/562-ath9k_4ms_limit_table.patch b/package/mac80211/patches/562-ath9k_4ms_limit_table.patch deleted file mode 100644 index 2eee096a2..000000000 --- a/package/mac80211/patches/562-ath9k_4ms_limit_table.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -71,24 +71,36 @@ static void ath_tx_rc_status(struct ath_ - int nbad, int txok, bool update_rc); - - enum { -- MCS_DEFAULT, -+ MCS_HT20, -+ MCS_HT20_SGI, - MCS_HT40, - MCS_HT40_SGI, - }; - --static int ath_max_4ms_framelen[3][16] = { -- [MCS_DEFAULT] = { -- 3216, 6434, 9650, 12868, 19304, 25740, 28956, 32180, -- 6430, 12860, 19300, 25736, 38600, 51472, 57890, 64320, -+static u16 ath_max_4ms_framelen[4][32] = { -+ [MCS_HT20] = { -+ 3212, 6432, 9648, 12864, 19300, 25736, 28952, 32172, -+ 6424, 12852, 19280, 25708, 38568, 51424, 57852, 64280, -+ 9628, 19260, 28896, 38528, 57792, 65532, 65532, 65532, -+ 12828, 25656, 38488, 51320, 65532, 65532, 65532, 65532, -+ }, -+ [MCS_HT20_SGI] = { -+ 3572, 7144, 10720, 14296, 21444, 28596, 32172, 35744, -+ 7140, 14284, 21428, 28568, 42856, 57144, 64288, 65532, -+ 10700, 21408, 32112, 42816, 64228, 65532, 65532, 65532, -+ 14256, 28516, 42780, 57040, 65532, 65532, 65532, 65532, - }, - [MCS_HT40] = { -- 6684, 13368, 20052, 26738, 40104, 53476, 60156, 66840, -- 13360, 26720, 40080, 53440, 80160, 106880, 120240, 133600, -+ 6680, 13360, 20044, 26724, 40092, 53456, 60140, 65532, -+ 13348, 26700, 40052, 53400, 65532, 65532, 65532, 65532, -+ 20004, 40008, 60016, 65532, 65532, 65532, 65532, 65532, -+ 26644, 53292, 65532, 65532, 65532, 65532, 65532, 65532, - }, - [MCS_HT40_SGI] = { -- /* TODO: Only MCS 7 and 15 updated, recalculate the rest */ -- 6684, 13368, 20052, 26738, 40104, 53476, 60156, 74200, -- 13360, 26720, 40080, 53440, 80160, 106880, 120240, 148400, -+ 7420, 14844, 22272, 29696, 44544, 59396, 65532, 65532, -+ 14832, 29668, 44504, 59340, 65532, 65532, 65532, 65532, -+ 22232, 44464, 65532, 65532, 65532, 65532, 65532, 65532, -+ 29616, 59232, 65532, 65532, 65532, 65532, 65532, 65532, - } - }; - -@@ -538,12 +550,13 @@ static u32 ath_lookup_rate(struct ath_so - break; - } - -- if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) -- modeidx = MCS_HT40_SGI; -- else if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) -+ if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) - modeidx = MCS_HT40; - else -- modeidx = MCS_DEFAULT; -+ modeidx = MCS_HT20; -+ -+ if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) -+ modeidx++; - - frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; - max_4ms_framelen = min(max_4ms_framelen, frmlen); diff --git a/package/mac80211/patches/563-ath9k_bits_per_symbol.patch b/package/mac80211/patches/563-ath9k_bits_per_symbol.patch deleted file mode 100644 index d842e404d..000000000 --- a/package/mac80211/patches/563-ath9k_bits_per_symbol.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -34,7 +34,7 @@ - - #define OFDM_SIFS_TIME 16 - --static u32 bits_per_symbol[][2] = { -+static u16 bits_per_symbol[][2] = { - /* 20MHz 40MHz */ - { 26, 54 }, /* 0: BPSK */ - { 52, 108 }, /* 1: QPSK 1/2 */ -@@ -44,14 +44,6 @@ static u32 bits_per_symbol[][2] = { - { 208, 432 }, /* 5: 64-QAM 2/3 */ - { 234, 486 }, /* 6: 64-QAM 3/4 */ - { 260, 540 }, /* 7: 64-QAM 5/6 */ -- { 52, 108 }, /* 8: BPSK */ -- { 104, 216 }, /* 9: QPSK 1/2 */ -- { 156, 324 }, /* 10: QPSK 3/4 */ -- { 208, 432 }, /* 11: 16-QAM 1/2 */ -- { 312, 648 }, /* 12: 16-QAM 3/4 */ -- { 416, 864 }, /* 13: 64-QAM 2/3 */ -- { 468, 972 }, /* 14: 64-QAM 3/4 */ -- { 520, 1080 }, /* 15: 64-QAM 5/6 */ - }; - - #define IS_HT_RATE(_rate) ((_rate) & 0x80) -@@ -601,7 +593,7 @@ static int ath_compute_num_delims(struct - u32 nsymbits, nsymbols; - u16 minlen; - u8 flags, rix; -- int width, half_gi, ndelim, mindelim; -+ int width, streams, half_gi, ndelim, mindelim; - - /* Select standard number of delimiters based on frame length alone */ - ndelim = ATH_AGGR_GET_NDELIM(frmlen); -@@ -641,7 +633,8 @@ static int ath_compute_num_delims(struct - if (nsymbols == 0) - nsymbols = 1; - -- nsymbits = bits_per_symbol[rix][width]; -+ streams = HT_RC_2_STREAMS(rix); -+ nsymbits = bits_per_symbol[rix % 8][width] * streams; - minlen = (nsymbols * nsymbits) / BITS_PER_BYTE; - - if (frmlen < minlen) { -@@ -1533,8 +1526,9 @@ static u32 ath_pkt_duration(struct ath_s - pktlen = bf_isaggr(bf) ? bf->bf_al : bf->bf_frmlen; - - /* find number of symbols: PLCP + data */ -+ streams = HT_RC_2_STREAMS(rix); - nbits = (pktlen << 3) + OFDM_PLCP_BITS; -- nsymbits = bits_per_symbol[rix][width]; -+ nsymbits = bits_per_symbol[rix % 8][width] * streams; - nsymbols = (nbits + nsymbits - 1) / nsymbits; - - if (!half_gi) -@@ -1543,7 +1537,6 @@ static u32 ath_pkt_duration(struct ath_s - duration = SYMBOL_TIME_HALFGI(nsymbols); - - /* addup duration for legacy/ht training and signal fields */ -- streams = HT_RC_2_STREAMS(rix); - duration += L_STF + L_LTF + L_SIG + HT_SIG + HT_STF + HT_LTF(streams); - - return duration; diff --git a/package/mac80211/patches/564-ath9k_mcs_mask_fix.patch b/package/mac80211/patches/564-ath9k_mcs_mask_fix.patch deleted file mode 100644 index 4d0ac2de1..000000000 --- a/package/mac80211/patches/564-ath9k_mcs_mask_fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -19,7 +19,7 @@ - - #define BITS_PER_BYTE 8 - #define OFDM_PLCP_BITS 22 --#define HT_RC_2_MCS(_rc) ((_rc) & 0x0f) -+#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f) - #define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) - #define L_STF 8 - #define L_LTF 8 diff --git a/package/mac80211/patches/565-mac80211_rx_stbc_define.patch b/package/mac80211/patches/565-mac80211_rx_stbc_define.patch deleted file mode 100644 index 9202708d4..000000000 --- a/package/mac80211/patches/565-mac80211_rx_stbc_define.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/include/linux/ieee80211.h -+++ b/include/linux/ieee80211.h -@@ -876,6 +876,7 @@ struct ieee80211_ht_cap { - #define IEEE80211_HT_CAP_SGI_40 0x0040 - #define IEEE80211_HT_CAP_TX_STBC 0x0080 - #define IEEE80211_HT_CAP_RX_STBC 0x0300 -+#define IEEE80211_HT_CAP_RX_STBC_SHIFT 8 - #define IEEE80211_HT_CAP_DELAY_BA 0x0400 - #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 - #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -275,6 +275,8 @@ struct ieee80211_bss_conf { - * MLME command (internal to mac80211 to figure out whether to send TX - * status to user space) - * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame -+ * @IEEE80211_TX_CTL_STBC: tells the driver to use Space-Time Block Coding -+ * (STBC) for this frame. - */ - enum mac80211_tx_control_flags { - IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), -@@ -299,6 +301,7 @@ enum mac80211_tx_control_flags { - IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), - IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), - IEEE80211_TX_CTL_LDPC = BIT(22), -+ IEEE80211_TX_CTL_STBC = BIT(23), - }; - - /** diff --git a/package/mac80211/patches/566-ath9k_stbc_support.patch b/package/mac80211/patches/566-ath9k_stbc_support.patch deleted file mode 100644 index b403377b5..000000000 --- a/package/mac80211/patches/566-ath9k_stbc_support.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -217,6 +217,12 @@ static void setup_ht_cap(struct ath_soft - else - max_streams = 2; - -+ if (AR_SREV_9280_10_OR_LATER(ah)) { -+ if (max_streams >= 2) -+ ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; -+ ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT); -+ } -+ - /* set up supported mcs set */ - memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); - tx_streams = count_streams(common->tx_chainmask, max_streams); ---- a/drivers/net/wireless/ath/ath9k/mac.h -+++ b/drivers/net/wireless/ath/ath9k/mac.h -@@ -37,6 +37,8 @@ - AR_2040_##_index : 0) \ - |((_series)[_index].RateFlags & ATH9K_RATESERIES_HALFGI ? \ - AR_GI##_index : 0) \ -+ |((_series)[_index].RateFlags & ATH9K_RATESERIES_STBC ? \ -+ AR_STBC##_index : 0) \ - |SM((_series)[_index].ChSel, AR_ChainSel##_index)) - - #define CCK_SIFS_TIME 10 -@@ -434,7 +436,10 @@ struct ar5416_desc { - #define AR_ChainSel3_S 17 - #define AR_RTSCTSRate 0x0ff00000 - #define AR_RTSCTSRate_S 20 --#define AR_TxCtlRsvd70 0xf0000000 -+#define AR_STBC0 0x10000000 -+#define AR_STBC1 0x20000000 -+#define AR_STBC2 0x40000000 -+#define AR_STBC3 0x80000000 - - #define AR_TxRSSIAnt00 0x000000ff - #define AR_TxRSSIAnt00_S 0 -@@ -647,6 +652,7 @@ enum ath9k_rx_filter { - #define ATH9K_RATESERIES_RTS_CTS 0x0001 - #define ATH9K_RATESERIES_2040 0x0002 - #define ATH9K_RATESERIES_HALFGI 0x0004 -+#define ATH9K_RATESERIES_STBC 0x0008 - - struct ath9k_11n_rate_series { - u32 Tries; ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1607,6 +1607,8 @@ static void ath_buf_set_rate(struct ath_ - series[i].Rate = rix | 0x80; - series[i].PktDuration = ath_pkt_duration(sc, rix, bf, - is_40, is_sgi, is_sp); -+ if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) -+ series[i].RateFlags |= ATH9K_RATESERIES_STBC; - continue; - } - diff --git a/package/mac80211/patches/567-ath9k_rc_stbc_support.patch b/package/mac80211/patches/567-ath9k_rc_stbc_support.patch deleted file mode 100644 index 4a4b099ce..000000000 --- a/package/mac80211/patches/567-ath9k_rc_stbc_support.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/rc.c -+++ b/drivers/net/wireless/ath/ath9k/rc.c -@@ -700,6 +700,10 @@ static void ath_get_rate(void *priv, str - (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)) - tx_info->flags |= IEEE80211_TX_CTL_LDPC; - -+ if (conf_is_ht(&sc->hw->conf) && -+ (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)) -+ tx_info->flags |= IEEE80211_TX_CTL_STBC; -+ - if (is_probe) { - /* set one try for probe rates. For the - * probes don't enable rts */ |