aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ar9003_calib.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-07-31 00:12:00 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-08-04 15:27:37 -0400
commit20bd2a0952d01ba82a99b3f22d46e3832c255529 (patch)
treed875681269e087e6a148593bb1d436849e642b7f /drivers/net/wireless/ath/ath9k/ar9003_calib.c
parent5ee0865615f65f84e6ee9174771a6716c29e08e1 (diff)
downloadkernel_samsung_smdk4412-20bd2a0952d01ba82a99b3f22d46e3832c255529.zip
kernel_samsung_smdk4412-20bd2a0952d01ba82a99b3f22d46e3832c255529.tar.gz
kernel_samsung_smdk4412-20bd2a0952d01ba82a99b3f22d46e3832c255529.tar.bz2
ath9k_hw: clean up per-channel calibration data
The noise floor history buffer is currently not kept per channel, which can lead to problems when changing channels from a clean channel to a noisy one. Also when switching from HT20 to HT40, the noise floor history buffer is full of measurements, but none of them contain data for the extension channel, which it needs quite a bit of time to recover from. This patch puts all the per-channel calibration data into a single data structure, and gives the the driver control over whether that is used per-channel or even not used for some channels. For ath9k_htc, I decided to keep this per-channel in order to avoid creating regressions. For ath9k, the data is kept only for the operating channel, which saves some space. ath9k_hw takes care of wiping old data when the operating channel or its channel flags change. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_calib.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_calib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index f51ab89..4674ea8 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -68,6 +68,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
u8 rxchainmask,
struct ath9k_cal_list *currCal)
{
+ struct ath9k_hw_cal_data *caldata = ah->caldata;
/* Cal is assumed not done until explicitly set below */
bool iscaldone = false;
@@ -95,7 +96,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
currCal->calData->calPostProc(ah, numChains);
/* Calibration has finished. */
- ichan->CalValid |= currCal->calData->calType;
+ caldata->CalValid |= currCal->calData->calType;
currCal->calState = CAL_DONE;
iscaldone = true;
} else {
@@ -106,7 +107,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
ar9003_hw_setup_calibration(ah, currCal);
}
}
- } else if (!(ichan->CalValid & currCal->calData->calType)) {
+ } else if (!(caldata->CalValid & currCal->calData->calType)) {
/* If current cal is marked invalid in channel, kick it off */
ath9k_hw_reset_calibration(ah, currCal);
}
@@ -793,7 +794,8 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
if (ah->cal_list_curr)
ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
- chan->CalValid = 0;
+ if (ah->caldata)
+ ah->caldata->CalValid = 0;
return true;
}