When a channel switch announcement (CSA) happens either through an action frame or a beacon, the sampling algorithm can get back responses with a rate of zero which result in rate index lookups that fail with -1 as a return value.

We just need to ignore these, as the sample rate control algorithm will recover quickly.

Previously, after a channel switch due to radar or command line channel change, we would see lots of error messages spewed to the logs about invalid rate indexes from the sample alg.  This just squelches those messages.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2799 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mtaylor 2007-10-29 22:34:55 +00:00
parent d2fd0a8446
commit be0769dcae
1 changed files with 4 additions and 4 deletions

View File

@ -759,7 +759,7 @@ ath_rate_tx_complete(struct ath_softc *sc,
* sample higher rates 1 try at a time doing so * sample higher rates 1 try at a time doing so
* may unfairly penalize them. * may unfairly penalize them.
*/ */
if (tries[0]) { if (tries[0] && ndx[0] >= 0) {
update_stats(sc, an, frame_size, update_stats(sc, an, frame_size,
ndx[0], tries[0], ndx[0], tries[0],
ndx[1], tries[1], ndx[1], tries[1],
@ -771,7 +771,7 @@ ath_rate_tx_complete(struct ath_softc *sc,
} }
if (tries[1] && finalTSIdx > 0) { if (tries[1] && ndx[1] >= 0 && finalTSIdx > 0) {
update_stats(sc, an, frame_size, update_stats(sc, an, frame_size,
ndx[1], tries[1], ndx[1], tries[1],
ndx[2], tries[2], ndx[2], tries[2],
@ -782,7 +782,7 @@ ath_rate_tx_complete(struct ath_softc *sc,
long_tries -= tries[1]; long_tries -= tries[1];
} }
if (tries[2] && finalTSIdx > 1) { if (tries[2] && ndx[2] >= 0 && finalTSIdx > 1) {
update_stats(sc, an, frame_size, update_stats(sc, an, frame_size,
ndx[2], tries[2], ndx[2], tries[2],
ndx[3], tries[3], ndx[3], tries[3],
@ -793,7 +793,7 @@ ath_rate_tx_complete(struct ath_softc *sc,
long_tries -= tries[2]; long_tries -= tries[2];
} }
if (tries[3] && finalTSIdx > 2) { if (tries[3] && ndx[3] >= 0 && finalTSIdx > 2) {
update_stats(sc, an, frame_size, update_stats(sc, an, frame_size,
ndx[3], tries[3], ndx[3], tries[3],
0, 0, 0, 0,