svn commit: r214633 - stable/8/sys/dev/iwi

Bernhard Schmidt bschmidt at FreeBSD.org
Mon Nov 1 19:05:38 UTC 2010


Author: bschmidt
Date: Mon Nov  1 19:05:38 2010
New Revision: 214633
URL: http://svn.freebsd.org/changeset/base/214633

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/8/sys/dev/iwi/if_iwi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/iwi/if_iwi.c
==============================================================================
--- stable/8/sys/dev/iwi/if_iwi.c	Mon Nov  1 19:04:16 2010	(r214632)
+++ stable/8/sys/dev/iwi/if_iwi.c	Mon Nov  1 19:05:38 2010	(r214633)
@@ -1368,7 +1368,7 @@ iwi_checkforqos(struct ieee80211vap *vap
 
 	ni = vap->iv_bss;
 	ni->ni_capinfo = capinfo;
-	ni->ni_associd = associd;
+	ni->ni_associd = associd & 0x3fff;
 	if (wme != NULL)
 		ni->ni_flags |= IEEE80211_NODE_QOS;
 	else
@@ -1483,7 +1483,7 @@ iwi_notification_intr(struct iwi_softc *
 			IWI_STATE_END(sc, IWI_FW_ASSOCIATING);
 			iwi_checkforqos(vap,
 			    (const struct ieee80211_frame *)(assoc+1),
-			    le16toh(notif->len) - sizeof(*assoc));
+			    le16toh(notif->len) - sizeof(*assoc) - 1);
 			ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
 			break;
 		case IWI_ASSOC_INIT:


More information about the svn-src-all mailing list