Loading the NF CCA values may take longer than expected to occur.
If it does, don't then try reprogramming the NF "cap" values (ie what values are the "maximum" value the NF can be) - instead, just leave the current CCA value as the NF cap. This was inspired by some similar work from ath9k. It isn't a 100% complete solution (as there may be some reason where a high NF CCA/cap is written, causing the baseband to stop thinking it is able to transmit, leading to stuck beacon and interface reset) which I'll investigate and look at fixing in a later commit. Obtained from: Linux
This commit is contained in:
parent
5215ce1038
commit
52f81b679a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211211
@ -527,7 +527,7 @@ ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *chan)
|
||||
AR_PHY_CH2_EXT_CCA
|
||||
};
|
||||
struct ar5212NfCalHist *h;
|
||||
int i, j;
|
||||
int i;
|
||||
int32_t val;
|
||||
uint8_t chainmask;
|
||||
|
||||
@ -562,11 +562,20 @@ ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *chan)
|
||||
OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
|
||||
OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
|
||||
|
||||
/* Wait for load to complete, should be fast, a few 10s of us. */
|
||||
for (j = 0; j < 1000; j++) {
|
||||
if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0)
|
||||
break;
|
||||
OS_DELAY(10);
|
||||
if (! ar5212WaitNFCalComplete(ah, 1000)) {
|
||||
/*
|
||||
* We timed out waiting for the noisefloor to load, probably due to an
|
||||
* in-progress rx. Simply return here and allow the load plenty of time
|
||||
* to complete before the next calibration interval. We need to avoid
|
||||
* trying to load -50 (which happens below) while the previous load is
|
||||
* still in progress as this can cause rx deafness. Instead by returning
|
||||
* here, the baseband nf cal will just be capped by our present
|
||||
* noisefloor until the next calibration timer.
|
||||
*/
|
||||
HALDEBUG(ah, HAL_DEBUG_ANY, "Timeout while waiting for nf "
|
||||
"to load: AR_PHY_AGC_CONTROL=0x%x\n",
|
||||
OS_REG_READ(ah, AR_PHY_AGC_CONTROL));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user