xref: /haiku/src/libs/compat/freebsd_wlan/net80211/ieee80211_input.h (revision 8244a9baad63102214028afbb3b1e2326f4c4cca)
1753c7e08SAugustin Cavalier /*-
2*8244a9baSAugustin Cavalier  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*8244a9baSAugustin 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  *
27*8244a9baSAugustin 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 
136*8244a9baSAugustin Cavalier static __inline int
137*8244a9baSAugustin Cavalier ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs)
138*8244a9baSAugustin Cavalier {
139*8244a9baSAugustin Cavalier 
140*8244a9baSAugustin Cavalier 	return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU));
141*8244a9baSAugustin Cavalier }
142*8244a9baSAugustin Cavalier 
143*8244a9baSAugustin Cavalier /*
144*8244a9baSAugustin Cavalier  * Return 1 if the rxseq check should increment the sequence
145*8244a9baSAugustin Cavalier  * number. Return 0 if it's part of an AMSDU batch and it isn't
146*8244a9baSAugustin Cavalier  * the final frame in the decap'ed burst.
147*8244a9baSAugustin Cavalier  */
148*8244a9baSAugustin Cavalier static __inline int
149*8244a9baSAugustin Cavalier ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs)
150*8244a9baSAugustin Cavalier {
151*8244a9baSAugustin Cavalier 	/* No state? ok */
152*8244a9baSAugustin Cavalier 	if (rxs == NULL)
153*8244a9baSAugustin Cavalier 		return (1);
154*8244a9baSAugustin Cavalier 
155*8244a9baSAugustin Cavalier 	/* State but no AMSDU set? ok */
156*8244a9baSAugustin Cavalier 	if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0)
157*8244a9baSAugustin Cavalier 		return (1);
158*8244a9baSAugustin Cavalier 
159*8244a9baSAugustin Cavalier 	/* State, AMSDU set, then _MORE means "don't inc yet" */
160*8244a9baSAugustin Cavalier 	if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) {
161*8244a9baSAugustin Cavalier 		return (0);
162*8244a9baSAugustin Cavalier 	}
163*8244a9baSAugustin Cavalier 
164*8244a9baSAugustin Cavalier 	/* Both are set, so return ok */
165*8244a9baSAugustin Cavalier 	return (1);
166*8244a9baSAugustin Cavalier }
167*8244a9baSAugustin Cavalier 
168753c7e08SAugustin Cavalier /*
169753c7e08SAugustin Cavalier  * Check the current frame sequence number against the current TID
170753c7e08SAugustin Cavalier  * state and return whether it's in sequence or should be dropped.
171753c7e08SAugustin Cavalier  *
172753c7e08SAugustin Cavalier  * Since out of order packet and duplicate packet eliminations should
173753c7e08SAugustin Cavalier  * be done by the AMPDU RX code, this routine blindly accepts all
174753c7e08SAugustin Cavalier  * frames from a HT station w/ a TID that is currently doing AMPDU-RX.
175753c7e08SAugustin Cavalier  * HT stations without WME or where the TID is not doing AMPDU-RX
176753c7e08SAugustin Cavalier  * are checked like non-HT stations.
177753c7e08SAugustin Cavalier  *
178753c7e08SAugustin Cavalier  * The routine only eliminates packets whose sequence/fragment
179753c7e08SAugustin Cavalier  * match or are less than the last seen sequence/fragment number
180753c7e08SAugustin Cavalier  * AND are retransmits It doesn't try to eliminate out of order packets.
181753c7e08SAugustin Cavalier  *
182753c7e08SAugustin Cavalier  * Since all frames after sequence number 4095 will be less than 4095
183753c7e08SAugustin Cavalier  * (as the seqnum wraps), handle that special case so packets aren't
184753c7e08SAugustin Cavalier  * incorrectly dropped - ie, if the next packet is sequence number 0
185753c7e08SAugustin Cavalier  * but a retransmit since the initial packet didn't make it.
186*8244a9baSAugustin Cavalier  *
187*8244a9baSAugustin Cavalier  * XXX TODO: handle sequence number space wrapping with dropped frames;
188*8244a9baSAugustin Cavalier  * especially in high interference conditions under high traffic load
189*8244a9baSAugustin Cavalier  * The RX AMPDU reorder code also needs it.
190*8244a9baSAugustin Cavalier  *
191*8244a9baSAugustin Cavalier  * XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery.
192753c7e08SAugustin Cavalier  */
193753c7e08SAugustin Cavalier static __inline int
194753c7e08SAugustin Cavalier ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh,
195*8244a9baSAugustin Cavalier     uint8_t *bssid, const struct ieee80211_rx_stats *rxs)
196753c7e08SAugustin Cavalier {
197753c7e08SAugustin Cavalier #define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)
198753c7e08SAugustin Cavalier #define	SEQ_EQ(a,b)	((int)((a)-(b)) == 0)
199753c7e08SAugustin Cavalier #define	SEQNO(a)	((a) >> IEEE80211_SEQ_SEQ_SHIFT)
200753c7e08SAugustin Cavalier #define	FRAGNO(a)	((a) & IEEE80211_SEQ_FRAG_MASK)
201753c7e08SAugustin Cavalier 	struct ieee80211vap *vap = ni->ni_vap;
202753c7e08SAugustin Cavalier 	uint16_t rxseq;
203753c7e08SAugustin Cavalier 	uint8_t type, subtype;
204753c7e08SAugustin Cavalier 	uint8_t tid;
205753c7e08SAugustin Cavalier 	struct ieee80211_rx_ampdu *rap;
206753c7e08SAugustin Cavalier 
207753c7e08SAugustin Cavalier 	rxseq = le16toh(*(uint16_t *)wh->i_seq);
208753c7e08SAugustin Cavalier 	type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
209753c7e08SAugustin Cavalier 	subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
210753c7e08SAugustin Cavalier 
211753c7e08SAugustin Cavalier 	/*
212753c7e08SAugustin Cavalier 	 * Types with no sequence number (or QoS (+)Null frames)
213753c7e08SAugustin Cavalier 	 * are always treated valid.
214753c7e08SAugustin Cavalier 	 */
215753c7e08SAugustin Cavalier 	if (! IEEE80211_HAS_SEQ(type, subtype))
216753c7e08SAugustin Cavalier 		return 1;
217753c7e08SAugustin Cavalier 
218*8244a9baSAugustin Cavalier 	/*
219*8244a9baSAugustin Cavalier 	 * Always allow multicast frames for now - QoS (any TID)
220*8244a9baSAugustin Cavalier 	 * or not.
221*8244a9baSAugustin Cavalier 	 */
222*8244a9baSAugustin Cavalier 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
223*8244a9baSAugustin Cavalier 		return 1;
224*8244a9baSAugustin Cavalier 
225753c7e08SAugustin Cavalier 	tid = ieee80211_gettid(wh);
226753c7e08SAugustin Cavalier 
227753c7e08SAugustin Cavalier 	/*
228753c7e08SAugustin Cavalier 	 * Only do the HT AMPDU check for WME stations; non-WME HT stations
229753c7e08SAugustin Cavalier 	 * shouldn't exist outside of debugging. We should at least
230753c7e08SAugustin Cavalier 	 * handle that.
231753c7e08SAugustin Cavalier 	 */
232753c7e08SAugustin Cavalier 	if (tid < WME_NUM_TID) {
233753c7e08SAugustin Cavalier 		rap = &ni->ni_rx_ampdu[tid];
234753c7e08SAugustin Cavalier 		/* HT nodes currently doing RX AMPDU are always valid */
235753c7e08SAugustin Cavalier 		if ((ni->ni_flags & IEEE80211_NODE_HT) &&
236753c7e08SAugustin Cavalier 		    (rap->rxa_flags & IEEE80211_AGGR_RUNNING))
237753c7e08SAugustin Cavalier 			goto ok;
238753c7e08SAugustin Cavalier 	}
239753c7e08SAugustin Cavalier 
240753c7e08SAugustin Cavalier 	/*
241753c7e08SAugustin Cavalier 	 * Otherwise, retries for packets below or equal to the last
242753c7e08SAugustin Cavalier 	 * seen sequence number should be dropped.
243753c7e08SAugustin Cavalier 	 */
244753c7e08SAugustin Cavalier 
245753c7e08SAugustin Cavalier 	/*
246753c7e08SAugustin Cavalier 	 * Treat frame seqnum 4095 as special due to boundary
247753c7e08SAugustin Cavalier 	 * wrapping conditions.
248753c7e08SAugustin Cavalier 	 */
249753c7e08SAugustin Cavalier 	if (SEQNO(ni->ni_rxseqs[tid]) == 4095) {
250753c7e08SAugustin Cavalier 		/*
251753c7e08SAugustin Cavalier 		 * Drop retransmits on seqnum 4095/current fragment for itself.
252753c7e08SAugustin Cavalier 		 */
253753c7e08SAugustin Cavalier 		if (SEQ_EQ(rxseq, ni->ni_rxseqs[tid]) &&
254753c7e08SAugustin Cavalier 		    (wh->i_fc[1] & IEEE80211_FC1_RETRY))
255753c7e08SAugustin Cavalier 			goto fail;
256753c7e08SAugustin Cavalier 		/*
257753c7e08SAugustin Cavalier 		 * Treat any subsequent frame as fine if the last seen frame
258753c7e08SAugustin Cavalier 		 * is 4095 and it's not a retransmit for the same sequence
259753c7e08SAugustin Cavalier 		 * number. However, this doesn't capture incorrectly ordered
260753c7e08SAugustin Cavalier 	 	 * fragments w/ sequence number 4095. It shouldn't be seen
261753c7e08SAugustin Cavalier 		 * in practice, but see the comment above for further info.
262753c7e08SAugustin Cavalier 		 */
263753c7e08SAugustin Cavalier 		goto ok;
264753c7e08SAugustin Cavalier 	}
265753c7e08SAugustin Cavalier 
266753c7e08SAugustin Cavalier 	/*
267753c7e08SAugustin Cavalier 	 * At this point we assume that retransmitted seq/frag numbers below
268753c7e08SAugustin Cavalier 	 * the current can simply be eliminated.
269753c7e08SAugustin Cavalier 	 */
270753c7e08SAugustin Cavalier 	if ((wh->i_fc[1] & IEEE80211_FC1_RETRY) &&
271753c7e08SAugustin Cavalier 	    SEQ_LEQ(rxseq, ni->ni_rxseqs[tid]))
272753c7e08SAugustin Cavalier 		goto fail;
273753c7e08SAugustin Cavalier 
274753c7e08SAugustin Cavalier ok:
275*8244a9baSAugustin Cavalier 	/*
276*8244a9baSAugustin Cavalier 	 * Only bump the sequence number if it's the last frame
277*8244a9baSAugustin Cavalier 	 * in a batch.  That way frames in the rest of the batch
278*8244a9baSAugustin Cavalier 	 * get included, and the last frame in the batch kicks
279*8244a9baSAugustin Cavalier 	 * it next.
280*8244a9baSAugustin Cavalier 	 */
281*8244a9baSAugustin Cavalier 	if (ieee80211_check_rxseq_amsdu_more(rxs)) {
282753c7e08SAugustin Cavalier 		ni->ni_rxseqs[tid] = rxseq;
283*8244a9baSAugustin Cavalier 		if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
284*8244a9baSAugustin Cavalier 			IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
285*8244a9baSAugustin Cavalier 	} else {
286*8244a9baSAugustin Cavalier 		/* .. still waiting */
287*8244a9baSAugustin Cavalier 		IEEE80211_NODE_STAT(ni, rx_amsdu_more);
288*8244a9baSAugustin Cavalier 	}
289753c7e08SAugustin Cavalier 
290753c7e08SAugustin Cavalier 	return 1;
291753c7e08SAugustin Cavalier 
292753c7e08SAugustin Cavalier fail:
293753c7e08SAugustin Cavalier 	/* duplicate, discard */
294753c7e08SAugustin Cavalier 	IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, bssid, "duplicate",
295753c7e08SAugustin Cavalier 	    "seqno <%u,%u> fragno <%u,%u> tid %u",
296753c7e08SAugustin Cavalier 	     SEQNO(rxseq),  SEQNO(ni->ni_rxseqs[tid]),
297753c7e08SAugustin Cavalier 	    FRAGNO(rxseq), FRAGNO(ni->ni_rxseqs[tid]), tid);
298753c7e08SAugustin Cavalier 	vap->iv_stats.is_rx_dup++;
299753c7e08SAugustin Cavalier 	IEEE80211_NODE_STAT(ni, rx_dup);
300753c7e08SAugustin Cavalier 
301753c7e08SAugustin Cavalier 	return 0;
302753c7e08SAugustin Cavalier #undef	SEQ_LEQ
303753c7e08SAugustin Cavalier #undef	SEQ_EQ
304753c7e08SAugustin Cavalier #undef	SEQNO
305753c7e08SAugustin Cavalier #undef	FRAGNO
306753c7e08SAugustin Cavalier }
307753c7e08SAugustin Cavalier 
308753c7e08SAugustin Cavalier void	ieee80211_deliver_data(struct ieee80211vap *,
309753c7e08SAugustin Cavalier 		struct ieee80211_node *, struct mbuf *);
310753c7e08SAugustin Cavalier struct mbuf *ieee80211_defrag(struct ieee80211_node *,
311753c7e08SAugustin Cavalier 		struct mbuf *, int);
312753c7e08SAugustin Cavalier struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t);
313753c7e08SAugustin Cavalier struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int);
314753c7e08SAugustin Cavalier struct mbuf *ieee80211_decap1(struct mbuf *, int *);
315753c7e08SAugustin Cavalier int	ieee80211_setup_rates(struct ieee80211_node *ni,
316753c7e08SAugustin Cavalier 		const uint8_t *rates, const uint8_t *xrates, int flags);
317753c7e08SAugustin Cavalier void ieee80211_send_error(struct ieee80211_node *,
318753c7e08SAugustin Cavalier 		const uint8_t mac[IEEE80211_ADDR_LEN], int subtype, int arg);
319753c7e08SAugustin Cavalier int	ieee80211_alloc_challenge(struct ieee80211_node *);
320753c7e08SAugustin Cavalier int	ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
321753c7e08SAugustin Cavalier 		struct ieee80211_channel *,
322753c7e08SAugustin Cavalier 		struct ieee80211_scanparams *);
323753c7e08SAugustin Cavalier int	ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);
324753c7e08SAugustin Cavalier #endif /* _NET80211_IEEE80211_INPUT_H_ */
325