xref: /openbmc/linux/net/mac80211/ieee80211_i.h (revision 83eb935e)
1f0706e82SJiri Benc /*
2f0706e82SJiri Benc  * Copyright 2002-2005, Instant802 Networks, Inc.
3f0706e82SJiri Benc  * Copyright 2005, Devicescape Software, Inc.
4f0706e82SJiri Benc  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
5026331c4SJouni Malinen  * Copyright 2007-2010	Johannes Berg <johannes@sipsolutions.net>
6f0706e82SJiri Benc  *
7f0706e82SJiri Benc  * This program is free software; you can redistribute it and/or modify
8f0706e82SJiri Benc  * it under the terms of the GNU General Public License version 2 as
9f0706e82SJiri Benc  * published by the Free Software Foundation.
10f0706e82SJiri Benc  */
11f0706e82SJiri Benc 
12f0706e82SJiri Benc #ifndef IEEE80211_I_H
13f0706e82SJiri Benc #define IEEE80211_I_H
14f0706e82SJiri Benc 
15f0706e82SJiri Benc #include <linux/kernel.h>
16f0706e82SJiri Benc #include <linux/device.h>
17f0706e82SJiri Benc #include <linux/if_ether.h>
18f0706e82SJiri Benc #include <linux/interrupt.h>
19f0706e82SJiri Benc #include <linux/list.h>
20f0706e82SJiri Benc #include <linux/netdevice.h>
21f0706e82SJiri Benc #include <linux/skbuff.h>
22f0706e82SJiri Benc #include <linux/workqueue.h>
23f0706e82SJiri Benc #include <linux/types.h>
24f0706e82SJiri Benc #include <linux/spinlock.h>
25571ecf67SJohannes Berg #include <linux/etherdevice.h>
26e1e54068SJohannes Berg #include <linux/leds.h>
27a729cff8SJohannes Berg #include <linux/idr.h>
28fe7a5d5cSJohannes Berg #include <net/ieee80211_radiotap.h>
2993da9cc1Scolin@cozybit.com #include <net/cfg80211.h>
3051cb6db0SDavid S. Miller #include <net/mac80211.h>
312c8dccc7SJohannes Berg #include "key.h"
32f0706e82SJiri Benc #include "sta_info.h"
33bdcbd8e0SJohannes Berg #include "debug.h"
34f0706e82SJiri Benc 
359cfb0009SJohannes Berg struct ieee80211_local;
36f0706e82SJiri Benc 
37f0706e82SJiri Benc /* Maximum number of broadcast/multicast frames to buffer when some of the
38f0706e82SJiri Benc  * associated stations are using power saving. */
39f0706e82SJiri Benc #define AP_MAX_BC_BUFFER 128
40f0706e82SJiri Benc 
41f0706e82SJiri Benc /* Maximum number of frames buffered to all STAs, including multicast frames.
42f0706e82SJiri Benc  * Note: increasing this limit increases the potential memory requirement. Each
43f0706e82SJiri Benc  * frame can be up to about 2 kB long. */
44f0706e82SJiri Benc #define TOTAL_MAX_TX_BUFFER 512
45f0706e82SJiri Benc 
46f0706e82SJiri Benc /* Required encryption head and tailroom */
47f0706e82SJiri Benc #define IEEE80211_ENCRYPT_HEADROOM 8
48765cb46aSJouni Malinen #define IEEE80211_ENCRYPT_TAILROOM 18
49f0706e82SJiri Benc 
50f0706e82SJiri Benc /* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent
51f0706e82SJiri Benc  * reception of at least three fragmented frames. This limit can be increased
52f0706e82SJiri Benc  * by changing this define, at the cost of slower frame reassembly and
53f0706e82SJiri Benc  * increased memory use (about 2 kB of RAM per entry). */
54f0706e82SJiri Benc #define IEEE80211_FRAGMENT_MAX 4
55f0706e82SJiri Benc 
561ea6f9c0SJohannes Berg /* power level hasn't been configured (or set to automatic) */
571ea6f9c0SJohannes Berg #define IEEE80211_UNSET_POWER_LEVEL	INT_MIN
581ea6f9c0SJohannes Berg 
59d6a4ed6fSArik Nemtsov /*
60d6a4ed6fSArik Nemtsov  * Some APs experience problems when working with U-APSD. Decrease the
61d6a4ed6fSArik Nemtsov  * probability of that happening by using legacy mode for all ACs but VO.
62d6a4ed6fSArik Nemtsov  * The AP that caused us trouble was a Cisco 4410N. It ignores our
63d6a4ed6fSArik Nemtsov  * setting, and always treats non-VO ACs as legacy.
64d6a4ed6fSArik Nemtsov  */
65ab13315aSKalle Valo #define IEEE80211_DEFAULT_UAPSD_QUEUES \
66d6a4ed6fSArik Nemtsov 	IEEE80211_WMM_IE_STA_QOSINFO_AC_VO
67ab13315aSKalle Valo 
68ab13315aSKalle Valo #define IEEE80211_DEFAULT_MAX_SP_LEN		\
69ab13315aSKalle Valo 	IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
70ab13315aSKalle Valo 
716ae16775SAntonio Quartulli #define IEEE80211_DEAUTH_FRAME_LEN	(24 /* hdr */ + 2 /* reason */)
726ae16775SAntonio Quartulli 
73f0706e82SJiri Benc struct ieee80211_fragment_entry {
74f0706e82SJiri Benc 	unsigned long first_frag_time;
75f0706e82SJiri Benc 	unsigned int seq;
76f0706e82SJiri Benc 	unsigned int rx_queue;
77f0706e82SJiri Benc 	unsigned int last_frag;
78f0706e82SJiri Benc 	unsigned int extra_len;
79f0706e82SJiri Benc 	struct sk_buff_head skb_list;
80f0706e82SJiri Benc 	int ccmp; /* Whether fragments were encrypted with CCMP */
81f0706e82SJiri Benc 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
82f0706e82SJiri Benc };
83f0706e82SJiri Benc 
84f0706e82SJiri Benc 
85c2b13452SJohannes Berg struct ieee80211_bss {
86ef429dadSJohannes Berg 	u32 device_ts_beacon, device_ts_presp;
878c358bcdSJohannes Berg 
8843ac2ca3SJouni Malinen 	bool wmm_used;
89ab13315aSKalle Valo 	bool uapsd_supported;
9000d3f14cSJohannes Berg 
91f0706e82SJiri Benc #define IEEE80211_MAX_SUPP_RATES 32
92f0706e82SJiri Benc 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
93f0706e82SJiri Benc 	size_t supp_rates_len;
94817cee76SAlexander Bondar 	struct ieee80211_rate *beacon_rate;
95f0706e82SJiri Benc 
9600d3f14cSJohannes Berg 	/*
9725985edcSLucas De Marchi 	 * During association, we save an ERP value from a probe response so
985628221cSDaniel Drake 	 * that we can feed ERP info to the driver when handling the
995628221cSDaniel Drake 	 * association completes. these fields probably won't be up-to-date
10000d3f14cSJohannes Berg 	 * otherwise, you probably don't want to use them.
10100d3f14cSJohannes Berg 	 */
10200d3f14cSJohannes Berg 	bool has_erp_value;
1035628221cSDaniel Drake 	u8 erp_value;
104fcff4f10SPaul Stewart 
105fcff4f10SPaul Stewart 	/* Keep track of the corruption of the last beacon/probe response. */
106fcff4f10SPaul Stewart 	u8 corrupt_data;
107fcff4f10SPaul Stewart 
108fcff4f10SPaul Stewart 	/* Keep track of what bits of information we have valid info for. */
109fcff4f10SPaul Stewart 	u8 valid_data;
110fcff4f10SPaul Stewart };
111fcff4f10SPaul Stewart 
112fcff4f10SPaul Stewart /**
113fcff4f10SPaul Stewart  * enum ieee80211_corrupt_data_flags - BSS data corruption flags
114fcff4f10SPaul Stewart  * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
115fcff4f10SPaul Stewart  * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
116fcff4f10SPaul Stewart  *
117fcff4f10SPaul Stewart  * These are bss flags that are attached to a bss in the
118fcff4f10SPaul Stewart  * @corrupt_data field of &struct ieee80211_bss.
119fcff4f10SPaul Stewart  */
120fcff4f10SPaul Stewart enum ieee80211_bss_corrupt_data_flags {
121fcff4f10SPaul Stewart 	IEEE80211_BSS_CORRUPT_BEACON		= BIT(0),
122fcff4f10SPaul Stewart 	IEEE80211_BSS_CORRUPT_PROBE_RESP	= BIT(1)
123fcff4f10SPaul Stewart };
124fcff4f10SPaul Stewart 
125fcff4f10SPaul Stewart /**
126fcff4f10SPaul Stewart  * enum ieee80211_valid_data_flags - BSS valid data flags
127fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
128fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
129fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
130fcff4f10SPaul Stewart  *
131fcff4f10SPaul Stewart  * These are bss flags that are attached to a bss in the
132fcff4f10SPaul Stewart  * @valid_data field of &struct ieee80211_bss.  They show which parts
133fcff4f10SPaul Stewart  * of the data structure were recieved as a result of an un-corrupted
134fcff4f10SPaul Stewart  * beacon/probe response.
135fcff4f10SPaul Stewart  */
136fcff4f10SPaul Stewart enum ieee80211_bss_valid_data_flags {
137fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_WMM			= BIT(1),
138fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_RATES		= BIT(2),
139fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_ERP			= BIT(3)
140f0706e82SJiri Benc };
141f0706e82SJiri Benc 
1429ae54c84SJohannes Berg typedef unsigned __bitwise__ ieee80211_tx_result;
1439ae54c84SJohannes Berg #define TX_CONTINUE	((__force ieee80211_tx_result) 0u)
1449ae54c84SJohannes Berg #define TX_DROP		((__force ieee80211_tx_result) 1u)
1459ae54c84SJohannes Berg #define TX_QUEUED	((__force ieee80211_tx_result) 2u)
1469ae54c84SJohannes Berg 
1475cf121c3SJohannes Berg #define IEEE80211_TX_UNICAST		BIT(1)
1485cf121c3SJohannes Berg #define IEEE80211_TX_PS_BUFFERED	BIT(2)
1499ae54c84SJohannes Berg 
1505cf121c3SJohannes Berg struct ieee80211_tx_data {
151f0706e82SJiri Benc 	struct sk_buff *skb;
152252b86c4SJohannes Berg 	struct sk_buff_head skbs;
153f0706e82SJiri Benc 	struct ieee80211_local *local;
154f0706e82SJiri Benc 	struct ieee80211_sub_if_data *sdata;
155f0706e82SJiri Benc 	struct sta_info *sta;
156f0706e82SJiri Benc 	struct ieee80211_key *key;
1570d528d85SFelix Fietkau 	struct ieee80211_tx_rate rate;
1585cf121c3SJohannes Berg 
159056cdd59SJohannes Berg 	unsigned int flags;
1605cf121c3SJohannes Berg };
1615cf121c3SJohannes Berg 
1625cf121c3SJohannes Berg 
1635cf121c3SJohannes Berg typedef unsigned __bitwise__ ieee80211_rx_result;
1645cf121c3SJohannes Berg #define RX_CONTINUE		((__force ieee80211_rx_result) 0u)
1655cf121c3SJohannes Berg #define RX_DROP_UNUSABLE	((__force ieee80211_rx_result) 1u)
1665cf121c3SJohannes Berg #define RX_DROP_MONITOR		((__force ieee80211_rx_result) 2u)
1675cf121c3SJohannes Berg #define RX_QUEUED		((__force ieee80211_rx_result) 3u)
1685cf121c3SJohannes Berg 
169554891e6SJohannes Berg /**
170554891e6SJohannes Berg  * enum ieee80211_packet_rx_flags - packet RX flags
171554891e6SJohannes Berg  * @IEEE80211_RX_RA_MATCH: frame is destined to interface currently processed
172554891e6SJohannes Berg  *	(incl. multicast frames)
173554891e6SJohannes Berg  * @IEEE80211_RX_FRAGMENTED: fragmented frame
174554891e6SJohannes Berg  * @IEEE80211_RX_AMSDU: a-MSDU packet
175554891e6SJohannes Berg  * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed
1764cfda47bSChristian Lamparter  * @IEEE80211_RX_DEFERRED_RELEASE: frame was subjected to receive reordering
177554891e6SJohannes Berg  *
178554891e6SJohannes Berg  * These are per-frame flags that are attached to a frame in the
179554891e6SJohannes Berg  * @rx_flags field of &struct ieee80211_rx_status.
180554891e6SJohannes Berg  */
181554891e6SJohannes Berg enum ieee80211_packet_rx_flags {
182554891e6SJohannes Berg 	IEEE80211_RX_RA_MATCH			= BIT(1),
183554891e6SJohannes Berg 	IEEE80211_RX_FRAGMENTED			= BIT(2),
184554891e6SJohannes Berg 	IEEE80211_RX_AMSDU			= BIT(3),
185554891e6SJohannes Berg 	IEEE80211_RX_MALFORMED_ACTION_FRM	= BIT(4),
1864cfda47bSChristian Lamparter 	IEEE80211_RX_DEFERRED_RELEASE		= BIT(5),
187554891e6SJohannes Berg };
188554891e6SJohannes Berg 
189554891e6SJohannes Berg /**
190554891e6SJohannes Berg  * enum ieee80211_rx_flags - RX data flags
191554891e6SJohannes Berg  *
192554891e6SJohannes Berg  * @IEEE80211_RX_CMNTR: received on cooked monitor already
193ee971924SJohannes Berg  * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
194ee971924SJohannes Berg  *	to cfg80211_report_obss_beacon().
195554891e6SJohannes Berg  *
196554891e6SJohannes Berg  * These flags are used across handling multiple interfaces
197554891e6SJohannes Berg  * for a single frame.
198554891e6SJohannes Berg  */
199554891e6SJohannes Berg enum ieee80211_rx_flags {
200554891e6SJohannes Berg 	IEEE80211_RX_CMNTR		= BIT(0),
201ee971924SJohannes Berg 	IEEE80211_RX_BEACON_REPORTED	= BIT(1),
202554891e6SJohannes Berg };
2035cf121c3SJohannes Berg 
2045cf121c3SJohannes Berg struct ieee80211_rx_data {
2055cf121c3SJohannes Berg 	struct sk_buff *skb;
2065cf121c3SJohannes Berg 	struct ieee80211_local *local;
2075cf121c3SJohannes Berg 	struct ieee80211_sub_if_data *sdata;
2085cf121c3SJohannes Berg 	struct sta_info *sta;
2095cf121c3SJohannes Berg 	struct ieee80211_key *key;
210056cdd59SJohannes Berg 
211056cdd59SJohannes Berg 	unsigned int flags;
2129e26297aSJohannes Berg 
2139e26297aSJohannes Berg 	/*
2149e26297aSJohannes Berg 	 * Index into sequence numbers array, 0..16
2159e26297aSJohannes Berg 	 * since the last (16) is used for non-QoS,
2169e26297aSJohannes Berg 	 * will be 16 on non-QoS frames.
2179e26297aSJohannes Berg 	 */
2189e26297aSJohannes Berg 	int seqno_idx;
2199e26297aSJohannes Berg 
2209e26297aSJohannes Berg 	/*
2219e26297aSJohannes Berg 	 * Index into the security IV/PN arrays, 0..16
2229e26297aSJohannes Berg 	 * since the last (16) is used for CCMP-encrypted
2239e26297aSJohannes Berg 	 * management frames, will be set to 16 on mgmt
2249e26297aSJohannes Berg 	 * frames and 0 on non-QoS frames.
2259e26297aSJohannes Berg 	 */
2269e26297aSJohannes Berg 	int security_idx;
2279e26297aSJohannes Berg 
22850741ae0SJohannes Berg 	u32 tkip_iv32;
22950741ae0SJohannes Berg 	u16 tkip_iv16;
230f0706e82SJiri Benc };
231f0706e82SJiri Benc 
232af296bdbSMichal Kazior struct ieee80211_csa_settings {
233af296bdbSMichal Kazior 	const u16 *counter_offsets_beacon;
234af296bdbSMichal Kazior 	const u16 *counter_offsets_presp;
235af296bdbSMichal Kazior 
236af296bdbSMichal Kazior 	int n_counter_offsets_beacon;
237af296bdbSMichal Kazior 	int n_counter_offsets_presp;
238af296bdbSMichal Kazior 
239af296bdbSMichal Kazior 	u8 count;
240af296bdbSMichal Kazior };
241af296bdbSMichal Kazior 
2425dfdaf58SJohannes Berg struct beacon_data {
2435dfdaf58SJohannes Berg 	u8 *head, *tail;
2445dfdaf58SJohannes Berg 	int head_len, tail_len;
24543552be1SThomas Pedersen 	struct ieee80211_meshconf_ie *meshconf;
246af296bdbSMichal Kazior 	u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
247af296bdbSMichal Kazior 	u8 csa_current_counter;
2488860020eSJohannes Berg 	struct rcu_head rcu_head;
2495dfdaf58SJohannes Berg };
2505dfdaf58SJohannes Berg 
251aa7a0080SEyal Shapira struct probe_resp {
252aa7a0080SEyal Shapira 	struct rcu_head rcu_head;
253aa7a0080SEyal Shapira 	int len;
254af296bdbSMichal Kazior 	u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
255aa7a0080SEyal Shapira 	u8 data[0];
256aa7a0080SEyal Shapira };
257aa7a0080SEyal Shapira 
258d012a605SMarco Porsch struct ps_data {
259d012a605SMarco Porsch 	/* yes, this looks ugly, but guarantees that we can later use
260d012a605SMarco Porsch 	 * bitmap_empty :)
261d012a605SMarco Porsch 	 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
2625fe2bb86SJoe Perches 	u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]
2635fe2bb86SJoe Perches 			__aligned(__alignof__(unsigned long));
264d012a605SMarco Porsch 	struct sk_buff_head bc_buf;
265d012a605SMarco Porsch 	atomic_t num_sta_ps; /* number of stations in PS mode */
266d012a605SMarco Porsch 	int dtim_count;
267d012a605SMarco Porsch 	bool dtim_bc_mc;
268d012a605SMarco Porsch };
269d012a605SMarco Porsch 
270f0706e82SJiri Benc struct ieee80211_if_ap {
27140b275b6SJohannes Berg 	struct beacon_data __rcu *beacon;
272aa7a0080SEyal Shapira 	struct probe_resp __rcu *probe_resp;
273f0706e82SJiri Benc 
27473da7d5bSSimon Wunderlich 	/* to be used after channel switch. */
27573da7d5bSSimon Wunderlich 	struct cfg80211_beacon_data *next_beacon;
2764e141dadSMichal Kazior 	struct list_head vlans; /* write-protected with RTNL and local->mtx */
2770ec3ca44SJohannes Berg 
278d012a605SMarco Porsch 	struct ps_data ps;
279030ef8f8SFelix Fietkau 	atomic_t num_mcast_sta; /* number of stations receiving multicast */
280687da132SEmmanuel Grumbach 	enum ieee80211_smps_mode req_smps, /* requested smps mode */
281687da132SEmmanuel Grumbach 			 driver_smps_mode; /* smps mode request */
282687da132SEmmanuel Grumbach 
283687da132SEmmanuel Grumbach 	struct work_struct request_smps_work;
284f0706e82SJiri Benc };
285f0706e82SJiri Benc 
286f0706e82SJiri Benc struct ieee80211_if_wds {
287f0706e82SJiri Benc 	struct sta_info *sta;
288056cdd59SJohannes Berg 	u8 remote_addr[ETH_ALEN];
289f0706e82SJiri Benc };
290f0706e82SJiri Benc 
291f0706e82SJiri Benc struct ieee80211_if_vlan {
2924e141dadSMichal Kazior 	struct list_head list; /* write-protected with RTNL and local->mtx */
293f14543eeSFelix Fietkau 
294f14543eeSFelix Fietkau 	/* used for all tx if the VLAN is configured to 4-addr mode */
29540b275b6SJohannes Berg 	struct sta_info __rcu *sta;
296f0706e82SJiri Benc };
297f0706e82SJiri Benc 
298ee385855SLuis Carlos Cobo struct mesh_stats {
299c8a61a7dSDaniel Walker 	__u32 fwded_mcast;		/* Mesh forwarded multicast frames */
300c8a61a7dSDaniel Walker 	__u32 fwded_unicast;		/* Mesh forwarded unicast frames */
301c8a61a7dSDaniel Walker 	__u32 fwded_frames;		/* Mesh total forwarded frames */
302ee385855SLuis Carlos Cobo 	__u32 dropped_frames_ttl;	/* Not transmitted since mesh_ttl == 0*/
303ee385855SLuis Carlos Cobo 	__u32 dropped_frames_no_route;	/* Not transmitted, no route found */
304cfee66b0SJavier Cardona 	__u32 dropped_frames_congestion;/* Not forwarded due to congestion */
305ee385855SLuis Carlos Cobo };
306ee385855SLuis Carlos Cobo 
307ee385855SLuis Carlos Cobo #define PREQ_Q_F_START		0x1
308ee385855SLuis Carlos Cobo #define PREQ_Q_F_REFRESH	0x2
309ee385855SLuis Carlos Cobo struct mesh_preq_queue {
310ee385855SLuis Carlos Cobo 	struct list_head list;
311ee385855SLuis Carlos Cobo 	u8 dst[ETH_ALEN];
312ee385855SLuis Carlos Cobo 	u8 flags;
313ee385855SLuis Carlos Cobo };
314ee385855SLuis Carlos Cobo 
3152eb278e0SJohannes Berg #if HZ/100 == 0
3162eb278e0SJohannes Berg #define IEEE80211_ROC_MIN_LEFT	1
3172eb278e0SJohannes Berg #else
3182eb278e0SJohannes Berg #define IEEE80211_ROC_MIN_LEFT	(HZ/100)
3192eb278e0SJohannes Berg #endif
32077fdaa12SJohannes Berg 
3212eb278e0SJohannes Berg struct ieee80211_roc_work {
32277fdaa12SJohannes Berg 	struct list_head list;
3232eb278e0SJohannes Berg 	struct list_head dependents;
324f679f65dSJohannes Berg 
3252eb278e0SJohannes Berg 	struct delayed_work work;
326af6b6374SJohannes Berg 
327af6b6374SJohannes Berg 	struct ieee80211_sub_if_data *sdata;
328af6b6374SJohannes Berg 
329f679f65dSJohannes Berg 	struct ieee80211_channel *chan;
330af6b6374SJohannes Berg 
3312eb278e0SJohannes Berg 	bool started, abort, hw_begun, notified;
3323fbd45caSJohannes Berg 	bool to_be_freed;
333b4b177a5SJohannes Berg 	bool on_channel;
334f679f65dSJohannes Berg 
3352eb278e0SJohannes Berg 	unsigned long hw_start_time;
336e4da8c37SJohannes Berg 
3372eb278e0SJohannes Berg 	u32 duration, req_duration;
338f30221e4SJohannes Berg 	struct sk_buff *frame;
33950febf6aSJohannes Berg 	u64 cookie, mgmt_tx_cookie;
340d339d5caSIlan Peer 	enum ieee80211_roc_type type;
34177fdaa12SJohannes Berg };
34277fdaa12SJohannes Berg 
34346900298SJohannes Berg /* flags used in struct ieee80211_if_managed.flags */
344ab1faeadSJohannes Berg enum ieee80211_sta_flags {
345b291ba11SJohannes Berg 	IEEE80211_STA_CONNECTION_POLL	= BIT(1),
346b291ba11SJohannes Berg 	IEEE80211_STA_CONTROL_PORT	= BIT(2),
347a8243b72SJohannes Berg 	IEEE80211_STA_DISABLE_HT	= BIT(4),
348b291ba11SJohannes Berg 	IEEE80211_STA_MFP_ENABLED	= BIT(6),
349ab13315aSKalle Valo 	IEEE80211_STA_UAPSD_ENABLED	= BIT(7),
350375177bfSVivek Natarajan 	IEEE80211_STA_NULLFUNC_ACKED	= BIT(8),
35117e4ec14SJouni Malinen 	IEEE80211_STA_RESET_SIGNAL_AVE	= BIT(9),
35224398e39SJohannes Berg 	IEEE80211_STA_DISABLE_40MHZ	= BIT(10),
353d545dabaSMahesh Palivela 	IEEE80211_STA_DISABLE_VHT	= BIT(11),
354f2d9d270SJohannes Berg 	IEEE80211_STA_DISABLE_80P80MHZ	= BIT(12),
355f2d9d270SJohannes Berg 	IEEE80211_STA_DISABLE_160MHZ	= BIT(13),
356095d81ceSJohannes Berg 	IEEE80211_STA_DISABLE_WMM	= BIT(14),
357ab1faeadSJohannes Berg };
358ab1faeadSJohannes Berg 
35966e67e41SJohannes Berg struct ieee80211_mgd_auth_data {
36066e67e41SJohannes Berg 	struct cfg80211_bss *bss;
36166e67e41SJohannes Berg 	unsigned long timeout;
36266e67e41SJohannes Berg 	int tries;
36366e67e41SJohannes Berg 	u16 algorithm, expected_transaction;
36466e67e41SJohannes Berg 
36566e67e41SJohannes Berg 	u8 key[WLAN_KEY_LEN_WEP104];
36666e67e41SJohannes Berg 	u8 key_len, key_idx;
36766e67e41SJohannes Berg 	bool done;
36889afe614SJohannes Berg 	bool timeout_started;
36966e67e41SJohannes Berg 
3706b8ece3aSJouni Malinen 	u16 sae_trans, sae_status;
3716b8ece3aSJouni Malinen 	size_t data_len;
3726b8ece3aSJouni Malinen 	u8 data[];
37366e67e41SJohannes Berg };
37466e67e41SJohannes Berg 
37566e67e41SJohannes Berg struct ieee80211_mgd_assoc_data {
37666e67e41SJohannes Berg 	struct cfg80211_bss *bss;
37766e67e41SJohannes Berg 	const u8 *supp_rates;
37866e67e41SJohannes Berg 
37966e67e41SJohannes Berg 	unsigned long timeout;
38066e67e41SJohannes Berg 	int tries;
38166e67e41SJohannes Berg 
38266e67e41SJohannes Berg 	u16 capability;
38366e67e41SJohannes Berg 	u8 prev_bssid[ETH_ALEN];
38466e67e41SJohannes Berg 	u8 ssid[IEEE80211_MAX_SSID_LEN];
38566e67e41SJohannes Berg 	u8 ssid_len;
38666e67e41SJohannes Berg 	u8 supp_rates_len;
38776f0303dSJohannes Berg 	bool wmm, uapsd;
388989c6505SAlexander Bondar 	bool need_beacon;
38966e67e41SJohannes Berg 	bool synced;
39089afe614SJohannes Berg 	bool timeout_started;
39166e67e41SJohannes Berg 
3929dde6423SJohannes Berg 	u8 ap_ht_param;
3939dde6423SJohannes Berg 
394b08fbbd8SJohannes Berg 	struct ieee80211_vht_cap ap_vht_cap;
395b08fbbd8SJohannes Berg 
39666e67e41SJohannes Berg 	size_t ie_len;
39766e67e41SJohannes Berg 	u8 ie[];
39866e67e41SJohannes Berg };
39966e67e41SJohannes Berg 
40046900298SJohannes Berg struct ieee80211_if_managed {
401056cdd59SJohannes Berg 	struct timer_list timer;
402b291ba11SJohannes Berg 	struct timer_list conn_mon_timer;
403b291ba11SJohannes Berg 	struct timer_list bcn_mon_timer;
404c481ec97SSujith 	struct timer_list chswitch_timer;
405b291ba11SJohannes Berg 	struct work_struct monitor_work;
406c481ec97SSujith 	struct work_struct chswitch_work;
4071e4dcd01SJuuso Oikarinen 	struct work_struct beacon_connection_loss_work;
408882a7c69SJohannes Berg 	struct work_struct csa_connection_drop_work;
40946900298SJohannes Berg 
4107ccc8bd7SFelix Fietkau 	unsigned long beacon_timeout;
411b291ba11SJohannes Berg 	unsigned long probe_timeout;
412a43abf29SMaxim Levitsky 	int probe_send_count;
41304ac3c0eSFelix Fietkau 	bool nullfunc_failed;
414682bd38bSJohannes Berg 	bool connection_loss;
415b291ba11SJohannes Berg 
4160c1ad2caSJohannes Berg 	struct cfg80211_bss *associated;
41766e67e41SJohannes Berg 	struct ieee80211_mgd_auth_data *auth_data;
41866e67e41SJohannes Berg 	struct ieee80211_mgd_assoc_data *assoc_data;
41946900298SJohannes Berg 
42077fdaa12SJohannes Berg 	u8 bssid[ETH_ALEN];
42146900298SJohannes Berg 
422f0706e82SJiri Benc 	u16 aid;
423f0706e82SJiri Benc 
424965bedadSJohannes Berg 	bool powersave; /* powersave requested for this iface */
42505cb9108SJohannes Berg 	bool broken_ap; /* AP is broken -- turn off powersave */
426989c6505SAlexander Bondar 	bool have_beacon;
427826262c3SJohannes Berg 	u8 dtim_period;
4280f78231bSJohannes Berg 	enum ieee80211_smps_mode req_smps, /* requested smps mode */
429d1f5b7a3SJohannes Berg 				 driver_smps_mode; /* smps mode request */
430d1f5b7a3SJohannes Berg 
431d1f5b7a3SJohannes Berg 	struct work_struct request_smps_work;
432965bedadSJohannes Berg 
433d6f2da5bSJiri Slaby 	unsigned int flags;
434f0706e82SJiri Benc 
435d8ec4433SJuuso Oikarinen 	bool beacon_crc_valid;
436d91f36dbSJohannes Berg 	u32 beacon_crc;
437d91f36dbSJohannes Berg 
4381672c0e3SJohannes Berg 	bool status_acked;
4391672c0e3SJohannes Berg 	bool status_received;
4401672c0e3SJohannes Berg 	__le16 status_fc;
4411672c0e3SJohannes Berg 
442fdfacf0aSJouni Malinen 	enum {
443fdfacf0aSJouni Malinen 		IEEE80211_MFP_DISABLED,
444fdfacf0aSJouni Malinen 		IEEE80211_MFP_OPTIONAL,
445fdfacf0aSJouni Malinen 		IEEE80211_MFP_REQUIRED
446fdfacf0aSJouni Malinen 	} mfp; /* management frame protection */
447fdfacf0aSJouni Malinen 
448dc41e4d4SEliad Peller 	/*
449dc41e4d4SEliad Peller 	 * Bitmask of enabled u-apsd queues,
450dc41e4d4SEliad Peller 	 * IEEE80211_WMM_IE_STA_QOSINFO_AC_BE & co. Needs a new association
451dc41e4d4SEliad Peller 	 * to take effect.
452dc41e4d4SEliad Peller 	 */
453dc41e4d4SEliad Peller 	unsigned int uapsd_queues;
454dc41e4d4SEliad Peller 
455dc41e4d4SEliad Peller 	/*
456dc41e4d4SEliad Peller 	 * Maximum number of buffered frames AP can deliver during a
457dc41e4d4SEliad Peller 	 * service period, IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL or similar.
458dc41e4d4SEliad Peller 	 * Needs a new association to take effect.
459dc41e4d4SEliad Peller 	 */
460dc41e4d4SEliad Peller 	unsigned int uapsd_max_sp_len;
461dc41e4d4SEliad Peller 
462f0706e82SJiri Benc 	int wmm_last_param_set;
4639bc383deSJohannes Berg 
4649bc383deSJohannes Berg 	u8 use_4addr;
46517e4ec14SJouni Malinen 
46667baf663SJanusz Dziedzic 	s16 p2p_noa_index;
467488dd7b5SJohannes Berg 
46817e4ec14SJouni Malinen 	/* Signal strength from the last Beacon frame in the current BSS. */
46917e4ec14SJouni Malinen 	int last_beacon_signal;
47017e4ec14SJouni Malinen 
47117e4ec14SJouni Malinen 	/*
47217e4ec14SJouni Malinen 	 * Weighted average of the signal strength from Beacon frames in the
47317e4ec14SJouni Malinen 	 * current BSS. This is in units of 1/16 of the signal unit to maintain
47417e4ec14SJouni Malinen 	 * accuracy and to speed up calculations, i.e., the value need to be
47517e4ec14SJouni Malinen 	 * divided by 16 to get the actual value.
47617e4ec14SJouni Malinen 	 */
47717e4ec14SJouni Malinen 	int ave_beacon_signal;
47817e4ec14SJouni Malinen 
47917e4ec14SJouni Malinen 	/*
480391a200aSJouni Malinen 	 * Number of Beacon frames used in ave_beacon_signal. This can be used
481391a200aSJouni Malinen 	 * to avoid generating less reliable cqm events that would be based
482391a200aSJouni Malinen 	 * only on couple of received frames.
483391a200aSJouni Malinen 	 */
484391a200aSJouni Malinen 	unsigned int count_beacon_signal;
485391a200aSJouni Malinen 
486391a200aSJouni Malinen 	/*
48717e4ec14SJouni Malinen 	 * Last Beacon frame signal strength average (ave_beacon_signal / 16)
48817e4ec14SJouni Malinen 	 * that triggered a cqm event. 0 indicates that no event has been
48917e4ec14SJouni Malinen 	 * generated for the current association.
49017e4ec14SJouni Malinen 	 */
49117e4ec14SJouni Malinen 	int last_cqm_event_signal;
492615f7b9bSMeenakshi Venkataraman 
493615f7b9bSMeenakshi Venkataraman 	/*
494615f7b9bSMeenakshi Venkataraman 	 * State variables for keeping track of RSSI of the AP currently
495615f7b9bSMeenakshi Venkataraman 	 * connected to and informing driver when RSSI has gone
496615f7b9bSMeenakshi Venkataraman 	 * below/above a certain threshold.
497615f7b9bSMeenakshi Venkataraman 	 */
498615f7b9bSMeenakshi Venkataraman 	int rssi_min_thold, rssi_max_thold;
499615f7b9bSMeenakshi Venkataraman 	int last_ave_beacon_signal;
500ef96a842SBen Greear 
501ef96a842SBen Greear 	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
502ef96a842SBen Greear 	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
503dd5ecfeaSJohannes Berg 	struct ieee80211_vht_cap vht_capa; /* configured VHT overrides */
504dd5ecfeaSJohannes Berg 	struct ieee80211_vht_cap vht_capa_mask; /* Valid parts of vht_capa */
50581dd2b88SArik Nemtsov 
50681dd2b88SArik Nemtsov 	u8 tdls_peer[ETH_ALEN] __aligned(2);
50781dd2b88SArik Nemtsov 	struct delayed_work tdls_peer_del_work;
508f0706e82SJiri Benc };
509f0706e82SJiri Benc 
51046900298SJohannes Berg struct ieee80211_if_ibss {
51146900298SJohannes Berg 	struct timer_list timer;
512cd7760e6SSimon Wunderlich 	struct work_struct csa_connection_drop_work;
51346900298SJohannes Berg 
514af8cdcd8SJohannes Berg 	unsigned long last_scan_completed;
5155bb644a0SJohannes Berg 
516fbd2c8dcSTeemu Paasikivi 	u32 basic_rates;
517fbd2c8dcSTeemu Paasikivi 
518af8cdcd8SJohannes Berg 	bool fixed_bssid;
519af8cdcd8SJohannes Berg 	bool fixed_channel;
520fffd0934SJohannes Berg 	bool privacy;
52146900298SJohannes Berg 
522267335d6SAntonio Quartulli 	bool control_port;
5238e8d347dSSimon Wunderlich 	bool userspace_handles_dfs;
524267335d6SAntonio Quartulli 
5254d196e4bSFelix Fietkau 	u8 bssid[ETH_ALEN] __aligned(2);
526af8cdcd8SJohannes Berg 	u8 ssid[IEEE80211_MAX_SSID_LEN];
527af8cdcd8SJohannes Berg 	u8 ssid_len, ie_len;
528af8cdcd8SJohannes Berg 	u8 *ie;
5293aede78aSSimon Wunderlich 	struct cfg80211_chan_def chandef;
53046900298SJohannes Berg 
53146900298SJohannes Berg 	unsigned long ibss_join_req;
532af8cdcd8SJohannes Berg 	/* probe response/beacon for IBSS */
533c3ffeab4SJohannes Berg 	struct beacon_data __rcu *presp;
53446900298SJohannes Berg 
535822854b0SSimon Wunderlich 	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
536822854b0SSimon Wunderlich 	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
537822854b0SSimon Wunderlich 
5388bf11d8dSJohannes Berg 	spinlock_t incomplete_lock;
5398bf11d8dSJohannes Berg 	struct list_head incomplete_stations;
5408bf11d8dSJohannes Berg 
54146900298SJohannes Berg 	enum {
54246900298SJohannes Berg 		IEEE80211_IBSS_MLME_SEARCH,
54346900298SJohannes Berg 		IEEE80211_IBSS_MLME_JOINED,
54446900298SJohannes Berg 	} state;
54546900298SJohannes Berg };
54646900298SJohannes Berg 
547dbf498fbSJavier Cardona /**
548dbf498fbSJavier Cardona  * struct ieee80211_mesh_sync_ops - Extensible synchronization framework interface
549dbf498fbSJavier Cardona  *
550dbf498fbSJavier Cardona  * these declarations define the interface, which enables
551dbf498fbSJavier Cardona  * vendor-specific mesh synchronization
552dbf498fbSJavier Cardona  *
553dbf498fbSJavier Cardona  */
554dbf498fbSJavier Cardona struct ieee802_11_elems;
555dbf498fbSJavier Cardona struct ieee80211_mesh_sync_ops {
556dbf498fbSJavier Cardona 	void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
557dbf498fbSJavier Cardona 			     u16 stype,
558dbf498fbSJavier Cardona 			     struct ieee80211_mgmt *mgmt,
559dbf498fbSJavier Cardona 			     struct ieee802_11_elems *elems,
560dbf498fbSJavier Cardona 			     struct ieee80211_rx_status *rx_status);
56143552be1SThomas Pedersen 
56243552be1SThomas Pedersen 	/* should be called with beacon_data under RCU read lock */
56343552be1SThomas Pedersen 	void (*adjust_tbtt)(struct ieee80211_sub_if_data *sdata,
56443552be1SThomas Pedersen 			    struct beacon_data *beacon);
565dbf498fbSJavier Cardona 	/* add other framework functions here */
566dbf498fbSJavier Cardona };
567dbf498fbSJavier Cardona 
568b8456a14SChun-Yeow Yeoh struct mesh_csa_settings {
569b8456a14SChun-Yeow Yeoh 	struct rcu_head rcu_head;
570b8456a14SChun-Yeow Yeoh 	struct cfg80211_csa_settings settings;
571b8456a14SChun-Yeow Yeoh };
572b8456a14SChun-Yeow Yeoh 
573472dbc45SJohannes Berg struct ieee80211_if_mesh {
574472dbc45SJohannes Berg 	struct timer_list housekeeping_timer;
575472dbc45SJohannes Berg 	struct timer_list mesh_path_timer;
576e304bfd3SRui Paulo 	struct timer_list mesh_path_root_timer;
577472dbc45SJohannes Berg 
57818889231SJavier Cardona 	unsigned long wrkq_flags;
579f81a9dedSThomas Pedersen 	unsigned long mbss_changed;
580472dbc45SJohannes Berg 
581472dbc45SJohannes Berg 	u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
582472dbc45SJohannes Berg 	size_t mesh_id_len;
583472dbc45SJohannes Berg 	/* Active Path Selection Protocol Identifier */
5843491707aSRui Paulo 	u8 mesh_pp_id;
585472dbc45SJohannes Berg 	/* Active Path Selection Metric Identifier */
5863491707aSRui Paulo 	u8 mesh_pm_id;
587472dbc45SJohannes Berg 	/* Congestion Control Mode Identifier */
5883491707aSRui Paulo 	u8 mesh_cc_id;
5899e03fdfdSJavier Cardona 	/* Synchronization Protocol Identifier */
5903491707aSRui Paulo 	u8 mesh_sp_id;
5919e03fdfdSJavier Cardona 	/* Authentication Protocol Identifier */
5923491707aSRui Paulo 	u8 mesh_auth_id;
593d19b3bf6SRui Paulo 	/* Local mesh Sequence Number */
594d19b3bf6SRui Paulo 	u32 sn;
595472dbc45SJohannes Berg 	/* Last used PREQ ID */
596472dbc45SJohannes Berg 	u32 preq_id;
597472dbc45SJohannes Berg 	atomic_t mpaths;
598d19b3bf6SRui Paulo 	/* Timestamp of last SN update */
599d19b3bf6SRui Paulo 	unsigned long last_sn_update;
600dca7e943SThomas Pedersen 	/* Time when it's ok to send next PERR */
601dca7e943SThomas Pedersen 	unsigned long next_perr;
602dca7e943SThomas Pedersen 	/* Timestamp of last PREQ sent */
603472dbc45SJohannes Berg 	unsigned long last_preq;
604472dbc45SJohannes Berg 	struct mesh_rmc *rmc;
605472dbc45SJohannes Berg 	spinlock_t mesh_preq_queue_lock;
606472dbc45SJohannes Berg 	struct mesh_preq_queue preq_queue;
607472dbc45SJohannes Berg 	int preq_queue_len;
608472dbc45SJohannes Berg 	struct mesh_stats mshstats;
609472dbc45SJohannes Berg 	struct mesh_config mshcfg;
6101258d976SAshok Nagarajan 	atomic_t estab_plinks;
611472dbc45SJohannes Berg 	u32 mesh_seqnum;
612472dbc45SJohannes Berg 	bool accepting_plinks;
6135ee68e5bSJavier Cardona 	int num_gates;
6142b5e1967SThomas Pedersen 	struct beacon_data __rcu *beacon;
615581a8b0fSJavier Cardona 	const u8 *ie;
616581a8b0fSJavier Cardona 	u8 ie_len;
617b130e5ceSJavier Cardona 	enum {
618b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_NONE = 0x0,
619b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_AUTHED = 0x1,
620b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_SECURED = 0x2,
621b130e5ceSJavier Cardona 	} security;
622a6dad6a2SThomas Pedersen 	bool user_mpm;
623dbf498fbSJavier Cardona 	/* Extensible Synchronization Framework */
6248ba7acf3SJohannes Berg 	const struct ieee80211_mesh_sync_ops *sync_ops;
625dbf498fbSJavier Cardona 	s64 sync_offset_clockdrift_max;
626dbf498fbSJavier Cardona 	spinlock_t sync_offset_lock;
627dbf498fbSJavier Cardona 	bool adjusting_tbtt;
6283f52b7e3SMarco Porsch 	/* mesh power save */
6293f52b7e3SMarco Porsch 	enum nl80211_mesh_power_mode nonpeer_pm;
6303f52b7e3SMarco Porsch 	int ps_peers_light_sleep;
6313f52b7e3SMarco Porsch 	int ps_peers_deep_sleep;
6323f52b7e3SMarco Porsch 	struct ps_data ps;
6338f2535b9SChun-Yeow Yeoh 	/* Channel Switching Support */
634b8456a14SChun-Yeow Yeoh 	struct mesh_csa_settings __rcu *csa;
6350cb4d4dcSLuciano Coelho 	enum {
6360cb4d4dcSLuciano Coelho 		IEEE80211_MESH_CSA_ROLE_NONE,
6370cb4d4dcSLuciano Coelho 		IEEE80211_MESH_CSA_ROLE_INIT,
6380cb4d4dcSLuciano Coelho 		IEEE80211_MESH_CSA_ROLE_REPEATER,
6390cb4d4dcSLuciano Coelho 	} csa_role;
640b8456a14SChun-Yeow Yeoh 	u8 chsw_ttl;
6418f2535b9SChun-Yeow Yeoh 	u16 pre_value;
64243552be1SThomas Pedersen 
64343552be1SThomas Pedersen 	/* offset from skb->data while building IE */
64443552be1SThomas Pedersen 	int meshconf_offset;
645472dbc45SJohannes Berg };
646902acc78SJohannes Berg 
647902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH
648472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name)	\
649472dbc45SJohannes Berg 	do { (msh)->mshstats.name++; } while (0)
650902acc78SJohannes Berg #else
651472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \
652902acc78SJohannes Berg 	do { } while (0)
653902acc78SJohannes Berg #endif
654f0706e82SJiri Benc 
655213cd118SJohannes Berg /**
656213cd118SJohannes Berg  * enum ieee80211_sub_if_data_flags - virtual interface flags
657213cd118SJohannes Berg  *
658213cd118SJohannes Berg  * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
659213cd118SJohannes Berg  * @IEEE80211_SDATA_PROMISC: interface is promisc
660213cd118SJohannes Berg  * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
661213cd118SJohannes Berg  * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
662213cd118SJohannes Berg  *	associated stations and deliver multicast frames both
663213cd118SJohannes Berg  *	back to wireless media and to the local net stack.
66495acac61SJohannes Berg  * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
6657b7eab6fSJohannes Berg  * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
666213cd118SJohannes Berg  */
667213cd118SJohannes Berg enum ieee80211_sub_if_data_flags {
668213cd118SJohannes Berg 	IEEE80211_SDATA_ALLMULTI		= BIT(0),
669213cd118SJohannes Berg 	IEEE80211_SDATA_PROMISC			= BIT(1),
6707986cf95SJohannes Berg 	IEEE80211_SDATA_OPERATING_GMODE		= BIT(2),
6717986cf95SJohannes Berg 	IEEE80211_SDATA_DONT_BRIDGE_PACKETS	= BIT(3),
67295acac61SJohannes Berg 	IEEE80211_SDATA_DISCONNECT_RESUME	= BIT(4),
6737b7eab6fSJohannes Berg 	IEEE80211_SDATA_IN_DRIVER		= BIT(5),
674213cd118SJohannes Berg };
675213cd118SJohannes Berg 
67634d4bc4dSJohannes Berg /**
67734d4bc4dSJohannes Berg  * enum ieee80211_sdata_state_bits - virtual interface state bits
67834d4bc4dSJohannes Berg  * @SDATA_STATE_RUNNING: virtual interface is up & running; this
67934d4bc4dSJohannes Berg  *	mirrors netif_running() but is separate for interface type
68034d4bc4dSJohannes Berg  *	change handling while the interface is up
6815b714c6aSJohannes Berg  * @SDATA_STATE_OFFCHANNEL: This interface is currently in offchannel
6825b714c6aSJohannes Berg  *	mode, so queues are stopped
683d6a83228SJohannes Berg  * @SDATA_STATE_OFFCHANNEL_BEACON_STOPPED: Beaconing was stopped due
684d6a83228SJohannes Berg  *	to offchannel, reset when offchannel returns
68534d4bc4dSJohannes Berg  */
68634d4bc4dSJohannes Berg enum ieee80211_sdata_state_bits {
68734d4bc4dSJohannes Berg 	SDATA_STATE_RUNNING,
6885b714c6aSJohannes Berg 	SDATA_STATE_OFFCHANNEL,
689d6a83228SJohannes Berg 	SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
69034d4bc4dSJohannes Berg };
69134d4bc4dSJohannes Berg 
692d01a1e65SMichal Kazior /**
693d01a1e65SMichal Kazior  * enum ieee80211_chanctx_mode - channel context configuration mode
694d01a1e65SMichal Kazior  *
695d01a1e65SMichal Kazior  * @IEEE80211_CHANCTX_SHARED: channel context may be used by
696d01a1e65SMichal Kazior  *	multiple interfaces
697d01a1e65SMichal Kazior  * @IEEE80211_CHANCTX_EXCLUSIVE: channel context can be used
698d01a1e65SMichal Kazior  *	only by a single interface. This can be used for example for
699d01a1e65SMichal Kazior  *	non-fixed channel IBSS.
700d01a1e65SMichal Kazior  */
701d01a1e65SMichal Kazior enum ieee80211_chanctx_mode {
702d01a1e65SMichal Kazior 	IEEE80211_CHANCTX_SHARED,
703d01a1e65SMichal Kazior 	IEEE80211_CHANCTX_EXCLUSIVE
704d01a1e65SMichal Kazior };
705d01a1e65SMichal Kazior 
7065bcae31dSMichal Kazior /**
7075bcae31dSMichal Kazior  * enum ieee80211_chanctx_replace_state - channel context replacement state
7085bcae31dSMichal Kazior  *
7095bcae31dSMichal Kazior  * This is used for channel context in-place reservations that require channel
7105bcae31dSMichal Kazior  * context switch/swap.
7115bcae31dSMichal Kazior  *
7125bcae31dSMichal Kazior  * @IEEE80211_CHANCTX_REPLACE_NONE: no replacement is taking place
7135bcae31dSMichal Kazior  * @IEEE80211_CHANCTX_WILL_BE_REPLACED: this channel context will be replaced
7145bcae31dSMichal Kazior  *	by a (not yet registered) channel context pointed by %replace_ctx.
7155bcae31dSMichal Kazior  * @IEEE80211_CHANCTX_REPLACES_OTHER: this (not yet registered) channel context
7165bcae31dSMichal Kazior  *	replaces an existing channel context pointed to by %replace_ctx.
7175bcae31dSMichal Kazior  */
7185bcae31dSMichal Kazior enum ieee80211_chanctx_replace_state {
7195bcae31dSMichal Kazior 	IEEE80211_CHANCTX_REPLACE_NONE,
7205bcae31dSMichal Kazior 	IEEE80211_CHANCTX_WILL_BE_REPLACED,
7215bcae31dSMichal Kazior 	IEEE80211_CHANCTX_REPLACES_OTHER,
7225bcae31dSMichal Kazior };
7235bcae31dSMichal Kazior 
724d01a1e65SMichal Kazior struct ieee80211_chanctx {
725d01a1e65SMichal Kazior 	struct list_head list;
726d01a1e65SMichal Kazior 	struct rcu_head rcu_head;
727d01a1e65SMichal Kazior 
728484298adSMichal Kazior 	struct list_head assigned_vifs;
729e3afb920SMichal Kazior 	struct list_head reserved_vifs;
730484298adSMichal Kazior 
7315bcae31dSMichal Kazior 	enum ieee80211_chanctx_replace_state replace_state;
7325bcae31dSMichal Kazior 	struct ieee80211_chanctx *replace_ctx;
7335bcae31dSMichal Kazior 
734d01a1e65SMichal Kazior 	enum ieee80211_chanctx_mode mode;
7358a61af65SJohannes Berg 	bool driver_present;
736d01a1e65SMichal Kazior 
737d01a1e65SMichal Kazior 	struct ieee80211_chanctx_conf conf;
738d01a1e65SMichal Kazior };
739d01a1e65SMichal Kazior 
74032db6b54SKyeyoon Park struct mac80211_qos_map {
74132db6b54SKyeyoon Park 	struct cfg80211_qos_map qos_map;
74232db6b54SKyeyoon Park 	struct rcu_head rcu_head;
74332db6b54SKyeyoon Park };
74432db6b54SKyeyoon Park 
745f0706e82SJiri Benc struct ieee80211_sub_if_data {
746f0706e82SJiri Benc 	struct list_head list;
747f0706e82SJiri Benc 
748f0706e82SJiri Benc 	struct wireless_dev wdev;
749f0706e82SJiri Benc 
75011a843b7SJohannes Berg 	/* keys */
75111a843b7SJohannes Berg 	struct list_head key_list;
75211a843b7SJohannes Berg 
7533bff1865SYogesh Ashok Powar 	/* count for keys needing tailroom space allocation */
7543bff1865SYogesh Ashok Powar 	int crypto_tx_tailroom_needed_cnt;
7558d1f7ecdSJohannes Berg 	int crypto_tx_tailroom_pending_dec;
7568d1f7ecdSJohannes Berg 	struct delayed_work dec_tailroom_needed_wk;
7573bff1865SYogesh Ashok Powar 
758f0706e82SJiri Benc 	struct net_device *dev;
759f0706e82SJiri Benc 	struct ieee80211_local *local;
760f0706e82SJiri Benc 
76113262ffdSJiri Slaby 	unsigned int flags;
7627e9ed188SDaniel Drake 
76334d4bc4dSJohannes Berg 	unsigned long state;
76434d4bc4dSJohannes Berg 
765f0706e82SJiri Benc 	int drop_unencrypted;
766f0706e82SJiri Benc 
76747846c9bSJohannes Berg 	char name[IFNAMSIZ];
76847846c9bSJohannes Berg 
769f0706e82SJiri Benc 	/* Fragment table for host-based reassembly */
770f0706e82SJiri Benc 	struct ieee80211_fragment_entry	fragments[IEEE80211_FRAGMENT_MAX];
771f0706e82SJiri Benc 	unsigned int fragment_next;
772f0706e82SJiri Benc 
773b53be792SSimon Wunderlich 	/* TID bitmap for NoAck policy */
774b53be792SSimon Wunderlich 	u16 noack_map;
775b53be792SSimon Wunderlich 
77600e96decSYoni Divinsky 	/* bit field of ACM bits (BIT(802.1D tag)) */
77700e96decSYoni Divinsky 	u8 wmm_acm;
77800e96decSYoni Divinsky 
77940b275b6SJohannes Berg 	struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
78040b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_unicast_key;
78140b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_multicast_key;
78240b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_mgmt_key;
783f0706e82SJiri Benc 
78494778280SJohannes Berg 	u16 sequence_number;
785a621fa4dSJohannes Berg 	__be16 control_port_protocol;
786a621fa4dSJohannes Berg 	bool control_port_no_encrypt;
7872475b1ccSMax Stepanov 	int encrypt_headroom;
78894778280SJohannes Berg 
78954bcbc69SJohannes Berg 	struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
79032db6b54SKyeyoon Park 	struct mac80211_qos_map __rcu *qos_map;
791f6f3def3SEliad Peller 
79273da7d5bSSimon Wunderlich 	struct work_struct csa_finalize_work;
79359af6928SMichal Kazior 	bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
79433787fc4SLuciano Coelho 	struct cfg80211_chan_def csa_chandef;
79573da7d5bSSimon Wunderlich 
796484298adSMichal Kazior 	struct list_head assigned_chanctx_list; /* protected by chanctx_mtx */
797e3afb920SMichal Kazior 	struct list_head reserved_chanctx_list; /* protected by chanctx_mtx */
798484298adSMichal Kazior 
79911335a55SLuciano Coelho 	/* context reservation -- protected with chanctx_mtx */
80011335a55SLuciano Coelho 	struct ieee80211_chanctx *reserved_chanctx;
80111335a55SLuciano Coelho 	struct cfg80211_chan_def reserved_chandef;
80209332481SMichal Kazior 	bool reserved_radar_required;
8035bcae31dSMichal Kazior 	bool reserved_ready;
80411335a55SLuciano Coelho 
80504ecd257SJohannes Berg 	/* used to reconfigure hardware SM PS */
80604ecd257SJohannes Berg 	struct work_struct recalc_smps;
80704ecd257SJohannes Berg 
80864592c8fSJohannes Berg 	struct work_struct work;
80935f20c14SJohannes Berg 	struct sk_buff_head skb_queue;
81035f20c14SJohannes Berg 
81104ecd257SJohannes Berg 	u8 needed_rx_chains;
81204ecd257SJohannes Berg 	enum ieee80211_smps_mode smps_mode;
81304ecd257SJohannes Berg 
8141ea6f9c0SJohannes Berg 	int user_power_level; /* in dBm */
8151ea6f9c0SJohannes Berg 	int ap_power_level; /* in dBm */
8161ea6f9c0SJohannes Berg 
817164eb02dSSimon Wunderlich 	bool radar_required;
818164eb02dSSimon Wunderlich 	struct delayed_work dfs_cac_timer_work;
819164eb02dSSimon Wunderlich 
8203e122be0SJohannes Berg 	/*
8213e122be0SJohannes Berg 	 * AP this belongs to: self in AP mode and
8223e122be0SJohannes Berg 	 * corresponding AP in VLAN mode, NULL for
8233e122be0SJohannes Berg 	 * all others (might be needed later in IBSS)
8243e122be0SJohannes Berg 	 */
8253e122be0SJohannes Berg 	struct ieee80211_if_ap *bss;
8263e122be0SJohannes Berg 
82737eb0b16SJouni Malinen 	/* bitmap of allowed (non-MCS) rate indexes for rate control */
82837eb0b16SJouni Malinen 	u32 rc_rateidx_mask[IEEE80211_NUM_BANDS];
8292ffbe6d3SFelix Fietkau 
8302ffbe6d3SFelix Fietkau 	bool rc_has_mcs_mask[IEEE80211_NUM_BANDS];
83119468413SSimon Wunderlich 	u8  rc_rateidx_mcs_mask[IEEE80211_NUM_BANDS][IEEE80211_HT_MCS_MASK_LEN];
832f0706e82SJiri Benc 
833f0706e82SJiri Benc 	union {
834f0706e82SJiri Benc 		struct ieee80211_if_ap ap;
835f0706e82SJiri Benc 		struct ieee80211_if_wds wds;
836f0706e82SJiri Benc 		struct ieee80211_if_vlan vlan;
83746900298SJohannes Berg 		struct ieee80211_if_managed mgd;
83846900298SJohannes Berg 		struct ieee80211_if_ibss ibss;
839472dbc45SJohannes Berg 		struct ieee80211_if_mesh mesh;
8408cc9a739SMichael Wu 		u32 mntr_flags;
841f0706e82SJiri Benc 	} u;
842e9f207f0SJiri Benc 
843e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS
844e9f207f0SJiri Benc 	struct {
845295bafb4SBen Greear 		struct dentry *subdir_stations;
846f7e0104cSJohannes Berg 		struct dentry *default_unicast_key;
847f7e0104cSJohannes Berg 		struct dentry *default_multicast_key;
8483cfcf6acSJouni Malinen 		struct dentry *default_mgmt_key;
8497bcfaf2fSJohannes Berg 	} debugfs;
850e9f207f0SJiri Benc #endif
851529ba6e9SJohannes Berg 
85232bfd35dSJohannes Berg 	/* must be last, dynamically sized area in this! */
85332bfd35dSJohannes Berg 	struct ieee80211_vif vif;
854f0706e82SJiri Benc };
855f0706e82SJiri Benc 
85632bfd35dSJohannes Berg static inline
85732bfd35dSJohannes Berg struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
85832bfd35dSJohannes Berg {
85932bfd35dSJohannes Berg 	return container_of(p, struct ieee80211_sub_if_data, vif);
86032bfd35dSJohannes Berg }
86132bfd35dSJohannes Berg 
8628d61ffa5SJohannes Berg static inline void sdata_lock(struct ieee80211_sub_if_data *sdata)
8638d61ffa5SJohannes Berg 	__acquires(&sdata->wdev.mtx)
8648d61ffa5SJohannes Berg {
8658d61ffa5SJohannes Berg 	mutex_lock(&sdata->wdev.mtx);
8668d61ffa5SJohannes Berg 	__acquire(&sdata->wdev.mtx);
8678d61ffa5SJohannes Berg }
8688d61ffa5SJohannes Berg 
8698d61ffa5SJohannes Berg static inline void sdata_unlock(struct ieee80211_sub_if_data *sdata)
8708d61ffa5SJohannes Berg 	__releases(&sdata->wdev.mtx)
8718d61ffa5SJohannes Berg {
8728d61ffa5SJohannes Berg 	mutex_unlock(&sdata->wdev.mtx);
8738d61ffa5SJohannes Berg 	__release(&sdata->wdev.mtx);
8748d61ffa5SJohannes Berg }
8758d61ffa5SJohannes Berg 
8767ca133bcSSimon Wunderlich #define sdata_dereference(p, sdata) \
8777ca133bcSSimon Wunderlich 	rcu_dereference_protected(p, lockdep_is_held(&sdata->wdev.mtx))
8787ca133bcSSimon Wunderlich 
8798d61ffa5SJohannes Berg static inline void
8808d61ffa5SJohannes Berg sdata_assert_lock(struct ieee80211_sub_if_data *sdata)
8818d61ffa5SJohannes Berg {
8828d61ffa5SJohannes Berg 	lockdep_assert_held(&sdata->wdev.mtx);
8838d61ffa5SJohannes Berg }
8848d61ffa5SJohannes Berg 
88555de908aSJohannes Berg static inline enum ieee80211_band
88655de908aSJohannes Berg ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
88755de908aSJohannes Berg {
88855de908aSJohannes Berg 	enum ieee80211_band band = IEEE80211_BAND_2GHZ;
88955de908aSJohannes Berg 	struct ieee80211_chanctx_conf *chanctx_conf;
89055de908aSJohannes Berg 
89155de908aSJohannes Berg 	rcu_read_lock();
89255de908aSJohannes Berg 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
89355de908aSJohannes Berg 	if (!WARN_ON(!chanctx_conf))
8944bf88530SJohannes Berg 		band = chanctx_conf->def.chan->band;
89555de908aSJohannes Berg 	rcu_read_unlock();
89655de908aSJohannes Berg 
89755de908aSJohannes Berg 	return band;
89855de908aSJohannes Berg }
89955de908aSJohannes Berg 
900438b61b7SSimon Wunderlich static inline int
901438b61b7SSimon Wunderlich ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef)
902438b61b7SSimon Wunderlich {
903438b61b7SSimon Wunderlich 	switch (chandef->width) {
904438b61b7SSimon Wunderlich 	case NL80211_CHAN_WIDTH_5:
905438b61b7SSimon Wunderlich 		return 2;
906438b61b7SSimon Wunderlich 	case NL80211_CHAN_WIDTH_10:
907438b61b7SSimon Wunderlich 		return 1;
908438b61b7SSimon Wunderlich 	default:
909438b61b7SSimon Wunderlich 		return 0;
910438b61b7SSimon Wunderlich 	}
911438b61b7SSimon Wunderlich }
912438b61b7SSimon Wunderlich 
913438b61b7SSimon Wunderlich static inline int
914438b61b7SSimon Wunderlich ieee80211_vif_get_shift(struct ieee80211_vif *vif)
915438b61b7SSimon Wunderlich {
916438b61b7SSimon Wunderlich 	struct ieee80211_chanctx_conf *chanctx_conf;
917438b61b7SSimon Wunderlich 	int shift = 0;
918438b61b7SSimon Wunderlich 
919438b61b7SSimon Wunderlich 	rcu_read_lock();
920438b61b7SSimon Wunderlich 	chanctx_conf = rcu_dereference(vif->chanctx_conf);
921438b61b7SSimon Wunderlich 	if (chanctx_conf)
922438b61b7SSimon Wunderlich 		shift = ieee80211_chandef_get_shift(&chanctx_conf->def);
923438b61b7SSimon Wunderlich 	rcu_read_unlock();
924438b61b7SSimon Wunderlich 
925438b61b7SSimon Wunderlich 	return shift;
926438b61b7SSimon Wunderlich }
927438b61b7SSimon Wunderlich 
928c1475ca9SJohannes Berg enum sdata_queue_type {
929c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_TYPE_FRAME	= 0,
930c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_AGG_START		= 1,
931c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_AGG_STOP		= 2,
932c1475ca9SJohannes Berg };
933c1475ca9SJohannes Berg 
934f0706e82SJiri Benc enum {
935f0706e82SJiri Benc 	IEEE80211_RX_MSG	= 1,
936f0706e82SJiri Benc 	IEEE80211_TX_STATUS_MSG	= 2,
937f0706e82SJiri Benc };
938f0706e82SJiri Benc 
939ce7c9111SKalle Valo enum queue_stop_reason {
940ce7c9111SKalle Valo 	IEEE80211_QUEUE_STOP_REASON_DRIVER,
941520eb820SKalle Valo 	IEEE80211_QUEUE_STOP_REASON_PS,
94296f5e66eSJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_CSA,
94396f5e66eSJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
94425420604SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_SUSPEND,
9458f77f384SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
9466c17b77bSSeth Forshee 	IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
947445ea4e8SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_FLUSH,
948db67d661SArik Nemtsov 	IEEE80211_QUEUE_STOP_REASON_TDLS_TEARDOWN,
949cca07b00SLuciano Coelho 
950cca07b00SLuciano Coelho 	IEEE80211_QUEUE_STOP_REASONS,
951ce7c9111SKalle Valo };
952ce7c9111SKalle Valo 
95365a6538aSLuciano Coelho #ifdef CONFIG_MAC80211_LEDS
954e1e54068SJohannes Berg struct tpt_led_trigger {
955e1e54068SJohannes Berg 	struct led_trigger trig;
956e1e54068SJohannes Berg 	char name[32];
957e1e54068SJohannes Berg 	const struct ieee80211_tpt_blink *blink_table;
958e1e54068SJohannes Berg 	unsigned int blink_table_len;
959e1e54068SJohannes Berg 	struct timer_list timer;
960e1e54068SJohannes Berg 	unsigned long prev_traffic;
961e1e54068SJohannes Berg 	unsigned long tx_bytes, rx_bytes;
96267408c8cSJohannes Berg 	unsigned int active, want;
96367408c8cSJohannes Berg 	bool running;
964e1e54068SJohannes Berg };
96565a6538aSLuciano Coelho #endif
966e1e54068SJohannes Berg 
967ad38bfc9SMatti Gottlieb /*
968ad38bfc9SMatti Gottlieb  * struct ieee80211_tx_latency_bin_ranges - Tx latency statistics bins ranges
969ad38bfc9SMatti Gottlieb  *
970ad38bfc9SMatti Gottlieb  * Measuring Tx latency statistics. Counts how many Tx frames transmitted in a
971ad38bfc9SMatti Gottlieb  * certain latency range (in Milliseconds). Each station that uses these
972ad38bfc9SMatti Gottlieb  * ranges will have bins to count the amount of frames received in that range.
973ad38bfc9SMatti Gottlieb  * The user can configure the ranges via debugfs.
974ad38bfc9SMatti Gottlieb  * If ranges is NULL then Tx latency statistics bins are disabled for all
975ad38bfc9SMatti Gottlieb  * stations.
976ad38bfc9SMatti Gottlieb  *
977ad38bfc9SMatti Gottlieb  * @n_ranges: number of ranges that are taken in account
978ad38bfc9SMatti Gottlieb  * @ranges: the ranges that the user requested or NULL if disabled.
979ad38bfc9SMatti Gottlieb  */
980ad38bfc9SMatti Gottlieb struct ieee80211_tx_latency_bin_ranges {
981ad38bfc9SMatti Gottlieb 	int n_ranges;
982ad38bfc9SMatti Gottlieb 	u32 ranges[];
983ad38bfc9SMatti Gottlieb };
984ad38bfc9SMatti Gottlieb 
985142b9f50SHelmut Schaa /**
986142b9f50SHelmut Schaa  * mac80211 scan flags - currently active scan mode
987142b9f50SHelmut Schaa  *
988142b9f50SHelmut Schaa  * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
989142b9f50SHelmut Schaa  *	well be on the operating channel
990142b9f50SHelmut Schaa  * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to
991142b9f50SHelmut Schaa  *	determine if we are on the operating channel or not
9928a690674SBen Greear  * @SCAN_ONCHANNEL_SCANNING:  Do a software scan on only the current operating
9938a690674SBen Greear  *	channel. This should not interrupt normal traffic.
9948789d459SJohannes Berg  * @SCAN_COMPLETED: Set for our scan work function when the driver reported
9958789d459SJohannes Berg  *	that the scan completed.
9968789d459SJohannes Berg  * @SCAN_ABORTED: Set for our scan work function when the driver reported
9978789d459SJohannes Berg  *	a scan complete for an aborted scan.
998a754055aSEmmanuel Grumbach  * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being
999a754055aSEmmanuel Grumbach  *	cancelled.
1000142b9f50SHelmut Schaa  */
1001fbe9c429SHelmut Schaa enum {
1002fbe9c429SHelmut Schaa 	SCAN_SW_SCANNING,
1003142b9f50SHelmut Schaa 	SCAN_HW_SCANNING,
10048a690674SBen Greear 	SCAN_ONCHANNEL_SCANNING,
10058789d459SJohannes Berg 	SCAN_COMPLETED,
10068789d459SJohannes Berg 	SCAN_ABORTED,
1007a754055aSEmmanuel Grumbach 	SCAN_HW_CANCELLED,
1008142b9f50SHelmut Schaa };
1009142b9f50SHelmut Schaa 
1010142b9f50SHelmut Schaa /**
1011142b9f50SHelmut Schaa  * enum mac80211_scan_state - scan state machine states
1012142b9f50SHelmut Schaa  *
1013142b9f50SHelmut Schaa  * @SCAN_DECISION: Main entry point to the scan state machine, this state
1014142b9f50SHelmut Schaa  *	determines if we should keep on scanning or switch back to the
1015142b9f50SHelmut Schaa  *	operating channel
1016142b9f50SHelmut Schaa  * @SCAN_SET_CHANNEL: Set the next channel to be scanned
1017142b9f50SHelmut Schaa  * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
101807ef03eeSJohannes Berg  * @SCAN_SUSPEND: Suspend the scan and go back to operating channel to
101907ef03eeSJohannes Berg  *	send out data
102007ef03eeSJohannes Berg  * @SCAN_RESUME: Resume the scan and scan the next channel
1021cd2bb512SSam Leffler  * @SCAN_ABORT: Abort the scan and go back to operating channel
1022142b9f50SHelmut Schaa  */
1023142b9f50SHelmut Schaa enum mac80211_scan_state {
1024142b9f50SHelmut Schaa 	SCAN_DECISION,
1025142b9f50SHelmut Schaa 	SCAN_SET_CHANNEL,
1026142b9f50SHelmut Schaa 	SCAN_SEND_PROBE,
102707ef03eeSJohannes Berg 	SCAN_SUSPEND,
102807ef03eeSJohannes Berg 	SCAN_RESUME,
1029cd2bb512SSam Leffler 	SCAN_ABORT,
1030fbe9c429SHelmut Schaa };
1031fbe9c429SHelmut Schaa 
1032f0706e82SJiri Benc struct ieee80211_local {
1033f0706e82SJiri Benc 	/* embed the driver visible part.
1034f0706e82SJiri Benc 	 * don't cast (use the static inlines below), but we keep
1035f0706e82SJiri Benc 	 * it first anyway so they become a no-op */
1036f0706e82SJiri Benc 	struct ieee80211_hw hw;
1037f0706e82SJiri Benc 
1038f0706e82SJiri Benc 	const struct ieee80211_ops *ops;
1039f0706e82SJiri Benc 
104042935ecaSLuis R. Rodriguez 	/*
104142935ecaSLuis R. Rodriguez 	 * private workqueue to mac80211. mac80211 makes this accessible
104242935ecaSLuis R. Rodriguez 	 * via ieee80211_queue_work()
104342935ecaSLuis R. Rodriguez 	 */
104442935ecaSLuis R. Rodriguez 	struct workqueue_struct *workqueue;
104542935ecaSLuis R. Rodriguez 
1046e4e72fb4SJohannes Berg 	unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
1047cca07b00SLuciano Coelho 	int q_stop_reasons[IEEE80211_MAX_QUEUES][IEEE80211_QUEUE_STOP_REASONS];
104896f5e66eSJohannes Berg 	/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
1049ce7c9111SKalle Valo 	spinlock_t queue_stop_reason_lock;
105096f5e66eSJohannes Berg 
1051f0706e82SJiri Benc 	int open_count;
10523d30d949SMichael Wu 	int monitors, cooked_mntrs;
10538cc9a739SMichael Wu 	/* number of interfaces with corresponding FIF_ flags */
10547be5086dSJohannes Berg 	int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
10557be5086dSJohannes Berg 	    fif_probe_req;
10567be5086dSJohannes Berg 	int probe_req_reg;
10574150c572SJohannes Berg 	unsigned int filter_flags; /* FIF_* */
10583b8d81e0SJohannes Berg 
10593ffc2a90SJohannes Berg 	bool wiphy_ciphers_allocated;
10603ffc2a90SJohannes Berg 
1061fe57d9f5SJohannes Berg 	bool use_chanctx;
1062fe57d9f5SJohannes Berg 
10633b8d81e0SJohannes Berg 	/* protects the aggregated multicast list and filter calls */
10643b8d81e0SJohannes Berg 	spinlock_t filter_lock;
10653b8d81e0SJohannes Berg 
10663ac64beeSJohannes Berg 	/* used for uploading changed mc list */
10673ac64beeSJohannes Berg 	struct work_struct reconfig_filter;
10683ac64beeSJohannes Berg 
10693b8d81e0SJohannes Berg 	/* aggregated multicast list */
107022bedad3SJiri Pirko 	struct netdev_hw_addr_list mc_list;
10713b8d81e0SJohannes Berg 
1072d0709a65SJohannes Berg 	bool tim_in_locked_section; /* see ieee80211_beacon_get() */
10735bb644a0SJohannes Berg 
10745bb644a0SJohannes Berg 	/*
10755bb644a0SJohannes Berg 	 * suspended is true if we finished all the suspend _and_ we have
10765bb644a0SJohannes Berg 	 * not yet come up from resume. This is to be used by mac80211
10775bb644a0SJohannes Berg 	 * to ensure driver sanity during suspend and mac80211's own
10785bb644a0SJohannes Berg 	 * sanity. It can eventually be used for WoW as well.
10795bb644a0SJohannes Berg 	 */
10805bb644a0SJohannes Berg 	bool suspended;
10815bb644a0SJohannes Berg 
10825bb644a0SJohannes Berg 	/*
1083ceb99fe0SJohannes Berg 	 * Resuming is true while suspended, but when we're reprogramming the
1084ceb99fe0SJohannes Berg 	 * hardware -- at that time it's allowed to use ieee80211_queue_work()
1085ceb99fe0SJohannes Berg 	 * again even though some other parts of the stack are still suspended
1086ceb99fe0SJohannes Berg 	 * and we still drop received frames to avoid waking the stack.
1087ceb99fe0SJohannes Berg 	 */
1088ceb99fe0SJohannes Berg 	bool resuming;
1089ceb99fe0SJohannes Berg 
1090ceb99fe0SJohannes Berg 	/*
10915bb644a0SJohannes Berg 	 * quiescing is true during the suspend process _only_ to
10925bb644a0SJohannes Berg 	 * ease timer cancelling etc.
10935bb644a0SJohannes Berg 	 */
10945bb644a0SJohannes Berg 	bool quiescing;
10955bb644a0SJohannes Berg 
1096ea77f12fSJohannes Berg 	/* device is started */
1097ea77f12fSJohannes Berg 	bool started;
1098ea77f12fSJohannes Berg 
109904800adaSArik Nemtsov 	/* device is during a HW reconfig */
110004800adaSArik Nemtsov 	bool in_reconfig;
110104800adaSArik Nemtsov 
1102eecc4800SJohannes Berg 	/* wowlan is enabled -- don't reconfig on resume */
1103eecc4800SJohannes Berg 	bool wowlan;
1104eecc4800SJohannes Berg 
1105164eb02dSSimon Wunderlich 	/* DFS/radar detection is enabled */
1106164eb02dSSimon Wunderlich 	bool radar_detect_enabled;
1107164eb02dSSimon Wunderlich 	struct work_struct radar_detected_work;
1108164eb02dSSimon Wunderlich 
110904ecd257SJohannes Berg 	/* number of RX chains the hardware has */
111004ecd257SJohannes Berg 	u8 rx_chains;
111104ecd257SJohannes Berg 
1112b306f453SJohannes Berg 	int tx_headroom; /* required headroom for hardware/radiotap */
1113f0706e82SJiri Benc 
1114f0706e82SJiri Benc 	/* Tasklet and skb queue to process calls from IRQ mode. All frames
1115f0706e82SJiri Benc 	 * added to skb_queue will be processed, but frames in
1116f0706e82SJiri Benc 	 * skb_queue_unreliable may be dropped if the total length of these
1117f0706e82SJiri Benc 	 * queues increases over the limit. */
1118f0706e82SJiri Benc #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128
1119f0706e82SJiri Benc 	struct tasklet_struct tasklet;
1120f0706e82SJiri Benc 	struct sk_buff_head skb_queue;
1121f0706e82SJiri Benc 	struct sk_buff_head skb_queue_unreliable;
1122f0706e82SJiri Benc 
1123f9e124fbSChristian Lamparter 	spinlock_t rx_path_lock;
112424a8fdadSChristian Lamparter 
1125d0709a65SJohannes Berg 	/* Station data */
1126d0709a65SJohannes Berg 	/*
11274d33960bSJohannes Berg 	 * The mutex only protects the list, hash table and
11284d33960bSJohannes Berg 	 * counter, reads are done with RCU.
1129d0709a65SJohannes Berg 	 */
113034e89507SJohannes Berg 	struct mutex sta_mtx;
11314d33960bSJohannes Berg 	spinlock_t tim_lock;
1132d0709a65SJohannes Berg 	unsigned long num_sta;
11334d33960bSJohannes Berg 	struct list_head sta_list;
113440b275b6SJohannes Berg 	struct sta_info __rcu *sta_hash[STA_HASH_SIZE];
1135f0706e82SJiri Benc 	struct timer_list sta_cleanup;
1136f5ea9120SJohannes Berg 	int sta_generation;
1137f0706e82SJiri Benc 
1138ad38bfc9SMatti Gottlieb 	/*
1139ad38bfc9SMatti Gottlieb 	 * Tx latency statistics parameters for all stations.
1140ad38bfc9SMatti Gottlieb 	 * Can enable via debugfs (NULL when disabled).
1141ad38bfc9SMatti Gottlieb 	 */
1142ad38bfc9SMatti Gottlieb 	struct ieee80211_tx_latency_bin_ranges __rcu *tx_latency;
1143ad38bfc9SMatti Gottlieb 
11442a577d98SJohannes Berg 	struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
1145f0706e82SJiri Benc 	struct tasklet_struct tx_pending_tasklet;
1146f0706e82SJiri Benc 
1147a6a67db2SJohannes Berg 	atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
1148cd8ffc80SJohannes Berg 
1149f0706e82SJiri Benc 	/* number of interfaces with corresponding IFF_ flags */
115053918994SJohannes Berg 	atomic_t iff_allmultis, iff_promiscs;
1151f0706e82SJiri Benc 
1152f0706e82SJiri Benc 	struct rate_control_ref *rate_ctrl;
1153f0706e82SJiri Benc 
11545f9f1812SFelix Fietkau 	struct crypto_cipher *wep_tx_tfm;
11555f9f1812SFelix Fietkau 	struct crypto_cipher *wep_rx_tfm;
1156f0706e82SJiri Benc 	u32 wep_iv;
1157f0706e82SJiri Benc 
1158c771c9d8SJohannes Berg 	/* see iface.c */
115979010420SJohannes Berg 	struct list_head interfaces;
1160c771c9d8SJohannes Berg 	struct mutex iflist_mtx;
116179010420SJohannes Berg 
1162b16bd15cSJohannes Berg 	/*
1163ad0e2b5aSJohannes Berg 	 * Key mutex, protects sdata's key_list and sta_info's
1164b16bd15cSJohannes Berg 	 * key pointers (write access, they're RCU.)
1165b16bd15cSJohannes Berg 	 */
1166ad0e2b5aSJohannes Berg 	struct mutex key_mtx;
1167b16bd15cSJohannes Berg 
1168a1699b75SJohannes Berg 	/* mutex for scan and work locking */
1169a1699b75SJohannes Berg 	struct mutex mtx;
1170b16bd15cSJohannes Berg 
1171c2b13452SJohannes Berg 	/* Scanning and BSS list */
1172fbe9c429SHelmut Schaa 	unsigned long scanning;
11732a519311SJohannes Berg 	struct cfg80211_ssid scan_ssid;
11745ba63533SJohannes Berg 	struct cfg80211_scan_request *int_scan_req;
1175c56ef672SDavid Spinadel 	struct cfg80211_scan_request *scan_req;
1176c56ef672SDavid Spinadel 	struct ieee80211_scan_request *hw_scan_req;
11777ca15a0aSSimon Wunderlich 	struct cfg80211_chan_def scan_chandef;
11784d36ec58SJohannes Berg 	enum ieee80211_band hw_scan_band;
1179f0706e82SJiri Benc 	int scan_channel_idx;
1180de95a54bSJohannes Berg 	int scan_ies_len;
1181c604b9f2SJohannes Berg 	int hw_scan_ies_bufsize;
11828318d78aSJohannes Berg 
118385a9994aSLuciano Coelho 	struct work_struct sched_scan_stopped_work;
11845260a5b2SJohannes Berg 	struct ieee80211_sub_if_data __rcu *sched_scan_sdata;
1185d43c6b6eSDavid Spinadel 	struct cfg80211_sched_scan_request *sched_scan_req;
118679f460caSLuciano Coelho 
1187df13cce5SHelmut Schaa 	unsigned long leave_oper_channel_time;
1188977923b0SHelmut Schaa 	enum mac80211_scan_state next_scan_state;
1189f0706e82SJiri Benc 	struct delayed_work scan_work;
1190e2fd5dbcSJohannes Berg 	struct ieee80211_sub_if_data __rcu *scan_sdata;
119155de908aSJohannes Berg 	/* For backward compatibility only -- do not use */
1192675a0b04SKarl Beldan 	struct cfg80211_chan_def _oper_chandef;
1193f0706e82SJiri Benc 
1194b8bc4b0aSJohannes Berg 	/* Temporary remain-on-channel for off-channel operations */
1195b8bc4b0aSJohannes Berg 	struct ieee80211_channel *tmp_channel;
1196b8bc4b0aSJohannes Berg 
1197d01a1e65SMichal Kazior 	/* channel contexts */
1198d01a1e65SMichal Kazior 	struct list_head chanctx_list;
1199d01a1e65SMichal Kazior 	struct mutex chanctx_mtx;
1200d01a1e65SMichal Kazior 
1201f0706e82SJiri Benc 	/* SNMP counters */
1202f0706e82SJiri Benc 	/* dot11CountersTable */
1203f0706e82SJiri Benc 	u32 dot11TransmittedFragmentCount;
1204f0706e82SJiri Benc 	u32 dot11MulticastTransmittedFrameCount;
1205f0706e82SJiri Benc 	u32 dot11FailedCount;
1206f0706e82SJiri Benc 	u32 dot11RetryCount;
1207f0706e82SJiri Benc 	u32 dot11MultipleRetryCount;
1208f0706e82SJiri Benc 	u32 dot11FrameDuplicateCount;
1209f0706e82SJiri Benc 	u32 dot11ReceivedFragmentCount;
1210f0706e82SJiri Benc 	u32 dot11MulticastReceivedFrameCount;
1211f0706e82SJiri Benc 	u32 dot11TransmittedFrameCount;
1212f0706e82SJiri Benc 
1213f0706e82SJiri Benc #ifdef CONFIG_MAC80211_LEDS
1214cdcb006fSIvo van Doorn 	struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
1215e1e54068SJohannes Berg 	struct tpt_led_trigger *tpt_led_trigger;
1216cdcb006fSIvo van Doorn 	char tx_led_name[32], rx_led_name[32],
1217cdcb006fSIvo van Doorn 	     assoc_led_name[32], radio_led_name[32];
1218f0706e82SJiri Benc #endif
1219f0706e82SJiri Benc 
1220f0706e82SJiri Benc #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
1221f0706e82SJiri Benc 	/* TX/RX handler statistics */
1222f0706e82SJiri Benc 	unsigned int tx_handlers_drop;
1223f0706e82SJiri Benc 	unsigned int tx_handlers_queued;
1224f0706e82SJiri Benc 	unsigned int tx_handlers_drop_unencrypted;
1225f0706e82SJiri Benc 	unsigned int tx_handlers_drop_fragment;
1226f0706e82SJiri Benc 	unsigned int tx_handlers_drop_wep;
1227f0706e82SJiri Benc 	unsigned int tx_handlers_drop_not_assoc;
1228f0706e82SJiri Benc 	unsigned int tx_handlers_drop_unauth_port;
1229f0706e82SJiri Benc 	unsigned int rx_handlers_drop;
1230f0706e82SJiri Benc 	unsigned int rx_handlers_queued;
1231f0706e82SJiri Benc 	unsigned int rx_handlers_drop_nullfunc;
1232f0706e82SJiri Benc 	unsigned int rx_handlers_drop_defrag;
1233f0706e82SJiri Benc 	unsigned int rx_handlers_drop_short;
1234f0706e82SJiri Benc 	unsigned int tx_expand_skb_head;
1235f0706e82SJiri Benc 	unsigned int tx_expand_skb_head_cloned;
1236f0706e82SJiri Benc 	unsigned int rx_expand_skb_head;
1237f0706e82SJiri Benc 	unsigned int rx_expand_skb_head2;
1238f0706e82SJiri Benc 	unsigned int rx_handlers_fragments;
1239f0706e82SJiri Benc 	unsigned int tx_status_drop;
1240f0706e82SJiri Benc #define I802_DEBUG_INC(c) (c)++
1241f0706e82SJiri Benc #else /* CONFIG_MAC80211_DEBUG_COUNTERS */
1242f0706e82SJiri Benc #define I802_DEBUG_INC(c) do { } while (0)
1243f0706e82SJiri Benc #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
1244f0706e82SJiri Benc 
1245f0706e82SJiri Benc 
1246f0706e82SJiri Benc 	int total_ps_buffered; /* total number of all buffered unicast and
1247f0706e82SJiri Benc 				* multicast packets for power saving stations
1248f0706e82SJiri Benc 				*/
1249520eb820SKalle Valo 
1250572e0012SKalle Valo 	bool pspolling;
1251b203ffc3SJouni Malinen 	bool offchannel_ps_enabled;
1252965bedadSJohannes Berg 	/*
1253965bedadSJohannes Berg 	 * PS can only be enabled when we have exactly one managed
1254965bedadSJohannes Berg 	 * interface (and monitors) in PS, this then points there.
1255965bedadSJohannes Berg 	 */
1256965bedadSJohannes Berg 	struct ieee80211_sub_if_data *ps_sdata;
1257520eb820SKalle Valo 	struct work_struct dynamic_ps_enable_work;
1258520eb820SKalle Valo 	struct work_struct dynamic_ps_disable_work;
1259520eb820SKalle Valo 	struct timer_list dynamic_ps_timer;
126010f644a4SJohannes Berg 	struct notifier_block network_latency_notifier;
12612b2c009eSJuuso Oikarinen 	struct notifier_block ifa_notifier;
1262a65240c1SJohannes Berg 	struct notifier_block ifa6_notifier;
1263f0706e82SJiri Benc 
1264ff616381SJuuso Oikarinen 	/*
1265ff616381SJuuso Oikarinen 	 * The dynamic ps timeout configured from user space via WEXT -
1266ff616381SJuuso Oikarinen 	 * this will override whatever chosen by mac80211 internally.
1267ff616381SJuuso Oikarinen 	 */
1268ff616381SJuuso Oikarinen 	int dynamic_ps_forced_timeout;
1269ff616381SJuuso Oikarinen 
12701ea6f9c0SJohannes Berg 	int user_power_level; /* in dBm, for all interfaces */
12712bf30fabSJohannes Berg 
12720f78231bSJohannes Berg 	enum ieee80211_smps_mode smps_mode;
12730f78231bSJohannes Berg 
1274f2753ddbSJohannes Berg 	struct work_struct restart_work;
1275f2753ddbSJohannes Berg 
1276e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS
1277e9f207f0SJiri Benc 	struct local_debugfsdentries {
12784b7679a5SJohannes Berg 		struct dentry *rcdir;
1279e9f207f0SJiri Benc 		struct dentry *keys;
1280e9f207f0SJiri Benc 	} debugfs;
1281e9f207f0SJiri Benc #endif
12824e6cbfd0SJohn W. Linville 
12832eb278e0SJohannes Berg 	/*
12842eb278e0SJohannes Berg 	 * Remain-on-channel support
12852eb278e0SJohannes Berg 	 */
12862eb278e0SJohannes Berg 	struct list_head roc_list;
128721f83589SJohannes Berg 	struct work_struct hw_roc_start, hw_roc_done;
12882eb278e0SJohannes Berg 	unsigned long hw_roc_start_time;
128950febf6aSJohannes Berg 	u64 roc_cookie_counter;
129021f83589SJohannes Berg 
1291a729cff8SJohannes Berg 	struct idr ack_status_frames;
1292a729cff8SJohannes Berg 	spinlock_t ack_status_lock;
1293a729cff8SJohannes Berg 
1294f142c6b9SJohannes Berg 	struct ieee80211_sub_if_data __rcu *p2p_sdata;
1295f142c6b9SJohannes Berg 
129606d181a8SJohannes Berg 	struct napi_struct *napi;
129706d181a8SJohannes Berg 
12984b6f1dd6SJohannes Berg 	/* virtual monitor interface */
12994b6f1dd6SJohannes Berg 	struct ieee80211_sub_if_data __rcu *monitor_sdata;
13004bf88530SJohannes Berg 	struct cfg80211_chan_def monitor_chandef;
1301f0706e82SJiri Benc };
1302f0706e82SJiri Benc 
13033e122be0SJohannes Berg static inline struct ieee80211_sub_if_data *
13043e122be0SJohannes Berg IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
13053e122be0SJohannes Berg {
13063e122be0SJohannes Berg 	return netdev_priv(dev);
13073e122be0SJohannes Berg }
13083e122be0SJohannes Berg 
130971bbc994SJohannes Berg static inline struct ieee80211_sub_if_data *
131071bbc994SJohannes Berg IEEE80211_WDEV_TO_SUB_IF(struct wireless_dev *wdev)
131171bbc994SJohannes Berg {
131271bbc994SJohannes Berg 	return container_of(wdev, struct ieee80211_sub_if_data, wdev);
131371bbc994SJohannes Berg }
131471bbc994SJohannes Berg 
1315c1475ca9SJohannes Berg /* this struct represents 802.11n's RA/TID combination */
1316eadc8d9eSRon Rindjunsky struct ieee80211_ra_tid {
1317eadc8d9eSRon Rindjunsky 	u8 ra[ETH_ALEN];
1318eadc8d9eSRon Rindjunsky 	u16 tid;
1319eadc8d9eSRon Rindjunsky };
1320eadc8d9eSRon Rindjunsky 
1321c0f17eb9SChun-Yeow Yeoh /* this struct holds the value parsing from channel switch IE  */
1322c0f17eb9SChun-Yeow Yeoh struct ieee80211_csa_ie {
1323c0f17eb9SChun-Yeow Yeoh 	struct cfg80211_chan_def chandef;
1324c0f17eb9SChun-Yeow Yeoh 	u8 mode;
1325c0f17eb9SChun-Yeow Yeoh 	u8 count;
1326c0f17eb9SChun-Yeow Yeoh 	u8 ttl;
13273f718fd8SChun-Yeow Yeoh 	u16 pre_value;
1328c0f17eb9SChun-Yeow Yeoh };
1329c0f17eb9SChun-Yeow Yeoh 
1330dd76986bSJohannes Berg /* Parsed Information Elements */
1331dd76986bSJohannes Berg struct ieee802_11_elems {
13324a3cb702SJohannes Berg 	const u8 *ie_start;
1333dd76986bSJohannes Berg 	size_t total_len;
1334dd76986bSJohannes Berg 
1335dd76986bSJohannes Berg 	/* pointers to IEs */
13364a3cb702SJohannes Berg 	const u8 *ssid;
13374a3cb702SJohannes Berg 	const u8 *supp_rates;
13384a3cb702SJohannes Berg 	const u8 *ds_params;
13394a3cb702SJohannes Berg 	const struct ieee80211_tim_ie *tim;
13404a3cb702SJohannes Berg 	const u8 *challenge;
13414a3cb702SJohannes Berg 	const u8 *rsn;
13424a3cb702SJohannes Berg 	const u8 *erp_info;
13434a3cb702SJohannes Berg 	const u8 *ext_supp_rates;
13444a3cb702SJohannes Berg 	const u8 *wmm_info;
13454a3cb702SJohannes Berg 	const u8 *wmm_param;
13464a3cb702SJohannes Berg 	const struct ieee80211_ht_cap *ht_cap_elem;
13474a3cb702SJohannes Berg 	const struct ieee80211_ht_operation *ht_operation;
13484a3cb702SJohannes Berg 	const struct ieee80211_vht_cap *vht_cap_elem;
13494a3cb702SJohannes Berg 	const struct ieee80211_vht_operation *vht_operation;
13504a3cb702SJohannes Berg 	const struct ieee80211_meshconf_ie *mesh_config;
13514a3cb702SJohannes Berg 	const u8 *mesh_id;
13524a3cb702SJohannes Berg 	const u8 *peering;
13534a3cb702SJohannes Berg 	const __le16 *awake_window;
13544a3cb702SJohannes Berg 	const u8 *preq;
13554a3cb702SJohannes Berg 	const u8 *prep;
13564a3cb702SJohannes Berg 	const u8 *perr;
13574a3cb702SJohannes Berg 	const struct ieee80211_rann_ie *rann;
13584a3cb702SJohannes Berg 	const struct ieee80211_channel_sw_ie *ch_switch_ie;
1359b4f286a1SJohannes Berg 	const struct ieee80211_ext_chansw_ie *ext_chansw_ie;
1360b2e506bfSJohannes Berg 	const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie;
13614a3cb702SJohannes Berg 	const u8 *country_elem;
13624a3cb702SJohannes Berg 	const u8 *pwr_constr_elem;
136379ba1d89SJohannes Berg 	const struct ieee80211_timeout_interval_ie *timeout_int;
13644a3cb702SJohannes Berg 	const u8 *opmode_notif;
136585220d71SJohannes Berg 	const struct ieee80211_sec_chan_offs_ie *sec_chan_offs;
13668f2535b9SChun-Yeow Yeoh 	const struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie;
1367dd76986bSJohannes Berg 
1368dd76986bSJohannes Berg 	/* length of them, respectively */
1369dd76986bSJohannes Berg 	u8 ssid_len;
1370dd76986bSJohannes Berg 	u8 supp_rates_len;
1371dd76986bSJohannes Berg 	u8 tim_len;
1372dd76986bSJohannes Berg 	u8 challenge_len;
1373dd76986bSJohannes Berg 	u8 rsn_len;
1374dd76986bSJohannes Berg 	u8 ext_supp_rates_len;
1375dd76986bSJohannes Berg 	u8 wmm_info_len;
1376dd76986bSJohannes Berg 	u8 wmm_param_len;
1377dd76986bSJohannes Berg 	u8 mesh_id_len;
1378dd76986bSJohannes Berg 	u8 peering_len;
1379dd76986bSJohannes Berg 	u8 preq_len;
1380dd76986bSJohannes Berg 	u8 prep_len;
1381dd76986bSJohannes Berg 	u8 perr_len;
1382dd76986bSJohannes Berg 	u8 country_elem_len;
1383fcff4f10SPaul Stewart 
1384fcff4f10SPaul Stewart 	/* whether a parse error occurred while retrieving these elements */
1385fcff4f10SPaul Stewart 	bool parse_error;
1386dd76986bSJohannes Berg };
1387dd76986bSJohannes Berg 
1388f0706e82SJiri Benc static inline struct ieee80211_local *hw_to_local(
1389f0706e82SJiri Benc 	struct ieee80211_hw *hw)
1390f0706e82SJiri Benc {
1391f0706e82SJiri Benc 	return container_of(hw, struct ieee80211_local, hw);
1392f0706e82SJiri Benc }
1393f0706e82SJiri Benc 
1394f0706e82SJiri Benc 
1395571ecf67SJohannes Berg static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
1396571ecf67SJohannes Berg {
1397b203ca39SJoe Perches 	return ether_addr_equal(raddr, addr) ||
1398571ecf67SJohannes Berg 	       is_broadcast_ether_addr(raddr);
1399571ecf67SJohannes Berg }
1400571ecf67SJohannes Berg 
1401f4bda337SThomas Pedersen static inline bool
1402f4bda337SThomas Pedersen ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
1403f4bda337SThomas Pedersen {
1404f4bda337SThomas Pedersen 	WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
1405f4bda337SThomas Pedersen 		     status->flag & RX_FLAG_MACTIME_END);
1406f4bda337SThomas Pedersen 	return status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END);
1407f4bda337SThomas Pedersen }
1408571ecf67SJohannes Berg 
1409f4bda337SThomas Pedersen u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
1410f4bda337SThomas Pedersen 				     struct ieee80211_rx_status *status,
1411f4bda337SThomas Pedersen 				     unsigned int mpdu_len,
1412f4bda337SThomas Pedersen 				     unsigned int mpdu_offset);
1413e8975581SJohannes Berg int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
14145cf121c3SJohannes Berg void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
14159c6bd790SJohannes Berg void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
14169c6bd790SJohannes Berg 				      u32 changed);
14170d143fe1SJohannes Berg void ieee80211_configure_filter(struct ieee80211_local *local);
141846900298SJohannes Berg u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
1419f0706e82SJiri Benc 
142046900298SJohannes Berg /* STA code */
14219c6bd790SJohannes Berg void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
142277fdaa12SJohannes Berg int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
142377fdaa12SJohannes Berg 		       struct cfg80211_auth_request *req);
142477fdaa12SJohannes Berg int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
142577fdaa12SJohannes Berg 			struct cfg80211_assoc_request *req);
142677fdaa12SJohannes Berg int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
142763c9c5e7SJohannes Berg 			 struct cfg80211_deauth_request *req);
142877fdaa12SJohannes Berg int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
142963c9c5e7SJohannes Berg 			   struct cfg80211_disassoc_request *req);
1430572e0012SKalle Valo void ieee80211_send_pspoll(struct ieee80211_local *local,
1431572e0012SKalle Valo 			   struct ieee80211_sub_if_data *sdata);
143210f644a4SJohannes Berg void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
1433ab095877SEliad Peller void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
143410f644a4SJohannes Berg int ieee80211_max_network_latency(struct notifier_block *nb,
143510f644a4SJohannes Berg 				  unsigned long data, void *dummy);
14362b2c009eSJuuso Oikarinen int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
14371fa57d01SJohannes Berg void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
14381fa57d01SJohannes Berg void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
14391fa57d01SJohannes Berg 				  struct sk_buff *skb);
1440d3a910a8SLuis R. Rodriguez void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
1441be099e82SLuis R. Rodriguez void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
1442afa762f6SEliad Peller void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
14431672c0e3SJohannes Berg void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
14441672c0e3SJohannes Berg 				  __le16 fc, bool acked);
14451a1cb744SJohannes Berg void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata);
1446b8360ab8SJohannes Berg void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
14479c6bd790SJohannes Berg 
144846900298SJohannes Berg /* IBSS code */
144946900298SJohannes Berg void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
145046900298SJohannes Berg void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
14518bf11d8dSJohannes Berg void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
14528bf11d8dSJohannes Berg 			      const u8 *bssid, const u8 *addr, u32 supp_rates);
1453af8cdcd8SJohannes Berg int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
1454af8cdcd8SJohannes Berg 			struct cfg80211_ibss_params *params);
1455af8cdcd8SJohannes Berg int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
14561fa57d01SJohannes Berg void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
14571fa57d01SJohannes Berg void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
14581fa57d01SJohannes Berg 				   struct sk_buff *skb);
1459cd7760e6SSimon Wunderlich int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
1460cd7760e6SSimon Wunderlich 			      struct cfg80211_csa_settings *csa_settings);
1461cd7760e6SSimon Wunderlich int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata);
1462cd7760e6SSimon Wunderlich void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata);
14631fa57d01SJohannes Berg 
14641fa57d01SJohannes Berg /* mesh code */
14651fa57d01SJohannes Berg void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
14661fa57d01SJohannes Berg void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
14671fa57d01SJohannes Berg 				   struct sk_buff *skb);
1468b8456a14SChun-Yeow Yeoh int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
146966e01cf9SLuciano Coelho 			      struct cfg80211_csa_settings *csa_settings);
1470b8456a14SChun-Yeow Yeoh int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata);
147146900298SJohannes Berg 
14729c6bd790SJohannes Berg /* scan/BSS handling */
147346900298SJohannes Berg void ieee80211_scan_work(struct work_struct *work);
147434bcf715SStanislaw Gruszka int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
1475be4a4b6aSJohannes Berg 				const u8 *ssid, u8 ssid_len,
14767ca15a0aSSimon Wunderlich 				struct ieee80211_channel *chan,
14777ca15a0aSSimon Wunderlich 				enum nl80211_bss_scan_width scan_width);
1478c2b13452SJohannes Berg int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
14792a519311SJohannes Berg 			   struct cfg80211_scan_request *req);
14805bb644a0SJohannes Berg void ieee80211_scan_cancel(struct ieee80211_local *local);
1481133d40f9SStanislaw Gruszka void ieee80211_run_deferred_scan(struct ieee80211_local *local);
1482d48b2968SJohannes Berg void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb);
14839c6bd790SJohannes Berg 
14840a51b27eSJohannes Berg void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local);
1485c2b13452SJohannes Berg struct ieee80211_bss *
148698c8fccfSJohannes Berg ieee80211_bss_info_update(struct ieee80211_local *local,
148798c8fccfSJohannes Berg 			  struct ieee80211_rx_status *rx_status,
148898c8fccfSJohannes Berg 			  struct ieee80211_mgmt *mgmt,
148998c8fccfSJohannes Berg 			  size_t len,
149098c8fccfSJohannes Berg 			  struct ieee802_11_elems *elems,
1491d45c4172SEmmanuel Grumbach 			  struct ieee80211_channel *channel);
149298c8fccfSJohannes Berg void ieee80211_rx_bss_put(struct ieee80211_local *local,
1493c2b13452SJohannes Berg 			  struct ieee80211_bss *bss);
1494ee385855SLuis Carlos Cobo 
149579f460caSLuciano Coelho /* scheduled scan handling */
1496d43c6b6eSDavid Spinadel int
1497d43c6b6eSDavid Spinadel __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
1498d43c6b6eSDavid Spinadel 				     struct cfg80211_sched_scan_request *req);
149979f460caSLuciano Coelho int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
150079f460caSLuciano Coelho 				       struct cfg80211_sched_scan_request *req);
150185a9994aSLuciano Coelho int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
1502f6837ba8SJohannes Berg void ieee80211_sched_scan_end(struct ieee80211_local *local);
150385a9994aSLuciano Coelho void ieee80211_sched_scan_stopped_work(struct work_struct *work);
150479f460caSLuciano Coelho 
1505b203ffc3SJouni Malinen /* off-channel helpers */
1506aacde9eeSStanislaw Gruszka void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
1507aacde9eeSStanislaw Gruszka void ieee80211_offchannel_return(struct ieee80211_local *local);
15082eb278e0SJohannes Berg void ieee80211_roc_setup(struct ieee80211_local *local);
15092eb278e0SJohannes Berg void ieee80211_start_next_roc(struct ieee80211_local *local);
1510c8f994eeSJohannes Berg void ieee80211_roc_purge(struct ieee80211_local *local,
1511c8f994eeSJohannes Berg 			 struct ieee80211_sub_if_data *sdata);
15123fbd45caSJohannes Berg void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free);
15132eb278e0SJohannes Berg void ieee80211_sw_roc_work(struct work_struct *work);
15142eb278e0SJohannes Berg void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc);
1515b203ffc3SJouni Malinen 
151673da7d5bSSimon Wunderlich /* channel switch handling */
151773da7d5bSSimon Wunderlich void ieee80211_csa_finalize_work(struct work_struct *work);
151882a8e17dSLuciano Coelho int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
151982a8e17dSLuciano Coelho 			     struct cfg80211_csa_settings *params);
152073da7d5bSSimon Wunderlich 
15213e122be0SJohannes Berg /* interface handling */
152247846c9bSJohannes Berg int ieee80211_iface_init(void);
152347846c9bSJohannes Berg void ieee80211_iface_exit(void);
15243e122be0SJohannes Berg int ieee80211_if_add(struct ieee80211_local *local, const char *name,
152584efbb84SJohannes Berg 		     struct wireless_dev **new_wdev, enum nl80211_iftype type,
1526ee385855SLuis Carlos Cobo 		     struct vif_params *params);
1527f3947e2dSJohannes Berg int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
152805c914feSJohannes Berg 			     enum nl80211_iftype type);
1529f698d856SJasper Bryant-Greene void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
153075636525SJohannes Berg void ieee80211_remove_interfaces(struct ieee80211_local *local);
1531382a103bSJohannes Berg u32 ieee80211_idle_off(struct ieee80211_local *local);
15325cff20e6SJohannes Berg void ieee80211_recalc_idle(struct ieee80211_local *local);
153385416a4fSChristian Lamparter void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
153485416a4fSChristian Lamparter 				    const int offset);
1535f142c6b9SJohannes Berg int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up);
1536f142c6b9SJohannes Berg void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata);
15373c3e21e7SJohannes Berg int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
15383c3e21e7SJohannes Berg void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
1539f0706e82SJiri Benc 
15401ea6f9c0SJohannes Berg bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
15411ea6f9c0SJohannes Berg void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
15421ea6f9c0SJohannes Berg 
15439607e6b6SJohannes Berg static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
15449607e6b6SJohannes Berg {
154534d4bc4dSJohannes Berg 	return test_bit(SDATA_STATE_RUNNING, &sdata->state);
15469607e6b6SJohannes Berg }
15479607e6b6SJohannes Berg 
1548e2ebc74dSJohannes Berg /* tx handling */
1549e2ebc74dSJohannes Berg void ieee80211_clear_tx_pending(struct ieee80211_local *local);
1550e2ebc74dSJohannes Berg void ieee80211_tx_pending(unsigned long data);
1551d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1552d0cf9c0dSStephen Hemminger 					 struct net_device *dev);
1553d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1554d0cf9c0dSStephen Hemminger 				       struct net_device *dev);
15551f98ab7fSFelix Fietkau void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
15561f98ab7fSFelix Fietkau 			      struct sk_buff_head *skbs);
1557e2ebc74dSJohannes Berg 
1558de1ede7aSJohannes Berg /* HT */
1559ef96a842SBen Greear void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
1560ef96a842SBen Greear 				     struct ieee80211_sta_ht_cap *ht_cap);
1561e1a0c6b3SJohannes Berg bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
1562ef96a842SBen Greear 				       struct ieee80211_supported_band *sband,
15634a3cb702SJohannes Berg 				       const struct ieee80211_ht_cap *ht_cap_ie,
1564e1a0c6b3SJohannes Berg 				       struct sta_info *sta);
1565b8695a8fSJohannes Berg void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
1566b8695a8fSJohannes Berg 			  const u8 *da, u16 tid,
1567b8695a8fSJohannes Berg 			  u16 initiator, u16 reason_code);
15680f78231bSJohannes Berg int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
15690f78231bSJohannes Berg 			       enum ieee80211_smps_mode smps, const u8 *da,
15700f78231bSJohannes Berg 			       const u8 *bssid);
1571687da132SEmmanuel Grumbach void ieee80211_request_smps_ap_work(struct work_struct *work);
1572687da132SEmmanuel Grumbach void ieee80211_request_smps_mgd_work(struct work_struct *work);
1573687da132SEmmanuel Grumbach bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
1574687da132SEmmanuel Grumbach 				   enum ieee80211_smps_mode smps_mode_new);
1575de1ede7aSJohannes Berg 
15767c3b1dd8SJohannes Berg void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
157753f73c09SJohannes Berg 				     u16 initiator, u16 reason, bool stop);
1578849b7967SJohannes Berg void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
157953f73c09SJohannes Berg 				    u16 initiator, u16 reason, bool stop);
1580c82c4a80SJohannes Berg void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
1581c82c4a80SJohannes Berg 					 enum ieee80211_agg_stop_reason reason);
1582de1ede7aSJohannes Berg void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
1583de1ede7aSJohannes Berg 			     struct sta_info *sta,
1584de1ede7aSJohannes Berg 			     struct ieee80211_mgmt *mgmt, size_t len);
1585de1ede7aSJohannes Berg void ieee80211_process_addba_resp(struct ieee80211_local *local,
1586de1ede7aSJohannes Berg 				  struct sta_info *sta,
1587de1ede7aSJohannes Berg 				  struct ieee80211_mgmt *mgmt,
1588de1ede7aSJohannes Berg 				  size_t len);
1589de1ede7aSJohannes Berg void ieee80211_process_addba_request(struct ieee80211_local *local,
1590de1ede7aSJohannes Berg 				     struct sta_info *sta,
1591de1ede7aSJohannes Berg 				     struct ieee80211_mgmt *mgmt,
1592de1ede7aSJohannes Berg 				     size_t len);
1593de1ede7aSJohannes Berg 
1594849b7967SJohannes Berg int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1595c82c4a80SJohannes Berg 				   enum ieee80211_agg_stop_reason reason);
159667c282c0SJohannes Berg int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1597c82c4a80SJohannes Berg 				    enum ieee80211_agg_stop_reason reason);
15985d22c89bSJohannes Berg void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
15995d22c89bSJohannes Berg void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
160067c282c0SJohannes Berg void ieee80211_ba_session_work(struct work_struct *work);
160167c282c0SJohannes Berg void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
16022bff8ebfSChristian Lamparter void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
1603849b7967SJohannes Berg 
160404ecd257SJohannes Berg u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
160504ecd257SJohannes Berg 
1606818255eaSMahesh Palivela /* VHT */
16074a3cb702SJohannes Berg void
16084a3cb702SJohannes Berg ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
1609818255eaSMahesh Palivela 				    struct ieee80211_supported_band *sband,
16104a3cb702SJohannes Berg 				    const struct ieee80211_vht_cap *vht_cap_ie,
16114a34215eSJohannes Berg 				    struct sta_info *sta);
1612e1a0c6b3SJohannes Berg enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
16138921d04eSJohannes Berg void ieee80211_sta_set_rx_nss(struct sta_info *sta);
1614b1bce14aSMarek Kwaczynski u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
1615b1bce14aSMarek Kwaczynski                                   struct sta_info *sta, u8 opmode,
1616b1bce14aSMarek Kwaczynski                                   enum ieee80211_band band, bool nss_only);
16170af83d3dSJohannes Berg void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
16180af83d3dSJohannes Berg 				 struct sta_info *sta, u8 opmode,
1619bee7f586SJohannes Berg 				 enum ieee80211_band band, bool nss_only);
1620dd5ecfeaSJohannes Berg void ieee80211_apply_vhtcap_overrides(struct ieee80211_sub_if_data *sdata,
1621dd5ecfeaSJohannes Berg 				      struct ieee80211_sta_vht_cap *vht_cap);
16224a34215eSJohannes Berg 
162339192c0bSJohannes Berg /* Spectrum management */
162439192c0bSJohannes Berg void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
162539192c0bSJohannes Berg 				       struct ieee80211_mgmt *mgmt,
162639192c0bSJohannes Berg 				       size_t len);
1627e6b7cde4SSimon Wunderlich /**
1628e6b7cde4SSimon Wunderlich  * ieee80211_parse_ch_switch_ie - parses channel switch IEs
1629e6b7cde4SSimon Wunderlich  * @sdata: the sdata of the interface which has received the frame
1630e6b7cde4SSimon Wunderlich  * @elems: parsed 802.11 elements received with the frame
1631e6b7cde4SSimon Wunderlich  * @beacon: indicates if the frame was a beacon or probe response
1632e6b7cde4SSimon Wunderlich  * @current_band: indicates the current band
1633e6b7cde4SSimon Wunderlich  * @sta_flags: contains information about own capabilities and restrictions
1634e6b7cde4SSimon Wunderlich  *	to decide which channel switch announcements can be accepted. Only the
1635e6b7cde4SSimon Wunderlich  *	following subset of &enum ieee80211_sta_flags are evaluated:
1636e6b7cde4SSimon Wunderlich  *	%IEEE80211_STA_DISABLE_HT, %IEEE80211_STA_DISABLE_VHT,
1637e6b7cde4SSimon Wunderlich  *	%IEEE80211_STA_DISABLE_40MHZ, %IEEE80211_STA_DISABLE_80P80MHZ,
1638e6b7cde4SSimon Wunderlich  *	%IEEE80211_STA_DISABLE_160MHZ.
1639e6b7cde4SSimon Wunderlich  * @bssid: the currently connected bssid (for reporting)
1640c0f17eb9SChun-Yeow Yeoh  * @csa_ie: parsed 802.11 csa elements on count, mode, chandef and mesh ttl.
1641c0f17eb9SChun-Yeow Yeoh 	All of them will be filled with if success only.
1642e6b7cde4SSimon Wunderlich  * Return: 0 on success, <0 on error and >0 if there is nothing to parse.
1643e6b7cde4SSimon Wunderlich  */
1644e6b7cde4SSimon Wunderlich int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
1645e6b7cde4SSimon Wunderlich 				 struct ieee802_11_elems *elems, bool beacon,
1646e6b7cde4SSimon Wunderlich 				 enum ieee80211_band current_band,
1647c0f17eb9SChun-Yeow Yeoh 				 u32 sta_flags, u8 *bssid,
1648c0f17eb9SChun-Yeow Yeoh 				 struct ieee80211_csa_ie *csa_ie);
164939192c0bSJohannes Berg 
1650f2753ddbSJohannes Berg /* Suspend/resume and hw reconfiguration */
1651f2753ddbSJohannes Berg int ieee80211_reconfig(struct ieee80211_local *local);
165284f6a01cSJohannes Berg void ieee80211_stop_device(struct ieee80211_local *local);
1653f2753ddbSJohannes Berg 
1654eecc4800SJohannes Berg int __ieee80211_suspend(struct ieee80211_hw *hw,
1655eecc4800SJohannes Berg 			struct cfg80211_wowlan *wowlan);
1656f2753ddbSJohannes Berg 
1657f2753ddbSJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw)
1658f2753ddbSJohannes Berg {
165985f72bc8SJohn W. Linville 	struct ieee80211_local *local = hw_to_local(hw);
166085f72bc8SJohn W. Linville 
166185f72bc8SJohn W. Linville 	WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
166285f72bc8SJohn W. Linville 		"%s: resume with hardware scan still in progress\n",
166385f72bc8SJohn W. Linville 		wiphy_name(hw->wiphy));
166485f72bc8SJohn W. Linville 
1665f2753ddbSJohannes Berg 	return ieee80211_reconfig(hw_to_local(hw));
1666f2753ddbSJohannes Berg }
1667665af4fcSBob Copeland 
1668c2d1560aSJohannes Berg /* utility functions/constants */
16698a47cea7SJohannes Berg extern const void *const mac80211_wiphy_privid; /* for wiphy privid */
167071364716SRon Rindjunsky u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
167105c914feSJohannes Berg 			enum nl80211_iftype type);
16724ee73f33SMichal Kazior int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
1673438b61b7SSimon Wunderlich 			     int rate, int erp, int short_preamble,
1674438b61b7SSimon Wunderlich 			     int shift);
1675f698d856SJasper Bryant-Greene void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
1676e6d6e342SJohannes Berg 				     struct ieee80211_hdr *hdr, const u8 *tsc,
1677e6d6e342SJohannes Berg 				     gfp_t gfp);
16783abead59SJohannes Berg void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
16793abead59SJohannes Berg 			       bool bss_notify);
168055de908aSJohannes Berg void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
168155de908aSJohannes Berg 		    enum ieee80211_band band);
1682cf6bb79aSHelmut Schaa 
168355de908aSJohannes Berg void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
168455de908aSJohannes Berg 				 struct sk_buff *skb, int tid,
168555de908aSJohannes Berg 				 enum ieee80211_band band);
168655de908aSJohannes Berg 
168755de908aSJohannes Berg static inline void
168855de908aSJohannes Berg ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
168955de908aSJohannes Berg 			  struct sk_buff *skb, int tid,
169055de908aSJohannes Berg 			  enum ieee80211_band band)
169155de908aSJohannes Berg {
169255de908aSJohannes Berg 	rcu_read_lock();
169355de908aSJohannes Berg 	__ieee80211_tx_skb_tid_band(sdata, skb, tid, band);
169455de908aSJohannes Berg 	rcu_read_unlock();
169555de908aSJohannes Berg }
169655de908aSJohannes Berg 
169755de908aSJohannes Berg static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
169855de908aSJohannes Berg 					struct sk_buff *skb, int tid)
169955de908aSJohannes Berg {
170055de908aSJohannes Berg 	struct ieee80211_chanctx_conf *chanctx_conf;
170155de908aSJohannes Berg 
170255de908aSJohannes Berg 	rcu_read_lock();
170355de908aSJohannes Berg 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
170455de908aSJohannes Berg 	if (WARN_ON(!chanctx_conf)) {
170555de908aSJohannes Berg 		rcu_read_unlock();
170655de908aSJohannes Berg 		kfree_skb(skb);
170755de908aSJohannes Berg 		return;
170855de908aSJohannes Berg 	}
170955de908aSJohannes Berg 
171055de908aSJohannes Berg 	__ieee80211_tx_skb_tid_band(sdata, skb, tid,
17114bf88530SJohannes Berg 				    chanctx_conf->def.chan->band);
171255de908aSJohannes Berg 	rcu_read_unlock();
171355de908aSJohannes Berg }
171455de908aSJohannes Berg 
171555de908aSJohannes Berg static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
1716cf6bb79aSHelmut Schaa 				    struct sk_buff *skb)
1717cf6bb79aSHelmut Schaa {
1718cf6bb79aSHelmut Schaa 	/* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
1719cf6bb79aSHelmut Schaa 	ieee80211_tx_skb_tid(sdata, skb, 7);
1720cf6bb79aSHelmut Schaa }
1721cf6bb79aSHelmut Schaa 
172235d865afSJohannes Berg u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
1723d91f36dbSJohannes Berg 			       struct ieee802_11_elems *elems,
1724d91f36dbSJohannes Berg 			       u64 filter, u32 crc);
172535d865afSJohannes Berg static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
172635d865afSJohannes Berg 					  bool action,
1727ddc4db2eSJohannes Berg 					  struct ieee802_11_elems *elems)
1728ddc4db2eSJohannes Berg {
1729b2e506bfSJohannes Berg 	ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0);
1730ddc4db2eSJohannes Berg }
1731ddc4db2eSJohannes Berg 
173283eb935eSMichal Kazior static inline bool ieee80211_rx_reorder_ready(struct sk_buff_head *frames)
173383eb935eSMichal Kazior {
173483eb935eSMichal Kazior 	struct sk_buff *tail = skb_peek_tail(frames);
173583eb935eSMichal Kazior 	struct ieee80211_rx_status *status;
173683eb935eSMichal Kazior 
173783eb935eSMichal Kazior 	if (!tail)
173883eb935eSMichal Kazior 		return false;
173983eb935eSMichal Kazior 
174083eb935eSMichal Kazior 	status = IEEE80211_SKB_RXCB(tail);
174183eb935eSMichal Kazior 	if (status->flag & RX_FLAG_AMSDU_MORE)
174283eb935eSMichal Kazior 		return false;
174383eb935eSMichal Kazior 
174483eb935eSMichal Kazior 	return true;
174583eb935eSMichal Kazior }
174683eb935eSMichal Kazior 
1747520eb820SKalle Valo void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
1748520eb820SKalle Valo void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
1749520eb820SKalle Valo void ieee80211_dynamic_ps_timer(unsigned long data);
1750a97b77b9SVivek Natarajan void ieee80211_send_nullfunc(struct ieee80211_local *local,
1751a97b77b9SVivek Natarajan 			     struct ieee80211_sub_if_data *sdata,
1752a97b77b9SVivek Natarajan 			     int powersave);
17533cf335d5SKalle Valo void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
17543cf335d5SKalle Valo 			     struct ieee80211_hdr *hdr);
17554e5ff376SFelix Fietkau void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
175604ac3c0eSFelix Fietkau 			     struct ieee80211_hdr *hdr, bool ack);
1757520eb820SKalle Valo 
1758ce7c9111SKalle Valo void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
1759445ea4e8SJohannes Berg 				     unsigned long queues,
1760cca07b00SLuciano Coelho 				     enum queue_stop_reason reason,
1761cca07b00SLuciano Coelho 				     bool refcounted);
176226da23b6SLuciano Coelho void ieee80211_stop_vif_queues(struct ieee80211_local *local,
176326da23b6SLuciano Coelho 			       struct ieee80211_sub_if_data *sdata,
176426da23b6SLuciano Coelho 			       enum queue_stop_reason reason);
176526da23b6SLuciano Coelho void ieee80211_wake_vif_queues(struct ieee80211_local *local,
176626da23b6SLuciano Coelho 			       struct ieee80211_sub_if_data *sdata,
176726da23b6SLuciano Coelho 			       enum queue_stop_reason reason);
1768ce7c9111SKalle Valo void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
1769445ea4e8SJohannes Berg 				     unsigned long queues,
1770cca07b00SLuciano Coelho 				     enum queue_stop_reason reason,
1771cca07b00SLuciano Coelho 				     bool refcounted);
177296f5e66eSJohannes Berg void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
1773cca07b00SLuciano Coelho 				    enum queue_stop_reason reason,
1774cca07b00SLuciano Coelho 				    bool refcounted);
177596f5e66eSJohannes Berg void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
1776cca07b00SLuciano Coelho 				    enum queue_stop_reason reason,
1777cca07b00SLuciano Coelho 				    bool refcounted);
17783a25a8c8SJohannes Berg void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
17798f77f384SJohannes Berg void ieee80211_add_pending_skb(struct ieee80211_local *local,
17808f77f384SJohannes Berg 			       struct sk_buff *skb);
1781e3685e03SJohannes Berg void ieee80211_add_pending_skbs(struct ieee80211_local *local,
1782e3685e03SJohannes Berg 				struct sk_buff_head *skbs);
178339ecc01dSJohannes Berg void ieee80211_flush_queues(struct ieee80211_local *local,
178439ecc01dSJohannes Berg 			    struct ieee80211_sub_if_data *sdata);
1785ce7c9111SKalle Valo 
178646900298SJohannes Berg void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1787700e8ea6SJouni Malinen 			 u16 transaction, u16 auth_alg, u16 status,
17884a3cb702SJohannes Berg 			 const u8 *extra, size_t extra_len, const u8 *bssid,
17891672c0e3SJohannes Berg 			 const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
17901672c0e3SJohannes Berg 			 u32 tx_flags);
17916ae16775SAntonio Quartulli void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
17926ae16775SAntonio Quartulli 				    const u8 *bssid, u16 stype, u16 reason,
17936ae16775SAntonio Quartulli 				    bool send_frame, u8 *frame_buf);
1794de95a54bSJohannes Berg int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1795c56ef672SDavid Spinadel 			     size_t buffer_len,
1796c56ef672SDavid Spinadel 			     struct ieee80211_scan_ies *ie_desc,
1797c56ef672SDavid Spinadel 			     const u8 *ie, size_t ie_len,
1798c56ef672SDavid Spinadel 			     u8 bands_used, u32 *rate_masks,
17992103dec1SSimon Wunderlich 			     struct cfg80211_chan_def *chandef);
1800a619a4c0SJuuso Oikarinen struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
180185a237feSJohannes Berg 					  u8 *dst, u32 ratemask,
18026b77863bSJohannes Berg 					  struct ieee80211_channel *chan,
1803a619a4c0SJuuso Oikarinen 					  const u8 *ssid, size_t ssid_len,
1804a806c558SPaul Stewart 					  const u8 *ie, size_t ie_len,
1805a806c558SPaul Stewart 					  bool directed);
180646900298SJohannes Berg void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1807de95a54bSJohannes Berg 			      const u8 *ssid, size_t ssid_len,
1808a806c558SPaul Stewart 			      const u8 *ie, size_t ie_len,
18091672c0e3SJohannes Berg 			      u32 ratemask, bool directed, u32 tx_flags,
181055de908aSJohannes Berg 			      struct ieee80211_channel *channel, bool scan);
181146900298SJohannes Berg 
18122103dec1SSimon Wunderlich u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata,
181346900298SJohannes Berg 			    struct ieee802_11_elems *elems,
18149ebb61a2SAshok Nagarajan 			    enum ieee80211_band band, u32 *basic_rates);
1815687da132SEmmanuel Grumbach int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata,
1816687da132SEmmanuel Grumbach 				 enum ieee80211_smps_mode smps_mode);
1817687da132SEmmanuel Grumbach int __ieee80211_request_smps_ap(struct ieee80211_sub_if_data *sdata,
18180f78231bSJohannes Berg 				enum ieee80211_smps_mode smps_mode);
181904ecd257SJohannes Berg void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata);
182021f659bfSEliad Peller void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata);
182146900298SJohannes Berg 
18228e664fb3SJohannes Berg size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
18238e664fb3SJohannes Berg 			  const u8 *ids, int n_ids, size_t offset);
18248e664fb3SJohannes Berg size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
1825ef96a842SBen Greear u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
182642e7aa77SAlexander Simon 			      u16 cap);
1827074d46d1SJohannes Berg u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
18284bf88530SJohannes Berg 			       const struct cfg80211_chan_def *chandef,
1829431e3154SAshok Nagarajan 			       u16 prot_mode);
1830ba0afa2fSMahesh Palivela u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
1831ba0afa2fSMahesh Palivela 			       u32 cap);
18322103dec1SSimon Wunderlich int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
18332103dec1SSimon Wunderlich 			     const struct ieee80211_supported_band *sband,
18342103dec1SSimon Wunderlich 			     const u8 *srates, int srates_len, u32 *rates);
1835fc8a7321SJohannes Berg int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
18366b77863bSJohannes Berg 			    struct sk_buff *skb, bool need_basic,
18376b77863bSJohannes Berg 			    enum ieee80211_band band);
1838fc8a7321SJohannes Berg int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
18396b77863bSJohannes Berg 				struct sk_buff *skb, bool need_basic,
18406b77863bSJohannes Berg 				enum ieee80211_band band);
184140b861a0SArik Nemtsov u8 *ieee80211_add_wmm_info_ie(u8 *buf, u8 qosinfo);
18428e664fb3SJohannes Berg 
1843f444de05SJohannes Berg /* channel management */
18444bf88530SJohannes Berg void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan,
18454a3cb702SJohannes Berg 				  const struct ieee80211_ht_operation *ht_oper,
18464bf88530SJohannes Berg 				  struct cfg80211_chan_def *chandef);
1847e6b7cde4SSimon Wunderlich u32 ieee80211_chandef_downgrade(struct cfg80211_chan_def *c);
1848f444de05SJohannes Berg 
1849d01a1e65SMichal Kazior int __must_check
1850d01a1e65SMichal Kazior ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
18514bf88530SJohannes Berg 			  const struct cfg80211_chan_def *chandef,
1852d01a1e65SMichal Kazior 			  enum ieee80211_chanctx_mode mode);
18532c9b7359SJohannes Berg int __must_check
185411335a55SLuciano Coelho ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
185511335a55SLuciano Coelho 			      const struct cfg80211_chan_def *chandef,
185609332481SMichal Kazior 			      enum ieee80211_chanctx_mode mode,
185709332481SMichal Kazior 			      bool radar_required);
185811335a55SLuciano Coelho int __must_check
18595bcae31dSMichal Kazior ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata);
186011335a55SLuciano Coelho int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata);
18615bcae31dSMichal Kazior int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local);
186211335a55SLuciano Coelho 
186311335a55SLuciano Coelho int __must_check
18642c9b7359SJohannes Berg ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
18652c9b7359SJohannes Berg 			       const struct cfg80211_chan_def *chandef,
18662c9b7359SJohannes Berg 			       u32 *changed);
1867d01a1e65SMichal Kazior void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
18684d76d21bSJohannes Berg void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
18691f4ac5a6SJohannes Berg void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
18701f4ac5a6SJohannes Berg 					 bool clear);
1871c0166da9SMichal Kazior int ieee80211_chanctx_refcount(struct ieee80211_local *local,
1872c0166da9SMichal Kazior 			       struct ieee80211_chanctx *ctx);
1873d01a1e65SMichal Kazior 
187404ecd257SJohannes Berg void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
187504ecd257SJohannes Berg 				   struct ieee80211_chanctx *chanctx);
187621f659bfSEliad Peller void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
187721f659bfSEliad Peller 				      struct ieee80211_chanctx *ctx);
1878164eb02dSSimon Wunderlich 
1879164eb02dSSimon Wunderlich void ieee80211_dfs_cac_timer(unsigned long data);
1880164eb02dSSimon Wunderlich void ieee80211_dfs_cac_timer_work(struct work_struct *work);
1881164eb02dSSimon Wunderlich void ieee80211_dfs_cac_cancel(struct ieee80211_local *local);
1882164eb02dSSimon Wunderlich void ieee80211_dfs_radar_detected_work(struct work_struct *work);
1883c6da674aSChun-Yeow Yeoh int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
1884c6da674aSChun-Yeow Yeoh 			      struct cfg80211_csa_settings *csa_settings);
188504ecd257SJohannes Berg 
18862475b1ccSMax Stepanov bool ieee80211_cs_valid(const struct ieee80211_cipher_scheme *cs);
18872475b1ccSMax Stepanov bool ieee80211_cs_list_valid(const struct ieee80211_cipher_scheme *cs, int n);
18882475b1ccSMax Stepanov const struct ieee80211_cipher_scheme *
18892475b1ccSMax Stepanov ieee80211_cs_get(struct ieee80211_local *local, u32 cipher,
18902475b1ccSMax Stepanov 		 enum nl80211_iftype iftype);
18912475b1ccSMax Stepanov int ieee80211_cs_headroom(struct ieee80211_local *local,
18922475b1ccSMax Stepanov 			  struct cfg80211_crypto_settings *crypto,
18932475b1ccSMax Stepanov 			  enum nl80211_iftype iftype);
1894057d5f4bSThomas Pedersen void ieee80211_recalc_dtim(struct ieee80211_local *local,
1895057d5f4bSThomas Pedersen 			   struct ieee80211_sub_if_data *sdata);
189673de86a3SLuciano Coelho int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
189773de86a3SLuciano Coelho 				 const struct cfg80211_chan_def *chandef,
189873de86a3SLuciano Coelho 				 enum ieee80211_chanctx_mode chanmode,
189973de86a3SLuciano Coelho 				 u8 radar_detect);
19006fa001bcSMichal Kazior int ieee80211_max_num_channels(struct ieee80211_local *local);
19012475b1ccSMax Stepanov 
190295224fe8SArik Nemtsov /* TDLS */
190395224fe8SArik Nemtsov int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
19043b3a0162SJohannes Berg 			const u8 *peer, u8 action_code, u8 dialog_token,
190595224fe8SArik Nemtsov 			u16 status_code, u32 peer_capability,
190631fa97c5SArik Nemtsov 			bool initiator, const u8 *extra_ies,
190731fa97c5SArik Nemtsov 			size_t extra_ies_len);
190895224fe8SArik Nemtsov int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
19093b3a0162SJohannes Berg 			const u8 *peer, enum nl80211_tdls_operation oper);
191095224fe8SArik Nemtsov 
191195224fe8SArik Nemtsov 
1912b7ffbd7eSJohannes Berg extern const struct ethtool_ops ieee80211_ethtool_ops;
1913b7ffbd7eSJohannes Berg 
1914f4ea83ddSJohannes Berg #ifdef CONFIG_MAC80211_NOINLINE
1915d9e8a70fSJohannes Berg #define debug_noinline noinline
1916d9e8a70fSJohannes Berg #else
1917d9e8a70fSJohannes Berg #define debug_noinline
1918d9e8a70fSJohannes Berg #endif
1919d9e8a70fSJohannes Berg 
1920f0706e82SJiri Benc #endif /* IEEE80211_I_H */
192117e6a59aSArik Nemtsov void ieee80211_tdls_peer_del_work(struct work_struct *wk);
1922