From owner-p4-projects@FreeBSD.ORG Mon Jan 14 07:21:29 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E84E916A420; Mon, 14 Jan 2008 07:21:28 +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 ADF2216A418 for ; Mon, 14 Jan 2008 07:21:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A920113C44B for ; Mon, 14 Jan 2008 07:21:28 +0000 (UTC) (envelope-from sephe@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 m0E7LS8s061622 for ; Mon, 14 Jan 2008 07:21:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0E7LSo5061619 for perforce@freebsd.org; Mon, 14 Jan 2008 07:21:28 GMT (envelope-from sephe@FreeBSD.org) Date: Mon, 14 Jan 2008 07:21:28 GMT Message-Id: <200801140721.m0E7LSo5061619@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau To: Perforce Change Reviews Cc: Subject: PERFORCE change 133244 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, 14 Jan 2008 07:21:29 -0000 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