[Madwifi-cvs] madwifi/driver if_ath.c,1.121,1.122
Status: Beta
Brought to you by:
otaku
From: <sam...@pr...> - 2004-01-27 20:59:43
|
Update of /cvsroot/madwifi/madwifi/driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26034 Modified Files: if_ath.c Log Message: correct handling of fixed xmit rate Index: if_ath.c =================================================================== RCS file: /cvsroot/madwifi/madwifi/driver/if_ath.c,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** if_ath.c 19 Jan 2004 20:39:05 -0000 1.121 --- if_ath.c 27 Jan 2004 20:58:34 -0000 1.122 *************** *** 2871,2893 **** #define RATE(_ix) (ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL) struct ieee80211com *ic = &sc->sc_ic; KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates")); if (ic->ic_fixed_rate == -1) { ! /* start with highest negotiated rate */ ! int srate = ni->ni_rates.rs_nrates - 1; if (sc->sc_curmode != IEEE80211_MODE_11B) { /* ! * 11a and 11g work better if you start at 24Mb ! * or 36Mb and raise the rate. Scan the negotiated ! * rate set to find the closest rate. */ ! /* NB: rate set assumed sorted */ for (; srate >= 0 && RATE(srate) > 72; srate--) ; KASSERT(srate >= 0, ("bogus rate set")); } ! ath_rate_update(sc, ni, srate); ! } else ! ath_rate_update(sc, ni, ic->ic_fixed_rate); #undef RATE } --- 2871,2913 ---- #define RATE(_ix) (ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL) struct ieee80211com *ic = &sc->sc_ic; + int srate; KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates")); if (ic->ic_fixed_rate == -1) { ! /* ! * No fixed rate is requested. For 11b start with ! * the highest negotiated rate; otherwise, for 11g ! * and 11a, we start "in the middle" at 24Mb or 36Mb. ! */ ! srate = ni->ni_rates.rs_nrates - 1; if (sc->sc_curmode != IEEE80211_MODE_11B) { /* ! * Scan the negotiated rate set to find the ! * closest rate. */ ! /* NB: the rate set is assumed sorted */ for (; srate >= 0 && RATE(srate) > 72; srate--) ; KASSERT(srate >= 0, ("bogus rate set")); } ! } else { ! /* ! * A fixed rate is to be used; ic_fixed_rate is an ! * index into the supported rate set. Convert this ! * to the index into the negotiated rate set for ! * the node. We know the rate is there because the ! * rate set is checked when the station associates. ! */ ! const struct ieee80211_rateset *rs = ! &ic->ic_sup_rates[ic->ic_curmode]; ! int r = rs->rs_rates[ic->ic_fixed_rate] & IEEE80211_RATE_VAL; ! /* NB: the rate set is assumed sorted */ ! srate = ni->ni_rates.rs_nrates - 1; ! for (; srate >= 0 && RATE(srate) != r; srate--) ! ; ! KASSERT(srate >= 0, ! ("fixed rate %d not in rate set", ic->ic_fixed_rate)); ! } ! ath_rate_update(sc, ni, srate); #undef RATE } |