ieee80211_node.h revision 178354
1228753Smm/*-
2228753Smm * Copyright (c) 2001 Atsushi Onoe
3228753Smm * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
4228753Smm * All rights reserved.
5228753Smm *
6228753Smm * Redistribution and use in source and binary forms, with or without
7228753Smm * modification, are permitted provided that the following conditions
8228753Smm * are met:
9228753Smm * 1. Redistributions of source code must retain the above copyright
10228753Smm *    notice, this list of conditions and the following disclaimer.
11228753Smm * 2. Redistributions in binary form must reproduce the above copyright
12228753Smm *    notice, this list of conditions and the following disclaimer in the
13228753Smm *    documentation and/or other materials provided with the distribution.
14228753Smm *
15228753Smm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16228753Smm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17228753Smm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18228753Smm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19228753Smm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20228753Smm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21228753Smm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22228753Smm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23228753Smm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24228753Smm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25228753Smm *
26228753Smm * $FreeBSD: head/sys/net80211/ieee80211_node.h 178354 2008-04-20 20:35:46Z sam $
27229592Smm */
28228753Smm#ifndef _NET80211_IEEE80211_NODE_H_
29228753Smm#define _NET80211_IEEE80211_NODE_H_
30228753Smm
31228753Smm#include <net80211/ieee80211_ioctl.h>		/* for ieee80211_nodestats */
32228753Smm#include <net80211/ieee80211_ht.h>		/* for aggregation state */
33228753Smm
34228753Smm/*
35228753Smm * Each ieee80211com instance has a single timer that fires every
36228753Smm * IEEE80211_INACT_WAIT seconds to handle "inactivity processing".
37228753Smm * This is used to do node inactivity processing when operating
38228753Smm * as an AP or in adhoc mode.  For inactivity processing each node
39228753Smm * has a timeout set in it's ni_inact field that is decremented
40228753Smm * on each timeout and the node is reclaimed when the counter goes
41228753Smm * to zero.  We use different inactivity timeout values depending
42228753Smm * on whether the node is associated and authorized (either by
43228753Smm * 802.1x or open/shared key authentication) or associated but yet
44228753Smm * to be authorized.  The latter timeout is shorter to more aggressively
45228753Smm * reclaim nodes that leave part way through the 802.1x exchange.
46228753Smm */
47228753Smm#define	IEEE80211_INACT_WAIT	15		/* inactivity interval (secs) */
48228753Smm#define	IEEE80211_INACT_INIT	(30/IEEE80211_INACT_WAIT)	/* initial */
49228753Smm#define	IEEE80211_INACT_AUTH	(180/IEEE80211_INACT_WAIT)	/* associated but not authorized */
50228753Smm#define	IEEE80211_INACT_RUN	(300/IEEE80211_INACT_WAIT)	/* authorized */
51228753Smm#define	IEEE80211_INACT_PROBE	(30/IEEE80211_INACT_WAIT)	/* probe */
52228753Smm#define	IEEE80211_INACT_SCAN	(300/IEEE80211_INACT_WAIT)	/* scanned */
53228753Smm
54228753Smm#define	IEEE80211_TRANS_WAIT 	2		/* mgt frame tx timer (secs) */
55228753Smm
56228753Smm/* threshold for aging overlapping non-ERP bss */
57228753Smm#define	IEEE80211_NONERP_PRESENT_AGE	msecs_to_ticks(60*1000)
58228753Smm
59228753Smm#define	IEEE80211_NODE_HASHSIZE	32
60228753Smm/* simple hash is enough for variation of macaddr */
61228753Smm#define	IEEE80211_NODE_HASH(addr)	\
62228753Smm	(((const uint8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % \
63228753Smm		IEEE80211_NODE_HASHSIZE)
64228753Smm
65228753Smmstruct ieee80211_node_table;
66228753Smmstruct ieee80211com;
67228753Smmstruct ieee80211vap;
68228753Smm
69228753Smm/*
70228753Smm * Information element ``blob''.  We use this structure
71228753Smm * to capture management frame payloads that need to be
72228753Smm * retained.  Information elemnts within the payload that
73228753Smm * we need to consult have references recorded.
74228753Smm */
75228753Smmstruct ieee80211_ies {
76228753Smm	/* the following are either NULL or point within data */
77228753Smm	uint8_t	*wpa_ie;	/* captured WPA ie */
78228753Smm	uint8_t	*rsn_ie;	/* captured RSN ie */
79228753Smm	uint8_t	*wme_ie;	/* captured WME ie */
80228753Smm	uint8_t	*ath_ie;	/* captured Atheros ie */
81228753Smm	uint8_t	*htcap_ie;	/* captured HTCAP ie */
82228753Smm	uint8_t	*htinfo_ie;	/* captured HTINFO ie */
83228753Smm	/* NB: these must be the last members of this structure */
84228753Smm	uint8_t	*data;		/* frame data > 802.11 header */
85228753Smm	int	len;		/* data size in bytes */
86228753Smm};
87228753Smm
88228753Smm/*
89228753Smm * Node specific information.  Note that drivers are expected
90228753Smm * to derive from this structure to add device-specific per-node
91228753Smm * state.  This is done by overriding the ic_node_* methods in
92228753Smm * the ieee80211com structure.
93228753Smm */
94228753Smmstruct ieee80211_node {
95228753Smm	struct ieee80211vap	*ni_vap;	/* associated vap */
96228753Smm	struct ieee80211com	*ni_ic;		/* copy from vap to save deref*/
97228753Smm	struct ieee80211_node_table *ni_table;	/* NB: may be NULL */
98228753Smm	TAILQ_ENTRY(ieee80211_node) ni_list;	/* list of all nodes */
99228753Smm	LIST_ENTRY(ieee80211_node) ni_hash;	/* hash collision list */
100228753Smm	u_int			ni_refcnt;	/* count of held references */
101228753Smm	u_int			ni_scangen;	/* gen# for timeout scan */
102228753Smm	uint8_t			ni_authmode;	/* authentication algorithm */
103228753Smm	uint8_t			ni_ath_flags;	/* Atheros feature flags */
104228753Smm	/* NB: These must have the same values as IEEE80211_ATHC_* */
105228753Smm#define IEEE80211_NODE_TURBOP	0x0001		/* Turbo prime enable */
106229592Smm#define IEEE80211_NODE_COMP	0x0002		/* Compresssion enable */
107228753Smm#define IEEE80211_NODE_FF	0x0004          /* Fast Frame capable */
108228753Smm#define IEEE80211_NODE_XR	0x0008		/* Atheros WME enable */
109228753Smm#define IEEE80211_NODE_AR	0x0010		/* AR capable */
110228753Smm#define IEEE80211_NODE_BOOST	0x0080
111228753Smm#define IEEE80211_NODE_PSUPDATE	0x0200		/* power save state changed */
112228753Smm#define	IEEE80211_NODE_CHWUPDATE 0x0400		/* 11n channel width change */
113228753Smm	uint16_t		ni_flags;	/* special-purpose state */
114228753Smm#define	IEEE80211_NODE_AUTH	0x0001		/* authorized for data */
115228753Smm#define	IEEE80211_NODE_QOS	0x0002		/* QoS enabled */
116229592Smm#define	IEEE80211_NODE_ERP	0x0004		/* ERP enabled */
117229592Smm/* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */
118229592Smm#define	IEEE80211_NODE_PWR_MGT	0x0010		/* power save mode enabled */
119229592Smm#define	IEEE80211_NODE_AREF	0x0020		/* authentication ref held */
120228753Smm#define	IEEE80211_NODE_HT	0x0040		/* HT enabled */
121228753Smm#define	IEEE80211_NODE_HTCOMPAT	0x0080		/* HT setup w/ vendor OUI's */
122229592Smm#define	IEEE80211_NODE_WPS	0x0100		/* WPS association */
123228753Smm#define	IEEE80211_NODE_TSN	0x0200		/* TSN association */
124228753Smm#define	IEEE80211_NODE_AMPDU_RX	0x0400		/* AMPDU rx enabled */
125228753Smm#define	IEEE80211_NODE_AMPDU_TX	0x0800		/* AMPDU tx enabled */
126228753Smm	uint16_t		ni_ath_defkeyix;/* Atheros def key index */
127228753Smm	uint16_t		ni_associd;	/* assoc response */
128228753Smm	uint16_t		ni_txpower;	/* current transmit power */
129228753Smm	uint16_t		ni_vlan;	/* vlan tag */
130228753Smm	uint32_t		ni_jointime;	/* time of join (secs) */
131228753Smm	uint32_t		*ni_challenge;	/* shared-key challenge */
132228753Smm	struct ieee80211_ies	ni_ies;		/* captured ie's */
133228753Smm						/* tx seq per-tid */
134228753Smm	uint16_t		ni_txseqs[IEEE80211_TID_SIZE];
135228753Smm						/* rx seq previous per-tid*/
136228753Smm	uint16_t		ni_rxseqs[IEEE80211_TID_SIZE];
137228753Smm	uint32_t		ni_rxfragstamp;	/* time stamp of last rx frag */
138228753Smm	struct mbuf		*ni_rxfrag[3];	/* rx frag reassembly */
139228753Smm	struct ieee80211_key	ni_ucastkey;	/* unicast key */
140228753Smm
141228753Smm	/* hardware */
142228753Smm	uint32_t		ni_rstamp;	/* recv timestamp */
143228753Smm	uint32_t		ni_avgrssi;	/* recv ssi state */
144228753Smm	int8_t			ni_noise;	/* noise floor */
145228753Smm
146228753Smm	/* header */
147228753Smm	uint8_t			ni_macaddr[IEEE80211_ADDR_LEN];
148228753Smm	uint8_t			ni_bssid[IEEE80211_ADDR_LEN];
149228753Smm
150228753Smm	/* beacon, probe response */
151228753Smm	union {
152228753Smm		uint8_t		data[8];
153228753Smm		u_int64_t	tsf;
154228753Smm	} ni_tstamp;				/* from last rcv'd beacon */
155228753Smm	uint16_t		ni_intval;	/* beacon interval */
156228753Smm	uint16_t		ni_capinfo;	/* capabilities */
157228753Smm	uint8_t			ni_esslen;
158228753Smm	uint8_t			ni_essid[IEEE80211_NWID_LEN];
159228753Smm	struct ieee80211_rateset ni_rates;	/* negotiated rate set */
160228753Smm	struct ieee80211_channel *ni_chan;
161228753Smm	uint16_t		ni_fhdwell;	/* FH only */
162228753Smm	uint8_t			ni_fhindex;	/* FH only */
163228753Smm	uint16_t		ni_erp;		/* ERP from beacon/probe resp */
164228753Smm	uint16_t		ni_timoff;	/* byte offset to TIM ie */
165228753Smm	uint8_t			ni_dtim_period;	/* DTIM period */
166228753Smm	uint8_t			ni_dtim_count;	/* DTIM count for last bcn */
167228753Smm
168228753Smm	/* 11n state */
169228753Smm	uint16_t		ni_htcap;	/* HT capabilities */
170228753Smm	uint8_t			ni_htparam;	/* HT params */
171228753Smm	uint8_t			ni_htctlchan;	/* HT control channel */
172228753Smm	uint8_t			ni_ht2ndchan;	/* HT 2nd channel */
173228753Smm	uint8_t			ni_htopmode;	/* HT operating mode */
174228753Smm	uint8_t			ni_htstbc;	/* HT */
175228753Smm	uint8_t			ni_reqcw;	/* requested tx channel width */
176228753Smm	uint8_t			ni_chw;		/* negotiated channel width */
177228753Smm	struct ieee80211_htrateset ni_htrates;	/* negotiated ht rate set */
178228753Smm	struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_AC];
179228753Smm	struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID];
180228753Smm
181228753Smm	/* others */
182228753Smm	short			ni_inact;	/* inactivity mark count */
183228753Smm	short			ni_inact_reload;/* inactivity reload value */
184228753Smm	int			ni_txrate;	/* legacy rate/MCS */
185228753Smm	struct ifqueue		ni_savedq;	/* ps-poll queue */
186228753Smm	struct ieee80211_nodestats ni_stats;	/* per-node statistics */
187228753Smm
188228753Smm	struct ieee80211vap	*ni_wdsvap;	/* associated WDS vap */
189228753Smm	/* XXX move to vap? */
190228753Smm	struct ifqueue		ni_wdsq;	/* wds pending queue */
191228753Smm};
192228753SmmMALLOC_DECLARE(M_80211_NODE);
193228753SmmMALLOC_DECLARE(M_80211_NODE_IE);
194228753Smm
195228753Smm#define	IEEE80211_NODE_ATH	(IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP)
196228753Smm#define	IEEE80211_NODE_AMPDU \
197228753Smm	(IEEE80211_NODE_AMPDU_RX | IEEE80211_NODE_AMPDU_TX)
198228753Smm
199228753Smm#define	IEEE80211_NODE_AID(ni)	IEEE80211_AID(ni->ni_associd)
200228753Smm
201228753Smm#define	IEEE80211_NODE_STAT(ni,stat)	(ni->ni_stats.ns_##stat++)
202228753Smm#define	IEEE80211_NODE_STAT_ADD(ni,stat,v)	(ni->ni_stats.ns_##stat += v)
203228753Smm#define	IEEE80211_NODE_STAT_SET(ni,stat,v)	(ni->ni_stats.ns_##stat = v)
204228753Smm
205228753Smm/*
206228753Smm * Filtered rssi calculation support.  The receive rssi is maintained
207228753Smm * as an average over the last 10 frames received using a low pass filter
208228753Smm * (all frames for now, possibly need to be more selective).  Calculations
209228753Smm * are designed such that a good compiler can optimize them.  The avg
210228753Smm * rssi state should be initialized to IEEE80211_RSSI_DUMMY_MARKER and
211228753Smm * each sample incorporated with IEEE80211_RSSI_LPF.  Use IEEE80211_RSSI_GET
212228753Smm * to extract the current value.
213228753Smm *
214228753Smm * Note that we assume rssi data are in the range [-127..127] and we
215228753Smm * discard values <-20.  This is consistent with assumptions throughout
216228753Smm * net80211 that signal strength data are in .5 dBm units relative to
217228753Smm * the current noise floor (linear, not log).
218228753Smm */
219228753Smm#define IEEE80211_RSSI_LPF_LEN		10
220228753Smm#define	IEEE80211_RSSI_DUMMY_MARKER	127
221228753Smm/* NB: pow2 to optimize out * and / */
222229592Smm#define	IEEE80211_RSSI_EP_MULTIPLIER	(1<<7)
223228753Smm#define IEEE80211_RSSI_IN(x)		((x) * IEEE80211_RSSI_EP_MULTIPLIER)
224228753Smm#define _IEEE80211_RSSI_LPF(x, y, len) \
225228753Smm    (((x) != IEEE80211_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
226228753Smm#define IEEE80211_RSSI_LPF(x, y) do {					\
227228753Smm    if ((y) >= -20) {							\
228228753Smm    	x = _IEEE80211_RSSI_LPF((x), IEEE80211_RSSI_IN((y)), 		\
229228753Smm		IEEE80211_RSSI_LPF_LEN);				\
230228753Smm    }									\
231228753Smm} while (0)
232228753Smm#define	IEEE80211_RSSI_EP_RND(x, mul) \
233228753Smm	((((x) % (mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
234228753Smm#define	IEEE80211_RSSI_GET(x) \
235228753Smm	IEEE80211_RSSI_EP_RND(x, IEEE80211_RSSI_EP_MULTIPLIER)
236228753Smm
237228753Smmstatic __inline struct ieee80211_node *
238228753Smmieee80211_ref_node(struct ieee80211_node *ni)
239228753Smm{
240228753Smm	ieee80211_node_incref(ni);
241228753Smm	return ni;
242228753Smm}
243228753Smm
244228753Smmstatic __inline void
245228753Smmieee80211_unref_node(struct ieee80211_node **ni)
246228753Smm{
247228753Smm	ieee80211_node_decref(*ni);
248228753Smm	*ni = NULL;			/* guard against use */
249228753Smm}
250228753Smm
251228753Smmstruct ieee80211com;
252228753Smm
253228753Smmvoid	ieee80211_node_attach(struct ieee80211com *);
254228753Smmvoid	ieee80211_node_lateattach(struct ieee80211com *);
255228753Smmvoid	ieee80211_node_detach(struct ieee80211com *);
256228753Smmvoid	ieee80211_node_vattach(struct ieee80211vap *);
257228753Smmvoid	ieee80211_node_latevattach(struct ieee80211vap *);
258228753Smmvoid	ieee80211_node_vdetach(struct ieee80211vap *);
259228753Smm
260228753Smmstatic __inline int
261228753Smmieee80211_node_is_authorized(const struct ieee80211_node *ni)
262228753Smm{
263228753Smm	return (ni->ni_flags & IEEE80211_NODE_AUTH);
264228753Smm}
265228753Smm
266228753Smmvoid	ieee80211_node_authorize(struct ieee80211_node *);
267228753Smmvoid	ieee80211_node_unauthorize(struct ieee80211_node *);
268228753Smm
269228753Smmvoid	ieee80211_node_set_chan(struct ieee80211_node *,
270228753Smm		struct ieee80211_channel *);
271228753Smmvoid	ieee80211_create_ibss(struct ieee80211vap*, struct ieee80211_channel *);
272228753Smmvoid	ieee80211_reset_bss(struct ieee80211vap *);
273228753Smmvoid	ieee80211_sync_curchan(struct ieee80211com *);
274228753Smmvoid	ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *);
275228753Smmint	ieee80211_ibss_merge(struct ieee80211_node *);
276228753Smmstruct ieee80211_scan_entry;
277228753Smmint	ieee80211_sta_join(struct ieee80211vap *,
278228753Smm		const struct ieee80211_scan_entry *);
279228753Smmvoid	ieee80211_sta_leave(struct ieee80211_node *);
280228753Smmvoid	ieee80211_node_deauth(struct ieee80211_node *, int);
281228753Smm
282228753Smmint	ieee80211_ies_init(struct ieee80211_ies *, const uint8_t *, int);
283228753Smmvoid	ieee80211_ies_cleanup(struct ieee80211_ies *);
284228753Smmvoid	ieee80211_ies_expand(struct ieee80211_ies *);
285228753Smm#define	ieee80211_ies_setie(_ies, _ie, _off) do {		\
286228753Smm	(_ies)._ie = (_ies).data + (_off);			\
287228753Smm} while (0)
288228753Smm
289228753Smm/*
290228753Smm * Table of ieee80211_node instances.  Each ieee80211com
291228753Smm * has one that holds association stations (when operating
292228753Smm * as an ap) or neighbors (in ibss mode).
293228753Smm *
294228753Smm * XXX embed this in ieee80211com instead of indirect?
295228753Smm */
296228753Smmstruct ieee80211_node_table {
297228753Smm	struct ieee80211com	*nt_ic;		/* back reference */
298228753Smm	ieee80211_node_lock_t	nt_nodelock;	/* on node table */
299228753Smm	TAILQ_HEAD(, ieee80211_node) nt_node;	/* information of all nodes */
300228753Smm	LIST_HEAD(, ieee80211_node) nt_hash[IEEE80211_NODE_HASHSIZE];
301228753Smm	struct ieee80211_node	**nt_keyixmap;	/* key ix -> node map */
302228753Smm	int			nt_keyixmax;	/* keyixmap size */
303228753Smm	const char		*nt_name;	/* table name for debug msgs */
304228753Smm	ieee80211_scan_lock_t	nt_scanlock;	/* on nt_scangen */
305228753Smm	u_int			nt_scangen;	/* gen# for iterators */
306228753Smm	int			nt_inact_init;	/* initial node inact setting */
307228753Smm};
308228753Smm
309228753Smmstruct ieee80211_node *ieee80211_alloc_node(struct ieee80211_node_table *,
310228753Smm		struct ieee80211vap *,
311228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
312228753Smmstruct ieee80211_node *ieee80211_tmp_node(struct ieee80211vap *,
313228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
314228753Smmstruct ieee80211_node *ieee80211_dup_bss(struct ieee80211vap *,
315228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
316228753Smmstruct ieee80211_node *ieee80211_node_create_wds(struct ieee80211vap *,
317228753Smm		const uint8_t bssid[IEEE80211_ADDR_LEN],
318228753Smm		struct ieee80211_channel *);
319228753Smm#ifdef IEEE80211_DEBUG_REFCNT
320228753Smmvoid	ieee80211_free_node_debug(struct ieee80211_node *,
321228753Smm		const char *func, int line);
322228753Smmstruct ieee80211_node *ieee80211_find_node_locked_debug(
323228753Smm		struct ieee80211_node_table *,
324228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN],
325228753Smm		const char *func, int line);
326228753Smmstruct ieee80211_node *ieee80211_find_node_debug(struct ieee80211_node_table *,
327228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN],
328228753Smm		const char *func, int line);
329228753Smmstruct ieee80211_node *ieee80211_find_vap_node_locked_debug(
330228753Smm		struct ieee80211_node_table *,
331228753Smm		const struct ieee80211vap *vap,
332228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN],
333228753Smm		const char *func, int line);
334228753Smmstruct ieee80211_node *ieee80211_find_vap_node_debug(
335228753Smm		struct ieee80211_node_table *,
336228753Smm		const struct ieee80211vap *vap,
337228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN],
338228753Smm		const char *func, int line);
339228753Smmstruct ieee80211_node * ieee80211_find_rxnode_debug(struct ieee80211com *,
340228753Smm		const struct ieee80211_frame_min *,
341228753Smm		const char *func, int line);
342228753Smmstruct ieee80211_node * ieee80211_find_rxnode_withkey_debug(
343228753Smm		struct ieee80211com *,
344228753Smm		const struct ieee80211_frame_min *, uint16_t keyix,
345228753Smm		const char *func, int line);
346228753Smmstruct ieee80211_node *ieee80211_find_txnode_debug(struct ieee80211vap *,
347228753Smm		const uint8_t *,
348228753Smm		const char *func, int line);
349228753Smm#define	ieee80211_free_node(ni) \
350228753Smm	ieee80211_free_node_debug(ni, __func__, __LINE__)
351228753Smm#define	ieee80211_find_node_locked(nt, mac) \
352228753Smm	ieee80211_find_node_locked_debug(nt, mac, __func__, __LINE__)
353228753Smm#define	ieee80211_find_node(nt, mac) \
354228753Smm	ieee80211_find_node_debug(nt, mac, __func__, __LINE__)
355228753Smm#define	ieee80211_find_vap_node_locked(nt, vap, mac) \
356228753Smm	ieee80211_find_vap_node_locked_debug(nt, vap, mac, __func__, __LINE__)
357228753Smm#define	ieee80211_find_vap_node(nt, vap, mac) \
358228753Smm	ieee80211_find_vap_node_debug(nt, vap, mac, __func__, __LINE__)
359228753Smm#define	ieee80211_find_rxnode(ic, wh) \
360228753Smm	ieee80211_find_rxnode_debug(ic, wh, __func__, __LINE__)
361228753Smm#define	ieee80211_find_rxnode_withkey(ic, wh, keyix) \
362228753Smm	ieee80211_find_rxnode_withkey_debug(ic, wh, keyix, __func__, __LINE__)
363228753Smm#define	ieee80211_find_txnode(vap, mac) \
364228753Smm	ieee80211_find_txnode_debug(vap, mac, __func__, __LINE__)
365228753Smm#else
366228753Smmvoid	ieee80211_free_node(struct ieee80211_node *);
367228753Smmstruct ieee80211_node *ieee80211_find_node_locked(struct ieee80211_node_table *,
368228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
369228753Smmstruct ieee80211_node *ieee80211_find_node(struct ieee80211_node_table *,
370228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
371228753Smmstruct ieee80211_node *ieee80211_find_vap_node_locked(
372228753Smm		struct ieee80211_node_table *, const struct ieee80211vap *,
373228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
374228753Smmstruct ieee80211_node *ieee80211_find_vap_node(
375228753Smm		struct ieee80211_node_table *, const struct ieee80211vap *,
376228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
377228753Smmstruct ieee80211_node * ieee80211_find_rxnode(struct ieee80211com *,
378228753Smm		const struct ieee80211_frame_min *);
379228753Smmstruct ieee80211_node * ieee80211_find_rxnode_withkey(struct ieee80211com *,
380228753Smm		const struct ieee80211_frame_min *, uint16_t keyix);
381228753Smmstruct ieee80211_node *ieee80211_find_txnode(struct ieee80211vap *,
382228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
383228753Smm#endif
384228753Smmint	ieee80211_node_delucastkey(struct ieee80211_node *);
385228753Smmvoid	ieee80211_node_timeout(void *arg);
386228753Smm
387228753Smmtypedef void ieee80211_iter_func(void *, struct ieee80211_node *);
388228753Smmvoid	ieee80211_iterate_nodes(struct ieee80211_node_table *,
389228753Smm		ieee80211_iter_func *, void *);
390228753Smm
391228753Smmvoid	ieee80211_notify_erp(struct ieee80211com *);
392228753Smmvoid	ieee80211_dump_node(struct ieee80211_node_table *,
393228753Smm		struct ieee80211_node *);
394228753Smmvoid	ieee80211_dump_nodes(struct ieee80211_node_table *);
395228753Smm
396228753Smmstruct ieee80211_node *ieee80211_fakeup_adhoc_node(struct ieee80211vap *,
397228753Smm		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
398228753Smmstruct ieee80211_scanparams;
399228753Smmvoid	ieee80211_init_neighbor(struct ieee80211_node *,
400228753Smm		const struct ieee80211_frame *,
401228753Smm		const struct ieee80211_scanparams *);
402228753Smmstruct ieee80211_node *ieee80211_add_neighbor(struct ieee80211vap *,
403228753Smm		const struct ieee80211_frame *,
404228753Smm		const struct ieee80211_scanparams *);
405228753Smmvoid	ieee80211_node_join(struct ieee80211_node *,int);
406228753Smmvoid	ieee80211_node_leave(struct ieee80211_node *);
407228753Smmint8_t	ieee80211_getrssi(struct ieee80211vap *);
408228753Smmvoid	ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *);
409228753Smm#endif /* _NET80211_IEEE80211_NODE_H_ */
410228753Smm