When a channel switch announcement (CSA) happens either through an action frame or...
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Mon, 29 Oct 2007 22:34:55 +0000 (22:34 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Mon, 29 Oct 2007 22:34:55 +0000 (22:34 +0000)
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

index 786fa4b2240c482701d22a8c84f3d680f4d1c201..569f8dcfdeb866ee96e6edae86df8845c104f9f6 100644 (file)
@@ -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,