From owner-svn-src-all@FreeBSD.ORG Mon Nov 1 19:04:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97777106564A; Mon, 1 Nov 2010 19:04:16 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84DF28FC13; Mon, 1 Nov 2010 19:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1J4GPi083121; Mon, 1 Nov 2010 19:04:16 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1J4G2J083119; Mon, 1 Nov 2010 19:04:16 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011011904.oA1J4G2J083119@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 1 Nov 2010 19:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214632 - stable/7/sys/dev/iwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 19:04:16 -0000 Author: bschmidt Date: Mon Nov 1 19:04:16 2010 New Revision: 214632 URL: http://svn.freebsd.org/changeset/base/214632 Log: MFC r214160,214162,214236 r214236 & r214160: The firmware does pad notifications to an even number of bytes (at least the association notification), the included information though always contains an elem block with an odd number of bytes. We handle the last byte as if it might contain a whole elem block, this of course is not true as one byte is not enough to hold a block, we therefore discard the complete frame. The solution here is to subtract one from the actual notification length, this is also what the Linux driver does. With this change the frame ends exactly where the last elem block ends. r214262: The firmware always sets bit 14 and 15, to get the real associd we need to clear those bits. Modified: stable/7/sys/dev/iwi/if_iwi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/7/sys/dev/iwi/if_iwi.c Mon Nov 1 18:18:46 2010 (r214631) +++ stable/7/sys/dev/iwi/if_iwi.c Mon Nov 1 19:04:16 2010 (r214632) @@ -1377,7 +1377,7 @@ iwi_checkforqos(struct iwi_softc *sc, co ni = sc->sc_ic.ic_bss; ni->ni_capinfo = capinfo; - ni->ni_associd = associd; + ni->ni_associd = associd & 0x3fff; if (wme != NULL) ni->ni_flags |= IEEE80211_NODE_QOS; else @@ -1480,7 +1480,7 @@ iwi_notification_intr(struct iwi_softc * IWI_STATE_END(sc, IWI_FW_ASSOCIATING); iwi_checkforqos(sc, (const struct ieee80211_frame *)(assoc+1), - le16toh(notif->len) - sizeof(*assoc)); + le16toh(notif->len) - sizeof(*assoc) - 1); ieee80211_new_state(ic, IEEE80211_S_RUN, -1); break;