PERFORCE change 137360 for review
Sam Leffler
sam at FreeBSD.org
Mon Mar 10 22:11:00 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=137360
Change 137360 by sam at sam_ebb on 2008/03/10 22:10:52
don't fudge on ht rates; expand the table to have entries
for the various combinations: ht20/ht40 x short/long GI
Submitted by: Chris Zimmerman
Affected files ...
.. //depot/projects/vap/sys/net80211/ieee80211.c#29 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ht.c#18 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ht.h#11 edit
.. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#21 edit
Differences ...
==== //depot/projects/vap/sys/net80211/ieee80211.c#29 (text+ko) ====
@@ -907,8 +907,8 @@
IEEE80211_MODE_AUTO, IFM_IEEE80211_MCS);
/* XXX could walk htrates */
/* XXX known array size */
- if (ieee80211_htrates[15] > maxrate)
- maxrate = ieee80211_htrates[15];
+ if (ieee80211_htrates[15].ht40_rate_400ns > maxrate)
+ maxrate = ieee80211_htrates[15].ht40_rate_400ns;
}
return maxrate;
}
==== //depot/projects/vap/sys/net80211/ieee80211_ht.c#18 (text+ko) ====
@@ -53,32 +53,28 @@
#define MS(_v, _f) (((_v) & _f) >> _f##_S)
#define SM(_v, _f) (((_v) << _f##_S) & _f)
-/* XXX need max array size */
-/* NB: these are for HT20 w/ long GI */
-const int ieee80211_htrates[16] = {
- 13, /* IFM_IEEE80211_MCS0 */
- 26, /* IFM_IEEE80211_MCS1 */
- 39, /* IFM_IEEE80211_MCS2 */
- 52, /* IFM_IEEE80211_MCS3 */
- 78, /* IFM_IEEE80211_MCS4 */
- 104, /* IFM_IEEE80211_MCS5 */
- 117, /* IFM_IEEE80211_MCS6 */
- 130, /* IFM_IEEE80211_MCS7 */
- 26, /* IFM_IEEE80211_MCS8 */
- 52, /* IFM_IEEE80211_MCS9 */
- 78, /* IFM_IEEE80211_MCS10 */
- 104, /* IFM_IEEE80211_MCS11 */
- 156, /* IFM_IEEE80211_MCS12 */
- 208, /* IFM_IEEE80211_MCS13 */
- 234, /* IFM_IEEE80211_MCS14 */
- 260, /* IFM_IEEE80211_MCS15 */
+const struct ieee80211_mcs_rates ieee80211_htrates[16] = {
+ { 13, 14, 27, 30 }, /* MCS 0 */
+ { 26, 29, 54, 60 }, /* MCS 1 */
+ { 39, 43, 81, 90 }, /* MCS 2 */
+ { 52, 58, 108, 120 }, /* MCS 3 */
+ { 78, 87, 162, 180 }, /* MCS 4 */
+ { 104, 116, 216, 240 }, /* MCS 5 */
+ { 117, 130, 243, 270 }, /* MCS 6 */
+ { 130, 144, 270, 300 }, /* MCS 7 */
+ { 26, 29, 54, 60 }, /* MCS 8 */
+ { 52, 58, 108, 120 }, /* MCS 9 */
+ { 78, 87, 162, 180 }, /* MCS 10 */
+ { 104, 116, 216, 240 }, /* MCS 11 */
+ { 156, 173, 324, 360 }, /* MCS 12 */
+ { 208, 231, 432, 480 }, /* MCS 13 */
+ { 234, 260, 486, 540 }, /* MCS 14 */
+ { 260, 289, 540, 600 } /* MCS 15 */
};
static const struct ieee80211_htrateset ieee80211_rateset_11n =
{ 16, {
- /* MCS: 6.5 13 19.5 26 39 52 58.5 65 13 26 */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- /* 39 52 78 104 117, 130 */
10, 11, 12, 13, 14, 15 }
};
@@ -201,7 +197,7 @@
rs->rs_rates[i] | IEEE80211_RATE_MCS, mode);
if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS)
continue;
- rate = ieee80211_htrates[rs->rs_rates[i]];
+ rate = ieee80211_htrates[rs->rs_rates[i]].ht40_rate_400ns;
printf("%s%d%sMbps", (i != 0 ? " " : ""),
rate / 2, ((rate & 0x1) != 0 ? ".5" : ""));
}
==== //depot/projects/vap/sys/net80211/ieee80211_ht.h#11 (text+ko) ====
@@ -148,7 +148,13 @@
void ieee80211_ht_announce(struct ieee80211com *);
-extern const int ieee80211_htrates[16];
+struct ieee80211_mcs_rates {
+ uint16_t ht20_rate_800ns;
+ uint16_t ht20_rate_400ns;
+ uint16_t ht40_rate_800ns;
+ uint16_t ht40_rate_400ns;
+};
+extern const struct ieee80211_mcs_rates ieee80211_htrates[16];
const struct ieee80211_htrateset *ieee80211_get_suphtrates(
struct ieee80211com *, const struct ieee80211_channel *);
==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#21 (text+ko) ====
@@ -694,10 +694,12 @@
for (i = 15; i >= 0 && isclr(htcap->hc_mcsset, i); i--)
;
if (i >= 0) {
- rmax = ieee80211_htrates[i];
caps = LE_READ_2(&htcap->hc_cap);
+ /* XXX short/long GI */
if (caps & IEEE80211_HTCAP_CHWIDTH40)
- rmax *= 2;
+ rmax = ieee80211_htrates[i].ht40_rate_400ns;
+ else
+ rmax = ieee80211_htrates[i].ht40_rate_800ns;
}
}
for (i = 0; i < se->se_rates[1]; i++) {
More information about the p4-projects
mailing list