From owner-freebsd-net@FreeBSD.ORG Wed Feb 20 18:03:51 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFE7516A406 for ; Wed, 20 Feb 2008 18:03:51 +0000 (UTC) (envelope-from paul.barbieri@baesystems.com) Received: from dmzmta102.na.baesystems.com (dmzmta102.na.baesystems.com [149.32.252.102]) by mx1.freebsd.org (Postfix) with ESMTP id 738BF13C457 for ; Wed, 20 Feb 2008 18:03:51 +0000 (UTC) (envelope-from paul.barbieri@baesystems.com) Received: from BLUMS0035.bluelnk.net (blums0035.bluelnk.net [10.40.96.56]) by dmzmta102.na.baesystems.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id m1KHUVUJ006495 for ; Wed, 20 Feb 2008 12:30:33 -0500 Received: from usdmta001.na.baesystems.com ([10.40.96.57]) by BLUMS0035.bluelnk.net with InterScan Message Security Suite; Wed, 20 Feb 2008 12:30:55 -0500 Received: from GLDMS00006.goldlnk.rootlnka.net ([10.44.64.12]) by usdmta001.na.baesystems.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1KHUJqw011512 for ; Wed, 20 Feb 2008 12:30:19 -0500 Received: from GLDMS00013.goldlnk.rootlnka.net ([10.44.64.9]) by GLDMS00006.goldlnk.rootlnka.net with Microsoft SMTPSVC(6.0.3790.3959); Wed, 20 Feb 2008 12:30:54 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Wed, 20 Feb 2008 12:30:52 -0500 Message-ID: <8DD841934E0E96429CC4470C23528CA10260B9CB@GLDMS00013.goldlnk.rootlnka.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ieee80211 ms and tu convert macros Thread-Index: Achz5lcXuRQeysHnTaK0Yr1PPz8Nlw== From: "Barbieri, Paul (US SSA)" To: X-OriginalArrivalTime: 20 Feb 2008 17:30:54.0590 (UTC) FILETIME=[589521E0:01C873E6] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: ieee80211 ms and tu convert macros X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2008 18:03:51 -0000 I happened to be looking in net80211/ieee80211_var.h and examined the macros IEEE80211_MS_TO_TU and IEEE80211_TU_TO_MS. The conversions seem backward to me. The macros are: =20 #define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024) #define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000) =20 If I take the values: 1 second =3D 1000 milliseconds (ms) =3D 1024 timer units = (tu) =20 When I convert 1000 ms, I should get 1024 tu but when I use the macro IEEE80211_MS_TO_TU(1000), I get 976. The current definition yields (1000 * 1000) / 1024 =3D 976.=20 The macro should be: =20 #define IEEE80211_MS_TO_TU(x) (((x) * 1024) / 1000) =20 This yields IEEE80211_MS_TO_TU(1000) =3D (1000 * 1024) / 1000 =3D 1024 =20 The other macro needs a similar change. =20 Am I missing something, interpreting something incorrectly? Please let me know. =20 Paul