ieee80211_node.h revision 186904
185587Sobrien/*-
285587Sobrien * Copyright (c) 2001 Atsushi Onoe
385587Sobrien * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
485587Sobrien * All rights reserved.
585587Sobrien *
685587Sobrien * Redistribution and use in source and binary forms, with or without
785587Sobrien * modification, are permitted provided that the following conditions
885587Sobrien * are met:
985587Sobrien * 1. Redistributions of source code must retain the above copyright
1085587Sobrien *    notice, this list of conditions and the following disclaimer.
1185587Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1285587Sobrien *    notice, this list of conditions and the following disclaimer in the
1385587Sobrien *    documentation and/or other materials provided with the distribution.
1485587Sobrien *
1585587Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1685587Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1785587Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1885587Sobrien * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1985587Sobrien * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2085587Sobrien * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2185587Sobrien * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2285587Sobrien * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2385587Sobrien * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2485587Sobrien * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2585587Sobrien *
2685587Sobrien * $FreeBSD: head/sys/net80211/ieee80211_node.h 186904 2009-01-08 17:12:47Z sam $
2785587Sobrien */
2885587Sobrien#ifndef _NET80211_IEEE80211_NODE_H_
2985587Sobrien#define _NET80211_IEEE80211_NODE_H_
3085587Sobrien
3185587Sobrien#include <net80211/ieee80211_ioctl.h>		/* for ieee80211_nodestats */
3285587Sobrien#include <net80211/ieee80211_ht.h>		/* for aggregation state */
3385587Sobrien
3485587Sobrien/*
3585587Sobrien * Each ieee80211com instance has a single timer that fires every
36107806Sobrien * IEEE80211_INACT_WAIT seconds to handle "inactivity processing".
3785587Sobrien * This is used to do node inactivity processing when operating
3885587Sobrien * as an AP or in adhoc mode.  For inactivity processing each node
3985587Sobrien * has a timeout set in it's ni_inact field that is decremented
4085587Sobrien * on each timeout and the node is reclaimed when the counter goes
41107806Sobrien * to zero.  We use different inactivity timeout values depending
42107806Sobrien * on whether the node is associated and authorized (either by
4385587Sobrien * 802.1x or open/shared key authentication) or associated but yet
4485587Sobrien * to be authorized.  The latter timeout is shorter to more aggressively
4585587Sobrien * reclaim nodes that leave part way through the 802.1x exchange.
46224731Sru */
47224731Sru#define	IEEE80211_INACT_WAIT	15		/* inactivity interval (secs) */
48107806Sobrien#define	IEEE80211_INACT_INIT	(30/IEEE80211_INACT_WAIT)	/* initial */
49244988Sdelphij#define	IEEE80211_INACT_AUTH	(180/IEEE80211_INACT_WAIT)	/* associated but not authorized */
5085587Sobrien#define	IEEE80211_INACT_RUN	(300/IEEE80211_INACT_WAIT)	/* authorized */
5185587Sobrien#define	IEEE80211_INACT_PROBE	(30/IEEE80211_INACT_WAIT)	/* probe */
5285587Sobrien#define	IEEE80211_INACT_SCAN	(300/IEEE80211_INACT_WAIT)	/* scanned */
53107806Sobrien
54107806Sobrien#define	IEEE80211_TRANS_WAIT 	2		/* mgt frame tx timer (secs) */
55107806Sobrien
56107806Sobrien/* threshold for aging overlapping non-ERP bss */
57107806Sobrien#define	IEEE80211_NONERP_PRESENT_AGE	msecs_to_ticks(60*1000)
5885587Sobrien
5985587Sobrien#define	IEEE80211_NODE_HASHSIZE	32
6085587Sobrien/* simple hash is enough for variation of macaddr */
6185587Sobrien#define	IEEE80211_NODE_HASH(addr)	\
6285587Sobrien	(((const uint8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % \
6385587Sobrien		IEEE80211_NODE_HASHSIZE)
6485587Sobrien
6585587Sobrienstruct ieee80211_node_table;
6685587Sobrienstruct ieee80211com;
6785587Sobrienstruct ieee80211vap;
6885587Sobrien
6985587Sobrien/*
7085587Sobrien * Information element ``blob''.  We use this structure
7185587Sobrien * to capture management frame payloads that need to be
7285587Sobrien * retained.  Information elemnts within the payload that
7385587Sobrien * we need to consult have references recorded.
7485587Sobrien */
7585587Sobrienstruct ieee80211_ies {
7685587Sobrien	/* the following are either NULL or point within data */
7785587Sobrien	uint8_t	*wpa_ie;	/* captured WPA ie */
7885587Sobrien	uint8_t	*rsn_ie;	/* captured RSN ie */
7985587Sobrien	uint8_t	*wme_ie;	/* captured WME ie */
8085587Sobrien	uint8_t	*ath_ie;	/* captured Atheros ie */
8185587Sobrien	uint8_t	*htcap_ie;	/* captured HTCAP ie */
8285587Sobrien	uint8_t	*htinfo_ie;	/* captured HTINFO ie */
8385587Sobrien	uint8_t	*tdma_ie;	/* captured TDMA ie */
8485587Sobrien	/* NB: these must be the last members of this structure */
8585587Sobrien	uint8_t	*data;		/* frame data > 802.11 header */
8685587Sobrien	int	len;		/* data size in bytes */
8785587Sobrien};
8885587Sobrien
8985587Sobrien/*
90107806Sobrien * Node specific information.  Note that drivers are expected
9185587Sobrien * to derive from this structure to add device-specific per-node
9285587Sobrien * state.  This is done by overriding the ic_node_* methods in
9385587Sobrien * the ieee80211com structure.
9485587Sobrien */
9585587Sobrienstruct ieee80211_node {
9685587Sobrien	struct ieee80211vap	*ni_vap;	/* associated vap */
9785587Sobrien	struct ieee80211com	*ni_ic;		/* copy from vap to save deref*/
9885587Sobrien	struct ieee80211_node_table *ni_table;	/* NB: may be NULL */
9985587Sobrien	TAILQ_ENTRY(ieee80211_node) ni_list;	/* list of all nodes */
10085587Sobrien	LIST_ENTRY(ieee80211_node) ni_hash;	/* hash collision list */
101107806Sobrien	u_int			ni_refcnt;	/* count of held references */
102107806Sobrien	u_int			ni_scangen;	/* gen# for timeout scan */
103107806Sobrien	u_int			ni_flags;
10485587Sobrien#define	IEEE80211_NODE_AUTH	0x000001	/* authorized for data */
105107806Sobrien#define	IEEE80211_NODE_QOS	0x000002	/* QoS enabled */
10685587Sobrien#define	IEEE80211_NODE_ERP	0x000004	/* ERP enabled */
107107806Sobrien/* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */
108107806Sobrien#define	IEEE80211_NODE_PWR_MGT	0x000010	/* power save mode enabled */
10985587Sobrien#define	IEEE80211_NODE_AREF	0x000020	/* authentication ref held */
11085587Sobrien#define	IEEE80211_NODE_HT	0x000040	/* HT enabled */
111107806Sobrien#define	IEEE80211_NODE_HTCOMPAT	0x000080	/* HT setup w/ vendor OUI's */
112107806Sobrien#define	IEEE80211_NODE_WPS	0x000100	/* WPS association */
113107806Sobrien#define	IEEE80211_NODE_TSN	0x000200	/* TSN association */
11485587Sobrien#define	IEEE80211_NODE_AMPDU_RX	0x000400	/* AMPDU rx enabled */
11585587Sobrien#define	IEEE80211_NODE_AMPDU_TX	0x000800	/* AMPDU tx enabled */
11685587Sobrien#define	IEEE80211_NODE_MIMO_PS	0x001000	/* MIMO power save enabled */
11785587Sobrien#define	IEEE80211_NODE_MIMO_RTS	0x002000	/* send RTS in MIMO PS */
11885587Sobrien#define	IEEE80211_NODE_RIFS	0x004000	/* RIFS enabled */
11985587Sobrien#define	IEEE80211_NODE_SGI20	0x008000	/* Short GI in HT20 enabled */
12085587Sobrien#define	IEEE80211_NODE_SGI40	0x010000	/* Short GI in HT40 enabled */
12185587Sobrien#define	IEEE80211_NODE_ASSOCID	0x020000	/* xmit requires associd */
12285587Sobrien	uint16_t		ni_associd;	/* association ID */
12385587Sobrien	uint16_t		ni_vlan;	/* vlan tag */
12485587Sobrien	uint16_t		ni_txpower;	/* current transmit power */
12585587Sobrien	uint8_t			ni_authmode;	/* authentication algorithm */
12685587Sobrien	uint8_t			ni_ath_flags;	/* Atheros feature flags */
127107806Sobrien	/* NB: These must have the same values as IEEE80211_ATHC_* */
12885587Sobrien#define IEEE80211_NODE_TURBOP	0x0001		/* Turbo prime enable */
12985587Sobrien#define IEEE80211_NODE_COMP	0x0002		/* Compresssion enable */
130107806Sobrien#define IEEE80211_NODE_FF	0x0004          /* Fast Frame capable */
13185587Sobrien#define IEEE80211_NODE_XR	0x0008		/* Atheros WME enable */
13285587Sobrien#define IEEE80211_NODE_AR	0x0010		/* AR capable */
13385587Sobrien#define IEEE80211_NODE_BOOST	0x0080		/* Dynamic Turbo boosted */
134107806Sobrien	uint16_t		ni_ath_defkeyix;/* Atheros def key index */
135244988Sdelphij	const struct ieee80211_txparam *ni_txparms;
136107806Sobrien	uint32_t		ni_jointime;	/* time of join (secs) */
13785587Sobrien	uint32_t		*ni_challenge;	/* shared-key challenge */
13885587Sobrien	struct ieee80211_ies	ni_ies;		/* captured ie's */
13985587Sobrien						/* tx seq per-tid */
140107806Sobrien	uint16_t		ni_txseqs[IEEE80211_TID_SIZE];
141107806Sobrien						/* rx seq previous per-tid*/
142107806Sobrien	uint16_t		ni_rxseqs[IEEE80211_TID_SIZE];
14385587Sobrien	uint32_t		ni_rxfragstamp;	/* time stamp of last rx frag */
144107806Sobrien	struct mbuf		*ni_rxfrag[3];	/* rx frag reassembly */
14585587Sobrien	struct ieee80211_key	ni_ucastkey;	/* unicast key */
14685587Sobrien
14785587Sobrien	/* hardware */
14885587Sobrien	uint32_t		ni_rstamp;	/* recv timestamp */
14985587Sobrien	uint32_t		ni_avgrssi;	/* recv ssi state */
15085587Sobrien	int8_t			ni_noise;	/* noise floor */
15185587Sobrien
152201951Sru	/* header */
15385587Sobrien	uint8_t			ni_macaddr[IEEE80211_ADDR_LEN];
15485587Sobrien	uint8_t			ni_bssid[IEEE80211_ADDR_LEN];
15585587Sobrien
15685587Sobrien	/* beacon, probe response */
15785587Sobrien	union {
15885587Sobrien		uint8_t		data[8];
15985587Sobrien		u_int64_t	tsf;
16085587Sobrien	} ni_tstamp;				/* from last rcv'd beacon */
16185587Sobrien	uint16_t		ni_intval;	/* beacon interval */
16285587Sobrien	uint16_t		ni_capinfo;	/* capabilities */
16385587Sobrien	uint8_t			ni_esslen;
16485587Sobrien	uint8_t			ni_essid[IEEE80211_NWID_LEN];
16585587Sobrien	struct ieee80211_rateset ni_rates;	/* negotiated rate set */
166107806Sobrien	struct ieee80211_channel *ni_chan;
16785587Sobrien	uint16_t		ni_fhdwell;	/* FH only */
16885587Sobrien	uint8_t			ni_fhindex;	/* FH only */
16985587Sobrien	uint16_t		ni_erp;		/* ERP from beacon/probe resp */
17085587Sobrien	uint16_t		ni_timoff;	/* byte offset to TIM ie */
17185587Sobrien	uint8_t			ni_dtim_period;	/* DTIM period */
17285587Sobrien	uint8_t			ni_dtim_count;	/* DTIM count for last bcn */
17385587Sobrien
17485587Sobrien	/* 11n state */
17585587Sobrien	uint16_t		ni_htcap;	/* HT capabilities */
17685587Sobrien	uint8_t			ni_htparam;	/* HT params */
17785587Sobrien	uint8_t			ni_htctlchan;	/* HT control channel */
17885587Sobrien	uint8_t			ni_ht2ndchan;	/* HT 2nd channel */
17985587Sobrien	uint8_t			ni_htopmode;	/* HT operating mode */
18085587Sobrien	uint8_t			ni_htstbc;	/* HT */
18185587Sobrien	uint8_t			ni_chw;		/* negotiated channel width */
18285587Sobrien	struct ieee80211_htrateset ni_htrates;	/* negotiated ht rate set */
18385587Sobrien	struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_AC];
18485587Sobrien	struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID];
18585587Sobrien
18685587Sobrien	/* others */
187107806Sobrien	short			ni_inact;	/* inactivity mark count */
188107806Sobrien	short			ni_inact_reload;/* inactivity reload value */
18985587Sobrien	int			ni_txrate;	/* legacy rate/MCS */
19085587Sobrien	struct ieee80211_psq	ni_psq;		/* power save queue */
19185587Sobrien	struct ieee80211_nodestats ni_stats;	/* per-node statistics */
19285587Sobrien
19385587Sobrien	struct ieee80211vap	*ni_wdsvap;	/* associated WDS vap */
19485587Sobrien	/* XXX move to vap? */
19585587Sobrien	struct ifqueue		ni_wdsq;	/* wds pending queue */
196};
197MALLOC_DECLARE(M_80211_NODE);
198MALLOC_DECLARE(M_80211_NODE_IE);
199
200#define	IEEE80211_NODE_ATH	(IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP)
201#define	IEEE80211_NODE_AMPDU \
202	(IEEE80211_NODE_AMPDU_RX | IEEE80211_NODE_AMPDU_TX)
203#define	IEEE80211_NODE_HT_ALL \
204	(IEEE80211_NODE_HT | IEEE80211_NODE_HTCOMPAT | \
205	 IEEE80211_NODE_AMPDU | IEEE80211_NODE_MIMO_PS | \
206	 IEEE80211_NODE_MIMO_RTS | IEEE80211_NODE_RIFS | \
207	 IEEE80211_NODE_SGI20 | IEEE80211_NODE_SGI40)
208
209#define	IEEE80211_NODE_AID(ni)	IEEE80211_AID(ni->ni_associd)
210
211#define	IEEE80211_NODE_STAT(ni,stat)	(ni->ni_stats.ns_##stat++)
212#define	IEEE80211_NODE_STAT_ADD(ni,stat,v)	(ni->ni_stats.ns_##stat += v)
213#define	IEEE80211_NODE_STAT_SET(ni,stat,v)	(ni->ni_stats.ns_##stat = v)
214
215/*
216 * Filtered rssi calculation support.  The receive rssi is maintained
217 * as an average over the last 10 frames received using a low pass filter
218 * (all frames for now, possibly need to be more selective).  Calculations
219 * are designed such that a good compiler can optimize them.  The avg
220 * rssi state should be initialized to IEEE80211_RSSI_DUMMY_MARKER and
221 * each sample incorporated with IEEE80211_RSSI_LPF.  Use IEEE80211_RSSI_GET
222 * to extract the current value.
223 *
224 * Note that we assume rssi data are in the range [-127..127] and we
225 * discard values <-20.  This is consistent with assumptions throughout
226 * net80211 that signal strength data are in .5 dBm units relative to
227 * the current noise floor (linear, not log).
228 */
229#define IEEE80211_RSSI_LPF_LEN		10
230#define	IEEE80211_RSSI_DUMMY_MARKER	127
231/* NB: pow2 to optimize out * and / */
232#define	IEEE80211_RSSI_EP_MULTIPLIER	(1<<7)
233#define IEEE80211_RSSI_IN(x)		((x) * IEEE80211_RSSI_EP_MULTIPLIER)
234#define _IEEE80211_RSSI_LPF(x, y, len) \
235    (((x) != IEEE80211_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
236#define IEEE80211_RSSI_LPF(x, y) do {					\
237    if ((y) >= -20) {							\
238    	x = _IEEE80211_RSSI_LPF((x), IEEE80211_RSSI_IN((y)), 		\
239		IEEE80211_RSSI_LPF_LEN);				\
240    }									\
241} while (0)
242#define	IEEE80211_RSSI_EP_RND(x, mul) \
243	((((x) % (mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
244#define	IEEE80211_RSSI_GET(x) \
245	IEEE80211_RSSI_EP_RND(x, IEEE80211_RSSI_EP_MULTIPLIER)
246
247static __inline struct ieee80211_node *
248ieee80211_ref_node(struct ieee80211_node *ni)
249{
250	ieee80211_node_incref(ni);
251	return ni;
252}
253
254static __inline void
255ieee80211_unref_node(struct ieee80211_node **ni)
256{
257	ieee80211_node_decref(*ni);
258	*ni = NULL;			/* guard against use */
259}
260
261struct ieee80211com;
262
263void	ieee80211_node_attach(struct ieee80211com *);
264void	ieee80211_node_lateattach(struct ieee80211com *);
265void	ieee80211_node_detach(struct ieee80211com *);
266void	ieee80211_node_vattach(struct ieee80211vap *);
267void	ieee80211_node_latevattach(struct ieee80211vap *);
268void	ieee80211_node_vdetach(struct ieee80211vap *);
269
270static __inline int
271ieee80211_node_is_authorized(const struct ieee80211_node *ni)
272{
273	return (ni->ni_flags & IEEE80211_NODE_AUTH);
274}
275
276void	ieee80211_node_authorize(struct ieee80211_node *);
277void	ieee80211_node_unauthorize(struct ieee80211_node *);
278
279void	ieee80211_node_set_chan(struct ieee80211_node *,
280		struct ieee80211_channel *);
281void	ieee80211_create_ibss(struct ieee80211vap*, struct ieee80211_channel *);
282void	ieee80211_reset_bss(struct ieee80211vap *);
283void	ieee80211_sync_curchan(struct ieee80211com *);
284void	ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *);
285int	ieee80211_ibss_merge(struct ieee80211_node *);
286struct ieee80211_scan_entry;
287int	ieee80211_sta_join(struct ieee80211vap *, struct ieee80211_channel *,
288		const struct ieee80211_scan_entry *);
289void	ieee80211_sta_leave(struct ieee80211_node *);
290void	ieee80211_node_deauth(struct ieee80211_node *, int);
291
292int	ieee80211_ies_init(struct ieee80211_ies *, const uint8_t *, int);
293void	ieee80211_ies_cleanup(struct ieee80211_ies *);
294void	ieee80211_ies_expand(struct ieee80211_ies *);
295#define	ieee80211_ies_setie(_ies, _ie, _off) do {		\
296	(_ies)._ie = (_ies).data + (_off);			\
297} while (0)
298
299/*
300 * Table of ieee80211_node instances.  Each ieee80211com
301 * has one that holds association stations (when operating
302 * as an ap) or neighbors (in ibss mode).
303 *
304 * XXX embed this in ieee80211com instead of indirect?
305 */
306struct ieee80211_node_table {
307	struct ieee80211com	*nt_ic;		/* back reference */
308	ieee80211_node_lock_t	nt_nodelock;	/* on node table */
309	TAILQ_HEAD(, ieee80211_node) nt_node;	/* information of all nodes */
310	LIST_HEAD(, ieee80211_node) nt_hash[IEEE80211_NODE_HASHSIZE];
311	struct ieee80211_node	**nt_keyixmap;	/* key ix -> node map */
312	int			nt_keyixmax;	/* keyixmap size */
313	const char		*nt_name;	/* table name for debug msgs */
314	ieee80211_scan_lock_t	nt_scanlock;	/* on nt_scangen */
315	u_int			nt_scangen;	/* gen# for iterators */
316	int			nt_inact_init;	/* initial node inact setting */
317};
318
319struct ieee80211_node *ieee80211_alloc_node(struct ieee80211_node_table *,
320		struct ieee80211vap *,
321		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
322struct ieee80211_node *ieee80211_tmp_node(struct ieee80211vap *,
323		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
324struct ieee80211_node *ieee80211_dup_bss(struct ieee80211vap *,
325		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
326struct ieee80211_node *ieee80211_node_create_wds(struct ieee80211vap *,
327		const uint8_t bssid[IEEE80211_ADDR_LEN],
328		struct ieee80211_channel *);
329#ifdef IEEE80211_DEBUG_REFCNT
330void	ieee80211_free_node_debug(struct ieee80211_node *,
331		const char *func, int line);
332struct ieee80211_node *ieee80211_find_node_locked_debug(
333		struct ieee80211_node_table *,
334		const uint8_t macaddr[IEEE80211_ADDR_LEN],
335		const char *func, int line);
336struct ieee80211_node *ieee80211_find_node_debug(struct ieee80211_node_table *,
337		const uint8_t macaddr[IEEE80211_ADDR_LEN],
338		const char *func, int line);
339struct ieee80211_node *ieee80211_find_vap_node_locked_debug(
340		struct ieee80211_node_table *,
341		const struct ieee80211vap *vap,
342		const uint8_t macaddr[IEEE80211_ADDR_LEN],
343		const char *func, int line);
344struct ieee80211_node *ieee80211_find_vap_node_debug(
345		struct ieee80211_node_table *,
346		const struct ieee80211vap *vap,
347		const uint8_t macaddr[IEEE80211_ADDR_LEN],
348		const char *func, int line);
349struct ieee80211_node * ieee80211_find_rxnode_debug(struct ieee80211com *,
350		const struct ieee80211_frame_min *,
351		const char *func, int line);
352struct ieee80211_node * ieee80211_find_rxnode_withkey_debug(
353		struct ieee80211com *,
354		const struct ieee80211_frame_min *, uint16_t keyix,
355		const char *func, int line);
356struct ieee80211_node *ieee80211_find_txnode_debug(struct ieee80211vap *,
357		const uint8_t *,
358		const char *func, int line);
359#define	ieee80211_free_node(ni) \
360	ieee80211_free_node_debug(ni, __func__, __LINE__)
361#define	ieee80211_find_node_locked(nt, mac) \
362	ieee80211_find_node_locked_debug(nt, mac, __func__, __LINE__)
363#define	ieee80211_find_node(nt, mac) \
364	ieee80211_find_node_debug(nt, mac, __func__, __LINE__)
365#define	ieee80211_find_vap_node_locked(nt, vap, mac) \
366	ieee80211_find_vap_node_locked_debug(nt, vap, mac, __func__, __LINE__)
367#define	ieee80211_find_vap_node(nt, vap, mac) \
368	ieee80211_find_vap_node_debug(nt, vap, mac, __func__, __LINE__)
369#define	ieee80211_find_rxnode(ic, wh) \
370	ieee80211_find_rxnode_debug(ic, wh, __func__, __LINE__)
371#define	ieee80211_find_rxnode_withkey(ic, wh, keyix) \
372	ieee80211_find_rxnode_withkey_debug(ic, wh, keyix, __func__, __LINE__)
373#define	ieee80211_find_txnode(vap, mac) \
374	ieee80211_find_txnode_debug(vap, mac, __func__, __LINE__)
375#else
376void	ieee80211_free_node(struct ieee80211_node *);
377struct ieee80211_node *ieee80211_find_node_locked(struct ieee80211_node_table *,
378		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
379struct ieee80211_node *ieee80211_find_node(struct ieee80211_node_table *,
380		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
381struct ieee80211_node *ieee80211_find_vap_node_locked(
382		struct ieee80211_node_table *, const struct ieee80211vap *,
383		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
384struct ieee80211_node *ieee80211_find_vap_node(
385		struct ieee80211_node_table *, const struct ieee80211vap *,
386		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
387struct ieee80211_node * ieee80211_find_rxnode(struct ieee80211com *,
388		const struct ieee80211_frame_min *);
389struct ieee80211_node * ieee80211_find_rxnode_withkey(struct ieee80211com *,
390		const struct ieee80211_frame_min *, uint16_t keyix);
391struct ieee80211_node *ieee80211_find_txnode(struct ieee80211vap *,
392		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
393#endif
394int	ieee80211_node_delucastkey(struct ieee80211_node *);
395void	ieee80211_node_timeout(void *arg);
396
397typedef void ieee80211_iter_func(void *, struct ieee80211_node *);
398void	ieee80211_iterate_nodes(struct ieee80211_node_table *,
399		ieee80211_iter_func *, void *);
400
401void	ieee80211_notify_erp(struct ieee80211com *);
402void	ieee80211_dump_node(struct ieee80211_node_table *,
403		struct ieee80211_node *);
404void	ieee80211_dump_nodes(struct ieee80211_node_table *);
405
406struct ieee80211_node *ieee80211_fakeup_adhoc_node(struct ieee80211vap *,
407		const uint8_t macaddr[IEEE80211_ADDR_LEN]);
408struct ieee80211_scanparams;
409void	ieee80211_init_neighbor(struct ieee80211_node *,
410		const struct ieee80211_frame *,
411		const struct ieee80211_scanparams *);
412struct ieee80211_node *ieee80211_add_neighbor(struct ieee80211vap *,
413		const struct ieee80211_frame *,
414		const struct ieee80211_scanparams *);
415void	ieee80211_node_join(struct ieee80211_node *,int);
416void	ieee80211_node_leave(struct ieee80211_node *);
417int8_t	ieee80211_getrssi(struct ieee80211vap *);
418void	ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *);
419#endif /* _NET80211_IEEE80211_NODE_H_ */
420