xref: /freebsd/sys/net80211/ieee80211_input.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1b032f27cSSam Leffler /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3fe267a55SPedro F. Giffuni  *
410ad9a77SSam Leffler  * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
5b032f27cSSam Leffler  * All rights reserved.
6b032f27cSSam Leffler  *
7b032f27cSSam Leffler  * Redistribution and use in source and binary forms, with or without
8b032f27cSSam Leffler  * modification, are permitted provided that the following conditions
9b032f27cSSam Leffler  * are met:
10b032f27cSSam Leffler  * 1. Redistributions of source code must retain the above copyright
11b032f27cSSam Leffler  *    notice, this list of conditions and the following disclaimer.
12b032f27cSSam Leffler  * 2. Redistributions in binary form must reproduce the above copyright
13b032f27cSSam Leffler  *    notice, this list of conditions and the following disclaimer in the
14b032f27cSSam Leffler  *    documentation and/or other materials provided with the distribution.
15b032f27cSSam Leffler  *
16b032f27cSSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17b032f27cSSam Leffler  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18b032f27cSSam Leffler  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19b032f27cSSam Leffler  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20b032f27cSSam Leffler  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21b032f27cSSam Leffler  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22b032f27cSSam Leffler  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23b032f27cSSam Leffler  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24b032f27cSSam Leffler  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25b032f27cSSam Leffler  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26b032f27cSSam Leffler  */
27b032f27cSSam Leffler #ifndef _NET80211_IEEE80211_INPUT_H_
28b032f27cSSam Leffler #define _NET80211_IEEE80211_INPUT_H_
29b032f27cSSam Leffler 
30b032f27cSSam Leffler /* Verify the existence and length of __elem or get out. */
31b032f27cSSam Leffler #define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen, _action) do {	\
32b032f27cSSam Leffler 	if ((__elem) == NULL) {						\
33b032f27cSSam Leffler 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
34b032f27cSSam Leffler 		    wh, NULL, "%s", "no " #__elem );			\
35b032f27cSSam Leffler 		vap->iv_stats.is_rx_elem_missing++;			\
36b032f27cSSam Leffler 		_action;						\
37b032f27cSSam Leffler 	} else if ((__elem)[1] > (__maxlen)) {				\
38b032f27cSSam Leffler 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
39b032f27cSSam Leffler 		    wh, NULL, "bad " #__elem " len %d", (__elem)[1]);	\
40b032f27cSSam Leffler 		vap->iv_stats.is_rx_elem_toobig++;			\
41b032f27cSSam Leffler 		_action;						\
42b032f27cSSam Leffler 	}								\
43b032f27cSSam Leffler } while (0)
44b032f27cSSam Leffler 
45b032f27cSSam Leffler #define	IEEE80211_VERIFY_LENGTH(_len, _minlen, _action) do {		\
46b032f27cSSam Leffler 	if ((_len) < (_minlen)) {					\
47b032f27cSSam Leffler 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
48b032f27cSSam Leffler 		    wh, NULL, "ie too short, got %d, expected %d",	\
49b032f27cSSam Leffler 		    (_len), (_minlen));					\
50b032f27cSSam Leffler 		vap->iv_stats.is_rx_elem_toosmall++;			\
51b032f27cSSam Leffler 		_action;						\
52b032f27cSSam Leffler 	}								\
53b032f27cSSam Leffler } while (0)
54b032f27cSSam Leffler 
55b032f27cSSam Leffler #ifdef IEEE80211_DEBUG
56b032f27cSSam Leffler void	ieee80211_ssid_mismatch(struct ieee80211vap *, const char *tag,
57b032f27cSSam Leffler 	uint8_t mac[IEEE80211_ADDR_LEN], uint8_t *ssid);
58b032f27cSSam Leffler 
59b032f27cSSam Leffler #define	IEEE80211_VERIFY_SSID(_ni, _ssid, _action) do {			\
60b032f27cSSam Leffler 	if ((_ssid)[1] != 0 &&						\
61b032f27cSSam Leffler 	    ((_ssid)[1] != (_ni)->ni_esslen ||				\
62b032f27cSSam Leffler 	    memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) {	\
63b032f27cSSam Leffler 		if (ieee80211_msg_input(vap))				\
64b032f27cSSam Leffler 			ieee80211_ssid_mismatch(vap, 			\
654357a5d1SAndriy Voskoboinyk 			    ieee80211_mgt_subtype_name(subtype),	\
66b032f27cSSam Leffler 				wh->i_addr2, _ssid);			\
67b032f27cSSam Leffler 		vap->iv_stats.is_rx_ssidmismatch++;			\
68b032f27cSSam Leffler 		_action;						\
69b032f27cSSam Leffler 	}								\
70b032f27cSSam Leffler } while (0)
71b032f27cSSam Leffler #else /* !IEEE80211_DEBUG */
72b032f27cSSam Leffler #define	IEEE80211_VERIFY_SSID(_ni, _ssid, _action) do {			\
73b032f27cSSam Leffler 	if ((_ssid)[1] != 0 &&						\
74b032f27cSSam Leffler 	    ((_ssid)[1] != (_ni)->ni_esslen ||				\
75b032f27cSSam Leffler 	    memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) {	\
76b032f27cSSam Leffler 		vap->iv_stats.is_rx_ssidmismatch++;			\
77b032f27cSSam Leffler 		_action;						\
78b032f27cSSam Leffler 	}								\
79b032f27cSSam Leffler } while (0)
80b032f27cSSam Leffler #endif /* !IEEE80211_DEBUG */
81b032f27cSSam Leffler 
8231021a2bSAndriy Voskoboinyk #include <sys/endian.h>		/* For le16toh() / le32dec() */
83b032f27cSSam Leffler 
84b032f27cSSam Leffler static __inline int
iswpaoui(const uint8_t * frm)85b032f27cSSam Leffler iswpaoui(const uint8_t *frm)
86b032f27cSSam Leffler {
8731021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI);
88b032f27cSSam Leffler }
89b032f27cSSam Leffler 
90b032f27cSSam Leffler static __inline int
iswmeoui(const uint8_t * frm)91b032f27cSSam Leffler iswmeoui(const uint8_t *frm)
92b032f27cSSam Leffler {
9331021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI);
94b032f27cSSam Leffler }
95b032f27cSSam Leffler 
96b032f27cSSam Leffler static __inline int
iswmeparam(const uint8_t * frm)97b032f27cSSam Leffler iswmeparam(const uint8_t *frm)
98b032f27cSSam Leffler {
9931021a2bSAndriy Voskoboinyk 	return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) &&
100b032f27cSSam Leffler 		frm[6] == WME_PARAM_OUI_SUBTYPE;
101b032f27cSSam Leffler }
102b032f27cSSam Leffler 
103b032f27cSSam Leffler static __inline int
iswmeinfo(const uint8_t * frm)104b032f27cSSam Leffler iswmeinfo(const uint8_t *frm)
105b032f27cSSam Leffler {
10631021a2bSAndriy Voskoboinyk 	return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) &&
107b032f27cSSam Leffler 		frm[6] == WME_INFO_OUI_SUBTYPE;
108b032f27cSSam Leffler }
109b032f27cSSam Leffler 
110b032f27cSSam Leffler static __inline int
isatherosoui(const uint8_t * frm)111b032f27cSSam Leffler isatherosoui(const uint8_t *frm)
112b032f27cSSam Leffler {
11331021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI);
114b032f27cSSam Leffler }
115b032f27cSSam Leffler 
116b032f27cSSam Leffler static __inline int
istdmaoui(const uint8_t * frm)11710ad9a77SSam Leffler istdmaoui(const uint8_t *frm)
11810ad9a77SSam Leffler {
11931021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((TDMA_OUI_TYPE<<24)|TDMA_OUI);
12010ad9a77SSam Leffler }
12110ad9a77SSam Leffler 
12210ad9a77SSam Leffler static __inline int
ishtcapoui(const uint8_t * frm)123b032f27cSSam Leffler ishtcapoui(const uint8_t *frm)
124b032f27cSSam Leffler {
12531021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTCAP<<24)|BCM_OUI);
126b032f27cSSam Leffler }
127b032f27cSSam Leffler 
128b032f27cSSam Leffler static __inline int
ishtinfooui(const uint8_t * frm)129b032f27cSSam Leffler ishtinfooui(const uint8_t *frm)
130b032f27cSSam Leffler {
13131021a2bSAndriy Voskoboinyk 	return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI);
132b032f27cSSam Leffler }
133b032f27cSSam Leffler 
13448f95a36SAdrian Chadd static __inline int
ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats * rxs)13548f95a36SAdrian Chadd ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs)
13648f95a36SAdrian Chadd {
137e9efad4fSAdrian Chadd 	if (rxs == NULL)
138e9efad4fSAdrian Chadd 		return 0;
13948f95a36SAdrian Chadd 	return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU));
14048f95a36SAdrian Chadd }
14148f95a36SAdrian Chadd 
14248f95a36SAdrian Chadd /*
14348f95a36SAdrian Chadd  * Return 1 if the rxseq check should increment the sequence
14448f95a36SAdrian Chadd  * number. Return 0 if it's part of an AMSDU batch and it isn't
14548f95a36SAdrian Chadd  * the final frame in the decap'ed burst.
14648f95a36SAdrian Chadd  */
14748f95a36SAdrian Chadd static __inline int
ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats * rxs)14848f95a36SAdrian Chadd ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs)
14948f95a36SAdrian Chadd {
15048f95a36SAdrian Chadd 	/* No state? ok */
15148f95a36SAdrian Chadd 	if (rxs == NULL)
15248f95a36SAdrian Chadd 		return (1);
15348f95a36SAdrian Chadd 
15448f95a36SAdrian Chadd 	/* State but no AMSDU set? ok */
15548f95a36SAdrian Chadd 	if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0)
15648f95a36SAdrian Chadd 		return (1);
15748f95a36SAdrian Chadd 
15848f95a36SAdrian Chadd 	/* State, AMSDU set, then _MORE means "don't inc yet" */
15948f95a36SAdrian Chadd 	if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) {
16048f95a36SAdrian Chadd 		return (0);
16148f95a36SAdrian Chadd 	}
16248f95a36SAdrian Chadd 
16348f95a36SAdrian Chadd 	/* Both are set, so return ok */
16448f95a36SAdrian Chadd 	return (1);
16548f95a36SAdrian Chadd }
16648f95a36SAdrian Chadd 
167cd0b8f2dSAdrian Chadd /*
168cd0b8f2dSAdrian Chadd  * Check the current frame sequence number against the current TID
169cd0b8f2dSAdrian Chadd  * state and return whether it's in sequence or should be dropped.
170cd0b8f2dSAdrian Chadd  *
171cd0b8f2dSAdrian Chadd  * Since out of order packet and duplicate packet eliminations should
172cd0b8f2dSAdrian Chadd  * be done by the AMPDU RX code, this routine blindly accepts all
173cd0b8f2dSAdrian Chadd  * frames from a HT station w/ a TID that is currently doing AMPDU-RX.
174cd0b8f2dSAdrian Chadd  * HT stations without WME or where the TID is not doing AMPDU-RX
175cd0b8f2dSAdrian Chadd  * are checked like non-HT stations.
176cd0b8f2dSAdrian Chadd  *
177cd0b8f2dSAdrian Chadd  * The routine only eliminates packets whose sequence/fragment
178cd0b8f2dSAdrian Chadd  * match or are less than the last seen sequence/fragment number
17949c220b0SBjoern A. Zeeb  * AND are retransmits. It doesn't try to eliminate out of order packets.
180cd0b8f2dSAdrian Chadd  *
181cd0b8f2dSAdrian Chadd  * Since all frames after sequence number 4095 will be less than 4095
182cd0b8f2dSAdrian Chadd  * (as the seqnum wraps), handle that special case so packets aren't
183cd0b8f2dSAdrian Chadd  * incorrectly dropped - ie, if the next packet is sequence number 0
184cd0b8f2dSAdrian Chadd  * but a retransmit since the initial packet didn't make it.
1859764ef21SAdrian Chadd  *
1869764ef21SAdrian Chadd  * XXX TODO: handle sequence number space wrapping with dropped frames;
1879764ef21SAdrian Chadd  * especially in high interference conditions under high traffic load
1889764ef21SAdrian Chadd  * The RX AMPDU reorder code also needs it.
1899764ef21SAdrian Chadd  *
1909764ef21SAdrian Chadd  * XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery.
191cd0b8f2dSAdrian Chadd  */
192cd0b8f2dSAdrian Chadd static __inline int
ieee80211_check_rxseq(struct ieee80211_node * ni,struct ieee80211_frame * wh,uint8_t * bssid,const struct ieee80211_rx_stats * rxs)1931ffa8d7eSAndriy Voskoboinyk ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh,
19485c4e670SAdrian Chadd     uint8_t *bssid, const struct ieee80211_rx_stats *rxs)
195cd0b8f2dSAdrian Chadd {
196cd0b8f2dSAdrian Chadd #define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
197cd0b8f2dSAdrian Chadd #define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
198cd0b8f2dSAdrian Chadd #define	SEQNO(a)	((a) >> IEEE80211_SEQ_SEQ_SHIFT)
199cd0b8f2dSAdrian Chadd #define	FRAGNO(a)	((a) & IEEE80211_SEQ_FRAG_MASK)
2001ffa8d7eSAndriy Voskoboinyk 	struct ieee80211vap *vap = ni->ni_vap;
201cd0b8f2dSAdrian Chadd 	uint16_t rxseq;
202c3ebe019SAdrian Chadd 	uint8_t type, subtype;
203cd0b8f2dSAdrian Chadd 	uint8_t tid;
204cd0b8f2dSAdrian Chadd 	struct ieee80211_rx_ampdu *rap;
205cd0b8f2dSAdrian Chadd 
206cd0b8f2dSAdrian Chadd 	rxseq = le16toh(*(uint16_t *)wh->i_seq);
207cd0b8f2dSAdrian Chadd 	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
208c3ebe019SAdrian Chadd 	subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
209cd0b8f2dSAdrian Chadd 
210c3ebe019SAdrian Chadd 	/*
211c3ebe019SAdrian Chadd 	 * Types with no sequence number (or QoS (+)Null frames)
212c3ebe019SAdrian Chadd 	 * are always treated valid.
213c3ebe019SAdrian Chadd 	 */
214c3ebe019SAdrian Chadd 	if (! IEEE80211_HAS_SEQ(type, subtype))
215cd0b8f2dSAdrian Chadd 		return 1;
216cd0b8f2dSAdrian Chadd 
2179764ef21SAdrian Chadd 	/*
2189764ef21SAdrian Chadd 	 * Always allow multicast frames for now - QoS (any TID)
2199764ef21SAdrian Chadd 	 * or not.
2209764ef21SAdrian Chadd 	 */
2219764ef21SAdrian Chadd 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
2229764ef21SAdrian Chadd 		return 1;
2239764ef21SAdrian Chadd 
224cd0b8f2dSAdrian Chadd 	tid = ieee80211_gettid(wh);
225cd0b8f2dSAdrian Chadd 
226cd0b8f2dSAdrian Chadd 	/*
227cd0b8f2dSAdrian Chadd 	 * Only do the HT AMPDU check for WME stations; non-WME HT stations
228cd0b8f2dSAdrian Chadd 	 * shouldn't exist outside of debugging. We should at least
229cd0b8f2dSAdrian Chadd 	 * handle that.
230cd0b8f2dSAdrian Chadd 	 */
231cd0b8f2dSAdrian Chadd 	if (tid < WME_NUM_TID) {
232cd0b8f2dSAdrian Chadd 		rap = &ni->ni_rx_ampdu[tid];
233cd0b8f2dSAdrian Chadd 		/* HT nodes currently doing RX AMPDU are always valid */
234cd0b8f2dSAdrian Chadd 		if ((ni->ni_flags & IEEE80211_NODE_HT) &&
235cd0b8f2dSAdrian Chadd 		    (rap->rxa_flags & IEEE80211_AGGR_RUNNING))
2361ffa8d7eSAndriy Voskoboinyk 			goto ok;
237cd0b8f2dSAdrian Chadd 	}
238cd0b8f2dSAdrian Chadd 
239cd0b8f2dSAdrian Chadd 	/*
240cd0b8f2dSAdrian Chadd 	 * Otherwise, retries for packets below or equal to the last
241cd0b8f2dSAdrian Chadd 	 * seen sequence number should be dropped.
242cd0b8f2dSAdrian Chadd 	 */
243cd0b8f2dSAdrian Chadd 
244cd0b8f2dSAdrian Chadd 	/*
245cd0b8f2dSAdrian Chadd 	 * Treat frame seqnum 4095 as special due to boundary
246cd0b8f2dSAdrian Chadd 	 * wrapping conditions.
247cd0b8f2dSAdrian Chadd 	 */
248cd0b8f2dSAdrian Chadd 	if (SEQNO(ni->ni_rxseqs[tid]) == 4095) {
249cd0b8f2dSAdrian Chadd 		/*
250cd0b8f2dSAdrian Chadd 		 * Drop retransmits on seqnum 4095/current fragment for itself.
251cd0b8f2dSAdrian Chadd 		 */
252cd0b8f2dSAdrian Chadd 		if (SEQ_EQ(rxseq, ni->ni_rxseqs[tid]) &&
253cd0b8f2dSAdrian Chadd 		    (wh->i_fc[1] & IEEE80211_FC1_RETRY))
2541ffa8d7eSAndriy Voskoboinyk 			goto fail;
255cd0b8f2dSAdrian Chadd 		/*
256cd0b8f2dSAdrian Chadd 		 * Treat any subsequent frame as fine if the last seen frame
257cd0b8f2dSAdrian Chadd 		 * is 4095 and it's not a retransmit for the same sequence
258cd0b8f2dSAdrian Chadd 		 * number. However, this doesn't capture incorrectly ordered
259cd0b8f2dSAdrian Chadd 	 	 * fragments w/ sequence number 4095. It shouldn't be seen
260cd0b8f2dSAdrian Chadd 		 * in practice, but see the comment above for further info.
261cd0b8f2dSAdrian Chadd 		 */
2621ffa8d7eSAndriy Voskoboinyk 		goto ok;
263cd0b8f2dSAdrian Chadd 	}
264cd0b8f2dSAdrian Chadd 
265cd0b8f2dSAdrian Chadd 	/*
266cd0b8f2dSAdrian Chadd 	 * At this point we assume that retransmitted seq/frag numbers below
267cd0b8f2dSAdrian Chadd 	 * the current can simply be eliminated.
268cd0b8f2dSAdrian Chadd 	 */
269cd0b8f2dSAdrian Chadd 	if ((wh->i_fc[1] & IEEE80211_FC1_RETRY) &&
270cd0b8f2dSAdrian Chadd 	    SEQ_LEQ(rxseq, ni->ni_rxseqs[tid]))
2711ffa8d7eSAndriy Voskoboinyk 		goto fail;
2721ffa8d7eSAndriy Voskoboinyk 
2731ffa8d7eSAndriy Voskoboinyk ok:
27448f95a36SAdrian Chadd 	/*
27548f95a36SAdrian Chadd 	 * Only bump the sequence number if it's the last frame
27648f95a36SAdrian Chadd 	 * in a batch.  That way frames in the rest of the batch
27748f95a36SAdrian Chadd 	 * get included, and the last frame in the batch kicks
27848f95a36SAdrian Chadd 	 * it next.
27948f95a36SAdrian Chadd 	 */
28048f95a36SAdrian Chadd 	if (ieee80211_check_rxseq_amsdu_more(rxs)) {
2811ffa8d7eSAndriy Voskoboinyk 		ni->ni_rxseqs[tid] = rxseq;
28279caf56eSAdrian Chadd 		if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
28348f95a36SAdrian Chadd 			IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
28448f95a36SAdrian Chadd 	} else {
28548f95a36SAdrian Chadd 		/* .. still waiting */
28648f95a36SAdrian Chadd 		IEEE80211_NODE_STAT(ni, rx_amsdu_more);
28748f95a36SAdrian Chadd 	}
288cd0b8f2dSAdrian Chadd 
289cd0b8f2dSAdrian Chadd 	return 1;
2901ffa8d7eSAndriy Voskoboinyk 
2911ffa8d7eSAndriy Voskoboinyk fail:
2921ffa8d7eSAndriy Voskoboinyk 	/* duplicate, discard */
2931ffa8d7eSAndriy Voskoboinyk 	IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, bssid, "duplicate",
2941ffa8d7eSAndriy Voskoboinyk 	    "seqno <%u,%u> fragno <%u,%u> tid %u",
2951ffa8d7eSAndriy Voskoboinyk 	     SEQNO(rxseq),  SEQNO(ni->ni_rxseqs[tid]),
2961ffa8d7eSAndriy Voskoboinyk 	    FRAGNO(rxseq), FRAGNO(ni->ni_rxseqs[tid]), tid);
2971ffa8d7eSAndriy Voskoboinyk 	vap->iv_stats.is_rx_dup++;
2981ffa8d7eSAndriy Voskoboinyk 	IEEE80211_NODE_STAT(ni, rx_dup);
2991ffa8d7eSAndriy Voskoboinyk 
3001ffa8d7eSAndriy Voskoboinyk 	return 0;
301cd0b8f2dSAdrian Chadd #undef	SEQ_LEQ
302cd0b8f2dSAdrian Chadd #undef	SEQ_EQ
303cd0b8f2dSAdrian Chadd #undef	SEQNO
304cd0b8f2dSAdrian Chadd #undef	FRAGNO
305cd0b8f2dSAdrian Chadd }
306cd0b8f2dSAdrian Chadd 
307b032f27cSSam Leffler void	ieee80211_deliver_data(struct ieee80211vap *,
308b032f27cSSam Leffler 		struct ieee80211_node *, struct mbuf *);
309b032f27cSSam Leffler struct mbuf *ieee80211_defrag(struct ieee80211_node *,
31011572d7dSMathy Vanhoef 		struct mbuf *, int, int);
311519f677aSSam Leffler struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t);
312f024bdf1SMathy Vanhoef struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int,
313f024bdf1SMathy Vanhoef 		uint8_t);
314b032f27cSSam Leffler struct mbuf *ieee80211_decap1(struct mbuf *, int *);
315b032f27cSSam Leffler int	ieee80211_setup_rates(struct ieee80211_node *ni,
316b032f27cSSam Leffler 		const uint8_t *rates, const uint8_t *xrates, int flags);
317b032f27cSSam Leffler void ieee80211_send_error(struct ieee80211_node *,
318b032f27cSSam Leffler 		const uint8_t mac[IEEE80211_ADDR_LEN], int subtype, int arg);
319b032f27cSSam Leffler int	ieee80211_alloc_challenge(struct ieee80211_node *);
320b032f27cSSam Leffler int	ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
321c79f192cSAdrian Chadd 		struct ieee80211_channel *,
322b032f27cSSam Leffler 		struct ieee80211_scanparams *);
323b032f27cSSam Leffler int	ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);
324b032f27cSSam Leffler #endif /* _NET80211_IEEE80211_INPUT_H_ */
325