diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-04-14 12:17:34 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-04-14 12:17:34 +0000 |
commit | cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d (patch) | |
tree | 580c994a8d121e191f2de5383c8de7ea84afb665 /package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch | |
parent | 054044ff91891723025a6b35bd583c98e141ea3d (diff) | |
download | master-187ad058-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.tar.gz master-187ad058-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.tar.bz2 master-187ad058-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.zip |
mac80211: merge a number of upstream driver fixes/improvements
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45432 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch')
-rw-r--r-- | package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch b/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch new file mode 100644 index 0000000000..e5a362ffa6 --- /dev/null +++ b/package/kernel/mac80211/patches/327-ath9k-ath9k_hw_loadnf-use-REG_RMW.patch @@ -0,0 +1,71 @@ +From: Oleksij Rempel <linux@rempel-privat.de> +Date: Sun, 22 Mar 2015 19:29:54 +0100 +Subject: [PATCH] ath9k: ath9k_hw_loadnf: use REG_RMW + +Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + +--- a/drivers/net/wireless/ath/ath9k/calib.c ++++ b/drivers/net/wireless/ath/ath9k/calib.c +@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + { + struct ath9k_nfcal_hist *h = NULL; + unsigned i, j; +- int32_t val; + u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask; + struct ath_common *common = ath9k_hw_common(ah); + s16 default_nf = ath9k_hw_get_default_nf(ah, chan); +@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + if (ah->caldata) + h = ah->caldata->nfCalHist; + ++ ENABLE_REG_RMW_BUFFER(ah); + for (i = 0; i < NUM_NF_READINGS; i++) { + if (chainmask & (1 << i)) { + s16 nfval; +@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + else + nfval = default_nf; + +- val = REG_READ(ah, ah->nf_regs[i]); +- val &= 0xFFFFFE00; +- val |= (((u32) nfval << 1) & 0x1ff); +- REG_WRITE(ah, ah->nf_regs[i], val); ++ REG_RMW(ah, ah->nf_regs[i], ++ (((u32) nfval << 1) & 0x1ff), 0x1ff); + } + } + +@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_NO_UPDATE_NF); + REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); ++ REG_RMW_BUFFER_FLUSH(ah); + + /* + * Wait for load to complete, should be fast, a few 10s of us. +@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, s + * by the median we just loaded. This will be initial (and max) value + * of next noise floor calibration the baseband does. + */ +- ENABLE_REGWRITE_BUFFER(ah); ++ ENABLE_REG_RMW_BUFFER(ah); + for (i = 0; i < NUM_NF_READINGS; i++) { + if (chainmask & (1 << i)) { + if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan)) + continue; + +- val = REG_READ(ah, ah->nf_regs[i]); +- val &= 0xFFFFFE00; +- val |= (((u32) (-50) << 1) & 0x1ff); +- REG_WRITE(ah, ah->nf_regs[i], val); ++ REG_RMW(ah, ah->nf_regs[i], ++ (((u32) (-50) << 1) & 0x1ff), 0x1ff); + } + } +- REGWRITE_BUFFER_FLUSH(ah); ++ REG_RMW_BUFFER_FLUSH(ah); + + return 0; + } |