Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2011 08:53:34 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225139 - head/sys/net80211
Message-ID:  <201108240853.p7O8rYQo041434@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Aug 24 08:53:33 2011
New Revision: 225139
URL: http://svn.freebsd.org/changeset/base/225139

Log:
  This patch fixes beacon frame sequence number generation. The code
  didn't set a sequence number; it didn't show up earlier because the
  hardware most people use for hostap (ie, AR5212 series stuff) sets the
  sequence numbers up in hardware. Later hardware (AR5416, etc) which
  can do 11n and aggregation require sequence numbers to be generated in
  software.
  
  Submitted by:	paradyse@gmail.com
  Approved by:	re (kib)

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Wed Aug 24 08:38:44 2011	(r225138)
+++ head/sys/net80211/ieee80211_output.c	Wed Aug 24 08:53:33 2011	(r225139)
@@ -2792,6 +2792,8 @@ ieee80211_beacon_update(struct ieee80211
 	struct ieee80211com *ic = ni->ni_ic;
 	int len_changed = 0;
 	uint16_t capinfo;
+	struct ieee80211_frame *wh;
+	ieee80211_seq seqno;
 
 	IEEE80211_LOCK(ic);
 	/*
@@ -2823,6 +2825,12 @@ ieee80211_beacon_update(struct ieee80211
 		return 1;		/* just assume length changed */
 	}
 
+	wh = mtod(m, struct ieee80211_frame *);
+	seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++;
+	*(uint16_t *)&wh->i_seq[0] =
+		htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+	M_SEQNO_SET(m, seqno);
+
 	/* XXX faster to recalculate entirely or just changes? */
 	capinfo = ieee80211_getcapinfo(vap, ni->ni_chan);
 	*bo->bo_caps = htole16(capinfo);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108240853.p7O8rYQo041434>