Skip to content

Commit e225567

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
2 parents 4b030d4 + a24d52f commit e225567

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+866
-301
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,6 @@ F: drivers/net/wireless/ath/ath5k/
10871087
ATHEROS ATH9K WIRELESS DRIVER
10881088
M: "Luis R. Rodriguez" <[email protected]>
10891089
M: Jouni Malinen <[email protected]>
1090-
M: Sujith Manoharan <[email protected]>
10911090
M: Vasanthakumar Thiagarajan <[email protected]>
10921091
M: Senthil Balasubramanian <[email protected]>
10931092

drivers/net/wireless/ath/ath9k/ar9002_calib.c

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static bool ar9002_hw_per_calibration(struct ath_hw *ah,
6363
u8 rxchainmask,
6464
struct ath9k_cal_list *currCal)
6565
{
66+
struct ath9k_hw_cal_data *caldata = ah->caldata;
6667
bool iscaldone = false;
6768

6869
if (currCal->calState == CAL_RUNNING) {
@@ -81,14 +82,14 @@ static bool ar9002_hw_per_calibration(struct ath_hw *ah,
8182
}
8283

8384
currCal->calData->calPostProc(ah, numChains);
84-
ichan->CalValid |= currCal->calData->calType;
85+
caldata->CalValid |= currCal->calData->calType;
8586
currCal->calState = CAL_DONE;
8687
iscaldone = true;
8788
} else {
8889
ar9002_hw_setup_calibration(ah, currCal);
8990
}
9091
}
91-
} else if (!(ichan->CalValid & currCal->calData->calType)) {
92+
} else if (!(caldata->CalValid & currCal->calData->calType)) {
9293
ath9k_hw_reset_calibration(ah, currCal);
9394
}
9495

@@ -686,8 +687,13 @@ static bool ar9002_hw_calibrate(struct ath_hw *ah,
686687
{
687688
bool iscaldone = true;
688689
struct ath9k_cal_list *currCal = ah->cal_list_curr;
690+
bool nfcal, nfcal_pending = false;
689691

690-
if (currCal &&
692+
nfcal = !!(REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF);
693+
if (ah->caldata)
694+
nfcal_pending = ah->caldata->nfcal_pending;
695+
696+
if (currCal && !nfcal &&
691697
(currCal->calState == CAL_RUNNING ||
692698
currCal->calState == CAL_WAITING)) {
693699
iscaldone = ar9002_hw_per_calibration(ah, chan,
@@ -703,7 +709,7 @@ static bool ar9002_hw_calibrate(struct ath_hw *ah,
703709
}
704710

705711
/* Do NF cal only at longer intervals */
706-
if (longcal) {
712+
if (longcal || nfcal_pending) {
707713
/* Do periodic PAOffset Cal */
708714
ar9002_hw_pa_cal(ah, false);
709715
ar9002_hw_olc_temp_compensation(ah);
@@ -712,16 +718,18 @@ static bool ar9002_hw_calibrate(struct ath_hw *ah,
712718
* Get the value from the previous NF cal and update
713719
* history buffer.
714720
*/
715-
ath9k_hw_getnf(ah, chan);
716-
717-
/*
718-
* Load the NF from history buffer of the current channel.
719-
* NF is slow time-variant, so it is OK to use a historical
720-
* value.
721-
*/
722-
ath9k_hw_loadnf(ah, ah->curchan);
721+
if (ath9k_hw_getnf(ah, chan)) {
722+
/*
723+
* Load the NF from history buffer of the current
724+
* channel.
725+
* NF is slow time-variant, so it is OK to use a
726+
* historical value.
727+
*/
728+
ath9k_hw_loadnf(ah, ah->curchan);
729+
}
723730

724-
ath9k_hw_start_nfcal(ah);
731+
if (longcal)
732+
ath9k_hw_start_nfcal(ah, false);
725733
}
726734

727735
return iscaldone;
@@ -869,8 +877,10 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
869877
ar9002_hw_pa_cal(ah, true);
870878

871879
/* Do NF Calibration after DC offset and other calibrations */
872-
REG_WRITE(ah, AR_PHY_AGC_CONTROL,
873-
REG_READ(ah, AR_PHY_AGC_CONTROL) | AR_PHY_AGC_CONTROL_NF);
880+
ath9k_hw_start_nfcal(ah, true);
881+
882+
if (ah->caldata)
883+
ah->caldata->nfcal_pending = true;
874884

875885
ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
876886

@@ -901,7 +911,8 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
901911
ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
902912
}
903913

904-
chan->CalValid = 0;
914+
if (ah->caldata)
915+
ah->caldata->CalValid = 0;
905916

906917
return true;
907918
}

drivers/net/wireless/ath/ath9k/ar9003_calib.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
6868
u8 rxchainmask,
6969
struct ath9k_cal_list *currCal)
7070
{
71+
struct ath9k_hw_cal_data *caldata = ah->caldata;
7172
/* Cal is assumed not done until explicitly set below */
7273
bool iscaldone = false;
7374

@@ -95,7 +96,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
9596
currCal->calData->calPostProc(ah, numChains);
9697

9798
/* Calibration has finished. */
98-
ichan->CalValid |= currCal->calData->calType;
99+
caldata->CalValid |= currCal->calData->calType;
99100
currCal->calState = CAL_DONE;
100101
iscaldone = true;
101102
} else {
@@ -106,7 +107,7 @@ static bool ar9003_hw_per_calibration(struct ath_hw *ah,
106107
ar9003_hw_setup_calibration(ah, currCal);
107108
}
108109
}
109-
} else if (!(ichan->CalValid & currCal->calData->calType)) {
110+
} else if (!(caldata->CalValid & currCal->calData->calType)) {
110111
/* If current cal is marked invalid in channel, kick it off */
111112
ath9k_hw_reset_calibration(ah, currCal);
112113
}
@@ -148,6 +149,12 @@ static bool ar9003_hw_calibrate(struct ath_hw *ah,
148149

149150
/* Do NF cal only at longer intervals */
150151
if (longcal) {
152+
/*
153+
* Get the value from the previous NF cal and update
154+
* history buffer.
155+
*/
156+
ath9k_hw_getnf(ah, chan);
157+
151158
/*
152159
* Load the NF from history buffer of the current channel.
153160
* NF is slow time-variant, so it is OK to use a historical
@@ -156,7 +163,7 @@ static bool ar9003_hw_calibrate(struct ath_hw *ah,
156163
ath9k_hw_loadnf(ah, ah->curchan);
157164

158165
/* start NF calibration, without updating BB NF register */
159-
ath9k_hw_start_nfcal(ah);
166+
ath9k_hw_start_nfcal(ah, false);
160167
}
161168

162169
return iscaldone;
@@ -762,6 +769,8 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
762769
/* Revert chainmasks to their original values before NF cal */
763770
ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
764771

772+
ath9k_hw_start_nfcal(ah, true);
773+
765774
/* Initialize list pointers */
766775
ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
767776

@@ -785,7 +794,8 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
785794
if (ah->cal_list_curr)
786795
ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
787796

788-
chan->CalValid = 0;
797+
if (ah->caldata)
798+
ah->caldata->CalValid = 0;
789799

790800
return true;
791801
}

0 commit comments

Comments
 (0)