From owner-freebsd-wireless@FreeBSD.ORG Sun Dec 4 05:56:06 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 765681065670 for ; Sun, 4 Dec 2011 05:56:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 217108FC08 for ; Sun, 4 Dec 2011 05:56:05 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so5165910vbb.13 for ; Sat, 03 Dec 2011 21:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=s2YLOuHUDtmG9VF8FeT+2ohosz5ciEJkvjgrErsAy9E=; b=vkdpN3gbZAD+9ahFpdHuTeQBHHsAvAJEGqFwWMd/kZf+XTCEL0N6SOmw+D0j6HRavt ht4FX3mq0DVsskZhTZLrMeAvgoEdg1zUi9+RUlp8qXQkAg5ycSaek5D/ag4/G9v2uhlN 1de0xeCHw8jh1BxNsfvVrQzA/FdJjgHP5PwsM= MIME-Version: 1.0 Received: by 10.52.94.227 with SMTP id df3mr2573439vdb.51.1322978165275; Sat, 03 Dec 2011 21:56:05 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sat, 3 Dec 2011 21:56:05 -0800 (PST) In-Reply-To: References: <3d4d2d249836fafc6acd885693c02198@webmail.entel.upc.edu> <4ECFCDAB.1080407@entel.upc.edu> <4ED3B4D1.3020701@entel.upc.edu> <4EDA4BBA.6010203@entel.upc.edu> <4EDA609F.2080401@entel.upc.edu> Date: Sun, 4 Dec 2011 13:56:05 +0800 X-Google-Sender-Auth: M7J6SSAF61uP7njiLv3MWq-TgG0 Message-ID: From: Adrian Chadd To: Viet-Ha Pham Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Freebsd Wireless Subject: Re: Rate index for 11 Mbps X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 05:56:06 -0000 On 4 December 2011 13:36, Viet-Ha Pham wrote: > Hi there, > > I am working with the rate adaptation algorithm and at the very beginning > point of testing/programing. I have a concern with the rate index used in > the HAL. > > I wonder if the rate order in the rate table for 802.11g is 1 - 2 - 5.5 -= 6 > - 9 - 11 - 12 .... or 1 - 2 - 5.5 - 11 - 6 -9 - 12 ... ? The order of rate table entries is what you see: [for 11g]: /* short ctrl *= / /* valid rateCode Preamble dot11Rate Rate */ /* 1 Mb */ { AH_TRUE, CCK, 1000, 0x1b, 0x00, (0x80| 2), 0 }, /* 2 Mb */ { AH_TRUE, CCK, 2000, 0x1a, 0x04, (0x80| 4), 1 }, /* 5.5 Mb */ { AH_TRUE, CCK, 5500, 0x19, 0x04, (0x80|11), 2 }, /* 11 Mb */ { AH_TRUE, CCK, 11000, 0x18, 0x04, (0x80|22), 3 }, /* remove rates 6, 9 from rate ctrl */ /* 6 Mb */ { AH_FALSE, OFDM, 6000, 0x0b, 0x00, 12, 4 }, /* 9 Mb */ { AH_FALSE, OFDM, 9000, 0x0f, 0x00, 18, 4 }, /* 12 Mb */ { AH_TRUE, OFDM, 12000, 0x0a, 0x00, 24, 6 }, .. so it's cck 1, cck 2, cck 5.5, cck 11, ofdm 6, ofdm 9, ofdm 12, ofdm 18 .. ofdm 54. > I read the source code (ar5212_phy.c) but I am still confused. Also there= is > a comment with the rate table for 802.11g: > > /* Venice TODO: roundUpRate() is broken when the rate table does not > represent rates > * in increasing order =A0e.g. =A05.5, 11, 6, 9. > * An average rate of 6 Mbps will currently map to 11 Mbps. > */ I don't know where roundUpRate() is - but yes, if your function tries to map a throughput to a rate table index, it'll have problems if it simply finds the first rate greater than your specified bit rate. HTH, Adrian