xref: /OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/include/wlioctl_defs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Custom OID/ioctl definitions for
3  * Broadcom 802.11abg Networking Device Driver
4  *
5  * Definitions subject to change without notice.
6  *
7  * Copyright (C) 2020, Broadcom.
8  *
9  *      Unless you and Broadcom execute a separate written software license
10  * agreement governing use of this software, this software is licensed to you
11  * under the terms of the GNU General Public License version 2 (the "GPL"),
12  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13  * following added to such license:
14  *
15  *      As a special exception, the copyright holders of this software give you
16  * permission to link this software with independent modules, and to copy and
17  * distribute the resulting executable under terms of your choice, provided that
18  * you also meet, for each linked independent module, the terms and conditions of
19  * the license of that module.  An independent module is a module which is not
20  * derived from this software.  The special exception does not apply to any
21  * modifications of the software.
22  *
23  *
24  * <<Broadcom-WL-IPTag/Dual:>>
25  */
26 
27 #ifndef wlioctl_defs_h
28 #define wlioctl_defs_h
29 
30 #ifdef EFI
31 /*
32  * This is the Broadcom-specific guid selector for IOCTL handler in the 80211 Protocol
33  * define for EFI. However, we use last 4 nibbles to communicate 'cmd' from tool to
34  * driver.
35  */
36 #define BCMWL_IOCTL_GUID \
37 	{0xB4910A35, 0x88C5, 0x4328, { 0x90, 0x08, 0x9F, 0xB2, 0x00, 0x00, 0x0, 0x0 } }
38 #endif /* EFI */
39 /* All builds use the new 11ac ratespec/chanspec */
40 #undef  D11AC_IOTYPES
41 #define D11AC_IOTYPES
42 
43 #ifndef USE_NEW_RSPEC_DEFS
44 /* Remove when no referencing branches exist.
45  * These macros will be used only in older branches (prior to K branch).
46  * Wl layer in newer branches and trunk use those defined in bcmwifi_rspec.h.
47  * Non-wl layer in newer branches and trunk may use these as well
48  * until they are removed.
49  */
50 /* WL_RSPEC defines for rate information */
51 #define WL_RSPEC_RATE_MASK		0x000000FF      /* rate or HT MCS value */
52 #define WL_RSPEC_VHT_MCS_MASK		0x0000000F      /* VHT MCS value */
53 #define WL_RSPEC_VHT_NSS_MASK		0x000000F0      /* VHT Nss value */
54 #define WL_RSPEC_VHT_NSS_SHIFT		4               /* VHT Nss value shift */
55 #define WL_RSPEC_TXEXP_MASK		0x00000300
56 #define WL_RSPEC_TXEXP_SHIFT		8
57 #define WL_RSPEC_BW_MASK		0x00070000      /* bandwidth mask */
58 #define WL_RSPEC_BW_SHIFT		16              /* bandwidth shift */
59 #define WL_RSPEC_STBC			0x00100000      /* STBC encoding, Nsts = 2 x Nss */
60 #define WL_RSPEC_TXBF			0x00200000      /* bit indicates TXBF mode */
61 #define WL_RSPEC_LDPC			0x00400000      /* bit indicates adv coding in use */
62 #define WL_RSPEC_SGI			0x00800000      /* Short GI mode */
63 #define WL_RSPEC_ENCODING_MASK		0x03000000      /* Encoding of Rate/MCS field */
64 #define WL_RSPEC_OVERRIDE_RATE		0x40000000      /* bit indicate to override mcs only */
65 #define WL_RSPEC_OVERRIDE_MODE		0x80000000      /* bit indicates override rate & mode */
66 
67 /* WL_RSPEC_ENCODING field defs */
68 #define WL_RSPEC_ENCODE_RATE	0x00000000      /* Legacy rate is stored in RSPEC_RATE_MASK */
69 #define WL_RSPEC_ENCODE_HT	0x01000000      /* HT MCS is stored in RSPEC_RATE_MASK */
70 #define WL_RSPEC_ENCODE_VHT	0x02000000      /* VHT MCS and Nss is stored in RSPEC_RATE_MASK */
71 
72 /* WL_RSPEC_BW field defs */
73 #define WL_RSPEC_BW_UNSPECIFIED 0
74 #define WL_RSPEC_BW_20MHZ       0x00010000
75 #define WL_RSPEC_BW_40MHZ       0x00020000
76 #define WL_RSPEC_BW_80MHZ       0x00030000
77 #define WL_RSPEC_BW_160MHZ      0x00040000
78 #define WL_RSPEC_BW_10MHZ	0x00050000
79 #define WL_RSPEC_BW_5MHZ	0x00060000
80 #define WL_RSPEC_BW_2P5MHZ      0x00070000
81 
82 #define HIGHEST_SINGLE_STREAM_MCS	7 /* MCS values greater than this enable multiple streams */
83 
84 #ifndef OEM_ANDROID
85 /* 'proprietary' string should not exist in open source(OEM_ANDROID) */
86 /* given a proprietary MCS, get number of spatial streams */
87 #define GET_PROPRIETARY_11N_MCS_NSS(mcs) (1 + ((mcs) - 85) / 8)
88 
89 #define GET_11N_MCS_NSS(mcs) ((mcs) < 32 ? (1 + ((mcs) / 8)) \
90 				: ((mcs) == 32 ? 1 : GET_PROPRIETARY_11N_MCS_NSS(mcs)))
91 #endif /* !OEM_ANDROID */
92 #endif /* !USE_NEW_RSPEC_DEFS */
93 
94 /* Legacy defines for the nrate iovar */
95 #define OLD_NRATE_MCS_INUSE         0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
96 #define OLD_NRATE_RATE_MASK         0x0000007f /* rate/mcs value */
97 #define OLD_NRATE_STF_MASK          0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
98 #define OLD_NRATE_STF_SHIFT         8          /* stf mode shift */
99 #define OLD_NRATE_OVERRIDE          0x80000000 /* bit indicates override both rate & mode */
100 #define OLD_NRATE_OVERRIDE_MCS_ONLY 0x40000000 /* bit indicate to override mcs only */
101 #define OLD_NRATE_SGI               0x00800000 /* sgi mode */
102 #define OLD_NRATE_LDPC_CODING       0x00400000 /* bit indicates adv coding in use */
103 
104 #define OLD_NRATE_STF_SISO	0		/* stf mode SISO */
105 #define OLD_NRATE_STF_CDD	1		/* stf mode CDD */
106 #define OLD_NRATE_STF_STBC	2		/* stf mode STBC */
107 #define OLD_NRATE_STF_SDM	3		/* stf mode SDM */
108 
109 #define WLC_11N_N_PROP_MCS	6		/* number of proprietary 11n MCS'es */
110 #define WLC_11N_FIRST_PROP_MCS	87		/* first Broadcom proprietary MCS */
111 #define WLC_11N_LAST_PROP_MCS	102
112 
113 #define MAX_CCA_CHANNELS 38	/* Max number of 20 Mhz wide channels */
114 #define MAX_CCA_SECS	1	/* CCA keeps this many seconds history - trimmed for dongle */
115 
116 #define IBSS_MED        15	/* Mediom in-bss congestion percentage */
117 #define IBSS_HI         25	/* Hi in-bss congestion percentage */
118 #define OBSS_MED        12
119 #define OBSS_HI         25
120 #define INTERFER_MED    5
121 #define INTERFER_HI     10
122 
123 #define  CCA_FLAG_2G_ONLY		0x01	/* Return a channel from 2.4 Ghz band */
124 #define  CCA_FLAG_5G_ONLY		0x02	/* Return a channel from 2.4 Ghz band */
125 #define  CCA_FLAG_IGNORE_DURATION	0x04	/* Ignore dwell time for each channel */
126 #define  CCA_FLAGS_PREFER_1_6_11	0x10
127 #define  CCA_FLAG_IGNORE_INTERFER	0x20	/* do not exclude channel based on interfer level */
128 
129 #define CCA_ERRNO_BAND		1	/* After filtering for band pref, no choices left */
130 #define CCA_ERRNO_DURATION	2	/* After filtering for duration, no choices left */
131 #define CCA_ERRNO_PREF_CHAN	3	/* After filtering for chan pref, no choices left */
132 #define CCA_ERRNO_INTERFER	4	/* After filtering for interference, no choices left */
133 #define CCA_ERRNO_TOO_FEW	5	/* Only 1 channel was input */
134 
135 #define WL_STA_AID(a)		((a) &~ 0xc000)
136 
137 /* Flags for sta_info_t indicating properties of STA */
138 #define WL_STA_BRCM		0x00000001	/* Running a Broadcom driver */
139 #define WL_STA_WME		0x00000002	/* WMM association */
140 #define WL_STA_NONERP		0x00000004	/* No ERP */
141 #define WL_STA_AUTHE		0x00000008	/* Authenticated */
142 #define WL_STA_ASSOC		0x00000010	/* Associated */
143 #define WL_STA_AUTHO		0x00000020	/* Authorized */
144 #define WL_STA_WDS		0x00000040	/* Wireless Distribution System */
145 #define WL_STA_WDS_LINKUP	0x00000080	/* WDS traffic/probes flowing properly */
146 #define WL_STA_PS		0x00000100	/* STA is in power save mode from AP's viewpoint */
147 #define WL_STA_APSD_BE		0x00000200	/* APSD delv/trigger for AC_BE is default enabled */
148 #define WL_STA_APSD_BK		0x00000400	/* APSD delv/trigger for AC_BK is default enabled */
149 #define WL_STA_APSD_VI		0x00000800	/* APSD delv/trigger for AC_VI is default enabled */
150 #define WL_STA_APSD_VO		0x00001000	/* APSD delv/trigger for AC_VO is default enabled */
151 #define WL_STA_N_CAP		0x00002000	/* STA 802.11n capable */
152 #define WL_STA_SCBSTATS		0x00004000	/* Per STA debug stats */
153 #define WL_STA_AMPDU_CAP	0x00008000	/* STA AMPDU capable */
154 #define WL_STA_AMSDU_CAP	0x00010000	/* STA AMSDU capable */
155 #define WL_STA_MIMO_PS		0x00020000	/* mimo ps mode is enabled */
156 #define WL_STA_MIMO_RTS		0x00040000	/* send rts in mimo ps mode */
157 #define WL_STA_RIFS_CAP		0x00080000	/* rifs enabled */
158 #define WL_STA_VHT_CAP		0x00100000	/* STA VHT(11ac) capable */
159 #define WL_STA_WPS		0x00200000	/* WPS state */
160 #define WL_STA_DWDS_CAP		0x01000000	/* DWDS CAP */
161 #define WL_STA_DWDS		0x02000000	/* DWDS active */
162 #define WL_WDS_LINKUP		WL_STA_WDS_LINKUP	/* deprecated */
163 #define WL_STA_IS_2G		0x04000000	/* 2G channels supported */
164 #define WL_STA_IS_5G		0x08000000	/* 5G channels supported */
165 #define WL_STA_IS_6G		0x10000000	/* 6G channels supported */
166 
167 /* STA HT cap fields */
168 #define WL_STA_CAP_LDPC_CODING		0x0001	/* Support for rx of LDPC coded pkts */
169 #define WL_STA_CAP_40MHZ		0x0002  /* FALSE:20Mhz, TRUE:20/40MHZ supported */
170 #define WL_STA_CAP_MIMO_PS_MASK		0x000C  /* Mimo PS mask */
171 #define WL_STA_CAP_MIMO_PS_SHIFT	0x0002	/* Mimo PS shift */
172 #define WL_STA_CAP_MIMO_PS_OFF		0x0003	/* Mimo PS, no restriction */
173 #define WL_STA_CAP_MIMO_PS_RTS		0x0001	/* Mimo PS, send RTS/CTS around MIMO frames */
174 #define WL_STA_CAP_MIMO_PS_ON		0x0000	/* Mimo PS, MIMO disallowed */
175 #define WL_STA_CAP_GF			0x0010	/* Greenfield preamble support */
176 #define WL_STA_CAP_SHORT_GI_20		0x0020	/* 20MHZ short guard interval support */
177 #define WL_STA_CAP_SHORT_GI_40		0x0040	/* 40Mhz short guard interval support */
178 #define WL_STA_CAP_TX_STBC		0x0080	/* Tx STBC support */
179 #define WL_STA_CAP_RX_STBC_MASK		0x0300	/* Rx STBC mask */
180 #define WL_STA_CAP_RX_STBC_SHIFT	8	/* Rx STBC shift */
181 #define WL_STA_CAP_DELAYED_BA		0x0400	/* delayed BA support */
182 #define WL_STA_CAP_MAX_AMSDU		0x0800	/* Max AMSDU size in bytes , 0=3839, 1=7935 */
183 #define WL_STA_CAP_DSSS_CCK		0x1000	/* DSSS/CCK supported by the BSS */
184 #define WL_STA_CAP_PSMP			0x2000	/* Power Save Multi Poll support */
185 #define WL_STA_CAP_40MHZ_INTOLERANT	0x4000	/* 40MHz Intolerant */
186 #define WL_STA_CAP_LSIG_TXOP		0x8000	/* L-SIG TXOP protection support */
187 
188 #define WL_STA_CAP_RX_STBC_NO		0x0	/* no rx STBC support */
189 #define WL_STA_CAP_RX_STBC_ONE_STREAM	0x1	/* rx STBC support of 1 spatial stream */
190 #define WL_STA_CAP_RX_STBC_TWO_STREAM	0x2	/* rx STBC support of 1-2 spatial streams */
191 #define WL_STA_CAP_RX_STBC_THREE_STREAM	0x3	/* rx STBC support of 1-3 spatial streams */
192 
193 /* scb vht flags */
194 #define WL_STA_VHT_LDPCCAP	0x0001
195 #define WL_STA_SGI80		0x0002
196 #define WL_STA_SGI160		0x0004
197 #define WL_STA_VHT_TX_STBCCAP	0x0008
198 #define WL_STA_VHT_RX_STBCCAP	0x0010
199 #define WL_STA_SU_BEAMFORMER	0x0020
200 #define WL_STA_SU_BEAMFORMEE	0x0040
201 #define WL_STA_MU_BEAMFORMER	0x0080
202 #define WL_STA_MU_BEAMFORMEE	0x0100
203 #define WL_STA_VHT_TXOP_PS	0x0200
204 #define WL_STA_HTC_VHT_CAP	0x0400
205 
206 /* Values for TX Filter override mode */
207 #define WLC_TXFILTER_OVERRIDE_DISABLED  0
208 #define WLC_TXFILTER_OVERRIDE_ENABLED   1
209 
210 #define WL_IOCTL_ACTION_GET		0x0
211 #define WL_IOCTL_ACTION_SET		0x1
212 #define WL_IOCTL_ACTION_OVL_IDX_MASK	0x1e
213 #define WL_IOCTL_ACTION_OVL_RSV		0x20
214 #define WL_IOCTL_ACTION_OVL		0x40
215 #define WL_IOCTL_ACTION_MASK		0x7e
216 #define WL_IOCTL_ACTION_OVL_SHIFT	1
217 
218 /* For WLC_SET_INFRA ioctl & infra_configuration iovar SET/GET operations */
219 #define WL_BSSTYPE_INDEP 0
220 #define WL_BSSTYPE_INFRA 1
221 #define WL_BSSTYPE_ANY   2	/* deprecated */
222 #define WL_BSSTYPE_MESH  3
223 
224 /* Bit definitions of mws_active_scan_throttle iovar */
225 
226 #define WL_SCAN_THROTTLE_MASK	0xF
227 
228 #define WL_SCAN_THROTTLE_ASSOCSCAN		(1U << 0)
229 #define WL_SCAN_THROTTLE_ROAMSCAN		(1U << 1)
230 #define WL_SCAN_THROTTLE_OTHER_FW_SCAN		(1U << 2)  /* for other scans like pno etc */
231 #define WL_SCAN_THROTTLE_HOSTSCAN		(1U << 3)
232 
233 /* Mask bit for Assoc scan, Roam scan, Other FW scan, Host scan bit defines */
234 #define WL_SCANFLAGS_CLIENT_MASK	0xF00u
235 #define WL_SCANFLAGS_CLIENT_SHIFT	8
236 
237 /* Mask bit for LOW power scan, High accuracy scan, LOW span scan bit defines */
238 #define WL_SCANFLAGS_SCAN_MODE_MASK	0x7000u
239 #define WL_SCANFLAGS_SCAN_MODE_SHIFT	12u
240 
241 /* Bitmask for scan_type */
242 /* Reserved flag precludes the use of 0xff for scan_type which is
243  * interpreted as default for backward compatibility.
244  * Low priority scan uses currently reserved bit,
245  * this should be changed as scan_type extended.
246  * So, reserved flag definition removed.
247  */
248 /* Use lower 16 bit for scan flags, the upper 16 bits are for internal use */
249 #define WL_SCANFLAGS_PASSIVE	0x01U	/* force passive scan */
250 #define WL_SCANFLAGS_LOW_PRIO	0x02U	/* Low priority scan */
251 #define WL_SCANFLAGS_PROHIBITED	0x04U	/* allow scanning prohibited channels */
252 #define WL_SCANFLAGS_OFFCHAN	0x08U	/* allow scanning/reporting off-channel APs */
253 #define WL_SCANFLAGS_HOTSPOT	0x10U	/* automatic ANQP to hotspot APs */
254 #define WL_SCANFLAGS_SWTCHAN	0x20U	/* Force channel switch for differerent bandwidth */
255 #define WL_SCANFLAGS_FORCE_PARALLEL 0x40U /* Force parallel scan even when actcb_fn_t is on.
256 					  * by default parallel scan will be disabled if actcb_fn_t
257 					  * is provided.
258 					  */
259 #define WL_SCANFLAGS_SISO	0x40U	/* Use 1 RX chain for scanning */
260 #define WL_SCANFLAGS_MIMO	0x80U	/* Force MIMO scanning */
261 #define WL_SCANFLAGS_ASSOCSCAN  0x100U   /* Assoc scan    */
262 #define WL_SCANFLAGS_ROAMSCAN   0x200U   /* Roam scan     */
263 #define WL_SCANFLAGS_FWSCAN     0x400U   /* Other FW scan */
264 #define WL_SCANFLAGS_HOSTSCAN   0x800U   /* Host scan     */
265 #define WL_SCANFLAGS_LOW_POWER_SCAN     0x1000U /* LOW power scan, scheduled scan
266 						* only on scancore
267 						*/
268 #define WL_SCANFLAGS_HIGH_ACCURACY      0x2000U  /* High accuracy scan, which needs
269 						 * reliable scan results
270 						 */
271 #define WL_SCANFLAGS_LOW_SPAN            0x4000U  /* LOW span scan, which expects
272 						 * scan to be completed ASAP
273 						 */
274 #define WL_SCANFLAGS_LISTEN		 0x8000U  /* Listen option in escan
275 						 * enable LISTEN along with PASSIVE flag
276 						 */
277 
278 /* BIT MASK for SSID TYPE */
279 #define WL_SCAN_SSIDFLAGS_SHORT_SSID		0x01U /* Use as Regular SSID */
280 
281 /* Value to decide scan type based on scqs */
282 #define WL_SC_RETRY_SCAN_MODE_NO_SCAN		0x0u	/* Do not reschedule scan */
283 #define WL_SC_RETRY_SCAN_MODE_HIGH_ACC		0x1u	/* Reschedule scan as HighAccuracy */
284 #define WL_SC_RETRY_SCAN_MODE_LOWPOWER		0x2u	/* Reschedule scan as LOWPOWER */
285 #define WL_SC_RETRY_SCAN_MODE_AUTO		0x3u	/* Scan rescheduling type is decided
286 							* dynamically.
287 							*/
288 
289 /* wl_iscan_results status values */
290 #define WL_SCAN_RESULTS_SUCCESS	0
291 #define WL_SCAN_RESULTS_PARTIAL	1
292 #define WL_SCAN_RESULTS_PENDING	2
293 #define WL_SCAN_RESULTS_ABORTED	3
294 #define WL_SCAN_RESULTS_NO_MEM  4
295 
296 /* Flags for parallel scan */
297 /* Bitmap to enable/disable rsdb parallel scan, 5g-5g/2g-2g parallel scan
298  * SCAN_PARALLEL_PASSIVE_5G ==> 5g-5g parallel scan
299  * SCAN_PARALLEL_PASSIVE_2G ==> 2g-2g parallel scan
300  */
301 #define SCAN_PARALLEL_PASSIVE_5G	(0x40)
302 #define SCAN_PARALLEL_PASSIVE_2G	(0x80)
303 
304 #define SCANOL_ENABLED			(1 << 0)
305 #define SCANOL_BCAST_SSID		(1 << 1)
306 #define SCANOL_NOTIFY_BCAST_SSID	(1 << 2)
307 #define SCANOL_RESULTS_PER_CYCLE	(1 << 3)
308 
309 /* scan times in milliseconds */
310 #define SCANOL_HOME_TIME		45	/* for home channel processing */
311 #define SCANOL_ASSOC_TIME		20	/* dwell on a channel while associated */
312 #define SCANOL_UNASSOC_TIME		40	/* dwell on a channel while unassociated */
313 #define SCANOL_PASSIVE_TIME		110	/* listen on a channelfor passive scan */
314 #define SCANOL_AWAY_LIMIT		100	/* max time to be away from home channel */
315 #define SCANOL_IDLE_REST_TIME		40
316 #define SCANOL_IDLE_REST_MULTIPLIER	0
317 #define SCANOL_ACTIVE_REST_TIME		20
318 #define SCANOL_ACTIVE_REST_MULTIPLIER	0
319 #define SCANOL_CYCLE_IDLE_REST_TIME	300000	/* Idle Rest Time between Scan Cycle (msec) */
320 #define SCANOL_CYCLE_IDLE_REST_MULTIPLIER	0	/* Idle Rest Time Multiplier */
321 #define SCANOL_CYCLE_ACTIVE_REST_TIME	200
322 #define SCANOL_CYCLE_ACTIVE_REST_MULTIPLIER	0
323 #define SCANOL_MAX_REST_TIME		3600000	/* max rest time between scan cycle (msec) */
324 #define SCANOL_CYCLE_DEFAULT		0	/* default for Max Scan Cycle, 0 = forever */
325 #define SCANOL_CYCLE_MAX		864000	/* Max Scan Cycle */
326 						/* 10 sec/scan cycle => 100 days */
327 #define SCANOL_NPROBES			2	/* for Active scan; send n probes on each channel */
328 #define SCANOL_NPROBES_MAX		5	/* for Active scan; send n probes on each channel */
329 #define SCANOL_SCAN_START_DLY		10	/* delay start of offload scan (sec) */
330 #define SCANOL_SCAN_START_DLY_MAX	240	/* delay start of offload scan (sec) */
331 #define SCANOL_MULTIPLIER_MAX		10	/* Max Multiplier */
332 #define SCANOL_UNASSOC_TIME_MAX		100	/* max dwell on a channel while unassociated */
333 #define SCANOL_PASSIVE_TIME_MAX		500	/* max listen on a channel for passive scan */
334 #define SCANOL_SSID_MAX			16	/* max supported preferred SSID */
335 
336 /* masks for channel and ssid count */
337 #define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
338 #define WL_SCAN_PARAMS_NSSID_SHIFT 16
339 
340 #define WL_SCAN_ACTION_START      1
341 #define WL_SCAN_ACTION_CONTINUE   2
342 #define WL_SCAN_ACTION_ABORT      3
343 #if defined(SIMPLE_ISCAN)
344 #define ISCAN_RETRY_CNT   5
345 #define ISCAN_STATE_IDLE   0
346 #define ISCAN_STATE_SCANING 1
347 #define ISCAN_STATE_PENDING 2
348 #endif /* SIMPLE_ISCAN */
349 
350 #define ANTENNA_NUM_1	1		/* total number of antennas to be used */
351 #define ANTENNA_NUM_2	2
352 #define ANTENNA_NUM_3	3
353 #define ANTENNA_NUM_4	4
354 
355 #define ANT_SELCFG_AUTO		0x80	/* bit indicates antenna sel AUTO */
356 #define ANT_SELCFG_MASK		0x33	/* antenna configuration mask */
357 #define ANT_SELCFG_TX_UNICAST	0	/* unicast tx antenna configuration */
358 #define ANT_SELCFG_RX_UNICAST	1	/* unicast rx antenna configuration */
359 #define ANT_SELCFG_TX_DEF	2	/* default tx antenna configuration */
360 #define ANT_SELCFG_RX_DEF	3	/* default rx antenna configuration */
361 
362 /* interference source detection and identification mode */
363 #define ITFR_MODE_DISABLE	0	/* disable feature */
364 #define ITFR_MODE_MANUAL_ENABLE	1	/* enable manual detection */
365 #define ITFR_MODE_AUTO_ENABLE	2	/* enable auto detection */
366 
367 /* bit definitions for flags in interference source report */
368 #define ITFR_INTERFERENCED	1	/* interference detected */
369 #define ITFR_HOME_CHANNEL	2	/* home channel has interference */
370 #define ITFR_NOISY_ENVIRONMENT	4	/* noisy environemnt so feature stopped */
371 
372 #define WL_NUM_RPI_BINS		8
373 #define WL_RM_TYPE_BASIC	1
374 #define WL_RM_TYPE_CCA		2
375 #define WL_RM_TYPE_RPI		3
376 #define WL_RM_TYPE_ABORT	-1	/* ABORT any in-progress RM request */
377 
378 #define WL_RM_FLAG_PARALLEL	(1<<0)
379 
380 #define WL_RM_FLAG_LATE		(1<<1)
381 #define WL_RM_FLAG_INCAPABLE	(1<<2)
382 #define WL_RM_FLAG_REFUSED	(1<<3)
383 
384 /* flags */
385 #define WLC_ASSOC_REQ_IS_REASSOC 0x01 /* assoc req was actually a reassoc */
386 
387 #define WLC_CIS_DEFAULT	0	/* built-in default */
388 #define WLC_CIS_SROM	1	/* source is sprom */
389 #define WLC_CIS_OTP	2	/* source is otp */
390 
391 /* PCL - Power Control Loop */
392 /* current gain setting is replaced by user input */
393 #define WL_ATTEN_APP_INPUT_PCL_OFF	0	/* turn off PCL, apply supplied input */
394 #define WL_ATTEN_PCL_ON			1	/* turn on PCL */
395 /* current gain setting is maintained */
396 #define WL_ATTEN_PCL_OFF		2	/* turn off PCL. */
397 
398 /* defines used by poweridx iovar - it controls power in a-band */
399 /* current gain setting is maintained */
400 #define WL_PWRIDX_PCL_OFF	-2	/* turn off PCL.  */
401 #define WL_PWRIDX_PCL_ON	-1	/* turn on PCL */
402 #define WL_PWRIDX_LOWER_LIMIT	-2	/* lower limit */
403 #define WL_PWRIDX_UPPER_LIMIT	63	/* upper limit */
404 /* value >= 0 causes
405  *	- input to be set to that value
406  *	- PCL to be off
407  */
408 
409 #define BCM_MAC_STATUS_INDICATION	(0x40010200L)
410 
411 /* Values for TX Filter override mode */
412 #define WLC_TXFILTER_OVERRIDE_DISABLED  0
413 #define WLC_TXFILTER_OVERRIDE_ENABLED   1
414 
415 /* magic pattern used for mismatch driver and wl */
416 #define WL_TXFIFO_SZ_MAGIC	0xa5a5
417 
418 /* check this magic number */
419 #define WLC_IOCTL_MAGIC		0x14e46c77
420 
421 /* bss_info_cap_t flags */
422 #define WL_BSS_FLAGS_FROM_BEACON	0x01	/* bss_info derived from beacon */
423 #define WL_BSS_FLAGS_FROM_CACHE		0x02	/* bss_info collected from cache */
424 #define WL_BSS_FLAGS_RSSI_ONCHANNEL	0x04	/* rssi info received on channel (vs offchannel) */
425 #define WL_BSS_FLAGS_HS20		0x08	/* hotspot 2.0 capable */
426 #define WL_BSS_FLAGS_RSSI_INVALID	0x10	/* BSS contains invalid RSSI */
427 #define WL_BSS_FLAGS_RSSI_INACCURATE	0x20	/* BSS contains inaccurate RSSI */
428 #define WL_BSS_FLAGS_SNR_INVALID	0x40	/* BSS contains invalid SNR */
429 #define WL_BSS_FLAGS_NF_INVALID		0x80	/* BSS contains invalid noise floor */
430 
431 /* bit definitions for bcnflags in wl_bss_info */
432 #define WL_BSS_BCNFLAGS_INTERWORK_PRESENT	0x01 /* beacon had IE, accessnet valid */
433 #define WL_BSS_BCNFLAGS_INTERWORK_PRESENT_VALID 0x02 /* on indicates support for this API */
434 #define WL_BSS_BCNFLAGS_MULTIPLE_BSSID_SET 0x4 /* this AP belongs to a multiple BSSID set */
435 #define WL_BSS_BCNFLAGS_NONTRANSMITTED_BSSID 0x8 /* this AP is the transmitted BSSID */
436 
437 /* bssinfo flag for nbss_cap */
438 #define VHT_BI_SGI_80MHZ			0x00000100
439 #define VHT_BI_80MHZ			    0x00000200
440 #define VHT_BI_160MHZ			    0x00000400
441 #define VHT_BI_8080MHZ			    0x00000800
442 
443 /* reference to wl_ioctl_t struct used by usermode driver */
444 #define ioctl_subtype	set		/* subtype param */
445 #define ioctl_pid	used		/* pid param */
446 #define ioctl_status	needed		/* status param */
447 
448 /* Enumerate crypto algorithms */
449 #define	CRYPTO_ALGO_OFF			0
450 #define	CRYPTO_ALGO_WEP1		1
451 #define	CRYPTO_ALGO_TKIP		2
452 #define	CRYPTO_ALGO_WEP128		3
453 #define CRYPTO_ALGO_AES_CCM		4
454 #define CRYPTO_ALGO_AES_OCB_MSDU	5
455 #define CRYPTO_ALGO_AES_OCB_MPDU	6
456 #if !defined(BCMCCX) && !defined(BCMEXTCCX)
457 #define CRYPTO_ALGO_NALG		7
458 #else
459 #define CRYPTO_ALGO_CKIP		7
460 #define CRYPTO_ALGO_CKIP_MMH	8
461 #define CRYPTO_ALGO_WEP_MMH		9
462 #define CRYPTO_ALGO_NALG		10
463 #endif /* !BCMCCX && !BCMEXTCCX */
464 
465 #define CRYPTO_ALGO_SMS4		11
466 #define CRYPTO_ALGO_PMK			12	/* for 802.1x supp to set PMK before 4-way */
467 #define CRYPTO_ALGO_BIP			13  /* 802.11w BIP (aes cmac) */
468 
469 #define CRYPTO_ALGO_AES_GCM     14  /* 128 bit GCM */
470 #define CRYPTO_ALGO_AES_CCM256  15  /* 256 bit CCM */
471 #define CRYPTO_ALGO_AES_GCM256  16  /* 256 bit GCM */
472 #define CRYPTO_ALGO_BIP_CMAC256 17  /* 256 bit BIP CMAC */
473 #define CRYPTO_ALGO_BIP_GMAC    18  /* 128 bit BIP GMAC */
474 #define CRYPTO_ALGO_BIP_GMAC256 19  /* 256 bit BIP GMAC */
475 
476 #define CRYPTO_ALGO_NONE        CRYPTO_ALGO_OFF
477 
478 /* algo bit vector */
479 #define KEY_ALGO_MASK(_algo)	(1 << _algo)
480 
481 #if defined(BCMCCX) || defined(BCMEXTCCX)
482 #define KEY_ALGO_MASK_CCX		(KEY_ALGO_MASK(CRYPTO_ALGO_CKIP) | \
483 					KEY_ALGO_MASK(CRYPTO_ALGO_CKIP_MMH) | \
484 					KEY_ALGO_MASK(CRYPTO_ALGO_WEP_MMH))
485 #endif /* defined(BCMCCX) || defined(BCMEXTCCX) */
486 
487 #define KEY_ALGO_MASK_WEP		(KEY_ALGO_MASK(CRYPTO_ALGO_WEP1) | \
488 					KEY_ALGO_MASK(CRYPTO_ALGO_WEP128) | \
489 					KEY_ALGO_MASK(CRYPTO_ALGO_NALG))
490 
491 #define KEY_ALGO_MASK_AES		(KEY_ALGO_MASK(CRYPTO_ALGO_AES_CCM) | \
492 					KEY_ALGO_MASK(CRYPTO_ALGO_AES_CCM256) | \
493 					KEY_ALGO_MASK(CRYPTO_ALGO_AES_GCM) | \
494 					KEY_ALGO_MASK(CRYPTO_ALGO_AES_GCM256))
495 #define KEY_ALGO_MASK_TKIP		(KEY_ALGO_MASK(CRYPTO_ALGO_TKIP))
496 #define KEY_ALGO_MASK_WAPI		(KEY_ALGO_MASK(CRYPTO_ALGO_SMS4))
497 
498 #define WSEC_GEN_MIC_ERROR	0x0001
499 #define WSEC_GEN_REPLAY		0x0002
500 #define WSEC_GEN_ICV_ERROR	0x0004
501 #define WSEC_GEN_MFP_ACT_ERROR	0x0008
502 #define WSEC_GEN_MFP_DISASSOC_ERROR	0x0010
503 #define WSEC_GEN_MFP_DEAUTH_ERROR	0x0020
504 
505 #define WL_SOFT_KEY	(1 << 0)	/* Indicates this key is using soft encrypt */
506 #define WL_PRIMARY_KEY	(1 << 1)	/* Indicates this key is the primary (ie tx) key */
507 #if defined(BCMCCX) || defined(BCMEXTCCX)
508 #define WL_CKIP_KP	(1 << 4)	/* CMIC */
509 #define WL_CKIP_MMH	(1 << 5)	/* CKIP */
510 #else
511 #define WL_KF_RES_4	(1 << 4)	/* Reserved for backward compat */
512 #define WL_KF_RES_5	(1 << 5)	/* Reserved for backward compat */
513 #endif /* BCMCCX || BCMEXTCCX */
514 #define WL_IBSS_PEER_GROUP_KEY	(1 << 6)	/* Indicates a group key for a IBSS PEER */
515 #define WL_LINK_KEY	(1 << 7)	/* For linking keys of both cores */
516 #define WL_UNLINK_KEY	(1 << 8)	/* For unlinking keys of both cores */
517 
518 /* wireless security bitvec */
519 #define WSEC_NONE		0x0
520 #define WEP_ENABLED		0x0001
521 #define TKIP_ENABLED		0x0002
522 #define AES_ENABLED		0x0004
523 #define WSEC_SWFLAG		0x0008
524 #ifdef BCMCCX
525 #define CKIP_KP_ENABLED		0x0010
526 #define CKIP_MIC_ENABLED	0x0020
527 #endif /* BCMCCX */
528 #define SES_OW_ENABLED		0x0040	/* to go into transition mode without setting wep */
529 #ifdef WLFIPS
530 #define FIPS_ENABLED	0x0080
531 #endif /* WLFIPS */
532 
533 #ifdef BCMWAPI_WPI
534 #define SMS4_ENABLED		0x0100
535 #endif /* BCMWAPI_WPI */
536 
537 /* wsec macros for operating on the above definitions */
538 #ifdef WLWSEC
539 #define WSEC_WEP_ENABLED(wsec)	((wsec) & WEP_ENABLED)
540 #define WSEC_TKIP_ENABLED(wsec)	((wsec) & TKIP_ENABLED)
541 #define WSEC_AES_ENABLED(wsec)	((wsec) & AES_ENABLED)
542 #else /* WLWSEC */
543 #define WSEC_WEP_ENABLED(wsec) NULL
544 #define WSEC_TKIP_ENABLED(wsec) NULL
545 #define WSEC_AES_ENABLED(wsec) NULL
546 #endif /* WLWSEC */
547 
548 /* Macros to check if algorithm is enabled */
549 #define	WSEC_INFO_ALGO_ENABLED(_wi, _algo) \
550 	(_wi).cur_algos & (1 << CRYPTO_ALGO_##_algo)
551 
552 #define WSEC_INFO_ALGO_NONE(_wi) (((_wi).cur_algos) == 0)
553 
554 #ifdef WLWSEC
555 #ifdef BCMCCX
556 #define WSEC_CKIP_KP_ENABLED(wsec)	((wsec) & CKIP_KP_ENABLED)
557 #define WSEC_CKIP_MIC_ENABLED(wsec)	((wsec) & CKIP_MIC_ENABLED)
558 #define WSEC_CKIP_ENABLED(wsec)	((wsec) & (CKIP_KP_ENABLED|CKIP_MIC_ENABLED))
559 
560 #ifdef BCMWAPI_WPI
561 #define WSEC_ENABLED(wsec) \
562 	((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | CKIP_KP_ENABLED |	\
563 	  CKIP_MIC_ENABLED | SMS4_ENABLED))
564 #endif /* BCMWAPI_WPI */
565 
566 #ifndef BCMWAPI_WPI /* BCMWAPI_WPI */
567 #define WSEC_ENABLED(wsec) \
568 		((wsec) & \
569 		 (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | CKIP_KP_ENABLED | CKIP_MIC_ENABLED))
570 #endif /* BCMWAPI_WPI */
571 #else /* defined BCMCCX */
572 
573 #ifdef BCMWAPI_WPI
574 #define WSEC_ENABLED(wsec)	((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | SMS4_ENABLED))
575 #endif /* BCMWAPI_WPI */
576 
577 #ifndef BCMWAPI_WPI /* BCMWAPI_WPI */
578 #define WSEC_ENABLED(wsec)	((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
579 #endif /* BCMWAPI_WPI */
580 #endif /* BCMCCX */
581 #else /* WLWSEC */
582 #define WSEC_ENABLED(wsec) 0
583 #endif /* WLWSEC */
584 
585 #define WSEC_SES_OW_ENABLED(wsec)	((wsec) & SES_OW_ENABLED)
586 
587 #ifdef BCMWAPI_WAI
588 #define WSEC_SMS4_ENABLED(wsec)	((wsec) & SMS4_ENABLED)
589 #endif /* BCMWAPI_WAI */
590 
591 /* Following macros are not used any more. Just kept here to
592  * avoid build issue in BISON/CARIBOU branch
593  */
594 #define MFP_CAPABLE		0x0200
595 #define MFP_REQUIRED	0x0400
596 #define MFP_SHA256		0x0800 /* a special configuration for STA for WIFI test tool */
597 
598 /* WPA authentication mode bitvec */
599 #define WPA_AUTH_DISABLED		0x0000	/* Legacy (i.e., non-WPA) */
600 #define WPA_AUTH_NONE			0x0001	/* none (IBSS) */
601 #define WPA_AUTH_UNSPECIFIED		0x0002	/* over 802.1x */
602 #define WPA_AUTH_PSK			0x0004	/* Pre-shared key */
603 #if defined(BCMCCX) || defined(BCMEXTCCX)
604 #define WPA_AUTH_CCKM			0x0008	/* CCKM */
605 #define WPA2_AUTH_CCKM			0x0010	/* CCKM2 */
606 #endif	/* BCMCCX || BCMEXTCCX */
607 /* #define WPA_AUTH_8021X 0x0020 */	/* 802.1x, reserved */
608 #define WPA2_AUTH_UNSPECIFIED		0x0040	/* over 802.1x */
609 #define WPA2_AUTH_PSK			0x0080	/* Pre-shared key */
610 #define BRCM_AUTH_PSK			0x0100  /* BRCM specific PSK */
611 #define BRCM_AUTH_DPT			0x0200	/* DPT PSK without group keys */
612 #if defined(BCMWAPI_WAI) || defined(BCMWAPI_WPI)
613 #define WPA_AUTH_WAPI			0x0400 /* why it is same as WAPI_AUTH_UNSPECIFIED */
614 #define WAPI_AUTH_NONE			WPA_AUTH_NONE	/* none (IBSS) */
615 #define WAPI_AUTH_UNSPECIFIED		0x0400	/* over AS */
616 #define WAPI_AUTH_PSK			0x0800	/* Pre-shared key */
617 #endif /* BCMWAPI_WAI || BCMWAPI_WPI */
618 #define WPA2_AUTH_1X_SHA256		0x1000  /* 1X with SHA256 key derivation */
619 #define WPA2_AUTH_TPK			0x2000	/* TDLS Peer Key */
620 #define WPA2_AUTH_FT			0x4000	/* Fast Transition. */
621 #define WPA2_AUTH_PSK_SHA256		0x8000	/* PSK with SHA256 key derivation */
622 #define WPA2_AUTH_FILS_SHA256		0x10000 /* FILS with SHA256 key derivation */
623 #define WPA2_AUTH_FILS_SHA384		0x20000 /* FILS with SHA384 key derivation */
624 #define WPA2_AUTH_IS_FILS(auth) ((auth) & (WPA2_AUTH_FILS_SHA256 | WPA2_AUTH_FILS_SHA384))
625 #define WPA3_AUTH_SAE_PSK		0x40000 /* SAE with 4-way handshake */
626 #define WPA3_AUTH_DPP_AKM		0x80000 /* Device Provisioning Protocol (DPP) */
627 #define WPA3_AUTH_OWE			0x100000 /* OWE */
628 #define WPA3_AUTH_1X_SUITE_B_SHA256	0x200000 /* Suite B SHA256 */
629 #define WPA3_AUTH_1X_SUITE_B_SHA384	0x400000 /* Suite B-192 SHA384 */
630 #define WPA3_AUTH_PSK_SHA384		0x800000 /* PSK with SHA384 key derivation */
631 #define WPA3_AUTH_SAE_AP_ONLY		0x1000000 /* SAE restriction to connect to pure SAE APs */
632 /* WPA2_AUTH_SHA256 not used anymore. Just kept here to avoid build issue in DINGO */
633 #define WPA2_AUTH_SHA256		0x8000
634 #define WPA_AUTH_PFN_ANY		0xffffffff	/* for PFN, match only ssid */
635 
636 /* pmkid */
637 #define	MAXPMKID		16	/* max # PMKID cache entries NDIS */
638 
639 #ifdef MACOSX
640 /* Macos limits ioctl maxlen to 2k */
641 #define	WLC_IOCTL_MAXLEN		2048	/* max length ioctl buffer required */
642 #else
643 /* SROM12 changes */
644 #define	WLC_IOCTL_MAXLEN		8192	/* max length ioctl buffer required */
645 #endif /* MACOSX */
646 
647 #define WLC_IOCTL_SMLEN		256	/* "small" length ioctl buffer required */
648 #define WLC_IOCTL_MEDLEN		1896	/* "med" length ioctl buffer required */
649 #if defined(LCNCONF) || defined(LCN40CONF) || defined(LCN20CONF)
650 #define WLC_SAMPLECOLLECT_MAXLEN	8192	/* Max Sample Collect buffer */
651 #else
652 #define WLC_SAMPLECOLLECT_MAXLEN	10240	/* Max Sample Collect buffer for two cores */
653 #endif
654 #define WLC_SAMPLECOLLECT_MAXLEN_LCN40  8192
655 
656 #define WLC_IOCTL_NANRESP_MAXLEN        4096u    /* "max" length nan ioctl resp buffer required */
657 #define WLC_IOCTL_NANRESP_MEDLEN        800u     /* "med" length nan ioctl resp buffer required */
658 
659 /* common ioctl definitions */
660 #define WLC_GET_MAGIC				0
661 #define WLC_GET_VERSION				1
662 #define WLC_UP					2
663 #define WLC_DOWN				3
664 #define WLC_GET_LOOP				4
665 #define WLC_SET_LOOP				5
666 #define WLC_DUMP				6
667 #define WLC_GET_MSGLEVEL			7
668 #define WLC_SET_MSGLEVEL			8
669 #define WLC_GET_PROMISC				9
670 #define WLC_SET_PROMISC				10
671 /* #define WLC_OVERLAY_IOCTL			11 */ /* not supported */
672 #define WLC_GET_RATE				12
673 #define WLC_GET_MAX_RATE			13
674 #define WLC_GET_INSTANCE			14
675 /* #define WLC_GET_FRAG				15 */ /* no longer supported */
676 /* #define WLC_SET_FRAG				16 */ /* no longer supported */
677 /* #define WLC_GET_RTS				17 */ /* no longer supported */
678 /* #define WLC_SET_RTS				18 */ /* no longer supported */
679 #define WLC_GET_INFRA				19
680 #define WLC_SET_INFRA				20
681 #define WLC_GET_AUTH				21
682 #define WLC_SET_AUTH				22
683 #define WLC_GET_BSSID				23
684 #define WLC_SET_BSSID				24
685 #define WLC_GET_SSID				25
686 #define WLC_SET_SSID				26
687 #define WLC_RESTART				27
688 #define WLC_TERMINATED				28
689 /* #define WLC_DUMP_SCB				28 */ /* no longer supported */
690 #define WLC_GET_CHANNEL				29
691 #define WLC_SET_CHANNEL				30
692 #define WLC_GET_SRL				31
693 #define WLC_SET_SRL				32
694 #define WLC_GET_LRL				33
695 #define WLC_SET_LRL				34
696 #define WLC_GET_PLCPHDR				35
697 #define WLC_SET_PLCPHDR				36
698 #define WLC_GET_RADIO				37
699 #define WLC_SET_RADIO				38
700 #define WLC_GET_PHYTYPE				39
701 #define WLC_DUMP_RATE				40
702 #define WLC_SET_RATE_PARAMS			41
703 #define WLC_GET_FIXRATE				42
704 #define WLC_SET_FIXRATE				43
705 /* #define WLC_GET_WEP				42 */ /* no longer supported */
706 /* #define WLC_SET_WEP				43 */ /* no longer supported */
707 #define WLC_GET_KEY				44
708 #define WLC_SET_KEY				45
709 #define WLC_GET_REGULATORY			46
710 #define WLC_SET_REGULATORY			47
711 #define WLC_GET_PASSIVE_SCAN			48
712 #define WLC_SET_PASSIVE_SCAN			49
713 #define WLC_SCAN				50
714 #define WLC_SCAN_RESULTS			51
715 #define WLC_DISASSOC				52
716 #define WLC_REASSOC				53
717 #define WLC_GET_ROAM_TRIGGER			54
718 #define WLC_SET_ROAM_TRIGGER			55
719 #define WLC_GET_ROAM_DELTA			56
720 #define WLC_SET_ROAM_DELTA			57
721 #define WLC_GET_ROAM_SCAN_PERIOD		58
722 #define WLC_SET_ROAM_SCAN_PERIOD		59
723 #define WLC_EVM					60	/* diag */
724 #define WLC_GET_TXANT				61
725 #define WLC_SET_TXANT				62
726 #define WLC_GET_ANTDIV				63
727 #define WLC_SET_ANTDIV				64
728 /* #define WLC_GET_TXPWR			65 */ /* no longer supported */
729 /* #define WLC_SET_TXPWR			66 */ /* no longer supported */
730 #define WLC_GET_CLOSED				67
731 #define WLC_SET_CLOSED				68
732 #define WLC_GET_MACLIST				69
733 #define WLC_SET_MACLIST				70
734 #define WLC_GET_RATESET				71
735 #define WLC_SET_RATESET				72
736 /* #define WLC_GET_LOCALE			73 */ /* no longer supported */
737 #define WLC_LONGTRAIN				74
738 #define WLC_GET_BCNPRD				75
739 #define WLC_SET_BCNPRD				76
740 #define WLC_GET_DTIMPRD				77
741 #define WLC_SET_DTIMPRD				78
742 #define WLC_GET_SROM				79
743 #define WLC_SET_SROM				80
744 #define WLC_GET_WEP_RESTRICT			81
745 #define WLC_SET_WEP_RESTRICT			82
746 #define WLC_GET_COUNTRY				83
747 #define WLC_SET_COUNTRY				84
748 #define WLC_GET_PM				85
749 #define WLC_SET_PM				86
750 #define WLC_GET_WAKE				87
751 #define WLC_SET_WAKE				88
752 /* #define WLC_GET_D11CNTS			89 */ /* -> "counters" iovar */
753 #define WLC_GET_FORCELINK			90	/* ndis only */
754 #define WLC_SET_FORCELINK			91	/* ndis only */
755 #define WLC_FREQ_ACCURACY			92	/* diag */
756 #define WLC_CARRIER_SUPPRESS			93	/* diag */
757 #define WLC_GET_PHYREG				94
758 #define WLC_SET_PHYREG				95
759 #define WLC_GET_RADIOREG			96
760 #define WLC_SET_RADIOREG			97
761 #define WLC_GET_REVINFO				98
762 #define WLC_GET_UCANTDIV			99
763 #define WLC_SET_UCANTDIV			100
764 #define WLC_R_REG				101
765 #define WLC_W_REG				102
766 /* #define WLC_DIAG_LOOPBACK			103	old tray diag */
767 /* #define WLC_RESET_D11CNTS			104 */ /* -> "reset_d11cnts" iovar */
768 #define WLC_GET_MACMODE				105
769 #define WLC_SET_MACMODE				106
770 #define WLC_GET_MONITOR				107
771 #define WLC_SET_MONITOR				108
772 #define WLC_GET_GMODE				109
773 #define WLC_SET_GMODE				110
774 #define WLC_GET_LEGACY_ERP			111
775 #define WLC_SET_LEGACY_ERP			112
776 #define WLC_GET_RX_ANT				113
777 #define WLC_GET_CURR_RATESET			114	/* current rateset */
778 #define WLC_GET_SCANSUPPRESS			115
779 #define WLC_SET_SCANSUPPRESS			116
780 #define WLC_GET_AP				117
781 #define WLC_SET_AP				118
782 #define WLC_GET_EAP_RESTRICT			119
783 #define WLC_SET_EAP_RESTRICT			120
784 #define WLC_SCB_AUTHORIZE			121
785 #define WLC_SCB_DEAUTHORIZE			122
786 #define WLC_GET_WDSLIST				123
787 #define WLC_SET_WDSLIST				124
788 #define WLC_GET_ATIM				125
789 #define WLC_SET_ATIM				126
790 #define WLC_GET_RSSI				127
791 #define WLC_GET_PHYANTDIV			128
792 #define WLC_SET_PHYANTDIV			129
793 #define WLC_AP_RX_ONLY				130
794 #define WLC_GET_TX_PATH_PWR			131
795 #define WLC_SET_TX_PATH_PWR			132
796 #define WLC_GET_WSEC				133
797 #define WLC_SET_WSEC				134
798 #define WLC_GET_PHY_NOISE			135
799 #define WLC_GET_BSS_INFO			136
800 #define WLC_GET_PKTCNTS				137
801 #define WLC_GET_LAZYWDS				138
802 #define WLC_SET_LAZYWDS				139
803 #define WLC_GET_BANDLIST			140
804 #define WLC_GET_BAND				141
805 #define WLC_SET_BAND				142
806 #define WLC_SCB_DEAUTHENTICATE			143
807 #define WLC_GET_SHORTSLOT			144
808 #define WLC_GET_SHORTSLOT_OVERRIDE		145
809 #define WLC_SET_SHORTSLOT_OVERRIDE		146
810 #define WLC_GET_SHORTSLOT_RESTRICT		147
811 #define WLC_SET_SHORTSLOT_RESTRICT		148
812 #define WLC_GET_GMODE_PROTECTION		149
813 #define WLC_GET_GMODE_PROTECTION_OVERRIDE	150
814 #define WLC_SET_GMODE_PROTECTION_OVERRIDE	151
815 #define WLC_UPGRADE				152
816 /* #define WLC_GET_MRATE			153 */ /* no longer supported */
817 /* #define WLC_SET_MRATE			154 */ /* no longer supported */
818 #define WLC_GET_IGNORE_BCNS			155
819 #define WLC_SET_IGNORE_BCNS			156
820 #define WLC_GET_SCB_TIMEOUT			157
821 #define WLC_SET_SCB_TIMEOUT			158
822 #define WLC_GET_ASSOCLIST			159
823 #define WLC_GET_CLK				160
824 #define WLC_SET_CLK				161
825 #define WLC_GET_UP				162
826 #define WLC_OUT					163
827 #define WLC_GET_WPA_AUTH			164
828 #define WLC_SET_WPA_AUTH			165
829 #define WLC_GET_UCFLAGS				166
830 #define WLC_SET_UCFLAGS				167
831 #define WLC_GET_PWRIDX				168
832 #define WLC_SET_PWRIDX				169
833 #define WLC_GET_TSSI				170
834 #define WLC_GET_SUP_RATESET_OVERRIDE		171
835 #define WLC_SET_SUP_RATESET_OVERRIDE		172
836 /* #define WLC_SET_FAST_TIMER			173 */ /* no longer supported */
837 /* #define WLC_GET_FAST_TIMER			174 */ /* no longer supported */
838 /* #define WLC_SET_SLOW_TIMER			175 */ /* no longer supported */
839 /* #define WLC_GET_SLOW_TIMER			176 */ /* no longer supported */
840 /* #define WLC_DUMP_PHYREGS			177 */ /* no longer supported */
841 #define WLC_GET_PROTECTION_CONTROL		178
842 #define WLC_SET_PROTECTION_CONTROL		179
843 #define WLC_GET_PHYLIST				180
844 #define WLC_ENCRYPT_STRENGTH			181	/* ndis only */
845 #define WLC_DECRYPT_STATUS			182	/* ndis only */
846 #define WLC_GET_KEY_SEQ				183
847 #define WLC_GET_SCAN_CHANNEL_TIME		184
848 #define WLC_SET_SCAN_CHANNEL_TIME		185
849 #define WLC_GET_SCAN_UNASSOC_TIME		186
850 #define WLC_SET_SCAN_UNASSOC_TIME		187
851 #define WLC_GET_SCAN_HOME_TIME			188
852 #define WLC_SET_SCAN_HOME_TIME			189
853 #define WLC_GET_SCAN_NPROBES			190
854 #define WLC_SET_SCAN_NPROBES			191
855 #define WLC_GET_PRB_RESP_TIMEOUT		192
856 #define WLC_SET_PRB_RESP_TIMEOUT		193
857 #define WLC_GET_ATTEN				194
858 #define WLC_SET_ATTEN				195
859 #define WLC_GET_SHMEM				196	/* diag */
860 #define WLC_SET_SHMEM				197	/* diag */
861 /* #define WLC_GET_GMODE_PROTECTION_CTS		198 */ /* no longer supported */
862 /* #define WLC_SET_GMODE_PROTECTION_CTS		199 */ /* no longer supported */
863 #define WLC_SET_WSEC_TEST			200
864 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON	201
865 #define WLC_TKIP_COUNTERMEASURES		202
866 #define WLC_GET_PIOMODE				203
867 #define WLC_SET_PIOMODE				204
868 #define WLC_SET_ASSOC_PREFER			205
869 #define WLC_GET_ASSOC_PREFER			206
870 #define WLC_SET_ROAM_PREFER			207
871 #define WLC_GET_ROAM_PREFER			208
872 /* #define WLC_SET_LED				209 */ /* no longer supported */
873 /* #define WLC_GET_LED				210 */ /* no longer supported */
874 #define WLC_GET_INTERFERENCE_MODE		211
875 #define WLC_SET_INTERFERENCE_MODE		212
876 #define WLC_GET_CHANNEL_QA			213
877 #define WLC_START_CHANNEL_QA			214
878 #define WLC_GET_CHANNEL_SEL			215
879 #define WLC_START_CHANNEL_SEL			216
880 #define WLC_GET_VALID_CHANNELS			217
881 #define WLC_GET_FAKEFRAG			218
882 #define WLC_SET_FAKEFRAG			219
883 #define WLC_GET_PWROUT_PERCENTAGE		220
884 #define WLC_SET_PWROUT_PERCENTAGE		221
885 #define WLC_SET_BAD_FRAME_PREEMPT		222
886 #define WLC_GET_BAD_FRAME_PREEMPT		223
887 #define WLC_SET_LEAP_LIST			224
888 #define WLC_GET_LEAP_LIST			225
889 #define WLC_GET_CWMIN				226
890 #define WLC_SET_CWMIN				227
891 #define WLC_GET_CWMAX				228
892 #define WLC_SET_CWMAX				229
893 #define WLC_GET_WET				230
894 #define WLC_SET_WET				231
895 #define WLC_GET_PUB				232
896 /* #define WLC_SET_GLACIAL_TIMER		233 */ /* no longer supported */
897 /* #define WLC_GET_GLACIAL_TIMER		234 */ /* no longer supported */
898 #define WLC_GET_KEY_PRIMARY			235
899 #define WLC_SET_KEY_PRIMARY			236
900 
901 /* #define WLC_DUMP_RADIOREGS			237 */ /* no longer supported */
902 #define WLC_GET_ACI_ARGS			238
903 #define WLC_SET_ACI_ARGS			239
904 #define WLC_UNSET_CALLBACK			240
905 #define WLC_SET_CALLBACK			241
906 #define WLC_GET_RADAR				242
907 #define WLC_SET_RADAR				243
908 #define WLC_SET_SPECT_MANAGMENT			244
909 #define WLC_GET_SPECT_MANAGMENT			245
910 #define WLC_WDS_GET_REMOTE_HWADDR		246	/* handled in wl_linux.c/wl_vx.c */
911 #define WLC_WDS_GET_WPA_SUP			247
912 #define WLC_SET_CS_SCAN_TIMER			248
913 #define WLC_GET_CS_SCAN_TIMER			249
914 #define WLC_MEASURE_REQUEST			250
915 #define WLC_INIT				251
916 #define WLC_SEND_QUIET				252
917 #define WLC_KEEPALIVE			253
918 #define WLC_SEND_PWR_CONSTRAINT			254
919 #define WLC_UPGRADE_STATUS			255
920 #define WLC_CURRENT_PWR				256
921 #define WLC_GET_SCAN_PASSIVE_TIME		257
922 #define WLC_SET_SCAN_PASSIVE_TIME		258
923 #define WLC_LEGACY_LINK_BEHAVIOR		259
924 #define WLC_GET_CHANNELS_IN_COUNTRY		260
925 #define WLC_GET_COUNTRY_LIST			261
926 #define WLC_GET_VAR				262	/* get value of named variable */
927 #define WLC_SET_VAR				263	/* set named variable to value */
928 #define WLC_NVRAM_GET				264	/* deprecated */
929 #define WLC_NVRAM_SET				265
930 #define WLC_NVRAM_DUMP				266
931 #define WLC_REBOOT				267
932 #define WLC_SET_WSEC_PMK			268
933 #define WLC_GET_AUTH_MODE			269
934 #define WLC_SET_AUTH_MODE			270
935 #define WLC_GET_WAKEENTRY			271
936 #define WLC_SET_WAKEENTRY			272
937 #define WLC_NDCONFIG_ITEM			273	/* currently handled in wl_oid.c */
938 #define WLC_NVOTPW				274
939 #define WLC_OTPW				275
940 #define WLC_IOV_BLOCK_GET			276
941 #define WLC_IOV_MODULES_GET			277
942 #define WLC_SOFT_RESET				278
943 #define WLC_GET_ALLOW_MODE			279
944 #define WLC_SET_ALLOW_MODE			280
945 #define WLC_GET_DESIRED_BSSID			281
946 #define WLC_SET_DESIRED_BSSID			282
947 #define	WLC_DISASSOC_MYAP			283
948 #define WLC_GET_NBANDS				284	/* for Dongle EXT_STA support */
949 #define WLC_GET_BANDSTATES			285	/* for Dongle EXT_STA support */
950 #define WLC_GET_WLC_BSS_INFO			286	/* for Dongle EXT_STA support */
951 #define WLC_GET_ASSOC_INFO			287	/* for Dongle EXT_STA support */
952 #define WLC_GET_OID_PHY				288	/* for Dongle EXT_STA support */
953 #define WLC_SET_OID_PHY				289	/* for Dongle EXT_STA support */
954 #define WLC_SET_ASSOC_TIME			290	/* for Dongle EXT_STA support */
955 #define WLC_GET_DESIRED_SSID			291	/* for Dongle EXT_STA support */
956 #define WLC_GET_CHANSPEC			292	/* for Dongle EXT_STA support */
957 #define WLC_GET_ASSOC_STATE			293	/* for Dongle EXT_STA support */
958 #define WLC_SET_PHY_STATE			294	/* for Dongle EXT_STA support */
959 #define WLC_GET_SCAN_PENDING			295	/* for Dongle EXT_STA support */
960 #define WLC_GET_SCANREQ_PENDING			296	/* for Dongle EXT_STA support */
961 #define WLC_GET_PREV_ROAM_REASON		297	/* for Dongle EXT_STA support */
962 #define WLC_SET_PREV_ROAM_REASON		298	/* for Dongle EXT_STA support */
963 #define WLC_GET_BANDSTATES_PI			299	/* for Dongle EXT_STA support */
964 #define WLC_GET_PHY_STATE			300	/* for Dongle EXT_STA support */
965 #define WLC_GET_BSS_WPA_RSN			301	/* for Dongle EXT_STA support */
966 #define WLC_GET_BSS_WPA2_RSN			302	/* for Dongle EXT_STA support */
967 #define WLC_GET_BSS_BCN_TS			303	/* for Dongle EXT_STA support */
968 #define WLC_GET_INT_DISASSOC			304	/* for Dongle EXT_STA support */
969 #define WLC_SET_NUM_PEERS			305     /* for Dongle EXT_STA support */
970 #define WLC_GET_NUM_BSS				306	/* for Dongle EXT_STA support */
971 #define WLC_PHY_SAMPLE_COLLECT			307	/* phy sample collect mode */
972 /* #define WLC_UM_PRIV				308 */	/* Deprecated: usermode driver */
973 #define WLC_GET_CMD				309
974 /* #define WLC_LAST				310 */	/* Never used - can be reused */
975 #define WLC_SET_INTERFERENCE_OVERRIDE_MODE	311	/* set inter mode override */
976 #define WLC_GET_INTERFERENCE_OVERRIDE_MODE	312	/* get inter mode override */
977 /* #define WLC_GET_WAI_RESTRICT	313 */	/* for WAPI, deprecated use iovar instead */
978 /* #define WLC_SET_WAI_RESTRICT	314 */	/* for WAPI, deprecated use iovar instead */
979 /* #define WLC_SET_WAI_REKEY	315 */	/* for WAPI, deprecated use iovar instead */
980 #define WLC_SET_NAT_CONFIG			316	/* for configuring NAT filter driver */
981 #define WLC_GET_NAT_STATE			317
982 #define WLC_GET_TXBF_RATESET			318
983 #define WLC_SET_TXBF_RATESET			319
984 #define WLC_SCAN_CQ				320
985 #define WLC_GET_RSSI_QDB			321 /* qdB portion of the RSSI */
986 #define WLC_DUMP_RATESET			322
987 #define WLC_ECHO				323
988 #define WLC_SCB_AUTHENTICATE	325
989 #define WLC_LAST				326	/* The last ioctl. Also push this
990 							 * number when adding new ioctls
991 							 */
992 /*
993  * Alert:
994  * Duplicate a few definitions that irelay requires from epiioctl.h here
995  * so caller doesn't have to include this file and epiioctl.h .
996  * If this grows any more, it would be time to move these irelay-specific
997  * definitions out of the epiioctl.h and into a separate driver common file.
998  */
999 #define WLC_SPEC_FLAG			0x80000000 /* For some special IOCTL */
1000 #ifndef EPICTRL_COOKIE
1001 #define EPICTRL_COOKIE		0xABADCEDE
1002 #endif
1003 
1004 /* vx wlc ioctl's offset */
1005 #define CMN_IOCTL_OFF 0x180
1006 
1007 /*
1008  * custom OID support
1009  *
1010  * 0xFF - implementation specific OID
1011  * 0xE4 - first byte of Broadcom PCI vendor ID
1012  * 0x14 - second byte of Broadcom PCI vendor ID
1013  * 0xXX - the custom OID number
1014  */
1015 
1016 /* begin 0x1f values beyond the start of the ET driver range. */
1017 #define WL_OID_BASE		0xFFE41420
1018 
1019 /* NDIS overrides */
1020 #define OID_WL_GETINSTANCE	(WL_OID_BASE + WLC_GET_INSTANCE)
1021 #define OID_WL_GET_FORCELINK	(WL_OID_BASE + WLC_GET_FORCELINK)
1022 #define OID_WL_SET_FORCELINK	(WL_OID_BASE + WLC_SET_FORCELINK)
1023 #define	OID_WL_ENCRYPT_STRENGTH	(WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
1024 #define OID_WL_DECRYPT_STATUS	(WL_OID_BASE + WLC_DECRYPT_STATUS)
1025 #define OID_LEGACY_LINK_BEHAVIOR (WL_OID_BASE + WLC_LEGACY_LINK_BEHAVIOR)
1026 #define OID_WL_NDCONFIG_ITEM	(WL_OID_BASE + WLC_NDCONFIG_ITEM)
1027 
1028 /* EXT_STA Dongle suuport */
1029 #define OID_STA_CHANSPEC	(WL_OID_BASE + WLC_GET_CHANSPEC)
1030 #define OID_STA_NBANDS		(WL_OID_BASE + WLC_GET_NBANDS)
1031 #define OID_STA_GET_PHY		(WL_OID_BASE + WLC_GET_OID_PHY)
1032 #define OID_STA_SET_PHY		(WL_OID_BASE + WLC_SET_OID_PHY)
1033 #define OID_STA_ASSOC_TIME	(WL_OID_BASE + WLC_SET_ASSOC_TIME)
1034 #define OID_STA_DESIRED_SSID	(WL_OID_BASE + WLC_GET_DESIRED_SSID)
1035 #define OID_STA_SET_PHY_STATE	(WL_OID_BASE + WLC_SET_PHY_STATE)
1036 #define OID_STA_SCAN_PENDING	(WL_OID_BASE + WLC_GET_SCAN_PENDING)
1037 #define OID_STA_SCANREQ_PENDING (WL_OID_BASE + WLC_GET_SCANREQ_PENDING)
1038 #define OID_STA_GET_ROAM_REASON (WL_OID_BASE + WLC_GET_PREV_ROAM_REASON)
1039 #define OID_STA_SET_ROAM_REASON (WL_OID_BASE + WLC_SET_PREV_ROAM_REASON)
1040 #define OID_STA_GET_PHY_STATE	(WL_OID_BASE + WLC_GET_PHY_STATE)
1041 #define OID_STA_INT_DISASSOC	(WL_OID_BASE + WLC_GET_INT_DISASSOC)
1042 #define OID_STA_SET_NUM_PEERS	(WL_OID_BASE + WLC_SET_NUM_PEERS)
1043 #define OID_STA_GET_NUM_BSS	(WL_OID_BASE + WLC_GET_NUM_BSS)
1044 
1045 /* NAT filter driver support */
1046 #define OID_NAT_SET_CONFIG	(WL_OID_BASE + WLC_SET_NAT_CONFIG)
1047 #define OID_NAT_GET_STATE	(WL_OID_BASE + WLC_GET_NAT_STATE)
1048 
1049 #define WL_DECRYPT_STATUS_SUCCESS	1
1050 #define WL_DECRYPT_STATUS_FAILURE	2
1051 #define WL_DECRYPT_STATUS_UNKNOWN	3
1052 
1053 /* allows user-mode app to poll the status of USB image upgrade */
1054 #define WLC_UPGRADE_SUCCESS			0
1055 #define WLC_UPGRADE_PENDING			1
1056 
1057 /* WLC_GET_AUTH, WLC_SET_AUTH values */
1058 #define WL_AUTH_OPEN_SYSTEM		0	/* d11 open authentication */
1059 #define WL_AUTH_SHARED_KEY		1	/* d11 shared authentication */
1060 #define WL_AUTH_OPEN_SHARED		2	/* try open, then shared if open failed w/rc 13 */
1061 #define WL_AUTH_SAE_KEY			3	/* d11 sae authentication */
1062 #define WL_AUTH_FILS_SHARED		4	/* d11 fils shared key authentication */
1063 #define WL_AUTH_FILS_SHARED_PFS		5	/* d11 fils shared key w/ pfs authentication */
1064 #define WL_AUTH_FILS_PUBLIC		6	/* d11 fils public key authentication */
1065 /* Some branch use different define for WL_AUTH_OPEN_SHARED
1066  * for example, PHOENIX2 Branch defined WL_AUTH_OPEN_SHARED as 3
1067  * But other branch defined WL_AUTH_OPEN_SHARED as 2
1068  * if it is mismatch, WEP association can be failed.
1069  * More information - RB:5320
1070  */
1071 
1072 /* a large TX Power as an init value to factor out of MIN() calculations,
1073  * keep low enough to fit in an int8, units are .25 dBm
1074  */
1075 #define WLC_TXPWR_MAX		(127)	/* ~32 dBm = 1,500 mW */
1076 
1077 /* "diag" iovar argument and error code */
1078 #define WL_DIAG_INTERRUPT			1	/* d11 loopback interrupt test */
1079 #define WL_DIAG_LOOPBACK			2	/* d11 loopback data test */
1080 #define WL_DIAG_MEMORY				3	/* d11 memory test */
1081 #define WL_DIAG_LED				4	/* LED test */
1082 #define WL_DIAG_REG				5	/* d11/phy register test */
1083 #define WL_DIAG_SROM				6	/* srom read/crc test */
1084 #define WL_DIAG_DMA				7	/* DMA test */
1085 #define WL_DIAG_LOOPBACK_EXT			8	/* enhenced d11 loopback data test */
1086 
1087 #define WL_DIAGERR_SUCCESS			0
1088 #define WL_DIAGERR_FAIL_TO_RUN			1	/* unable to run requested diag */
1089 #define WL_DIAGERR_NOT_SUPPORTED		2	/* diag requested is not supported */
1090 #define WL_DIAGERR_INTERRUPT_FAIL		3	/* loopback interrupt test failed */
1091 #define WL_DIAGERR_LOOPBACK_FAIL		4	/* loopback data test failed */
1092 #define WL_DIAGERR_SROM_FAIL			5	/* srom read failed */
1093 #define WL_DIAGERR_SROM_BADCRC			6	/* srom crc failed */
1094 #define WL_DIAGERR_REG_FAIL			7	/* d11/phy register test failed */
1095 #define WL_DIAGERR_MEMORY_FAIL			8	/* d11 memory test failed */
1096 #define WL_DIAGERR_NOMEM			9	/* diag test failed due to no memory */
1097 #define WL_DIAGERR_DMA_FAIL			10	/* DMA test failed */
1098 
1099 #define WL_DIAGERR_MEMORY_TIMEOUT		11	/* d11 memory test didn't finish in time */
1100 #define WL_DIAGERR_MEMORY_BADPATTERN		12	/* d11 memory test result in bad pattern */
1101 
1102 /* band types */
1103 #define	WLC_BAND_AUTO		0	/* auto-select */
1104 #define	WLC_BAND_5G		1	/* 5 Ghz */
1105 #define	WLC_BAND_2G		2	/* 2.4 Ghz */
1106 #define	WLC_BAND_ALL		3	/* all bands */
1107 #define	WLC_BAND_6G		4	/* 6 Ghz */
1108 #define WLC_BAND_INVALID	-1	/* Invalid band */
1109 
1110 #define WL_BAND_MAX_CNT         3       /* max number of bands supported */
1111 
1112 /* band range returned by band_range iovar */
1113 #define WL_CHAN_FREQ_RANGE_2G      0
1114 #define WL_CHAN_FREQ_RANGE_5GL     1
1115 #define WL_CHAN_FREQ_RANGE_5GM     2
1116 #define WL_CHAN_FREQ_RANGE_5GH     3
1117 
1118 #define WL_CHAN_FREQ_RANGE_5GLL_5BAND    4
1119 #define WL_CHAN_FREQ_RANGE_5GLH_5BAND    5
1120 #define WL_CHAN_FREQ_RANGE_5GML_5BAND    6
1121 #define WL_CHAN_FREQ_RANGE_5GMH_5BAND    7
1122 #define WL_CHAN_FREQ_RANGE_5GH_5BAND     8
1123 
1124 #define WL_CHAN_FREQ_RANGE_5G_BAND0     1
1125 #define WL_CHAN_FREQ_RANGE_5G_BAND1     2
1126 #define WL_CHAN_FREQ_RANGE_5G_BAND2     3
1127 #define WL_CHAN_FREQ_RANGE_5G_BAND3     4
1128 #define WL_CHAN_FREQ_RANGE_5G_4BAND     5
1129 #define WL_CHAN_FREQ_RANGE_6G_6BAND		6
1130 
1131 /* SROM12 */
1132 #define WL_CHAN_FREQ_RANGE_5G_BAND4 5
1133 #define WL_CHAN_FREQ_RANGE_2G_40 6
1134 #define WL_CHAN_FREQ_RANGE_5G_BAND0_40 7
1135 #define WL_CHAN_FREQ_RANGE_5G_BAND1_40 8
1136 #define WL_CHAN_FREQ_RANGE_5G_BAND2_40 9
1137 #define WL_CHAN_FREQ_RANGE_5G_BAND3_40 10
1138 #define WL_CHAN_FREQ_RANGE_5G_BAND4_40 11
1139 #define WL_CHAN_FREQ_RANGE_5G_BAND0_80 12
1140 #define WL_CHAN_FREQ_RANGE_5G_BAND1_80 13
1141 #define WL_CHAN_FREQ_RANGE_5G_BAND2_80 14
1142 #define WL_CHAN_FREQ_RANGE_5G_BAND3_80 15
1143 #define WL_CHAN_FREQ_RANGE_5G_BAND4_80 16
1144 
1145 #define WL_CHAN_FREQ_RANGE_5G_5BAND	18
1146 #define WL_CHAN_FREQ_RANGE_5G_5BAND_40	19
1147 #define WL_CHAN_FREQ_RANGE_5G_5BAND_80	20
1148 
1149 #define WLC_MACMODE_DISABLED	0	/* MAC list disabled */
1150 #define WLC_MACMODE_DENY	1	/* Deny specified (i.e. allow unspecified) */
1151 #define WLC_MACMODE_ALLOW	2	/* Allow specified (i.e. deny unspecified) */
1152 #define WLC_MACMODE_AVOID	3	/* Avoid specified (i.e. conditionally avoid unspecified) */
1153 
1154 /*
1155  * 54g modes (basic bits may still be overridden)
1156  *
1157  * GMODE_LEGACY_B			Rateset: 1b, 2b, 5.5, 11
1158  *					Preamble: Long
1159  *					Shortslot: Off
1160  * GMODE_AUTO				Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1161  *					Extended Rateset: 6, 9, 12, 48
1162  *					Preamble: Long
1163  *					Shortslot: Auto
1164  * GMODE_ONLY				Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54
1165  *					Extended Rateset: 6b, 9, 12b, 48
1166  *					Preamble: Short required
1167  *					Shortslot: Auto
1168  * GMODE_B_DEFERRED			Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1169  *					Extended Rateset: 6, 9, 12, 48
1170  *					Preamble: Long
1171  *					Shortslot: On
1172  * GMODE_PERFORMANCE			Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54
1173  *					Preamble: Short required
1174  *					Shortslot: On and required
1175  * GMODE_LRS				Rateset: 1b, 2b, 5.5b, 11b
1176  *					Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54
1177  *					Preamble: Long
1178  *					Shortslot: Auto
1179  */
1180 #define GMODE_LEGACY_B		0
1181 #define GMODE_AUTO		1
1182 #define GMODE_ONLY		2
1183 #define GMODE_B_DEFERRED	3
1184 #define GMODE_PERFORMANCE	4
1185 #define GMODE_LRS		5
1186 #define GMODE_MAX		6
1187 
1188 /* values for PLCPHdr_override */
1189 #define WLC_PLCP_AUTO	-1
1190 #define WLC_PLCP_SHORT	0
1191 #define WLC_PLCP_LONG	1
1192 
1193 /* values for g_protection_override and n_protection_override */
1194 #define WLC_PROTECTION_AUTO		-1
1195 #define WLC_PROTECTION_OFF		0
1196 #define WLC_PROTECTION_ON		1
1197 #define WLC_PROTECTION_MMHDR_ONLY	2
1198 #define WLC_PROTECTION_CTS_ONLY		3
1199 
1200 /* values for g_protection_control and n_protection_control */
1201 #define WLC_PROTECTION_CTL_OFF		0
1202 #define WLC_PROTECTION_CTL_LOCAL	1
1203 #define WLC_PROTECTION_CTL_OVERLAP	2
1204 
1205 /* values for n_protection */
1206 #define WLC_N_PROTECTION_OFF		0
1207 #define WLC_N_PROTECTION_OPTIONAL	1
1208 #define WLC_N_PROTECTION_20IN40		2
1209 #define WLC_N_PROTECTION_MIXEDMODE	3
1210 
1211 /* values for n_preamble_type */
1212 #define WLC_N_PREAMBLE_MIXEDMODE	0
1213 #define WLC_N_PREAMBLE_GF		1
1214 #define WLC_N_PREAMBLE_GF_BRCM          2
1215 
1216 /* values for band specific 40MHz capabilities (deprecated) */
1217 #define WLC_N_BW_20ALL			0
1218 #define WLC_N_BW_40ALL			1
1219 #define WLC_N_BW_20IN2G_40IN5G		2
1220 
1221 #define WLC_BW_20MHZ_BIT		(1<<0)
1222 #define WLC_BW_40MHZ_BIT		(1<<1)
1223 #define WLC_BW_80MHZ_BIT		(1<<2)
1224 #define WLC_BW_160MHZ_BIT		(1<<3)
1225 #define WLC_BW_240MHZ_BIT		(1<<4)
1226 #define WLC_BW_320MHZ_BIT		(1u<<5u)
1227 
1228 /* Bandwidth capabilities */
1229 #define WLC_BW_CAP_20MHZ		(WLC_BW_20MHZ_BIT)
1230 #define WLC_BW_CAP_40MHZ		(WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
1231 #define WLC_BW_CAP_80MHZ		(WLC_BW_80MHZ_BIT|WLC_BW_40MHZ_BIT| \
1232 					 WLC_BW_20MHZ_BIT)
1233 #define WLC_BW_CAP_160MHZ		(WLC_BW_160MHZ_BIT|WLC_BW_80MHZ_BIT| \
1234 					 WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
1235 #define WLC_BW_CAP_320MHZ		(WLC_BW_320MHZ_BIT| \
1236 					 WLC_BW_160MHZ_BIT|WLC_BW_80MHZ_BIT| \
1237 					 WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
1238 #define WLC_BW_CAP_240MHZ		(WLC_BW_240MHZ_BIT| \
1239 					WLC_BW_160MHZ_BIT|WLC_BW_80MHZ_BIT| \
1240 					WLC_BW_40MHZ_BIT|WLC_BW_20MHZ_BIT)
1241 #define WLC_BW_CAP_UNRESTRICTED		0xFF
1242 
1243 #define WL_BW_CAP_20MHZ(bw_cap)		(((bw_cap) & WLC_BW_20MHZ_BIT) ? TRUE : FALSE)
1244 #define WL_BW_CAP_40MHZ(bw_cap)		(((bw_cap) & WLC_BW_40MHZ_BIT) ? TRUE : FALSE)
1245 #define WL_BW_CAP_80MHZ(bw_cap)		(((bw_cap) & WLC_BW_80MHZ_BIT) ? TRUE : FALSE)
1246 #define WL_BW_CAP_160MHZ(bw_cap)	(((bw_cap) & WLC_BW_160MHZ_BIT) ? TRUE : FALSE)
1247 #define WL_BW_CAP_240MHZ(bw_cap)	(((bw_cap) & WLC_BW_240MHZ_BIT) ? TRUE : FALSE)
1248 #define WL_BW_CAP_320MHZ(bw_cap)	(((bw_cap) & WLC_BW_320MHZ_BIT) ? TRUE : FALSE)
1249 
1250 /* values to force tx/rx chain */
1251 #define WLC_N_TXRX_CHAIN0		0
1252 #define WLC_N_TXRX_CHAIN1		1
1253 
1254 /* bitflags for SGI support (sgi_rx iovar) */
1255 #define WLC_N_SGI_20			0x01
1256 #define WLC_N_SGI_40			0x02
1257 #define WLC_VHT_SGI_80			0x04
1258 #define WLC_VHT_SGI_160			0x08
1259 
1260 /* when sgi_tx==WLC_SGI_ALL, bypass rate selection, enable sgi for all mcs */
1261 #define WLC_SGI_ALL			0x02
1262 
1263 #define LISTEN_INTERVAL			10
1264 /* interference mitigation options */
1265 #define	INTERFERE_OVRRIDE_OFF	-1	/* interference override off */
1266 #define	INTERFERE_NONE	0	/* off */
1267 #define	NON_WLAN	1	/* foreign/non 802.11 interference, no auto detect */
1268 #define	WLAN_MANUAL	2	/* ACI: no auto detection */
1269 #define	WLAN_AUTO	3	/* ACI: auto detect */
1270 #define	WLAN_AUTO_W_NOISE	4	/* ACI: auto - detect and non 802.11 interference */
1271 #define AUTO_ACTIVE	(1 << 7) /* Auto is currently active */
1272 
1273 /* interfernece mode bit-masks (ACPHY) */
1274 #define ACPHY_ACI_GLITCHBASED_DESENSE 1   /* bit 0 */
1275 #define ACPHY_ACI_HWACI_PKTGAINLMT 2      /* bit 1 */
1276 #define ACPHY_ACI_W2NB_PKTGAINLMT 4       /* bit 2 */
1277 #define ACPHY_ACI_PREEMPTION 8            /* bit 3 */
1278 #define ACPHY_HWACI_MITIGATION 16         /* bit 4 */
1279 #define ACPHY_LPD_PREEMPTION 32           /* bit 5 */
1280 #define ACPHY_HWOBSS_MITIGATION 64        /* bit 6 */
1281 #define ACPHY_ACI_MAX_MODE 127
1282 
1283 /* AP environment */
1284 #define AP_ENV_DETECT_NOT_USED		0 /* We aren't using AP environment detection */
1285 #define AP_ENV_DENSE			1 /* "Corporate" or other AP dense environment */
1286 #define AP_ENV_SPARSE			2 /* "Home" or other sparse environment */
1287 #define AP_ENV_INDETERMINATE		3 /* AP environment hasn't been identified */
1288 
1289 #define TRIGGER_NOW				0
1290 #define TRIGGER_CRS				0x01
1291 #define TRIGGER_CRSDEASSERT			0x02
1292 #define TRIGGER_GOODFCS				0x04
1293 #define TRIGGER_BADFCS				0x08
1294 #define TRIGGER_BADPLCP				0x10
1295 #define TRIGGER_CRSGLITCH			0x20
1296 #define TRIGGER_ASYNC				0x40
1297 
1298 #define	WL_SAMPLEDATA_HEADER_TYPE	1
1299 #define WL_SAMPLEDATA_HEADER_SIZE	80	/* sample collect header size (bytes) */
1300 #define	WL_SAMPLEDATA_TYPE		2
1301 #define	WL_SAMPLEDATA_SEQ		0xff	/* sequence # */
1302 #define	WL_SAMPLEDATA_MORE_DATA		0x100	/* more data mask */
1303 
1304 /* WL_OTA START */
1305 #define WL_OTA_ARG_PARSE_BLK_SIZE	1200
1306 #define WL_OTA_TEST_MAX_NUM_RATE	30
1307 #define WL_OTA_TEST_MAX_NUM_SEQ		100
1308 #define WL_OTA_TEST_MAX_NUM_RSSI	85
1309 #define WL_THRESHOLD_LO_BAND	70	/* range from 5250MHz - 5350MHz */
1310 
1311 /* radar iovar SET defines */
1312 #define WL_RADAR_DETECTOR_OFF		0	/* radar detector off */
1313 #define WL_RADAR_DETECTOR_ON		1	/* radar detector on */
1314 #define WL_RADAR_SIMULATED		2	/* force radar detector to declare
1315 						 * detection once
1316 						 */
1317 #define WL_RADAR_SIMULATED_SC		3	/* force radar detector to declare
1318 						 * detection once on scan core
1319 						 * if available and active
1320 						 */
1321 #define WL_RSSI_ANT_VERSION	1	/* current version of wl_rssi_ant_t */
1322 #define WL_ANT_RX_MAX		2	/* max 2 receive antennas */
1323 #define WL_ANT_HT_RX_MAX	4	/* max 4 receive antennas/cores */
1324 #define WL_ANT_IDX_1		0	/* antenna index 1 */
1325 #define WL_ANT_IDX_2		1	/* antenna index 2 */
1326 
1327 #ifndef WL_RSSI_ANT_MAX
1328 #define WL_RSSI_ANT_MAX		4	/* max possible rx antennas */
1329 #elif WL_RSSI_ANT_MAX != 4
1330 #error "WL_RSSI_ANT_MAX does not match"
1331 #endif
1332 
1333 /* dfs_status iovar-related defines */
1334 
1335 /* cac - channel availability check,
1336  * ism - in-service monitoring
1337  * csa - channel switching announcement
1338  */
1339 
1340 /* cac state values */
1341 #define WL_DFS_CACSTATE_IDLE		0	/* state for operating in non-radar channel */
1342 #define	WL_DFS_CACSTATE_PREISM_CAC	1	/* CAC in progress */
1343 #define WL_DFS_CACSTATE_ISM		2	/* ISM in progress */
1344 #define WL_DFS_CACSTATE_CSA		3	/* csa */
1345 #define WL_DFS_CACSTATE_POSTISM_CAC	4	/* ISM CAC */
1346 #define WL_DFS_CACSTATE_PREISM_OOC	5	/* PREISM OOC */
1347 #define WL_DFS_CACSTATE_POSTISM_OOC	6	/* POSTISM OOC */
1348 #define WL_DFS_CACSTATES		7	/* this many states exist */
1349 
1350 /* Defines used with channel_bandwidth for curpower */
1351 #define WL_BW_20MHZ		0
1352 #define WL_BW_40MHZ		1
1353 #define WL_BW_80MHZ		2
1354 #define WL_BW_160MHZ		3
1355 #define WL_BW_8080MHZ		4
1356 #define WL_BW_2P5MHZ		5
1357 #define WL_BW_5MHZ		6
1358 #define WL_BW_10MHZ		7
1359 #define WL_BW_320MHZ		8u
1360 
1361 /* tx_power_t.flags bits */
1362 #define WL_TX_POWER_F_ENABLED	1
1363 #define WL_TX_POWER_F_HW		2
1364 #define WL_TX_POWER_F_MIMO		4
1365 #define WL_TX_POWER_F_SISO		8
1366 #define WL_TX_POWER_F_HT		0x10
1367 #define WL_TX_POWER_F_VHT		0x20
1368 #define WL_TX_POWER_F_OPENLOOP		0x40
1369 #define WL_TX_POWER_F_PROP11NRATES	0x80
1370 #define WL_TX_POWER_F_UNIT_QDBM		0x100
1371 #define WL_TX_POWER_F_TXCAP		0x200
1372 #define WL_TX_POWER_F_HE		0x400
1373 #define WL_TX_POWER_F_RU_RATE		0x800
1374 
1375 /* Message levels */
1376 #define WL_ERROR_VAL		0x00000001
1377 #define WL_TRACE_VAL		0x00000002
1378 #define WL_PRHDRS_VAL		0x00000004
1379 #define WL_PRPKT_VAL		0x00000008
1380 #define WL_INFORM_VAL		0x00000010
1381 #define WL_TMP_VAL		0x00000020
1382 #define WL_OID_VAL		0x00000040
1383 #define WL_RATE_VAL		0x00000080
1384 #define WL_ASSOC_VAL		0x00000100
1385 #define WL_PRUSR_VAL		0x00000200
1386 #define WL_PS_VAL		0x00000400
1387 #define WL_TXPWR_VAL		0x00000000	/* retired in TOT on 6/10/2009 */
1388 #define WL_MODE_SWITCH_VAL	0x00000800	/* Using retired TXPWR val */
1389 #define WL_PORT_VAL		0x00001000
1390 #define WL_DUAL_VAL		0x00002000
1391 #define WL_WSEC_VAL		0x00004000
1392 #define WL_WSEC_DUMP_VAL	0x00008000
1393 #define WL_LOG_VAL		0x00010000
1394 #define WL_NRSSI_VAL		0x00000000	/* retired in TOT on 6/10/2009 */
1395 #define WL_BCNTRIM_VAL		0x00020000	/* Using retired NRSSI VAL */
1396 #define WL_LOFT_VAL		0x00000000	/* retired in TOT on 6/10/2009 */
1397 #define WL_PFN_VAL		0x00040000	/* Using retired LOFT_VAL */
1398 #define WL_REGULATORY_VAL	0x00080000
1399 #define WL_CSA_VAL		0x00080000	/* Reusing REGULATORY_VAL due to lackof bits */
1400 #define WL_TAF_VAL		0x00100000
1401 #define WL_RADAR_VAL		0x00000000	/* retired in TOT on 6/10/2009 */
1402 #define WL_WDI_VAL		0x00200000	/* Using retired WL_RADAR_VAL VAL */
1403 #define WL_MPC_VAL		0x00400000
1404 #define WL_APSTA_VAL		0x00800000
1405 #define WL_DFS_VAL		0x01000000
1406 #define WL_BA_VAL		0x00000000	/* retired in TOT on 6/14/2010 */
1407 #define WL_MUMIMO_VAL		0x02000000      /* Using retired WL_BA_VAL */
1408 #define WL_ACI_VAL		0x04000000
1409 #define WL_PRMAC_VAL		0x04000000
1410 #define WL_MBSS_VAL		0x04000000
1411 #define WL_CAC_VAL		0x08000000
1412 #define WL_AMSDU_VAL		0x10000000
1413 #define WL_AMPDU_VAL		0x20000000
1414 #define WL_FFPLD_VAL		0x40000000
1415 #define WL_ROAM_EXP_VAL		0x80000000
1416 
1417 /* wl_msg_level is full. For new bits take the next one and AND with
1418  * wl_msg_level2 in wl_dbg.h
1419  */
1420 #define WL_DPT_VAL		0x00000001
1421 /* re-using WL_DPT_VAL */
1422 /* re-using WL_MESH_VAL */
1423 #define WL_NATOE_VAL		0x00000001
1424 #define WL_MESH_VAL		0x00000001
1425 #define WL_SCAN_VAL		0x00000002
1426 #define WL_WOWL_VAL		0x00000004
1427 #define WL_COEX_VAL		0x00000008
1428 #define WL_RTDC_VAL		0x00000010
1429 #define WL_PROTO_VAL		0x00000020
1430 #define WL_SWDIV_VAL		0x00000040
1431 #define WL_CHANINT_VAL		0x00000080
1432 #define WL_WMF_VAL		0x00000100
1433 #define WL_P2P_VAL		0x00000200
1434 #define WL_ITFR_VAL		0x00000400
1435 #define WL_MCHAN_VAL		0x00000800
1436 #define WL_TDLS_VAL		0x00001000
1437 #define WL_MCNX_VAL		0x00002000
1438 #define WL_PROT_VAL		0x00004000
1439 #define WL_TSO_VAL		0x00010000
1440 #define WL_TRF_MGMT_VAL		0x00020000
1441 #define WL_LPC_VAL	        0x00040000
1442 #define WL_L2FILTER_VAL		0x00080000
1443 #define WL_TXBF_VAL		0x00100000
1444 #define WL_P2PO_VAL		0x00200000
1445 #define WL_TBTT_VAL		0x00400000
1446 #define WL_FBT_VAL		0x00800000
1447 #define WL_RRM_VAL		0x00800000	/* reuse */
1448 #define WL_MQ_VAL		0x01000000
1449 /* This level is currently used in Phoenix2 only */
1450 #define WL_SRSCAN_VAL		0x02000000
1451 #define WL_WNM_VAL		0x04000000
1452 /* re-using WL_WNM_VAL for MBO */
1453 #define WL_MBO_VAL		0x04000000
1454 /* re-using WL_SRSCAN_VAL */
1455 #define WL_RANDMAC_VAL		0x02000000
1456 
1457 #ifdef WLAWDL
1458 #define WL_AWDL_VAL		0x08000000
1459 #endif /* WLAWDL */
1460 
1461 #define WL_UNUSED_VAL		0x10000000	/* Was a duplicate for WL_LPC_VAL. Removed */
1462 #define WL_NET_DETECT_VAL	0x20000000
1463 #define WL_OCE_VAL  0x20000000 /* reuse */
1464 #define WL_PCIE_VAL		0x40000000
1465 #define WL_PMDUR_VAL	0x80000000
1466 /* use top-bit for WL_TIME_STAMP_VAL because this is a modifier
1467  * rather than a message-type of its own
1468  */
1469 #define WL_TIMESTAMP_VAL        0x80000000
1470 
1471 /* wl_msg_level2 is full. For new bits take the next one and AND with
1472  * wl_msg_level3 in wl_dbg.h
1473  */
1474 #define WL_ASSOC_AP_VAL		0x00000001
1475 #define WL_FILS_VAL		0x00000002
1476 #define WL_LATENCY_VAL		0x00000004
1477 #define WL_WBUS_VAL		0x00000008
1478 
1479 /* number of bytes needed to define a proper bit mask for MAC event reporting */
1480 #define BCMIO_ROUNDUP(x, y)	((((x) + ((y) - 1)) / (y)) * (y))
1481 #define BCMIO_NBBY		8
1482 #define WL_EVENTING_MASK_LEN	(16+4)		/* Don't increase this without wl review */
1483 
1484 #define WL_EVENTING_MASK_EXT_LEN	ROUNDUP(WLC_E_LAST, NBBY)/NBBY
1485 
1486 /* join preference types */
1487 #define WL_JOIN_PREF_RSSI	1u	/* by RSSI */
1488 #define WL_JOIN_PREF_WPA	2u	/* by akm and ciphers */
1489 #define WL_JOIN_PREF_BAND	3u	/* by 802.11 band */
1490 #define WL_JOIN_PREF_RSSI_DELTA	4u	/* by 802.11 band only if RSSI delta condition matches */
1491 #define WL_JOIN_PREF_TRANS_PREF	5u	/* defined by requesting AP */
1492 #define WL_JOIN_PREF_RSN_PRIO	6u	/* by RSNE/RSNXE related security priority */
1493 
1494 /* Join preference RSN priority */
1495 #define WL_JP_RSN_SAE_PK	1u	/* SAE-PK higher priority over non SAE-PK APs */
1496 
1497 /* band preference */
1498 #define WLJP_BAND_ASSOC_PREF	255	/* use what WLC_SET_ASSOC_PREFER ioctl specifies */
1499 
1500 /* any multicast cipher suite */
1501 #define WL_WPA_ACP_MCS_ANY	"\x00\x00\x00\x00"
1502 
1503 /* 802.11h measurement types */
1504 #define WLC_MEASURE_TPC			1
1505 #define WLC_MEASURE_CHANNEL_BASIC	2
1506 #define WLC_MEASURE_CHANNEL_CCA		3
1507 #define WLC_MEASURE_CHANNEL_RPI		4
1508 
1509 /* regulatory enforcement levels */
1510 #define SPECT_MNGMT_OFF			0		/* both 11h and 11d disabled */
1511 #define SPECT_MNGMT_LOOSE_11H		1		/* allow non-11h APs in scan lists */
1512 #define SPECT_MNGMT_STRICT_11H		2		/* prune out non-11h APs from scan list */
1513 #define SPECT_MNGMT_STRICT_11D		3		/* switch to 802.11D mode */
1514 /* SPECT_MNGMT_LOOSE_11H_D - same as SPECT_MNGMT_LOOSE with the exception that Country IE
1515  * adoption is done regardless of capability spectrum_management
1516  */
1517 #define SPECT_MNGMT_LOOSE_11H_D		4		/* operation defined above */
1518 
1519 /* bit position in per_chan_info; these depend on current country/regulatory domain */
1520 #define WL_CHAN_VALID_HW           (1u << 0)     /* valid with current HW */
1521 #define WL_CHAN_VALID_SW           (1u << 1)     /* valid with current country setting */
1522 #define WL_CHAN_BAND_5G            (1u << 2)     /* 5GHz-band channel */
1523 #define WL_CHAN_RADAR              (1u << 3)     /* radar sensitive channel */
1524 #define WL_CHAN_INACTIVE           (1u << 4)     /* temporarily inactive due to radar */
1525 #define WL_CHAN_PASSIVE            (1u << 5)     /* channel is in passive mode */
1526 #define WL_CHAN_RESTRICTED         (1u << 6)     /* restricted use channel */
1527 #define WL_CHAN_RADAR_EU_WEATHER   (1u << 7)     /* EU Radar weather channel.
1528 						  * Implies an EU Radar channel.
1529 						  */
1530 #define WL_CHAN_CLM_RESTRICTED     (1u << 8)     /* channel restricted in CLM (i.e. by default) */
1531 #define WL_CHAN_BAND_6G            (1u << 9)     /* 6GHz-band channel */
1532 #define WL_CHAN_OOS_SHIFT          24u           /* shift for OOS field */
1533 #define WL_CHAN_OOS_MASK           0xFF000000u   /* field specifying minutes remaining for this
1534 						  * channel's out-of-service period due to radar
1535 						  * detection
1536 						  */
1537 
1538 /* BTC mode used by "btc_mode" iovar */
1539 #define	WL_BTC_DISABLE		0	/* disable BT coexistence */
1540 #define WL_BTC_FULLTDM      1	/* full TDM COEX */
1541 #define WL_BTC_ENABLE       1	/* full TDM COEX to maintain backward compatiblity */
1542 #define WL_BTC_PREMPT      2    /* full TDM COEX with preemption */
1543 #define WL_BTC_LITE        3	/* light weight coex for large isolation platform */
1544 #define WL_BTC_PARALLEL		4   /* BT and WLAN run in parallel with separate antenna  */
1545 #define WL_BTC_HYBRID		5   /* hybrid coex, only ack is allowed to transmit in BT slot */
1546 #define WL_BTC_DEFAULT		8	/* set the default mode for the device */
1547 #define WL_INF_BTC_DISABLE      0
1548 #define WL_INF_BTC_ENABLE       1
1549 #define WL_INF_BTC_AUTO         3
1550 
1551 /* BTC wire used by "btc_wire" iovar */
1552 #define	WL_BTC_DEFWIRE		0	/* use default wire setting */
1553 #define WL_BTC_2WIRE		2	/* use 2-wire BTC */
1554 #define WL_BTC_3WIRE		3	/* use 3-wire BTC */
1555 #define WL_BTC_4WIRE		4	/* use 4-wire BTC */
1556 
1557 /* BTC flags: BTC configuration that can be set by host */
1558 #define WL_BTC_FLAG_PREMPT               (1 << 0)
1559 #define WL_BTC_FLAG_BT_DEF               (1 << 1)
1560 #define WL_BTC_FLAG_ACTIVE_PROT          (1 << 2)
1561 #define WL_BTC_FLAG_SIM_RSP              (1 << 3)
1562 #define WL_BTC_FLAG_PS_PROTECT           (1 << 4)
1563 #define WL_BTC_FLAG_SIM_TX_LP	         (1 << 5)
1564 #define WL_BTC_FLAG_ECI                  (1 << 6)
1565 #define WL_BTC_FLAG_LIGHT                (1 << 7)
1566 #define WL_BTC_FLAG_PARALLEL             (1 << 8)
1567 
1568 /* maximum channels returned by the get valid channels iovar */
1569 #define WL_NUMCHANNELS		64
1570 
1571 /* This constant is obsolete, not part of ioctl/iovar interface and should never be used
1572  * It is preserved only for compatibility with older branches that use it
1573  */
1574 #ifdef WL_BAND6G
1575 #ifdef WL11AC_80P80
1576 #define WL_NUMCHANSPECS 446
1577 #else
1578 #define WL_NUMCHANSPECS 350
1579 #endif
1580 #else
1581 #if defined(WL11AC_80P80)
1582 #define WL_NUMCHANSPECS 206
1583 #elif defined(WL_BW160MHZ)
1584 #define WL_NUMCHANSPECS 140
1585 #else
1586 #define WL_NUMCHANSPECS 110
1587 #endif
1588 #endif /* WL_BAND6G */
1589 
1590 /* WDS link local endpoint WPA role */
1591 #define WL_WDS_WPA_ROLE_AUTH	0	/* authenticator */
1592 #define WL_WDS_WPA_ROLE_SUP	1	/* supplicant */
1593 #define WL_WDS_WPA_ROLE_AUTO	255	/* auto, based on mac addr value */
1594 
1595 /* Base offset values */
1596 #define WL_PKT_FILTER_BASE_PKT   0
1597 #define WL_PKT_FILTER_BASE_END   1
1598 #define WL_PKT_FILTER_BASE_D11_H 2 /* May be removed */
1599 #define WL_PKT_FILTER_BASE_D11_D 3 /* May be removed */
1600 #define WL_PKT_FILTER_BASE_ETH_H 4
1601 #define WL_PKT_FILTER_BASE_ETH_D 5
1602 #define WL_PKT_FILTER_BASE_ARP_H 6
1603 #define WL_PKT_FILTER_BASE_ARP_D 7 /* May be removed */
1604 #define WL_PKT_FILTER_BASE_IP4_H 8
1605 #define WL_PKT_FILTER_BASE_IP4_D 9
1606 #define WL_PKT_FILTER_BASE_IP6_H 10
1607 #define WL_PKT_FILTER_BASE_IP6_D 11
1608 #define WL_PKT_FILTER_BASE_TCP_H 12
1609 #define WL_PKT_FILTER_BASE_TCP_D 13 /* May be removed */
1610 #define WL_PKT_FILTER_BASE_UDP_H 14
1611 #define WL_PKT_FILTER_BASE_UDP_D 15
1612 #define WL_PKT_FILTER_BASE_IP6_P 16
1613 #define WL_PKT_FILTER_BASE_COUNT 17 /* May be removed */
1614 
1615 /* String mapping for bases that may be used by applications or debug */
1616 #define WL_PKT_FILTER_BASE_NAMES \
1617 	{ "START", WL_PKT_FILTER_BASE_PKT },   \
1618 	{ "END",   WL_PKT_FILTER_BASE_END },   \
1619 	{ "ETH_H", WL_PKT_FILTER_BASE_ETH_H }, \
1620 	{ "ETH_D", WL_PKT_FILTER_BASE_ETH_D }, \
1621 	{ "D11_H", WL_PKT_FILTER_BASE_D11_H }, \
1622 	{ "D11_D", WL_PKT_FILTER_BASE_D11_D }, \
1623 	{ "ARP_H", WL_PKT_FILTER_BASE_ARP_H }, \
1624 	{ "IP4_H", WL_PKT_FILTER_BASE_IP4_H }, \
1625 	{ "IP4_D", WL_PKT_FILTER_BASE_IP4_D }, \
1626 	{ "IP6_H", WL_PKT_FILTER_BASE_IP6_H }, \
1627 	{ "IP6_D", WL_PKT_FILTER_BASE_IP6_D }, \
1628 	{ "IP6_P", WL_PKT_FILTER_BASE_IP6_P }, \
1629 	{ "TCP_H", WL_PKT_FILTER_BASE_TCP_H }, \
1630 	{ "TCP_D", WL_PKT_FILTER_BASE_TCP_D }, \
1631 	{ "UDP_H", WL_PKT_FILTER_BASE_UDP_H }, \
1632 	{ "UDP_D", WL_PKT_FILTER_BASE_UDP_D }
1633 
1634 /* Flags for a pattern list element */
1635 #define WL_PKT_FILTER_MFLAG_NEG 0x0001
1636 
1637 /*
1638  * Packet engine interface
1639  */
1640 
1641 #define WL_PKTENG_PER_TX_START			0x01
1642 #define WL_PKTENG_PER_TX_STOP			0x02
1643 #define WL_PKTENG_PER_RX_START			0x04
1644 #define WL_PKTENG_PER_RX_WITH_ACK_START		0x05
1645 #define WL_PKTENG_PER_TX_WITH_ACK_START		0x06
1646 #define WL_PKTENG_PER_RX_STOP			0x08
1647 #define WL_PKTENG_PER_RU_TX_START		0x09
1648 #define WL_PKTENG_PER_TRIG_TX_START		0x0a
1649 #define WL_PKTENG_PER_MASK			0xff
1650 
1651 #define WL_PKTENG_SYNCHRONOUS			0x100	/* synchronous flag */
1652 #define WL_PKTENG_SYNCHRONOUS_UNBLK		0x200	/* synchronous unblock flag */
1653 #define WL_PKTENG_COLLECT			0x400	/* Save last Rx'ed packet */
1654 #ifdef PKTENG_LONGPKTSZ
1655 /* max pktsz limit for pkteng */
1656 #define WL_PKTENG_MAXPKTSZ				PKTENG_LONGPKTSZ
1657 #else
1658 #define WL_PKTENG_MAXPKTSZ				16384
1659 #endif
1660 
1661 #define NUM_80211b_RATES	4
1662 #define NUM_80211ag_RATES	8
1663 #define NUM_80211n_RATES	32
1664 #define NUM_80211_RATES		(NUM_80211b_RATES+NUM_80211ag_RATES+NUM_80211n_RATES)
1665 
1666 /*
1667  * WOWL capability/override settings
1668  */
1669 #define WL_WOWL_MAGIC           (1 << 0)    /* Wakeup on Magic packet */
1670 #define WL_WOWL_NET             (1 << 1)    /* Wakeup on Netpattern */
1671 #define WL_WOWL_DIS             (1 << 2)    /* Wakeup on loss-of-link due to Disassoc/Deauth */
1672 #define WL_WOWL_RETR            (1 << 3)    /* Wakeup on retrograde TSF */
1673 #define WL_WOWL_BCN             (1 << 4)    /* Wakeup on loss of beacon */
1674 #define WL_WOWL_TST             (1 << 5)    /* Wakeup after test */
1675 #define WL_WOWL_M1              (1 << 6)    /* Wakeup after PTK refresh */
1676 #define WL_WOWL_EAPID           (1 << 7)    /* Wakeup after receipt of EAP-Identity Req */
1677 #define WL_WOWL_PME_GPIO        (1 << 8)    /* Wakeind via PME(0) or GPIO(1) */
1678 #define WL_WOWL_ULP_BAILOUT     (1 << 8)    /* wakeind via unknown pkt by basic ULP-offloads -
1679  * WL_WOWL_ULP_BAILOUT - same as WL_WOWL_PME_GPIO used only for DONGLE BUILDS
1680  */
1681 #define WL_WOWL_NEEDTKIP1       (1 << 9)    /* need tkip phase 1 key to be updated by the driver */
1682 #define WL_WOWL_GTK_FAILURE     (1 << 10)   /* enable wakeup if GTK fails */
1683 #define WL_WOWL_EXTMAGPAT       (1 << 11)   /* support extended magic packets */
1684 #define WL_WOWL_ARPOFFLOAD      (1 << 12)   /* support ARP/NS/keepalive offloading */
1685 #define WL_WOWL_WPA2            (1 << 13)   /* read protocol version for EAPOL frames */
1686 #define WL_WOWL_KEYROT          (1 << 14)   /* If the bit is set, use key rotaton */
1687 #define WL_WOWL_BCAST           (1 << 15)   /* If the bit is set, frm received was bcast frame */
1688 #define WL_WOWL_SCANOL          (1 << 16)   /* If the bit is set, scan offload is enabled */
1689 #define WL_WOWL_TCPKEEP_TIME    (1 << 17)   /* Wakeup on tcpkeep alive timeout */
1690 #define WL_WOWL_MDNS_CONFLICT   (1 << 18)   /* Wakeup on mDNS Conflict Resolution */
1691 #define WL_WOWL_MDNS_SERVICE    (1 << 19)   /* Wakeup on mDNS Service Connect */
1692 #define WL_WOWL_TCPKEEP_DATA    (1 << 20)   /* tcp keepalive got data */
1693 #define WL_WOWL_FW_HALT         (1 << 21)   /* Firmware died in wowl mode */
1694 #define WL_WOWL_ENAB_HWRADIO    (1 << 22)   /* Enable detection of radio button changes */
1695 #define WL_WOWL_MIC_FAIL        (1 << 23)   /* Offloads detected MIC failure(s) */
1696 #define WL_WOWL_UNASSOC         (1 << 24)   /* Wakeup in Unassociated state (Net/Magic Pattern) */
1697 #define WL_WOWL_SECURE          (1 << 25)   /* Wakeup if received matched secured pattern */
1698 #define WL_WOWL_EXCESS_WAKE     (1 << 26)   /* Excess wake */
1699 #define WL_WOWL_LINKDOWN        (1 << 31)   /* Link Down indication in WoWL mode */
1700 
1701 #define WL_WOWL_TCPKEEP         (1 << 20)   /* temp copy to satisfy automerger */
1702 #define MAGIC_PKT_MINLEN 102    /* Magic pkt min length is 6 * 0xFF + 16 * ETHER_ADDR_LEN */
1703 
1704 #define WOWL_PATTEN_TYPE_ARP	(1 << 0)	/* ARP offload Pattern */
1705 #define WOWL_PATTEN_TYPE_NA	(1 << 1)	/* NA offload Pattern */
1706 
1707 #define MAGIC_PKT_MINLEN	102    /* Magic pkt min length is 6 * 0xFF + 16 * ETHER_ADDR_LEN */
1708 #define MAGIC_PKT_NUM_MAC_ADDRS	16
1709 
1710 /* Overlap BSS Scan parameters default, minimum, maximum */
1711 #define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT		20	/* unit TU */
1712 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN			5	/* unit TU */
1713 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX			1000	/* unit TU */
1714 #define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT		10	/* unit TU */
1715 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN			10	/* unit TU */
1716 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX			1000	/* unit TU */
1717 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT	300	/* unit Sec */
1718 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN		10	/* unit Sec */
1719 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX		900	/* unit Sec */
1720 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT	5
1721 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN	5
1722 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX	100
1723 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT	200	/* unit TU */
1724 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN	200	/* unit TU */
1725 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX	10000	/* unit TU */
1726 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT	20	/* unit TU */
1727 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN	20	/* unit TU */
1728 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX	10000	/* unit TU */
1729 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT	25	/* unit percent */
1730 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN		0	/* unit percent */
1731 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX		100	/* unit percent */
1732 
1733 #define WL_MIN_NUM_OBSS_SCAN_ARG 7	/* minimum number of arguments required for OBSS Scan */
1734 
1735 #define WL_COEX_INFO_MASK		0x07
1736 #define WL_COEX_INFO_REQ		0x01
1737 #define	WL_COEX_40MHZ_INTOLERANT	0x02
1738 #define	WL_COEX_WIDTH20			0x04
1739 
1740 #define	WLC_RSSI_INVALID	 0	/* invalid RSSI value */
1741 
1742 #define MAX_RSSI_LEVELS 8
1743 
1744 /* **** EXTLOG **** */
1745 #define EXTLOG_CUR_VER		0x0100
1746 
1747 #define MAX_ARGSTR_LEN		18 /* At least big enough for storing ETHER_ADDR_STR_LEN */
1748 
1749 /* log modules (bitmap) */
1750 #define LOG_MODULE_COMMON	0x0001
1751 #define LOG_MODULE_ASSOC	0x0002
1752 #define LOG_MODULE_EVENT	0x0004
1753 #define LOG_MODULE_MAX		3			/* Update when adding module */
1754 
1755 /* log levels */
1756 #define WL_LOG_LEVEL_DISABLE	0
1757 #define WL_LOG_LEVEL_ERR	1
1758 #define WL_LOG_LEVEL_WARN	2
1759 #define WL_LOG_LEVEL_INFO	3
1760 #define WL_LOG_LEVEL_MAX	WL_LOG_LEVEL_INFO	/* Update when adding level */
1761 
1762 /* flag */
1763 #define LOG_FLAG_EVENT		1
1764 
1765 /* log arg_type */
1766 #define LOG_ARGTYPE_NULL	0
1767 #define LOG_ARGTYPE_STR		1	/* %s */
1768 #define LOG_ARGTYPE_INT		2	/* %d */
1769 #define LOG_ARGTYPE_INT_STR	3	/* %d...%s */
1770 #define LOG_ARGTYPE_STR_INT	4	/* %s...%d */
1771 
1772 /* 802.11 Mgmt Packet flags */
1773 #define VNDR_IE_BEACON_FLAG	0x1
1774 #define VNDR_IE_PRBRSP_FLAG	0x2
1775 #define VNDR_IE_ASSOCRSP_FLAG	0x4
1776 #define VNDR_IE_AUTHRSP_FLAG	0x8
1777 #define VNDR_IE_PRBREQ_FLAG	0x10
1778 #define VNDR_IE_ASSOCREQ_FLAG	0x20
1779 #define VNDR_IE_IWAPID_FLAG	0x40 /* vendor IE in IW advertisement protocol ID field */
1780 #define VNDR_IE_AUTHREQ_FLAG	0x80
1781 #define VNDR_IE_CUSTOM_FLAG	0x100 /* allow custom IE id */
1782 #define VNDR_IE_DISASSOC_FLAG	0x200
1783 
1784 #if defined(WLP2P)
1785 /* P2P Action Frames flags (spec ordered) */
1786 #define VNDR_IE_GONREQ_FLAG     0x001000
1787 #define VNDR_IE_GONRSP_FLAG     0x002000
1788 #define VNDR_IE_GONCFM_FLAG     0x004000
1789 #define VNDR_IE_INVREQ_FLAG     0x008000
1790 #define VNDR_IE_INVRSP_FLAG     0x010000
1791 #define VNDR_IE_DISREQ_FLAG     0x020000
1792 #define VNDR_IE_DISRSP_FLAG     0x040000
1793 #define VNDR_IE_PRDREQ_FLAG     0x080000
1794 #define VNDR_IE_PRDRSP_FLAG     0x100000
1795 
1796 #define VNDR_IE_P2PAF_SHIFT	12
1797 #endif /* WLP2P */
1798 
1799 /* channel interference measurement (chanim) related defines */
1800 
1801 /* chanim mode */
1802 #define CHANIM_DISABLE	0	/* disabled */
1803 #define CHANIM_DETECT	1	/* detection only */
1804 #define CHANIM_EXT		2	/* external state machine */
1805 #define CHANIM_ACT		3	/* full internal state machine, detect + act */
1806 #define CHANIM_MODE_MAX 4
1807 
1808 /* define for apcs reason code */
1809 #define APCS_INIT		0
1810 #define APCS_IOCTL		1
1811 #define APCS_CHANIM		2
1812 #define APCS_CSTIMER		3
1813 #define APCS_TXDLY		5
1814 #define APCS_NONACSD		6
1815 #define APCS_DFS_REENTRY	7
1816 #define APCS_TXFAIL		8
1817 #define APCS_MAX		9
1818 
1819 /* number of ACS record entries */
1820 #define CHANIM_ACS_RECORD			10
1821 
1822 /* CHANIM */
1823 #define CCASTATS_TXDUR  0
1824 #define CCASTATS_INBSS  1
1825 #define CCASTATS_OBSS   2
1826 #define CCASTATS_NOCTG  3
1827 #define CCASTATS_NOPKT  4
1828 #define CCASTATS_DOZE   5
1829 #define CCASTATS_TXOP	6
1830 #define CCASTATS_GDTXDUR        7
1831 #define CCASTATS_BDTXDUR        8
1832 
1833 /* FIXME: CCASTATS_MAX is 9 for existing chips and 10 for new ones.
1834  * This is to avoid rom invalidation of existing chips.
1835  */
1836 #ifndef WLCHANIM_V2
1837 #define CCASTATS_MAX    9
1838 #else /* WLCHANIM_V2 */
1839 #define CCASTATS_MYRX      9
1840 #define CCASTATS_MAX    10
1841 #endif /* WLCHANIM_V2 */
1842 
1843 #define WL_CHANIM_COUNT_ALL	0xff
1844 #define WL_CHANIM_COUNT_ONE	0x1
1845 
1846 /* Module id: to know which module has sent the stats */
1847 #define SC_CHANIM_ID_NULL	0u
1848 #define SC_CHANIM_ID_SCAN	1u	/* Module Id of scan, used to report scqs */
1849 #define SC_CHANIM_ID_STA	2u	/* Module Id of STA, used tp report scqs */
1850 
1851 /* ap tpc modes */
1852 #define	AP_TPC_OFF		0
1853 #define	AP_TPC_BSS_PWR		1	/* BSS power control */
1854 #define AP_TPC_AP_PWR		2	/* AP power control */
1855 #define	AP_TPC_AP_BSS_PWR	3	/* Both AP and BSS power control */
1856 #define AP_TPC_MAX_LINK_MARGIN	127
1857 
1858 /* ap tpc modes */
1859 #define	AP_TPC_OFF		0
1860 #define	AP_TPC_BSS_PWR		1	/* BSS power control */
1861 #define AP_TPC_AP_PWR		2	/* AP power control */
1862 #define	AP_TPC_AP_BSS_PWR	3	/* Both AP and BSS power control */
1863 #define AP_TPC_MAX_LINK_MARGIN	127
1864 
1865 /* tpc option bits */
1866 #define TPC_OPT_NO_11DH_TXPWR	1	/* Do not adopt 11d+11h AP power constraints when
1867 					 * autocountry is 0
1868 					 */
1869 
1870 /* state */
1871 #define WL_P2P_DISC_ST_SCAN	0
1872 #define WL_P2P_DISC_ST_LISTEN	1
1873 #define WL_P2P_DISC_ST_SEARCH	2
1874 
1875 /* i/f type */
1876 #define WL_P2P_IF_CLIENT	0
1877 #define WL_P2P_IF_GO		1
1878 #define WL_P2P_IF_DYNBCN_GO	2
1879 #define WL_P2P_IF_DEV		3
1880 
1881 /* p2p GO configuration */
1882 #define WL_P2P_ENABLE_CONF	1	/* configure */
1883 #define WL_P2P_DISABLE_CONF	0	/* un-configure */
1884 
1885 /* count */
1886 #define WL_P2P_SCHED_RSVD	0
1887 #define WL_P2P_SCHED_REPEAT	255	/* anything > 255 will be treated as 255 */
1888 
1889 #define WL_P2P_SCHED_FIXED_LEN		3
1890 
1891 /* schedule type */
1892 #define WL_P2P_SCHED_TYPE_ABS		0	/* Scheduled Absence */
1893 #define WL_P2P_SCHED_TYPE_REQ_ABS	1	/* Requested Absence */
1894 
1895 /* at some point we may need bitvec here (combination of actions) */
1896 /* schedule action during absence periods (for WL_P2P_SCHED_ABS type) */
1897 #define WL_P2P_SCHED_ACTION_NONE	0	/* no action */
1898 #define WL_P2P_SCHED_ACTION_DOZE	1	/* doze */
1899 /* schedule option - WL_P2P_SCHED_TYPE_REQ_ABS */
1900 #define WL_P2P_SCHED_ACTION_GOOFF	2	/* turn off GO beacon/prbrsp functions */
1901 /* schedule option - WL_P2P_SCHED_TYPE_XXX */
1902 #define WL_P2P_SCHED_ACTION_RESET	255	/* reset */
1903 
1904 /* at some point we may need bitvec here (combination of options) */
1905 /* schedule option - WL_P2P_SCHED_TYPE_ABS */
1906 #define WL_P2P_SCHED_OPTION_NORMAL	0	/* normal start/interval/duration/count */
1907 #define WL_P2P_SCHED_OPTION_BCNPCT	1	/* percentage of beacon interval */
1908 /* schedule option - WL_P2P_SCHED_TYPE_REQ_ABS */
1909 #define WL_P2P_SCHED_OPTION_TSFOFS	2	/* normal start/internal/duration/count with
1910 						 * start being an offset of the 'current' TSF
1911 						 */
1912 
1913 /* feature flags */
1914 #define WL_P2P_FEAT_GO_CSA	(1 << 0)	/* GO moves with the STA using CSA method */
1915 #define WL_P2P_FEAT_GO_NOLEGACY	(1 << 1)	/* GO does not probe respond to non-p2p probe
1916 						 * requests
1917 						 */
1918 #define WL_P2P_FEAT_RESTRICT_DEV_RESP (1 << 2)	/* Restrict p2p dev interface from responding */
1919 
1920 /* n-mode support capability */
1921 /* 2x2 includes both 1x1 & 2x2 devices
1922  * reserved #define 2 for future when we want to separate 1x1 & 2x2 and
1923  * control it independently
1924  */
1925 #define WL_11N_2x2			1
1926 #define WL_11N_3x3			3
1927 #define WL_11N_4x4			4
1928 
1929 /* define 11n feature disable flags */
1930 #define WLFEATURE_DISABLE_11N		0x00000001
1931 #define WLFEATURE_DISABLE_11N_STBC_TX	0x00000002
1932 #define WLFEATURE_DISABLE_11N_STBC_RX	0x00000004
1933 #define WLFEATURE_DISABLE_11N_SGI_TX	0x00000008
1934 #define WLFEATURE_DISABLE_11N_SGI_RX	0x00000010
1935 #define WLFEATURE_DISABLE_11N_AMPDU_TX	0x00000020
1936 #define WLFEATURE_DISABLE_11N_AMPDU_RX	0x00000040
1937 #define WLFEATURE_DISABLE_11N_GF	0x00000080
1938 
1939 /* op code in nat_cfg */
1940 #define NAT_OP_ENABLE		1	/* enable NAT on given interface */
1941 #define NAT_OP_DISABLE		2	/* disable NAT on given interface */
1942 #define NAT_OP_DISABLE_ALL	3	/* disable NAT on all interfaces */
1943 
1944 /* NAT state */
1945 #define NAT_STATE_ENABLED	1	/* NAT is enabled */
1946 #define NAT_STATE_DISABLED	2	/* NAT is disabled */
1947 
1948 #define CHANNEL_5G_LOW_START	36	/* 5G low (36..48) CDD enable/disable bit mask */
1949 #define CHANNEL_5G_MID_START	52	/* 5G mid (52..64) CDD enable/disable bit mask */
1950 #define CHANNEL_5G_HIGH_START	100	/* 5G high (100..140) CDD enable/disable bit mask */
1951 #define CHANNEL_5G_UPPER_START	149	/* 5G upper (149..161) CDD enable/disable bit mask */
1952 
1953 /* D0 Coalescing */
1954 #define IPV4_ARP_FILTER		0x0001
1955 #define IPV4_NETBT_FILTER	0x0002
1956 #define IPV4_LLMNR_FILTER	0x0004
1957 #define IPV4_SSDP_FILTER	0x0008
1958 #define IPV4_WSD_FILTER		0x0010
1959 #define IPV6_NETBT_FILTER	0x0200
1960 #define IPV6_LLMNR_FILTER	0x0400
1961 #define IPV6_SSDP_FILTER	0x0800
1962 #define IPV6_WSD_FILTER		0x1000
1963 
1964 /* Network Offload Engine */
1965 #define NWOE_OL_ENABLE		0x00000001
1966 
1967 /*
1968  * Traffic management structures/defines.
1969  */
1970 
1971 /* Traffic management bandwidth parameters */
1972 #define TRF_MGMT_MAX_PRIORITIES                 3
1973 
1974 #define TRF_MGMT_FLAG_ADD_DSCP                  0x0001  /* Add DSCP to IP TOS field */
1975 #define TRF_MGMT_FLAG_DISABLE_SHAPING           0x0002  /* Don't shape traffic */
1976 #define TRF_MGMT_FLAG_MANAGE_LOCAL_TRAFFIC      0x0008  /* Manage traffic over our local subnet */
1977 #define TRF_MGMT_FLAG_FILTER_ON_MACADDR         0x0010  /* filter on MAC address */
1978 #define TRF_MGMT_FLAG_NO_RX                     0x0020  /* do not apply fiters to rx packets */
1979 
1980 #define TRF_FILTER_MAC_ADDR              0x0001 /* L2 filter use dst mac address for filtering */
1981 #define TRF_FILTER_IP_ADDR               0x0002 /* L3 filter use ip ddress for filtering */
1982 #define TRF_FILTER_L4                    0x0004 /* L4 filter use tcp/udp for filtering */
1983 #define TRF_FILTER_DWM                   0x0008 /* L3 filter use DSCP for filtering */
1984 #define TRF_FILTER_FAVORED               0x0010 /* Tag the packet FAVORED */
1985 
1986 /* WNM/NPS subfeatures mask */
1987 #define WL_WNM_BSSTRANS		0x00000001
1988 #define WL_WNM_PROXYARP		0x00000002
1989 #define WL_WNM_MAXIDLE		0x00000004
1990 #define WL_WNM_TIMBC		0x00000008
1991 #define WL_WNM_TFS		0x00000010
1992 #define WL_WNM_SLEEP		0x00000020
1993 #define WL_WNM_DMS		0x00000040
1994 #define WL_WNM_FMS		0x00000080
1995 #define WL_WNM_NOTIF		0x00000100
1996 #define WL_WNM_WBTEXT	0x00000200
1997 #define WL_WNM_ESTM		0x00000400
1998 #define WL_WNM_MAX		0x00000800
1999 #ifdef WLWNM_BRCM
2000 #define BRCM_WNM_FEATURE_SET\
2001 					(WL_WNM_PROXYARP | \
2002 					WL_WNM_SLEEP | \
2003 					WL_WNM_FMS | \
2004 					WL_WNM_TFS | \
2005 					WL_WNM_TIMBC | \
2006 					WL_WNM_BSSTRANS | \
2007 					WL_WNM_DMS | \
2008 					WL_WNM_NOTIF | \
2009 					0)
2010 #endif /* WLWNM_BRCM */
2011 #ifndef ETHER_MAX_DATA
2012 #define ETHER_MAX_DATA	1500
2013 #endif /* ETHER_MAX_DATA */
2014 
2015 /* Different discovery modes for dpt */
2016 #define	DPT_DISCOVERY_MANUAL	0x01	/* manual discovery mode */
2017 #define	DPT_DISCOVERY_AUTO	0x02	/* auto discovery mode */
2018 #define	DPT_DISCOVERY_SCAN	0x04	/* scan-based discovery mode */
2019 
2020 /* different path selection values */
2021 #define DPT_PATHSEL_AUTO	0	/* auto mode for path selection */
2022 #define DPT_PATHSEL_DIRECT	1	/* always use direct DPT path */
2023 #define DPT_PATHSEL_APPATH	2	/* always use AP path */
2024 
2025 /* different ops for deny list */
2026 #define DPT_DENY_LIST_ADD	1	/* add to dpt deny list */
2027 #define DPT_DENY_LIST_REMOVE	2	/* remove from dpt deny list */
2028 
2029 /* different ops for manual end point */
2030 #define DPT_MANUAL_EP_CREATE	1	/* create manual dpt endpoint */
2031 #define DPT_MANUAL_EP_MODIFY	2	/* modify manual dpt endpoint */
2032 #define DPT_MANUAL_EP_DELETE	3	/* delete manual dpt endpoint */
2033 
2034 /* flags to indicate DPT status */
2035 #define	DPT_STATUS_ACTIVE	0x01	/* link active (though may be suspended) */
2036 #define	DPT_STATUS_AES		0x02	/* link secured through AES encryption */
2037 #define	DPT_STATUS_FAILED	0x04	/* DPT link failed */
2038 
2039 #ifdef WLTDLS
2040 /* different ops for manual end point */
2041 #define TDLS_MANUAL_EP_CREATE	1	/* create manual dpt endpoint */
2042 #define TDLS_MANUAL_EP_MODIFY	2	/* modify manual dpt endpoint */
2043 #define TDLS_MANUAL_EP_DELETE	3	/* delete manual dpt endpoint */
2044 #define TDLS_MANUAL_EP_PM		4	/*  put dpt endpoint in PM mode */
2045 #define TDLS_MANUAL_EP_WAKE		5	/* wake up dpt endpoint from PM */
2046 #define TDLS_MANUAL_EP_DISCOVERY	6	/* discover if endpoint is TDLS capable */
2047 #define TDLS_MANUAL_EP_CHSW		7	/* channel switch */
2048 #define TDLS_MANUAL_EP_WFD_TPQ	8	/* WiFi-Display Tunneled Probe reQuest */
2049 
2050 /* modes */
2051 #define TDLS_WFD_IE_TX			0
2052 #define TDLS_WFD_IE_RX			1
2053 #define TDLS_WFD_PROBE_IE_TX	2
2054 #define TDLS_WFD_PROBE_IE_RX	3
2055 #endif /* WLTDLS */
2056 
2057 /* define for flag */
2058 #define TSPEC_PENDING		0	/* TSPEC pending */
2059 #define TSPEC_ACCEPTED		1	/* TSPEC accepted */
2060 #define TSPEC_REJECTED		2	/* TSPEC rejected */
2061 #define TSPEC_UNKNOWN		3	/* TSPEC unknown */
2062 #define TSPEC_STATUS_MASK	7	/* TSPEC status mask */
2063 
2064 #ifdef BCMCCX
2065 /* "wlan_reason" iovar interface */
2066 #define WL_WLAN_ASSOC_REASON_NORMAL_NETWORK	0 /* normal WLAN network setup */
2067 #define WL_WLAN_ASSOC_REASON_ROAM_FROM_CELLULAR_NETWORK	1 /* roam from Cellular network */
2068 #define WL_WLAN_ASSOC_REASON_ROAM_FROM_LAN	2 /* roam from LAN */
2069 #define WL_WLAN_ASSOC_REASON_MAX		2 /* largest value allowed */
2070 #endif /* BCMCCX */
2071 
2072 /* Software feature flag defines used by wlfeatureflag */
2073 #ifdef WLAFTERBURNER
2074 #define WL_SWFL_ABBFL       0x0001 /* Allow Afterburner on systems w/o hardware BFL */
2075 #define WL_SWFL_ABENCORE    0x0002 /* Allow AB on non-4318E chips */
2076 #endif /* WLAFTERBURNER */
2077 #define WL_SWFL_NOHWRADIO	0x0004 /* Disable HW Radio monitor (e.g., Cust Spec) */
2078 #define WL_SWFL_FLOWCONTROL     0x0008 /* Enable backpressure to OS stack */
2079 #define WL_SWFL_WLBSSSORT	0x0010 /* Per-port supports sorting of BSS */
2080 
2081 #define WL_LIFETIME_MAX 0xFFFF /* Max value in ms */
2082 
2083 #define CSA_BROADCAST_ACTION_FRAME	0	/* csa broadcast action frame */
2084 #define CSA_UNICAST_ACTION_FRAME	  1 /* csa unicast action frame */
2085 
2086 /* Roaming trigger definitions for WLC_SET_ROAM_TRIGGER.
2087  *
2088  * (-100 < value < 0)   value is used directly as a roaming trigger in dBm
2089  * (0 <= value) value specifies a logical roaming trigger level from
2090  *                      the list below
2091  *
2092  * WLC_GET_ROAM_TRIGGER always returns roaming trigger value in dBm, never
2093  * the logical roam trigger value.
2094  */
2095 #define WLC_ROAM_TRIGGER_DEFAULT	0 /* default roaming trigger */
2096 #define WLC_ROAM_TRIGGER_BANDWIDTH	1 /* optimize for bandwidth roaming trigger */
2097 #define WLC_ROAM_TRIGGER_DISTANCE	2 /* optimize for distance roaming trigger */
2098 #define WLC_ROAM_TRIGGER_AUTO		3 /* auto-detect environment */
2099 #define WLC_ROAM_TRIGGER_MAX_VALUE	3 /* max. valid value */
2100 
2101 #define WLC_ROAM_NEVER_ROAM_TRIGGER	(-100) /* Avoid Roaming by setting a large value */
2102 
2103 /* Preferred Network Offload (PNO, formerly PFN) defines */
2104 #define WPA_AUTH_PFN_ANY	0xffffffff	/* for PFN, match only ssid */
2105 
2106 #define SORT_CRITERIA_BIT		0
2107 #define AUTO_NET_SWITCH_BIT		1
2108 #define ENABLE_BKGRD_SCAN_BIT		2
2109 #define IMMEDIATE_SCAN_BIT		3
2110 #define	AUTO_CONNECT_BIT		4
2111 #define	ENABLE_BD_SCAN_BIT		5
2112 #define ENABLE_ADAPTSCAN_BIT		6
2113 #define IMMEDIATE_EVENT_BIT		8
2114 #define SUPPRESS_SSID_BIT		9
2115 #define ENABLE_NET_OFFLOAD_BIT		10
2116 /* report found/lost events for SSID and BSSID networks seperately */
2117 #define REPORT_SEPERATELY_BIT		11
2118 #define BESTN_BSSID_ONLY_BIT		12
2119 
2120 #define SORT_CRITERIA_MASK		0x0001
2121 #define AUTO_NET_SWITCH_MASK		0x0002
2122 #define ENABLE_BKGRD_SCAN_MASK		0x0004
2123 #define IMMEDIATE_SCAN_MASK		0x0008
2124 #define	AUTO_CONNECT_MASK		0x0010
2125 
2126 #define ENABLE_BD_SCAN_MASK		0x0020
2127 #define ENABLE_ADAPTSCAN_MASK		0x00c0
2128 #define IMMEDIATE_EVENT_MASK		0x0100
2129 #define SUPPRESS_SSID_MASK		0x0200
2130 #define ENABLE_NET_OFFLOAD_MASK		0x0400
2131 /* report found/lost events for SSID and BSSID networks seperately */
2132 #define REPORT_SEPERATELY_MASK		0x0800
2133 #define BESTN_BSSID_ONLY_MASK		0x1000
2134 
2135 #ifdef PFN_SCANRESULT_2
2136 #define PFN_SCANRESULT_VERSION		2
2137 #else
2138 #define PFN_SCANRESULT_VERSION		1
2139 #endif /* PFN_SCANRESULT_2 */
2140 #ifndef MAX_PFN_LIST_COUNT
2141 #define MAX_PFN_LIST_COUNT		16
2142 #endif /* MAX_PFN_LIST_COUNT */
2143 
2144 #define PFN_COMPLETE			1
2145 #define PFN_INCOMPLETE			0
2146 
2147 #define DEFAULT_BESTN			2
2148 #define DEFAULT_MSCAN			0
2149 #define DEFAULT_REPEAT			10
2150 #define DEFAULT_EXP				2
2151 
2152 #define PFN_PARTIAL_SCAN_BIT		0
2153 #define PFN_PARTIAL_SCAN_MASK		1
2154 
2155 #define WL_PFN_SUPPRESSFOUND_MASK	0x08
2156 #define WL_PFN_SUPPRESSLOST_MASK	0x10
2157 #define WL_PFN_SSID_A_BAND_TRIG		0x20
2158 #define WL_PFN_SSID_BG_BAND_TRIG	0x40
2159 #define WL_PFN_SSID_IMPRECISE_MATCH	0x80
2160 #define WL_PFN_SSID_SAME_NETWORK	0x10000
2161 #define WL_PFN_SUPPRESS_AGING_MASK	0x20000
2162 #define WL_PFN_FLUSH_ALL_SSIDS		0x40000
2163 #define WL_PFN_RSSI_MASK		0xff00
2164 #define WL_PFN_RSSI_SHIFT		8
2165 
2166 #define WL_PFN_REPORT_ALLNET    0
2167 #define WL_PFN_REPORT_SSIDNET   1
2168 #define WL_PFN_REPORT_BSSIDNET  2
2169 
2170 #define WL_PFN_CFG_FLAGS_PROHIBITED	0x00000001	/* Accept and use prohibited channels */
2171 #define WL_PFN_CFG_FLAGS_HISTORY_OFF	0x00000002	/* Scan history suppressed */
2172 
2173 #define WL_PFN_HIDDEN_BIT		2
2174 #define PNO_SCAN_MAX_FW			508*1000	/* max time scan time in msec */
2175 #define PNO_SCAN_MAX_FW_SEC		PNO_SCAN_MAX_FW/1000 /* max time scan time in SEC */
2176 #define PNO_SCAN_MIN_FW_SEC		10			/* min time scan time in SEC */
2177 #define WL_PFN_HIDDEN_MASK		0x4
2178 #define MAX_BSSID_PREF_LIST_NUM        32
2179 
2180 #ifdef CUSTOM_SSID_WHITELIST_NUM
2181 #define MAX_SSID_WHITELIST_NUM		CUSTOM_SSID_WHITELIST_NUM
2182 #else
2183 #define MAX_SSID_WHITELIST_NUM         4
2184 #endif /* CUSTOM_SSID_WHITELIST_NUM */
2185 #ifdef CUSTOM_BSSID_BLACKLIST_NUM
2186 #define MAX_BSSID_BLACKLIST_NUM		CUSTOM_BSSID_BLACKLIST_NUM
2187 #else
2188 #define MAX_BSSID_BLACKLIST_NUM        32
2189 #endif /* CUSTOM_BSSID_BLACKLIST_NUM */
2190 
2191 /* TCP Checksum Offload error injection for testing */
2192 #define TOE_ERRTEST_TX_CSUM	0x00000001
2193 #define TOE_ERRTEST_RX_CSUM	0x00000002
2194 #define TOE_ERRTEST_RX_CSUM2	0x00000004
2195 
2196 /* ARP Offload feature flags for arp_ol iovar */
2197 #define ARP_OL_AGENT			0x00000001
2198 #define ARP_OL_SNOOP			0x00000002
2199 #define ARP_OL_HOST_AUTO_REPLY		0x00000004
2200 #define ARP_OL_PEER_AUTO_REPLY		0x00000008
2201 #define ARP_OL_UPDATE_HOST_CACHE	0x00000010
2202 
2203 /* ARP Offload error injection */
2204 #define ARP_ERRTEST_REPLY_PEER	0x1
2205 #define ARP_ERRTEST_REPLY_HOST	0x2
2206 
2207 #define ARP_MULTIHOMING_MAX	8	/* Maximum local host IP addresses */
2208 #if defined(WL_PKT_FLTR_EXT) && !defined(WL_PKT_FLTR_EXT_DISABLED)
2209 #define ND_MULTIHOMING_MAX 32	/* Maximum local host IP addresses */
2210 #else
2211 #define ND_MULTIHOMING_MAX 10	/* Maximum local host IP addresses */
2212 #endif /* WL_PKT_FLTR_EXT && !WL_PKT_FLTR_EXT_DISABLED */
2213 #define ND_REQUEST_MAX		5	/* Max set of offload params */
2214 
2215 #ifdef WLAWDL
2216 /* AWDL AF flags for awdl_oob_af iovar */
2217 #define AWDL_OOB_AF_FILL_TSF_PARAMS			0x00000001
2218 #define AWDL_OOB_AF_FILL_SYNC_PARAMS		0x00000002
2219 #define AWDL_OOB_AF_FILL_ELECT_PARAMS		0x00000004
2220 #define AWDL_OOB_AF_PARAMS_SIZE 38
2221 
2222 #define AWDL_OPMODE_AUTO	0
2223 #define AWDL_OPMODE_FIXED	1
2224 
2225 #define AWDL_PEER_STATE_OPEN	0
2226 #define AWDL_PEER_STATE_CLOSE	1
2227 
2228 #define SYNC_ROLE_SLAVE			0
2229 #define SYNC_ROLE_NE_MASTER		1	/* Non-election master */
2230 #define SYNC_ROLE_MASTER		2
2231 
2232 /* peer opcode */
2233 #define AWDL_PEER_OP_ADD	0
2234 #define AWDL_PEER_OP_DEL	1
2235 #define AWDL_PEER_OP_INFO	2
2236 #define AWDL_PEER_OP_UPD	3
2237 #endif /* WLAWDL */
2238 
2239 /* AOAC wake event flag */
2240 #define WAKE_EVENT_NLO_DISCOVERY_BIT		1
2241 #define WAKE_EVENT_AP_ASSOCIATION_LOST_BIT	2
2242 #define WAKE_EVENT_GTK_HANDSHAKE_ERROR_BIT 4
2243 #define WAKE_EVENT_4WAY_HANDSHAKE_REQUEST_BIT 8
2244 #define WAKE_EVENT_NET_PACKET_BIT 0x10
2245 
2246 #define MAX_NUM_WOL_PATTERN	22 /* LOGO requirements min 22 */
2247 
2248 /* Packet filter operation mode */
2249 /* True: 1; False: 0 */
2250 #define PKT_FILTER_MODE_FORWARD_ON_MATCH		1
2251 /* Enable and disable pkt_filter as a whole */
2252 #define PKT_FILTER_MODE_DISABLE					2
2253 /* Cache first matched rx pkt(be queried by host later) */
2254 #define PKT_FILTER_MODE_PKT_CACHE_ON_MATCH		4
2255 /* If pkt_filter is enabled and no filter is set, don't forward anything */
2256 #define PKT_FILTER_MODE_PKT_FORWARD_OFF_DEFAULT 8
2257 
2258 #ifdef DONGLEOVERLAYS
2259 #define OVERLAY_IDX_MASK		0x000000ff
2260 #define OVERLAY_IDX_SHIFT		0
2261 #define OVERLAY_FLAGS_MASK		0xffffff00
2262 #define OVERLAY_FLAGS_SHIFT		8
2263 /* overlay written to device memory immediately after loading the base image */
2264 #define OVERLAY_FLAG_POSTLOAD	0x100
2265 /* defer overlay download until the device responds w/WLC_E_OVL_DOWNLOAD event */
2266 #define OVERLAY_FLAG_DEFER_DL	0x200
2267 /* overlay downloaded prior to the host going to sleep */
2268 #define OVERLAY_FLAG_PRESLEEP	0x400
2269 #define OVERLAY_DOWNLOAD_CHUNKSIZE	1024
2270 #endif /* DONGLEOVERLAYS */
2271 
2272 /* reuse two number in the sc/rc space */
2273 #define	SMFS_CODE_MALFORMED 0xFFFE
2274 #define SMFS_CODE_IGNORED	0xFFFD
2275 
2276 /* RFAWARE def */
2277 #define BCM_ACTION_RFAWARE		0x77
2278 #define BCM_ACTION_RFAWARE_DCS  0x01
2279 
2280 /* DCS reason code define */
2281 #define BCM_DCS_IOVAR		0x1
2282 #define BCM_DCS_UNKNOWN		0xFF
2283 
2284 #ifdef EXT_STA
2285 #define IHV_OID_BCM 0x00181000	/* based on BRCM_OUI value */
2286 /* ---------------------------------------------------------------------------
2287 *  Event codes
2288 * ---------------------------------------------------------------------------
2289 */
2290 #ifdef BCMCCX
2291 #define IHV_CCX_EVENT_STATUS_INDICATION                 0x00000001L     /* from driver */
2292 #define IHV_CCX_EVENT_PACKET_RECEIVED                   0x00000002L     /* from driver */
2293 #define IHV_CCX_EVENT_PACKET_TRANSMITTED                0x00000003L     /* from driver */
2294 #define IHV_CCX_EVENT_OID                               0x00000004L     /* to driver */
2295 #define IHV_CCX_EVENT_OK_TO_ASSOCIATE                   0x00000005L     /* to driver */
2296 #define IHV_CCX_EVENT_SEND_PACKET                       0x00000006L     /* to driver */
2297 #endif /* BCMCCX */
2298 
2299 #define IHV_DRIVER_EVENT_GEN_INDICATION                 0x00000011L     /* from driver */
2300 #endif /* EXT_STA */
2301 #ifdef PROP_TXSTATUS
2302 /* Bit definitions for tlv iovar */
2303 /*
2304  * enable RSSI signals:
2305  * WLFC_CTL_TYPE_RSSI
2306  */
2307 #define WLFC_FLAGS_RSSI_SIGNALS			0x0001
2308 
2309 /* enable (if/mac_open, if/mac_close,, mac_add, mac_del) signals:
2310  *
2311  * WLFC_CTL_TYPE_MAC_OPEN
2312  * WLFC_CTL_TYPE_MAC_CLOSE
2313  *
2314  * WLFC_CTL_TYPE_INTERFACE_OPEN
2315  * WLFC_CTL_TYPE_INTERFACE_CLOSE
2316  *
2317  * WLFC_CTL_TYPE_MACDESC_ADD
2318  * WLFC_CTL_TYPE_MACDESC_DEL
2319  *
2320  */
2321 #define WLFC_FLAGS_XONXOFF_SIGNALS		0x0002
2322 
2323 /* enable (status, fifo_credit, mac_credit) signals
2324  * WLFC_CTL_TYPE_MAC_REQUEST_CREDIT
2325  * WLFC_CTL_TYPE_TXSTATUS
2326  * WLFC_CTL_TYPE_FIFO_CREDITBACK
2327  */
2328 #define WLFC_FLAGS_CREDIT_STATUS_SIGNALS	0x0004
2329 
2330 #define WLFC_FLAGS_HOST_PROPTXSTATUS_ACTIVE	0x0008
2331 #define WLFC_FLAGS_PSQ_GENERATIONFSM_ENABLE	0x0010
2332 #define WLFC_FLAGS_PSQ_ZERO_BUFFER_ENABLE	0x0020
2333 #define WLFC_FLAGS_HOST_RXRERODER_ACTIVE	0x0040
2334 #define WLFC_FLAGS_PKT_STAMP_SIGNALS		0x0080
2335 
2336 #endif /* PROP_TXSTATUS */
2337 
2338 #define WL_TIMBC_STATUS_AP_UNKNOWN	255	/* AP status for internal use only */
2339 
2340 #define WL_DFRTS_LOGIC_OFF	0	/* Feature is disabled */
2341 #define WL_DFRTS_LOGIC_OR	1	/* OR all non-zero threshold conditions */
2342 #define WL_DFRTS_LOGIC_AND	2	/* AND all non-zero threshold conditions */
2343 
2344 /* Definitions for Reliable Multicast */
2345 #define WL_RELMCAST_MAX_CLIENT		32
2346 #define WL_RELMCAST_FLAG_INBLACKLIST	1
2347 #define WL_RELMCAST_FLAG_ACTIVEACKER	2
2348 #define WL_RELMCAST_FLAG_RELMCAST	4
2349 
2350 /* structures for proximity detection device role */
2351 #define WL_PROXD_MODE_DISABLE	0
2352 #define WL_PROXD_MODE_NEUTRAL	1
2353 #define WL_PROXD_MODE_INITIATOR	2
2354 #define WL_PROXD_MODE_TARGET	3
2355 #define WL_PROXD_RANDOM_WAKEUP	0x8000
2356 
2357 #ifdef NET_DETECT
2358 #define NET_DETECT_MAX_WAKE_DATA_SIZE	2048
2359 #define NET_DETECT_MAX_PROFILES		16
2360 #define NET_DETECT_MAX_CHANNELS		50
2361 #endif /* NET_DETECT */
2362 
2363 /* Bit masks for radio disabled status - returned by WL_GET_RADIO */
2364 #define WL_RADIO_SW_DISABLE		(1<<0)
2365 #define WL_RADIO_HW_DISABLE		(1<<1)
2366 #define WL_RADIO_MPC_DISABLE		(1<<2)
2367 #define WL_RADIO_COUNTRY_DISABLE	(1<<3)	/* some countries don't support any channel */
2368 #define WL_RADIO_PERCORE_DISABLE	(1<<4)	/* Radio diable per core for DVT */
2369 #define WL_RADIO_TSYNC_PWRSAVE_DISABLE  (1<<5)  /* Disable Radio in tsync mode for power saving */
2370 
2371 #define	WL_SPURAVOID_OFF	0
2372 #define	WL_SPURAVOID_ON1	1
2373 #define	WL_SPURAVOID_ON2	2
2374 
2375 #define WL_4335_SPURAVOID_ON1	1
2376 #define WL_4335_SPURAVOID_ON2	2
2377 #define WL_4335_SPURAVOID_ON3	3
2378 #define WL_4335_SPURAVOID_ON4	4
2379 #define WL_4335_SPURAVOID_ON5	5
2380 #define WL_4335_SPURAVOID_ON6	6
2381 #define WL_4335_SPURAVOID_ON7	7
2382 #define WL_4335_SPURAVOID_ON8	8
2383 #define WL_4335_SPURAVOID_ON9	9
2384 
2385 /* Override bit for WLC_SET_TXPWR.  if set, ignore other level limits */
2386 #define WL_TXPWR_OVERRIDE	(1U<<31)
2387 #define WL_TXPWR_2G		(1U<<30)
2388 #define WL_TXPWR_5G		(1U<<29)
2389 #define WL_TXPWR_NEG   (1U<<28)
2390 
2391 #define WL_TXPWR_MASK		(~(0x7<<29))
2392 #define WL_TXPWR_CORE_MAX	(3)
2393 #define WL_TXPWR_CORE0_MASK	(0x000000FF)
2394 #define WL_TXPWR_CORE0_SHIFT	(0)
2395 #define WL_TXPWR_CORE1_MASK	(0x0000FF00)
2396 #define WL_TXPWR_CORE1_SHIFT	(8)
2397 #define WL_TXPWR_CORE2_MASK	(0x00FF0000)
2398 #define WL_TXPWR_CORE2_SHIFT	(16)
2399 
2400 /* phy types (returned by WLC_GET_PHYTPE) */
2401 #define	WLC_PHY_TYPE_A		0
2402 #define	WLC_PHY_TYPE_B		1
2403 #define	WLC_PHY_TYPE_G		2
2404 #define	WLC_PHY_TYPE_N		4
2405 #define	WLC_PHY_TYPE_LP		5
2406 #define	WLC_PHY_TYPE_SSN	6
2407 #define	WLC_PHY_TYPE_HT		7
2408 #define	WLC_PHY_TYPE_LCN	8
2409 #define	WLC_PHY_TYPE_LCN40	10
2410 #define WLC_PHY_TYPE_AC		11
2411 #define	WLC_PHY_TYPE_LCN20	12
2412 #define	WLC_PHY_TYPE_NULL	0xf
2413 
2414 /* Values for PM */
2415 #define PM_OFF	0
2416 #define PM_MAX	1
2417 #define PM_FAST 2
2418 #define PM_FORCE_OFF 3		/* use this bit to force PM off even bt is active */
2419 
2420 #define WL_WME_CNT_VERSION	1	/* current version of wl_wme_cnt_t */
2421 
2422 /* fbt_cap: FBT assoc / reassoc modes. */
2423 #define WLC_FBT_CAP_DRV_4WAY_AND_REASSOC  1 /* Driver 4-way handshake & reassoc (WLFBT). */
2424 
2425 /* monitor_promisc_level bits */
2426 #define WL_MONPROMISC_PROMISC 0x0001
2427 #define WL_MONPROMISC_CTRL 0x0002
2428 #define WL_MONPROMISC_FCS 0x0004
2429 
2430 /* TCP Checksum Offload defines */
2431 #define TOE_TX_CSUM_OL		0x00000001
2432 #define TOE_RX_CSUM_OL		0x00000002
2433 
2434 /* Wi-Fi Display Services (WFDS) */
2435 #define WL_P2P_SOCIAL_CHANNELS_MAX  WL_NUMCHANNELS
2436 #define MAX_WFDS_SEEK_SVC 4	/* Max # of wfds services to seek */
2437 #define MAX_WFDS_ADVERT_SVC 4	/* Max # of wfds services to advertise */
2438 #define MAX_WFDS_SVC_NAME_LEN 200	/* maximum service_name length */
2439 #define MAX_WFDS_ADV_SVC_INFO_LEN 65000	/* maximum adv service_info length */
2440 #define P2P_WFDS_HASH_LEN 6		/* Length of a WFDS service hash */
2441 #define MAX_WFDS_SEEK_SVC_INFO_LEN 255	/* maximum seek service_info req length */
2442 #define MAX_WFDS_SEEK_SVC_NAME_LEN 200	/* maximum service_name length */
2443 
2444 /* ap_isolate bitmaps */
2445 #define AP_ISOLATE_DISABLED		0x0
2446 #define AP_ISOLATE_SENDUP_ALL		0x01
2447 #define AP_ISOLATE_SENDUP_MCAST		0x02
2448 
2449 /* Type values for the wl_pwrstats_t data field */
2450 #define WL_PWRSTATS_TYPE_PHY		0 /**< struct wl_pwr_phy_stats */
2451 #define WL_PWRSTATS_TYPE_SCAN		1 /**< struct wl_pwr_scan_stats */
2452 #define WL_PWRSTATS_TYPE_USB_HSIC	2 /**< struct wl_pwr_usb_hsic_stats */
2453 #define WL_PWRSTATS_TYPE_PM_AWAKE1	3 /**< struct wl_pwr_pm_awake_stats_v1 */
2454 #define WL_PWRSTATS_TYPE_CONNECTION	4 /* struct wl_pwr_connect_stats; assoc and key-exch time */
2455 
2456 #ifdef WLAWDL
2457 #define WL_PWRSTATS_TYPE_AWDL		5 /**< struct wl_pwr_awdl_stats; */
2458 #endif /* WLAWDL */
2459 
2460 #define WL_PWRSTATS_TYPE_PCIE		6 /**< struct wl_pwr_pcie_stats */
2461 #define WL_PWRSTATS_TYPE_PM_AWAKE2	7 /**< struct wl_pwr_pm_awake_stats_v2 */
2462 #define WL_PWRSTATS_TYPE_SDIO		8 /* struct wl_pwr_sdio_stats */
2463 #define WL_PWRSTATS_TYPE_MIMO_PS_METRICS 9 /* struct wl_mimo_meas_metrics_t */
2464 #define WL_PWRSTATS_TYPE_SLICE_INDEX	10 /* slice index for which this report is meant for */
2465 #define WL_PWRSTATS_TYPE_TSYNC		11 /**< struct wl_pwr_tsync_stats */
2466 #define	WL_PWRSTATS_TYPE_OPS_STATS	12 /* struct wl_pwr_ops_stats_t */
2467 #define WL_PWRSTATS_TYPE_BCNTRIM_STATS	13 /* struct wl_pwr_bcntrim_stats_t */
2468 #define WL_PWRSTATS_TYPE_SLICE_INDEX_BAND_INFO	14 /* wl_pwr_slice_index_band_t */
2469 #define WL_PWRSTATS_TYPE_PSBW_STATS	15 /* struct wl_pwr_psbw_stats_t */
2470 #define WL_PWRSTATS_TYPE_PM_ACCUMUL	16 /* struct wl_pwr_pm_accum_stats_v1_t */
2471 
2472 /* IOV AWD DATA */
2473 #define AWD_DATA_JOIN_INFO	0
2474 #define AWD_DATA_VERSION_V1	1
2475 
2476 /* IOV ETD DATA */
2477 #define ETD_DATA_JOIN_INFO	0
2478 #define ETD_DATA_VERSION_V1	1
2479 
2480 /* CTMODE DBG */
2481 /* input param: [31:16] => MPDU_THRESHOLD
2482  *	        [15:03] => RESERVED
2483  *	        [02]    => enable UFP
2484  *	        [01]    => enable UFC
2485  *	        [00]    => enalbe CTMODE
2486  */
2487 #define	CTMODE_DBG_CTMODE_EN	(0x1u)
2488 #define	CTMODE_DBG_UFC_EN	(0x2u)
2489 #define CTMODE_DBG_UFP_EN	(0x4u)
2490 #define	CTMODE_DBG_MPDU_THRESHOLD_SHIFT	(7u)
2491 #define CTMODE_DBG_MPDU_THRESHOLD_MASK	((0x1FFu) << CTMODE_DBG_MPDU_THRESHOLD_SHIFT)
2492 #define	CTMODE_DBG_BYTES_THRESHOLD_SHIFT	(16u)
2493 #define CTMODE_DBG_BYTES_THRESHOLD_MASK	((0xFFFu) << CTMODE_DBG_BYTES_THRESHOLD_SHIFT)
2494 
2495 /* ====== SC use case configs ========= */
2496 /* SC user/use case request */
2497 #define WL_SC_REQ_SCAN	0u	/* user scan */
2498 #define WL_SC_REQ_CNX	1u	/* associated idle */
2499 #define WL_SC_REQ_NAN	2u	/* NAN synchronization and discovery offload */
2500 
2501 /* === Per use case configuration === */
2502 /* scan cfgs */
2503 #define SC_SCAN_CFG_PASSIVE_MASK	0x01u	/* Enable passive scan on sc */
2504 #define SC_SCAN_CFG_PASSIVE_SHIFT	0u
2505 #define SC_SCAN_CFG_LP_SCAN_MASK	0x02u	/* Enable low prio scan on sc */
2506 #define SC_SCAN_CFG_LP_SCAN_SHIFT	1u
2507 #define SC_SCAN_CFG_REG_SCAN_MASK	0x04u	/* Enable split scan using sc */
2508 #define SC_SCAN_CFG_REG_SCAN_SHIFT	2u
2509 #define SC_SCAN_CFG_FULL_SCAN_MASK	0x08u	/* Enable full scan on sc */
2510 #define SC_SCAN_CFG_FULL_SCAN_SHIFT	3u
2511 /* Add get and set macros for each of the configs? */
2512 
2513 /* === Place holder for cnx and nan cfgs === */
2514 #endif /* wlioctl_defs_h */
2515