|
@@ -46,8 +46,8 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = {
|
|
|
{ 5, 4, 1 }, /* lvl 5 */
|
|
|
{ 6, 5, 1 }, /* lvl 6 */
|
|
|
{ 7, 6, 1 }, /* lvl 7 */
|
|
|
- { 7, 7, 1 }, /* lvl 8 */
|
|
|
- { 7, 8, 0 } /* lvl 9 */
|
|
|
+ { 7, 6, 0 }, /* lvl 8 */
|
|
|
+ { 7, 7, 0 } /* lvl 9 */
|
|
|
};
|
|
|
#define ATH9K_ANI_OFDM_NUM_LEVEL \
|
|
|
ARRAY_SIZE(ofdm_level_table)
|
|
@@ -91,8 +91,8 @@ static const struct ani_cck_level_entry cck_level_table[] = {
|
|
|
{ 4, 0 }, /* lvl 4 */
|
|
|
{ 5, 0 }, /* lvl 5 */
|
|
|
{ 6, 0 }, /* lvl 6 */
|
|
|
- { 7, 0 }, /* lvl 7 (only for high rssi) */
|
|
|
- { 8, 0 } /* lvl 8 (only for high rssi) */
|
|
|
+ { 6, 0 }, /* lvl 7 (only for high rssi) */
|
|
|
+ { 7, 0 } /* lvl 8 (only for high rssi) */
|
|
|
};
|
|
|
|
|
|
#define ATH9K_ANI_CCK_NUM_LEVEL \
|
|
@@ -290,16 +290,9 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
|
|
|
ATH9K_ANI_FIRSTEP_LEVEL,
|
|
|
entry_ofdm->fir_step_level);
|
|
|
|
|
|
- if ((ah->opmode != NL80211_IFTYPE_STATION &&
|
|
|
- ah->opmode != NL80211_IFTYPE_ADHOC) ||
|
|
|
- aniState->noiseFloor <= aniState->rssiThrHigh) {
|
|
|
- if (aniState->ofdmWeakSigDetectOff)
|
|
|
- /* force on ofdm weak sig detect */
|
|
|
- ath9k_hw_ani_control(ah,
|
|
|
- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
|
|
|
- true);
|
|
|
- else if (aniState->ofdmWeakSigDetectOff ==
|
|
|
- entry_ofdm->ofdm_weak_signal_on)
|
|
|
+ if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
|
|
|
+ (!aniState->ofdmWeakSigDetectOff !=
|
|
|
+ entry_ofdm->ofdm_weak_signal_on)) {
|
|
|
ath9k_hw_ani_control(ah,
|
|
|
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
|
|
|
entry_ofdm->ofdm_weak_signal_on);
|
|
@@ -717,26 +710,30 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
|
|
|
ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
|
|
|
cckPhyErrRate, aniState->ofdmsTurn);
|
|
|
|
|
|
- if (aniState->listenTime > 5 * ah->aniperiod) {
|
|
|
- if (ofdmPhyErrRate <= ah->config.ofdm_trig_low &&
|
|
|
- cckPhyErrRate <= ah->config.cck_trig_low) {
|
|
|
+ if (aniState->listenTime > ah->aniperiod) {
|
|
|
+ if (cckPhyErrRate < ah->config.cck_trig_low &&
|
|
|
+ ((ofdmPhyErrRate < ah->config.ofdm_trig_low &&
|
|
|
+ aniState->ofdmNoiseImmunityLevel <
|
|
|
+ ATH9K_ANI_OFDM_DEF_LEVEL) ||
|
|
|
+ (ofdmPhyErrRate < ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI &&
|
|
|
+ aniState->ofdmNoiseImmunityLevel >=
|
|
|
+ ATH9K_ANI_OFDM_DEF_LEVEL))) {
|
|
|
ath9k_hw_ani_lower_immunity(ah);
|
|
|
aniState->ofdmsTurn = !aniState->ofdmsTurn;
|
|
|
- }
|
|
|
- ath9k_ani_restart(ah);
|
|
|
- } else if (aniState->listenTime > ah->aniperiod) {
|
|
|
- /* check to see if need to raise immunity */
|
|
|
- if (ofdmPhyErrRate > ah->config.ofdm_trig_high &&
|
|
|
- (cckPhyErrRate <= ah->config.cck_trig_high ||
|
|
|
- aniState->ofdmsTurn)) {
|
|
|
+ } else if ((ofdmPhyErrRate > ah->config.ofdm_trig_high &&
|
|
|
+ aniState->ofdmNoiseImmunityLevel >=
|
|
|
+ ATH9K_ANI_OFDM_DEF_LEVEL) ||
|
|
|
+ (ofdmPhyErrRate >
|
|
|
+ ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI &&
|
|
|
+ aniState->ofdmNoiseImmunityLevel <
|
|
|
+ ATH9K_ANI_OFDM_DEF_LEVEL)) {
|
|
|
ath9k_hw_ani_ofdm_err_trigger(ah);
|
|
|
- ath9k_ani_restart(ah);
|
|
|
aniState->ofdmsTurn = false;
|
|
|
} else if (cckPhyErrRate > ah->config.cck_trig_high) {
|
|
|
ath9k_hw_ani_cck_err_trigger(ah);
|
|
|
- ath9k_ani_restart(ah);
|
|
|
aniState->ofdmsTurn = true;
|
|
|
}
|
|
|
+ ath9k_ani_restart(ah);
|
|
|
}
|
|
|
}
|
|
|
EXPORT_SYMBOL(ath9k_hw_ani_monitor);
|