From be0769dcae5a6207858457472a9800aa37c09c9a Mon Sep 17 00:00:00 2001 From: mtaylor Date: Mon, 29 Oct 2007 22:34:55 +0000 Subject: [PATCH] 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 --- ath_rate/sample/sample.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ath_rate/sample/sample.c b/ath_rate/sample/sample.c index 786fa4b..569f8dc 100644 --- a/ath_rate/sample/sample.c +++ b/ath_rate/sample/sample.c @@ -759,7 +759,7 @@ ath_rate_tx_complete(struct ath_softc *sc, * sample higher rates 1 try at a time doing so * may unfairly penalize them. */ - if (tries[0]) { + if (tries[0] && ndx[0] >= 0) { update_stats(sc, an, frame_size, ndx[0], tries[0], 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, ndx[1], tries[1], ndx[2], tries[2], @@ -782,7 +782,7 @@ ath_rate_tx_complete(struct ath_softc *sc, long_tries -= tries[1]; } - if (tries[2] && finalTSIdx > 1) { + if (tries[2] && ndx[2] >= 0 && finalTSIdx > 1) { update_stats(sc, an, frame_size, ndx[2], tries[2], ndx[3], tries[3], @@ -793,7 +793,7 @@ ath_rate_tx_complete(struct ath_softc *sc, long_tries -= tries[2]; } - if (tries[3] && finalTSIdx > 2) { + if (tries[3] && ndx[3] >= 0 && finalTSIdx > 2) { update_stats(sc, an, frame_size, ndx[3], tries[3], 0, 0, -- 2.35.1