From: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>,
Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Subject: [PATCH 12/14] ath9k_hw: Do fast channel change based on reusable calibration results
Date: Fri, 7 Oct 2011 17:17:17 +0530 [thread overview]
Message-ID: <1317988039-28632-12-git-send-email-rmanohar@qca.qualcomm.com> (raw)
In-Reply-To: <1317988039-28632-1-git-send-email-rmanohar@qca.qualcomm.com>
Support the fast channel change across band switch only when there
are available of reusable cabliration results. And also observed that
doing agc control calibration on fastcc, sometimes causing calibration
timeout. Hence changing agc control to be run only on full chip reset.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 3 +--
drivers/net/wireless/ath/ath9k/hw.c | 14 ++++++++++++--
drivers/net/wireless/ath/ath9k/hw.h | 1 +
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index d5b671a..3a2fd53 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1007,8 +1007,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
skip_tx_iqcal:
-
- if (run_agc_cal) {
+ if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
/* Calibrate the AGC */
REG_WRITE(ah, AR_PHY_AGC_CONTROL,
REG_READ(ah, AR_PHY_AGC_CONTROL) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 96dc730..e5dbf12 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1455,6 +1455,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
ath9k_hw_spur_mitigate_freq(ah, chan);
if (edma && (band_switch || mode_diff)) {
+ ah->ah_flags |= AH_FASTCC;
if (band_switch || ini_reloaded)
ah->eep_ops->set_board_values(ah, chan);
@@ -1462,6 +1463,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
if (band_switch || ini_reloaded)
ath9k_hw_init_cal(ah, chan);
+ ah->ah_flags &= ~AH_FASTCC;
}
return true;
@@ -1519,6 +1521,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
u32 macStaId1;
u64 tsf = 0;
int i, r;
+ bool allow_fbs = false;
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
return -EIO;
@@ -1540,12 +1543,19 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
if (AR_SREV_9280(ah) && common->bus_ops->ath_bus_type == ATH_PCI)
bChannelChange = false;
+ if (caldata &&
+ caldata->done_txiqcal_once &&
+ caldata->done_txclcal_once &&
+ caldata->rtt_hist.num_readings)
+ allow_fbs = true;
+
if (bChannelChange &&
(ah->chip_fullsleep != true) &&
(ah->curchan != NULL) &&
(chan->channel != ah->curchan->channel) &&
- ((chan->channelFlags & CHANNEL_ALL) ==
- (ah->curchan->channelFlags & CHANNEL_ALL))) {
+ (allow_fbs ||
+ ((chan->channelFlags & CHANNEL_ALL) ==
+ (ah->curchan->channelFlags & CHANNEL_ALL)))) {
if (ath9k_hw_channel_change(ah, chan)) {
ath9k_hw_loadnf(ah, ah->curchan);
ath9k_hw_start_nfcal(ah, true);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 64f5a92..3ed3619 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -660,6 +660,7 @@ enum ath_cal_list {
/* ah_flags */
#define AH_USE_EEPROM 0x1
#define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
+#define AH_FASTCC 0x4
struct ath_hw {
struct ath_ops reg_ops;
--
1.7.7
next prev parent reply other threads:[~2011-10-07 11:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 11:47 [PATCH 01/14] ath9k_hw: Updated ar9003 initval table for AR9380 Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 02/14] ath9k_hw: Update AR9003 initval to improve phase noise Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 03/14] ath9k_hw: Updated AR9003 tx gain table for 5GHz Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 04/14] ath9k_hw: Improve fast channel change for AR9003 chips Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 05/14] ath9k_hw: Add support to reuse TxIQ cal measurements Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 06/14] ath9k_hw: Add support to reuse Carrier leak calibration Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 07/14] ath9k_hw: Cleanup Tx calibrations for AR9003 chips Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 08/14] ath9k_hw: Support fast channel change on 5GHz " Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 09/14] ath9k_hw: Fix ASPM L1 issue for AR9480 Rajkumar Manoharan
2011-10-07 15:49 ` Luis R. Rodriguez
2011-10-07 16:27 ` Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 10/14] ath9k_hw: Update normal/min noise floor value " Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 11/14] ath9k_hw: Add radio retention support " Rajkumar Manoharan
2011-10-07 11:47 ` Rajkumar Manoharan [this message]
2011-10-07 11:47 ` [PATCH 13/14] ath9k_hw: Rename AR9480 -> AR9462 initvals Rajkumar Manoharan
2011-10-07 15:47 ` Luis R. Rodriguez
2011-10-07 16:25 ` Rajkumar Manoharan
2011-10-07 11:47 ` [PATCH 14/14] ath9k: Rename AR9480 into AR9462 Rajkumar Manoharan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317988039-28632-12-git-send-email-rmanohar@qca.qualcomm.com \
--to=rmanohar@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox