xref: /haiku/src/libs/compat/freebsd_wlan/net80211/ieee80211_input.h (revision 5cad57c43b0225be334092e4700b79392db86f2d)
1753c7e08SAugustin Cavalier /*-
28244a9baSAugustin Cavalier  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
38244a9baSAugustin Cavalier  *
4753c7e08SAugustin Cavalier  * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
5753c7e08SAugustin Cavalier  * All rights reserved.
6753c7e08SAugustin Cavalier  *
7753c7e08SAugustin Cavalier  * Redistribution and use in source and binary forms, with or without
8753c7e08SAugustin Cavalier  * modification, are permitted provided that the following conditions
9753c7e08SAugustin Cavalier  * are met:
10753c7e08SAugustin Cavalier  * 1. Redistributions of source code must retain the above copyright
11753c7e08SAugustin Cavalier  *    notice, this list of conditions and the following disclaimer.
12753c7e08SAugustin Cavalier  * 2. Redistributions in binary form must reproduce the above copyright
13753c7e08SAugustin Cavalier  *    notice, this list of conditions and the following disclaimer in the
14753c7e08SAugustin Cavalier  *    documentation and/or other materials provided with the distribution.
15753c7e08SAugustin Cavalier  *
16753c7e08SAugustin Cavalier  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17753c7e08SAugustin Cavalier  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18753c7e08SAugustin Cavalier  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19753c7e08SAugustin Cavalier  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20753c7e08SAugustin Cavalier  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21753c7e08SAugustin Cavalier  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22753c7e08SAugustin Cavalier  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23753c7e08SAugustin Cavalier  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24753c7e08SAugustin Cavalier  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25753c7e08SAugustin Cavalier  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26753c7e08SAugustin Cavalier  *
278244a9baSAugustin Cavalier  * $FreeBSD: releng/12.0/sys/net80211/ieee80211_input.h 326272 2017-11-27 15:23:17Z pfg $
28753c7e08SAugustin Cavalier  */
29753c7e08SAugustin Cavalier #ifndef _NET80211_IEEE80211_INPUT_H_
30753c7e08SAugustin Cavalier #define _NET80211_IEEE80211_INPUT_H_
31753c7e08SAugustin Cavalier 
32753c7e08SAugustin Cavalier /* Verify the existence and length of __elem or get out. */
33753c7e08SAugustin Cavalier #define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen, _action) do {	\
34753c7e08SAugustin Cavalier 	if ((__elem) == NULL) {						\
35753c7e08SAugustin Cavalier 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
36753c7e08SAugustin Cavalier 		    wh, NULL, "%s", "no " #__elem );			\
37753c7e08SAugustin Cavalier 		vap->iv_stats.is_rx_elem_missing++;			\
38753c7e08SAugustin Cavalier 		_action;						\
39753c7e08SAugustin Cavalier 	} else if ((__elem)[1] > (__maxlen)) {				\
40753c7e08SAugustin Cavalier 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
41753c7e08SAugustin Cavalier 		    wh, NULL, "bad " #__elem " len %d", (__elem)[1]);	\
42753c7e08SAugustin Cavalier 		vap->iv_stats.is_rx_elem_toobig++;			\
43753c7e08SAugustin Cavalier 		_action;						\
44753c7e08SAugustin Cavalier 	}								\
45753c7e08SAugustin Cavalier } while (0)
46753c7e08SAugustin Cavalier 
47753c7e08SAugustin Cavalier #define	IEEE80211_VERIFY_LENGTH(_len, _minlen, _action) do {		\
48753c7e08SAugustin Cavalier 	if ((_len) < (_minlen)) {					\
49753c7e08SAugustin Cavalier 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID,		\
50753c7e08SAugustin Cavalier 		    wh, NULL, "ie too short, got %d, expected %d",	\
51753c7e08SAugustin Cavalier 		    (_len), (_minlen));					\
52753c7e08SAugustin Cavalier 		vap->iv_stats.is_rx_elem_toosmall++;			\
53753c7e08SAugustin Cavalier 		_action;						\
54753c7e08SAugustin Cavalier 	}								\
55753c7e08SAugustin Cavalier } while (0)
56753c7e08SAugustin Cavalier 
57753c7e08SAugustin Cavalier #ifdef IEEE80211_DEBUG
58753c7e08SAugustin Cavalier void	ieee80211_ssid_mismatch(struct ieee80211vap *, const char *tag,
59753c7e08SAugustin Cavalier 	uint8_t mac[IEEE80211_ADDR_LEN], uint8_t *ssid);
60753c7e08SAugustin Cavalier 
61753c7e08SAugustin Cavalier #define	IEEE80211_VERIFY_SSID(_ni, _ssid, _action) do {			\
62753c7e08SAugustin Cavalier 	if ((_ssid)[1] != 0 &&						\
63753c7e08SAugustin Cavalier 	    ((_ssid)[1] != (_ni)->ni_esslen ||				\
64753c7e08SAugustin Cavalier 	    memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) {	\
65753c7e08SAugustin Cavalier 		if (ieee80211_msg_input(vap))				\
66753c7e08SAugustin Cavalier 			ieee80211_ssid_mismatch(vap, 			\
67753c7e08SAugustin Cavalier 			    ieee80211_mgt_subtype_name(subtype),	\
68753c7e08SAugustin Cavalier 				wh->i_addr2, _ssid);			\
69753c7e08SAugustin Cavalier 		vap->iv_stats.is_rx_ssidmismatch++;			\
70753c7e08SAugustin Cavalier 		_action;						\
71753c7e08SAugustin Cavalier 	}								\
72753c7e08SAugustin Cavalier } while (0)
73753c7e08SAugustin Cavalier #else /* !IEEE80211_DEBUG */
74753c7e08SAugustin Cavalier #define	IEEE80211_VERIFY_SSID(_ni, _ssid, _action) do {			\
75753c7e08SAugustin Cavalier 	if ((_ssid)[1] != 0 &&						\
76753c7e08SAugustin Cavalier 	    ((_ssid)[1] != (_ni)->ni_esslen ||				\
77753c7e08SAugustin Cavalier 	    memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) {	\
78753c7e08SAugustin Cavalier 		vap->iv_stats.is_rx_ssidmismatch++;			\
79753c7e08SAugustin Cavalier 		_action;						\
80753c7e08SAugustin Cavalier 	}								\
81753c7e08SAugustin Cavalier } while (0)
82753c7e08SAugustin Cavalier #endif /* !IEEE80211_DEBUG */
83753c7e08SAugustin Cavalier 
84753c7e08SAugustin Cavalier #include <sys/endian.h>		/* For le16toh() / le32dec() */
85753c7e08SAugustin Cavalier 
86753c7e08SAugustin Cavalier static __inline int
87753c7e08SAugustin Cavalier iswpaoui(const uint8_t *frm)
88753c7e08SAugustin Cavalier {
89753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI);
90753c7e08SAugustin Cavalier }
91753c7e08SAugustin Cavalier 
92753c7e08SAugustin Cavalier static __inline int
93753c7e08SAugustin Cavalier iswmeoui(const uint8_t *frm)
94753c7e08SAugustin Cavalier {
95753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI);
96753c7e08SAugustin Cavalier }
97753c7e08SAugustin Cavalier 
98753c7e08SAugustin Cavalier static __inline int
99753c7e08SAugustin Cavalier iswmeparam(const uint8_t *frm)
100753c7e08SAugustin Cavalier {
101753c7e08SAugustin Cavalier 	return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) &&
102753c7e08SAugustin Cavalier 		frm[6] == WME_PARAM_OUI_SUBTYPE;
103753c7e08SAugustin Cavalier }
104753c7e08SAugustin Cavalier 
105753c7e08SAugustin Cavalier static __inline int
106753c7e08SAugustin Cavalier iswmeinfo(const uint8_t *frm)
107753c7e08SAugustin Cavalier {
108753c7e08SAugustin Cavalier 	return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) &&
109753c7e08SAugustin Cavalier 		frm[6] == WME_INFO_OUI_SUBTYPE;
110753c7e08SAugustin Cavalier }
111753c7e08SAugustin Cavalier 
112753c7e08SAugustin Cavalier static __inline int
113753c7e08SAugustin Cavalier isatherosoui(const uint8_t *frm)
114753c7e08SAugustin Cavalier {
115753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI);
116753c7e08SAugustin Cavalier }
117753c7e08SAugustin Cavalier 
118753c7e08SAugustin Cavalier static __inline int
119753c7e08SAugustin Cavalier istdmaoui(const uint8_t *frm)
120753c7e08SAugustin Cavalier {
121753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((TDMA_OUI_TYPE<<24)|TDMA_OUI);
122753c7e08SAugustin Cavalier }
123753c7e08SAugustin Cavalier 
124753c7e08SAugustin Cavalier static __inline int
125753c7e08SAugustin Cavalier ishtcapoui(const uint8_t *frm)
126753c7e08SAugustin Cavalier {
127753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTCAP<<24)|BCM_OUI);
128753c7e08SAugustin Cavalier }
129753c7e08SAugustin Cavalier 
130753c7e08SAugustin Cavalier static __inline int
131753c7e08SAugustin Cavalier ishtinfooui(const uint8_t *frm)
132753c7e08SAugustin Cavalier {
133753c7e08SAugustin Cavalier 	return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI);
134753c7e08SAugustin Cavalier }
135753c7e08SAugustin Cavalier 
1368244a9baSAugustin Cavalier static __inline int
1378244a9baSAugustin Cavalier ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs)
1388244a9baSAugustin Cavalier {
139*5cad57c4SJérôme Duval 	if (rxs == NULL)
140*5cad57c4SJérôme Duval 		return 0;
1418244a9baSAugustin Cavalier 	return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU));
1428244a9baSAugustin Cavalier }
1438244a9baSAugustin Cavalier 
1448244a9baSAugustin Cavalier /*
1458244a9baSAugustin Cavalier  * Return 1 if the rxseq check should increment the sequence
1468244a9baSAugustin Cavalier  * number. Return 0 if it's part of an AMSDU batch and it isn't
1478244a9baSAugustin Cavalier  * the final frame in the decap'ed burst.
1488244a9baSAugustin Cavalier  */
1498244a9baSAugustin Cavalier static __inline int
1508244a9baSAugustin Cavalier ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs)
1518244a9baSAugustin Cavalier {
1528244a9baSAugustin Cavalier 	/* No state? ok */
1538244a9baSAugustin Cavalier 	if (rxs == NULL)
1548244a9baSAugustin Cavalier 		return (1);
1558244a9baSAugustin Cavalier 
1568244a9baSAugustin Cavalier 	/* State but no AMSDU set? ok */
1578244a9baSAugustin Cavalier 	if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0)
1588244a9baSAugustin Cavalier 		return (1);
1598244a9baSAugustin Cavalier 
1608244a9baSAugustin Cavalier 	/* State, AMSDU set, then _MORE means "don't inc yet" */
1618244a9baSAugustin Cavalier 	if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) {
1628244a9baSAugustin Cavalier 		return (0);
1638244a9baSAugustin Cavalier 	}
1648244a9baSAugustin Cavalier 
1658244a9baSAugustin Cavalier 	/* Both are set, so return ok */
1668244a9baSAugustin Cavalier 	return (1);
1678244a9baSAugustin Cavalier }
1688244a9baSAugustin Cavalier 
169753c7e08SAugustin Cavalier /*
170753c7e08SAugustin Cavalier  * Check the current frame sequence number against the current TID
171753c7e08SAugustin Cavalier  * state and return whether it's in sequence or should be dropped.
172753c7e08SAugustin Cavalier  *
173753c7e08SAugustin Cavalier  * Since out of order packet and duplicate packet eliminations should
174753c7e08SAugustin Cavalier  * be done by the AMPDU RX code, this routine blindly accepts all
175753c7e08SAugustin Cavalier  * frames from a HT station w/ a TID that is currently doing AMPDU-RX.
176753c7e08SAugustin Cavalier  * HT stations without WME or where the TID is not doing AMPDU-RX
177753c7e08SAugustin Cavalier  * are checked like non-HT stations.
178753c7e08SAugustin Cavalier  *
179753c7e08SAugustin Cavalier  * The routine only eliminates packets whose sequence/fragment
180753c7e08SAugustin Cavalier  * match or are less than the last seen sequence/fragment number
181753c7e08SAugustin Cavalier  * AND are retransmits It doesn't try to eliminate out of order packets.
182753c7e08SAugustin Cavalier  *
183753c7e08SAugustin Cavalier  * Since all frames after sequence number 4095 will be less than 4095
184753c7e08SAugustin Cavalier  * (as the seqnum wraps), handle that special case so packets aren't
185753c7e08SAugustin Cavalier  * incorrectly dropped - ie, if the next packet is sequence number 0
186753c7e08SAugustin Cavalier  * but a retransmit since the initial packet didn't make it.
1878244a9baSAugustin Cavalier  *
1888244a9baSAugustin Cavalier  * XXX TODO: handle sequence number space wrapping with dropped frames;
1898244a9baSAugustin Cavalier  * especially in high interference conditions under high traffic load
1908244a9baSAugustin Cavalier  * The RX AMPDU reorder code also needs it.
1918244a9baSAugustin Cavalier  *
1928244a9baSAugustin Cavalier  * XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery.
193753c7e08SAugustin Cavalier  */
194753c7e08SAugustin Cavalier static __inline int
195753c7e08SAugustin Cavalier ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh,
1968244a9baSAugustin Cavalier     uint8_t *bssid, const struct ieee80211_rx_stats *rxs)
197753c7e08SAugustin Cavalier {
198753c7e08SAugustin Cavalier #define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
199753c7e08SAugustin Cavalier #define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
200753c7e08SAugustin Cavalier #define	SEQNO(a)	((a) >> IEEE80211_SEQ_SEQ_SHIFT)
201753c7e08SAugustin Cavalier #define	FRAGNO(a)	((a) & IEEE80211_SEQ_FRAG_MASK)
202753c7e08SAugustin Cavalier 	struct ieee80211vap *vap = ni->ni_vap;
203753c7e08SAugustin Cavalier 	uint16_t rxseq;
204753c7e08SAugustin Cavalier 	uint8_t type, subtype;
205753c7e08SAugustin Cavalier 	uint8_t tid;
206753c7e08SAugustin Cavalier 	struct ieee80211_rx_ampdu *rap;
207753c7e08SAugustin Cavalier 
208753c7e08SAugustin Cavalier 	rxseq = le16toh(*(uint16_t *)wh->i_seq);
209753c7e08SAugustin Cavalier 	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
210753c7e08SAugustin Cavalier 	subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
211753c7e08SAugustin Cavalier 
212753c7e08SAugustin Cavalier 	/*
213753c7e08SAugustin Cavalier 	 * Types with no sequence number (or QoS (+)Null frames)
214753c7e08SAugustin Cavalier 	 * are always treated valid.
215753c7e08SAugustin Cavalier 	 */
216753c7e08SAugustin Cavalier 	if (! IEEE80211_HAS_SEQ(type, subtype))
217753c7e08SAugustin Cavalier 		return 1;
218753c7e08SAugustin Cavalier 
2198244a9baSAugustin Cavalier 	/*
2208244a9baSAugustin Cavalier 	 * Always allow multicast frames for now - QoS (any TID)
2218244a9baSAugustin Cavalier 	 * or not.
2228244a9baSAugustin Cavalier 	 */
2238244a9baSAugustin Cavalier 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
2248244a9baSAugustin Cavalier 		return 1;
2258244a9baSAugustin Cavalier 
226753c7e08SAugustin Cavalier 	tid = ieee80211_gettid(wh);
227753c7e08SAugustin Cavalier 
228753c7e08SAugustin Cavalier 	/*
229753c7e08SAugustin Cavalier 	 * Only do the HT AMPDU check for WME stations; non-WME HT stations
230753c7e08SAugustin Cavalier 	 * shouldn't exist outside of debugging. We should at least
231753c7e08SAugustin Cavalier 	 * handle that.
232753c7e08SAugustin Cavalier 	 */
233753c7e08SAugustin Cavalier 	if (tid < WME_NUM_TID) {
234753c7e08SAugustin Cavalier 		rap = &ni->ni_rx_ampdu[tid];
235753c7e08SAugustin Cavalier 		/* HT nodes currently doing RX AMPDU are always valid */
236753c7e08SAugustin Cavalier 		if ((ni->ni_flags & IEEE80211_NODE_HT) &&
237753c7e08SAugustin Cavalier 		    (rap->rxa_flags & IEEE80211_AGGR_RUNNING))
238753c7e08SAugustin Cavalier 			goto ok;
239753c7e08SAugustin Cavalier 	}
240753c7e08SAugustin Cavalier 
241753c7e08SAugustin Cavalier 	/*
242753c7e08SAugustin Cavalier 	 * Otherwise, retries for packets below or equal to the last
243753c7e08SAugustin Cavalier 	 * seen sequence number should be dropped.
244753c7e08SAugustin Cavalier 	 */
245753c7e08SAugustin Cavalier 
246753c7e08SAugustin Cavalier 	/*
247753c7e08SAugustin Cavalier 	 * Treat frame seqnum 4095 as special due to boundary
248753c7e08SAugustin Cavalier 	 * wrapping conditions.
249753c7e08SAugustin Cavalier 	 */
250753c7e08SAugustin Cavalier 	if (SEQNO(ni->ni_rxseqs[tid]) == 4095) {
251753c7e08SAugustin Cavalier 		/*
252753c7e08SAugustin Cavalier 		 * Drop retransmits on seqnum 4095/current fragment for itself.
253753c7e08SAugustin Cavalier 		 */
254753c7e08SAugustin Cavalier 		if (SEQ_EQ(rxseq, ni->ni_rxseqs[tid]) &&
255753c7e08SAugustin Cavalier 		    (wh->i_fc[1] & IEEE80211_FC1_RETRY))
256753c7e08SAugustin Cavalier 			goto fail;
257753c7e08SAugustin Cavalier 		/*
258753c7e08SAugustin Cavalier 		 * Treat any subsequent frame as fine if the last seen frame
259753c7e08SAugustin Cavalier 		 * is 4095 and it's not a retransmit for the same sequence
260753c7e08SAugustin Cavalier 		 * number. However, this doesn't capture incorrectly ordered
261753c7e08SAugustin Cavalier 	 	 * fragments w/ sequence number 4095. It shouldn't be seen
262753c7e08SAugustin Cavalier 		 * in practice, but see the comment above for further info.
263753c7e08SAugustin Cavalier 		 */
264753c7e08SAugustin Cavalier 		goto ok;
265753c7e08SAugustin Cavalier 	}
266753c7e08SAugustin Cavalier 
267753c7e08SAugustin Cavalier 	/*
268753c7e08SAugustin Cavalier 	 * At this point we assume that retransmitted seq/frag numbers below
269753c7e08SAugustin Cavalier 	 * the current can simply be eliminated.
270753c7e08SAugustin Cavalier 	 */
271753c7e08SAugustin Cavalier 	if ((wh->i_fc[1] & IEEE80211_FC1_RETRY) &&
272753c7e08SAugustin Cavalier 	    SEQ_LEQ(rxseq, ni->ni_rxseqs[tid]))
273753c7e08SAugustin Cavalier 		goto fail;
274753c7e08SAugustin Cavalier 
275753c7e08SAugustin Cavalier ok:
2768244a9baSAugustin Cavalier 	/*
2778244a9baSAugustin Cavalier 	 * Only bump the sequence number if it's the last frame
2788244a9baSAugustin Cavalier 	 * in a batch.  That way frames in the rest of the batch
2798244a9baSAugustin Cavalier 	 * get included, and the last frame in the batch kicks
2808244a9baSAugustin Cavalier 	 * it next.
2818244a9baSAugustin Cavalier 	 */
2828244a9baSAugustin Cavalier 	if (ieee80211_check_rxseq_amsdu_more(rxs)) {
283753c7e08SAugustin Cavalier 		ni->ni_rxseqs[tid] = rxseq;
2848244a9baSAugustin Cavalier 		if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
2858244a9baSAugustin Cavalier 			IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
2868244a9baSAugustin Cavalier 	} else {
2878244a9baSAugustin Cavalier 		/* .. still waiting */
2888244a9baSAugustin Cavalier 		IEEE80211_NODE_STAT(ni, rx_amsdu_more);
2898244a9baSAugustin Cavalier 	}
290753c7e08SAugustin Cavalier 
291753c7e08SAugustin Cavalier 	return 1;
292753c7e08SAugustin Cavalier 
293753c7e08SAugustin Cavalier fail:
294753c7e08SAugustin Cavalier 	/* duplicate, discard */
295753c7e08SAugustin Cavalier 	IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, bssid, "duplicate",
296753c7e08SAugustin Cavalier 	    "seqno <%u,%u> fragno <%u,%u> tid %u",
297753c7e08SAugustin Cavalier 	     SEQNO(rxseq),  SEQNO(ni->ni_rxseqs[tid]),
298753c7e08SAugustin Cavalier 	    FRAGNO(rxseq), FRAGNO(ni->ni_rxseqs[tid]), tid);
299753c7e08SAugustin Cavalier 	vap->iv_stats.is_rx_dup++;
300753c7e08SAugustin Cavalier 	IEEE80211_NODE_STAT(ni, rx_dup);
301753c7e08SAugustin Cavalier 
302753c7e08SAugustin Cavalier 	return 0;
303753c7e08SAugustin Cavalier #undef	SEQ_LEQ
304753c7e08SAugustin Cavalier #undef	SEQ_EQ
305753c7e08SAugustin Cavalier #undef	SEQNO
306753c7e08SAugustin Cavalier #undef	FRAGNO
307753c7e08SAugustin Cavalier }
308753c7e08SAugustin Cavalier 
309753c7e08SAugustin Cavalier void	ieee80211_deliver_data(struct ieee80211vap *,
310753c7e08SAugustin Cavalier 		struct ieee80211_node *, struct mbuf *);
311753c7e08SAugustin Cavalier struct mbuf *ieee80211_defrag(struct ieee80211_node *,
312753c7e08SAugustin Cavalier 		struct mbuf *, int);
313753c7e08SAugustin Cavalier struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t);
314753c7e08SAugustin Cavalier struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int);
315753c7e08SAugustin Cavalier struct mbuf *ieee80211_decap1(struct mbuf *, int *);
316753c7e08SAugustin Cavalier int	ieee80211_setup_rates(struct ieee80211_node *ni,
317753c7e08SAugustin Cavalier 		const uint8_t *rates, const uint8_t *xrates, int flags);
318753c7e08SAugustin Cavalier void ieee80211_send_error(struct ieee80211_node *,
319753c7e08SAugustin Cavalier 		const uint8_t mac[IEEE80211_ADDR_LEN], int subtype, int arg);
320753c7e08SAugustin Cavalier int	ieee80211_alloc_challenge(struct ieee80211_node *);
321753c7e08SAugustin Cavalier int	ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
322753c7e08SAugustin Cavalier 		struct ieee80211_channel *,
323753c7e08SAugustin Cavalier 		struct ieee80211_scanparams *);
324753c7e08SAugustin Cavalier int	ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);
325753c7e08SAugustin Cavalier #endif /* _NET80211_IEEE80211_INPUT_H_ */
326