From owner-p4-projects@FreeBSD.ORG Mon Mar 10 22:10:59 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 94A791065675; Mon, 10 Mar 2008 22:10:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DF61065673 for ; Mon, 10 Mar 2008 22:10:59 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7ED8FC16 for ; Mon, 10 Mar 2008 22:10:59 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2AMAxTU054315 for ; Mon, 10 Mar 2008 22:10:59 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2AMAxeM054313 for perforce@freebsd.org; Mon, 10 Mar 2008 22:10:59 GMT (envelope-from sam@freebsd.org) Date: Mon, 10 Mar 2008 22:10:59 GMT Message-Id: <200803102210.m2AMAxeM054313@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 137360 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2008 22:11:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=137360 Change 137360 by sam@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++) {