Date: Mon, 14 Jan 2008 07:21:28 GMT From: Sepherosa Ziehau <sephe@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 133244 for review Message-ID: <200801140721.m0E7LSo5061619@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133244 Change 133244 by sephe@sephe_zealot:sam_wifi on 2008/01/14 07:20:31 - Correct control rate index mapping in turbog rate table - ieee80211_compute_duration() needs 802.11 rate code instead of rate table's rate index Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_phy.c#4 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_phy.c#4 (text+ko) ==== @@ -204,8 +204,8 @@ /* short ctrl */ /* Preamble dot11Rate Rate */ /* 6 Mb */ { TURBO, 6000, 0x00, (0x80|12), 0 }, -/* 12 Mb */ { TURBO, 12000, 0x00, (0x80|24), 2 }, -/* 18 Mb */ { TURBO, 18000, 0x00, 36, 2 }, +/* 12 Mb */ { TURBO, 12000, 0x00, (0x80|24), 1 }, +/* 18 Mb */ { TURBO, 18000, 0x00, 36, 1 }, /* 24 Mb */ { TURBO, 24000, 0x00, (0x80|48), 3 }, /* 36 Mb */ { TURBO, 36000, 0x00, 72, 3 }, /* 48 Mb */ { TURBO, 48000, 0x00, 96, 3 }, @@ -288,6 +288,7 @@ for (i = 0; i < rt->rateCount; i++) { uint8_t code = rt->info[i].dot11Rate; uint8_t cix = rt->info[i].ctlRateIndex; + uint8_t ctl_rate = rt->info[cix].dot11Rate; rt->rateCodeToIndex[code] = i; if (code & IEEE80211_RATE_BASIC) { @@ -303,11 +304,15 @@ * depends on whether they are marked as basic rates; * the static tables are setup with an 11b-compatible * 2Mb/s rate which will work but is suboptimal + * + * NB: Control rate is always less than or equal to the + * current rate, so control rate's reverse lookup entry + * has been installed and following call is safe. */ rt->info[i].lpAckDuration = ieee80211_compute_duration(rt, - WLAN_CTRL_FRAME_SIZE, cix, 0); + WLAN_CTRL_FRAME_SIZE, ctl_rate, 0); rt->info[i].spAckDuration = ieee80211_compute_duration(rt, - WLAN_CTRL_FRAME_SIZE, cix, IEEE80211_F_SHPREAMBLE); + WLAN_CTRL_FRAME_SIZE, ctl_rate, IEEE80211_F_SHPREAMBLE); } #undef WLAN_CTRL_FRAME_SIZE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801140721.m0E7LSo5061619>