From owner-freebsd-wireless@FreeBSD.ORG Sat Nov 9 07:46:24 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 31C8AC96 for ; Sat, 9 Nov 2013 07:46:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA0AC2F78 for ; Sat, 9 Nov 2013 07:46:23 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id i8so1632479qcq.30 for ; Fri, 08 Nov 2013 23:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=EzlbJ6qCIN/kQXMA00M4CZ8zYuSlOWnvz5a8GScGlTk=; b=mG2Gktx5xzjVHglkX2TB/sfpV4hvsnf2DB+9T6v3DbwZTWG2Ajupjnb1hciN+DQQGc tsiVHa94CnTilVFCOeAHv2N0Rs+ibjL2tlYA34YMgsl4svBuP3LWp+7l5QEY5R7nj+c+ DDOs+GuJ91wEkVYVlIMuoumWhumLueMlwzwrH62m9f/XaIAJnf28HFrY4cR0saWMfbQq kUC9XC9bTXMQ53IXPj5jru64M3VLKjtE/JDIEnwT2rjtMngu8L30OulyZLGHhjqnwD2I Hd7ubEPZnbrdrjkXA6en3amzzY6UGsQDjW9Q8iGqSwQP9X24nwld5p3P5EoO6voK6qio c3Lw== MIME-Version: 1.0 X-Received: by 10.49.99.98 with SMTP id ep2mr29104254qeb.9.1383983183081; Fri, 08 Nov 2013 23:46:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Fri, 8 Nov 2013 23:46:23 -0800 (PST) Date: Fri, 8 Nov 2013 23:46:23 -0800 X-Google-Sender-Auth: DeqAaIVMiDlZUsDzJq9W40X5pEA Message-ID: Subject: [iwn] round four - 5100 works, 21xx works, EAPOL fixes, rate selection fixes 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: Sat, 09 Nov 2013 07:46:24 -0000 Argh, why am I still hacking on the iwn(4) driver. So, I saw a lot of broken stuff. This patch fixes some. http://people.freebsd.org/~adrian/iwn/20131108-iwn-update-works-full-5100-11.diff You have to update sys/net80211 and sys/dev/iwn to the latest version in HEAD before you apply this diff. What's committed: * AMRR wasn't correctly initializing the initial rate, so it thought it was starting at MCS15 but it was in fact starting at MCS0. This caused hilarity. * AMRR should be selecting a "mostly ok" rate, not MCS15. So, this was also fixed. What's in this patch: * EAPOL frames were going out at the normal data rate, rather than going out at the management rate. Like ath(4), override this. Once I fixed AMRR to set the initial rate from MCS0 to the "best initial rate" it chose MCS15 and this failed. It showed up as the initial association suceeding but the auth exchange failed, logging a "pre-shared key may be incorrect" message. Sigh. So, like ath(4), detect if it's EAPOL and if so override. * If an AMPDU frame TX failed the firmware doesn't send up a compressed-BA notification as it doesn't receive one. iwn_ampdu_tx_done() doesn't do any rate control notification - that is left up to the compressed BA RX function. So, if an entire A-MPDU transmit failed, there'd be no notification of such - and the rate control code never got notified of said failures! Thus it would never back off the rate. So, if the whole frame transmission failed, just notify the rate control code so it correctly backs off the rate selection. With this, things are .. more stable. The whole A-MPDU handling needs a lot of work to make as correct as the ath(4) driver, but that is so not in the scope of what I'm doing here. -adrian