xref: /openbmc/linux/net/mac80211/ieee80211_i.h (revision 67baf663)
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 
5612d3952fSFelix Fietkau #define TU_TO_JIFFIES(x)	(usecs_to_jiffies((x) * 1024))
5712d3952fSFelix Fietkau #define TU_TO_EXP_TIME(x)	(jiffies + TU_TO_JIFFIES(x))
5820ad19d0SJohannes Berg 
591ea6f9c0SJohannes Berg /* power level hasn't been configured (or set to automatic) */
601ea6f9c0SJohannes Berg #define IEEE80211_UNSET_POWER_LEVEL	INT_MIN
611ea6f9c0SJohannes Berg 
62d6a4ed6fSArik Nemtsov /*
63d6a4ed6fSArik Nemtsov  * Some APs experience problems when working with U-APSD. Decrease the
64d6a4ed6fSArik Nemtsov  * probability of that happening by using legacy mode for all ACs but VO.
65d6a4ed6fSArik Nemtsov  * The AP that caused us trouble was a Cisco 4410N. It ignores our
66d6a4ed6fSArik Nemtsov  * setting, and always treats non-VO ACs as legacy.
67d6a4ed6fSArik Nemtsov  */
68ab13315aSKalle Valo #define IEEE80211_DEFAULT_UAPSD_QUEUES \
69d6a4ed6fSArik Nemtsov 	IEEE80211_WMM_IE_STA_QOSINFO_AC_VO
70ab13315aSKalle Valo 
71ab13315aSKalle Valo #define IEEE80211_DEFAULT_MAX_SP_LEN		\
72ab13315aSKalle Valo 	IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
73ab13315aSKalle Valo 
746ae16775SAntonio Quartulli #define IEEE80211_DEAUTH_FRAME_LEN	(24 /* hdr */ + 2 /* reason */)
756ae16775SAntonio Quartulli 
76f0706e82SJiri Benc struct ieee80211_fragment_entry {
77f0706e82SJiri Benc 	unsigned long first_frag_time;
78f0706e82SJiri Benc 	unsigned int seq;
79f0706e82SJiri Benc 	unsigned int rx_queue;
80f0706e82SJiri Benc 	unsigned int last_frag;
81f0706e82SJiri Benc 	unsigned int extra_len;
82f0706e82SJiri Benc 	struct sk_buff_head skb_list;
83f0706e82SJiri Benc 	int ccmp; /* Whether fragments were encrypted with CCMP */
84f0706e82SJiri Benc 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
85f0706e82SJiri Benc };
86f0706e82SJiri Benc 
87f0706e82SJiri Benc 
88c2b13452SJohannes Berg struct ieee80211_bss {
89ef429dadSJohannes Berg 	u32 device_ts_beacon, device_ts_presp;
908c358bcdSJohannes Berg 
9143ac2ca3SJouni Malinen 	bool wmm_used;
92ab13315aSKalle Valo 	bool uapsd_supported;
9300d3f14cSJohannes Berg 
94f0706e82SJiri Benc #define IEEE80211_MAX_SUPP_RATES 32
95f0706e82SJiri Benc 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
96f0706e82SJiri Benc 	size_t supp_rates_len;
97f0706e82SJiri Benc 
9800d3f14cSJohannes Berg 	/*
9925985edcSLucas De Marchi 	 * During association, we save an ERP value from a probe response so
1005628221cSDaniel Drake 	 * that we can feed ERP info to the driver when handling the
1015628221cSDaniel Drake 	 * association completes. these fields probably won't be up-to-date
10200d3f14cSJohannes Berg 	 * otherwise, you probably don't want to use them.
10300d3f14cSJohannes Berg 	 */
10400d3f14cSJohannes Berg 	bool has_erp_value;
1055628221cSDaniel Drake 	u8 erp_value;
106fcff4f10SPaul Stewart 
107fcff4f10SPaul Stewart 	/* Keep track of the corruption of the last beacon/probe response. */
108fcff4f10SPaul Stewart 	u8 corrupt_data;
109fcff4f10SPaul Stewart 
110fcff4f10SPaul Stewart 	/* Keep track of what bits of information we have valid info for. */
111fcff4f10SPaul Stewart 	u8 valid_data;
112fcff4f10SPaul Stewart };
113fcff4f10SPaul Stewart 
114fcff4f10SPaul Stewart /**
115fcff4f10SPaul Stewart  * enum ieee80211_corrupt_data_flags - BSS data corruption flags
116fcff4f10SPaul Stewart  * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
117fcff4f10SPaul Stewart  * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
118fcff4f10SPaul Stewart  *
119fcff4f10SPaul Stewart  * These are bss flags that are attached to a bss in the
120fcff4f10SPaul Stewart  * @corrupt_data field of &struct ieee80211_bss.
121fcff4f10SPaul Stewart  */
122fcff4f10SPaul Stewart enum ieee80211_bss_corrupt_data_flags {
123fcff4f10SPaul Stewart 	IEEE80211_BSS_CORRUPT_BEACON		= BIT(0),
124fcff4f10SPaul Stewart 	IEEE80211_BSS_CORRUPT_PROBE_RESP	= BIT(1)
125fcff4f10SPaul Stewart };
126fcff4f10SPaul Stewart 
127fcff4f10SPaul Stewart /**
128fcff4f10SPaul Stewart  * enum ieee80211_valid_data_flags - BSS valid data flags
129fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
130fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
131fcff4f10SPaul Stewart  * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
132fcff4f10SPaul Stewart  *
133fcff4f10SPaul Stewart  * These are bss flags that are attached to a bss in the
134fcff4f10SPaul Stewart  * @valid_data field of &struct ieee80211_bss.  They show which parts
135fcff4f10SPaul Stewart  * of the data structure were recieved as a result of an un-corrupted
136fcff4f10SPaul Stewart  * beacon/probe response.
137fcff4f10SPaul Stewart  */
138fcff4f10SPaul Stewart enum ieee80211_bss_valid_data_flags {
139fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_WMM			= BIT(1),
140fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_RATES		= BIT(2),
141fcff4f10SPaul Stewart 	IEEE80211_BSS_VALID_ERP			= BIT(3)
142f0706e82SJiri Benc };
143f0706e82SJiri Benc 
1449ae54c84SJohannes Berg typedef unsigned __bitwise__ ieee80211_tx_result;
1459ae54c84SJohannes Berg #define TX_CONTINUE	((__force ieee80211_tx_result) 0u)
1469ae54c84SJohannes Berg #define TX_DROP		((__force ieee80211_tx_result) 1u)
1479ae54c84SJohannes Berg #define TX_QUEUED	((__force ieee80211_tx_result) 2u)
1489ae54c84SJohannes Berg 
1495cf121c3SJohannes Berg #define IEEE80211_TX_UNICAST		BIT(1)
1505cf121c3SJohannes Berg #define IEEE80211_TX_PS_BUFFERED	BIT(2)
1519ae54c84SJohannes Berg 
1525cf121c3SJohannes Berg struct ieee80211_tx_data {
153f0706e82SJiri Benc 	struct sk_buff *skb;
154252b86c4SJohannes Berg 	struct sk_buff_head skbs;
155f0706e82SJiri Benc 	struct ieee80211_local *local;
156f0706e82SJiri Benc 	struct ieee80211_sub_if_data *sdata;
157f0706e82SJiri Benc 	struct sta_info *sta;
158f0706e82SJiri Benc 	struct ieee80211_key *key;
1595cf121c3SJohannes Berg 
160056cdd59SJohannes Berg 	unsigned int flags;
1615cf121c3SJohannes Berg };
1625cf121c3SJohannes Berg 
1635cf121c3SJohannes Berg 
1645cf121c3SJohannes Berg typedef unsigned __bitwise__ ieee80211_rx_result;
1655cf121c3SJohannes Berg #define RX_CONTINUE		((__force ieee80211_rx_result) 0u)
1665cf121c3SJohannes Berg #define RX_DROP_UNUSABLE	((__force ieee80211_rx_result) 1u)
1675cf121c3SJohannes Berg #define RX_DROP_MONITOR		((__force ieee80211_rx_result) 2u)
1685cf121c3SJohannes Berg #define RX_QUEUED		((__force ieee80211_rx_result) 3u)
1695cf121c3SJohannes Berg 
170554891e6SJohannes Berg /**
171554891e6SJohannes Berg  * enum ieee80211_packet_rx_flags - packet RX flags
172554891e6SJohannes Berg  * @IEEE80211_RX_RA_MATCH: frame is destined to interface currently processed
173554891e6SJohannes Berg  *	(incl. multicast frames)
174554891e6SJohannes Berg  * @IEEE80211_RX_FRAGMENTED: fragmented frame
175554891e6SJohannes Berg  * @IEEE80211_RX_AMSDU: a-MSDU packet
176554891e6SJohannes Berg  * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed
1774cfda47bSChristian Lamparter  * @IEEE80211_RX_DEFERRED_RELEASE: frame was subjected to receive reordering
178554891e6SJohannes Berg  *
179554891e6SJohannes Berg  * These are per-frame flags that are attached to a frame in the
180554891e6SJohannes Berg  * @rx_flags field of &struct ieee80211_rx_status.
181554891e6SJohannes Berg  */
182554891e6SJohannes Berg enum ieee80211_packet_rx_flags {
183554891e6SJohannes Berg 	IEEE80211_RX_RA_MATCH			= BIT(1),
184554891e6SJohannes Berg 	IEEE80211_RX_FRAGMENTED			= BIT(2),
185554891e6SJohannes Berg 	IEEE80211_RX_AMSDU			= BIT(3),
186554891e6SJohannes Berg 	IEEE80211_RX_MALFORMED_ACTION_FRM	= BIT(4),
1874cfda47bSChristian Lamparter 	IEEE80211_RX_DEFERRED_RELEASE		= BIT(5),
188554891e6SJohannes Berg };
189554891e6SJohannes Berg 
190554891e6SJohannes Berg /**
191554891e6SJohannes Berg  * enum ieee80211_rx_flags - RX data flags
192554891e6SJohannes Berg  *
193554891e6SJohannes Berg  * @IEEE80211_RX_CMNTR: received on cooked monitor already
194ee971924SJohannes Berg  * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
195ee971924SJohannes Berg  *	to cfg80211_report_obss_beacon().
196554891e6SJohannes Berg  *
197554891e6SJohannes Berg  * These flags are used across handling multiple interfaces
198554891e6SJohannes Berg  * for a single frame.
199554891e6SJohannes Berg  */
200554891e6SJohannes Berg enum ieee80211_rx_flags {
201554891e6SJohannes Berg 	IEEE80211_RX_CMNTR		= BIT(0),
202ee971924SJohannes Berg 	IEEE80211_RX_BEACON_REPORTED	= BIT(1),
203554891e6SJohannes Berg };
2045cf121c3SJohannes Berg 
2055cf121c3SJohannes Berg struct ieee80211_rx_data {
2065cf121c3SJohannes Berg 	struct sk_buff *skb;
2075cf121c3SJohannes Berg 	struct ieee80211_local *local;
2085cf121c3SJohannes Berg 	struct ieee80211_sub_if_data *sdata;
2095cf121c3SJohannes Berg 	struct sta_info *sta;
2105cf121c3SJohannes Berg 	struct ieee80211_key *key;
211056cdd59SJohannes Berg 
212056cdd59SJohannes Berg 	unsigned int flags;
2139e26297aSJohannes Berg 
2149e26297aSJohannes Berg 	/*
2159e26297aSJohannes Berg 	 * Index into sequence numbers array, 0..16
2169e26297aSJohannes Berg 	 * since the last (16) is used for non-QoS,
2179e26297aSJohannes Berg 	 * will be 16 on non-QoS frames.
2189e26297aSJohannes Berg 	 */
2199e26297aSJohannes Berg 	int seqno_idx;
2209e26297aSJohannes Berg 
2219e26297aSJohannes Berg 	/*
2229e26297aSJohannes Berg 	 * Index into the security IV/PN arrays, 0..16
2239e26297aSJohannes Berg 	 * since the last (16) is used for CCMP-encrypted
2249e26297aSJohannes Berg 	 * management frames, will be set to 16 on mgmt
2259e26297aSJohannes Berg 	 * frames and 0 on non-QoS frames.
2269e26297aSJohannes Berg 	 */
2279e26297aSJohannes Berg 	int security_idx;
2289e26297aSJohannes Berg 
22950741ae0SJohannes Berg 	u32 tkip_iv32;
23050741ae0SJohannes Berg 	u16 tkip_iv16;
231f0706e82SJiri Benc };
232f0706e82SJiri Benc 
2335dfdaf58SJohannes Berg struct beacon_data {
2345dfdaf58SJohannes Berg 	u8 *head, *tail;
2355dfdaf58SJohannes Berg 	int head_len, tail_len;
2368860020eSJohannes Berg 	struct rcu_head rcu_head;
2375dfdaf58SJohannes Berg };
2385dfdaf58SJohannes Berg 
239aa7a0080SEyal Shapira struct probe_resp {
240aa7a0080SEyal Shapira 	struct rcu_head rcu_head;
241aa7a0080SEyal Shapira 	int len;
242aa7a0080SEyal Shapira 	u8 data[0];
243aa7a0080SEyal Shapira };
244aa7a0080SEyal Shapira 
245d012a605SMarco Porsch struct ps_data {
246d012a605SMarco Porsch 	/* yes, this looks ugly, but guarantees that we can later use
247d012a605SMarco Porsch 	 * bitmap_empty :)
248d012a605SMarco Porsch 	 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
249d012a605SMarco Porsch 	u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)];
250d012a605SMarco Porsch 	struct sk_buff_head bc_buf;
251d012a605SMarco Porsch 	atomic_t num_sta_ps; /* number of stations in PS mode */
252d012a605SMarco Porsch 	int dtim_count;
253d012a605SMarco Porsch 	bool dtim_bc_mc;
254d012a605SMarco Porsch };
255d012a605SMarco Porsch 
256f0706e82SJiri Benc struct ieee80211_if_ap {
25740b275b6SJohannes Berg 	struct beacon_data __rcu *beacon;
258aa7a0080SEyal Shapira 	struct probe_resp __rcu *probe_resp;
259f0706e82SJiri Benc 
2600ec3ca44SJohannes Berg 	struct list_head vlans;
2610ec3ca44SJohannes Berg 
262d012a605SMarco Porsch 	struct ps_data ps;
263030ef8f8SFelix Fietkau 	atomic_t num_mcast_sta; /* number of stations receiving multicast */
264f0706e82SJiri Benc };
265f0706e82SJiri Benc 
266f0706e82SJiri Benc struct ieee80211_if_wds {
267f0706e82SJiri Benc 	struct sta_info *sta;
268056cdd59SJohannes Berg 	u8 remote_addr[ETH_ALEN];
269f0706e82SJiri Benc };
270f0706e82SJiri Benc 
271f0706e82SJiri Benc struct ieee80211_if_vlan {
2720ec3ca44SJohannes Berg 	struct list_head list;
273f14543eeSFelix Fietkau 
274f14543eeSFelix Fietkau 	/* used for all tx if the VLAN is configured to 4-addr mode */
27540b275b6SJohannes Berg 	struct sta_info __rcu *sta;
276f0706e82SJiri Benc };
277f0706e82SJiri Benc 
278ee385855SLuis Carlos Cobo struct mesh_stats {
279c8a61a7dSDaniel Walker 	__u32 fwded_mcast;		/* Mesh forwarded multicast frames */
280c8a61a7dSDaniel Walker 	__u32 fwded_unicast;		/* Mesh forwarded unicast frames */
281c8a61a7dSDaniel Walker 	__u32 fwded_frames;		/* Mesh total forwarded frames */
282ee385855SLuis Carlos Cobo 	__u32 dropped_frames_ttl;	/* Not transmitted since mesh_ttl == 0*/
283ee385855SLuis Carlos Cobo 	__u32 dropped_frames_no_route;	/* Not transmitted, no route found */
284cfee66b0SJavier Cardona 	__u32 dropped_frames_congestion;/* Not forwarded due to congestion */
285ee385855SLuis Carlos Cobo };
286ee385855SLuis Carlos Cobo 
287ee385855SLuis Carlos Cobo #define PREQ_Q_F_START		0x1
288ee385855SLuis Carlos Cobo #define PREQ_Q_F_REFRESH	0x2
289ee385855SLuis Carlos Cobo struct mesh_preq_queue {
290ee385855SLuis Carlos Cobo 	struct list_head list;
291ee385855SLuis Carlos Cobo 	u8 dst[ETH_ALEN];
292ee385855SLuis Carlos Cobo 	u8 flags;
293ee385855SLuis Carlos Cobo };
294ee385855SLuis Carlos Cobo 
2952eb278e0SJohannes Berg #if HZ/100 == 0
2962eb278e0SJohannes Berg #define IEEE80211_ROC_MIN_LEFT	1
2972eb278e0SJohannes Berg #else
2982eb278e0SJohannes Berg #define IEEE80211_ROC_MIN_LEFT	(HZ/100)
2992eb278e0SJohannes Berg #endif
30077fdaa12SJohannes Berg 
3012eb278e0SJohannes Berg struct ieee80211_roc_work {
30277fdaa12SJohannes Berg 	struct list_head list;
3032eb278e0SJohannes Berg 	struct list_head dependents;
304f679f65dSJohannes Berg 
3052eb278e0SJohannes Berg 	struct delayed_work work;
306af6b6374SJohannes Berg 
307af6b6374SJohannes Berg 	struct ieee80211_sub_if_data *sdata;
308af6b6374SJohannes Berg 
309f679f65dSJohannes Berg 	struct ieee80211_channel *chan;
310af6b6374SJohannes Berg 
3112eb278e0SJohannes Berg 	bool started, abort, hw_begun, notified;
312f679f65dSJohannes Berg 
3132eb278e0SJohannes Berg 	unsigned long hw_start_time;
314e4da8c37SJohannes Berg 
3152eb278e0SJohannes Berg 	u32 duration, req_duration;
316f30221e4SJohannes Berg 	struct sk_buff *frame;
31750febf6aSJohannes Berg 	u64 cookie, mgmt_tx_cookie;
318d339d5caSIlan Peer 	enum ieee80211_roc_type type;
31977fdaa12SJohannes Berg };
32077fdaa12SJohannes Berg 
32146900298SJohannes Berg /* flags used in struct ieee80211_if_managed.flags */
322ab1faeadSJohannes Berg enum ieee80211_sta_flags {
323b291ba11SJohannes Berg 	IEEE80211_STA_BEACON_POLL	= BIT(0),
324b291ba11SJohannes Berg 	IEEE80211_STA_CONNECTION_POLL	= BIT(1),
325b291ba11SJohannes Berg 	IEEE80211_STA_CONTROL_PORT	= BIT(2),
326a8243b72SJohannes Berg 	IEEE80211_STA_DISABLE_HT	= BIT(4),
327b291ba11SJohannes Berg 	IEEE80211_STA_CSA_RECEIVED	= BIT(5),
328b291ba11SJohannes Berg 	IEEE80211_STA_MFP_ENABLED	= BIT(6),
329ab13315aSKalle Valo 	IEEE80211_STA_UAPSD_ENABLED	= BIT(7),
330375177bfSVivek Natarajan 	IEEE80211_STA_NULLFUNC_ACKED	= BIT(8),
33117e4ec14SJouni Malinen 	IEEE80211_STA_RESET_SIGNAL_AVE	= BIT(9),
33224398e39SJohannes Berg 	IEEE80211_STA_DISABLE_40MHZ	= BIT(10),
333d545dabaSMahesh Palivela 	IEEE80211_STA_DISABLE_VHT	= BIT(11),
334f2d9d270SJohannes Berg 	IEEE80211_STA_DISABLE_80P80MHZ	= BIT(12),
335f2d9d270SJohannes Berg 	IEEE80211_STA_DISABLE_160MHZ	= BIT(13),
336ab1faeadSJohannes Berg };
337ab1faeadSJohannes Berg 
33866e67e41SJohannes Berg struct ieee80211_mgd_auth_data {
33966e67e41SJohannes Berg 	struct cfg80211_bss *bss;
34066e67e41SJohannes Berg 	unsigned long timeout;
34166e67e41SJohannes Berg 	int tries;
34266e67e41SJohannes Berg 	u16 algorithm, expected_transaction;
34366e67e41SJohannes Berg 
34466e67e41SJohannes Berg 	u8 key[WLAN_KEY_LEN_WEP104];
34566e67e41SJohannes Berg 	u8 key_len, key_idx;
34666e67e41SJohannes Berg 	bool done;
34789afe614SJohannes Berg 	bool timeout_started;
34866e67e41SJohannes Berg 
3496b8ece3aSJouni Malinen 	u16 sae_trans, sae_status;
3506b8ece3aSJouni Malinen 	size_t data_len;
3516b8ece3aSJouni Malinen 	u8 data[];
35266e67e41SJohannes Berg };
35366e67e41SJohannes Berg 
35466e67e41SJohannes Berg struct ieee80211_mgd_assoc_data {
35566e67e41SJohannes Berg 	struct cfg80211_bss *bss;
35666e67e41SJohannes Berg 	const u8 *supp_rates;
35766e67e41SJohannes Berg 
35866e67e41SJohannes Berg 	unsigned long timeout;
35966e67e41SJohannes Berg 	int tries;
36066e67e41SJohannes Berg 
36166e67e41SJohannes Berg 	u16 capability;
36266e67e41SJohannes Berg 	u8 prev_bssid[ETH_ALEN];
36366e67e41SJohannes Berg 	u8 ssid[IEEE80211_MAX_SSID_LEN];
36466e67e41SJohannes Berg 	u8 ssid_len;
36566e67e41SJohannes Berg 	u8 supp_rates_len;
36676f0303dSJohannes Berg 	bool wmm, uapsd;
367c65dd147SEmmanuel Grumbach 	bool have_beacon, need_beacon;
36866e67e41SJohannes Berg 	bool synced;
36989afe614SJohannes Berg 	bool timeout_started;
37066e67e41SJohannes Berg 
3719dde6423SJohannes Berg 	u8 ap_ht_param;
3729dde6423SJohannes Berg 
373b08fbbd8SJohannes Berg 	struct ieee80211_vht_cap ap_vht_cap;
374b08fbbd8SJohannes Berg 
37566e67e41SJohannes Berg 	size_t ie_len;
37666e67e41SJohannes Berg 	u8 ie[];
37766e67e41SJohannes Berg };
37866e67e41SJohannes Berg 
37946900298SJohannes Berg struct ieee80211_if_managed {
380056cdd59SJohannes Berg 	struct timer_list timer;
381b291ba11SJohannes Berg 	struct timer_list conn_mon_timer;
382b291ba11SJohannes Berg 	struct timer_list bcn_mon_timer;
383c481ec97SSujith 	struct timer_list chswitch_timer;
384b291ba11SJohannes Berg 	struct work_struct monitor_work;
385c481ec97SSujith 	struct work_struct chswitch_work;
3861e4dcd01SJuuso Oikarinen 	struct work_struct beacon_connection_loss_work;
387882a7c69SJohannes Berg 	struct work_struct csa_connection_drop_work;
38846900298SJohannes Berg 
3897ccc8bd7SFelix Fietkau 	unsigned long beacon_timeout;
390b291ba11SJohannes Berg 	unsigned long probe_timeout;
391a43abf29SMaxim Levitsky 	int probe_send_count;
39204ac3c0eSFelix Fietkau 	bool nullfunc_failed;
393682bd38bSJohannes Berg 	bool connection_loss;
394b291ba11SJohannes Berg 
39577fdaa12SJohannes Berg 	struct mutex mtx;
3960c1ad2caSJohannes Berg 	struct cfg80211_bss *associated;
39766e67e41SJohannes Berg 	struct ieee80211_mgd_auth_data *auth_data;
39866e67e41SJohannes Berg 	struct ieee80211_mgd_assoc_data *assoc_data;
39946900298SJohannes Berg 
40077fdaa12SJohannes Berg 	u8 bssid[ETH_ALEN];
40146900298SJohannes Berg 
402f0706e82SJiri Benc 	u16 aid;
403f0706e82SJiri Benc 
404965bedadSJohannes Berg 	bool powersave; /* powersave requested for this iface */
40505cb9108SJohannes Berg 	bool broken_ap; /* AP is broken -- turn off powersave */
406826262c3SJohannes Berg 	u8 dtim_period;
4070f78231bSJohannes Berg 	enum ieee80211_smps_mode req_smps, /* requested smps mode */
408d1f5b7a3SJohannes Berg 				 driver_smps_mode; /* smps mode request */
409d1f5b7a3SJohannes Berg 
410d1f5b7a3SJohannes Berg 	struct work_struct request_smps_work;
411965bedadSJohannes Berg 
412d6f2da5bSJiri Slaby 	unsigned int flags;
413f0706e82SJiri Benc 
414d8ec4433SJuuso Oikarinen 	bool beacon_crc_valid;
415d91f36dbSJohannes Berg 	u32 beacon_crc;
416d91f36dbSJohannes Berg 
4171672c0e3SJohannes Berg 	bool status_acked;
4181672c0e3SJohannes Berg 	bool status_received;
4191672c0e3SJohannes Berg 	__le16 status_fc;
4201672c0e3SJohannes Berg 
421fdfacf0aSJouni Malinen 	enum {
422fdfacf0aSJouni Malinen 		IEEE80211_MFP_DISABLED,
423fdfacf0aSJouni Malinen 		IEEE80211_MFP_OPTIONAL,
424fdfacf0aSJouni Malinen 		IEEE80211_MFP_REQUIRED
425fdfacf0aSJouni Malinen 	} mfp; /* management frame protection */
426fdfacf0aSJouni Malinen 
427dc41e4d4SEliad Peller 	/*
428dc41e4d4SEliad Peller 	 * Bitmask of enabled u-apsd queues,
429dc41e4d4SEliad Peller 	 * IEEE80211_WMM_IE_STA_QOSINFO_AC_BE & co. Needs a new association
430dc41e4d4SEliad Peller 	 * to take effect.
431dc41e4d4SEliad Peller 	 */
432dc41e4d4SEliad Peller 	unsigned int uapsd_queues;
433dc41e4d4SEliad Peller 
434dc41e4d4SEliad Peller 	/*
435dc41e4d4SEliad Peller 	 * Maximum number of buffered frames AP can deliver during a
436dc41e4d4SEliad Peller 	 * service period, IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL or similar.
437dc41e4d4SEliad Peller 	 * Needs a new association to take effect.
438dc41e4d4SEliad Peller 	 */
439dc41e4d4SEliad Peller 	unsigned int uapsd_max_sp_len;
440dc41e4d4SEliad Peller 
441f0706e82SJiri Benc 	int wmm_last_param_set;
4429bc383deSJohannes Berg 
4439bc383deSJohannes Berg 	u8 use_4addr;
44417e4ec14SJouni Malinen 
44567baf663SJanusz Dziedzic 	s16 p2p_noa_index;
446488dd7b5SJohannes Berg 
44717e4ec14SJouni Malinen 	/* Signal strength from the last Beacon frame in the current BSS. */
44817e4ec14SJouni Malinen 	int last_beacon_signal;
44917e4ec14SJouni Malinen 
45017e4ec14SJouni Malinen 	/*
45117e4ec14SJouni Malinen 	 * Weighted average of the signal strength from Beacon frames in the
45217e4ec14SJouni Malinen 	 * current BSS. This is in units of 1/16 of the signal unit to maintain
45317e4ec14SJouni Malinen 	 * accuracy and to speed up calculations, i.e., the value need to be
45417e4ec14SJouni Malinen 	 * divided by 16 to get the actual value.
45517e4ec14SJouni Malinen 	 */
45617e4ec14SJouni Malinen 	int ave_beacon_signal;
45717e4ec14SJouni Malinen 
45817e4ec14SJouni Malinen 	/*
459391a200aSJouni Malinen 	 * Number of Beacon frames used in ave_beacon_signal. This can be used
460391a200aSJouni Malinen 	 * to avoid generating less reliable cqm events that would be based
461391a200aSJouni Malinen 	 * only on couple of received frames.
462391a200aSJouni Malinen 	 */
463391a200aSJouni Malinen 	unsigned int count_beacon_signal;
464391a200aSJouni Malinen 
465391a200aSJouni Malinen 	/*
46617e4ec14SJouni Malinen 	 * Last Beacon frame signal strength average (ave_beacon_signal / 16)
46717e4ec14SJouni Malinen 	 * that triggered a cqm event. 0 indicates that no event has been
46817e4ec14SJouni Malinen 	 * generated for the current association.
46917e4ec14SJouni Malinen 	 */
47017e4ec14SJouni Malinen 	int last_cqm_event_signal;
471615f7b9bSMeenakshi Venkataraman 
472615f7b9bSMeenakshi Venkataraman 	/*
473615f7b9bSMeenakshi Venkataraman 	 * State variables for keeping track of RSSI of the AP currently
474615f7b9bSMeenakshi Venkataraman 	 * connected to and informing driver when RSSI has gone
475615f7b9bSMeenakshi Venkataraman 	 * below/above a certain threshold.
476615f7b9bSMeenakshi Venkataraman 	 */
477615f7b9bSMeenakshi Venkataraman 	int rssi_min_thold, rssi_max_thold;
478615f7b9bSMeenakshi Venkataraman 	int last_ave_beacon_signal;
479ef96a842SBen Greear 
480ef96a842SBen Greear 	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
481ef96a842SBen Greear 	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
482dd5ecfeaSJohannes Berg 	struct ieee80211_vht_cap vht_capa; /* configured VHT overrides */
483dd5ecfeaSJohannes Berg 	struct ieee80211_vht_cap vht_capa_mask; /* Valid parts of vht_capa */
484f0706e82SJiri Benc };
485f0706e82SJiri Benc 
48646900298SJohannes Berg struct ieee80211_if_ibss {
48746900298SJohannes Berg 	struct timer_list timer;
48846900298SJohannes Berg 
4897a17a33cSJohannes Berg 	struct mutex mtx;
4907a17a33cSJohannes Berg 
491af8cdcd8SJohannes Berg 	unsigned long last_scan_completed;
4925bb644a0SJohannes Berg 
493fbd2c8dcSTeemu Paasikivi 	u32 basic_rates;
494fbd2c8dcSTeemu Paasikivi 
495af8cdcd8SJohannes Berg 	bool fixed_bssid;
496af8cdcd8SJohannes Berg 	bool fixed_channel;
497fffd0934SJohannes Berg 	bool privacy;
49846900298SJohannes Berg 
499267335d6SAntonio Quartulli 	bool control_port;
5006abe0563SWill Hawkins 	unsigned int auth_frame_registrations;
501267335d6SAntonio Quartulli 
5024d196e4bSFelix Fietkau 	u8 bssid[ETH_ALEN] __aligned(2);
503af8cdcd8SJohannes Berg 	u8 ssid[IEEE80211_MAX_SSID_LEN];
504af8cdcd8SJohannes Berg 	u8 ssid_len, ie_len;
505af8cdcd8SJohannes Berg 	u8 *ie;
506af8cdcd8SJohannes Berg 	struct ieee80211_channel *channel;
50713c40c54SAlexander Simon 	enum nl80211_channel_type channel_type;
50846900298SJohannes Berg 
50946900298SJohannes Berg 	unsigned long ibss_join_req;
510af8cdcd8SJohannes Berg 	/* probe response/beacon for IBSS */
51140b275b6SJohannes Berg 	struct sk_buff __rcu *presp;
51240b275b6SJohannes Berg 	struct sk_buff *skb;
51346900298SJohannes Berg 
5148bf11d8dSJohannes Berg 	spinlock_t incomplete_lock;
5158bf11d8dSJohannes Berg 	struct list_head incomplete_stations;
5168bf11d8dSJohannes Berg 
51746900298SJohannes Berg 	enum {
51846900298SJohannes Berg 		IEEE80211_IBSS_MLME_SEARCH,
51946900298SJohannes Berg 		IEEE80211_IBSS_MLME_JOINED,
52046900298SJohannes Berg 	} state;
52146900298SJohannes Berg };
52246900298SJohannes Berg 
523dbf498fbSJavier Cardona /**
524dbf498fbSJavier Cardona  * struct ieee80211_mesh_sync_ops - Extensible synchronization framework interface
525dbf498fbSJavier Cardona  *
526dbf498fbSJavier Cardona  * these declarations define the interface, which enables
527dbf498fbSJavier Cardona  * vendor-specific mesh synchronization
528dbf498fbSJavier Cardona  *
529dbf498fbSJavier Cardona  */
530dbf498fbSJavier Cardona struct ieee802_11_elems;
531dbf498fbSJavier Cardona struct ieee80211_mesh_sync_ops {
532dbf498fbSJavier Cardona 	void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
533dbf498fbSJavier Cardona 			     u16 stype,
534dbf498fbSJavier Cardona 			     struct ieee80211_mgmt *mgmt,
535dbf498fbSJavier Cardona 			     struct ieee802_11_elems *elems,
536dbf498fbSJavier Cardona 			     struct ieee80211_rx_status *rx_status);
537dbf498fbSJavier Cardona 	void (*adjust_tbtt)(struct ieee80211_sub_if_data *sdata);
538dbf498fbSJavier Cardona 	/* add other framework functions here */
539dbf498fbSJavier Cardona };
540dbf498fbSJavier Cardona 
541472dbc45SJohannes Berg struct ieee80211_if_mesh {
542472dbc45SJohannes Berg 	struct timer_list housekeeping_timer;
543472dbc45SJohannes Berg 	struct timer_list mesh_path_timer;
544e304bfd3SRui Paulo 	struct timer_list mesh_path_root_timer;
545472dbc45SJohannes Berg 
54618889231SJavier Cardona 	unsigned long wrkq_flags;
547472dbc45SJohannes Berg 
548472dbc45SJohannes Berg 	u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
549472dbc45SJohannes Berg 	size_t mesh_id_len;
550472dbc45SJohannes Berg 	/* Active Path Selection Protocol Identifier */
5513491707aSRui Paulo 	u8 mesh_pp_id;
552472dbc45SJohannes Berg 	/* Active Path Selection Metric Identifier */
5533491707aSRui Paulo 	u8 mesh_pm_id;
554472dbc45SJohannes Berg 	/* Congestion Control Mode Identifier */
5553491707aSRui Paulo 	u8 mesh_cc_id;
5569e03fdfdSJavier Cardona 	/* Synchronization Protocol Identifier */
5573491707aSRui Paulo 	u8 mesh_sp_id;
5589e03fdfdSJavier Cardona 	/* Authentication Protocol Identifier */
5593491707aSRui Paulo 	u8 mesh_auth_id;
560d19b3bf6SRui Paulo 	/* Local mesh Sequence Number */
561d19b3bf6SRui Paulo 	u32 sn;
562472dbc45SJohannes Berg 	/* Last used PREQ ID */
563472dbc45SJohannes Berg 	u32 preq_id;
564472dbc45SJohannes Berg 	atomic_t mpaths;
565d19b3bf6SRui Paulo 	/* Timestamp of last SN update */
566d19b3bf6SRui Paulo 	unsigned long last_sn_update;
567dca7e943SThomas Pedersen 	/* Time when it's ok to send next PERR */
568dca7e943SThomas Pedersen 	unsigned long next_perr;
569dca7e943SThomas Pedersen 	/* Timestamp of last PREQ sent */
570472dbc45SJohannes Berg 	unsigned long last_preq;
571472dbc45SJohannes Berg 	struct mesh_rmc *rmc;
572472dbc45SJohannes Berg 	spinlock_t mesh_preq_queue_lock;
573472dbc45SJohannes Berg 	struct mesh_preq_queue preq_queue;
574472dbc45SJohannes Berg 	int preq_queue_len;
575472dbc45SJohannes Berg 	struct mesh_stats mshstats;
576472dbc45SJohannes Berg 	struct mesh_config mshcfg;
5771258d976SAshok Nagarajan 	atomic_t estab_plinks;
578472dbc45SJohannes Berg 	u32 mesh_seqnum;
579472dbc45SJohannes Berg 	bool accepting_plinks;
5805ee68e5bSJavier Cardona 	int num_gates;
5812b5e1967SThomas Pedersen 	struct beacon_data __rcu *beacon;
5822b5e1967SThomas Pedersen 	/* just protects beacon updates for now */
5832b5e1967SThomas Pedersen 	struct mutex mtx;
584581a8b0fSJavier Cardona 	const u8 *ie;
585581a8b0fSJavier Cardona 	u8 ie_len;
586b130e5ceSJavier Cardona 	enum {
587b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_NONE = 0x0,
588b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_AUTHED = 0x1,
589b130e5ceSJavier Cardona 		IEEE80211_MESH_SEC_SECURED = 0x2,
590b130e5ceSJavier Cardona 	} security;
591a6dad6a2SThomas Pedersen 	bool user_mpm;
592dbf498fbSJavier Cardona 	/* Extensible Synchronization Framework */
5938ba7acf3SJohannes Berg 	const struct ieee80211_mesh_sync_ops *sync_ops;
594dbf498fbSJavier Cardona 	s64 sync_offset_clockdrift_max;
595dbf498fbSJavier Cardona 	spinlock_t sync_offset_lock;
596dbf498fbSJavier Cardona 	bool adjusting_tbtt;
5973f52b7e3SMarco Porsch 	/* mesh power save */
5983f52b7e3SMarco Porsch 	enum nl80211_mesh_power_mode nonpeer_pm;
5993f52b7e3SMarco Porsch 	int ps_peers_light_sleep;
6003f52b7e3SMarco Porsch 	int ps_peers_deep_sleep;
6013f52b7e3SMarco Porsch 	struct ps_data ps;
602472dbc45SJohannes Berg };
603902acc78SJohannes Berg 
604902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH
605472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name)	\
606472dbc45SJohannes Berg 	do { (msh)->mshstats.name++; } while (0)
607902acc78SJohannes Berg #else
608472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \
609902acc78SJohannes Berg 	do { } while (0)
610902acc78SJohannes Berg #endif
611f0706e82SJiri Benc 
612213cd118SJohannes Berg /**
613213cd118SJohannes Berg  * enum ieee80211_sub_if_data_flags - virtual interface flags
614213cd118SJohannes Berg  *
615213cd118SJohannes Berg  * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
616213cd118SJohannes Berg  * @IEEE80211_SDATA_PROMISC: interface is promisc
617213cd118SJohannes Berg  * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
618213cd118SJohannes Berg  * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
619213cd118SJohannes Berg  *	associated stations and deliver multicast frames both
620213cd118SJohannes Berg  *	back to wireless media and to the local net stack.
62195acac61SJohannes Berg  * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
6227b7eab6fSJohannes Berg  * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
623213cd118SJohannes Berg  */
624213cd118SJohannes Berg enum ieee80211_sub_if_data_flags {
625213cd118SJohannes Berg 	IEEE80211_SDATA_ALLMULTI		= BIT(0),
626213cd118SJohannes Berg 	IEEE80211_SDATA_PROMISC			= BIT(1),
6277986cf95SJohannes Berg 	IEEE80211_SDATA_OPERATING_GMODE		= BIT(2),
6287986cf95SJohannes Berg 	IEEE80211_SDATA_DONT_BRIDGE_PACKETS	= BIT(3),
62995acac61SJohannes Berg 	IEEE80211_SDATA_DISCONNECT_RESUME	= BIT(4),
6307b7eab6fSJohannes Berg 	IEEE80211_SDATA_IN_DRIVER		= BIT(5),
631213cd118SJohannes Berg };
632213cd118SJohannes Berg 
63334d4bc4dSJohannes Berg /**
63434d4bc4dSJohannes Berg  * enum ieee80211_sdata_state_bits - virtual interface state bits
63534d4bc4dSJohannes Berg  * @SDATA_STATE_RUNNING: virtual interface is up & running; this
63634d4bc4dSJohannes Berg  *	mirrors netif_running() but is separate for interface type
63734d4bc4dSJohannes Berg  *	change handling while the interface is up
6385b714c6aSJohannes Berg  * @SDATA_STATE_OFFCHANNEL: This interface is currently in offchannel
6395b714c6aSJohannes Berg  *	mode, so queues are stopped
640d6a83228SJohannes Berg  * @SDATA_STATE_OFFCHANNEL_BEACON_STOPPED: Beaconing was stopped due
641d6a83228SJohannes Berg  *	to offchannel, reset when offchannel returns
64234d4bc4dSJohannes Berg  */
64334d4bc4dSJohannes Berg enum ieee80211_sdata_state_bits {
64434d4bc4dSJohannes Berg 	SDATA_STATE_RUNNING,
6455b714c6aSJohannes Berg 	SDATA_STATE_OFFCHANNEL,
646d6a83228SJohannes Berg 	SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
64734d4bc4dSJohannes Berg };
64834d4bc4dSJohannes Berg 
649d01a1e65SMichal Kazior /**
650d01a1e65SMichal Kazior  * enum ieee80211_chanctx_mode - channel context configuration mode
651d01a1e65SMichal Kazior  *
652d01a1e65SMichal Kazior  * @IEEE80211_CHANCTX_SHARED: channel context may be used by
653d01a1e65SMichal Kazior  *	multiple interfaces
654d01a1e65SMichal Kazior  * @IEEE80211_CHANCTX_EXCLUSIVE: channel context can be used
655d01a1e65SMichal Kazior  *	only by a single interface. This can be used for example for
656d01a1e65SMichal Kazior  *	non-fixed channel IBSS.
657d01a1e65SMichal Kazior  */
658d01a1e65SMichal Kazior enum ieee80211_chanctx_mode {
659d01a1e65SMichal Kazior 	IEEE80211_CHANCTX_SHARED,
660d01a1e65SMichal Kazior 	IEEE80211_CHANCTX_EXCLUSIVE
661d01a1e65SMichal Kazior };
662d01a1e65SMichal Kazior 
663d01a1e65SMichal Kazior struct ieee80211_chanctx {
664d01a1e65SMichal Kazior 	struct list_head list;
665d01a1e65SMichal Kazior 	struct rcu_head rcu_head;
666d01a1e65SMichal Kazior 
667d01a1e65SMichal Kazior 	enum ieee80211_chanctx_mode mode;
668d01a1e65SMichal Kazior 	int refcount;
6698a61af65SJohannes Berg 	bool driver_present;
670d01a1e65SMichal Kazior 
671d01a1e65SMichal Kazior 	struct ieee80211_chanctx_conf conf;
672d01a1e65SMichal Kazior };
673d01a1e65SMichal Kazior 
674f0706e82SJiri Benc struct ieee80211_sub_if_data {
675f0706e82SJiri Benc 	struct list_head list;
676f0706e82SJiri Benc 
677f0706e82SJiri Benc 	struct wireless_dev wdev;
678f0706e82SJiri Benc 
67911a843b7SJohannes Berg 	/* keys */
68011a843b7SJohannes Berg 	struct list_head key_list;
68111a843b7SJohannes Berg 
6823bff1865SYogesh Ashok Powar 	/* count for keys needing tailroom space allocation */
6833bff1865SYogesh Ashok Powar 	int crypto_tx_tailroom_needed_cnt;
6848d1f7ecdSJohannes Berg 	int crypto_tx_tailroom_pending_dec;
6858d1f7ecdSJohannes Berg 	struct delayed_work dec_tailroom_needed_wk;
6863bff1865SYogesh Ashok Powar 
687f0706e82SJiri Benc 	struct net_device *dev;
688f0706e82SJiri Benc 	struct ieee80211_local *local;
689f0706e82SJiri Benc 
69013262ffdSJiri Slaby 	unsigned int flags;
6917e9ed188SDaniel Drake 
69234d4bc4dSJohannes Berg 	unsigned long state;
69334d4bc4dSJohannes Berg 
694f0706e82SJiri Benc 	int drop_unencrypted;
695f0706e82SJiri Benc 
69647846c9bSJohannes Berg 	char name[IFNAMSIZ];
69747846c9bSJohannes Berg 
698f0706e82SJiri Benc 	/* Fragment table for host-based reassembly */
699f0706e82SJiri Benc 	struct ieee80211_fragment_entry	fragments[IEEE80211_FRAGMENT_MAX];
700f0706e82SJiri Benc 	unsigned int fragment_next;
701f0706e82SJiri Benc 
702b53be792SSimon Wunderlich 	/* TID bitmap for NoAck policy */
703b53be792SSimon Wunderlich 	u16 noack_map;
704b53be792SSimon Wunderlich 
70500e96decSYoni Divinsky 	/* bit field of ACM bits (BIT(802.1D tag)) */
70600e96decSYoni Divinsky 	u8 wmm_acm;
70700e96decSYoni Divinsky 
70840b275b6SJohannes Berg 	struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
70940b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_unicast_key;
71040b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_multicast_key;
71140b275b6SJohannes Berg 	struct ieee80211_key __rcu *default_mgmt_key;
712f0706e82SJiri Benc 
71394778280SJohannes Berg 	u16 sequence_number;
714a621fa4dSJohannes Berg 	__be16 control_port_protocol;
715a621fa4dSJohannes Berg 	bool control_port_no_encrypt;
71694778280SJohannes Berg 
71754bcbc69SJohannes Berg 	struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
718f6f3def3SEliad Peller 
71904ecd257SJohannes Berg 	/* used to reconfigure hardware SM PS */
72004ecd257SJohannes Berg 	struct work_struct recalc_smps;
72104ecd257SJohannes Berg 
72264592c8fSJohannes Berg 	struct work_struct work;
72335f20c14SJohannes Berg 	struct sk_buff_head skb_queue;
72435f20c14SJohannes Berg 
72504ecd257SJohannes Berg 	u8 needed_rx_chains;
72604ecd257SJohannes Berg 	enum ieee80211_smps_mode smps_mode;
72704ecd257SJohannes Berg 
7281ea6f9c0SJohannes Berg 	int user_power_level; /* in dBm */
7291ea6f9c0SJohannes Berg 	int ap_power_level; /* in dBm */
7301ea6f9c0SJohannes Berg 
731164eb02dSSimon Wunderlich 	bool radar_required;
732164eb02dSSimon Wunderlich 	struct delayed_work dfs_cac_timer_work;
733164eb02dSSimon Wunderlich 
7343e122be0SJohannes Berg 	/*
7353e122be0SJohannes Berg 	 * AP this belongs to: self in AP mode and
7363e122be0SJohannes Berg 	 * corresponding AP in VLAN mode, NULL for
7373e122be0SJohannes Berg 	 * all others (might be needed later in IBSS)
7383e122be0SJohannes Berg 	 */
7393e122be0SJohannes Berg 	struct ieee80211_if_ap *bss;
7403e122be0SJohannes Berg 
74137eb0b16SJouni Malinen 	/* bitmap of allowed (non-MCS) rate indexes for rate control */
74237eb0b16SJouni Malinen 	u32 rc_rateidx_mask[IEEE80211_NUM_BANDS];
74319468413SSimon Wunderlich 	u8  rc_rateidx_mcs_mask[IEEE80211_NUM_BANDS][IEEE80211_HT_MCS_MASK_LEN];
744f0706e82SJiri Benc 
745f0706e82SJiri Benc 	union {
746f0706e82SJiri Benc 		struct ieee80211_if_ap ap;
747f0706e82SJiri Benc 		struct ieee80211_if_wds wds;
748f0706e82SJiri Benc 		struct ieee80211_if_vlan vlan;
74946900298SJohannes Berg 		struct ieee80211_if_managed mgd;
75046900298SJohannes Berg 		struct ieee80211_if_ibss ibss;
751472dbc45SJohannes Berg 		struct ieee80211_if_mesh mesh;
7528cc9a739SMichael Wu 		u32 mntr_flags;
753f0706e82SJiri Benc 	} u;
754e9f207f0SJiri Benc 
75597f97b1fSJohannes Berg 	spinlock_t cleanup_stations_lock;
75697f97b1fSJohannes Berg 	struct list_head cleanup_stations;
75797f97b1fSJohannes Berg 	struct work_struct cleanup_stations_wk;
75897f97b1fSJohannes Berg 
759e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS
760e9f207f0SJiri Benc 	struct {
761295bafb4SBen Greear 		struct dentry *subdir_stations;
762f7e0104cSJohannes Berg 		struct dentry *default_unicast_key;
763f7e0104cSJohannes Berg 		struct dentry *default_multicast_key;
7643cfcf6acSJouni Malinen 		struct dentry *default_mgmt_key;
7657bcfaf2fSJohannes Berg 	} debugfs;
766e9f207f0SJiri Benc #endif
767529ba6e9SJohannes Berg 
76832bfd35dSJohannes Berg 	/* must be last, dynamically sized area in this! */
76932bfd35dSJohannes Berg 	struct ieee80211_vif vif;
770f0706e82SJiri Benc };
771f0706e82SJiri Benc 
77232bfd35dSJohannes Berg static inline
77332bfd35dSJohannes Berg struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
77432bfd35dSJohannes Berg {
77532bfd35dSJohannes Berg 	return container_of(p, struct ieee80211_sub_if_data, vif);
77632bfd35dSJohannes Berg }
77732bfd35dSJohannes Berg 
77855de908aSJohannes Berg static inline enum ieee80211_band
77955de908aSJohannes Berg ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
78055de908aSJohannes Berg {
78155de908aSJohannes Berg 	enum ieee80211_band band = IEEE80211_BAND_2GHZ;
78255de908aSJohannes Berg 	struct ieee80211_chanctx_conf *chanctx_conf;
78355de908aSJohannes Berg 
78455de908aSJohannes Berg 	rcu_read_lock();
78555de908aSJohannes Berg 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
78655de908aSJohannes Berg 	if (!WARN_ON(!chanctx_conf))
7874bf88530SJohannes Berg 		band = chanctx_conf->def.chan->band;
78855de908aSJohannes Berg 	rcu_read_unlock();
78955de908aSJohannes Berg 
79055de908aSJohannes Berg 	return band;
79155de908aSJohannes Berg }
79255de908aSJohannes Berg 
793c1475ca9SJohannes Berg enum sdata_queue_type {
794c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_TYPE_FRAME	= 0,
795c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_AGG_START		= 1,
796c1475ca9SJohannes Berg 	IEEE80211_SDATA_QUEUE_AGG_STOP		= 2,
797c1475ca9SJohannes Berg };
798c1475ca9SJohannes Berg 
799f0706e82SJiri Benc enum {
800f0706e82SJiri Benc 	IEEE80211_RX_MSG	= 1,
801f0706e82SJiri Benc 	IEEE80211_TX_STATUS_MSG	= 2,
802f0706e82SJiri Benc };
803f0706e82SJiri Benc 
804ce7c9111SKalle Valo enum queue_stop_reason {
805ce7c9111SKalle Valo 	IEEE80211_QUEUE_STOP_REASON_DRIVER,
806520eb820SKalle Valo 	IEEE80211_QUEUE_STOP_REASON_PS,
80796f5e66eSJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_CSA,
80896f5e66eSJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
80925420604SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_SUSPEND,
8108f77f384SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
8116c17b77bSSeth Forshee 	IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
812445ea4e8SJohannes Berg 	IEEE80211_QUEUE_STOP_REASON_FLUSH,
813ce7c9111SKalle Valo };
814ce7c9111SKalle Valo 
81565a6538aSLuciano Coelho #ifdef CONFIG_MAC80211_LEDS
816e1e54068SJohannes Berg struct tpt_led_trigger {
817e1e54068SJohannes Berg 	struct led_trigger trig;
818e1e54068SJohannes Berg 	char name[32];
819e1e54068SJohannes Berg 	const struct ieee80211_tpt_blink *blink_table;
820e1e54068SJohannes Berg 	unsigned int blink_table_len;
821e1e54068SJohannes Berg 	struct timer_list timer;
822e1e54068SJohannes Berg 	unsigned long prev_traffic;
823e1e54068SJohannes Berg 	unsigned long tx_bytes, rx_bytes;
82467408c8cSJohannes Berg 	unsigned int active, want;
82567408c8cSJohannes Berg 	bool running;
826e1e54068SJohannes Berg };
82765a6538aSLuciano Coelho #endif
828e1e54068SJohannes Berg 
829142b9f50SHelmut Schaa /**
830142b9f50SHelmut Schaa  * mac80211 scan flags - currently active scan mode
831142b9f50SHelmut Schaa  *
832142b9f50SHelmut Schaa  * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
833142b9f50SHelmut Schaa  *	well be on the operating channel
834142b9f50SHelmut Schaa  * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to
835142b9f50SHelmut Schaa  *	determine if we are on the operating channel or not
8368a690674SBen Greear  * @SCAN_ONCHANNEL_SCANNING:  Do a software scan on only the current operating
8378a690674SBen Greear  *	channel. This should not interrupt normal traffic.
8388789d459SJohannes Berg  * @SCAN_COMPLETED: Set for our scan work function when the driver reported
8398789d459SJohannes Berg  *	that the scan completed.
8408789d459SJohannes Berg  * @SCAN_ABORTED: Set for our scan work function when the driver reported
8418789d459SJohannes Berg  *	a scan complete for an aborted scan.
842142b9f50SHelmut Schaa  */
843fbe9c429SHelmut Schaa enum {
844fbe9c429SHelmut Schaa 	SCAN_SW_SCANNING,
845142b9f50SHelmut Schaa 	SCAN_HW_SCANNING,
8468a690674SBen Greear 	SCAN_ONCHANNEL_SCANNING,
8478789d459SJohannes Berg 	SCAN_COMPLETED,
8488789d459SJohannes Berg 	SCAN_ABORTED,
849142b9f50SHelmut Schaa };
850142b9f50SHelmut Schaa 
851142b9f50SHelmut Schaa /**
852142b9f50SHelmut Schaa  * enum mac80211_scan_state - scan state machine states
853142b9f50SHelmut Schaa  *
854142b9f50SHelmut Schaa  * @SCAN_DECISION: Main entry point to the scan state machine, this state
855142b9f50SHelmut Schaa  *	determines if we should keep on scanning or switch back to the
856142b9f50SHelmut Schaa  *	operating channel
857142b9f50SHelmut Schaa  * @SCAN_SET_CHANNEL: Set the next channel to be scanned
858142b9f50SHelmut Schaa  * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
85907ef03eeSJohannes Berg  * @SCAN_SUSPEND: Suspend the scan and go back to operating channel to
86007ef03eeSJohannes Berg  *	send out data
86107ef03eeSJohannes Berg  * @SCAN_RESUME: Resume the scan and scan the next channel
862cd2bb512SSam Leffler  * @SCAN_ABORT: Abort the scan and go back to operating channel
863142b9f50SHelmut Schaa  */
864142b9f50SHelmut Schaa enum mac80211_scan_state {
865142b9f50SHelmut Schaa 	SCAN_DECISION,
866142b9f50SHelmut Schaa 	SCAN_SET_CHANNEL,
867142b9f50SHelmut Schaa 	SCAN_SEND_PROBE,
86807ef03eeSJohannes Berg 	SCAN_SUSPEND,
86907ef03eeSJohannes Berg 	SCAN_RESUME,
870cd2bb512SSam Leffler 	SCAN_ABORT,
871fbe9c429SHelmut Schaa };
872fbe9c429SHelmut Schaa 
873f0706e82SJiri Benc struct ieee80211_local {
874f0706e82SJiri Benc 	/* embed the driver visible part.
875f0706e82SJiri Benc 	 * don't cast (use the static inlines below), but we keep
876f0706e82SJiri Benc 	 * it first anyway so they become a no-op */
877f0706e82SJiri Benc 	struct ieee80211_hw hw;
878f0706e82SJiri Benc 
879f0706e82SJiri Benc 	const struct ieee80211_ops *ops;
880f0706e82SJiri Benc 
88142935ecaSLuis R. Rodriguez 	/*
88242935ecaSLuis R. Rodriguez 	 * private workqueue to mac80211. mac80211 makes this accessible
88342935ecaSLuis R. Rodriguez 	 * via ieee80211_queue_work()
88442935ecaSLuis R. Rodriguez 	 */
88542935ecaSLuis R. Rodriguez 	struct workqueue_struct *workqueue;
88642935ecaSLuis R. Rodriguez 
887e4e72fb4SJohannes Berg 	unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
88896f5e66eSJohannes Berg 	/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
889ce7c9111SKalle Valo 	spinlock_t queue_stop_reason_lock;
89096f5e66eSJohannes Berg 
891f0706e82SJiri Benc 	int open_count;
8923d30d949SMichael Wu 	int monitors, cooked_mntrs;
8938cc9a739SMichael Wu 	/* number of interfaces with corresponding FIF_ flags */
8947be5086dSJohannes Berg 	int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
8957be5086dSJohannes Berg 	    fif_probe_req;
8967be5086dSJohannes Berg 	int probe_req_reg;
8974150c572SJohannes Berg 	unsigned int filter_flags; /* FIF_* */
8983b8d81e0SJohannes Berg 
8993ffc2a90SJohannes Berg 	bool wiphy_ciphers_allocated;
9003ffc2a90SJohannes Berg 
901fe57d9f5SJohannes Berg 	bool use_chanctx;
902fe57d9f5SJohannes Berg 
9033b8d81e0SJohannes Berg 	/* protects the aggregated multicast list and filter calls */
9043b8d81e0SJohannes Berg 	spinlock_t filter_lock;
9053b8d81e0SJohannes Berg 
9063ac64beeSJohannes Berg 	/* used for uploading changed mc list */
9073ac64beeSJohannes Berg 	struct work_struct reconfig_filter;
9083ac64beeSJohannes Berg 
9093b8d81e0SJohannes Berg 	/* aggregated multicast list */
91022bedad3SJiri Pirko 	struct netdev_hw_addr_list mc_list;
9113b8d81e0SJohannes Berg 
912d0709a65SJohannes Berg 	bool tim_in_locked_section; /* see ieee80211_beacon_get() */
9135bb644a0SJohannes Berg 
9145bb644a0SJohannes Berg 	/*
9155bb644a0SJohannes Berg 	 * suspended is true if we finished all the suspend _and_ we have
9165bb644a0SJohannes Berg 	 * not yet come up from resume. This is to be used by mac80211
9175bb644a0SJohannes Berg 	 * to ensure driver sanity during suspend and mac80211's own
9185bb644a0SJohannes Berg 	 * sanity. It can eventually be used for WoW as well.
9195bb644a0SJohannes Berg 	 */
9205bb644a0SJohannes Berg 	bool suspended;
9215bb644a0SJohannes Berg 
9225bb644a0SJohannes Berg 	/*
923ceb99fe0SJohannes Berg 	 * Resuming is true while suspended, but when we're reprogramming the
924ceb99fe0SJohannes Berg 	 * hardware -- at that time it's allowed to use ieee80211_queue_work()
925ceb99fe0SJohannes Berg 	 * again even though some other parts of the stack are still suspended
926ceb99fe0SJohannes Berg 	 * and we still drop received frames to avoid waking the stack.
927ceb99fe0SJohannes Berg 	 */
928ceb99fe0SJohannes Berg 	bool resuming;
929ceb99fe0SJohannes Berg 
930ceb99fe0SJohannes Berg 	/*
9315bb644a0SJohannes Berg 	 * quiescing is true during the suspend process _only_ to
9325bb644a0SJohannes Berg 	 * ease timer cancelling etc.
9335bb644a0SJohannes Berg 	 */
9345bb644a0SJohannes Berg 	bool quiescing;
9355bb644a0SJohannes Berg 
936ea77f12fSJohannes Berg 	/* device is started */
937ea77f12fSJohannes Berg 	bool started;
938ea77f12fSJohannes Berg 
93904800adaSArik Nemtsov 	/* device is during a HW reconfig */
94004800adaSArik Nemtsov 	bool in_reconfig;
94104800adaSArik Nemtsov 
942eecc4800SJohannes Berg 	/* wowlan is enabled -- don't reconfig on resume */
943eecc4800SJohannes Berg 	bool wowlan;
944eecc4800SJohannes Berg 
945164eb02dSSimon Wunderlich 	/* DFS/radar detection is enabled */
946164eb02dSSimon Wunderlich 	bool radar_detect_enabled;
947164eb02dSSimon Wunderlich 	struct work_struct radar_detected_work;
948164eb02dSSimon Wunderlich 
94904ecd257SJohannes Berg 	/* number of RX chains the hardware has */
95004ecd257SJohannes Berg 	u8 rx_chains;
95104ecd257SJohannes Berg 
952b306f453SJohannes Berg 	int tx_headroom; /* required headroom for hardware/radiotap */
953f0706e82SJiri Benc 
954f0706e82SJiri Benc 	/* Tasklet and skb queue to process calls from IRQ mode. All frames
955f0706e82SJiri Benc 	 * added to skb_queue will be processed, but frames in
956f0706e82SJiri Benc 	 * skb_queue_unreliable may be dropped if the total length of these
957f0706e82SJiri Benc 	 * queues increases over the limit. */
958f0706e82SJiri Benc #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128
959f0706e82SJiri Benc 	struct tasklet_struct tasklet;
960f0706e82SJiri Benc 	struct sk_buff_head skb_queue;
961f0706e82SJiri Benc 	struct sk_buff_head skb_queue_unreliable;
962f0706e82SJiri Benc 
963f9e124fbSChristian Lamparter 	spinlock_t rx_path_lock;
96424a8fdadSChristian Lamparter 
965d0709a65SJohannes Berg 	/* Station data */
966d0709a65SJohannes Berg 	/*
9674d33960bSJohannes Berg 	 * The mutex only protects the list, hash table and
9684d33960bSJohannes Berg 	 * counter, reads are done with RCU.
969d0709a65SJohannes Berg 	 */
97034e89507SJohannes Berg 	struct mutex sta_mtx;
9714d33960bSJohannes Berg 	spinlock_t tim_lock;
972d0709a65SJohannes Berg 	unsigned long num_sta;
9734d33960bSJohannes Berg 	struct list_head sta_list;
97440b275b6SJohannes Berg 	struct sta_info __rcu *sta_hash[STA_HASH_SIZE];
975f0706e82SJiri Benc 	struct timer_list sta_cleanup;
976f5ea9120SJohannes Berg 	int sta_generation;
977f0706e82SJiri Benc 
9782a577d98SJohannes Berg 	struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
979f0706e82SJiri Benc 	struct tasklet_struct tx_pending_tasklet;
980f0706e82SJiri Benc 
981a6a67db2SJohannes Berg 	atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
982cd8ffc80SJohannes Berg 
983f0706e82SJiri Benc 	/* number of interfaces with corresponding IFF_ flags */
98453918994SJohannes Berg 	atomic_t iff_allmultis, iff_promiscs;
985f0706e82SJiri Benc 
986f0706e82SJiri Benc 	struct rate_control_ref *rate_ctrl;
987f0706e82SJiri Benc 
9885f9f1812SFelix Fietkau 	struct crypto_cipher *wep_tx_tfm;
9895f9f1812SFelix Fietkau 	struct crypto_cipher *wep_rx_tfm;
990f0706e82SJiri Benc 	u32 wep_iv;
991f0706e82SJiri Benc 
992c771c9d8SJohannes Berg 	/* see iface.c */
99379010420SJohannes Berg 	struct list_head interfaces;
994c771c9d8SJohannes Berg 	struct mutex iflist_mtx;
99579010420SJohannes Berg 
996b16bd15cSJohannes Berg 	/*
997ad0e2b5aSJohannes Berg 	 * Key mutex, protects sdata's key_list and sta_info's
998b16bd15cSJohannes Berg 	 * key pointers (write access, they're RCU.)
999b16bd15cSJohannes Berg 	 */
1000ad0e2b5aSJohannes Berg 	struct mutex key_mtx;
1001b16bd15cSJohannes Berg 
1002a1699b75SJohannes Berg 	/* mutex for scan and work locking */
1003a1699b75SJohannes Berg 	struct mutex mtx;
1004b16bd15cSJohannes Berg 
1005c2b13452SJohannes Berg 	/* Scanning and BSS list */
1006fbe9c429SHelmut Schaa 	unsigned long scanning;
10072a519311SJohannes Berg 	struct cfg80211_ssid scan_ssid;
10085ba63533SJohannes Berg 	struct cfg80211_scan_request *int_scan_req;
10094d36ec58SJohannes Berg 	struct cfg80211_scan_request *scan_req, *hw_scan_req;
10102a519311SJohannes Berg 	struct ieee80211_channel *scan_channel;
10114d36ec58SJohannes Berg 	enum ieee80211_band hw_scan_band;
1012f0706e82SJiri Benc 	int scan_channel_idx;
1013de95a54bSJohannes Berg 	int scan_ies_len;
1014c604b9f2SJohannes Berg 	int hw_scan_ies_bufsize;
10158318d78aSJohannes Berg 
101685a9994aSLuciano Coelho 	struct work_struct sched_scan_stopped_work;
10175260a5b2SJohannes Berg 	struct ieee80211_sub_if_data __rcu *sched_scan_sdata;
101879f460caSLuciano Coelho 
1019df13cce5SHelmut Schaa 	unsigned long leave_oper_channel_time;
1020977923b0SHelmut Schaa 	enum mac80211_scan_state next_scan_state;
1021f0706e82SJiri Benc 	struct delayed_work scan_work;
1022e2fd5dbcSJohannes Berg 	struct ieee80211_sub_if_data __rcu *scan_sdata;
102355de908aSJohannes Berg 	struct ieee80211_channel *csa_channel;
102455de908aSJohannes Berg 	/* For backward compatibility only -- do not use */
102555de908aSJohannes Berg 	struct ieee80211_channel *_oper_channel;
10260aaffa9bSJohannes Berg 	enum nl80211_channel_type _oper_channel_type;
1027f0706e82SJiri Benc 
1028b8bc4b0aSJohannes Berg 	/* Temporary remain-on-channel for off-channel operations */
1029b8bc4b0aSJohannes Berg 	struct ieee80211_channel *tmp_channel;
1030b8bc4b0aSJohannes Berg 
1031d01a1e65SMichal Kazior 	/* channel contexts */
1032d01a1e65SMichal Kazior 	struct list_head chanctx_list;
1033d01a1e65SMichal Kazior 	struct mutex chanctx_mtx;
1034d01a1e65SMichal Kazior 
1035f0706e82SJiri Benc 	/* SNMP counters */
1036f0706e82SJiri Benc 	/* dot11CountersTable */
1037f0706e82SJiri Benc 	u32 dot11TransmittedFragmentCount;
1038f0706e82SJiri Benc 	u32 dot11MulticastTransmittedFrameCount;
1039f0706e82SJiri Benc 	u32 dot11FailedCount;
1040f0706e82SJiri Benc 	u32 dot11RetryCount;
1041f0706e82SJiri Benc 	u32 dot11MultipleRetryCount;
1042f0706e82SJiri Benc 	u32 dot11FrameDuplicateCount;
1043f0706e82SJiri Benc 	u32 dot11ReceivedFragmentCount;
1044f0706e82SJiri Benc 	u32 dot11MulticastReceivedFrameCount;
1045f0706e82SJiri Benc 	u32 dot11TransmittedFrameCount;
1046f0706e82SJiri Benc 
1047f0706e82SJiri Benc #ifdef CONFIG_MAC80211_LEDS
1048f0706e82SJiri Benc 	int tx_led_counter, rx_led_counter;
1049cdcb006fSIvo van Doorn 	struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
1050e1e54068SJohannes Berg 	struct tpt_led_trigger *tpt_led_trigger;
1051cdcb006fSIvo van Doorn 	char tx_led_name[32], rx_led_name[32],
1052cdcb006fSIvo van Doorn 	     assoc_led_name[32], radio_led_name[32];
1053f0706e82SJiri Benc #endif
1054f0706e82SJiri Benc 
1055f0706e82SJiri Benc #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
1056f0706e82SJiri Benc 	/* TX/RX handler statistics */
1057f0706e82SJiri Benc 	unsigned int tx_handlers_drop;
1058f0706e82SJiri Benc 	unsigned int tx_handlers_queued;
1059f0706e82SJiri Benc 	unsigned int tx_handlers_drop_unencrypted;
1060f0706e82SJiri Benc 	unsigned int tx_handlers_drop_fragment;
1061f0706e82SJiri Benc 	unsigned int tx_handlers_drop_wep;
1062f0706e82SJiri Benc 	unsigned int tx_handlers_drop_not_assoc;
1063f0706e82SJiri Benc 	unsigned int tx_handlers_drop_unauth_port;
1064f0706e82SJiri Benc 	unsigned int rx_handlers_drop;
1065f0706e82SJiri Benc 	unsigned int rx_handlers_queued;
1066f0706e82SJiri Benc 	unsigned int rx_handlers_drop_nullfunc;
1067f0706e82SJiri Benc 	unsigned int rx_handlers_drop_defrag;
1068f0706e82SJiri Benc 	unsigned int rx_handlers_drop_short;
1069f0706e82SJiri Benc 	unsigned int tx_expand_skb_head;
1070f0706e82SJiri Benc 	unsigned int tx_expand_skb_head_cloned;
1071f0706e82SJiri Benc 	unsigned int rx_expand_skb_head;
1072f0706e82SJiri Benc 	unsigned int rx_expand_skb_head2;
1073f0706e82SJiri Benc 	unsigned int rx_handlers_fragments;
1074f0706e82SJiri Benc 	unsigned int tx_status_drop;
1075f0706e82SJiri Benc #define I802_DEBUG_INC(c) (c)++
1076f0706e82SJiri Benc #else /* CONFIG_MAC80211_DEBUG_COUNTERS */
1077f0706e82SJiri Benc #define I802_DEBUG_INC(c) do { } while (0)
1078f0706e82SJiri Benc #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
1079f0706e82SJiri Benc 
1080f0706e82SJiri Benc 
1081f0706e82SJiri Benc 	int total_ps_buffered; /* total number of all buffered unicast and
1082f0706e82SJiri Benc 				* multicast packets for power saving stations
1083f0706e82SJiri Benc 				*/
1084520eb820SKalle Valo 
1085572e0012SKalle Valo 	bool pspolling;
1086b203ffc3SJouni Malinen 	bool offchannel_ps_enabled;
1087965bedadSJohannes Berg 	/*
1088965bedadSJohannes Berg 	 * PS can only be enabled when we have exactly one managed
1089965bedadSJohannes Berg 	 * interface (and monitors) in PS, this then points there.
1090965bedadSJohannes Berg 	 */
1091965bedadSJohannes Berg 	struct ieee80211_sub_if_data *ps_sdata;
1092520eb820SKalle Valo 	struct work_struct dynamic_ps_enable_work;
1093520eb820SKalle Valo 	struct work_struct dynamic_ps_disable_work;
1094520eb820SKalle Valo 	struct timer_list dynamic_ps_timer;
109510f644a4SJohannes Berg 	struct notifier_block network_latency_notifier;
10962b2c009eSJuuso Oikarinen 	struct notifier_block ifa_notifier;
1097a65240c1SJohannes Berg 	struct notifier_block ifa6_notifier;
1098f0706e82SJiri Benc 
1099ff616381SJuuso Oikarinen 	/*
1100ff616381SJuuso Oikarinen 	 * The dynamic ps timeout configured from user space via WEXT -
1101ff616381SJuuso Oikarinen 	 * this will override whatever chosen by mac80211 internally.
1102ff616381SJuuso Oikarinen 	 */
1103ff616381SJuuso Oikarinen 	int dynamic_ps_forced_timeout;
1104ff616381SJuuso Oikarinen 
11051ea6f9c0SJohannes Berg 	int user_power_level; /* in dBm, for all interfaces */
11062bf30fabSJohannes Berg 
11070f78231bSJohannes Berg 	enum ieee80211_smps_mode smps_mode;
11080f78231bSJohannes Berg 
1109f2753ddbSJohannes Berg 	struct work_struct restart_work;
1110f2753ddbSJohannes Berg 
1111e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS
1112e9f207f0SJiri Benc 	struct local_debugfsdentries {
11134b7679a5SJohannes Berg 		struct dentry *rcdir;
1114e9f207f0SJiri Benc 		struct dentry *keys;
1115e9f207f0SJiri Benc 	} debugfs;
1116e9f207f0SJiri Benc #endif
11174e6cbfd0SJohn W. Linville 
11182eb278e0SJohannes Berg 	/*
11192eb278e0SJohannes Berg 	 * Remain-on-channel support
11202eb278e0SJohannes Berg 	 */
11212eb278e0SJohannes Berg 	struct list_head roc_list;
112221f83589SJohannes Berg 	struct work_struct hw_roc_start, hw_roc_done;
11232eb278e0SJohannes Berg 	unsigned long hw_roc_start_time;
112450febf6aSJohannes Berg 	u64 roc_cookie_counter;
112521f83589SJohannes Berg 
1126a729cff8SJohannes Berg 	struct idr ack_status_frames;
1127a729cff8SJohannes Berg 	spinlock_t ack_status_lock;
1128a729cff8SJohannes Berg 
1129f142c6b9SJohannes Berg 	struct ieee80211_sub_if_data __rcu *p2p_sdata;
1130f142c6b9SJohannes Berg 
11314b6f1dd6SJohannes Berg 	/* virtual monitor interface */
11324b6f1dd6SJohannes Berg 	struct ieee80211_sub_if_data __rcu *monitor_sdata;
11334bf88530SJohannes Berg 	struct cfg80211_chan_def monitor_chandef;
1134f0706e82SJiri Benc };
1135f0706e82SJiri Benc 
11363e122be0SJohannes Berg static inline struct ieee80211_sub_if_data *
11373e122be0SJohannes Berg IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
11383e122be0SJohannes Berg {
11393e122be0SJohannes Berg 	return netdev_priv(dev);
11403e122be0SJohannes Berg }
11413e122be0SJohannes Berg 
114271bbc994SJohannes Berg static inline struct ieee80211_sub_if_data *
114371bbc994SJohannes Berg IEEE80211_WDEV_TO_SUB_IF(struct wireless_dev *wdev)
114471bbc994SJohannes Berg {
114571bbc994SJohannes Berg 	return container_of(wdev, struct ieee80211_sub_if_data, wdev);
114671bbc994SJohannes Berg }
114771bbc994SJohannes Berg 
1148c1475ca9SJohannes Berg /* this struct represents 802.11n's RA/TID combination */
1149eadc8d9eSRon Rindjunsky struct ieee80211_ra_tid {
1150eadc8d9eSRon Rindjunsky 	u8 ra[ETH_ALEN];
1151eadc8d9eSRon Rindjunsky 	u16 tid;
1152eadc8d9eSRon Rindjunsky };
1153eadc8d9eSRon Rindjunsky 
1154dd76986bSJohannes Berg /* Parsed Information Elements */
1155dd76986bSJohannes Berg struct ieee802_11_elems {
11564a3cb702SJohannes Berg 	const u8 *ie_start;
1157dd76986bSJohannes Berg 	size_t total_len;
1158dd76986bSJohannes Berg 
1159dd76986bSJohannes Berg 	/* pointers to IEs */
11604a3cb702SJohannes Berg 	const u8 *ssid;
11614a3cb702SJohannes Berg 	const u8 *supp_rates;
11624a3cb702SJohannes Berg 	const u8 *fh_params;
11634a3cb702SJohannes Berg 	const u8 *ds_params;
11644a3cb702SJohannes Berg 	const u8 *cf_params;
11654a3cb702SJohannes Berg 	const struct ieee80211_tim_ie *tim;
11664a3cb702SJohannes Berg 	const u8 *ibss_params;
11674a3cb702SJohannes Berg 	const u8 *challenge;
11684a3cb702SJohannes Berg 	const u8 *rsn;
11694a3cb702SJohannes Berg 	const u8 *erp_info;
11704a3cb702SJohannes Berg 	const u8 *ext_supp_rates;
11714a3cb702SJohannes Berg 	const u8 *wmm_info;
11724a3cb702SJohannes Berg 	const u8 *wmm_param;
11734a3cb702SJohannes Berg 	const struct ieee80211_ht_cap *ht_cap_elem;
11744a3cb702SJohannes Berg 	const struct ieee80211_ht_operation *ht_operation;
11754a3cb702SJohannes Berg 	const struct ieee80211_vht_cap *vht_cap_elem;
11764a3cb702SJohannes Berg 	const struct ieee80211_vht_operation *vht_operation;
11774a3cb702SJohannes Berg 	const struct ieee80211_meshconf_ie *mesh_config;
11784a3cb702SJohannes Berg 	const u8 *mesh_id;
11794a3cb702SJohannes Berg 	const u8 *peering;
11804a3cb702SJohannes Berg 	const __le16 *awake_window;
11814a3cb702SJohannes Berg 	const u8 *preq;
11824a3cb702SJohannes Berg 	const u8 *prep;
11834a3cb702SJohannes Berg 	const u8 *perr;
11844a3cb702SJohannes Berg 	const struct ieee80211_rann_ie *rann;
11854a3cb702SJohannes Berg 	const struct ieee80211_channel_sw_ie *ch_switch_ie;
11864a3cb702SJohannes Berg 	const u8 *country_elem;
11874a3cb702SJohannes Berg 	const u8 *pwr_constr_elem;
11884a3cb702SJohannes Berg 	const u8 *quiet_elem;	/* first quite element */
11894a3cb702SJohannes Berg 	const u8 *timeout_int;
11904a3cb702SJohannes Berg 	const u8 *opmode_notif;
1191dd76986bSJohannes Berg 
1192dd76986bSJohannes Berg 	/* length of them, respectively */
1193dd76986bSJohannes Berg 	u8 ssid_len;
1194dd76986bSJohannes Berg 	u8 supp_rates_len;
1195dd76986bSJohannes Berg 	u8 fh_params_len;
1196dd76986bSJohannes Berg 	u8 ds_params_len;
1197dd76986bSJohannes Berg 	u8 cf_params_len;
1198dd76986bSJohannes Berg 	u8 tim_len;
1199dd76986bSJohannes Berg 	u8 ibss_params_len;
1200dd76986bSJohannes Berg 	u8 challenge_len;
1201dd76986bSJohannes Berg 	u8 rsn_len;
1202dd76986bSJohannes Berg 	u8 erp_info_len;
1203dd76986bSJohannes Berg 	u8 ext_supp_rates_len;
1204dd76986bSJohannes Berg 	u8 wmm_info_len;
1205dd76986bSJohannes Berg 	u8 wmm_param_len;
1206dd76986bSJohannes Berg 	u8 mesh_id_len;
1207dd76986bSJohannes Berg 	u8 peering_len;
1208dd76986bSJohannes Berg 	u8 preq_len;
1209dd76986bSJohannes Berg 	u8 prep_len;
1210dd76986bSJohannes Berg 	u8 perr_len;
1211dd76986bSJohannes Berg 	u8 country_elem_len;
1212dd76986bSJohannes Berg 	u8 quiet_elem_len;
1213dd76986bSJohannes Berg 	u8 num_of_quiet_elem;	/* can be more the one */
1214dd76986bSJohannes Berg 	u8 timeout_int_len;
1215fcff4f10SPaul Stewart 
1216fcff4f10SPaul Stewart 	/* whether a parse error occurred while retrieving these elements */
1217fcff4f10SPaul Stewart 	bool parse_error;
1218dd76986bSJohannes Berg };
1219dd76986bSJohannes Berg 
1220f0706e82SJiri Benc static inline struct ieee80211_local *hw_to_local(
1221f0706e82SJiri Benc 	struct ieee80211_hw *hw)
1222f0706e82SJiri Benc {
1223f0706e82SJiri Benc 	return container_of(hw, struct ieee80211_local, hw);
1224f0706e82SJiri Benc }
1225f0706e82SJiri Benc 
1226f0706e82SJiri Benc 
1227571ecf67SJohannes Berg static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
1228571ecf67SJohannes Berg {
1229b203ca39SJoe Perches 	return ether_addr_equal(raddr, addr) ||
1230571ecf67SJohannes Berg 	       is_broadcast_ether_addr(raddr);
1231571ecf67SJohannes Berg }
1232571ecf67SJohannes Berg 
1233f4bda337SThomas Pedersen static inline bool
1234f4bda337SThomas Pedersen ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
1235f4bda337SThomas Pedersen {
1236f4bda337SThomas Pedersen 	WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
1237f4bda337SThomas Pedersen 		     status->flag & RX_FLAG_MACTIME_END);
1238f4bda337SThomas Pedersen 	return status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END);
1239f4bda337SThomas Pedersen }
1240571ecf67SJohannes Berg 
1241f4bda337SThomas Pedersen u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
1242f4bda337SThomas Pedersen 				     struct ieee80211_rx_status *status,
1243f4bda337SThomas Pedersen 				     unsigned int mpdu_len,
1244f4bda337SThomas Pedersen 				     unsigned int mpdu_offset);
1245e8975581SJohannes Berg int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
12465cf121c3SJohannes Berg void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
12479c6bd790SJohannes Berg void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
12489c6bd790SJohannes Berg 				      u32 changed);
12490d143fe1SJohannes Berg void ieee80211_configure_filter(struct ieee80211_local *local);
125046900298SJohannes Berg u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
1251f0706e82SJiri Benc 
125246900298SJohannes Berg /* STA code */
12539c6bd790SJohannes Berg void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
125477fdaa12SJohannes Berg int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
125577fdaa12SJohannes Berg 		       struct cfg80211_auth_request *req);
125677fdaa12SJohannes Berg int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
125777fdaa12SJohannes Berg 			struct cfg80211_assoc_request *req);
125877fdaa12SJohannes Berg int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
125963c9c5e7SJohannes Berg 			 struct cfg80211_deauth_request *req);
126077fdaa12SJohannes Berg int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
126163c9c5e7SJohannes Berg 			   struct cfg80211_disassoc_request *req);
1262572e0012SKalle Valo void ieee80211_send_pspoll(struct ieee80211_local *local,
1263572e0012SKalle Valo 			   struct ieee80211_sub_if_data *sdata);
126410f644a4SJohannes Berg void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
1265ab095877SEliad Peller void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
126610f644a4SJohannes Berg int ieee80211_max_network_latency(struct notifier_block *nb,
126710f644a4SJohannes Berg 				  unsigned long data, void *dummy);
12682b2c009eSJuuso Oikarinen int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
12694a3cb702SJohannes Berg void
12704a3cb702SJohannes Berg ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
12714a3cb702SJohannes Berg 				 const struct ieee80211_channel_sw_ie *sw_elem,
12724a3cb702SJohannes Berg 				 struct ieee80211_bss *bss, u64 timestamp);
12731fa57d01SJohannes Berg void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
12741fa57d01SJohannes Berg void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
12751fa57d01SJohannes Berg 				  struct sk_buff *skb);
1276d3a910a8SLuis R. Rodriguez void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
1277be099e82SLuis R. Rodriguez void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
1278afa762f6SEliad Peller void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
12791672c0e3SJohannes Berg void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
12801672c0e3SJohannes Berg 				  __le16 fc, bool acked);
12819c6bd790SJohannes Berg 
128246900298SJohannes Berg /* IBSS code */
128346900298SJohannes Berg void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
128446900298SJohannes Berg void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
12858bf11d8dSJohannes Berg void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
12868bf11d8dSJohannes Berg 			      const u8 *bssid, const u8 *addr, u32 supp_rates);
1287af8cdcd8SJohannes Berg int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
1288af8cdcd8SJohannes Berg 			struct cfg80211_ibss_params *params);
1289af8cdcd8SJohannes Berg int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
12901fa57d01SJohannes Berg void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
12911fa57d01SJohannes Berg void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
12921fa57d01SJohannes Berg 				   struct sk_buff *skb);
12931fa57d01SJohannes Berg 
12941fa57d01SJohannes Berg /* mesh code */
12951fa57d01SJohannes Berg void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
12961fa57d01SJohannes Berg void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
12971fa57d01SJohannes Berg 				   struct sk_buff *skb);
129846900298SJohannes Berg 
12999c6bd790SJohannes Berg /* scan/BSS handling */
130046900298SJohannes Berg void ieee80211_scan_work(struct work_struct *work);
130134bcf715SStanislaw Gruszka int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
1302be4a4b6aSJohannes Berg 				const u8 *ssid, u8 ssid_len,
1303be4a4b6aSJohannes Berg 				struct ieee80211_channel *chan);
1304c2b13452SJohannes Berg int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
13052a519311SJohannes Berg 			   struct cfg80211_scan_request *req);
13065bb644a0SJohannes Berg void ieee80211_scan_cancel(struct ieee80211_local *local);
1307133d40f9SStanislaw Gruszka void ieee80211_run_deferred_scan(struct ieee80211_local *local);
1308d48b2968SJohannes Berg void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb);
13099c6bd790SJohannes Berg 
13100a51b27eSJohannes Berg void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local);
1311c2b13452SJohannes Berg struct ieee80211_bss *
131298c8fccfSJohannes Berg ieee80211_bss_info_update(struct ieee80211_local *local,
131398c8fccfSJohannes Berg 			  struct ieee80211_rx_status *rx_status,
131498c8fccfSJohannes Berg 			  struct ieee80211_mgmt *mgmt,
131598c8fccfSJohannes Berg 			  size_t len,
131698c8fccfSJohannes Berg 			  struct ieee802_11_elems *elems,
1317d45c4172SEmmanuel Grumbach 			  struct ieee80211_channel *channel);
131898c8fccfSJohannes Berg void ieee80211_rx_bss_put(struct ieee80211_local *local,
1319c2b13452SJohannes Berg 			  struct ieee80211_bss *bss);
1320ee385855SLuis Carlos Cobo 
132179f460caSLuciano Coelho /* scheduled scan handling */
132279f460caSLuciano Coelho int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
132379f460caSLuciano Coelho 				       struct cfg80211_sched_scan_request *req);
132485a9994aSLuciano Coelho int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
132585a9994aSLuciano Coelho void ieee80211_sched_scan_stopped_work(struct work_struct *work);
132679f460caSLuciano Coelho 
1327b203ffc3SJouni Malinen /* off-channel helpers */
1328aacde9eeSStanislaw Gruszka void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
1329aacde9eeSStanislaw Gruszka void ieee80211_offchannel_return(struct ieee80211_local *local);
13302eb278e0SJohannes Berg void ieee80211_roc_setup(struct ieee80211_local *local);
13312eb278e0SJohannes Berg void ieee80211_start_next_roc(struct ieee80211_local *local);
13322eb278e0SJohannes Berg void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
13332eb278e0SJohannes Berg void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc);
13342eb278e0SJohannes Berg void ieee80211_sw_roc_work(struct work_struct *work);
13352eb278e0SJohannes Berg void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc);
1336b203ffc3SJouni Malinen 
13373e122be0SJohannes Berg /* interface handling */
133847846c9bSJohannes Berg int ieee80211_iface_init(void);
133947846c9bSJohannes Berg void ieee80211_iface_exit(void);
13403e122be0SJohannes Berg int ieee80211_if_add(struct ieee80211_local *local, const char *name,
134184efbb84SJohannes Berg 		     struct wireless_dev **new_wdev, enum nl80211_iftype type,
1342ee385855SLuis Carlos Cobo 		     struct vif_params *params);
1343f3947e2dSJohannes Berg int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
134405c914feSJohannes Berg 			     enum nl80211_iftype type);
1345f698d856SJasper Bryant-Greene void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
134675636525SJohannes Berg void ieee80211_remove_interfaces(struct ieee80211_local *local);
13475cff20e6SJohannes Berg void ieee80211_recalc_idle(struct ieee80211_local *local);
134885416a4fSChristian Lamparter void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
134985416a4fSChristian Lamparter 				    const int offset);
1350f142c6b9SJohannes Berg int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up);
1351f142c6b9SJohannes Berg void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata);
1352f0706e82SJiri Benc 
13531ea6f9c0SJohannes Berg bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
13541ea6f9c0SJohannes Berg void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
13551ea6f9c0SJohannes Berg 
13569607e6b6SJohannes Berg static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
13579607e6b6SJohannes Berg {
135834d4bc4dSJohannes Berg 	return test_bit(SDATA_STATE_RUNNING, &sdata->state);
13599607e6b6SJohannes Berg }
13609607e6b6SJohannes Berg 
1361e2ebc74dSJohannes Berg /* tx handling */
1362e2ebc74dSJohannes Berg void ieee80211_clear_tx_pending(struct ieee80211_local *local);
1363e2ebc74dSJohannes Berg void ieee80211_tx_pending(unsigned long data);
1364d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1365d0cf9c0dSStephen Hemminger 					 struct net_device *dev);
1366d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1367d0cf9c0dSStephen Hemminger 				       struct net_device *dev);
13681f98ab7fSFelix Fietkau void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
13691f98ab7fSFelix Fietkau 			      struct sk_buff_head *skbs);
1370e2ebc74dSJohannes Berg 
1371de1ede7aSJohannes Berg /* HT */
1372ef96a842SBen Greear void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
1373ef96a842SBen Greear 				     struct ieee80211_sta_ht_cap *ht_cap);
1374e1a0c6b3SJohannes Berg bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
1375ef96a842SBen Greear 				       struct ieee80211_supported_band *sband,
13764a3cb702SJohannes Berg 				       const struct ieee80211_ht_cap *ht_cap_ie,
1377e1a0c6b3SJohannes Berg 				       struct sta_info *sta);
1378b8695a8fSJohannes Berg void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
1379b8695a8fSJohannes Berg 			  const u8 *da, u16 tid,
1380b8695a8fSJohannes Berg 			  u16 initiator, u16 reason_code);
13810f78231bSJohannes Berg int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
13820f78231bSJohannes Berg 			       enum ieee80211_smps_mode smps, const u8 *da,
13830f78231bSJohannes Berg 			       const u8 *bssid);
1384d1f5b7a3SJohannes Berg void ieee80211_request_smps_work(struct work_struct *work);
1385de1ede7aSJohannes Berg 
13867c3b1dd8SJohannes Berg void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
138753f73c09SJohannes Berg 				     u16 initiator, u16 reason, bool stop);
1388849b7967SJohannes Berg void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
138953f73c09SJohannes Berg 				    u16 initiator, u16 reason, bool stop);
1390c82c4a80SJohannes Berg void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
1391c82c4a80SJohannes Berg 					 enum ieee80211_agg_stop_reason reason);
1392de1ede7aSJohannes Berg void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
1393de1ede7aSJohannes Berg 			     struct sta_info *sta,
1394de1ede7aSJohannes Berg 			     struct ieee80211_mgmt *mgmt, size_t len);
1395de1ede7aSJohannes Berg void ieee80211_process_addba_resp(struct ieee80211_local *local,
1396de1ede7aSJohannes Berg 				  struct sta_info *sta,
1397de1ede7aSJohannes Berg 				  struct ieee80211_mgmt *mgmt,
1398de1ede7aSJohannes Berg 				  size_t len);
1399de1ede7aSJohannes Berg void ieee80211_process_addba_request(struct ieee80211_local *local,
1400de1ede7aSJohannes Berg 				     struct sta_info *sta,
1401de1ede7aSJohannes Berg 				     struct ieee80211_mgmt *mgmt,
1402de1ede7aSJohannes Berg 				     size_t len);
1403de1ede7aSJohannes Berg 
1404849b7967SJohannes Berg int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1405c82c4a80SJohannes Berg 				   enum ieee80211_agg_stop_reason reason);
140667c282c0SJohannes Berg int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1407c82c4a80SJohannes Berg 				    enum ieee80211_agg_stop_reason reason);
14085d22c89bSJohannes Berg void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
14095d22c89bSJohannes Berg void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
141067c282c0SJohannes Berg void ieee80211_ba_session_work(struct work_struct *work);
141167c282c0SJohannes Berg void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
14122bff8ebfSChristian Lamparter void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
1413849b7967SJohannes Berg 
141404ecd257SJohannes Berg u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
141504ecd257SJohannes Berg 
1416818255eaSMahesh Palivela /* VHT */
14174a3cb702SJohannes Berg void
14184a3cb702SJohannes Berg ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
1419818255eaSMahesh Palivela 				    struct ieee80211_supported_band *sband,
14204a3cb702SJohannes Berg 				    const struct ieee80211_vht_cap *vht_cap_ie,
14214a34215eSJohannes Berg 				    struct sta_info *sta);
1422e1a0c6b3SJohannes Berg enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
14238921d04eSJohannes Berg void ieee80211_sta_set_rx_nss(struct sta_info *sta);
14240af83d3dSJohannes Berg void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
14250af83d3dSJohannes Berg 				 struct sta_info *sta, u8 opmode,
1426bee7f586SJohannes Berg 				 enum ieee80211_band band, bool nss_only);
1427dd5ecfeaSJohannes Berg void ieee80211_apply_vhtcap_overrides(struct ieee80211_sub_if_data *sdata,
1428dd5ecfeaSJohannes Berg 				      struct ieee80211_sta_vht_cap *vht_cap);
14294a34215eSJohannes Berg 
143039192c0bSJohannes Berg /* Spectrum management */
143139192c0bSJohannes Berg void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
143239192c0bSJohannes Berg 				       struct ieee80211_mgmt *mgmt,
143339192c0bSJohannes Berg 				       size_t len);
143439192c0bSJohannes Berg 
1435f2753ddbSJohannes Berg /* Suspend/resume and hw reconfiguration */
1436f2753ddbSJohannes Berg int ieee80211_reconfig(struct ieee80211_local *local);
143784f6a01cSJohannes Berg void ieee80211_stop_device(struct ieee80211_local *local);
1438f2753ddbSJohannes Berg 
1439eecc4800SJohannes Berg int __ieee80211_suspend(struct ieee80211_hw *hw,
1440eecc4800SJohannes Berg 			struct cfg80211_wowlan *wowlan);
1441f2753ddbSJohannes Berg 
1442f2753ddbSJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw)
1443f2753ddbSJohannes Berg {
144485f72bc8SJohn W. Linville 	struct ieee80211_local *local = hw_to_local(hw);
144585f72bc8SJohn W. Linville 
144685f72bc8SJohn W. Linville 	WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
144785f72bc8SJohn W. Linville 		"%s: resume with hardware scan still in progress\n",
144885f72bc8SJohn W. Linville 		wiphy_name(hw->wiphy));
144985f72bc8SJohn W. Linville 
1450f2753ddbSJohannes Berg 	return ieee80211_reconfig(hw_to_local(hw));
1451f2753ddbSJohannes Berg }
1452665af4fcSBob Copeland 
1453c2d1560aSJohannes Berg /* utility functions/constants */
1454c2d1560aSJohannes Berg extern void *mac80211_wiphy_privid; /* for wiphy privid */
145571364716SRon Rindjunsky u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
145605c914feSJohannes Berg 			enum nl80211_iftype type);
14574ee73f33SMichal Kazior int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
1458c2d1560aSJohannes Berg 			     int rate, int erp, int short_preamble);
1459f698d856SJasper Bryant-Greene void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
1460e6d6e342SJohannes Berg 				     struct ieee80211_hdr *hdr, const u8 *tsc,
1461e6d6e342SJohannes Berg 				     gfp_t gfp);
14623abead59SJohannes Berg void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
14633abead59SJohannes Berg 			       bool bss_notify);
146455de908aSJohannes Berg void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
146555de908aSJohannes Berg 		    enum ieee80211_band band);
1466cf6bb79aSHelmut Schaa 
146755de908aSJohannes Berg void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
146855de908aSJohannes Berg 				 struct sk_buff *skb, int tid,
146955de908aSJohannes Berg 				 enum ieee80211_band band);
147055de908aSJohannes Berg 
147155de908aSJohannes Berg static inline void
147255de908aSJohannes Berg ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
147355de908aSJohannes Berg 			  struct sk_buff *skb, int tid,
147455de908aSJohannes Berg 			  enum ieee80211_band band)
147555de908aSJohannes Berg {
147655de908aSJohannes Berg 	rcu_read_lock();
147755de908aSJohannes Berg 	__ieee80211_tx_skb_tid_band(sdata, skb, tid, band);
147855de908aSJohannes Berg 	rcu_read_unlock();
147955de908aSJohannes Berg }
148055de908aSJohannes Berg 
148155de908aSJohannes Berg static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
148255de908aSJohannes Berg 					struct sk_buff *skb, int tid)
148355de908aSJohannes Berg {
148455de908aSJohannes Berg 	struct ieee80211_chanctx_conf *chanctx_conf;
148555de908aSJohannes Berg 
148655de908aSJohannes Berg 	rcu_read_lock();
148755de908aSJohannes Berg 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
148855de908aSJohannes Berg 	if (WARN_ON(!chanctx_conf)) {
148955de908aSJohannes Berg 		rcu_read_unlock();
149055de908aSJohannes Berg 		kfree_skb(skb);
149155de908aSJohannes Berg 		return;
149255de908aSJohannes Berg 	}
149355de908aSJohannes Berg 
149455de908aSJohannes Berg 	__ieee80211_tx_skb_tid_band(sdata, skb, tid,
14954bf88530SJohannes Berg 				    chanctx_conf->def.chan->band);
149655de908aSJohannes Berg 	rcu_read_unlock();
149755de908aSJohannes Berg }
149855de908aSJohannes Berg 
149955de908aSJohannes Berg static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
1500cf6bb79aSHelmut Schaa 				    struct sk_buff *skb)
1501cf6bb79aSHelmut Schaa {
1502cf6bb79aSHelmut Schaa 	/* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
1503cf6bb79aSHelmut Schaa 	ieee80211_tx_skb_tid(sdata, skb, 7);
1504cf6bb79aSHelmut Schaa }
1505cf6bb79aSHelmut Schaa 
15069c6bd790SJohannes Berg void ieee802_11_parse_elems(u8 *start, size_t len,
15079c6bd790SJohannes Berg 			    struct ieee802_11_elems *elems);
1508d91f36dbSJohannes Berg u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
1509d91f36dbSJohannes Berg 			       struct ieee802_11_elems *elems,
1510d91f36dbSJohannes Berg 			       u64 filter, u32 crc);
1511881d948cSJohannes Berg u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
151296dd22acSJohannes Berg 			      enum ieee80211_band band);
1513f0706e82SJiri Benc 
1514520eb820SKalle Valo void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
1515520eb820SKalle Valo void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
1516520eb820SKalle Valo void ieee80211_dynamic_ps_timer(unsigned long data);
1517a97b77b9SVivek Natarajan void ieee80211_send_nullfunc(struct ieee80211_local *local,
1518a97b77b9SVivek Natarajan 			     struct ieee80211_sub_if_data *sdata,
1519a97b77b9SVivek Natarajan 			     int powersave);
15203cf335d5SKalle Valo void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
15213cf335d5SKalle Valo 			     struct ieee80211_hdr *hdr);
15224e5ff376SFelix Fietkau void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
152304ac3c0eSFelix Fietkau 			     struct ieee80211_hdr *hdr, bool ack);
1524520eb820SKalle Valo 
1525ce7c9111SKalle Valo void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
1526445ea4e8SJohannes Berg 				     unsigned long queues,
1527ce7c9111SKalle Valo 				     enum queue_stop_reason reason);
1528ce7c9111SKalle Valo void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
1529445ea4e8SJohannes Berg 				     unsigned long queues,
1530ce7c9111SKalle Valo 				     enum queue_stop_reason reason);
153196f5e66eSJohannes Berg void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
153296f5e66eSJohannes Berg 				    enum queue_stop_reason reason);
153396f5e66eSJohannes Berg void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
153496f5e66eSJohannes Berg 				    enum queue_stop_reason reason);
15353a25a8c8SJohannes Berg void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
15368f77f384SJohannes Berg void ieee80211_add_pending_skb(struct ieee80211_local *local,
15378f77f384SJohannes Berg 			       struct sk_buff *skb);
1538b0b97a8aSJohannes Berg void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
153950a9432dSJohannes Berg 				   struct sk_buff_head *skbs,
154050a9432dSJohannes Berg 				   void (*fn)(void *data), void *data);
154178307daaSJohannes Berg static inline void ieee80211_add_pending_skbs(struct ieee80211_local *local,
154278307daaSJohannes Berg 					      struct sk_buff_head *skbs)
154378307daaSJohannes Berg {
154478307daaSJohannes Berg 	ieee80211_add_pending_skbs_fn(local, skbs, NULL, NULL);
154578307daaSJohannes Berg }
154639ecc01dSJohannes Berg void ieee80211_flush_queues(struct ieee80211_local *local,
154739ecc01dSJohannes Berg 			    struct ieee80211_sub_if_data *sdata);
1548ce7c9111SKalle Valo 
154946900298SJohannes Berg void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1550700e8ea6SJouni Malinen 			 u16 transaction, u16 auth_alg, u16 status,
15514a3cb702SJohannes Berg 			 const u8 *extra, size_t extra_len, const u8 *bssid,
15521672c0e3SJohannes Berg 			 const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
15531672c0e3SJohannes Berg 			 u32 tx_flags);
15546ae16775SAntonio Quartulli void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
15556ae16775SAntonio Quartulli 				    const u8 *bssid, u16 stype, u16 reason,
15566ae16775SAntonio Quartulli 				    bool send_frame, u8 *frame_buf);
1557de95a54bSJohannes Berg int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1558c604b9f2SJohannes Berg 			     size_t buffer_len, const u8 *ie, size_t ie_len,
1559651b5225SJouni Malinen 			     enum ieee80211_band band, u32 rate_mask,
1560651b5225SJouni Malinen 			     u8 channel);
1561a619a4c0SJuuso Oikarinen struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
156285a237feSJohannes Berg 					  u8 *dst, u32 ratemask,
15636b77863bSJohannes Berg 					  struct ieee80211_channel *chan,
1564a619a4c0SJuuso Oikarinen 					  const u8 *ssid, size_t ssid_len,
1565a806c558SPaul Stewart 					  const u8 *ie, size_t ie_len,
1566a806c558SPaul Stewart 					  bool directed);
156746900298SJohannes Berg void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1568de95a54bSJohannes Berg 			      const u8 *ssid, size_t ssid_len,
1569a806c558SPaul Stewart 			      const u8 *ie, size_t ie_len,
15701672c0e3SJohannes Berg 			      u32 ratemask, bool directed, u32 tx_flags,
157155de908aSJohannes Berg 			      struct ieee80211_channel *channel, bool scan);
157246900298SJohannes Berg 
157346900298SJohannes Berg void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
157446900298SJohannes Berg 				  const size_t supp_rates_len,
157546900298SJohannes Berg 				  const u8 *supp_rates);
157646900298SJohannes Berg u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
157746900298SJohannes Berg 			    struct ieee802_11_elems *elems,
15789ebb61a2SAshok Nagarajan 			    enum ieee80211_band band, u32 *basic_rates);
15790f78231bSJohannes Berg int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata,
15800f78231bSJohannes Berg 			     enum ieee80211_smps_mode smps_mode);
158104ecd257SJohannes Berg void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata);
158246900298SJohannes Berg 
15838e664fb3SJohannes Berg size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
15848e664fb3SJohannes Berg 			  const u8 *ids, int n_ids, size_t offset);
15858e664fb3SJohannes Berg size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
1586ef96a842SBen Greear u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
158742e7aa77SAlexander Simon 			      u16 cap);
1588074d46d1SJohannes Berg u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
15894bf88530SJohannes Berg 			       const struct cfg80211_chan_def *chandef,
1590431e3154SAshok Nagarajan 			       u16 prot_mode);
1591ba0afa2fSMahesh Palivela u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
1592ba0afa2fSMahesh Palivela 			       u32 cap);
1593fc8a7321SJohannes Berg int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
15946b77863bSJohannes Berg 			    struct sk_buff *skb, bool need_basic,
15956b77863bSJohannes Berg 			    enum ieee80211_band band);
1596fc8a7321SJohannes Berg int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
15976b77863bSJohannes Berg 				struct sk_buff *skb, bool need_basic,
15986b77863bSJohannes Berg 				enum ieee80211_band band);
15998e664fb3SJohannes Berg 
1600f444de05SJohannes Berg /* channel management */
16014bf88530SJohannes Berg void ieee80211_ht_oper_to_chandef(struct ieee80211_channel *control_chan,
16024a3cb702SJohannes Berg 				  const struct ieee80211_ht_operation *ht_oper,
16034bf88530SJohannes Berg 				  struct cfg80211_chan_def *chandef);
1604f444de05SJohannes Berg 
1605d01a1e65SMichal Kazior int __must_check
1606d01a1e65SMichal Kazior ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
16074bf88530SJohannes Berg 			  const struct cfg80211_chan_def *chandef,
1608d01a1e65SMichal Kazior 			  enum ieee80211_chanctx_mode mode);
16092c9b7359SJohannes Berg int __must_check
16102c9b7359SJohannes Berg ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
16112c9b7359SJohannes Berg 			       const struct cfg80211_chan_def *chandef,
16122c9b7359SJohannes Berg 			       u32 *changed);
1613d01a1e65SMichal Kazior void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
16144d76d21bSJohannes Berg void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
16151f4ac5a6SJohannes Berg void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
16161f4ac5a6SJohannes Berg 					 bool clear);
1617d01a1e65SMichal Kazior 
161804ecd257SJohannes Berg void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
161904ecd257SJohannes Berg 				   struct ieee80211_chanctx *chanctx);
1620164eb02dSSimon Wunderlich void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
1621164eb02dSSimon Wunderlich 				    struct ieee80211_chanctx *chanctx);
1622164eb02dSSimon Wunderlich 
1623164eb02dSSimon Wunderlich void ieee80211_dfs_cac_timer(unsigned long data);
1624164eb02dSSimon Wunderlich void ieee80211_dfs_cac_timer_work(struct work_struct *work);
1625164eb02dSSimon Wunderlich void ieee80211_dfs_cac_cancel(struct ieee80211_local *local);
1626164eb02dSSimon Wunderlich void ieee80211_dfs_radar_detected_work(struct work_struct *work);
162704ecd257SJohannes Berg 
1628f4ea83ddSJohannes Berg #ifdef CONFIG_MAC80211_NOINLINE
1629d9e8a70fSJohannes Berg #define debug_noinline noinline
1630d9e8a70fSJohannes Berg #else
1631d9e8a70fSJohannes Berg #define debug_noinline
1632d9e8a70fSJohannes Berg #endif
1633d9e8a70fSJohannes Berg 
1634f0706e82SJiri Benc #endif /* IEEE80211_I_H */
1635