logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

revision 3013 committed: msg#00019

Subject: revision 3013 committed
Project     : madwifi
Revision    : 3013
Author      : br1 (Bruno Randolf)
Date        : 2007-12-10 14:15:06 +0100 (Mon, 10 Dec 2007)

Log Message :
guard against 0 rates which can be caused by wrong received frames.

Affected Files:
* madwifi/trunk/ath/if_ath.c                          updated             
* madwifi/trunk/net80211/ieee80211_input.c            updated             
* madwifi/trunk/net80211/ieee80211_proto.c            updated             


Modified: madwifi/trunk/ath/if_ath.c
===================================================================
--- madwifi/trunk/ath/if_ath.c  2007-12-07 22:12:22 UTC (rev 3012)
+++ madwifi/trunk/ath/if_ath.c  2007-12-10 13:15:06 UTC (rev 3013)
@@ -7520,6 +7520,17 @@
        } else
                antenna = sc->sc_txantenna;
 
+       /* should be ok, but just to be sure */
+       if (txrate == 0)
+               return -EIO;
+
+       DPRINTF(sc, ATH_DEBUG_XMIT, "%s: set up txdesc: pktlen %d hdrlen %d "
+               "atype %d txpower %d txrate %d try0 %d keyix %d ant %d flags %x 
"
+               "ctsrate %d ctsdur %d icvlen %d ivlen %d comp %d\n",
+               __func__, pktlen, hdrlen, atype, MIN(ni->ni_txpower, 60), 
txrate,
+               try0, keyix, antenna, flags, ctsrate, ctsduration, icvlen, 
ivlen,
+               comp);
+
        /*
         * Formulate first tx descriptor with tx controls.
         */
@@ -7551,6 +7562,20 @@
        if (try0 != ATH_TXMAXTRY) {
                sc->sc_rc->ops->get_mrr(sc, an, shortPreamble, skb->len, rix,
                                        &mrr);
+               /*
+                * if rate module fucks up and gives us 0 rates we disable the
+                * multi rate retries. this is important since 0 rates can lead
+                * to a card continously sending noise (in A band at least)
+                */
+               if (!mrr.rate1) mrr.retries1 = 0;
+               if (!mrr.rate2) mrr.retries2 = 0;
+               if (!mrr.rate3) mrr.retries3 = 0;
+
+               DPRINTF(sc, ATH_DEBUG_XMIT, "%s: set up multi rate/retry "
+                       "1:%d/%d 2:%d/%d 3:%d/%d\n", __func__,
+                       mrr.rate1, mrr.retries1, mrr.rate2, mrr.retries2,
+                       mrr.rate3, mrr.retries3);
+
                ath_hal_setupxtxdesc(sc->sc_ah, ds, mrr.rate1, mrr.retries1,
                                     mrr.rate2, mrr.retries2,
                                     mrr.rate3, mrr.retries3);

Modified: madwifi/trunk/net80211/ieee80211_input.c
===================================================================
--- madwifi/trunk/net80211/ieee80211_input.c    2007-12-07 22:12:22 UTC (rev 
3012)
+++ madwifi/trunk/net80211/ieee80211_input.c    2007-12-10 13:15:06 UTC (rev 
3013)
@@ -2765,6 +2765,7 @@
                if (frm > efrm)
                        return;
                IEEE80211_VERIFY_ELEMENT(scan.rates, IEEE80211_RATE_MAXSIZE);
+               IEEE80211_VERIFY_ELEMENT(scan.xrates, IEEE80211_RATE_MAXSIZE);
                IEEE80211_VERIFY_ELEMENT(scan.ssid, IEEE80211_NWID_LEN);
 #if IEEE80211_CHAN_MAX < 255
                if (scan.chan > IEEE80211_CHAN_MAX) {

Modified: madwifi/trunk/net80211/ieee80211_proto.c
===================================================================
--- madwifi/trunk/net80211/ieee80211_proto.c    2007-12-07 22:12:22 UTC (rev 
3012)
+++ madwifi/trunk/net80211/ieee80211_proto.c    2007-12-10 13:15:06 UTC (rev 
3013)
@@ -425,7 +425,21 @@
                }
                r = nrs->rs_rates[i] & IEEE80211_RATE_VAL;
                badrate = r;
+
                /*
+                * remove 0 rates
+                * they don't make sense and can lead to trouble later
+                */
+               if (r == 0) {
+                       nrs->rs_nrates--;
+                       nrs->rs_nrates--;
+                       for (j = i; j < nrs->rs_nrates; j++)
+                               nrs->rs_rates[j] = nrs->rs_rates[j + 1];
+                       nrs->rs_rates[j] = 0;
+                       continue;
+               }
+
+               /*
                 * Check for fixed rate. 
                 */
                if (r == vap->iv_fixed_rate)

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php


<Prev in Thread] Current Thread [Next in Thread>