View | Details | Raw Unified | Return to bug 200128
Collapse All | Expand All

(-)sys/net80211/ieee80211.h (+5 lines)
Lines 169-174 Link Here
169
#define	IEEE80211_FC1_PROTECTED			0x40
169
#define	IEEE80211_FC1_PROTECTED			0x40
170
#define	IEEE80211_FC1_ORDER			0x80
170
#define	IEEE80211_FC1_ORDER			0x80
171
171
172
#define IEEE80211_HAS_SEQ(type, subtype) \
173
	((type) != IEEE80211_FC0_TYPE_CTL && \
174
	!((type) == IEEE80211_FC0_TYPE_DATA && \
175
	 ((subtype) & IEEE80211_FC0_SUBTYPE_QOS_NULL) == \
176
		      IEEE80211_FC0_SUBTYPE_QOS_NULL))
172
#define	IEEE80211_SEQ_FRAG_MASK			0x000f
177
#define	IEEE80211_SEQ_FRAG_MASK			0x000f
173
#define	IEEE80211_SEQ_FRAG_SHIFT		0
178
#define	IEEE80211_SEQ_FRAG_SHIFT		0
174
#define	IEEE80211_SEQ_SEQ_MASK			0xfff0
179
#define	IEEE80211_SEQ_SEQ_MASK			0xfff0
(-)sys/net80211/ieee80211_adhoc.c (-2 / +2 lines)
Lines 291-297 Link Here
291
static int
291
static int
292
adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
292
adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
293
{
293
{
294
#define	HAS_SEQ(type)	((type & 0x4) == 0)
295
	struct ieee80211vap *vap = ni->ni_vap;
294
	struct ieee80211vap *vap = ni->ni_vap;
296
	struct ieee80211com *ic = ni->ni_ic;
295
	struct ieee80211com *ic = ni->ni_ic;
297
	struct ifnet *ifp = vap->iv_ifp;
296
	struct ifnet *ifp = vap->iv_ifp;
Lines 414-420 Link Here
414
		}
413
		}
415
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
414
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
416
		ni->ni_noise = nf;
415
		ni->ni_noise = nf;
417
		if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
416
		if (IEEE80211_HAS_SEQ(type, subtype) &&
417
		    IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
418
			uint8_t tid = ieee80211_gettid(wh);
418
			uint8_t tid = ieee80211_gettid(wh);
419
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
419
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
420
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
420
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
(-)sys/net80211/ieee80211_hostap.c (-2 / +1 lines)
Lines 478-484 Link Here
478
static int
478
static int
479
hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
479
hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
480
{
480
{
481
#define	HAS_SEQ(type)	((type & 0x4) == 0)
482
	struct ieee80211vap *vap = ni->ni_vap;
481
	struct ieee80211vap *vap = ni->ni_vap;
483
	struct ieee80211com *ic = ni->ni_ic;
482
	struct ieee80211com *ic = ni->ni_ic;
484
	struct ifnet *ifp = vap->iv_ifp;
483
	struct ifnet *ifp = vap->iv_ifp;
Lines 571-577 Link Here
571
570
572
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
571
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
573
		ni->ni_noise = nf;
572
		ni->ni_noise = nf;
574
		if (HAS_SEQ(type)) {
573
		if (IEEE80211_HAS_SEQ(type, subtype)) {
575
			uint8_t tid = ieee80211_gettid(wh);
574
			uint8_t tid = ieee80211_gettid(wh);
576
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
575
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
577
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
576
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
(-)sys/net80211/ieee80211_input.h (-5 / +7 lines)
Lines 168-186 Link Here
168
{
168
{
169
#define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
169
#define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
170
#define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
170
#define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
171
#define	HAS_SEQ(type)	((type & 0x4) == 0)
172
#define	SEQNO(a)	((a) >> IEEE80211_SEQ_SEQ_SHIFT)
171
#define	SEQNO(a)	((a) >> IEEE80211_SEQ_SEQ_SHIFT)
173
#define	FRAGNO(a)	((a) & IEEE80211_SEQ_FRAG_MASK)
172
#define	FRAGNO(a)	((a) & IEEE80211_SEQ_FRAG_MASK)
174
	uint16_t rxseq;
173
	uint16_t rxseq;
175
	uint8_t type;
174
	uint8_t type, subtype;
176
	uint8_t tid;
175
	uint8_t tid;
177
	struct ieee80211_rx_ampdu *rap;
176
	struct ieee80211_rx_ampdu *rap;
178
177
179
	rxseq = le16toh(*(uint16_t *)wh->i_seq);
178
	rxseq = le16toh(*(uint16_t *)wh->i_seq);
180
	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
179
	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
180
	subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
181
181
182
	/* Types with no sequence number are always treated valid */
182
	/*
183
	if (! HAS_SEQ(type))
183
	 * Types with no sequence number (or QoS (+)Null frames)
184
	 * are always treated valid.
185
	 */
186
	if (! IEEE80211_HAS_SEQ(type, subtype))
184
		return 1;
187
		return 1;
185
188
186
	tid = ieee80211_gettid(wh);
189
	tid = ieee80211_gettid(wh);
Lines 235-241 Link Here
235
	return 1;
238
	return 1;
236
#undef	SEQ_LEQ
239
#undef	SEQ_LEQ
237
#undef	SEQ_EQ
240
#undef	SEQ_EQ
238
#undef	HAS_SEQ
239
#undef	SEQNO
241
#undef	SEQNO
240
#undef	FRAGNO
242
#undef	FRAGNO
241
}
243
}
(-)sys/net80211/ieee80211_output.c (-1 / +6 lines)
Lines 730-736 Link Here
730
	if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap))
730
	if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap))
731
		m->m_flags |= M_AMPDU_MPDU;
731
		m->m_flags |= M_AMPDU_MPDU;
732
	else {
732
	else {
733
		seqno = ni->ni_txseqs[tid]++;
733
		if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK,
734
				      type & IEEE80211_FC0_SUBTYPE_MASK))
735
			seqno = ni->ni_txseqs[tid]++;
736
		else
737
			seqno = 0;
738
734
		*(uint16_t *)&wh->i_seq[0] =
739
		*(uint16_t *)&wh->i_seq[0] =
735
		    htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
740
		    htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
736
		M_SEQNO_SET(m, seqno);
741
		M_SEQNO_SET(m, seqno);
(-)sys/net80211/ieee80211_sta.c (-2 / +2 lines)
Lines 527-533 Link Here
527
static int
527
static int
528
sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
528
sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
529
{
529
{
530
#define	HAS_SEQ(type)	((type & 0x4) == 0)
531
	struct ieee80211vap *vap = ni->ni_vap;
530
	struct ieee80211vap *vap = ni->ni_vap;
532
	struct ieee80211com *ic = ni->ni_ic;
531
	struct ieee80211com *ic = ni->ni_ic;
533
	struct ifnet *ifp = vap->iv_ifp;
532
	struct ifnet *ifp = vap->iv_ifp;
Lines 623-629 Link Here
623
622
624
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
623
		IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
625
		ni->ni_noise = nf;
624
		ni->ni_noise = nf;
626
		if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) {
625
		if ( IEEE80211_HAS_SEQ(type, subtype) &&
626
		    !IEEE80211_IS_MULTICAST(wh->i_addr1)) {
627
			uint8_t tid = ieee80211_gettid(wh);
627
			uint8_t tid = ieee80211_gettid(wh);
628
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
628
			if (IEEE80211_QOS_HAS_SEQ(wh) &&
629
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
629
			    TID_TO_WME_AC(tid) >= WME_AC_VI)
(-)sys/net80211/ieee80211_wds.c (-2 / +1 lines)
Lines 406-412 Link Here
406
static int
406
static int
407
wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
407
wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
408
{
408
{
409
#define	HAS_SEQ(type)	((type & 0x4) == 0)
410
	struct ieee80211vap *vap = ni->ni_vap;
409
	struct ieee80211vap *vap = ni->ni_vap;
411
	struct ieee80211com *ic = ni->ni_ic;
410
	struct ieee80211com *ic = ni->ni_ic;
412
	struct ifnet *ifp = vap->iv_ifp;
411
	struct ifnet *ifp = vap->iv_ifp;
Lines 488-494 Link Here
488
	}
487
	}
489
	IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
488
	IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
490
	ni->ni_noise = nf;
489
	ni->ni_noise = nf;
491
	if (HAS_SEQ(type)) {
490
	if (IEEE80211_HAS_SEQ(type, subtype)) {
492
		uint8_t tid = ieee80211_gettid(wh);
491
		uint8_t tid = ieee80211_gettid(wh);
493
		if (IEEE80211_QOS_HAS_SEQ(wh) &&
492
		if (IEEE80211_QOS_HAS_SEQ(wh) &&
494
		    TID_TO_WME_AC(tid) >= WME_AC_VI)
493
		    TID_TO_WME_AC(tid) >= WME_AC_VI)

Return to bug 200128