Date: Tue, 16 Nov 2004 17:17:25 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 65265 for review Message-ID: <200411161717.iAGHHPfA088109@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=65265 Change 65265 by sam@sam_ebb on 2004/11/16 17:16:53 split turbo mode into TURBO_A and TURBO_G for forthcoming SuperG support Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#22 edit .. //depot/projects/wifi/sys/net80211/_ieee80211.h#2 edit .. //depot/projects/wifi/sys/net80211/ieee80211.c#8 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#22 (text+ko) ==== @@ -338,7 +338,8 @@ ath_rate_setup(sc, IEEE80211_MODE_11A); ath_rate_setup(sc, IEEE80211_MODE_11B); ath_rate_setup(sc, IEEE80211_MODE_11G); - ath_rate_setup(sc, IEEE80211_MODE_TURBO); + ath_rate_setup(sc, IEEE80211_MODE_TURBO_A); + ath_rate_setup(sc, IEEE80211_MODE_TURBO_G); /* NB: setup here so ath_rate_update is happy */ ath_setcurmode(sc, IEEE80211_MODE_11A); @@ -775,7 +776,8 @@ CHANNEL_B, /* IEEE80211_MODE_11B */ CHANNEL_PUREG, /* IEEE80211_MODE_11G */ 0, /* IEEE80211_MODE_FH */ - CHANNEL_T /* IEEE80211_MODE_TURBO */ + CHANNEL_T, /* IEEE80211_MODE_TURBO_A */ + CHANNEL_108G /* IEEE80211_MODE_TURBO_G */ }; enum ieee80211_phymode mode = ieee80211_chan2mode(ic, chan); @@ -3672,9 +3674,12 @@ case IEEE80211_MODE_11G: sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11G); break; - case IEEE80211_MODE_TURBO: + case IEEE80211_MODE_TURBO_A: sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_TURBO); break; + case IEEE80211_MODE_TURBO_G: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108G); + break; default: DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid mode %u\n", __func__, mode); ==== //depot/projects/wifi/sys/net80211/_ieee80211.h#2 (text+ko) ==== @@ -49,9 +49,10 @@ IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ - IEEE80211_MODE_TURBO = 5, /* 5GHz, OFDM, 2x clock */ + IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock */ + IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock */ }; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO+1) +#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO_G+1) enum ieee80211_opmode { IEEE80211_M_STA = 1, /* infrastructure station */ @@ -138,6 +139,8 @@ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) #define IEEE80211_CHAN_T \ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) +#define IEEE80211_CHAN_108G \ + (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) #define IEEE80211_IS_CHAN_FHSS(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) @@ -151,6 +154,8 @@ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) #define IEEE80211_IS_CHAN_T(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) +#define IEEE80211_IS_CHAN_108G(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) #define IEEE80211_IS_CHAN_2GHZ(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0) ==== //depot/projects/wifi/sys/net80211/ieee80211.c#8 (text+ko) ==== @@ -57,7 +57,8 @@ "11b", /* IEEE80211_MODE_11B */ "11g", /* IEEE80211_MODE_11G */ "FH", /* IEEE80211_MODE_FH */ - "turbo", /* IEEE80211_MODE_TURBO */ + "turboA", /* IEEE80211_MODE_TURBO_A */ + "turboG", /* IEEE80211_MODE_TURBO_G */ }; /* list of all instances */ @@ -114,7 +115,9 @@ if (IEEE80211_IS_CHAN_FHSS(c)) ic->ic_modecaps |= 1<<IEEE80211_MODE_FH; if (IEEE80211_IS_CHAN_T(c)) - ic->ic_modecaps |= 1<<IEEE80211_MODE_TURBO; + ic->ic_modecaps |= 1<<IEEE80211_MODE_TURBO_A; + if (IEEE80211_IS_CHAN_108G(c)) + ic->ic_modecaps |= 1<<IEEE80211_MODE_TURBO_G; } } /* validate ic->ic_curmode */ @@ -446,13 +449,16 @@ return EINVAL; } /* - * Turbo mode is an ``option''. Eventually it - * needs to be applied to 11g too. + * Turbo mode is an ``option''. + * XXX does not apply to AUTO */ if (ime->ifm_media & IFM_IEEE80211_TURBO) { - if (newphymode != IEEE80211_MODE_11A) + if (newphymode == IEEE80211_MODE_11A) + newphymode = IEEE80211_MODE_TURBO_A; + else if (newphymode == IEEE80211_MODE_11G) + newphymode = IEEE80211_MODE_TURBO_G; + else return EINVAL; - newphymode = IEEE80211_MODE_TURBO; } /* * Validate requested mode is available. @@ -639,10 +645,14 @@ case IEEE80211_MODE_FH: imr->ifm_active |= IFM_IEEE80211_FH; break; - case IEEE80211_MODE_TURBO: + case IEEE80211_MODE_TURBO_A: imr->ifm_active |= IFM_IEEE80211_11A | IFM_IEEE80211_TURBO; break; + case IEEE80211_MODE_TURBO_G: + imr->ifm_active |= IFM_IEEE80211_11G + | IFM_IEEE80211_TURBO; + break; } } @@ -688,7 +698,8 @@ IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ - IEEE80211_CHAN_T, /* IEEE80211_MODE_TURBO */ + IEEE80211_CHAN_T, /* IEEE80211_MODE_TURBO_A */ + IEEE80211_CHAN_108G, /* IEEE80211_MODE_TURBO_G */ }; struct ieee80211_channel *c; u_int modeflags; @@ -812,8 +823,8 @@ * This assumes all 11a turbo channels are also * usable withut turbo, which is currently true. */ - if (ic->ic_curmode == IEEE80211_MODE_TURBO) - return IEEE80211_MODE_TURBO; + if (ic->ic_curmode == IEEE80211_MODE_TURBO_A) + return IEEE80211_MODE_TURBO_A; return IEEE80211_MODE_11A; } else if (IEEE80211_IS_CHAN_FHSS(chan)) return IEEE80211_MODE_FH; @@ -822,6 +833,8 @@ * This assumes all 11g channels are also usable * for 11b, which is currently true. */ + if (ic->ic_curmode == IEEE80211_MODE_TURBO_G) + return IEEE80211_MODE_TURBO_G; if (ic->ic_curmode == IEEE80211_MODE_11B) return IEEE80211_MODE_11B; return IEEE80211_MODE_11G; @@ -875,7 +888,7 @@ mask = rate & IEEE80211_RATE_VAL; switch (mode) { case IEEE80211_MODE_11A: - case IEEE80211_MODE_TURBO: + case IEEE80211_MODE_TURBO_A: mask |= IFM_IEEE80211_11A; break; case IEEE80211_MODE_11B: @@ -893,6 +906,7 @@ /* NB: hack, 11g matches both 11b+11a rates */ /* fall thru... */ case IEEE80211_MODE_11G: + case IEEE80211_MODE_TURBO_G: mask |= IFM_IEEE80211_11G; break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411161717.iAGHHPfA088109>