From owner-freebsd-wireless@FreeBSD.ORG Thu Jul 4 01:39:07 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E6C495B7 for ; Thu, 4 Jul 2013 01:39:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) by mx1.freebsd.org (Postfix) with ESMTP id B09D71293 for ; Thu, 4 Jul 2013 01:39:07 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id m15so506290qcq.33 for ; Wed, 03 Jul 2013 18:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=gaxH/hB5mYmxeSU5O6CX124EyCgKMjLG7BgI4eBRnwQ=; b=rLpOgb9dwFkD+EzKUxZE0RKczNvnO4vNx2WheMpkwva/gFk/IrjBQpP6g0WyhnKiwV 6QRUdbjeQKYJOIqgjC+zcrNP7C5sTB2KIOi6o85wf8swxHCK0hyJ0rSfTDzPUyHOl5hY fggBTACpTXSy7eug2wQoe9T8f70n3Jy/N7LUUHLpv0o1Ig306cEOzmbcUmd97GlE5UlU LRJNUPV7dMZYAwFoAEF3jO4Xm3lkRYA9piA/8wcsxTMhTYyppc21YYReJDEQ007u9KUB gmjl2ZKaW63VP4JwQGA/HaXNVKETyn4bDfOsv2+XX7W9WHObFzK7mtnniA1Kb2Tbao/E v9ig== MIME-Version: 1.0 X-Received: by 10.224.13.19 with SMTP id z19mr6848213qaz.12.1372901947285; Wed, 03 Jul 2013 18:39:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.195.72 with HTTP; Wed, 3 Jul 2013 18:39:07 -0700 (PDT) Date: Wed, 3 Jul 2013 18:39:07 -0700 X-Google-Sender-Auth: RVOWG1RHqSj8l5ZWB7Cyni7NxYQ Message-ID: Subject: [rfc] net80211 PHY updates, amrr rate control changes, iwn changes for native 11n From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 04 Jul 2013 01:39:08 -0000 Hi! I have been hacking at adding 11n awareness to the PHY and rate control code in net80211 in preparation for "real" 11n awareness in the rate control code. The patch is here: http://people.freebsd.org/~adrian/ath/20130630-net80211-phy-11n-1.diff The problems: * The rate representation is a single uint8_t which represents the throughput (pre-11n) or the MCS code (11n) * The BASIC rate flag is 0x80, and the MCS rate flag is 0x80 - making a unified representation of "stuff" rather difficult; * There's no current way for it to return the rest of the 11n configuration (short-gi, 20/40mhz, stbc, ldpc, etc), which means the current "result" isn't enough to fully represent an 11n transmit; * .. same with pre-11n - there's no current way for the rate control code to say "transmit short preamble" for legacy (11b) versus 11g setups. What it does: PHY: * adds the 11n PHY tables to ieee80211_phy.c; * adds 11n packet duration calculation as a new function call; * adds some new methods in ieee80211_phy.h to access the rate code information based on the rate index; * adds checks to ensure that these legacy methods don't get called with the MCS/BASIC bit set (0x80); ratectl: * Modify amrr to use the HT table if the device is HT aware Drivers (non-iwn): * Modify the drivers that directly use the node rate table to use the new phy functions that do it for you, which do sanity checks; * The drivers now only look up the legacy rates -without- the basic rate flag, so when they're taught about 11n it is clear what that 0x80 bit means; Drivers (iwn): * remove that "pretend I'm 11n, really" crap from iwn_newassoc(), as now amrr will return 11n rates; * move the rate/ridx -> iwn plcp table into an inline function that takes the node and rate, and calculates the plcp to use * teach it to now use the HT rate from amrr correctly I've verified this on iwn(4) in STA mode and it's behaving correctly. AMRR makes some pretty bad 11n decisions but I'm not making it worse. I'd appreciate any testing that people can give. I'm going to commit this soon. Thanks! -adrian