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
This commit is contained in:
Sam Leffler 2009-04-27 17:39:41 +00:00
parent a3a981b7f9
commit 9a841c7fd0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191571
2 changed files with 11 additions and 0 deletions

View File

@ -248,6 +248,13 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
#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 {

View File

@ -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, struct ieee80211_node *ni,
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) &&