svn commit: r191571 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Mon Apr 27 17:39:42 UTC 2009


Author: sam
Date: Mon Apr 27 17:39:41 2009
New Revision: 191571
URL: http://svn.freebsd.org/changeset/base/191571

Log:
  Store the tx seq# of an 802.11 frame in the mbuf pkthdr; this will be
  used for s/w retransmit schemes that want to access this information
  w/o the overhead of decoding the raw frame.  Note this also allows
  drivers to record this information w/o writing the frame when the seq#
  is obtained through an out-of-band mechanism (e.g. when a h/w assigned
  seq# is reported in a descriptor on tx done notification).
  
  Reviewed by:	sephe, avatar

Modified:
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Mon Apr 27 17:37:36 2009	(r191570)
+++ head/sys/net80211/ieee80211_freebsd.h	Mon Apr 27 17:39:41 2009	(r191571)
@@ -248,6 +248,13 @@ struct mbuf *ieee80211_getmgtframe(uint8
 #define	M_AGE_GET(m)		(m->m_pkthdr.csum_data)
 #define	M_AGE_SUB(m,adj)	(m->m_pkthdr.csum_data -= adj)
 
+/*
+ * Store the sequence number.
+ */
+#define	M_SEQNO_SET(m, seqno) \
+	((m)->m_pkthdr.tso_segsz = (seqno))
+#define	M_SEQNO_GET(m)	((m)->m_pkthdr.tso_segsz)
+
 #define	MTAG_ABI_NET80211	1132948340	/* net80211 ABI */
 
 struct ieee80211_cb {

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Mon Apr 27 17:37:36 2009	(r191570)
+++ head/sys/net80211/ieee80211_output.c	Mon Apr 27 17:39:41 2009	(r191571)
@@ -512,6 +512,7 @@ ieee80211_send_setup(
 
 	seqno = ni->ni_txseqs[tid]++;
 	*(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+	M_SEQNO_SET(m, seqno);
 
 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
 		m->m_flags |= M_MCAST;
@@ -1097,12 +1098,15 @@ ieee80211_encap(struct ieee80211vap *vap
 			seqno = ni->ni_txseqs[tid]++;
 			*(uint16_t *)wh->i_seq =
 			    htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+			M_SEQNO_SET(m, seqno);
 		}
 	} else {
 		seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++;
 		*(uint16_t *)wh->i_seq =
 		    htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+		M_SEQNO_SET(m, seqno);
 	}
+
 	/* check if xmit fragmentation is required */
 	txfrag = (m->m_pkthdr.len > vap->iv_fragthreshold &&
 	    !IEEE80211_IS_MULTICAST(wh->i_addr1) &&


More information about the svn-src-head mailing list