xref: /wlan-dirver/qcacld-3.0/core/mac/inc/sir_api.h (revision 080e85188dafe29bc908e45fa94377f21a0c9431)
1 /*
2  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /*
21  * This file sir_api.h contains definitions exported by
22  * Sirius software.
23  * Author:        Chandra Modumudi
24  * Date:          04/16/2002
25  * History:-
26  * Date           Modified by    Modification Information
27  * --------------------------------------------------------------------
28  */
29 
30 #ifndef __SIR_API_H
31 #define __SIR_API_H
32 
33 /* legacy definition */
34 typedef void *tpAniSirGlobal;
35 
36 struct mac_context;
37 #include "qdf_types.h"
38 #include "cds_regdomain.h"
39 #include "sir_types.h"
40 #include "sir_mac_prot_def.h"
41 #include "ani_system_defs.h"
42 #include "sir_params.h"
43 #include "cds_regdomain.h"
44 #include "wmi_unified.h"
45 #include "wmi_unified_param.h"
46 #include "ol_txrx_htt_api.h"
47 #include "wlan_reg_services_api.h"
48 #include <dot11f.h>
49 #include "wlan_policy_mgr_api.h"
50 #include "wlan_tdls_public_structs.h"
51 #include "qca_vendor.h"
52 #include "wlan_cp_stats_mc_defs.h"
53 #ifdef WLAN_FEATURE_11BE_MLO
54 #include "wlan_mlo_mgr_public_structs.h"
55 #endif
56 
57 #define OFFSET_OF(structType, fldName)   (&((structType *)0)->fldName)
58 #define WLAN_DOT11_BASIC_RATE_MASK (0x80)
59 #define BITS_ON(_Field, _Bitmask)  ((_Field) |=  (_Bitmask))
60 #define BITS_OFF(_Field, _Bitmask) ((_Field) &= ~(_Bitmask))
61 
62 /* / Max supported channel list */
63 #define SIR_MAX_SUPPORTED_CHANNEL_LIST      96
64 
65 #define SIR_MDIE_SIZE               3   /* MD ID(2 bytes), Capability(1 byte) */
66 
67 #define SIR_MAX_ELEMENT_ID         255
68 
69 #define SIR_BCN_REPORT_MAX_BSS_DESC       8
70 
71 #define SIR_NUM_11B_RATES 4     /* 1,2,5.5,11 */
72 #define SIR_NUM_11A_RATES 8     /* 6,9,12,18,24,36,48,54 */
73 
74 typedef uint8_t tSirIpv4Addr[QDF_IPV4_ADDR_SIZE];
75 
76 #define SIR_VERSION_STRING_LEN 1024
77 typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
78 
79 /* Periodic Tx pattern offload feature */
80 #define PERIODIC_TX_PTRN_MAX_SIZE 1536
81 #ifndef MAXNUM_PERIODIC_TX_PTRNS
82 #define MAXNUM_PERIODIC_TX_PTRNS 6
83 #endif
84 
85 /* FW response timeout values in milli seconds */
86 #define SIR_PEER_ASSOC_TIMEOUT           (4000) /* 4 seconds */
87 
88 #ifdef FEATURE_RUNTIME_PM
89 /* Add extra PMO_RESUME_TIMEOUT for runtime PM resume timeout */
90 #define SIR_PEER_CREATE_RESPONSE_TIMEOUT (4000 + PMO_RESUME_TIMEOUT)
91 #define SIR_DELETE_STA_TIMEOUT           (4000 + PMO_RESUME_TIMEOUT)
92 #define SIR_VDEV_PLCY_MGR_TIMEOUT        (4000 + PMO_RESUME_TIMEOUT)
93 #else
94 #define SIR_PEER_CREATE_RESPONSE_TIMEOUT (4000)
95 #define SIR_DELETE_STA_TIMEOUT           (4000) /* 4 seconds */
96 #define SIR_VDEV_PLCY_MGR_TIMEOUT        (4000)
97 #endif
98 
99 #define MAX_POWER_DBG_ARGS_SUPPORTED 8
100 #define QOS_MAP_MAX_EX  21
101 #define QOS_MAP_RANGE_NUM 8
102 #define QOS_MAP_LEN_MIN (QOS_MAP_RANGE_NUM * 2)
103 #define QOS_MAP_LEN_MAX \
104 	(QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
105 #define NUM_CHAINS_MAX  2
106 
107 /* Maximum number of realms present in fils indication element */
108 #define SIR_MAX_REALM_COUNT 7
109 /* Realm length */
110 #define SIR_REALM_LEN 2
111 /* Cache ID length */
112 #define CACHE_ID_LEN 2
113 
114 /* Maximum peer station number query one time */
115 #define MAX_PEER_STA 12
116 
117 /* Maximum number of peers for SAP */
118 #ifndef SIR_SAP_MAX_NUM_PEERS
119 #define SIR_SAP_MAX_NUM_PEERS 32
120 #endif
121 
122 #define SIR_KEK_KEY_LEN 16
123 #define SIR_KEK_KEY_LEN_FILS 64
124 
125 #define SIR_FILS_HLP_OUI_TYPE  "\x5"
126 #define SIR_FILS_HLP_OUI_LEN   1
127 #define SIR_FILS_HLP_IE_LEN    2048
128 
129 #define SIR_REPLAY_CTR_LEN 8
130 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
131 #define SIR_UAPSD_BITOFFSET_ACVO     0
132 #define SIR_UAPSD_BITOFFSET_ACVI     1
133 #define SIR_UAPSD_BITOFFSET_ACBK     2
134 #define SIR_UAPSD_BITOFFSET_ACBE     3
135 
136 #define SIR_UAPSD_FLAG_ACVO     (1 << SIR_UAPSD_BITOFFSET_ACVO)
137 #define SIR_UAPSD_FLAG_ACVI     (1 << SIR_UAPSD_BITOFFSET_ACVI)
138 #define SIR_UAPSD_FLAG_ACBK     (1 << SIR_UAPSD_BITOFFSET_ACBK)
139 #define SIR_UAPSD_FLAG_ACBE     (1 << SIR_UAPSD_BITOFFSET_ACBE)
140 #define SIR_UAPSD_GET(ac, mask)      (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
141 
142 #endif
143 
144 /* Maximum management packet data unit length */
145 #define MAX_MGMT_MPDU_LEN 2304
146 
147 struct scheduler_msg;
148 
149 /**
150  * enum sir_roam_op_code - Operation to be done by the callback.
151  * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
152  * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
153  * @SIR_ROAMING_START: Firmware started roaming operation
154  * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
155  * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
156  * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
157  * @SIR_ROAMING_DEAUTH: Firmware indicates deauth.
158  */
159 enum sir_roam_op_code {
160 	SIR_ROAM_SYNCH_PROPAGATION = 1,
161 	SIR_ROAMING_DEREGISTER_STA,
162 	SIR_ROAMING_START,
163 	SIR_ROAMING_ABORT,
164 	SIR_ROAM_SYNCH_COMPLETE,
165 	SIR_ROAM_SYNCH_NAPI_OFF,
166 	SIR_ROAMING_INVOKE_FAIL,
167 	SIR_ROAMING_DEAUTH,
168 };
169 
170 /**
171  * enum ps_state - State of the power save
172  * @FULL_POWER_MODE: for Full power mode
173  * @LEGACY_POWER_SAVE_MODE: For Legacy Power Save mode
174  * @UAPSD_MODE: for UAPSD power save
175  */
176 enum ps_state {
177 	FULL_POWER_MODE,
178 	LEGACY_POWER_SAVE_MODE,
179 	UAPSD_MODE
180 };
181 
182 /**
183  * \var g_phy_rates_suppt
184  *
185  * \brief Rate support lookup table
186  *
187  *
188  * This is a  lookup table indexing rates &  configuration parameters to
189  * support.  Given a rate (in  unites of 0.5Mpbs) & three bools (MIMO
190  * Enabled, Channel  Bonding Enabled, & Concatenation  Enabled), one can
191  * determine  whether  the given  rate  is  supported  by computing  two
192  * indices.  The  first maps  the rate to  table row as  indicated below
193  * (i.e. eHddSuppRate_6Mbps maps to  row zero, eHddSuppRate_9Mbps to row
194  * 1, and so on).  Index two can be computed like so:
195  *
196  * \code
197  *  idx2 = ( fEsf  ? 0x4 : 0x0 ) |
198  *         ( fCb   ? 0x2 : 0x0 ) |
199  *         ( fMimo ? 0x1 : 0x0 );
200  * \endcode
201  *
202  *
203  * Given that:
204  *
205  *  \code
206  *  fSupported = g_phy_rates_suppt[idx1][idx2];
207  *  \endcode
208  *
209  *
210  * This table is based on  the document "PHY Supported Rates.doc".  This
211  * table is  permissive in that a  rate is reflected  as being supported
212  * even  when turning  off an  enabled feature  would be  required.  For
213  * instance, "PHY Supported Rates"  lists 42Mpbs as unsupported when CB,
214  * ESF, &  MIMO are all  on.  However,  if we turn  off either of  CB or
215  * MIMO, it then becomes supported.   Therefore, we mark it as supported
216  * even in index 7 of this table.
217  *
218  *
219  */
220 
221 static const bool g_phy_rates_suppt[24][8] = {
222 
223 	/* SSF   SSF    SSF    SSF    ESF    ESF    ESF    ESF */
224 	/* SIMO  MIMO   SIMO   MIMO   SIMO   MIMO   SIMO   MIMO */
225 	/* No CB No CB  CB     CB     No CB  No CB  CB     CB */
226 	{true, true, true, true, true, true, true, true},       /* 6Mbps */
227 	{true, true, true, true, true, true, true, true},       /* 9Mbps */
228 	{true, true, true, true, true, true, true, true},       /* 12Mbps */
229 	{true, true, true, true, true, true, true, true},       /* 18Mbps */
230 	{false, false, true, true, false, false, true, true},   /* 20Mbps */
231 	{true, true, true, true, true, true, true, true},       /* 24Mbps */
232 	{true, true, true, true, true, true, true, true},       /* 36Mbps */
233 	{false, false, true, true, false, true, true, true},    /* 40Mbps */
234 	{false, false, true, true, false, true, true, true},    /* 42Mbps */
235 	{true, true, true, true, true, true, true, true},       /* 48Mbps */
236 	{true, true, true, true, true, true, true, true},       /* 54Mbps */
237 	{false, true, true, true, false, true, true, true},     /* 72Mbps */
238 	{false, false, true, true, false, true, true, true},    /* 80Mbps */
239 	{false, false, true, true, false, true, true, true},    /* 84Mbps */
240 	{false, true, true, true, false, true, true, true},     /* 96Mbps */
241 	{false, true, true, true, false, true, true, true},     /* 108Mbps */
242 	{false, false, true, true, false, true, true, true},    /* 120Mbps */
243 	{false, false, true, true, false, true, true, true},    /* 126Mbps */
244 	{false, false, false, true, false, false, false, true}, /* 144Mbps */
245 	{false, false, false, true, false, false, false, true}, /* 160Mbps */
246 	{false, false, false, true, false, false, false, true}, /* 168Mbps */
247 	{false, false, false, true, false, false, false, true}, /* 192Mbps */
248 	{false, false, false, true, false, false, false, true}, /* 216Mbps */
249 	{false, false, false, true, false, false, false, true}, /* 240Mbps */
250 };
251 
252 typedef enum {
253 	/* 11b rates */
254 	SUPP_RATE_1_MBPS   =   1 * 2,
255 	SUPP_RATE_2_MBPS   =   2 * 2,
256 	SUPP_RATE_5_MBPS =     11,
257 	SUPP_RATE_11_MBPS  =   11 * 2,
258 
259 	/* 11a / 11g rates */
260 	SUPP_RATE_6_MBPS   =   6 * 2,
261 	SUPP_RATE_9_MBPS   =   9 * 2,
262 	SUPP_RATE_12_MBPS  =   12 * 2,
263 	SUPP_RATE_18_MBPS  =   18 * 2,
264 	SUPP_RATE_24_MBPS  =   24 * 2,
265 	SUPP_RATE_36_MBPS  =   36 * 2,
266 	SUPP_RATE_48_MBPS  =   48 * 2,
267 	SUPP_RATE_54_MBPS  =   54 * 2,
268 
269 	/* Airgo prop. rates */
270 	SUPP_RATE_20_MBPS   =  20 * 2,
271 	SUPP_RATE_40_MBPS   =  40 * 2,
272 	SUPP_RATE_42_MBPS   =  42 * 2,
273 	SUPP_RATE_72_MBPS   =  72 * 2,
274 	SUPP_RATE_80_MBPS   =  80 * 2,
275 	SUPP_RATE_84_MBPS   =  84 * 2,
276 	SUPP_RATE_96_MBPS   =  96 * 2,
277 	SUPP_RATE_108_MBPS  =  108 * 2,
278 	SUPP_RATE_120_MBPS  =  120 * 2,
279 	SUPP_RATE_126_MBPS  =  126 * 2,
280 	SUPP_RATE_144_MBPS  =  144 * 2,
281 	SUPP_RATE_160_MBPS  =  160 * 2,
282 	SUPP_RATE_168_MBPS  =  168 * 2,
283 	SUPP_RATE_192_MBPS  =  192 * 2,
284 	SUPP_RATE_216_MBPS  =  216 * 2,
285 	SUPP_RATE_240_MBPS  =  240 * 2
286 } eCsrSupportedRates;
287 
288 /**
289  * struct ps_params - maintain power save state and USAPD params
290  * @mac_ctx: mac_ctx
291  * @session_id: Session Id.
292  * @ps_state : State of the power save
293  * @uapsd_per_ac_trigger_enable_mask: dynamic UPASD mask setting
294  *		derived from AddTS Rsp and DelTS frame.
295  *		If a particular AC bit is set, it means AC is trigger  enabled.
296  * @uapsd_per_ac_delivery_enable_mask: dynamic UPASD mask setting
297  *		derived from AddTS Rsp and DelTs frame.
298  *		If a particular AC bit is set, it means AC is delivery enabled.
299  * @ac_admit_mask: used for AC downgrade. This is a dynamic mask
300  *		setting which keep tracks of ACs being admitted.
301  *		If bit is set to 0: That particular AC is not admitted
302  *		If bit is set to 1: That particular AC is admitted
303  * @uapsd_per_ac_bit_mask: This is a static UAPSD mask setting
304  *		derived from SME_JOIN_REQ and SME_REASSOC_REQ.
305  *		If a particular AC bit is set, it means the AC is both
306  *		trigger enabled and delivery enabled.
307  * @auto_ps_enable_timer: Upon expiration of this timer	Power Save Offload
308  *		module will try to enable sta mode ps
309  */
310 
311 struct ps_params {
312 	void *mac_ctx;
313 	uint32_t     session_id;
314 	enum    ps_state ps_state;
315 	uint8_t uapsd_per_ac_trigger_enable_mask;
316 	uint8_t uapsd_per_ac_delivery_enable_mask;
317 	uint8_t ac_admit_mask[SIR_MAC_DIRECTION_DIRECT];
318 	uint8_t uapsd_per_ac_bit_mask;
319 	qdf_mc_timer_t auto_ps_enable_timer;
320 };
321 
322 /* Type declarations used by Firmware and Host software */
323 
324 /* Scan type enum used in scan request */
325 typedef enum eSirScanType {
326 	eSIR_PASSIVE_SCAN,
327 	eSIR_ACTIVE_SCAN,
328 	eSIR_BEACON_TABLE,
329 } tSirScanType;
330 
331 /**
332  * struct roam_scan_ch_resp - roam scan chan list response to userspace
333  * @vdev_id: vdev id
334  * @num_channels: number of roam scan channels
335  * @command_resp: command response or async event
336  * @chan_list: list of roam scan channels
337  */
338 struct roam_scan_ch_resp {
339 	uint16_t vdev_id;
340 	uint16_t num_channels;
341 	uint32_t command_resp;
342 	uint32_t *chan_list;
343 };
344 
345 /**
346  * struct wlan_beacon_report - Beacon info to be send to userspace
347  * @vdev_id: vdev id
348  * @ssid: ssid present in beacon
349  * @bssid: bssid present in beacon
350  * @frequency: channel frequency in MHz
351  * @beacon_interval: Interval between two consecutive beacons
352  * @time_stamp: time stamp at which beacon received from AP
353  * @boot_time: Boot time when beacon received
354  */
355 struct wlan_beacon_report {
356 	uint8_t vdev_id;
357 	struct wlan_ssid ssid;
358 	struct qdf_mac_addr bssid;
359 	uint32_t frequency;
360 	uint16_t beacon_interval;
361 	qdf_time_t time_stamp;
362 	qdf_time_t boot_time;
363 };
364 
365 
366 /* / Result codes Firmware return to Host SW */
367 typedef enum eSirResultCodes {
368 	eSIR_SME_SUCCESS,
369 	eSIR_LOGE_EXCEPTION,
370 	eSIR_SME_INVALID_PARAMETERS = 500,
371 	eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
372 	eSIR_SME_RESOURCES_UNAVAILABLE,
373 	/* Unable to find a BssDescription */
374 	eSIR_SME_SCAN_FAILED,
375 	/* matching requested scan criteria */
376 	eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
377 	eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
378 	eSIR_SME_REFUSED,
379 	eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
380 	eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
381 	eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
382 	eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
383 	eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
384 	eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
385 	eSIR_SME_AUTH_REFUSED,
386 	eSIR_SME_INVALID_WEP_DEFAULT_KEY,
387 	eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
388 	eSIR_SME_ASSOC_REFUSED,
389 	eSIR_SME_REASSOC_REFUSED,
390 	/* Recvd Deauth while join/pre-auth */
391 	eSIR_SME_DEAUTH_WHILE_JOIN,
392 	eSIR_SME_STA_NOT_AUTHENTICATED,
393 	eSIR_SME_STA_NOT_ASSOCIATED,
394 	eSIR_SME_ALREADY_JOINED_A_BSS,
395 	/* Given in SME_SCAN_RSP msg */
396 	eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
397 	/* that more SME_SCAN_RSP */
398 	/* messages are following. */
399 	/* SME_SCAN_RSP message with */
400 	/* eSIR_SME_SUCCESS status */
401 	/* code is the last one. */
402 	/* Sent in SME_JOIN/REASSOC_RSP */
403 	eSIR_SME_INVALID_ASSOC_RSP_RXED,
404 	/* messages upon receiving */
405 	/* invalid Re/Assoc Rsp frame. */
406 	/* STOP BSS triggered by MIC failures: MAC software to
407 	 * disassoc all stations
408 	 */
409 	eSIR_SME_MIC_COUNTER_MEASURES,
410 	/* with MIC_FAILURE reason code and perform the stop bss operation */
411 	/* didn't get rsp from peer within timeout interval */
412 	eSIR_SME_ADDTS_RSP_TIMEOUT,
413 	/* didn't get success rsp from HAL */
414 	eSIR_SME_ADDTS_RSP_FAILED,
415 	/* failed to send ch switch act frm */
416 	eSIR_SME_CHANNEL_SWITCH_FAIL,
417 	eSIR_SME_INVALID_STATE,
418 	/* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
419 	eSIR_SME_HAL_SCAN_INIT_FAILED,
420 	/* SIR_HAL_END_SCAN_RSP returned failed status */
421 	eSIR_SME_HAL_SCAN_END_FAILED,
422 	/* SIR_HAL_FINISH_SCAN_RSP returned failed status */
423 	eSIR_SME_HAL_SCAN_FINISH_FAILED,
424 	/* Failed to send a message to HAL */
425 	eSIR_SME_HAL_SEND_MESSAGE_FAIL,
426 	/* Failed to stop the bss */
427 	eSIR_SME_STOP_BSS_FAILURE,
428 	eSIR_SME_WOWL_ENTER_REQ_FAILED,
429 	eSIR_SME_WOWL_EXIT_REQ_FAILED,
430 	eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
431 	eSIR_SME_FT_REASSOC_FAILURE,
432 	eSIR_SME_SEND_ACTION_FAIL,
433 	eSIR_SME_DEAUTH_STATUS,
434 	eSIR_PNO_SCAN_SUCCESS,
435 	eSIR_SME_INVALID_SESSION,
436 	eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
437 } tSirResultCodes;
438 
439 #ifdef WLAN_FEATURE_FILS_SK
440 struct fils_join_rsp_params {
441 	uint8_t *fils_pmk;
442 	uint8_t fils_pmk_len;
443 	uint8_t fils_pmkid[PMKID_LEN];
444 	uint8_t kek[MAX_KEK_LEN];
445 	uint8_t kek_len;
446 	uint8_t tk[MAX_TK_LEN];
447 	uint8_t tk_len;
448 	uint8_t gtk_len;
449 	uint8_t gtk[MAX_GTK_LEN];
450 	struct qdf_mac_addr dst_mac;
451 	struct qdf_mac_addr src_mac;
452 	uint16_t hlp_data_len;
453 	uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
454 };
455 #endif
456 
457 #define RMENABLEDCAP_MAX_LEN 5
458 
459 struct rrm_config_param {
460 	uint8_t rrm_enabled;
461 	bool sap_rrm_enabled;
462 	uint8_t max_randn_interval;
463 	uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
464 };
465 
466 const char *lim_bss_type_to_string(const uint16_t bss_type);
467 /**
468  * struct supported_rates - stores rates/MCS supported
469  * @llbRates: 11b rates in unit of 500kbps
470  * @llaRates: 11a rates in unit of 500kbps
471  * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
472  *                    bits 0-15 and 32 should be set.
473  * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
474  *                      rate that the STA is able to receive, in unites of 1Mbps
475  *                      This value is derived from "Supported MCS Set field"
476  *                      inside the HT capability element.
477  * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
478  *                number of spacial streams
479  * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
480  *                         able to receive
481  * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
482  *                each number of spacial streams
483  * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
484  *                         able to transmit
485  * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
486  *              number of spacial streams
487  * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
488  *              number of spacial streams
489  * @bw_20_rx_max_nss_for_mcs_0_to_7: Indicates MAX RX NSS for MCS from 0 to 7
490  * @bw_20_tx_max_nss_for_mcs_0_to_7: Indicates MAX TX NSS for MCS from 0 to 7
491  * @bw_20_rx_max_nss_for_mcs_8_and_9: Indicates MAX RX NSS for MCS from 8 9
492  * @bw_20_tx_max_nss_for_mcs_8_and_9: Indicates MAX TX NSS for MCS from 8 9
493  * @bw_20_rx_max_nss_for_mcs_10_and_11:Indicates MAX RX NSS for MCS from 10 11
494  * @bw_20_tx_max_nss_for_mcs_10_and_11: Indicates MAX TX NSS for MCS from 10 11
495  * @bw_20_rx_max_nss_for_mcs_12_and_13: Indicates MAX RX NSS for MCS from 12 13
496  * @bw_20_tx_max_nss_for_mcs_12_and_13: Indicates MAX TX NSS for MCS from 12 13
497  * @bw_le_80_rx_max_nss_for_mcs_0_to_7: Indicates MAX RX NSS for MCS from 0 to 7
498  * @bw_le_80_tx_max_nss_for_mcs_0_to_7: Indicates MAX TX NSS for MCS from 0 to 7
499  * @bw_le_80_rx_max_nss_for_mcs_8_and_9: Indicates MAX RX NSS for MCS from 8 9
500  * @bw_le_80_tx_max_nss_for_mcs_8_and_9: Indicates MAX TX NSS for MCS from 8 9
501  * @bw_le_80_rx_max_nss_for_mcs_10_and_11:Indicates MAX RX NSS for MCS from
502  *                                        10 11
503  * @bw_le_80_tx_max_nss_for_mcs_10_and_11: Indicates MAX TX NSS for MCS from
504  *                                         10 11
505  * @bw_le_80_rx_max_nss_for_mcs_12_and_13: Indicates MAX RX NSS for MCS from
506  *                                         12 13
507  * @bw_le_80_tx_max_nss_for_mcs_12_and_13: Indicates MAX TX NSS for MCS from
508  *                                         12 13
509  * @bw_160_rx_max_nss_for_mcs_0_to_7: Indicates MAX RX NSS for MCS from 0 to 7
510  * @bw_160_tx_max_nss_for_mcs_0_to_7: Indicates MAX TX NSS for MCS from 0 to 7
511  * @bw_160_rx_max_nss_for_mcs_8_and_9: Indicates MAX RX NSS for MCS from 8 9
512  * @bw_160_tx_max_nss_for_mcs_8_and_9: Indicates MAX TX NSS for MCS from 8 9
513  * @bw_160_rx_max_nss_for_mcs_10_and_11:Indicates MAX RX NSS for MCS from
514  *                                        10 11
515  * @bw_160_tx_max_nss_for_mcs_10_and_11: Indicates MAX TX NSS for MCS from
516  *                                         10 11
517  * @bw_160_rx_max_nss_for_mcs_12_and_13: Indicates MAX RX NSS for MCS from
518  *                                         12 13
519  * @bw_160_tx_max_nss_for_mcs_12_and_13: Indicates MAX TX NSS for MCS from
520  *                                         12 13
521  * @bw_320_rx_max_nss_for_mcs_0_to_7: Indicates MAX RX NSS for MCS from 0 to 7
522  * @bw_320_tx_max_nss_for_mcs_0_to_7: Indicates MAX TX NSS for MCS from 0 to 7
523  * @bw_320_rx_max_nss_for_mcs_8_and_9: Indicates MAX RX NSS for MCS from 8 9
524  * @bw_320_tx_max_nss_for_mcs_8_and_9: Indicates MAX TX NSS for MCS from 8 9
525  * @bw_320_rx_max_nss_for_mcs_10_and_11:Indicates MAX RX NSS for MCS from
526  *                                        10 11
527  * @bw_320_tx_max_nss_for_mcs_10_and_11: Indicates MAX TX NSS for MCS from
528  *                                         10 11
529  * @bw_320_rx_max_nss_for_mcs_12_and_13: Indicates MAX RX NSS for MCS from
530  *                                         12 13
531  * @bw_320_tx_max_nss_for_mcs_12_and_13: Indicates MAX TX NSS for MCS from
532  *                                         12 13
533  */
534 struct supported_rates {
535 	uint16_t llbRates[SIR_NUM_11B_RATES];
536 	uint16_t llaRates[SIR_NUM_11A_RATES];
537 	uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
538 	uint16_t rxHighestDataRate;
539 	uint16_t vhtRxMCSMap;
540 	uint16_t vhtRxHighestDataRate;
541 	uint16_t vhtTxMCSMap;
542 	uint16_t vhtTxHighestDataRate;
543 #ifdef WLAN_FEATURE_11AX
544 	uint16_t rx_he_mcs_map_lt_80;
545 	uint16_t tx_he_mcs_map_lt_80;
546 	uint16_t rx_he_mcs_map_160;
547 	uint16_t tx_he_mcs_map_160;
548 	uint16_t rx_he_mcs_map_80_80;
549 	uint16_t tx_he_mcs_map_80_80;
550 #endif
551 #ifdef WLAN_FEATURE_11BE
552 	uint32_t bw_20_rx_max_nss_for_mcs_0_to_7:4;
553 	uint32_t bw_20_tx_max_nss_for_mcs_0_to_7:4;
554 	uint32_t bw_20_rx_max_nss_for_mcs_8_and_9:4;
555 	uint32_t bw_20_tx_max_nss_for_mcs_8_and_9:4;
556 	uint32_t bw_20_rx_max_nss_for_mcs_10_and_11:4;
557 	uint32_t bw_20_tx_max_nss_for_mcs_10_and_11:4;
558 	uint32_t bw_20_rx_max_nss_for_mcs_12_and_13:4;
559 	uint32_t bw_20_tx_max_nss_for_mcs_12_and_13:4;
560 	uint32_t bw_le_80_rx_max_nss_for_mcs_0_to_9:4;
561 	uint32_t bw_le_80_tx_max_nss_for_mcs_0_to_9:4;
562 	uint32_t bw_le_80_rx_max_nss_for_mcs_10_and_11:4;
563 	uint32_t bw_le_80_tx_max_nss_for_mcs_10_and_11:4;
564 	uint32_t bw_le_80_rx_max_nss_for_mcs_12_and_13:4;
565 	uint32_t bw_le_80_tx_max_nss_for_mcs_12_and_13:4;
566 	uint32_t bw_160_rx_max_nss_for_mcs_0_to_9:4;
567 	uint32_t bw_160_tx_max_nss_for_mcs_0_to_9:4;
568 	uint32_t bw_160_rx_max_nss_for_mcs_10_and_11:4;
569 	uint32_t bw_160_tx_max_nss_for_mcs_10_and_11:4;
570 	uint32_t bw_160_rx_max_nss_for_mcs_12_and_13:4;
571 	uint32_t bw_160_tx_max_nss_for_mcs_12_and_13:4;
572 	uint32_t bw_320_rx_max_nss_for_mcs_0_to_9:4;
573 	uint32_t bw_320_tx_max_nss_for_mcs_0_to_9:4;
574 	uint32_t bw_320_rx_max_nss_for_mcs_10_and_11:4;
575 	uint32_t bw_320_tx_max_nss_for_mcs_10_and_11:4;
576 	uint8_t bw_320_rx_max_nss_for_mcs_12_and_13:4;
577 	uint8_t bw_320_tx_max_nss_for_mcs_12_and_13:4;
578 #endif
579 };
580 
581 struct register_mgmt_frame {
582 	uint16_t messageType;
583 	uint16_t length;
584 	uint8_t sessionId;
585 	bool registerFrame;
586 	uint16_t frameType;
587 	uint16_t matchLen;
588 	QDF_FLEX_ARRAY(uint8_t, matchData);
589 };
590 
591 /* / Generic type for sending a response message */
592 /* / with result code to host software */
593 typedef struct sSirSmeRsp {
594 	uint16_t messageType;   /* eWNI_SME_*_RSP */
595 	uint16_t length;
596 	uint8_t vdev_id;
597 	tSirResultCodes status_code;
598 	struct wlan_objmgr_psoc *psoc;
599 } tSirSmeRsp, *tpSirSmeRsp;
600 
601 struct bss_description;
602 struct roam_offload_synch_ind;
603 struct roam_pmkid_req_event;
604 
605 /**
606  * typedef pe_roam_synch_fn_t - PE roam synch callback routine pointer
607  * @mac_ctx: Global MAC context
608  * @vdev_id: vdev id
609  * @roam_sync_ind_ptr: Structure with roam synch parameters
610  * @ie_len: ie length
611  * @reason: Reason for calling the callback
612  *
613  * This type is for callbacks registered with WMA to complete the roam synch
614  * propagation at PE level. It also fills the BSS descriptor, which will be
615  * helpful to complete the roam synch propagation.
616  *
617  * Return: Success or Failure.
618  */
619 typedef QDF_STATUS
620 (*pe_roam_synch_fn_t)(struct mac_context *mac_ctx,
621 		      uint8_t vdev_id,
622 		      struct roam_offload_synch_ind *roam_sync_ind_ptr,
623 		      uint16_t ie_len,
624 		      enum sir_roam_op_code reason);
625 
626 /**
627  * typedef stop_roaming_fn_t - Stop roaming routine pointer
628  * @mac_handle: Pointer to opaque mac handle
629  * @session_id: Session Identifier
630  * @reason: Reason for calling the callback
631  * @requestor: Requestor for disabling roaming in driver
632  *
633  * This type is for callbacks registered with WMA to stop roaming on the given
634  * session ID
635  *
636  * Return: Success or Failure.
637  */
638 typedef QDF_STATUS
639 (*stop_roaming_fn_t)(mac_handle_t mac_handle,
640 		     uint8_t session_id, uint8_t reason,
641 		     enum wlan_cm_rso_control_requestor requestor);
642 
643 /**
644  * typedef set_ies_fn_t - Set IEs routine pointer
645  * @mac_ctx: Global MAC context
646  * @vdev_id: vdev id
647  * @dot11_mode: dot11 mode
648  * @opmode: device opmode
649  *
650  * This type is for callbacks registered with WMA to set the IEs for a
651  * given vdev id to the firmware.
652  *
653  * Return: Success or Failure
654  */
655 typedef QDF_STATUS
656 (*set_ies_fn_t)(struct mac_context *mac_ctx, uint8_t vdev_id,
657 		uint16_t dot11_mode, enum QDF_OPMODE device_mode);
658 
659 /* / Definition for indicating all modules ready on STA */
660 struct sme_ready_req {
661 	uint16_t messageType;   /* eWNI_SME_SYS_READY_IND */
662 	uint16_t length;
663 	QDF_STATUS (*csr_roam_auth_event_handle_cb)(struct mac_context *mac,
664 						    uint8_t vdev_id,
665 						    struct qdf_mac_addr bssid,
666 						    uint32_t akm);
667 	pe_roam_synch_fn_t pe_roam_synch_cb;
668 	stop_roaming_fn_t stop_roaming_cb;
669 	QDF_STATUS (*sme_msg_cb)(struct mac_context *mac,
670 				 struct scheduler_msg *msg);
671 	QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
672 					uint8_t vdev_id,
673 					uint8_t *deauth_disassoc_frame,
674 					uint16_t deauth_disassoc_frame_len,
675 					uint16_t reason_code);
676 	set_ies_fn_t pe_roam_set_ie_cb;
677 };
678 
679 /**
680  * struct s_sir_set_hw_mode - Set HW mode request
681  * @messageType: Message type
682  * @length: Length of the message
683  * @set_hw: Params containing the HW mode index and callback
684  */
685 struct s_sir_set_hw_mode {
686 	uint16_t messageType;
687 	uint16_t length;
688 	struct policy_mgr_hw_mode set_hw;
689 };
690 
691 /**
692  * struct sir_set_dual_mac_cfg - Set Dual mac config request
693  * @message_type: Message type
694  * @length: Length of the message
695  * @set_dual_mac: Params containing the dual mac config and callback
696  */
697 struct sir_set_dual_mac_cfg {
698 	uint16_t message_type;
699 	uint16_t length;
700 	struct policy_mgr_dual_mac_config set_dual_mac;
701 };
702 
703 /**
704  * struct sir_antenna_mode_param - antenna mode param
705  * @num_tx_chains: Number of TX chains
706  * @num_rx_chains: Number of RX chains
707  * @set_antenna_mode_resp: callback to set antenna mode command
708  * @set_antenna_mode_ctx: callback context to set antenna mode command
709  */
710 struct sir_antenna_mode_param {
711 	uint32_t num_tx_chains;
712 	uint32_t num_rx_chains;
713 	void *set_antenna_mode_resp;
714 	void *set_antenna_mode_ctx;
715 };
716 
717 /**
718  * struct sir_set_antenna_mode - Set antenna mode request
719  * @message_type: Message type
720  * @length: Length of the message
721  * @set_antenna_mode: Params containing antenna mode params
722  */
723 struct sir_set_antenna_mode {
724 	uint16_t message_type;
725 	uint16_t length;
726 	struct sir_antenna_mode_param set_antenna_mode;
727 };
728 
729 /**
730  * enum bss_type - Enum for BSS type used in scanning/joining etc.
731  *
732  * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
733  * @eSIR_INFRA_AP_MODE: softAP mode
734  * @eSIR_AUTO_MODE: Auto role
735  * @eSIR_MONITOR_MODE: Monitor mode
736  * @eSIR_NDI_MODE: NAN datapath mode
737  */
738 enum bss_type {
739 	eSIR_INFRASTRUCTURE_MODE,
740 	eSIR_INFRA_AP_MODE,
741 	eSIR_AUTO_MODE,
742 	eSIR_MONITOR_MODE,
743 	eSIR_NDI_MODE,
744 	eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
745 };
746 
747 /* / Power Capability info used in 11H */
748 struct power_cap_info {
749 	uint8_t minTxPower;
750 	uint8_t maxTxPower;
751 };
752 
753 /* / Supported Channel info used in 11H */
754 struct supported_channels {
755 	uint8_t numChnl;
756 	uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
757 };
758 
759 typedef enum eSirNwType {
760 	eSIR_11A_NW_TYPE,
761 	eSIR_11B_NW_TYPE,
762 	eSIR_11G_NW_TYPE,
763 	eSIR_11N_NW_TYPE,
764 	eSIR_11AC_NW_TYPE,
765 	eSIR_11AX_NW_TYPE,
766 	eSIR_11BE_NW_TYPE,
767 	eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
768 } tSirNwType;
769 
770 struct add_ie_params {
771 	uint16_t probeRespDataLen;
772 	uint8_t *probeRespData_buff;
773 	uint16_t assocRespDataLen;
774 	uint8_t *assocRespData_buff;
775 	uint16_t probeRespBCNDataLen;
776 	uint8_t *probeRespBCNData_buff;
777 };
778 
779 #define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
780 			    ((uintptr_t)OFFSET_OF(struct bss_description,\
781 						  ieFields)))
782 
783 #define WSCIE_PROBE_RSP_LEN (317 + 2)
784 
785 #ifdef WLAN_FEATURE_FILS_SK
786 /* struct fils_ind_elements: elements parsed from fils indication present
787  * in beacon/probe resp
788  * @realm_cnt: number of realm present
789  * @realm: realms
790  * @is_fils_sk_supported: if FILS SK supported
791  * @is_cache_id_present: if cache id present
792  * @cache_id: cache id
793  */
794 struct fils_ind_elements {
795 	uint16_t realm_cnt;
796 	uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
797 	bool is_fils_sk_supported;
798 	bool is_cache_id_present;
799 	uint8_t cache_id[CACHE_ID_LEN];
800 };
801 #endif
802 
803 struct bss_description {
804 	/* offset of the ieFields from bssId. */
805 	uint16_t length;
806 	tSirMacAddr bssId;
807 	unsigned long scansystimensec;
808 	uint32_t timeStamp[2];
809 	uint16_t beaconInterval;
810 	uint16_t capabilityInfo;
811 	tSirNwType nwType;      /* Indicates 11a/b/g */
812 	int8_t rssi;
813 	int8_t rssi_raw;
814 	int8_t sinr;
815 	/* channel frequency what peer sent in beacon/probersp. */
816 	uint32_t chan_freq;
817 	/* Based on system time, not a relative time. */
818 	uint64_t received_time;
819 	uint32_t parentTSF;
820 	uint32_t startTSF[2];
821 	uint8_t mdiePresent;
822 	/* MDIE for 11r, picked from the beacons */
823 	uint8_t mdie[SIR_MDIE_SIZE];
824 #ifdef FEATURE_WLAN_ESE
825 	uint16_t QBSSLoad_present;
826 	uint16_t QBSSLoad_avail;
827 #endif
828 	/* whether it is from a probe rsp */
829 	uint8_t fProbeRsp;
830 	tSirMacSeqCtl seq_ctrl;
831 	uint32_t tsf_delta;
832 	struct scan_mbssid_info mbssid_info;
833 #ifdef WLAN_FEATURE_FILS_SK
834 	struct fils_ind_elements fils_info_element;
835 #endif
836 	uint32_t assoc_disallowed;
837 	uint32_t adaptive_11r_ap;
838 	uint32_t mbo_oce_enabled_ap;
839 #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
840 	uint32_t is_single_pmk;
841 #endif
842 	/* Please keep the structure 4 bytes aligned above the ieFields */
843 	QDF_FLEX_ARRAY(uint32_t, ieFields);
844 };
845 
846 /* / Definition for response message to previously */
847 /* / issued start BSS request */
848 /* / MAC ---> */
849 struct start_bss_rsp {
850 	uint8_t vdev_id;
851 	tSirResultCodes status_code;
852 	uint32_t staId;         /* Station ID for Self */
853 };
854 
855 struct report_channel_list {
856 	uint8_t num_channels;
857 	uint32_t chan_freq_lst[SIR_ESE_MAX_MEAS_IE_REQS];
858 };
859 
860 #ifdef FEATURE_OEM_DATA_SUPPORT
861 struct oem_data_req {
862 	uint32_t data_len;
863 	uint8_t *data;
864 };
865 
866 struct oem_data_rsp {
867 	uint32_t rsp_len;
868 	uint8_t *data;
869 };
870 #endif /* FEATURE_OEM_DATA_SUPPORT */
871 
872 #ifdef FEATURE_WLAN_ESE
873 typedef struct ese_wmm_tspec_ie {
874 	uint16_t         traffic_type:1;
875 	uint16_t                 tsid:4;
876 	uint16_t            direction:2;
877 	uint16_t        access_policy:2;
878 	uint16_t          aggregation:1;
879 	uint16_t                  psb:1;
880 	uint16_t        user_priority:3;
881 	uint16_t       tsinfo_ack_pol:2;
882 	uint8_t          tsinfo_rsvd:7;
883 	uint8_t      burst_size_defn:1;
884 	uint16_t                 size:15;
885 	uint16_t                fixed:1;
886 	uint16_t            max_msdu_size;
887 	uint32_t            min_service_int;
888 	uint32_t            max_service_int;
889 	uint32_t            inactivity_int;
890 	uint32_t            suspension_int;
891 	uint32_t            service_start_time;
892 	uint32_t            min_data_rate;
893 	uint32_t            mean_data_rate;
894 	uint32_t            peak_data_rate;
895 	uint32_t            burst_size;
896 	uint32_t            delay_bound;
897 	uint32_t            min_phy_rate;
898 	uint16_t            surplus_bw_allowance;
899 	uint16_t            medium_time;
900 } qdf_packed ese_wmm_tspec_ie;
901 
902 typedef struct sTspecInfo {
903 	uint8_t valid;
904 	struct mac_tspec_ie tspec;
905 } tTspecInfo;
906 
907 typedef struct sESETspecTspecInfo {
908 	uint8_t numTspecs;
909 	tTspecInfo tspec[ESE_MAX_TSPEC_IES];
910 } tESETspecInfo;
911 
912 struct tsm_ie {
913 	uint8_t tsid;
914 	uint8_t state;
915 	uint16_t msmt_interval;
916 };
917 
918 struct tsm_ie_ind {
919 	struct tsm_ie tsm_ie;
920 	uint8_t sessionId;
921 };
922 
923 typedef struct sAniTrafStrmMetrics {
924 	uint16_t UplinkPktQueueDly;
925 	uint16_t UplinkPktQueueDlyHist[4];
926 	uint32_t UplinkPktTxDly;
927 	uint16_t UplinkPktLoss;
928 	uint16_t UplinkPktCount;
929 	uint8_t RoamingCount;
930 	uint16_t RoamingDly;
931 } tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
932 
933 typedef struct sAniGetTsmStatsReq {
934 	/* Common for all types are requests */
935 	uint16_t msgType;       /* message type is same as the request type */
936 	uint16_t msgLen;        /* length of the entire request */
937 	uint8_t tid;            /* traffic id */
938 	struct qdf_mac_addr bssId;
939 	void *tsmStatsCallback;
940 	void *pDevContext;      /* device context */
941 } tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
942 
943 typedef struct sAniGetTsmStatsRsp {
944 	/* Common for all types are responses */
945 	uint16_t msgType;       /*
946 				 * message type is same as
947 				 * the request type
948 				 */
949 	uint16_t msgLen;        /*
950 				 * length of the entire request,
951 				 * includes the pStatsBuf length too
952 				 */
953 	uint8_t sessionId;
954 	uint32_t rc;            /* success/failure */
955 	struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */
956 	tAniTrafStrmMetrics tsmMetrics;
957 	void *tsmStatsReq;      /* tsm stats request backup */
958 } tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
959 
960 struct ese_bcn_report_bss_info {
961 	tBcnReportFields bcnReportFields;
962 	uint8_t ieLen;
963 	uint8_t *pBuf;
964 };
965 
966 struct ese_bcn_report_rsp {
967 	uint16_t measurementToken;
968 	uint8_t flag;        /* Flag to report measurement done and more data */
969 	uint8_t numBss;
970 	struct ese_bcn_report_bss_info
971 				bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
972 };
973 
974 #define TSRS_11AG_RATE_6MBPS   0xC
975 #define TSRS_11B_RATE_5_5MBPS  0xB
976 
977 struct ese_tsrs_ie {
978 	uint8_t tsid;
979 	uint8_t rates[8];
980 };
981 
982 struct ese_tsm_ie {
983 	uint8_t tsid;
984 	uint8_t state;
985 	uint16_t msmt_interval;
986 };
987 
988 typedef struct sTSMStats {
989 	uint8_t tid;
990 	struct qdf_mac_addr bssid;
991 	tTrafStrmMetrics tsmMetrics;
992 } tTSMStats, *tpTSMStats;
993 typedef struct sEseTSMContext {
994 	uint8_t tid;
995 	struct ese_tsm_ie tsmInfo;
996 	tTrafStrmMetrics tsmMetrics;
997 } tEseTSMContext, *tpEseTSMContext;
998 typedef struct sEsePEContext {
999 	tEseTSMContext tsm;
1000 } tEsePEContext, *tpEsePEContext;
1001 
1002 #endif /* FEATURE_WLAN_ESE */
1003 
1004 /* Warning Do not add any new param in this struct */
1005 struct join_req {
1006 	tSirRSNie rsnIE;
1007 	tSirAddie addIEScan;
1008 	tSirAddie addIEAssoc;
1009 #ifdef WLAN_FEATURE_11BE_MLO
1010 	struct mlo_partner_info partner_info;
1011 	uint8_t assoc_link_id;
1012 	bool is_ml_probe_req_sent;
1013 #endif
1014 	/* Warning:::::::::::: Do not add any new param in this struct */
1015 	/* Pls make this as last variable in struct */
1016 	struct bss_description bssDescription;
1017 	/*
1018 	 * WARNING: Pls make bssDescription as last variable in struct
1019 	 * join_req as it has ieFields followed after this bss
1020 	 * description. Adding a variable after this corrupts the ieFields
1021 	 */
1022 };
1023 
1024 struct oem_channel_info {
1025 	uint32_t mhz;
1026 	uint32_t band_center_freq1;
1027 	uint32_t band_center_freq2;
1028 	uint32_t info;
1029 	uint32_t reg_info_1;
1030 	uint32_t reg_info_2;
1031 	uint8_t nss;
1032 	uint32_t rate_flags;
1033 	uint8_t sec_ch_offset;
1034 	enum phy_ch_width ch_width;
1035 };
1036 
1037 enum sir_sme_phy_mode {
1038 	SIR_SME_PHY_MODE_LEGACY = 0,
1039 	SIR_SME_PHY_MODE_HT = 1,
1040 	SIR_SME_PHY_MODE_VHT = 2
1041 };
1042 
1043 /* / Definition for Association indication from peer */
1044 /* / MAC ---> */
1045 struct assoc_ind {
1046 	uint16_t messageType;   /* eWNI_SME_ASSOC_IND */
1047 	uint16_t length;
1048 	uint8_t sessionId;
1049 	tSirMacAddr peerMacAddr;
1050 	uint16_t aid;
1051 	tSirMacAddr bssId;      /* Self BSSID */
1052 	uint16_t staId;         /* Station ID for peer */
1053 	tAniAuthType authType;
1054 	enum ani_akm_type akm_type;
1055 	tAniSSID ssId;          /* SSID used by STA to associate */
1056 	tSirWAPIie wapiIE;      /* WAPI IE received from peer */
1057 	tSirRSNie rsnIE;        /* RSN IE received from peer */
1058 	/* Additional IE received from peer, which possibly include
1059 	 * WSC IE and/or P2P IE
1060 	 */
1061 	tSirAddie addIE;
1062 
1063 	/* powerCap & supportedChannels are present only when */
1064 	/* spectrumMgtIndicator flag is set */
1065 	bool spectrumMgtIndicator;
1066 	struct power_cap_info powerCap;
1067 	struct supported_channels supportedChannels;
1068 	bool wmmEnabledSta; /* if present - STA is WMM enabled */
1069 	bool reassocReq;
1070 	/* Required for indicating the frames to upper layer */
1071 	uint32_t assocReqLength;
1072 	uint8_t *assocReqPtr;
1073 
1074 	/* Timing measurement capability */
1075 	uint8_t timingMeasCap;
1076 	struct oem_channel_info chan_info;
1077 	bool ampdu;
1078 	bool sgi_enable;
1079 	bool tx_stbc;
1080 	bool rx_stbc;
1081 	tSirMacHTChannelWidth ch_width;
1082 	enum sir_sme_phy_mode mode;
1083 	uint8_t max_supp_idx;
1084 	uint8_t max_ext_idx;
1085 	uint8_t max_mcs_idx;
1086 	uint8_t max_real_mcs_idx;
1087 	uint8_t rx_mcs_map;
1088 	uint8_t tx_mcs_map;
1089 	/* Extended CSA capability of station */
1090 	uint8_t ecsa_capable;
1091 	uint32_t ext_cap;
1092 	uint8_t supported_band;
1093 	tDot11fIEHTCaps HTCaps;
1094 	tDot11fIEVHTCaps VHTCaps;
1095 	bool he_caps_present;
1096 	bool eht_caps_present;
1097 	tSirMacCapabilityInfo capability_info;
1098 	bool is_sae_authenticated;
1099 	const uint8_t *owe_ie;
1100 	uint32_t owe_ie_len;
1101 	uint16_t owe_status;
1102 	const uint8_t *ft_ie;
1103 	uint32_t ft_ie_len;
1104 	uint16_t ft_status;
1105 	bool need_assoc_rsp_tx_cb;
1106 	tSirMacAddr peer_mld_addr;
1107 };
1108 
1109 /**
1110  * struct owe_assoc_ind - owe association indication
1111  * @node : List entry element
1112  * @assoc_ind: pointer to assoc ind
1113  */
1114 struct owe_assoc_ind {
1115 	qdf_list_node_t node;
1116 	struct assoc_ind *assoc_ind;
1117 };
1118 
1119 /**
1120  * struct ft_assoc_ind - ft association indication
1121  * @node: List entry element
1122  * @assoc_ind: pointer to assoc ind
1123  */
1124 struct ft_assoc_ind {
1125 	qdf_list_node_t node;
1126 	struct assoc_ind *assoc_ind;
1127 };
1128 
1129 /* / Definition for Association confirm */
1130 /* / ---> MAC */
1131 struct assoc_cnf {
1132 	uint16_t messageType;   /* eWNI_SME_ASSOC_CNF */
1133 	uint16_t length;
1134 	tSirResultCodes status_code;
1135 	struct qdf_mac_addr bssid;      /* Self BSSID */
1136 	struct qdf_mac_addr peer_macaddr;
1137 	uint16_t aid;
1138 	enum wlan_status_code mac_status_code;
1139 	uint8_t *owe_ie;
1140 	uint32_t owe_ie_len;
1141 	uint8_t *ft_ie;
1142 	uint32_t ft_ie_len;
1143 	bool need_assoc_rsp_tx_cb;
1144 };
1145 
1146 /**
1147  * Table below indicates what information is passed for each of
1148  * the Wireless Media status change notifications:
1149  *
1150  * Status Change code               Status change info
1151  * ----------------------------------------------------------------------
1152  * eSIR_SME_DEAUTH_FROM_PEER        Reason code received in DEAUTH frame
1153  * eSIR_SME_DISASSOC_FROM_PEER      Reason code received in DISASSOC frame
1154  * eSIR_SME_LOST_LINK_WITH_PEER     None
1155  * eSIR_SME_CHANNEL_SWITCH          New channel number
1156  * eSIR_SME_RADAR_DETECTED          Indicates that radar is detected
1157  * eSIR_SME_AP_CAPS_CHANGED         Indicates that capabilities of the AP
1158  *                                  that STA is currently associated with
1159  *                                  have changed.
1160  */
1161 
1162 /* Definition for Disassociation request */
1163 struct disassoc_req {
1164 	uint16_t messageType;   /* eWNI_SME_DISASSOC_REQ */
1165 	uint16_t length;
1166 	uint8_t sessionId;      /* Session ID */
1167 	struct qdf_mac_addr bssid;      /* Peer BSSID */
1168 	struct qdf_mac_addr peer_macaddr;
1169 	uint16_t reasonCode;
1170 	/* This flag tells LIM whether to send the disassoc OTA or not */
1171 	/* This will be set in while handing off from one AP to other */
1172 	uint8_t doNotSendOverTheAir;
1173 	bool process_ho_fail;
1174 };
1175 
1176 /* / Definition for Disassociation response */
1177 struct disassoc_rsp {
1178 	uint16_t messageType;   /* eWNI_SME_DISASSOC_RSP */
1179 	uint16_t length;
1180 	uint8_t sessionId;      /* Session ID */
1181 	tSirResultCodes status_code;
1182 	struct qdf_mac_addr peer_macaddr;
1183 	uint16_t staId;
1184 };
1185 
1186 /* / Definition for Disassociation indication from peer */
1187 struct disassoc_ind {
1188 	uint16_t messageType;   /* eWNI_SME_DISASSOC_IND */
1189 	uint16_t length;
1190 	uint8_t vdev_id;
1191 	tSirResultCodes status_code;
1192 	struct qdf_mac_addr bssid;
1193 	struct qdf_mac_addr peer_macaddr;
1194 	uint16_t staId;
1195 	uint32_t reasonCode;
1196 	bool from_ap;
1197 };
1198 
1199 /* / Definition for Disassociation confirm */
1200 /* / MAC ---> */
1201 struct disassoc_cnf {
1202 	uint16_t messageType;   /* eWNI_SME_DISASSOC_CNF */
1203 	uint16_t length;
1204 	uint8_t vdev_id;
1205 	tSirResultCodes status_code;
1206 	struct qdf_mac_addr bssid;
1207 	struct qdf_mac_addr peer_macaddr;
1208 };
1209 
1210 /**
1211  * struct sir_sme_discon_done_ind  - disconnect done indiaction
1212  * @message_type: msg type
1213  * @length: length of msg
1214  * @session_id: session id of the indication
1215  * @reason_code: reason for disconnect indication
1216  * @peer_mac: peer mac
1217  */
1218 struct sir_sme_discon_done_ind {
1219 	uint16_t           message_type;
1220 	uint16_t           length;
1221 	uint8_t            session_id;
1222 	tSirResultCodes    reason_code;
1223 	tSirMacAddr        peer_mac;
1224 };
1225 
1226 /* / Definition for Deauthetication request */
1227 struct deauth_req {
1228 	uint16_t messageType;   /* eWNI_SME_DEAUTH_REQ */
1229 	uint16_t length;
1230 	uint8_t vdev_id;      /* Session ID */
1231 	struct qdf_mac_addr bssid;      /* AP BSSID */
1232 	struct qdf_mac_addr peer_macaddr;
1233 	uint16_t reasonCode;
1234 };
1235 
1236 /**
1237  * struct deauth_retry_params - deauth retry params
1238  * @peer_mac: peer mac
1239  * @reason_code: reason for disconnect indication
1240  * @retry_cnt: retry count
1241  */
1242 struct deauth_retry_params {
1243 	struct qdf_mac_addr peer_macaddr;
1244 	uint16_t reason_code;
1245 	uint8_t retry_cnt;
1246 };
1247 
1248 /* / Definition for Deauthetication response */
1249 struct deauth_rsp {
1250 	uint16_t messageType;   /* eWNI_SME_DEAUTH_RSP */
1251 	uint16_t length;
1252 	uint8_t sessionId;      /* Session ID */
1253 	tSirResultCodes status_code;
1254 	struct qdf_mac_addr peer_macaddr;
1255 };
1256 
1257 /* / Definition for Deauthetication indication from peer */
1258 struct deauth_ind {
1259 	uint16_t messageType;   /* eWNI_SME_DEAUTH_IND */
1260 	uint16_t length;
1261 	uint8_t vdev_id;
1262 	tSirResultCodes status_code;
1263 	struct qdf_mac_addr bssid;      /* AP BSSID */
1264 	struct qdf_mac_addr peer_macaddr;
1265 
1266 	uint16_t staId;
1267 	uint32_t reasonCode;
1268 	int8_t rssi;
1269 	bool from_ap;
1270 };
1271 
1272 /* / Definition for Deauthetication confirm */
1273 struct deauth_cnf {
1274 	uint16_t messageType;   /* eWNI_SME_DEAUTH_CNF */
1275 	uint16_t length;
1276 	uint8_t vdev_id;
1277 	tSirResultCodes status_code;
1278 	struct qdf_mac_addr bssid;
1279 	struct qdf_mac_addr peer_macaddr;
1280 };
1281 
1282 struct stop_bss_req {
1283 	uint8_t vdev_id;
1284 	uint32_t cmd_id;
1285 };
1286 
1287 struct stop_bss_rsp {
1288 	uint8_t vdev_id;
1289 	tSirResultCodes status_code;
1290 };
1291 
1292 /* / Definition for Channel Switch indication for station */
1293 /* / MAC ---> */
1294 struct switch_channel_ind {
1295 	uint16_t messageType;   /* eWNI_SME_SWITCH_CHL_IND */
1296 	uint16_t length;
1297 	uint8_t sessionId;
1298 	uint32_t freq;
1299 	struct ch_params chan_params;
1300 	struct qdf_mac_addr bssid;      /* BSSID */
1301 	QDF_STATUS status;
1302 	enum wlan_phymode ch_phymode;
1303 };
1304 
1305 /* / Definition for MIC failure indication */
1306 /* / MAC ---> */
1307 /* / MAC reports this each time a MIC failure occurs on Rx TKIP packet */
1308 struct mic_failure_ind {
1309 	uint16_t messageType;   /* eWNI_SME_MIC_FAILURE_IND */
1310 	uint16_t length;
1311 	uint8_t sessionId;
1312 	struct qdf_mac_addr bssId;
1313 	tSirMicFailureInfo info;
1314 };
1315 
1316 struct missed_beacon_ind {
1317 	uint16_t messageType;   /* eWNI_SME_MISSED_BEACON_IND */
1318 	uint16_t length;
1319 	uint8_t bss_idx;
1320 	int32_t rssi;
1321 };
1322 
1323 /* / Definition for Set Context response */
1324 /* / MAC ---> */
1325 struct set_context_rsp {
1326 	uint16_t messageType;   /* eWNI_SME_SET_CONTEXT_RSP */
1327 	uint16_t length;
1328 	uint8_t sessionId;      /* Session ID */
1329 	tSirResultCodes status_code;
1330 	struct qdf_mac_addr peer_macaddr;
1331 };
1332 
1333 typedef struct sAniGetSnrReq {
1334 	/* Common for all types are requests */
1335 	uint16_t msgType;       /* message type is same as the request type */
1336 	uint16_t msgLen;        /* length of the entire request */
1337 	uint8_t sessionId;
1338 	void *snrCallback;
1339 	void *pDevContext;      /* device context */
1340 	int8_t snr;
1341 } tAniGetSnrReq, *tpAniGetSnrReq;
1342 
1343 /* generic country code change request MSG structure */
1344 typedef struct sAniGenericChangeCountryCodeReq {
1345 	uint16_t msgType;       /* message type is same as the request type */
1346 	uint16_t msgLen;        /* length of the entire request */
1347 	uint8_t countryCode[REG_ALPHA2_LEN + 1];  /* 3 char country code */
1348 } tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1349 
1350 /**
1351  * struct sAniDHCPStopInd - DHCP Stop indication message
1352  * @msgType: message type is same as the request type
1353  * @msgLen: length of the entire request
1354  * @device_mode: Mode of the device(ex:STA, AP)
1355  * @adapterMacAddr: MAC address of the adapter
1356  * @peerMacAddr: MAC address of the connected peer
1357  */
1358 typedef struct sAniDHCPStopInd {
1359 	uint16_t msgType;
1360 	uint16_t msgLen;
1361 	uint8_t device_mode;
1362 	struct qdf_mac_addr adapterMacAddr;
1363 	struct qdf_mac_addr peerMacAddr;
1364 } tAniDHCPInd, *tpAniDHCPInd;
1365 
1366 /**********************PE Statistics end*************************/
1367 
1368 typedef struct sSirP2PNoaAttr {
1369 #ifdef ANI_BIG_BYTE_ENDIAN
1370 	uint32_t index:8;
1371 	uint32_t oppPsFlag:1;
1372 	uint32_t ctWin:7;
1373 	uint32_t rsvd1:16;
1374 #else
1375 	uint32_t rsvd1:16;
1376 	uint32_t ctWin:7;
1377 	uint32_t oppPsFlag:1;
1378 	uint32_t index:8;
1379 #endif
1380 
1381 #ifdef ANI_BIG_BYTE_ENDIAN
1382 	uint32_t uNoa1IntervalCnt:8;
1383 	uint32_t rsvd2:24;
1384 #else
1385 	uint32_t rsvd2:24;
1386 	uint32_t uNoa1IntervalCnt:8;
1387 #endif
1388 	uint32_t uNoa1Duration;
1389 	uint32_t uNoa1Interval;
1390 	uint32_t uNoa1StartTime;
1391 
1392 #ifdef ANI_BIG_BYTE_ENDIAN
1393 	uint32_t uNoa2IntervalCnt:8;
1394 	uint32_t rsvd3:24;
1395 #else
1396 	uint32_t rsvd3:24;
1397 	uint32_t uNoa2IntervalCnt:8;
1398 #endif
1399 	uint32_t uNoa2Duration;
1400 	uint32_t uNoa2Interval;
1401 	uint32_t uNoa2StartTime;
1402 } tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1403 
1404 typedef struct sSirTclasInfo {
1405 	tSirMacTclasIE tclas;
1406 	uint8_t version;        /* applies only for classifier type ip */
1407 	union {
1408 		tSirMacTclasParamEthernet eth;
1409 		tSirMacTclasParamIPv4 ipv4;
1410 		tSirMacTclasParamIPv6 ipv6;
1411 		tSirMacTclasParam8021dq t8021dq;
1412 	} qdf_packed tclasParams;
1413 } qdf_packed tSirTclasInfo;
1414 
1415 typedef struct sSirAddtsReqInfo {
1416 	uint8_t dialogToken;
1417 	struct mac_tspec_ie tspec;
1418 
1419 	uint8_t numTclas;       /* number of Tclas elements */
1420 	tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1421 	uint8_t tclasProc;
1422 #if defined(FEATURE_WLAN_ESE)
1423 	struct ese_tsrs_ie tsrsIE;
1424 	uint8_t tsrsPresent:1;
1425 #endif
1426 	uint8_t wmeTspecPresent:1;
1427 	uint8_t wsmTspecPresent:1;
1428 	uint8_t lleTspecPresent:1;
1429 	uint8_t tclasProcPresent:1;
1430 } tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1431 
1432 typedef struct sSirAddtsRspInfo {
1433 	uint8_t dialogToken;
1434 	enum wlan_status_code status;
1435 	tSirMacTsDelayIE delay;
1436 
1437 	struct mac_tspec_ie tspec;
1438 	uint8_t numTclas;       /* number of Tclas elements */
1439 	tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1440 	uint8_t tclasProc;
1441 	tSirMacScheduleIE schedule;
1442 #ifdef FEATURE_WLAN_ESE
1443 	struct ese_tsm_ie tsmIE;
1444 	uint8_t tsmPresent:1;
1445 #endif
1446 	uint8_t wmeTspecPresent:1;
1447 	uint8_t wsmTspecPresent:1;
1448 	uint8_t lleTspecPresent:1;
1449 	uint8_t tclasProcPresent:1;
1450 	uint8_t schedulePresent:1;
1451 } tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1452 
1453 /* / Add a tspec as defined */
1454 typedef struct sSirAddtsReq {
1455 	uint16_t messageType;   /* eWNI_SME_ADDTS_REQ */
1456 	uint16_t length;
1457 	uint8_t sessionId;      /* Session ID */
1458 	struct qdf_mac_addr bssid;      /* BSSID */
1459 	uint32_t timeout;       /* in ms */
1460 	uint8_t rspReqd;
1461 	tSirAddtsReqInfo req;
1462 } tSirAddtsReq, *tpSirAddtsReq;
1463 
1464 typedef struct sSirAddtsRsp {
1465 	uint16_t messageType;   /* eWNI_SME_ADDTS_RSP */
1466 	uint16_t length;
1467 	uint8_t sessionId;      /* sme sessionId  Added for BT-AMP support */
1468 	uint32_t rc;            /* return code */
1469 	tSirAddtsRspInfo rsp;
1470 } tSirAddtsRsp, *tpSirAddtsRsp;
1471 
1472 typedef struct sSirDeltsReq {
1473 	uint16_t messageType;   /* eWNI_SME_DELTS_REQ */
1474 	uint16_t length;
1475 	uint8_t sessionId;      /* Session ID */
1476 	struct qdf_mac_addr bssid;      /* BSSID */
1477 	uint16_t aid;           /* use 0 if macAddr is being specified */
1478 	struct qdf_mac_addr macaddr;    /* only on AP to specify the STA */
1479 	uint8_t rspReqd;
1480 	struct delts_req_info req;
1481 } tSirDeltsReq, *tpSirDeltsReq;
1482 
1483 typedef struct sSirDeltsRsp {
1484 	uint16_t messageType;   /* eWNI_SME_DELTS_RSP */
1485 	uint16_t length;
1486 	uint8_t sessionId;
1487 	uint32_t rc;
1488 	uint16_t aid;           /* use 0 if macAddr is being specified */
1489 	struct qdf_mac_addr macaddr;    /* only on AP to specify the STA */
1490 	struct delts_req_info rsp;
1491 } tSirDeltsRsp, *tpSirDeltsRsp;
1492 
1493 typedef struct sSirAggrQosReqInfo {
1494 	uint16_t tspecIdx;
1495 	tSirAddtsReqInfo aggrAddTsInfo[QCA_WLAN_AC_ALL];
1496 } tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
1497 
1498 typedef struct sSirAggrQosReq {
1499 	uint16_t messageType;   /* eWNI_SME_ADDTS_REQ */
1500 	uint16_t length;
1501 	uint8_t sessionId;      /* Session ID */
1502 	struct qdf_mac_addr bssid;      /* BSSID */
1503 	uint32_t timeout;       /* in ms */
1504 	uint8_t rspReqd;
1505 	tSirAggrQosReqInfo aggrInfo;
1506 } tSirAggrQosReq;
1507 
1508 typedef struct sSirAggrQosRspInfo {
1509 	uint16_t tspecIdx;
1510 	tSirAddtsRspInfo aggrRsp[QCA_WLAN_AC_ALL];
1511 } tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
1512 
1513 typedef struct sSirAggrQosRsp {
1514 	uint16_t messageType;
1515 	uint16_t length;
1516 	uint8_t sessionId;
1517 	tSirAggrQosRspInfo aggrInfo;
1518 } tSirAggrQosRsp, *tpSirAggrQosRsp;
1519 
1520 
1521 struct qos_map_set {
1522 	uint8_t present;
1523 	uint8_t num_dscp_exceptions;
1524 	uint8_t dscp_exceptions[QOS_MAP_MAX_EX][2];
1525 	uint8_t dscp_range[QOS_MAP_RANGE_NUM][2];
1526 };
1527 
1528 typedef struct sSmeMaxAssocInd {
1529 	uint16_t mesgType;      /* eWNI_SME_MAX_ASSOC_EXCEEDED */
1530 	uint16_t mesgLen;
1531 	uint8_t sessionId;
1532 	/* the new peer that got rejected max assoc limit reached */
1533 	struct qdf_mac_addr peer_mac;
1534 } tSmeMaxAssocInd, *tpSmeMaxAssocInd;
1535 
1536 #define SIR_MAX_NAME_SIZE 64
1537 #define SIR_MAX_TEXT_SIZE 32
1538 
1539 typedef struct sSirName {
1540 	uint8_t num_name;
1541 	uint8_t name[SIR_MAX_NAME_SIZE];
1542 } tSirName;
1543 
1544 typedef struct sSirText {
1545 	uint8_t num_text;
1546 	uint8_t text[SIR_MAX_TEXT_SIZE];
1547 } tSirText;
1548 
1549 #define SIR_WPS_PROBRSP_VER_PRESENT    0x00000001
1550 #define SIR_WPS_PROBRSP_STATE_PRESENT    0x00000002
1551 #define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT    0x00000004
1552 #define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT    0x00000008
1553 #define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT    0x00000010
1554 #define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT    0x00000020
1555 #define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT    0x00000040
1556 #define SIR_WPS_PROBRSP_UUIDE_PRESENT    0x00000080
1557 #define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT    0x00000100
1558 #define SIR_WPS_PROBRSP_MODELNAME_PRESENT    0x00000200
1559 #define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT    0x00000400
1560 #define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT    0x00000800
1561 #define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT    0x00001000
1562 #define SIR_WPS_PROBRSP_DEVICENAME_PRESENT    0x00002000
1563 #define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT    0x00004000
1564 #define SIR_WPS_PROBRSP_RF_BANDS_PRESENT    0x00008000
1565 
1566 typedef struct sSirWPSProbeRspIE {
1567 	uint32_t FieldPresent;
1568 	uint32_t Version;       /* Version. 0x10 = version 1.0, 0x11 = etc. */
1569 	uint32_t wpsState;      /* 1 = unconfigured, 2 = configured. */
1570 	bool APSetupLocked;     /* Must be included if value is true */
1571 	/*
1572 	 * BOOL:  indicates if the user has recently activated a Registrar to
1573 	 * add an Enrollee.
1574 	 */
1575 	bool SelectedRegistra;
1576 	uint16_t DevicePasswordID;      /* Device Password ID */
1577 	/* Selected Registrar config method */
1578 	uint16_t SelectedRegistraCfgMethod;
1579 	uint8_t ResponseType;   /* Response type */
1580 	uint8_t UUID_E[16];     /* Unique identifier of the AP. */
1581 	tSirName Manufacture;
1582 	tSirText ModelName;
1583 	tSirText ModelNumber;
1584 	tSirText SerialNumber;
1585 	/* Device Category ID: 1Computer, 2Input Device, ... */
1586 	uint32_t PrimaryDeviceCategory;
1587 	/* Vendor specific OUI for Device Sub Category */
1588 	uint8_t PrimaryDeviceOUI[4];
1589 	/*
1590 	   Device Sub Category ID: 1-PC, 2-Server if Device Category ID
1591 	 * is computer
1592 	 */
1593 	uint32_t DeviceSubCategory;
1594 	tSirText DeviceName;
1595 	uint16_t ConfigMethod;  /* Configuration method */
1596 	uint8_t RFBand;         /* RF bands available on the AP */
1597 } tSirWPSProbeRspIE;
1598 
1599 #define SIR_WPS_BEACON_VER_PRESENT    0x00000001
1600 #define SIR_WPS_BEACON_STATE_PRESENT    0x00000002
1601 #define SIR_WPS_BEACON_APSETUPLOCK_PRESENT    0x00000004
1602 #define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT    0x00000008
1603 #define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT    0x00000010
1604 #define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT    0x00000020
1605 #define SIR_WPS_BEACON_UUIDE_PRESENT    0x00000080
1606 #define SIR_WPS_BEACON_RF_BANDS_PRESENT    0x00000100
1607 #define SIR_WPS_UUID_LEN 16
1608 
1609 typedef struct sSirWPSBeaconIE {
1610 	uint32_t FieldPresent;
1611 	uint32_t Version;       /* Version. 0x10 = version 1.0, 0x11 = etc. */
1612 	uint32_t wpsState;      /* 1 = unconfigured, 2 = configured. */
1613 	bool APSetupLocked;     /* Must be included if value is true */
1614 	/*
1615 	 * BOOL:  indicates if the user has recently activated a Registrar to
1616 	 * add an Enrollee.
1617 	 */
1618 	bool SelectedRegistra;
1619 	uint16_t DevicePasswordID;      /* Device Password ID */
1620 	/* Selected Registrar config method */
1621 	uint16_t SelectedRegistraCfgMethod;
1622 	uint8_t UUID_E[SIR_WPS_UUID_LEN];     /* Unique identifier of the AP. */
1623 	uint8_t RFBand;         /* RF bands available on the AP */
1624 } tSirWPSBeaconIE;
1625 
1626 typedef struct sSirAPWPSIEs {
1627 	tSirWPSProbeRspIE SirWPSProbeRspIE;     /*WPS Set Probe Response IE */
1628 	tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
1629 } tSirAPWPSIEs, *tpSiriAPWPSIEs;
1630 
1631 struct update_config {
1632 	uint16_t messageType;   /* eWNI_SME_UPDATE_CONFIG */
1633 	uint16_t length;
1634 	uint8_t vdev_id;
1635 	uint16_t capab;
1636 	uint32_t value;
1637 };
1638 
1639 /*
1640  * enum sir_update_session_param_type - session param type
1641  * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
1642  */
1643 enum sir_update_session_param_type {
1644 	SIR_PARAM_SSID_HIDDEN,
1645 };
1646 
1647 /*
1648  * struct sir_update_session_param
1649  * @message_type: SME message type
1650  * @length: size of struct sir_update_session_param
1651  * @vdev_id: vdev ID
1652  * @param_type: parameter to be updated
1653  * @param_val: Parameter value to update
1654  */
1655 struct sir_update_session_param {
1656 	uint16_t message_type;
1657 	uint16_t length;
1658 	uint8_t vdev_id;
1659 	uint32_t param_type;
1660 	uint32_t param_val;
1661 };
1662 
1663 /**
1664  * struct sir_set_he_bss_color
1665  * @message_type: SME message type
1666  * @length: size of struct sir_set_he_bss_color
1667  * @vdev_id: vdev ID
1668  * @bss_color: bss color value
1669  */
1670 struct sir_set_he_bss_color {
1671 	uint16_t message_type;
1672 	uint16_t length;
1673 	uint8_t vdev_id;
1674 	uint8_t bss_color;
1675 };
1676 
1677 /**
1678  * struct sir_cfg_obss_scan
1679  * @message_type: SME message type
1680  * @length: size of struct sir_cfg_obss_scan
1681  * @vdev_id: vdev ID
1682  * @is_scan_reconfig: true for NDP session
1683  */
1684 struct sir_cfg_obss_scan {
1685 	uint16_t message_type;
1686 	uint16_t length;
1687 	uint8_t vdev_id;
1688 	bool is_scan_reconfig;
1689 };
1690 
1691 /**
1692  * struct sir_create_session - Used for creating session in monitor mode
1693  * @type: SME host message type.
1694  * @msg_len: Length of the message.
1695  * @bss_id: bss_id for creating the session.
1696  */
1697 struct sir_create_session {
1698 	uint16_t type;
1699 	uint16_t msg_len;
1700 	uint8_t vdev_id;
1701 	struct qdf_mac_addr bss_id;
1702 };
1703 
1704 /**
1705  * struct sir_delete_session - Used for deleting session in monitor mode
1706  * @type: SME host message type.
1707  * @msg_len: Length of the message.
1708  * @vdev_id: vdev id.
1709  */
1710 struct sir_delete_session {
1711 	uint16_t type;
1712 	uint16_t msg_len;
1713 	uint8_t vdev_id;
1714 };
1715 
1716 #ifdef QCA_HT_2040_COEX
1717 struct set_ht2040_mode {
1718 	uint16_t messageType;
1719 	uint16_t length;
1720 	uint8_t cbMode;
1721 	bool obssEnabled;
1722 	struct qdf_mac_addr bssid;
1723 	uint8_t sessionId;      /* Session ID */
1724 };
1725 #endif
1726 
1727 #define SIR_WPS_PBC_WALK_TIME   120     /* 120 Second */
1728 
1729 typedef struct sSirWPSPBCSession {
1730 	struct sSirWPSPBCSession *next;
1731 	struct qdf_mac_addr addr;
1732 	uint8_t uuid_e[SIR_WPS_UUID_LEN];
1733 	uint32_t timestamp;
1734 } tSirWPSPBCSession;
1735 
1736 typedef struct sSirWPSPBCProbeReq {
1737 	struct qdf_mac_addr peer_macaddr;
1738 	uint16_t probeReqIELen;
1739 	uint8_t probeReqIE[512];
1740 } tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
1741 
1742 /* probereq from peer, when wsc is enabled */
1743 typedef struct sSirSmeProbeReqInd {
1744 	uint16_t messageType;   /*  eWNI_SME_WPS_PBC_PROBE_REQ_IND */
1745 	uint16_t length;
1746 	uint8_t sessionId;
1747 	struct qdf_mac_addr bssid;
1748 	tSirWPSPBCProbeReq WPSPBCProbeReq;
1749 } tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
1750 
1751 #define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE    450
1752 /* Occupied channel list remains static */
1753 #define CHANNEL_LIST_STATIC                   1
1754 /* Occupied channel list can be dynamic */
1755 #define CHANNEL_LIST_DYNAMIC                  2
1756 
1757 /* SME -> HAL - This is the host offload request. */
1758 #define SIR_IPV6_NS_OFFLOAD                         2
1759 #define SIR_OFFLOAD_DISABLE                         0
1760 #define SIR_OFFLOAD_ENABLE                          1
1761 
1762 struct sir_host_offload_req {
1763 	uint8_t offloadType;
1764 	uint8_t enableOrDisable;
1765 	uint32_t num_ns_offload_count;
1766 	union {
1767 		uint8_t hostIpv4Addr[QDF_IPV4_ADDR_SIZE];
1768 		uint8_t hostIpv6Addr[QDF_IPV6_ADDR_SIZE];
1769 	} params;
1770 	struct qdf_mac_addr bssid;
1771 };
1772 
1773 /* Packet Types. */
1774 #define SIR_KEEP_ALIVE_NULL_PKT              1
1775 #define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
1776 #define SIR_KEEP_ALIVE_MGMT_FRAME            5
1777 
1778 /* Keep Alive request. */
1779 struct keep_alive_req {
1780 	uint8_t packetType;
1781 	uint32_t timePeriod;
1782 	tSirIpv4Addr hostIpv4Addr;
1783 	tSirIpv4Addr destIpv4Addr;
1784 	struct qdf_mac_addr dest_macaddr;
1785 	struct qdf_mac_addr bssid;
1786 	uint8_t sessionId;
1787 };
1788 
1789 /**
1790  * enum rxmgmt_flags - flags for received management frame.
1791  * @RXMGMT_FLAG_NONE: Default value to indicate no flags are set.
1792  * @RXMGMT_FLAG_EXTERNAL_AUTH: frame can be used for external authentication
1793  *			       by upper layers.
1794  */
1795 enum rxmgmt_flags {
1796 	RXMGMT_FLAG_NONE,
1797 	RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
1798 };
1799 
1800 typedef struct sSirSmeMgmtFrameInd {
1801 	uint16_t frame_len;
1802 	uint32_t rx_freq;
1803 	uint8_t sessionId;
1804 	uint8_t frameType;
1805 	int8_t rxRssi;
1806 	enum rxmgmt_flags rx_flags;
1807 	QDF_FLEX_ARRAY(uint8_t, frameBuf);
1808 } tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
1809 
1810 typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
1811 /**
1812  * struct sir_sme_mgmt_frame_cb_req - Register a
1813  * management frame callback req
1814  *
1815  * @message_type: message id
1816  * @length: msg length
1817  * @callback: callback for management frame indication
1818  */
1819 struct sir_sme_mgmt_frame_cb_req {
1820 	uint16_t message_type;
1821 	uint16_t length;
1822 	sir_mgmt_frame_ind_callback callback;
1823 };
1824 
1825 typedef struct sSirSmeUnprotMgmtFrameInd {
1826 	uint8_t sessionId;
1827 	uint8_t frameType;
1828 	uint8_t frameLen;
1829 	QDF_FLEX_ARRAY(uint8_t, frameBuf);
1830 } tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
1831 
1832 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
1833 
1834 typedef enum ext_wow_type {
1835 	EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
1836 	EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
1837 	EXT_WOW_TYPE_APP_TYPE1_2,  /* wow type: enable wakeup for app type1&2 */
1838 } EXT_WOW_TYPE;
1839 
1840 typedef struct {
1841 	uint8_t vdev_id;
1842 	EXT_WOW_TYPE type;
1843 	uint32_t wakeup_pin_num;
1844 } tSirExtWoWParams, *tpSirExtWoWParams;
1845 
1846 typedef struct {
1847 	uint8_t vdev_id;
1848 	struct qdf_mac_addr wakee_mac_addr;
1849 	uint8_t identification_id[8];
1850 	uint8_t password[16];
1851 	uint32_t id_length;
1852 	uint32_t pass_length;
1853 } tSirAppType1Params, *tpSirAppType1Params;
1854 
1855 typedef struct {
1856 	uint8_t vdev_id;
1857 
1858 	uint8_t rc4_key[16];
1859 	uint32_t rc4_key_len;
1860 
1861 	/** ip header parameter */
1862 	uint32_t ip_id;         /* NC id */
1863 	uint32_t ip_device_ip;  /* NC IP address */
1864 	uint32_t ip_server_ip;  /* Push server IP address */
1865 
1866 	/** tcp header parameter */
1867 	uint16_t tcp_src_port;  /* NC TCP port */
1868 	uint16_t tcp_dst_port;  /* Push server TCP port */
1869 	uint32_t tcp_seq;
1870 	uint32_t tcp_ack_seq;
1871 
1872 	uint32_t keepalive_init;        /* Initial ping interval */
1873 	uint32_t keepalive_min; /* Minimum ping interval */
1874 	uint32_t keepalive_max; /* Maximum ping interval */
1875 	uint32_t keepalive_inc; /* Increment of ping interval */
1876 
1877 	struct qdf_mac_addr gateway_mac;
1878 	uint32_t tcp_tx_timeout_val;
1879 	uint32_t tcp_rx_timeout_val;
1880 } tSirAppType2Params, *tpSirAppType2Params;
1881 #endif
1882 
1883 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1884 typedef struct {
1885 	uint8_t acvo_uapsd:1;
1886 	uint8_t acvi_uapsd:1;
1887 	uint8_t acbk_uapsd:1;
1888 	uint8_t acbe_uapsd:1;
1889 	uint8_t reserved:4;
1890 } tSirAcUapsd, *tpSirAcUapsd;
1891 #endif
1892 
1893 /**
1894  * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
1895  * @fw_okc: Opportunistic key caching enable in firmware
1896  * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
1897  *                  visited BSSID/PMK pairs
1898  */
1899 struct pmkid_mode_bits {
1900 	uint32_t fw_okc:1;
1901 	uint32_t fw_pmksa_cache:1;
1902 	uint32_t unused:30;
1903 };
1904 
1905 /**
1906  * struct roam_init_params - Firmware roam module initialization parameters
1907  * @vdev_id: vdev for which the roaming has to be enabled/disabled
1908  * @enable:  flag to init/deinit roam module
1909  */
1910 struct roam_init_params {
1911 	uint8_t vdev_id;
1912 	uint8_t enable;
1913 };
1914 
1915 /**
1916  * struct roam_sync_timeout_timer_info - Info related to roam sync timer
1917  * @vdev_id: Vdev id for which host waiting roam sync ind from fw
1918  */
1919 struct roam_sync_timeout_timer_info {
1920 	uint8_t vdev_id;
1921 };
1922 
1923 struct roam_offload_scan_rsp {
1924 	uint8_t sessionId;
1925 	uint32_t reason;
1926 };
1927 
1928 /*---------------------------------------------------------------------------
1929    Packet Filtering Parameters
1930    ---------------------------------------------------------------------------*/
1931 #define    SIR_MAX_FILTER_TEST_DATA_LEN       8
1932 #define    SIR_MAX_FILTER_TEST_DATA_OFFSET  200
1933 #define    SIR_MAX_NUM_MULTICAST_ADDRESS    240
1934 
1935 /* */
1936 /* Multicast Address List Parameters */
1937 /* */
1938 typedef struct sSirRcvFltMcAddrList {
1939 	uint32_t ulMulticastAddrCnt;
1940 	struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
1941 	struct qdf_mac_addr self_macaddr;
1942 	struct qdf_mac_addr bssid;
1943 	uint8_t action;
1944 } tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
1945 
1946 /**
1947  * struct sir_wifi_start_log - Structure to store the params sent to start/
1948  * stop logging
1949  * @name:          Attribute which indicates the type of logging like per packet
1950  *                 statistics, connectivity etc.
1951  * @verbose_level: Verbose level which can be 0,1,2,3
1952  * @is_iwpriv_command: Set 1 for iwpriv command
1953  * @ini_triggered: triggered using ini
1954  * @user_triggered: triggered by user
1955  * @size: pktlog buffer size
1956  * @is_pktlog_buff_clear: clear the pktlog buffer
1957  */
1958 struct sir_wifi_start_log {
1959 	uint32_t ring_id;
1960 	uint32_t verbose_level;
1961 	uint32_t is_iwpriv_command;
1962 	bool ini_triggered;
1963 	uint8_t user_triggered;
1964 	int size;
1965 	bool is_pktlog_buff_clear;
1966 };
1967 
1968 
1969 /**
1970  * struct sir_pcl_list - Format of PCL
1971  * @pcl_list: List of preferred channels
1972  * @weight_list: Weights of the PCL
1973  * @pcl_len: Number of channels in the PCL
1974  */
1975 struct sir_pcl_list {
1976 	uint32_t pcl_len;
1977 	uint8_t pcl_list[NUM_CHANNELS];
1978 	uint8_t weight_list[NUM_CHANNELS];
1979 };
1980 
1981 /**
1982  * struct sir_pcl_chan_weights - Params to get the valid weighed list
1983  * @pcl_list: Preferred channel list already sorted in the order of preference
1984  * @pcl_len: Length of the PCL
1985  * @saved_chan_list: Valid channel list updated as part of
1986  * WMA_UPDATE_CHAN_LIST_REQ
1987  * @saved_num_chan: Length of the valid channel list
1988  * @weighed_valid_list: Weights of the valid channel list. This will have one
1989  * to one mapping with valid_chan_list. FW expects channel order and size to be
1990  * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
1991  * @weight_list: Weights assigned by policy manager
1992  */
1993 struct sir_pcl_chan_weights {
1994 	uint8_t pcl_list[NUM_CHANNELS];
1995 	uint32_t pcl_len;
1996 	uint8_t saved_chan_list[NUM_CHANNELS];
1997 	uint32_t saved_num_chan;
1998 	uint8_t weighed_valid_list[NUM_CHANNELS];
1999 	uint8_t weight_list[NUM_CHANNELS];
2000 };
2001 
2002 /**
2003  * struct sir_hw_mode_params - HW mode params
2004  * @mac0_tx_ss: MAC0 Tx spatial stream
2005  * @mac0_rx_ss: MAC0 Rx spatial stream
2006  * @mac1_tx_ss: MAC1 Tx spatial stream
2007  * @mac1_rx_ss: MAC1 Rx spatial stream
2008  * @mac0_bw: MAC0 bandwidth
2009  * @mac1_bw: MAC1 bandwidth
2010  * @dbs_cap: DBS capabality
2011  * @agile_dfs_cap: Agile DFS capabality
2012  */
2013 struct sir_hw_mode_params {
2014 	uint8_t mac0_tx_ss;
2015 	uint8_t mac0_rx_ss;
2016 	uint8_t mac1_tx_ss;
2017 	uint8_t mac1_rx_ss;
2018 	uint8_t mac0_bw;
2019 	uint8_t mac1_bw;
2020 	uint8_t dbs_cap;
2021 	uint8_t agile_dfs_cap;
2022 	uint8_t sbs_cap;
2023 };
2024 
2025 /**
2026  * struct sir_set_hw_mode_resp - HW mode response
2027  * @status: Status
2028  * @cfgd_hw_mode_index: Configured HW mode index
2029  * @num_vdev_mac_entries: Number of vdev-mac id entries
2030  * @vdev_mac_map: vdev id-mac id map
2031  */
2032 struct sir_set_hw_mode_resp {
2033 	uint32_t status;
2034 	uint32_t cfgd_hw_mode_index;
2035 	uint32_t num_vdev_mac_entries;
2036 	struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
2037 };
2038 
2039 /**
2040  * struct sir_dual_mac_config_resp - Dual MAC config response
2041  * @status: Status of setting the dual mac configuration
2042  */
2043 struct sir_dual_mac_config_resp {
2044 	uint32_t status;
2045 };
2046 
2047 /**
2048  * enum set_antenna_mode_status - Status of set antenna mode
2049  * command
2050  * @SET_ANTENNA_MODE_STATUS_OK: command successful
2051  * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2052  * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2053  * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2054  */
2055 enum set_antenna_mode_status {
2056 	SET_ANTENNA_MODE_STATUS_OK,
2057 	SET_ANTENNA_MODE_STATUS_EINVAL,
2058 	SET_ANTENNA_MODE_STATUS_ECANCELED,
2059 	SET_ANTENNA_MODE_STATUS_ENOTSUP,
2060 };
2061 
2062 /**
2063  * struct sir_antenna_mode_resp - set antenna mode response
2064  * @status: Status of setting the antenna mode
2065  */
2066 struct sir_antenna_mode_resp {
2067 	enum set_antenna_mode_status status;
2068 };
2069 
2070 typedef struct sSirWlanExcludeUnencryptParam {
2071 	bool excludeUnencrypt;
2072 	struct qdf_mac_addr bssid;
2073 } tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
2074 
2075 typedef enum {
2076 	P2P_SCAN_TYPE_SEARCH = 1,       /* P2P Search */
2077 	P2P_SCAN_TYPE_LISTEN    /* P2P Listen */
2078 } tSirP2pScanType;
2079 
2080 typedef struct sAniHandoffReq {
2081 	/* Common for all types are requests */
2082 	uint16_t msgType;       /* message type is same as the request type */
2083 	uint16_t msgLen;        /* length of the entire request */
2084 	uint8_t sessionId;
2085 	uint8_t bssid[QDF_MAC_ADDR_SIZE];
2086 	uint32_t ch_freq;
2087 	uint8_t handoff_src;
2088 } tAniHandoffReq, *tpAniHandoffReq;
2089 
2090 /**
2091  * sir_scan_event_type - scan event types used in LIM
2092  * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
2093  * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
2094  * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
2095  * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FOREIGN channel
2096  * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
2097  * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
2098  * @SIR_SCAN_EVENT_START_FAILED - scan start failed
2099  * @SIR_SCAN_EVENT_RESTARTED - scan restarted
2100  * @SIR_SCAN_EVENT_MAX - max value for event type
2101 */
2102 enum sir_scan_event_type {
2103 	SIR_SCAN_EVENT_STARTED = 0x1,
2104 	SIR_SCAN_EVENT_COMPLETED = 0x2,
2105 	SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
2106 	SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2107 	SIR_SCAN_EVENT_DEQUEUED = 0x10,
2108 	SIR_SCAN_EVENT_PREEMPTED = 0x20,
2109 	SIR_SCAN_EVENT_START_FAILED = 0x40,
2110 	SIR_SCAN_EVENT_RESTARTED = 0x80,
2111 	SIR_SCAN_EVENT_MAX = 0x8000
2112 };
2113 
2114 typedef struct sSirScanOffloadEvent {
2115 	enum sir_scan_event_type event;
2116 	tSirResultCodes reasonCode;
2117 	uint32_t chanFreq;
2118 	uint32_t requestor;
2119 	uint32_t scanId;
2120 	tSirP2pScanType p2pScanType;
2121 	uint8_t sessionId;
2122 } tSirScanOffloadEvent, *tpSirScanOffloadEvent;
2123 
2124 /**
2125  * struct sSirUpdateChanParam - channel parameters
2126  * @freq: Frequency of the channel
2127  * @pwr: power level
2128  * @dfsSet: is dfs supported or not
2129  * @half_rate: is the channel operating at 10MHz
2130  * @quarter_rate: is the channel operating at 5MHz
2131  * @nan_disabled: is NAN disabled on @freq
2132  */
2133 typedef struct sSirUpdateChanParam {
2134 	uint32_t freq;
2135 	uint8_t pwr;
2136 	bool dfsSet;
2137 	bool half_rate;
2138 	bool quarter_rate;
2139 	bool nan_disabled;
2140 } tSirUpdateChanParam, *tpSirUpdateChanParam;
2141 
2142 typedef struct sSirUpdateChan {
2143 	uint8_t numChan;
2144 	uint8_t ht_en;
2145 	uint8_t vht_en;
2146 	uint8_t vht_24_en;
2147 	bool he_en;
2148 	bool eht_en;
2149 	QDF_FLEX_ARRAY(tSirUpdateChanParam, chanParam);
2150 } tSirUpdateChanList, *tpSirUpdateChanList;
2151 
2152 typedef enum eSirAddonPsReq {
2153 	eSIR_ADDON_NOTHING,
2154 	eSIR_ADDON_ENABLE_UAPSD,
2155 	eSIR_ADDON_DISABLE_UAPSD
2156 } tSirAddonPsReq;
2157 
2158 #ifdef FEATURE_WLAN_CH_AVOID
2159 typedef struct sSirChAvoidUpdateReq {
2160 	uint32_t reserved_param;
2161 } tSirChAvoidUpdateReq;
2162 #endif /* FEATURE_WLAN_CH_AVOID */
2163 
2164 struct link_speed_info {
2165 	/* MAC Address for the peer */
2166 	struct qdf_mac_addr peer_macaddr;
2167 	uint32_t estLinkSpeed;  /* Linkspeed from firmware */
2168 };
2169 
2170 /**
2171  * struct sir_isolation_resp - isolation info related structure
2172  * @isolation_chain0: isolation value for chain 0
2173  * @isolation_chain1: isolation value for chain 1
2174  * @isolation_chain2: isolation value for chain 2
2175  * @isolation_chain3: isolation value for chain 3
2176  */
2177 struct sir_isolation_resp {
2178 	uint32_t isolation_chain0:8,
2179 		 isolation_chain1:8,
2180 		 isolation_chain2:8,
2181 		 isolation_chain3:8;
2182 };
2183 
2184 typedef struct sSirAddPeriodicTxPtrn {
2185 	/* MAC Address for the adapter */
2186 	struct qdf_mac_addr mac_address;
2187 	uint8_t ucPtrnId;       /* Pattern ID */
2188 	uint16_t ucPtrnSize;    /* Pattern size */
2189 	uint32_t usPtrnIntervalMs;      /* In msec */
2190 	uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE];   /* Pattern buffer */
2191 } tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
2192 
2193 typedef struct sSirDelPeriodicTxPtrn {
2194 	/* MAC Address for the adapter */
2195 	struct qdf_mac_addr mac_address;
2196 	uint8_t ucPtrnId;       /* Pattern ID */
2197 } tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
2198 
2199 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2200 typedef struct {
2201 	uint16_t mesgType;
2202 	uint16_t mesgLen;
2203 	bool status;
2204 } tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
2205 #endif
2206 typedef struct sSirRateUpdateInd {
2207 	uint8_t nss;            /* 0: 1x1, 1: 2x2 */
2208 	struct qdf_mac_addr bssid;
2209 	enum QDF_OPMODE dev_mode;
2210 	int32_t bcastDataRate;  /* bcast rate unit Mbpsx10, -1:not used */
2211 
2212 	/*
2213 	 * 0 implies MCAST RA, positive value implies fixed rate,
2214 	 * -1 implies ignore this param
2215 	 */
2216 	int32_t reliableMcastDataRate;  /* unit Mbpsx10 */
2217 
2218 	/* TX flag to differentiate between HT20, HT40 etc */
2219 	enum tx_rate_info reliableMcastDataRateTxFlag;
2220 
2221 	/*
2222 	 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
2223 	 * 0 implies ignore
2224 	 */
2225 	uint32_t mcastDataRate24GHz;
2226 
2227 	/* TX flag to differentiate between HT20, HT40 etc */
2228 	enum tx_rate_info mcastDataRate24GHzTxFlag;
2229 
2230 	/*
2231 	 * MCAST(or BCAST) fixed data rate in 5 GHz,
2232 	 * unit Mbpsx10, 0 implies ignore
2233 	 */
2234 	uint32_t mcastDataRate5GHz;
2235 
2236 	/* TX flag to differentiate between HT20, HT40 etc */
2237 	enum tx_rate_info mcastDataRate5GHzTxFlag;
2238 
2239 } tSirRateUpdateInd, *tpSirRateUpdateInd;
2240 
2241 #define SIR_DFS_MAX_20M_SUB_CH 8
2242 #define SIR_80MHZ_START_CENTER_CH_DIFF 6
2243 
2244 typedef struct sSirSmeDfsChannelList {
2245 	uint32_t nchannels;
2246 	/* Ch num including bonded channels on which the RADAR is present */
2247 	uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
2248 } tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
2249 
2250 typedef struct sSirChanChangeResponse {
2251 	uint8_t sessionId;
2252 	uint32_t new_op_freq;
2253 	uint8_t channelChangeStatus;
2254 } tSirChanChangeResponse, *tpSirChanChangeResponse;
2255 
2256 typedef struct sSirStartBeaconIndication {
2257 	uint16_t messageType;
2258 	uint16_t messageLen;
2259 	uint8_t beaconStartStatus;
2260 	uint8_t bssid[QDF_MAC_ADDR_SIZE];
2261 } tSirStartBeaconIndication, *tpSirStartBeaconIndication;
2262 
2263 /* additional IE type */
2264 typedef enum tUpdateIEsType {
2265 	eUPDATE_IE_NONE,
2266 	eUPDATE_IE_PROBE_BCN,
2267 	eUPDATE_IE_PROBE_RESP,
2268 	eUPDATE_IE_ASSOC_RESP,
2269 
2270 	/* Add type above this line */
2271 	/* this is used to reset all buffer */
2272 	eUPDATE_IE_ALL,
2273 	eUPDATE_IE_MAX
2274 } eUpdateIEsType;
2275 
2276 /* Modify particular IE in addition IE for prob resp Bcn */
2277 typedef struct sSirModifyIE {
2278 	struct qdf_mac_addr bssid;
2279 	uint16_t vdev_id;
2280 	bool notify;
2281 	uint8_t ieID;
2282 	uint8_t ieIDLen;        /*ie length as per spec */
2283 	uint16_t ieBufferlength;
2284 	uint8_t *pIEBuffer;
2285 	int32_t oui_length;
2286 
2287 } tSirModifyIE, *tpSirModifyIE;
2288 
2289 struct send_add_ba_req {
2290 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2291 	struct addba_send_params param;
2292 };
2293 
2294 /* Message format for Update IE message sent to PE  */
2295 typedef struct sSirModifyIEsInd {
2296 	uint16_t msgType;
2297 	uint16_t msgLen;
2298 	tSirModifyIE modifyIE;
2299 	eUpdateIEsType updateType;
2300 } tSirModifyIEsInd, *tpSirModifyIEsInd;
2301 
2302 /* Message format for Update IE message sent to PE  */
2303 typedef struct sSirUpdateIE {
2304 	struct qdf_mac_addr bssid;
2305 	uint16_t vdev_id;
2306 	bool append;
2307 	bool notify;
2308 	uint16_t ieBufferlength;
2309 	uint8_t *pAdditionIEBuffer;
2310 } tSirUpdateIE, *tpSirUpdateIE;
2311 
2312 /* Message format for Update IE message sent to PE  */
2313 typedef struct sSirUpdateIEsInd {
2314 	uint16_t msgType;
2315 	uint16_t msgLen;
2316 	tSirUpdateIE updateIE;
2317 	eUpdateIEsType updateType;
2318 } tSirUpdateIEsInd, *tpSirUpdateIEsInd;
2319 
2320 /* Message format for requesting channel switch announcement to lower layers */
2321 typedef struct sSirDfsCsaIeRequest {
2322 	uint16_t msgType;
2323 	uint16_t msgLen;
2324 	uint32_t target_chan_freq;
2325 	uint8_t csaIeRequired;
2326 	uint8_t bssid[QDF_MAC_ADDR_SIZE];
2327 	struct ch_params ch_params;
2328 	uint8_t  ch_switch_beacon_cnt;
2329 	uint8_t  ch_switch_mode;
2330 	uint8_t  dfs_ch_switch_disable;
2331 	uint32_t new_chan_cac_ms;
2332 } tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
2333 
2334 /* Indication from lower layer indicating the completion of first beacon send
2335  * after the beacon template update
2336  */
2337 typedef struct sSirFirstBeaconTxCompleteInd {
2338 	uint16_t messageType;   /* eWNI_SME_MISSED_BEACON_IND */
2339 	uint16_t length;
2340 	uint8_t bss_idx;
2341 } tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
2342 
2343 typedef struct sSirSmeCSAIeTxCompleteRsp {
2344 	uint8_t sessionId;
2345 	uint8_t chanSwIeTxStatus;
2346 } tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
2347 
2348 /* Thermal Mitigation*/
2349 
2350 typedef struct {
2351 	uint16_t minTempThreshold;
2352 	uint16_t maxTempThreshold;
2353 } t_thermal_level_info, *tp_thermal_level_info;
2354 
2355 typedef enum {
2356 	WLAN_WMA_THERMAL_LEVEL_0,
2357 	WLAN_WMA_THERMAL_LEVEL_1,
2358 	WLAN_WMA_THERMAL_LEVEL_2,
2359 	WLAN_WMA_THERMAL_LEVEL_3,
2360 	WLAN_WMA_THERMAL_LEVEL_4,
2361 	WLAN_WMA_THERMAL_LEVEL_5,
2362 	WLAN_WMA_MAX_THERMAL_LEVELS
2363 } t_thermal_level;
2364 
2365 #define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (6)
2366 
2367 typedef struct {
2368 	/* Array of thermal levels */
2369 	t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
2370 	uint8_t thermalCurrLevel;
2371 	uint8_t thermalMgmtEnabled;
2372 	uint32_t throttlePeriod;
2373 	uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
2374 	enum thermal_mgmt_action_code thermal_action;
2375 } t_thermal_mgmt, *tp_thermal_mgmt;
2376 
2377 struct tx_power_limit {
2378 	/* Thermal limits for 2g and 5g */
2379 	uint32_t txPower2g;
2380 	uint32_t txPower5g;
2381 };
2382 
2383 enum bad_peer_thresh_levels {
2384 	WLAN_WMA_IEEE80211_B_LEVEL = 0,
2385 	WLAN_WMA_IEEE80211_AG_LEVEL,
2386 	WLAN_WMA_IEEE80211_N_LEVEL,
2387 	WLAN_WMA_IEEE80211_AC_LEVEL,
2388 	WLAN_WMA_IEEE80211_AX_LEVEL,
2389 	WLAN_WMA_IEEE80211_MAX_LEVEL,
2390 };
2391 
2392 #define NUM_OF_RATE_THRESH_MAX    (4)
2393 struct t_bad_peer_info {
2394 	uint32_t cond;
2395 	uint32_t delta;
2396 	uint32_t percentage;
2397 	uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
2398 	uint32_t txlimit;
2399 };
2400 
2401 struct t_bad_peer_txtcl_config {
2402 	/* Array of thermal levels */
2403 	struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
2404 	uint32_t enable;
2405 	uint32_t period;
2406 	uint32_t txq_limit;
2407 	uint32_t tgt_backoff;
2408 	uint32_t tgt_report_prd;
2409 };
2410 
2411 /* notify MODEM power state to FW */
2412 typedef struct {
2413 	uint32_t param;
2414 } tSirModemPowerStateInd, *tpSirModemPowerStateInd;
2415 
2416 #ifdef WLAN_FEATURE_STATS_EXT
2417 typedef struct {
2418 	uint32_t vdev_id;
2419 	uint32_t event_data_len;
2420 	uint8_t event_data[];
2421 } tSirStatsExtEvent, *tpSirStatsExtEvent;
2422 #endif
2423 
2424 /**
2425  * struct sir_wisa_params - WISA Mode Parameters
2426  * @mode: WISA mode
2427  * @session_id: Session ID of vdev
2428  */
2429 struct sir_wisa_params {
2430 	bool mode;
2431 	uint8_t vdev_id;
2432 };
2433 
2434 /**
2435  * typedef enum wifi_scan_flags - wifi scan flags
2436  * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
2437  *				because probes were not sent on some channels
2438  */
2439 typedef enum {
2440 	WIFI_SCAN_FLAG_INTERRUPTED = 1,
2441 } wifi_scan_flags;
2442 
2443 typedef enum {
2444 	WIFI_BAND_UNSPECIFIED,
2445 	WIFI_BAND_BG = 1,       /* 2.4 GHz */
2446 	WIFI_BAND_A = 2,        /* 5 GHz without DFS */
2447 	WIFI_BAND_ABG = 3,      /* 2.4 GHz + 5 GHz; no DFS */
2448 	WIFI_BAND_A_DFS_ONLY = 4,       /* 5 GHz DFS only */
2449 	/* 5 is reserved */
2450 	WIFI_BAND_A_WITH_DFS = 6,       /* 5 GHz with DFS */
2451 	WIFI_BAND_ABG_WITH_DFS = 7,     /* 2.4 GHz + 5 GHz with DFS */
2452 
2453 	/* Keep it last */
2454 	WIFI_BAND_MAX
2455 } tWifiBand;
2456 
2457 #ifdef FEATURE_WLAN_EXTSCAN
2458 
2459 #define WLAN_EXTSCAN_MAX_CHANNELS                 36
2460 #define WLAN_EXTSCAN_MAX_BUCKETS                  16
2461 #define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS   64
2462 
2463 typedef enum {
2464 	eSIR_EXTSCAN_INVALID,
2465 	eSIR_EXTSCAN_START_RSP,
2466 	eSIR_EXTSCAN_STOP_RSP,
2467 	eSIR_EXTSCAN_CACHED_RESULTS_RSP,
2468 	eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
2469 	eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
2470 	eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
2471 	eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
2472 
2473 	eSIR_EXTSCAN_GET_CAPABILITIES_IND,
2474 	eSIR_EXTSCAN_HOTLIST_MATCH_IND,
2475 	eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
2476 	eSIR_EXTSCAN_CACHED_RESULTS_IND,
2477 	eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
2478 	eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
2479 	eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
2480 	eSIR_EPNO_NETWORK_FOUND_IND,
2481 	eSIR_PASSPOINT_NETWORK_FOUND_IND,
2482 	eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
2483 	eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
2484 
2485 	/* Keep this last */
2486 	eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
2487 } tSirExtScanCallbackType;
2488 
2489 /**
2490  * enum wifi_extscan_event_type - extscan event type
2491  * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
2492  *		and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
2493  *		WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
2494  *		reason for the event is available; however, at most one of
2495  *		these events should be reported per scan.
2496  * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
2497  *		REPORT_EVENTS_EACH_SCAN is not set and
2498  *		report_threshold_num_scans is reached.
2499  * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
2500  *		is not set and report_threshold_percent is reached.
2501  * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
2502  *		start_gscan will need to be called again in order to continue
2503  *		scanning.
2504  * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
2505  *		This event is consumed in driver only.
2506  * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
2507  *		This event is consumed in driver only.
2508  * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
2509  *		triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
2510  */
2511 enum wifi_extscan_event_type {
2512 	WIFI_EXTSCAN_RESULTS_AVAILABLE,
2513 	WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
2514 	WIFI_EXTSCAN_THRESHOLD_PERCENT,
2515 	WIFI_SCAN_DISABLED,
2516 
2517 	WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
2518 	WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
2519 	WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
2520 };
2521 
2522 /**
2523  * enum extscan_configuration_flags - extscan config flags
2524  * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
2525  */
2526 enum extscan_configuration_flags {
2527 	EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
2528 };
2529 
2530 /**
2531  * struct ext_scan_capabilities_response - extscan capabilities response data
2532  * @requestId: request identifier
2533  * @status:    status
2534  * @max_scan_cache_size: total space allocated for scan (in bytes)
2535  * @max_scan_buckets: maximum number of channel buckets
2536  * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
2537  * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
2538  * @ax_scan_reporting_threshold: max possible report_threshold
2539  * @max_hotlist_bssids: maximum number of entries for hotlist APs
2540  * @max_significant_wifi_change_aps: maximum number of entries for
2541  *				significant wifi change APs
2542  * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
2543  * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
2544  * @max_number_epno_networks: max number of epno entries
2545  * @max_number_epno_networks_by_ssid: max number of epno entries
2546  *			if ssid is specified, that is, epno entries for
2547  *			which an exact match is required,
2548  *			or entries corresponding to hidden ssids
2549  * @max_number_of_allow_listed_ssid: max number of allow listed SSIDs
2550  * @max_number_of_deny_listed_bssid: max number of deny listed BSSIDs
2551  */
2552 struct ext_scan_capabilities_response {
2553 	uint32_t requestId;
2554 	uint32_t status;
2555 
2556 	uint32_t max_scan_cache_size;
2557 	uint32_t max_scan_buckets;
2558 	uint32_t max_ap_cache_per_scan;
2559 	uint32_t max_rssi_sample_size;
2560 	uint32_t max_scan_reporting_threshold;
2561 
2562 	uint32_t max_hotlist_bssids;
2563 	uint32_t max_significant_wifi_change_aps;
2564 
2565 	uint32_t max_bssid_history_entries;
2566 	uint32_t max_hotlist_ssids;
2567 	uint32_t max_number_epno_networks;
2568 	uint32_t max_number_epno_networks_by_ssid;
2569 	uint32_t max_number_of_allow_listed_ssid;
2570 	uint32_t max_number_of_deny_listed_bssid;
2571 };
2572 
2573 typedef struct {
2574 	/* Time of discovery */
2575 	uint64_t ts;
2576 
2577 	/* Null terminated SSID */
2578 	uint8_t ssid[WLAN_SSID_MAX_LEN + 1];
2579 
2580 	struct qdf_mac_addr bssid;
2581 
2582 	/* Frequency in MHz */
2583 	uint32_t channel;
2584 
2585 	/* RSSI in dBm */
2586 	int32_t rssi;
2587 
2588 	/* RTT in nanoseconds */
2589 	uint32_t rtt;
2590 
2591 	/* Standard deviation in rtt */
2592 	uint32_t rtt_sd;
2593 
2594 	/* Period advertised in the beacon */
2595 	uint16_t beaconPeriod;
2596 
2597 	/* Capabilities advertised in the beacon */
2598 	uint16_t capability;
2599 
2600 	uint16_t ieLength;
2601 
2602 	uint8_t ieData[];
2603 } tSirWifiScanResult, *tpSirWifiScanResult;
2604 
2605 /**
2606  * struct extscan_hotlist_match - extscan hotlist match
2607  * @requestId: request identifier
2608  * @numOfAps: number of bssids retrieved by the scan
2609  * @moreData: 0 - for last fragment
2610  *	      1 - still more fragment(s) coming
2611  * @ap: wifi scan result
2612  */
2613 struct extscan_hotlist_match {
2614 	uint32_t    requestId;
2615 	bool        moreData;
2616 	bool        ap_found;
2617 	uint32_t    numOfAps;
2618 	tSirWifiScanResult   ap[];
2619 };
2620 
2621 /**
2622  * struct extscan_cached_scan_result - extscan cached scan result
2623  * @scan_id: a unique identifier for the scan unit
2624  * @flags: a bitmask with additional information about scan
2625  * @num_results: number of bssids retrieved by the scan
2626  * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
2627  * @ap: wifi scan bssid results info
2628  */
2629 struct extscan_cached_scan_result {
2630 	uint32_t    scan_id;
2631 	uint32_t    flags;
2632 	uint32_t    num_results;
2633 	uint32_t    buckets_scanned;
2634 	tSirWifiScanResult *ap;
2635 };
2636 
2637 /**
2638  * struct extscan_cached_scan_results - extscan cached scan results
2639  * @request_id: request identifier
2640  * @more_data: 0 - for last fragment
2641  *	       1 - still more fragment(s) coming
2642  * @num_scan_ids: number of scan ids
2643  * @result: wifi scan result
2644  */
2645 struct extscan_cached_scan_results {
2646 	uint32_t    request_id;
2647 	bool        more_data;
2648 	uint32_t    num_scan_ids;
2649 	struct extscan_cached_scan_result  *result;
2650 };
2651 
2652 
2653 /**
2654  * struct tSirWifiFullScanResultEvent - extscan full scan event
2655  * @request_id: request identifier
2656  * @moreData: 0 - for last fragment
2657  *             1 - still more fragment(s) coming
2658  * @ap: bssid info
2659  *
2660  * Reported when each probe response is received, if report_events
2661  * enabled in struct wifi_scan_cmd_req_params
2662  */
2663 typedef struct {
2664 	uint32_t            requestId;
2665 	bool                moreData;
2666 	tSirWifiScanResult  ap;
2667 } tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
2668 
2669 /**
2670  * struct pno_match_found - epno match found
2671  * @request_id: request identifier
2672  * @moreData: 0 - for last fragment
2673      * 1 - still more fragment(s) coming
2674  * @num_results: number of bssids, driver sends this event to upper layer
2675  *		 for every beacon, hence %num_results is always set to 1.
2676  * @ap: bssid info
2677  *
2678  * Reported when each beacon probe response is received with
2679  * epno match found tag.
2680      */
2681 struct pno_match_found {
2682 	uint32_t            request_id;
2683 	bool                more_data;
2684 	uint32_t            num_results;
2685 	tSirWifiScanResult  ap[];
2686 };
2687 
2688 /**
2689  * struct sir_extscan_generic_response -
2690  *	Generic ExtScan Response structure
2691  * @request_id: ID of the request
2692  * @status: operation status returned by firmware
2693  */
2694 struct sir_extscan_generic_response {
2695 	uint32_t request_id;
2696 	uint32_t status;
2697 };
2698 
2699 typedef struct {
2700 	struct qdf_mac_addr bssid;
2701 	uint32_t channel;
2702 	uint32_t numOfRssi;
2703 
2704 	/* Rssi history in db */
2705 	int32_t rssi[];
2706 } tSirWifiSignificantChange, *tpSirWifiSignificantChange;
2707 
2708 typedef struct {
2709 	uint32_t requestId;
2710 
2711 	bool moreData;
2712 	uint32_t numResults;
2713 	tSirWifiSignificantChange ap[];
2714 } tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
2715 
2716 typedef struct {
2717 	uint32_t requestId;
2718 	uint32_t numResultsAvailable;
2719 } tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
2720 
2721 typedef struct {
2722 	uint32_t requestId;
2723 	uint32_t status;
2724 	uint8_t scanEventType;
2725 	uint32_t   buckets_scanned;
2726 } tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
2727 
2728 #define MAX_EPNO_NETWORKS 64
2729 
2730 #define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
2731 
2732 /**
2733  * struct wifi_passpoint_match - wifi passpoint network match
2734  * @id: network block identifier for the matched network
2735  * @anqp_len: length of ANQP blob
2736  * @ap: scan result, with channel and beacon information
2737  * @anqp: ANQP data, in the information_element format
2738  */
2739 struct wifi_passpoint_match {
2740 	uint32_t  request_id;
2741 	uint32_t  id;
2742 	uint32_t  anqp_len;
2743 	tSirWifiScanResult ap;
2744 	uint8_t   anqp[];
2745 };
2746 #endif /* FEATURE_WLAN_EXTSCAN */
2747 
2748 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
2749 struct auto_shutdown_cmd {
2750 	uint32_t timer_val;
2751 };
2752 #endif
2753 
2754 #ifdef WLAN_POWER_DEBUG
2755 /**
2756  * struct power_stats_response - Power stats response
2757  * @cumulative_sleep_time_ms: cumulative sleep time in ms
2758  * @cumulative_total_on_time_ms: total awake time in ms
2759  * @deep_sleep_enter_counter: deep sleep enter counter
2760  * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
2761  * @debug_register_fmt: debug registers format
2762  * @num_debug_register: number of debug registers
2763  * @debug_registers: Pointer to the debug registers buffer
2764  */
2765 struct power_stats_response {
2766 	uint32_t cumulative_sleep_time_ms;
2767 	uint32_t cumulative_total_on_time_ms;
2768 	uint32_t deep_sleep_enter_counter;
2769 	uint32_t last_deep_sleep_enter_tstamp_ms;
2770 	uint32_t debug_register_fmt;
2771 	uint32_t num_debug_register;
2772 	uint32_t *debug_registers;
2773 };
2774 #endif
2775 
2776 #ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
2777 #define MAX_BCNMISS_BITMAP 8
2778 /**
2779  * struct bcn_reception_stats_rsp - beacon stats response
2780  * @total_bcn_cnt: total beacon count (tbtt instances)
2781  * @total_bmiss_cnt: Total beacon miss count in last 255 beacons, max 255
2782  * @bmiss_bitmap: This bitmap indicates the status of the last 255 beacons.
2783  * If a bit is set, that means the corresponding beacon was missed.
2784  * Bit 0 of bmiss_bitmap[0] represents the most recent beacon.
2785  * The total_bcn_cnt field indicates how many bits within bmiss_bitmap
2786  * are valid.
2787  */
2788 struct bcn_reception_stats_rsp {
2789 	uint32_t vdev_id;
2790 	uint32_t total_bcn_cnt;
2791 	uint32_t total_bmiss_cnt;
2792 	uint32_t bmiss_bitmap[MAX_BCNMISS_BITMAP];
2793 };
2794 #endif
2795 
2796 /**
2797  * struct lfr_firmware_status - LFR status in firmware
2798  * @is_disabled: Is LFR disabled in FW
2799  * @disable_lfr_event: Disable attempt done in FW
2800  */
2801 struct lfr_firmware_status {
2802 	uint32_t is_disabled;
2803 	struct completion disable_lfr_event;
2804 };
2805 
2806 /**
2807  * struct rso_cmd_status - RSO Command status
2808  * @vdev_id: Vdev ID for which RSO command sent
2809  * @status: Status of RSO command sent to FW
2810  */
2811 struct rso_cmd_status {
2812 	uint32_t vdev_id;
2813 	bool status;
2814 };
2815 
2816 enum {
2817 	SIR_AP_RX_DATA_OFFLOAD             = 0x00,
2818 	SIR_STA_RX_DATA_OFFLOAD            = 0x01,
2819 };
2820 
2821 /**
2822  * struct sir_set_vdev_ies_per_band
2823  * @msg_type: message type
2824  * @len: message length
2825  * @vdev_id: vdev id
2826  *
2827  * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
2828  */
2829 struct sir_set_vdev_ies_per_band {
2830 	uint16_t msg_type;
2831 	uint16_t len;
2832 	uint32_t vdev_id;
2833 	uint16_t dot11_mode;
2834 	enum QDF_OPMODE device_mode;
2835 };
2836 
2837 /**
2838  * struct sir_set_ht_vht_cfg - ht, vht IE config
2839  * @msg_type: message type
2840  * @len: message length
2841  * @pdev_id: pdev id
2842  * @nss: Nss value
2843  * @dot11mode: Dot11 mode.
2844  *
2845  * Message wrapper structure for set HT/VHT IE req.
2846  */
2847 struct sir_set_ht_vht_cfg {
2848 	uint16_t msg_type;
2849 	uint16_t len;
2850 	uint32_t pdev_id;
2851 	uint32_t nss;
2852 	uint32_t dot11mode;
2853 };
2854 
2855 #define WIFI_INVALID_PEER_ID            (-1)
2856 #define WIFI_INVALID_VDEV_ID            (-1)
2857 #define WIFI_MAX_AC                     (4)
2858 #define RATE_STAT_MCS_MASK              (0xFF00)
2859 #define RATE_STAT_GET_MCS_INDEX(x)      (((x) & RATE_STAT_MCS_MASK) >> 8)
2860 
2861 typedef struct {
2862 	uint32_t paramId;
2863 	uint8_t ifaceId;
2864 	uint32_t rspId;
2865 	uint32_t moreResultToFollow;
2866 	uint32_t nr_received;
2867 	union {
2868 		uint32_t num_peers;
2869 		uint32_t num_radio;
2870 	};
2871 
2872 	uint32_t peer_event_number;
2873 	/* Variable  length field - Do not add anything after this */
2874 	uint8_t results[0];
2875 } tSirLLStatsResults, *tpSirLLStatsResults;
2876 
2877 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
2878 /*---------------------------------------------------------------------------
2879    WLAN_HAL_LL_NOTIFY_STATS
2880    ---------------------------------------------------------------------------*/
2881 
2882 /******************************LINK LAYER Statistics**********************/
2883 
2884 typedef struct {
2885 	uint32_t reqId;
2886 	uint8_t staId;
2887 	uint32_t mpduSizeThreshold;
2888 	uint32_t aggressiveStatisticsGathering;
2889 } tSirLLStatsSetReq, *tpSirLLStatsSetReq;
2890 
2891 typedef struct {
2892 	uint32_t reqId;
2893 	uint8_t staId;
2894 	uint32_t paramIdMask;
2895 	bool is_mlo_req;
2896 	uint32_t mlo_vdev_id_bitmap;
2897 } tSirLLStatsGetReq, *tpSirLLStatsGetReq;
2898 
2899 typedef struct {
2900 	uint32_t reqId;
2901 	uint8_t staId;
2902 	uint32_t statsClearReqMask;
2903 	uint8_t stopReq;
2904 } tSirLLStatsClearReq, *tpSirLLStatsClearReq;
2905 
2906 typedef enum {
2907 	WIFI_DISCONNECTED = 0,
2908 	WIFI_AUTHENTICATING = 1,
2909 	WIFI_ASSOCIATING = 2,
2910 	WIFI_ASSOCIATED = 3,
2911 	WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
2912 	WIFI_EAPOL_COMPLETED = 5,       /* if done by firmware/driver */
2913 } tSirWifiConnectionState;
2914 
2915 typedef enum {
2916 	WIFI_ROAMING_IDLE = 0,
2917 	WIFI_ROAMING_ACTIVE = 1,
2918 } tSirWifiRoamState;
2919 
2920 typedef enum {
2921 	WIFI_INTERFACE_STA = 0,
2922 	WIFI_INTERFACE_SOFTAP = 1,
2923 	WIFI_INTERFACE_IBSS = 2,
2924 	WIFI_INTERFACE_P2P_CLIENT = 3,
2925 	WIFI_INTERFACE_P2P_GO = 4,
2926 	WIFI_INTERFACE_NAN = 5,
2927 	WIFI_INTERFACE_MESH = 6,
2928 	WIFI_INTERFACE_NDI = 7,
2929 } tSirWifiInterfaceMode;
2930 
2931 /* set for QOS association */
2932 #define WIFI_CAPABILITY_QOS          0x00000001
2933 /* set for protected assoc (802.11 beacon frame control protected bit set) */
2934 #define WIFI_CAPABILITY_PROTECTED    0x00000002
2935 /* set if 802.11 Extended Capabilities element interworking bit is set */
2936 #define WIFI_CAPABILITY_INTERWORKING 0x00000004
2937 /* set for HS20 association */
2938 #define WIFI_CAPABILITY_HS20         0x00000008
2939 /* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
2940 #define WIFI_CAPABILITY_SSID_UTF8    0x00000010
2941 /* set is 802.11 Country Element is present */
2942 #define WIFI_CAPABILITY_COUNTRY      0x00000020
2943 
2944 struct wifi_interface_info {
2945 	/* tSirWifiInterfaceMode */
2946 	/* interface mode */
2947 	uint8_t mode;
2948 	/* interface mac address (self) */
2949 	struct qdf_mac_addr macAddr;
2950 	/* tSirWifiConnectionState */
2951 	/* connection state (valid for STA, CLI only) */
2952 	uint8_t state;
2953 	/* tSirWifiRoamState */
2954 	/* roaming state */
2955 	uint32_t roaming;
2956 	/* WIFI_CAPABILITY_XXX (self) */
2957 	uint32_t capabilities;
2958 	/* null terminated SSID */
2959 	uint8_t ssid[33];
2960 	/* bssid */
2961 	struct qdf_mac_addr bssid;
2962 	/* country string advertised by AP */
2963 	uint8_t apCountryStr[REG_ALPHA2_LEN + 1];
2964 	/* country string for this association */
2965 	uint8_t countryStr[REG_ALPHA2_LEN + 1];
2966 	uint8_t time_slice_duty_cycle;
2967 };
2968 
2969 /**
2970  * struct wifi_channel_info - channel information
2971  * @width: channel width (20, 40, 80, 80+80, 160)
2972  * @center_freq: primary 20 MHz channel
2973  * @center_freq0: center frequency (MHz) first segment
2974  * @center_freq1: center frequency (MHz) second segment
2975  */
2976 struct wifi_channel_info {
2977 	enum phy_ch_width width;
2978 	uint32_t center_freq;
2979 	uint32_t center_freq0;
2980 	uint32_t center_freq1;
2981 };
2982 
2983 /**
2984  * struct wifi_rate_info - wifi rate information
2985  * @preamble: 0:OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved
2986  * @nss: 0:1x1, 1:2x2, 3:3x3, 4:4x4
2987  * @bw: 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz
2988  * @rate_or_mcs_index:
2989  * * OFDM/CCK: rate code per ieee std in units of 0.5mbps
2990  * * HT/VHT: mcs index
2991  * @reserved: reserved
2992  * @bitrate: bitrate units of 100 Kbps
2993  */
2994 struct wifi_rate_info {
2995 	uint32_t preamble:3;
2996 	uint32_t nss:2;
2997 	uint32_t bw:3;
2998 	uint32_t rate_or_mcs_index:8;
2999 	uint32_t reserved:16;
3000 	uint32_t bitrate;
3001 };
3002 
3003 /**
3004  * struct wifi_channel_stats - channel statistics
3005  * @channel: channel for which the stats are applicable
3006  * @on_time: msecs the radio is awake
3007  * @cca_busy_time: secs the CCA register is busy excluding own tx_time
3008  * @tx_time: msecs the radio is transmitting on this channel
3009  * @rx_time: msecs the radio is in active receive on this channel
3010  */
3011 struct wifi_channel_stats {
3012 	struct wifi_channel_info channel;
3013 	uint32_t on_time;
3014 	uint32_t cca_busy_time;
3015 	uint32_t tx_time;
3016 	uint32_t rx_time;
3017 
3018 };
3019 
3020 /**
3021  * struct wifi_radio_stats - per-radio statistics
3022  * @radio: wifi radio for which the stats are applicable
3023  * @on_time: msecs the radio is awake
3024  * @tx_time: msecs the radio is transmitting
3025  * @rx_time: msecs the radio is in active receive
3026  * @on_time_scan: msecs the radio is awake due to all scan
3027  * @on_time_nbd: msecs the radio is awake due to NAN
3028  * @on_time_gscan: msecs the radio is awake due to Gscan
3029  * @on_time_roam_scan: msecs the radio is awake due to roam scan
3030  * @on_time_pno_scan: msecs the radio is awake due to PNO scan
3031  * @on_time_hs20: msecs the radio is awake due to HS2.0 scans and GAS exchange
3032  * @on_time_host_scan: msecs the radio is awake due to Host initiated scan
3033  * @on_time_lpi_scan: msecs the radio is awake due to LPI scan
3034  * @total_num_tx_power_levels: @tx_time_per_power_level record count
3035  * @tx_time_per_power_level:  tx time (in milliseconds) per TPC level (0.5 dBm)
3036  * @more_channels: If more channels are there and will come in next event
3037  * @num_channels: @channels record count
3038  * @channels: per-channel statistics
3039  */
3040 struct wifi_radio_stats {
3041 	uint32_t radio;
3042 	uint32_t on_time;
3043 	uint32_t tx_time;
3044 	uint32_t rx_time;
3045 	uint32_t on_time_scan;
3046 	uint32_t on_time_nbd;
3047 	uint32_t on_time_gscan;
3048 	uint32_t on_time_roam_scan;
3049 	uint32_t on_time_pno_scan;
3050 	uint32_t on_time_hs20;
3051 	uint32_t on_time_host_scan;
3052 	uint32_t on_time_lpi_scan;
3053 	uint32_t total_num_tx_power_levels;
3054 	uint32_t *tx_time_per_power_level;
3055 	uint32_t more_channels;
3056 	uint32_t num_channels;
3057 	struct wifi_channel_stats *channels;
3058 };
3059 
3060 /**
3061  * struct wifi_rate_stat - per rate statistics
3062  * @rate: rate information
3063  * @tx_mpdu: number of successfully transmitted data pkts (ACK rcvd)
3064  * @rx_mpdu: number of received data pkts
3065  * @mpdu_lost: number of data packet losses (no ACK)
3066  * @retries: total number of data pkt retries *
3067  * @retries_short: number of short data pkt retries
3068  * @retries_long: number of long data pkt retries
3069  */
3070 struct wifi_rate_stat {
3071 	struct wifi_rate_info rate;
3072 	uint32_t tx_mpdu;
3073 	uint32_t rx_mpdu;
3074 	uint32_t mpdu_lost;
3075 	uint32_t retries;
3076 	uint32_t retries_short;
3077 	uint32_t retries_long;
3078 };
3079 
3080 /* wifi peer type */
3081 typedef enum {
3082 	WIFI_PEER_STA,
3083 	WIFI_PEER_AP,
3084 	WIFI_PEER_P2P_GO,
3085 	WIFI_PEER_P2P_CLIENT,
3086 	WIFI_PEER_NAN,
3087 	WIFI_PEER_TDLS,
3088 	WIFI_PEER_INVALID,
3089 } tSirWifiPeerType;
3090 
3091 /**
3092  * struct wifi_peer_info - per peer information
3093  * @type: peer type (AP, TDLS, GO etc.)
3094  * @peer_macaddr: mac address
3095  * @capabilities: peer WIFI_CAPABILITY_XXX
3096  * @power_saving: peer power saving mode
3097  * @num_rate: number of rates
3098  * @rate_stats: per rate statistics, number of entries  = @num_rate
3099  */
3100 struct wifi_peer_info {
3101 	enum wmi_peer_type type;
3102 	struct qdf_mac_addr peer_macaddr;
3103 	uint32_t capabilities;
3104 	union {
3105 		uint32_t power_saving;
3106 		uint32_t num_rate;
3107 	};
3108 	struct wifi_rate_stat rate_stats[0];
3109 };
3110 
3111 /**
3112  * struct wifi_interface_stats - Interface statistics
3113  * @info: struct containing the current state of the interface
3114  * @rts_succ_cnt: number of RTS/CTS sequence success
3115  * @rts_fail_cnt: number of RTS/CTS sequence failures
3116  * @ppdu_succ_cnt: number of PPDUs transmitted
3117  * @ppdu_fail_cnt: number of PPDUs that failed to transmit
3118  * @link_stats: link-level statistics
3119  * @ac_stats: per-Access Category statistics
3120  * @num_offload_stats: @offload_stats record count
3121  * @offload_stats: per-offload statistics
3122  * @powersave_stats: powersave statistics
3123  * @vdev_id: vdev id
3124  *
3125  * Statistics corresponding to 2nd most LSB in wifi statistics bitmap
3126  * for getting statistics
3127  */
3128 struct wifi_interface_stats {
3129 	struct wifi_interface_info info;
3130 	uint32_t rts_succ_cnt;
3131 	uint32_t rts_fail_cnt;
3132 	uint32_t ppdu_succ_cnt;
3133 	uint32_t ppdu_fail_cnt;
3134 	wmi_iface_link_stats link_stats;
3135 	wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
3136 	uint32_t num_offload_stats;
3137 	wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
3138 	wmi_iface_powersave_stats powersave_stats;
3139 	uint8_t vdev_id;
3140 };
3141 
3142 /**
3143  * struct wifi_peer_stat - peer statistics
3144  * @num_peers: number of peers
3145  * @peer_info: per peer statistics
3146  *
3147  * Peer statistics - corresponding to 3rd most LSB in
3148  * wifi statistics bitmap for getting statistics
3149  */
3150 struct wifi_peer_stat {
3151 	uint32_t num_peers;
3152 	struct wifi_peer_info peer_info[0];
3153 };
3154 
3155 /* wifi statistics bitmap  for getting statistics */
3156 #define WMI_LINK_STATS_RADIO          0x00000001
3157 #define WMI_LINK_STATS_IFACE          0x00000002
3158 #define WMI_LINK_STATS_ALL_PEER       0x00000004
3159 #define WMI_LINK_STATS_PER_PEER       0x00000008
3160 
3161 /* wifi statistics bitmap  for clearing statistics */
3162 /* all radio statistics */
3163 #define WIFI_STATS_RADIO              0x00000001
3164 /* cca_busy_time (within radio statistics) */
3165 #define WIFI_STATS_RADIO_CCA          0x00000002
3166 /* all channel statistics (within radio statistics) */
3167 #define WIFI_STATS_RADIO_CHANNELS     0x00000004
3168 /* all scan statistics (within radio statistics) */
3169 #define WIFI_STATS_RADIO_SCAN         0x00000008
3170 /* all interface statistics */
3171 #define WIFI_STATS_IFACE              0x00000010
3172 /* all tx rate statistics (within interface statistics) */
3173 #define WIFI_STATS_IFACE_TXRATE       0x00000020
3174 /* all ac statistics (within interface statistics) */
3175 #define WIFI_STATS_IFACE_AC           0x00000040
3176 /* all contention (min, max, avg) statistics (within ac statistics) */
3177 #define WIFI_STATS_IFACE_CONTENTION   0x00000080
3178 /* All peer stats on this interface */
3179 #define WIFI_STATS_IFACE_ALL_PEER      0x00000100
3180 /* Clear particular peer stats depending on the peer_mac */
3181 #define WIFI_STATS_IFACE_PER_PEER      0x00000200
3182 
3183 /**
3184  * struct sir_wifi_iface_tx_fail - TX failure event
3185  * @tid: TX TID
3186  * @msdu_num: TX MSDU failed counter
3187  * @status: TX status from HTT message.
3188  *          Only failure status will be involved.
3189  */
3190 struct sir_wifi_iface_tx_fail {
3191 	uint8_t  tid;
3192 	uint16_t msdu_num;
3193 	enum htt_tx_status status;
3194 };
3195 
3196 /**
3197  * struct sir_wifi_chan_cca_stats - channal CCA stats
3198  * @vdev_id: vdev ID
3199  * @idle_time: percentage of idle time, no TX, no RX, no interference
3200  * @tx_time: percentage of time transmitting packets
3201  * @rx_in_bss_time: percentage of time receiving packets in current BSS
3202  * @rx_out_bss_time: percentage of time receiving packets not in current BSS
3203  * @rx_busy_time: percentage of time interference detected
3204  * @rx_in_bad_cond_time: percentage of time receiving packets with errors
3205  *	or packets flagged as retransmission or seqnum discontinued.
3206  * @tx_in_bad_cond_time: percentage of time the device transmitted packets
3207  *	that haven't been ACKed.
3208  * @wlan_not_avail_time: percentage of time the chip is unable to
3209  *	work in normal conditions.
3210  */
3211 struct sir_wifi_chan_cca_stats {
3212 	uint32_t vdev_id;
3213 	uint32_t idle_time;
3214 	uint32_t tx_time;
3215 	uint32_t rx_in_bss_time;
3216 	uint32_t rx_out_bss_time;
3217 	uint32_t rx_busy_time;
3218 	uint32_t rx_in_bad_cond_time;
3219 	uint32_t tx_in_bad_cond_time;
3220 	uint32_t wlan_not_avail_time;
3221 };
3222 
3223 #define WIFI_MAX_CHAINS                 8
3224 
3225 /**
3226  * struct sir_wifi_peer_signal_stats - peer signal stats
3227  * @vdev_id: vdev ID
3228  * @peer_id: peer ID
3229  * @per_ant_snr: per antenna SNR
3230  * @nf: peer background noise
3231  * @per_ant_rx_mpdus: MPDUs received per antenna
3232  * @per_ant_tx_mpdus: MPDUs transferred per antenna
3233  * @num_chain: valid chain count
3234  */
3235 struct sir_wifi_peer_signal_stats {
3236 	uint32_t vdev_id;
3237 	uint32_t peer_id;
3238 
3239 	/* per antenna SNR in current bss */
3240 	int32_t per_ant_snr[WIFI_MAX_CHAINS];
3241 
3242 	/* Background noise */
3243 	int32_t nf[WIFI_MAX_CHAINS];
3244 
3245 	uint32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
3246 	uint32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
3247 	uint32_t num_chain;
3248 };
3249 
3250 #define WIFI_VDEV_NUM           4
3251 #define WFIF_MCS_NUM            10
3252 #define WIFI_AGGR_NUM           8
3253 #define WIFI_DELAY_SIZE         11
3254 
3255 /**
3256  * struct sir_wifi_tx - per AC tx stats
3257  * @msdus: number of totoal MSDUs on MAC layer in the period
3258  * @mpdus: number of totoal MPDUs on MAC layer in the period
3259  * @ppdus: number of totoal PPDUs on PHY layer in the period
3260  * @bytes: bytes of tx data on MAC layer in the period
3261  * @drops: number of TX packets cancelled due to any reason in the period,
3262  *	such as WMM limitation/bandwidth limitation/radio congestion
3263  * @drop_bytes: bytes of dropped TX packets in the period
3264  * @retries: number of unacked transmissions of MPDUs
3265  * @failed: number of packets have not been ACKed despite retried
3266  * @aggr_len: length of the MPDU aggregation size buffer
3267  * @mpdu_aggr_size: histogram of MPDU aggregation size
3268  * @success_mcs_len: length of success mcs buffer
3269  * @success_mcs: histogram of successful received MPDUs encoding rate
3270  * @fail_mcs_len: length of failed mcs buffer
3271  * @fail_mcs: histogram of failed received MPDUs encoding rate
3272  * @delay_len: length of the delay histofram buffer
3273  * @delay: histogram of delays on MAC layer
3274  */
3275 struct sir_wifi_tx {
3276 	uint32_t msdus;
3277 	uint32_t mpdus;
3278 	uint32_t ppdus;
3279 	uint32_t bytes;
3280 	uint32_t drops;
3281 	uint32_t drop_bytes;
3282 	uint32_t retries;
3283 	uint32_t failed;
3284 	uint32_t aggr_len;
3285 	uint32_t *mpdu_aggr_size;
3286 	uint32_t success_mcs_len;
3287 	uint32_t *success_mcs;
3288 	uint32_t fail_mcs_len;
3289 	uint32_t *fail_mcs;
3290 	uint32_t delay_len;
3291 	uint32_t *delay;
3292 };
3293 
3294 /**
3295  * struct sir_wifi_rx - per AC rx stats
3296  * @mpdus: number of RX packets on MAC layer
3297  * @bytes: bytes of RX packets on MAC layer
3298  * @ppdus: number of RX packets on PHY layer
3299  * @ppdu_bytes: bytes of RX packets on PHY layer
3300  * @mpdu_lost: number of discontinuity in seqnum
3301  * @mpdu_retry: number of RX packets flagged as retransmissions
3302  * @mpdu_dup: number of RX packets identified as duplicates
3303  * @mpdu_discard: number of RX packets discarded
3304  * @aggr_len: length of MPDU aggregation histogram buffer
3305  * @mpdu_aggr: histogram of MPDU aggregation size
3306  * @mcs_len: length of mcs histogram buffer
3307  * @mcs: histogram of encoding rate.
3308  */
3309 struct sir_wifi_rx {
3310 	uint32_t mpdus;
3311 	uint32_t bytes;
3312 	uint32_t ppdus;
3313 	uint32_t ppdu_bytes;
3314 	uint32_t mpdu_lost;
3315 	uint32_t mpdu_retry;
3316 	uint32_t mpdu_dup;
3317 	uint32_t mpdu_discard;
3318 	uint32_t aggr_len;
3319 	uint32_t *mpdu_aggr;
3320 	uint32_t mcs_len;
3321 	uint32_t *mcs;
3322 };
3323 
3324 /**
3325  * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
3326  * @type: WMM AC type
3327  * @tx_stats: pointer to TX stats
3328  * @rx_stats: pointer to RX stats
3329  */
3330 struct sir_wifi_ll_ext_wmm_ac_stats {
3331 	uint32_t type;
3332 	struct sir_wifi_tx *tx_stats;
3333 	struct sir_wifi_rx *rx_stats;
3334 };
3335 
3336 /**
3337  * struct sir_wifi_ll_ext_peer_stats - per peer stats
3338  * @peer_id: peer ID
3339  * @vdev_id: VDEV ID
3340  * @mac_address: MAC address
3341  * @sta_ps_inds: how many times STAs go to sleep
3342  * @sta_ps_durs: total sleep time of STAs (units in ms)
3343  * @rx_probe_reqs: number of probe requests received
3344  * @rx_oth_mgmts: number of other management frames received,
3345  *		  not including probe requests
3346  * @peer_signal_stat: signal stats
3347  * @ac_stats: WMM BE/BK/VI/VO stats
3348  */
3349 struct sir_wifi_ll_ext_peer_stats {
3350 	uint32_t peer_id;
3351 	uint32_t vdev_id;
3352 	tSirMacAddr mac_address;
3353 	uint32_t sta_ps_inds;
3354 	uint32_t sta_ps_durs;
3355 	uint32_t rx_probe_reqs;
3356 	uint32_t rx_oth_mgmts;
3357 	struct sir_wifi_peer_signal_stats peer_signal_stats;
3358 	struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
3359 };
3360 
3361 /**
3362  * struct sir_wifi_ll_ext_stats - link layer stats report
3363  * @trigger_cond_id:  Indicate what triggered this event.
3364  *	1: timeout. 2: threshold
3365  * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
3366  *	which exceeded the thresholds
3367  * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
3368  *	which exceeded the thresholds
3369  * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
3370  *	which exceeded the thresholds
3371  * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
3372  *	which exceeded the thresholds
3373  * @chan_cca_stats: channel CCA stats
3374  * @peer_signal_stats: peer signal stats
3375  * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
3376  * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
3377  * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
3378  * @tx_delay_array_len: length of delay stats buffer
3379  * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
3380  * @rx_mcs_array_len: length of RX mcs stats buffer
3381  * @peer_stats: peer stats
3382  * @cca: physical channel CCA stats
3383  * @stats: pointer to stats data buffer.
3384  *
3385  * Structure of the whole statistics is like this:
3386  *     ---------------------------------
3387  *     |      trigger_cond_i           |
3388  *     +-------------------------------+
3389  *     |      cca_chgd_bitmap          |
3390  *     +-------------------------------+
3391  *     |      sig_chgd_bitmap          |
3392  *     +-------------------------------+
3393  *     |      tx_chgd_bitmap           |
3394  *     +-------------------------------+
3395  *     |      rx_chgd_bitmap           |
3396  *     +-------------------------------+
3397  *     |      peer_num                 |
3398  *     +-------------------------------+
3399  *     |      channel_num              |
3400  *     +-------------------------------+
3401  *     |      tx_mpdu_aggr_array_len   |
3402  *     +-------------------------------+
3403  *     |      tx_succ_mcs_array_len    |
3404  *     +-------------------------------+
3405  *     |      tx_fail_mcs_array_len    |
3406  *     +-------------------------------+
3407  *     |      tx_delay_array_len       |
3408  *     +-------------------------------+
3409  *     |      rx_mpdu_aggr_array_len   |
3410  *     +-------------------------------+
3411  *     |      rx_mcs_array_len         |
3412  *     +-------------------------------+
3413  *     |      pointer to CCA stats     |
3414  *     +-------------------------------+
3415  *     |      pointer to peer stats    |
3416  *     +-------------------------------+
3417  *     |      CCA stats                |
3418  *     +-------------------------------+
3419  *     |      peer_stats               |----+
3420  *     +-------------------------------+    |
3421  *     |      per peer signals stats   |<---+
3422  *     |        peer0 ~ peern          |    |
3423  *     +-------------------------------+    |
3424  *     | TX aggr/mcs parameters array  |    |
3425  *     | Length of this buffer is      |    |
3426  *     | configurable for user layer.  |<-+ |
3427  *     +-------------------------------+  | |
3428  *     |      per peer tx stats        |--+ |
3429  *     |         BE                    | <--+
3430  *     |         BK                    |    |
3431  *     |         VI                    |    |
3432  *     |         VO                    |    |
3433  *     +-------------------------------+    |
3434  *     | TX aggr/mcs parameters array  |    |
3435  *     | Length of this buffer is      |    |
3436  *     | configurable for user layer.  |<-+ |
3437  *     +-------------------------------+  | |
3438  *     |      peer peer rx stats       |--+ |
3439  *     |         BE                    | <--+
3440  *     |         BE                    |
3441  *     |         BK                    |
3442  *     |         VI                    |
3443  *     |         VO                    |
3444  *     ---------------------------------
3445  */
3446 struct sir_wifi_ll_ext_stats {
3447 	uint32_t trigger_cond_id;
3448 	uint32_t cca_chgd_bitmap;
3449 	uint32_t sig_chgd_bitmap;
3450 	uint32_t tx_chgd_bitmap;
3451 	uint32_t rx_chgd_bitmap;
3452 	uint8_t peer_num;
3453 	uint8_t channel_num;
3454 	uint32_t tx_mpdu_aggr_array_len;
3455 	uint32_t tx_succ_mcs_array_len;
3456 	uint32_t tx_fail_mcs_array_len;
3457 	uint32_t tx_delay_array_len;
3458 	uint32_t rx_mpdu_aggr_array_len;
3459 	uint32_t rx_mcs_array_len;
3460 	struct sir_wifi_ll_ext_peer_stats *peer_stats;
3461 	struct sir_wifi_chan_cca_stats *cca;
3462 	uint8_t stats[];
3463 };
3464 
3465 /**
3466  * struct sir_channel_cca_threshold - threshold for channel CCA
3467  * @idle_time: idle time, no TX, no RX, no interference
3468  * @tx_time: time transmitting packets
3469  * @rx_in_bss_time: time receiving packets in current BSSs
3470  * @rx_out_bss_time: time receiving packets not in current BSSs
3471  * @rx_busy_time: time interference detected
3472  * @rx_in_bad_cond_time: receiving packets with errors
3473  * @tx_in_bad_cond_time: time transmitted packets not been ACKed
3474  * @wlan_not_avail_time: wlan card cannot work
3475  */
3476 struct sir_channel_cca_threshold {
3477 	uint32_t idle_time;
3478 	uint32_t tx_time;
3479 	uint32_t rx_in_bss_time;
3480 	uint32_t rx_out_bss_time;
3481 	uint32_t rx_busy_time;
3482 	uint32_t rx_in_bad_cond_time;
3483 	uint32_t tx_in_bad_cond_time;
3484 	uint32_t wlan_not_avail_time;
3485 };
3486 
3487 /**
3488  * struct sir_signal_threshold - threshold for per peer sigbal
3489  * @snr: signal to noise rate
3490  * @nf: noise floor
3491  */
3492 struct sir_signal_threshold {
3493 	uint32_t snr;
3494 	uint32_t nf;
3495 };
3496 
3497 /**
3498  * struct sir_tx_threshold - threshold for TX
3499  * @msdu: TX MSDUs on MAC layer
3500  * @mpdu: TX MPDUs on MAC layer
3501  * @ppdu: TX PPDUs on MAC layer
3502  * @bytes: TX bytes on MAC layer
3503  * @msdu_drop: drooped MSDUs
3504  * @byte_drop: dropped Bytes
3505  * @mpdu_retry: MPDU not acked
3506  * @ppdu_fail: PPDUs which received no block ack
3507  * @aggregation: aggregation size
3508  * @succ_mcs: histogram of encoding rate for acked PPDUs
3509  * @fail_mcs: histogram of encoding rate for no-acked PPDUs
3510  */
3511 struct sir_tx_threshold {
3512 	uint32_t msdu;
3513 	uint32_t mpdu;
3514 	uint32_t ppdu;
3515 	uint32_t bytes;
3516 	uint32_t msdu_drop;
3517 	uint32_t byte_drop;
3518 	uint32_t mpdu_retry;
3519 	uint32_t mpdu_fail;
3520 	uint32_t ppdu_fail;
3521 	uint32_t aggregation;
3522 	uint32_t succ_mcs;
3523 	uint32_t fail_mcs;
3524 	uint32_t delay;
3525 };
3526 
3527 /**
3528  * struct sir_rx_threshold - threshold for RX
3529  * @mpdu: RX MPDUs on MAC layer
3530  * @bytes: RX bytes on MAC layer
3531  * @ppdu: RX PPDU on PHY layer
3532  * @ppdu_bytes: RX bytes on PHY layer
3533  * @disorder: discontinuity in seqnum
3534  * @mpdu_retry: MPDUs flagged as retry
3535  * @mpdu_dup: MPDUs identified as duplicated
3536  * @aggregation: aggregation size
3537  * @mcs: histogram of encoding rate for PPDUs
3538  * @ps_inds: power save indication
3539  * @ps_durs: total time in power save
3540  * @probe_reqs: probe request received
3541  * @other_mgmt: other MGMT frames received
3542  */
3543 struct sir_rx_threshold {
3544 	uint32_t mpdu;
3545 	uint32_t bytes;
3546 	uint32_t ppdu;
3547 	uint32_t ppdu_bytes;
3548 	uint32_t disorder;
3549 	uint32_t mpdu_lost;
3550 	uint32_t mpdu_retry;
3551 	uint32_t mpdu_dup;
3552 	uint32_t mpdu_discard;
3553 	uint32_t aggregation;
3554 	uint32_t mcs;
3555 	uint32_t ps_inds;
3556 	uint32_t ps_durs;
3557 	uint32_t probe_reqs;
3558 	uint32_t other_mgmt;
3559 };
3560 
3561 /**
3562  * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
3563  * @period: MAC counter indication period (unit in ms)
3564  * @enable: if threshold mechanism is enabled or disabled
3565  * @enable_bitmap: whether dedicated threshold is enabed.
3566  *     Every MAC counter has a dedicated threshold. If the dedicated
3567  *     threshold is not set in the bitmap, global threshold will take
3568  *     effect.
3569  * @global: whether clobal threshold is enabled.
3570  *     When both global and dedicated threshold are disabled, MAC counter
3571  *     will indicate stats periodically.
3572  * @global_threshold: global threshold value
3573  * @cca_bitmap: bitmap for CCA.
3574  *     Bit0: idle time
3575  *     Bit1: tx time
3576  *     Bit2: RX in BSS
3577  *     Bit3: RX out of BSS
3578  *     Bit4: medium busy
3579  *     Bit5: RX bad
3580  *     Bit6: TX bad
3581  *     Bit7: WLAN card not available
3582  * @signal_bitmap:
3583  *     Bit0: Per channel SNR counter
3584  *     Bit1: Per channel noise floor counter
3585  * @tx_bitmap:  bitmap for TX counters
3586  *     Bit0: TX counter unit in MSDU
3587  *     Bit1: TX counter unit in MPDU
3588  *     Bit2: TX counter unit in PPDU
3589  *     Bit3: TX counter unit in byte
3590  *     Bit4: Dropped MSDUs
3591  *     Bit5: Dropped Bytes
3592  *     Bit6: MPDU retry counter
3593  *     Bit7: MPDU failure counter
3594  *     Bit8: PPDU failure counter
3595  *     Bit9: MPDU aggregation counter
3596  *     Bit10: MCS counter for ACKed MPDUs
3597  *     Bit11: MCS counter for Failed MPDUs
3598  *     Bit12: TX Delay counter
3599  * @rx_bitmap:bitmap for RX counters
3600  *     Bit0: MAC RX counter unit in MPDU
3601  *     Bit1: MAC RX counter unit in byte
3602  *     Bit2: PHY RX counter unit in PPDU
3603  *     Bit3: PHY RX counter unit in byte
3604  *     Bit4: Disorder counter
3605  *     Bit5: Retry counter
3606  *     Bit6: Duplication counter
3607  *     Bit7: Discard counter
3608  *     Bit8: MPDU aggregation size counter
3609  *     Bit9: MCS counter
3610  *     Bit10: Peer STA power state change (wake to sleep) counter
3611  *     Bit11: Peer STA power save counter, total time in PS mode
3612  *     Bit12: Probe request counter
3613  *     Bit13: Other management frames counter
3614  * @cca_thresh: CCA threshold
3615  * @signal_thresh: signal threshold
3616  * @tx_thresh: TX threshold
3617  * @rx_thresh: RX threshold
3618  *
3619  * Generally, Link layer statistics is reported periodically. But if the
3620  * variation of one stats of compared to the previous notification exceeds
3621  * a threshold, FW will report the new stats immediately.
3622  * This structure contains threshold for different counters.
3623  */
3624 struct sir_ll_ext_stats_threshold {
3625 	uint32_t period;
3626 	uint32_t enable;
3627 	uint32_t enable_bitmap;
3628 	uint32_t global;
3629 	uint32_t global_threshold;
3630 	uint32_t cca_bitmap;
3631 	uint32_t signal_bitmap;
3632 	uint32_t tx_bitmap;
3633 	uint32_t rx_bitmap;
3634 	struct sir_channel_cca_threshold cca;
3635 	struct sir_signal_threshold signal;
3636 	struct sir_tx_threshold tx;
3637 	struct sir_rx_threshold rx;
3638 };
3639 
3640 #define LL_STATS_MIN_PERIOD          10
3641 #define LL_STATS_INVALID_PERIOD      0xFFFFFFFF
3642 
3643 /* Result ID for LL stats extension */
3644 #define WMI_LL_STATS_EXT_PS_CHG             0x00000100
3645 #define WMI_LL_STATS_EXT_TX_FAIL            0x00000200
3646 #define WMI_LL_STATS_EXT_MAC_COUNTER        0x00000400
3647 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
3648 
3649 typedef struct sAniGetLinkStatus {
3650 	uint16_t msgType;       /* message type is same as the request type */
3651 	uint16_t msgLen;        /* length of the entire request */
3652 	uint8_t linkStatus;
3653 	uint8_t sessionId;
3654 } tAniGetLinkStatus, *tpAniGetLinkStatus;
3655 
3656 /**
3657  * struct sir_lost_link_info - lost link information structure.
3658  *
3659  * @vdev_id: vdev_id from WMA. some modules call sessionId.
3660  * @rssi: rssi at disconnection time.
3661  *
3662  * driver uses this structure to communicate information collected at
3663  * disconnection time.
3664  */
3665 struct sir_lost_link_info {
3666 	uint32_t vdev_id;
3667 	int32_t rssi;
3668 };
3669 
3670 /* find the size of given member within a structure */
3671 #ifndef member_size
3672 #define member_size(type, member) (sizeof(((type *)0)->member))
3673 #endif
3674 
3675 #define RTT_INVALID                     0x00
3676 #define RTT_TIMING_MEAS_CAPABILITY      0x01
3677 #define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
3678 #define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
3679 
3680 /* number of neighbor reports that we can handle in Neighbor Report Response */
3681 #define MAX_SUPPORTED_NEIGHBOR_RPT 15
3682 
3683 /**
3684  * struct sir_stats_avg_factor
3685  * @vdev_id: session id
3686  * @stats_avg_factor: average factor
3687  */
3688 struct sir_stats_avg_factor {
3689 	uint8_t vdev_id;
3690 	uint16_t stats_avg_factor;
3691 };
3692 
3693 /**
3694  * struct sir_guard_time_request
3695  * @vdev_id: session id
3696  * @guard_time: guard time
3697  */
3698 struct sir_guard_time_request {
3699 	uint8_t vdev_id;
3700 	uint32_t guard_time;
3701 };
3702 
3703 /* Max number of rates allowed in Supported Rates IE */
3704 #define MAX_NUM_SUPPORTED_RATES (8)
3705 
3706 /**
3707  * struct rssi_breach_event - rssi breached event structure
3708  * @request_id: request id
3709  * @session_id: session id
3710  * @curr_rssi: current rssi
3711  * @curr_bssid: current bssid
3712  */
3713 struct rssi_breach_event {
3714 	uint32_t     request_id;
3715 	uint32_t     session_id;
3716 	int8_t       curr_rssi;
3717 	struct qdf_mac_addr  curr_bssid;
3718 };
3719 
3720 /**
3721  * struct chip_pwr_save_fail_detected_params - chip power save failure detected
3722  * event params
3723  * @failure_reason_code:failure reason code
3724  * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
3725  */
3726 struct chip_pwr_save_fail_detected_params {
3727 	uint32_t     failure_reason_code;
3728 	uint32_t     wake_lock_bitmap[4];
3729 };
3730 
3731 #define MAX_NUM_FW_SEGMENTS 4
3732 
3733 /**
3734  * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
3735  * by default to the probe request
3736  */
3737 #define DEFAULT_SCAN_IE_ID 256
3738 
3739  /* MAX_DEFAULT_SCAN_IE_LEN - Maximum length of Default Scan IE's */
3740 #define MAX_DEFAULT_SCAN_IE_LEN 2048
3741 
3742  /* Extended Capabilities IE header(IE Id + IE Length) length */
3743 #define EXT_CAP_IE_HDR_LEN 2
3744 
3745 /**
3746  * struct hdd_default_scan_ie - HDD default scan IE structure
3747  * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
3748  * @length: length of the struct hdd_default_scan_ie
3749  * @vdev_id: vdev_id
3750  * @ie_len: Default scan IE length
3751  * @ie_data: Pointer to default scan IE data
3752  */
3753 struct hdd_default_scan_ie {
3754 	uint16_t message_type;
3755 	uint16_t length;
3756 	uint16_t vdev_id;
3757 	uint16_t ie_len;
3758 	uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
3759 };
3760 
3761 /**
3762  * struct vdev_ie_info - IE info
3763  * @vdev_id - vdev for which the IE is being sent
3764  * @ie_id - ID of the IE
3765  * @length - length of the IE data
3766  * @band - indicates IE is intended for which band
3767  * @data - IE data
3768  *
3769  * This structure is used to store the IE information.
3770  */
3771 struct vdev_ie_info {
3772 	uint32_t vdev_id;
3773 	uint32_t ie_id;
3774 	uint32_t length;
3775 	uint32_t band;
3776 	uint8_t *data;
3777 };
3778 
3779 /**
3780  * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
3781  * @type - MSG type
3782  * @length - length of the message
3783  * @seesion_id - session_id for which the message is intended for
3784  *
3785  * This structure is used to pass send_extcap_ie msg from SME to PE
3786  */
3787 struct send_extcap_ie {
3788 	uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
3789 	uint16_t length;
3790 	uint8_t session_id;
3791 };
3792 
3793 typedef void (*antenna_mode_cb)(uint32_t status, void *context);
3794 
3795 /**
3796  * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
3797  * @vdev_id - vdev id
3798  * @cfg - enable/disable
3799  * @frm_len - frame length
3800  * @data - frame data
3801  *
3802  * This structure is used to cfg action frame tb ppdu.
3803  */
3804 struct cfg_action_frm_tb_ppdu {
3805 	uint8_t vdev_id;
3806 	uint8_t cfg;
3807 	uint8_t frm_len;
3808 	uint8_t *data;
3809 };
3810 
3811 /**
3812  * struct sir_nss_update_request
3813  * @msgType: nss update msg type
3814  * @msgLen: length of the msg
3815  * @new_nss: new spatial stream value
3816  * @ch_width: channel width - optional
3817  * @vdev_id: session id
3818  */
3819 struct sir_nss_update_request {
3820 	uint16_t msgType;
3821 	uint16_t msgLen;
3822 	uint8_t  new_nss;
3823 	uint8_t ch_width;
3824 	uint32_t vdev_id;
3825 };
3826 
3827 /**
3828  * struct sir_sap_ch_width_update
3829  * @msgType: ch_width update msg type
3830  * @msgLen: length of the msg
3831  * @ch_width: channel width
3832  * @vdev_id: vdev id
3833  */
3834 struct sir_sap_ch_width_update {
3835 	uint16_t msgType;
3836 	uint16_t msgLen;
3837 	enum phy_ch_width ch_width;
3838 	uint32_t vdev_id;
3839 };
3840 
3841 /**
3842  * enum sir_bcn_update_reason: bcn update reason
3843  * @REASON_DEFAULT: reason default
3844  * @REASON_NSS_UPDATE: If NSS is updated
3845  * @REASON_CONFIG_UPDATE: Config update
3846  * @REASON_SET_HT2040: HT2040 update
3847  * @REASON_COLOR_CHANGE: Color change
3848  * @REASON_CHANNEL_SWITCH: channel switch
3849  * @REASON_MLO_IE_UPDATE: mlo ie update
3850  * @REASON_RNR_UPDATE: SAP is changed, notify co-located SAP
3851  */
3852 enum sir_bcn_update_reason {
3853 	REASON_DEFAULT = 0,
3854 	REASON_NSS_UPDATE = 1,
3855 	REASON_CONFIG_UPDATE = 2,
3856 	REASON_SET_HT2040 = 3,
3857 	REASON_COLOR_CHANGE = 4,
3858 	REASON_CHANNEL_SWITCH = 5,
3859 	REASON_MLO_IE_UPDATE = 6,
3860 	REASON_RNR_UPDATE = 7,
3861 	REASON_CH_WIDTH_UPDATE = 8,
3862 };
3863 
3864 /**
3865  * struct sir_bcn_update_rsp
3866  *
3867  * @vdev_id: session for which bcn was updated
3868  * @reason: bcn update reason
3869  * @status: status of the beacon sent to FW
3870  */
3871 struct sir_bcn_update_rsp {
3872 	uint8_t vdev_id;
3873 	enum sir_bcn_update_reason reason;
3874 	QDF_STATUS status;
3875 };
3876 
3877 struct sir_qos_params {
3878 	uint8_t aifsn;
3879 	uint8_t cwmin;
3880 	uint8_t cwmax;
3881 };
3882 
3883 /**
3884  * struct sir_sme_ext_change_chan_req - channel change request
3885  * @message_type: message id
3886  * @length: msg length
3887  * @new_channel: new channel
3888  * @vdev_id: vdev id
3889  */
3890 struct sir_sme_ext_cng_chan_req {
3891 	uint16_t  message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
3892 	uint16_t  length;
3893 	uint32_t  new_ch_freq;
3894 	uint8_t   vdev_id;
3895 };
3896 
3897 #define IGNORE_NUD_FAIL                      0
3898 #define DISCONNECT_AFTER_NUD_FAIL            1
3899 #define ROAM_AFTER_NUD_FAIL                  2
3900 #define DISCONNECT_AFTER_ROAM_FAIL           3
3901 
3902 /**
3903  * struct sir_sme_ext_change_chan_ind.
3904  * @session_id: session id
3905  * @new_chan_freq: new channel frequency to change to
3906  */
3907 struct sir_sme_ext_cng_chan_ind {
3908 	uint8_t  session_id;
3909 	uint32_t  new_chan_freq;
3910 };
3911 
3912 /**
3913  * struct stsf - the basic stsf structure
3914  *
3915  * @vdev_id: vdev id
3916  * @tsf_low: low 32bits of tsf
3917  * @tsf_high: high 32bits of tsf
3918  * @soc_timer_low: low 32bits of synced SOC timer value
3919  * @soc_timer_high: high 32bits of synced SOC timer value
3920  * @global_tsf_low: low 32bits of tsf64
3921  * @global_tsf_high: high 32bits of tsf64
3922  * @mac_id: MAC identifier
3923  * @mac_id_valid: Indicate if mac_id is valid or not
3924  * @tsf_id: TSF-ID corresponding to the TSF value
3925  * @tsf_id_valid: flag indicating whether TSD-ID is valid
3926  *
3927  * Driver uses this structure to store the tsf information.
3928  */
3929 struct stsf {
3930 	uint32_t vdev_id;
3931 	uint32_t tsf_low;
3932 	uint32_t tsf_high;
3933 	uint32_t soc_timer_low;
3934 	uint32_t soc_timer_high;
3935 	uint32_t global_tsf_low;
3936 	uint32_t global_tsf_high;
3937 	uint32_t mac_id;
3938 	uint32_t mac_id_valid;
3939 	uint32_t tsf_id;
3940 	uint32_t tsf_id_valid;
3941 };
3942 
3943 /* ie + extn ie */
3944 #define SIR_BCN_FLT_MAX_ELEMS_IE_LIST (8 + 8)
3945 /**
3946  * struct beacon_filter_param - parameters for beacon filtering
3947  * @vdev_id: vdev id
3948  * @ie_map: bitwise map of IEs that needs to be filtered
3949  *
3950  */
3951 struct beacon_filter_param {
3952 	uint32_t   vdev_id;
3953 	uint32_t   ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
3954 };
3955 
3956 /**
3957  * struct adaptive_dwelltime_params - the adaptive dwelltime params
3958  * @vdev_id: vdev id
3959  * @is_enabled: Adaptive dwell time is enabled/disabled
3960  * @dwelltime_mode: global default adaptive dwell mode
3961  * @lpf_weight: weight to calculate the average low pass
3962  * filter for channel congestion
3963  * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
3964  * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
3965  *
3966  */
3967 struct adaptive_dwelltime_params {
3968 	uint32_t  vdev_id;
3969 	bool      is_enabled;
3970 	uint8_t   dwelltime_mode;
3971 	uint8_t   lpf_weight;
3972 	uint8_t   passive_mon_intval;
3973 	uint8_t   wifi_act_threshold;
3974 };
3975 
3976 /**
3977  * enum obss_ht40_scancmd_type - obss scan command type
3978  * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
3979  * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
3980  */
3981 enum obss_ht40_scancmd_type {
3982 	HT40_OBSS_SCAN_PARAM_START,
3983 	HT40_OBSS_SCAN_PARAM_UPDATE
3984 };
3985 
3986 /**
3987  * struct sme_obss_ht40_scanind_msg - sme obss scan params
3988  * @msg_type: message type
3989  * @length: message length
3990  * @mac_addr: mac address
3991  */
3992 struct sme_obss_ht40_scanind_msg {
3993 	uint16_t               msg_type;
3994 	uint16_t               length;
3995 	struct qdf_mac_addr    mac_addr;
3996 };
3997 
3998 /**
3999  * struct obss_ht40_scanind - ht40 obss scan request
4000  * @cmd: message type
4001  * @scan_type: message length
4002  * @obss_passive_dwelltime: obss passive dwelltime
4003  * @obss_active_dwelltime: obss active dwelltime
4004  * @obss_width_trigger_interval: scan interval
4005  * @obss_passive_total_per_channel: total passive scan time per channel
4006  * @obss_active_total_per_channel: total active scan time per channel
4007  * @bsswidth_ch_trans_delay: OBSS transition delay time
4008  * @obss_activity_threshold: OBSS activity threshold
4009  * @self_sta_idx: self sta identification
4010  * @bss_id: BSS index
4011  * @fortymhz_intolerent: Ht40mhz intolerance
4012  * @channel_count: channel count
4013  * @chan_freq_list: List of channel frequencies in MHz
4014  * @current_operatingclass: operating class
4015  * @iefield_len: ie's length
4016  * @iefiled: ie's information
4017  */
4018 struct obss_ht40_scanind {
4019 	enum obss_ht40_scancmd_type cmd;
4020 	enum eSirScanType scan_type;
4021 	/* In TUs */
4022 	uint16_t obss_passive_dwelltime;
4023 	uint16_t obss_active_dwelltime;
4024 	/* In seconds */
4025 	uint16_t obss_width_trigger_interval;
4026 	/* In TU's */
4027 	uint16_t obss_passive_total_per_channel;
4028 	uint16_t obss_active_total_per_channel;
4029 	uint16_t bsswidth_ch_trans_delay;
4030 	uint16_t obss_activity_threshold;
4031 	uint8_t  self_sta_idx;
4032 	uint8_t bss_id;
4033 	uint8_t fortymhz_intolerent;
4034 	uint8_t channel_count;
4035 	uint32_t chan_freq_list[CFG_VALID_CHANNEL_LIST_LEN];
4036 	uint8_t current_operatingclass;
4037 	uint16_t iefield_len;
4038 	uint8_t  iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
4039 };
4040 
4041 /**
4042  * struct obss_scanparam - OBSS scan parameters
4043  * @obss_passive_dwelltime: message type
4044  * @obss_active_dwelltime: message length
4045  * @obss_width_trigger_interval: obss passive dwelltime
4046  * @obss_passive_total_per_channel: obss passive total scan time
4047  * @obss_active_total_per_channel: obss active total scan time
4048  * @bsswidth_ch_trans_delay: OBSS transition delay time
4049  * @obss_activity_threshold: OBSS activity threshold
4050  */
4051 struct obss_scanparam {
4052 	uint16_t obss_passive_dwelltime;
4053 	uint16_t obss_active_dwelltime;
4054 	uint16_t obss_width_trigger_interval;
4055 	uint16_t obss_passive_total_per_channel;
4056 	uint16_t obss_active_total_per_channel;
4057 	uint16_t bsswidth_ch_trans_delay;
4058 	uint16_t obss_activity_threshold;
4059 };
4060 
4061 /**
4062  * struct sir_apf_set_offload - set apf filter instructions
4063  * @session_id: session identifier
4064  * @version: host apf version
4065  * @filter_id: Filter ID for APF filter
4066  * @total_length: The total length of the full instruction
4067  *                total_length equal to 0 means reset
4068  * @current_offset: current offset, 0 means start a new setting
4069  * @current_length: Length of current @program
4070  * @program: APF instructions
4071  */
4072 struct sir_apf_set_offload {
4073 	uint8_t  session_id;
4074 	uint32_t version;
4075 	uint32_t filter_id;
4076 	uint32_t total_length;
4077 	uint32_t current_offset;
4078 	uint32_t current_length;
4079 	uint8_t  *program;
4080 };
4081 
4082 /**
4083  * struct sir_apf_offload_capabilities - get apf Capabilities
4084  * @apf_version: fw's implement version
4085  * @max_apf_filters: max filters that fw supports
4086  * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
4087  */
4088 struct sir_apf_get_offload {
4089 	uint32_t apf_version;
4090 	uint32_t max_apf_filters;
4091 	uint32_t max_bytes_for_apf_inst;
4092 };
4093 
4094 #ifdef WLAN_FEATURE_NAN
4095 /**
4096  * enum ndp_end_type - NDP end type
4097  * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
4098  * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
4099  * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
4100  *
4101  */
4102 enum ndp_end_type {
4103 	NDP_END_TYPE_UNSPECIFIED = 0x00,
4104 	NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
4105 	NDP_END_TYPE_OTA_FRAME = 0x02,
4106 };
4107 
4108 /**
4109  * enum ndp_end_reason_code - NDP end reason code
4110  * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
4111  * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
4112  * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
4113  *
4114  */
4115 enum ndp_end_reason_code {
4116 	NDP_END_REASON_UNSPECIFIED = 0x00,
4117 	NDP_END_REASON_INACTIVITY = 0x01,
4118 	NDP_END_REASON_PEER_DATA_END = 0x02,
4119 };
4120 
4121 /**
4122  * enum nan_status_type - NDP status type
4123  * @NDP_RSP_STATUS_SUCCESS: request was successful
4124  * @NDP_RSP_STATUS_ERROR: request failed
4125  */
4126 enum nan_status_type {
4127 	NDP_RSP_STATUS_SUCCESS = 0x00,
4128 	NDP_RSP_STATUS_ERROR = 0x01,
4129 };
4130 
4131 /**
4132  * enum nan_reason_code - NDP command rsp reason code value
4133  * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
4134  * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
4135  * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
4136  * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
4137  * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
4138  * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
4139  * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
4140  * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
4141  * @NDP_INVALID_APP_INFO_LEN: invalid app info length
4142  * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
4143  * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
4144  * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
4145  * @NDP_END_FAILED: ndp end failed
4146  * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
4147  * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
4148  */
4149 enum nan_reason_code {
4150 	NDP_UNSUPPORTED_CONCURRENCY = 9000,
4151 	NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
4152 	NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
4153 	NDP_DATA_INITIATOR_REQ_FAILED = 9003,
4154 	NDP_DATA_RESPONDER_REQ_FAILED = 9004,
4155 	NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
4156 	NDP_INVALID_NDP_INSTANCE_ID = 9006,
4157 	NDP_INVALID_RSP_CODE = 9007,
4158 	NDP_INVALID_APP_INFO_LEN = 9008,
4159 	NDP_NMF_REQ_FAIL = 9009,
4160 	NDP_NMF_RSP_FAIL = 9010,
4161 	NDP_NMF_CNF_FAIL = 9011,
4162 	NDP_END_FAILED = 9012,
4163 	NDP_NMF_END_REQ_FAIL = 9013,
4164 	/* 9500 onwards vendor specific error codes */
4165 	NDP_VENDOR_SPECIFIC_ERROR = 9500,
4166 };
4167 
4168 /**
4169  * struct ndi_create_rsp - ndi create response params
4170  * @status: request status
4171  * @reason: reason if any
4172  *
4173  */
4174 struct ndi_create_rsp {
4175 	uint32_t status;
4176 	uint32_t reason;
4177 	uint8_t sta_id;
4178 };
4179 
4180 /**
4181  * struct ndi_delete_rsp - ndi delete response params
4182  * @status: request status
4183  * @reason: reason if any
4184  *
4185  */
4186 struct ndi_delete_rsp {
4187 	uint32_t status;
4188 	uint32_t reason;
4189 };
4190 
4191 /**
4192  * struct peer_ndp_map  - mapping of NDP instances to peer to VDEV
4193  * @vdev_id: session id of the interface over which ndp is being created
4194  * @peer_ndi_mac_addr: peer NDI mac address
4195  * @num_active_ndp_sessions: number of active NDP sessions on the peer
4196  * @type: NDP end indication type
4197  * @reason_code: NDP end indication reason code
4198  * @ndp_instance_id: NDP instance ID
4199  *
4200  */
4201 struct peer_ndp_map {
4202 	uint32_t vdev_id;
4203 	struct qdf_mac_addr peer_ndi_mac_addr;
4204 	uint32_t num_active_ndp_sessions;
4205 	enum ndp_end_type type;
4206 	enum ndp_end_reason_code reason_code;
4207 	uint32_t ndp_instance_id;
4208 };
4209 
4210 #endif /* WLAN_FEATURE_NAN */
4211 
4212 /**
4213  * struct sir_p2p_lo_start - p2p listen offload start
4214  * @vdev_id: vdev identifier
4215  * @ctl_flags: control flag
4216  * @freq: p2p listen frequency
4217  * @period: listen offload period
4218  * @interval: listen offload interval
4219  * @count: number listen offload intervals
4220  * @device_types: device types
4221  * @dev_types_len: device types length
4222  * @probe_resp_tmplt: probe response template
4223  * @probe_resp_len: probe response template length
4224  */
4225 struct sir_p2p_lo_start {
4226 	uint32_t vdev_id;
4227 	uint32_t ctl_flags;
4228 	uint32_t freq;
4229 	uint32_t period;
4230 	uint32_t interval;
4231 	uint32_t count;
4232 	uint8_t  *device_types;
4233 	uint32_t dev_types_len;
4234 	uint8_t  *probe_resp_tmplt;
4235 	uint32_t probe_resp_len;
4236 };
4237 
4238 /**
4239  * struct sir_p2p_lo_event - P2P listen offload stop event
4240  * @vdev_id: vdev identifier
4241  * @reason_code: P2P listen offload stop reason
4242  */
4243 struct sir_p2p_lo_event {
4244 	uint32_t vdev_id;
4245 	uint32_t reason_code;
4246 };
4247 
4248 /**
4249  * struct sir_hal_pwr_dbg_cmd - unit test command parameters
4250  * @pdev_id: pdev id
4251  * @module_id: module id
4252  * @num_args: number of arguments
4253  * @args: arguments
4254  */
4255 struct sir_mac_pwr_dbg_cmd {
4256 	uint32_t pdev_id;
4257 	uint32_t module_id;
4258 	uint32_t num_args;
4259 	uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
4260 };
4261 
4262 /**
4263  * struct sme_send_disassoc_frm_req - send disassoc request frame
4264  * @msg_type: message type
4265  * @length: length of message
4266  * @vdev_id: vdev id
4267  * @peer_mac: peer mac address
4268  * @reason: reason for disassoc
4269  * @wait_for_ack: wait for acknowledgment
4270  **/
4271  struct sme_send_disassoc_frm_req {
4272 	uint16_t msg_type;
4273 	uint16_t length;
4274 	uint8_t vdev_id;
4275 	uint8_t peer_mac[6];
4276 	uint16_t reason;
4277 	uint8_t wait_for_ack;
4278  };
4279 
4280 /**
4281  * struct sme_update_access_policy_vendor_ie - update vendor ie and access
4282  * policy
4283  * @msg_type: message id
4284  * @msg_len: message length
4285  * @vdev_id: vdev id
4286  * @ie: vendor ie
4287  * @access_policy: access policy for vendor ie
4288  */
4289 struct sme_update_access_policy_vendor_ie {
4290 	uint16_t msg_type;
4291 	uint16_t length;
4292 	uint32_t vdev_id;
4293 	uint8_t ie[WLAN_MAX_IE_LEN + 2];
4294 	uint8_t access_policy;
4295 };
4296 
4297 /**
4298  * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
4299  * @session_id: Session id
4300  * @tx_fail_cnt_threshold: Tx failure count to do disconnect
4301  */
4302 struct sme_tx_fail_cnt_threshold {
4303 	uint8_t session_id;
4304 	uint32_t tx_fail_cnt_threshold;
4305 };
4306 
4307 /**
4308  * struct sme_short_retry_limit - transmission retry limit for short frames.
4309  * @session_id: Session id
4310  * @short_retry_limit: transmission retry limit for short frame.
4311  *
4312  */
4313 struct sme_short_retry_limit {
4314 	uint8_t session_id;
4315 	uint32_t short_retry_limit;
4316 };
4317 
4318 /**
4319  * struct sme_long_retry_limit - transmission retry limit for long frames
4320  * @session_id: Session id
4321  * @short_retry_limit: transmission retry limit for long frames.
4322  *
4323  */
4324 struct sme_long_retry_limit {
4325 	uint8_t session_id;
4326 	uint32_t long_retry_limit;
4327 };
4328 
4329 /**
4330  * struct sme_addba_accept - Allow/reject the addba request frame
4331  * @session_id: Session id
4332  * @addba_accept: Allow/reject the addba request frame
4333  */
4334 struct sme_addba_accept {
4335 	uint8_t session_id;
4336 	uint8_t addba_accept;
4337 };
4338 
4339 /**
4340  * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
4341  * @session_id: session Id.
4342  * @sta_inactivity_timeout: Timeout to disconnect STA after there
4343  * is no activity.
4344  */
4345 struct sme_sta_inactivity_timeout {
4346 	uint8_t session_id;
4347 	uint32_t sta_inactivity_timeout;
4348 };
4349 
4350 /**
4351  * struct sme_vdev_pause - Pause vdev for a defined time interval
4352  * @session_id: Session id
4353  * @vdev_pause_duration: vdev pause duration
4354  */
4355 struct sme_vdev_pause {
4356 	uint8_t session_id;
4357 	uint8_t vdev_pause_duration;
4358 };
4359 
4360 /*
4361  * struct wow_pulse_mode - WoW Pulse set cmd struct
4362  * @wow_pulse_enable: enable or disable this feature
4363  * @wow_pulse_pin: GPIO PIN for Pulse
4364  * @wow_pulse_interval_low: Pulse interval low
4365  * @wow_pulse_interval_high: Pulse interval high
4366  * @wow_pulse_repeat_count: Pulse repeat count
4367  * @wow_pulse_init_state: Pulse init level
4368  *
4369  * SME uses this structure to configure wow pulse info
4370  * and send it to WMA
4371  */
4372 struct wow_pulse_mode {
4373 	bool                       wow_pulse_enable;
4374 	uint8_t                    wow_pulse_pin;
4375 	uint16_t                   wow_pulse_interval_high;
4376 	uint16_t                   wow_pulse_interval_low;
4377 	uint32_t                   wow_pulse_repeat_count;
4378 	uint32_t                   wow_pulse_init_state;
4379 };
4380 
4381 
4382 /**
4383  * umac_send_mb_message_to_mac(): post message to umac
4384  * @msg: opaque message pointer
4385  *
4386  * Return: QDF status
4387  */
4388 QDF_STATUS umac_send_mb_message_to_mac(void *msg);
4389 
4390 /**
4391  * struct scan_chan_info - channel info
4392  * @freq: radio frequence
4393  * @cmd flag: cmd flag
4394  * @noise_floor: noise floor
4395  * @cycle_count: cycle count
4396  * @rx_clear_count: rx clear count
4397  * @tx_frame_count: TX frame count
4398  * @clock_freq: clock frequence MHZ
4399  * @cca_busy_subband_info: CCA busy for each possible 20Mhz subbands
4400  * of the wideband scan channel
4401  */
4402 struct scan_chan_info {
4403 	uint32_t freq;
4404 	uint32_t cmd_flag;
4405 	uint32_t noise_floor;
4406 	uint32_t cycle_count;
4407 	uint32_t rx_clear_count;
4408 	uint32_t tx_frame_count;
4409 	uint32_t clock_freq;
4410 	struct wide_band_scan_chan_info subband_info;
4411 };
4412 
4413 /**
4414  * enum wow_resume_trigger - resume trigger override setting values
4415  * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
4416  * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
4417  * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
4418  * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
4419  */
4420 enum wow_resume_trigger {
4421 	/* always first */
4422 	WOW_RESUME_TRIGGER_DEFAULT = 0,
4423 	WOW_RESUME_TRIGGER_HTC_WAKEUP,
4424 	WOW_RESUME_TRIGGER_GPIO,
4425 	/* always last */
4426 	WOW_RESUME_TRIGGER_COUNT
4427 };
4428 
4429 /**
4430  * enum wow_interface_pause - interface pause override setting values
4431  * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
4432  * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
4433  * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
4434  * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
4435  */
4436 enum wow_interface_pause {
4437 	/* always first */
4438 	WOW_INTERFACE_PAUSE_DEFAULT = 0,
4439 	WOW_INTERFACE_PAUSE_ENABLE,
4440 	WOW_INTERFACE_PAUSE_DISABLE,
4441 	/* always last */
4442 	WOW_INTERFACE_PAUSE_COUNT
4443 };
4444 
4445 /**
4446  * struct wow_enable_params - A collection of wow enable override parameters
4447  * @is_unit_test: true to notify fw this is a unit-test suspend
4448  * @interface_pause: used to override the interface pause indication sent to fw
4449  * @resume_trigger: used to force fw to use a particular resume method
4450  */
4451 struct wow_enable_params {
4452 	bool is_unit_test;
4453 	enum wow_interface_pause interface_pause;
4454 	enum wow_resume_trigger resume_trigger;
4455 };
4456 
4457 #define HE_LTF_1X	0
4458 #define HE_LTF_2X	1
4459 #define HE_LTF_4X	2
4460 
4461 #define HE_LTF_ALL	0x7
4462 #define HE_SGI_MASK	0xFF00
4463 
4464 #define AUTO_RATE_GI_400NS	8
4465 #define AUTO_RATE_GI_800NS	9
4466 #define AUTO_RATE_GI_1600NS	10
4467 #define AUTO_RATE_GI_3200NS	11
4468 
4469 #define AUTO_RATE_LDPC_DIS_BIT	16
4470 
4471 #define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
4472 	(set_val = (set_val & HE_LTF_ALL) | bit_mask)
4473 
4474 #define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
4475 	(set_val = (set_val & HE_SGI_MASK) | bit_mask)
4476 
4477 #define MSCS_OUI_TYPE "\x58"
4478 #define MSCS_OUI_SIZE 1
4479 
4480 #ifdef WLAN_FEATURE_11AX
4481 #define HE_CAP_OUI_TYPE "\x23"
4482 #define HE_CAP_OUI_SIZE 1
4483 #define HE_OP_OUI_TYPE "\x24"
4484 #define HE_OP_OUI_SIZE 1
4485 
4486 #define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
4487 #define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
4488 #define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
4489 #define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
4490 
4491 /* 3 bits for NSS and 4 bits for RU Index */
4492 #define HE_PPET_NSS_LEN 3
4493 #define HE_PEPT_RU_IDX_LEN 4
4494 #define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
4495 #define HE_PPET_SIZE 3
4496 #define HE_BYTE_SIZE 8
4497 
4498 struct ppet_hdr {
4499 	uint8_t nss:3;
4500 	uint8_t ru_idx_mask:4;
4501 	uint8_t remaining:1;
4502 };
4503 
4504 /* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
4505 #define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
4506 
4507 #define HE_MAX_PHY_CAP_SIZE 3
4508 
4509 #define HE_CH_WIDTH_GET_BIT(ch_wd, bit)      (((ch_wd) >> (bit)) & 1)
4510 #define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6)             \
4511 	((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) |  ((b3) << 3) | \
4512 	((b4) << 4) | ((b5) << 5) | ((b6) << 6))
4513 #define HE_CH_WIDTH_CLR_BIT(ch_wd, bit)      (((ch_wd) >> (bit)) & ~1)
4514 
4515 /*
4516  * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
4517  * +-----------------------------------------------------+
4518  * |  SS8  |  SS7  |  SS6  | SS5 | SS4 | SS3 | SS2 | SS1 |
4519  * +-----------------------------------------------------+
4520  * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
4521  * +-----------------------------------------------------+
4522  */
4523 #define HE_MCS_NSS_SHIFT(nss)                 (((nss) - 1) << 1)
4524 #define HE_MCS_MSK_4_NSS(nss)                 (3 << HE_MCS_NSS_SHIFT(nss))
4525 #define HE_MCS_INV_MSK_4_NSS(nss)             (~HE_MCS_MSK_4_NSS(nss))
4526 #define HE_GET_MCS_4_NSS(mcs_set, nss)             \
4527 	(((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
4528 #define HE_SET_MCS_4_NSS(mcs_set, mcs, nss)        \
4529 	(((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
4530 	((mcs) << HE_MCS_NSS_SHIFT(nss)))
4531 #define HE_MCS_IS_NSS_ENABLED(mcs_set, nss)        \
4532 	((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
4533 
4534 #define HE_MCS_ALL_DISABLED                   0xFFFF
4535 
4536 #define HE_MCS_0_7     0x0
4537 #define HE_MCS_0_9     0x1
4538 #define HE_MCS_0_11    0x2
4539 #define HE_MCS_DISABLE 0x3
4540 
4541 #define HE_6G_MIN_MPDU_START_SAPCE_BIT_POS 0
4542 #define HE_6G_MAX_AMPDU_LEN_EXP_BIT_POS 3
4543 #define HE_6G_MAX_MPDU_LEN_BIT_POS 6
4544 #define HE_6G_SMPS_BIT_POS 9
4545 #define HE_6G_RD_RESP_BIT_POS 11
4546 #define HE_6G_RX_ANT_PATTERN_BIT_POS 12
4547 #define HE_6G_TX_ANT_PATTERN_BIT_POS 13
4548 
4549 /*
4550  * Following formuala has been arrived at using karnaugh map and unit tested
4551  * with sample code. Take MCS for each NSS as 2 bit value first and solve for
4552  * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
4553  * K-Maps
4554  * MCS 1\MCS 2    00         01         10         11
4555  *    00          00         00         00         11
4556  *    01          00         01         01         11
4557  *    10          00         01         10         11
4558  *    11          11         11         11         11
4559  * if output MCS is o1o0, then as per K-map reduction:
4560  * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
4561  * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
4562  *
4563  * Please note: Calculating MCS intersection is 80211 protocol specific and
4564  * should be implemented in PE. WMA can use this macro rather than calling any
4565  * lim API to do the intersection.
4566  */
4567 #define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0)                \
4568 	(((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0))  |      \
4569 	(((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) |      \
4570 	(m1 & ~m0 & n1 & ~n0)) << 1))
4571 
4572 /* following takes MCS as 2 bits */
4573 #define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2)                       \
4574 	HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1),     \
4575 				      (mcs_2 >> 1), (mcs_2 & 1))
4576 
4577 /* following takes MCS as 16 bits */
4578 #define HE_INTERSECT_MCS(mcs_1, mcs_2)                             ( \
4579 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1),         \
4580 		HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
4581 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2),         \
4582 		HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
4583 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3),         \
4584 		HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
4585 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4),         \
4586 		HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
4587 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5),         \
4588 		HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
4589 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6),         \
4590 		HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
4591 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7),         \
4592 		HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
4593 	HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8),         \
4594 		HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
4595 
4596 /**
4597  * struct he_capability - to store 11ax HE capabilities
4598  * @phy_cap: HE PHY capabilities
4599  * @mac_cap: HE MAC capabilities
4600  * @mcs: HE MCS
4601  * @ppet: HE PPE threshold
4602  */
4603 struct he_capability {
4604 	uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
4605 	uint32_t mac_cap;
4606 	uint32_t mcs;
4607 	struct wlan_psoc_host_ppe_threshold ppet;
4608 };
4609 #endif
4610 
4611 #define HE_GET_NSS(mcs, nss)                                         \
4612 	do {                                                         \
4613 		(nss) = 0;                                           \
4614 		while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8)   \
4615 			(nss)++;                                     \
4616 	} while (0)
4617 
4618 #ifdef WLAN_FEATURE_11BE
4619 #define EHT_MAX_PHY_CAP_SIZE 3
4620 #define EHT_OP_OUI_TYPE "\x6a"
4621 #define EHT_OP_OUI_SIZE 1
4622 
4623 #define MLO_IE_OUI_TYPE "\x6b"
4624 #define MLO_IE_OUI_SIZE 1
4625 
4626 #define EHT_CAP_OUI_TYPE "\x6c"
4627 #define EHT_CAP_OUI_SIZE 1
4628 
4629 /**
4630  * struct eht_capability - to store 11be EHT capabilities
4631  * @phy_cap: EHT PHY capabilities
4632  * @mac_cap: EHT MAC capabilities
4633  * @mcs: EHT MCS
4634  */
4635 struct eht_capability {
4636 	uint32_t phy_cap[EHT_MAX_PHY_CAP_SIZE];
4637 	uint32_t mac_cap;
4638 	uint32_t mcs;
4639 };
4640 #endif
4641 /**
4642  * struct rsp_stats - arp packet stats
4643  * @arp_req_enqueue: fw tx count
4644  * @arp_req_tx_success: tx ack count
4645  * @arp_req_tx_failure: tx ack fail count
4646  * @arp_rsp_recvd: rx fw count
4647  * @out_of_order_arp_rsp_drop_cnt: out of order count
4648  * @dad_detected: dad detected
4649  * @connect_status: connection status
4650  * @ba_session_establishment_status: BA session status
4651  * @connect_stats_present: connectivity stats present or not
4652  * @tcp_ack_recvd: tcp syn ack's count
4653  * @icmpv4_rsp_recvd: icmpv4 responses count
4654  */
4655 struct rsp_stats {
4656 	uint32_t vdev_id;
4657 	uint32_t arp_req_enqueue;
4658 	uint32_t arp_req_tx_success;
4659 	uint32_t arp_req_tx_failure;
4660 	uint32_t arp_rsp_recvd;
4661 	uint32_t out_of_order_arp_rsp_drop_cnt;
4662 	uint32_t dad_detected;
4663 	uint32_t connect_status;
4664 	uint32_t ba_session_establishment_status;
4665 	bool connect_stats_present;
4666 	uint32_t tcp_ack_recvd;
4667 	uint32_t icmpv4_rsp_recvd;
4668 };
4669 
4670 /**
4671  * struct set_arp_stats_params - set/reset arp stats
4672  * @vdev_id: session id
4673  * @flag: enable/disable stats
4674  * @pkt_type: type of packet(1 - arp)
4675  * @ip_addr: subnet ipv4 address in case of encrypted packets
4676  * @pkt_type_bitmap: pkt bitmap
4677  * @tcp_src_port: tcp src port for pkt tracking
4678  * @tcp_dst_port: tcp dst port for pkt tracking
4679  * @icmp_ipv4: target ipv4 address to track ping packets
4680  * @reserved: reserved
4681  */
4682 struct set_arp_stats_params {
4683 	uint32_t vdev_id;
4684 	uint8_t flag;
4685 	uint8_t pkt_type;
4686 	uint32_t ip_addr;
4687 	uint32_t pkt_type_bitmap;
4688 	uint32_t tcp_src_port;
4689 	uint32_t tcp_dst_port;
4690 	uint32_t icmp_ipv4;
4691 	uint32_t reserved;
4692 };
4693 
4694 /**
4695  * struct get_arp_stats_params - get arp stats from firmware
4696  * @pkt_type: packet type(1 - ARP)
4697  * @vdev_id: session id
4698  */
4699 struct get_arp_stats_params {
4700 	uint8_t pkt_type;
4701 	uint32_t vdev_id;
4702 };
4703 
4704 typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
4705 				  int32_t rcpi, QDF_STATUS status);
4706 /**
4707  * struct sme_rcpi_req - structure for querying rcpi info
4708  * @session_id: session for which rcpi is required
4709  * @measurement_type: type of measurement from enum rcpi_measurement_type
4710  * @rcpi_callback: callback function to be invoked for rcpi response
4711  * @rcpi_context: context info for rcpi callback
4712  * @mac_addr: peer addr for which rcpi is required
4713  */
4714 struct sme_rcpi_req {
4715 	uint32_t session_id;
4716 	enum rcpi_measurement_type measurement_type;
4717 	sme_rcpi_callback rcpi_callback;
4718 	void *rcpi_context;
4719 	struct qdf_mac_addr mac_addr;
4720 };
4721 
4722 /*
4723  * @SCAN_REJECT_DEFAULT: default value
4724  * @CONNECTION_IN_PROGRESS: connection is in progress
4725  * @REASSOC_IN_PROGRESS: reassociation is in progress
4726  * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
4727  * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
4728  * @SAP_CONNECTION_IN_PROGRESS: SAP/P2P-GO is in middle of connection.
4729  * @NAN_ENABLE_DISABLE_IN_PROGRESS: NAN is in middle of enable/disable discovery
4730  */
4731 enum scan_reject_states {
4732 	SCAN_REJECT_DEFAULT = 0,
4733 	CONNECTION_IN_PROGRESS,
4734 	REASSOC_IN_PROGRESS,
4735 	EAPOL_IN_PROGRESS,
4736 	SAP_EAPOL_IN_PROGRESS,
4737 	SAP_CONNECTION_IN_PROGRESS,
4738 	NAN_ENABLE_DISABLE_IN_PROGRESS,
4739 };
4740 
4741 /**
4742  * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
4743  * @hole_cnt: num of holes detected
4744  * @hole_info_array: hole info
4745  */
4746 struct sir_sme_rx_aggr_hole_ind {
4747 	uint32_t hole_cnt;
4748 	uint32_t hole_info_array[];
4749 };
4750 
4751 /**
4752  * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
4753  * @rx_timeout_pri: reorder timeout for AC
4754  *                  rx_timeout_pri[0] : AC_VO
4755  *                  rx_timeout_pri[1] : AC_VI
4756  *                  rx_timeout_pri[2] : AC_BE
4757  *                  rx_timeout_pri[3] : AC_BK
4758  */
4759 struct sir_set_rx_reorder_timeout_val {
4760 	uint32_t rx_timeout_pri[4];
4761 };
4762 
4763 /**
4764  * struct sir_peer_set_rx_blocksize - set rx blocksize
4765  * @vdev_id: vdev id
4766  * @peer_macaddr: peer mac address
4767  * @rx_block_ack_win_limit: windows size limitation
4768  */
4769 struct sir_peer_set_rx_blocksize {
4770 	uint32_t vdev_id;
4771 	struct qdf_mac_addr peer_macaddr;
4772 	uint32_t rx_block_ack_win_limit;
4773 };
4774 
4775 /**
4776  * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
4777  * list
4778  * @node: Node pointer
4779  * @bssid: BSSID of the AP
4780  * @retry_delay: Retry delay received during last rejection in ms
4781  * @ expected_rssi: RSSI at which STA can initiate
4782  * @time_during_rejection: Timestamp during last rejection in millisec
4783  * @reject_reason: reason to add the BSSID to DLM
4784  * @source: Source of adding the BSSID to DLM
4785  * @original_timeout: original timeout sent by the AP
4786  * @received_time: Timestamp when the AP was added to the Denylist
4787  */
4788 struct sir_rssi_disallow_lst {
4789 	qdf_list_node_t node;
4790 	struct qdf_mac_addr bssid;
4791 	uint32_t retry_delay;
4792 	int8_t expected_rssi;
4793 	qdf_time_t time_during_rejection;
4794 	enum dlm_reject_ap_reason reject_reason;
4795 	enum dlm_reject_ap_source source;
4796 	uint32_t original_timeout;
4797 	qdf_time_t received_time;
4798 };
4799 
4800 /**
4801  * struct chain_rssi_result - chain rssi result
4802  * num_chains_valid: valid chain num
4803  * @chain_rssi: chain rssi result as dBm unit
4804  * @chain_evm: error vector magnitude
4805  * @ant_id: antenna id
4806  */
4807 #define CHAIN_MAX_NUM 8
4808 struct chain_rssi_result {
4809 	uint32_t num_chains_valid;
4810 	uint32_t chain_rssi[CHAIN_MAX_NUM];
4811 	int32_t chain_evm[CHAIN_MAX_NUM];
4812 	uint32_t ant_id[CHAIN_MAX_NUM];
4813 };
4814 
4815 /**
4816  * struct get_chain_rssi_req_params - get chain rssi req params
4817  * @peer_macaddr: specific peer mac address
4818  * @session_id: session id
4819  */
4820 struct get_chain_rssi_req_params {
4821 	struct qdf_mac_addr peer_macaddr;
4822 	uint8_t session_id;
4823 };
4824 
4825 /*
4826  * struct sir_limit_off_chan - limit off-channel command parameters
4827  * @vdev_id: vdev id
4828  * @is_tos_active: status of the traffic (active/inactive)
4829  * @max_off_chan_time: max allowed off channel time
4830  * @rest_time: home channel time
4831  * @skip_dfs_chans: skip dfs channels during scan
4832  */
4833 struct sir_limit_off_chan {
4834 	uint8_t vdev_id;
4835 	bool is_tos_active;
4836 	uint32_t max_off_chan_time;
4837 	uint32_t rest_time;
4838 	bool skip_dfs_chans;
4839 };
4840 
4841 typedef void (*roam_scan_stats_cb)(void *context,
4842 				   struct wmi_roam_scan_stats_res *res);
4843 
4844 /**
4845  * struct sir_roam_scan_stats - Stores roam scan context
4846  * @vdev_id: vdev id
4847  * @cb: callback to be invoked for roam scan stats response
4848  * @context: context of callback
4849  */
4850 struct sir_roam_scan_stats {
4851 	uint32_t vdev_id;
4852 	roam_scan_stats_cb cb;
4853 	void *context;
4854 };
4855 
4856 /**
4857  * struct sae_info - SAE info used for commit/confirm messages
4858  * @msg_type: Message type
4859  * @msg_len: length of message
4860  * @vdev_id: vdev id
4861  * @peer_mac_addr: peer MAC address
4862  * @ssid: SSID
4863  * @akm: key mgmt suite used
4864  */
4865 struct sir_sae_info {
4866 	uint16_t msg_type;
4867 	uint16_t msg_len;
4868 	uint32_t vdev_id;
4869 	struct qdf_mac_addr peer_mac_addr;
4870 	tSirMacSSid ssid;
4871 	uint32_t akm;
4872 };
4873 
4874 /**
4875  * struct sir_sae_msg - SAE msg used for message posting
4876  * @message_type: message type
4877  * @length: message length
4878  * @vdev_id: vdev id
4879  * @sae_status: SAE status, 0: Success, Non-zero: Failure.
4880  * @pmkid: PMKID derived as part of SAE authentication
4881  * @peer_mac_addr: peer MAC address
4882  * @result_code: This carries the reason of the SAE auth failure.
4883  *               Currently, SAE authentication failure may happen due to
4884  *               1. Authentication failure detected as part of SAE auth frame
4885  *                  exchanges and validation.
4886  *               2. Deauth received from AP while SAE authentication is in
4887  *                  progress.
4888  */
4889 struct sir_sae_msg {
4890 	uint16_t message_type;
4891 	uint16_t length;
4892 	uint16_t vdev_id;
4893 	uint8_t pmkid[PMKID_LEN];
4894 	uint8_t sae_status;
4895 	tSirMacAddr peer_mac_addr;
4896 	tSirResultCodes result_code;
4897 };
4898 
4899 #ifdef WLAN_FEATURE_MOTION_DETECTION
4900 /**
4901  * struct sir_md_evt - motion detection event status
4902  * @vdev_id: vdev id
4903  * @status: md event status
4904  */
4905 struct sir_md_evt {
4906 	uint8_t vdev_id;
4907 	uint32_t status;
4908 };
4909 
4910 /**
4911  * struct sir_md_bl_evt - motion detection baseline event values
4912  * @vdev_id: vdev id
4913  * @bl_baseline_value: baseline correlation value calculated during baselining
4914  * @bl_max_corr_reserved: max corr value obtained during baselining phase in %
4915  * @bl_min_corr_reserved: min corr value obtained during baselining phase in %
4916  */
4917 struct sir_md_bl_evt {
4918 	uint8_t vdev_id;
4919 	uint32_t bl_baseline_value;
4920 	uint32_t bl_max_corr_reserved;
4921 	uint32_t bl_min_corr_reserved;
4922 };
4923 #endif /* WLAN_FEATURE_MOTION_DETECTION */
4924 
4925 #ifdef WLAN_MWS_INFO_DEBUGFS
4926 /**
4927  * struct sir_get_mws_coex_info - Get MWS coex info
4928  * @vdev_id: vdev id
4929  * @cmd_id: wmi mws-coex command IDs
4930  */
4931 struct sir_get_mws_coex_info {
4932 	uint32_t vdev_id;
4933 	uint32_t cmd_id;
4934 };
4935 #endif /* WLAN_MWS_INFO_DEBUGFS */
4936 
4937 /*
4938  * struct sir_update_session_txq_edca_param
4939  * @message_type: SME message type
4940  * @length: size of struct sir_update_session_txq_edca_param
4941  * @vdev_id: vdev ID
4942  * @txq_edca_params: txq edca parameter to update
4943  */
4944 struct sir_update_session_txq_edca_param {
4945 	uint16_t message_type;
4946 	uint16_t length;
4947 	uint8_t vdev_id;
4948 	tSirMacEdcaParamRecord txq_edca_params;
4949 };
4950 
4951 /* struct channel_change_req - Change channel
4952  * request for SAP
4953  * @vdev_id: vdev id
4954  * @target_chan_freq: New channel frequency
4955  * @sec_ch_offset: second channel offset
4956  * @center_freq_seg0: channel center freq 0
4957  * @center_freq_seg1: channel center freq 1
4958  * @target_punc_bitmap: New channel puncturing bitmap
4959  * @dot11mode: dot11 mode
4960  * @nw_type: nw type
4961  * @cac_duration_ms:  cac duration in ms
4962  * @dfs_regdomain: dfs regdomain
4963  * @opr_rates: operational rates
4964  * @ext_rates: extended rates
4965  */
4966 struct channel_change_req {
4967 	uint8_t vdev_id;
4968 	uint32_t target_chan_freq;
4969 	uint8_t sec_ch_offset;
4970 	enum phy_ch_width ch_width;
4971 	uint8_t center_freq_seg0;
4972 	uint8_t center_freq_seg1;
4973 #ifdef WLAN_FEATURE_11BE
4974 	uint16_t target_punc_bitmap;
4975 #endif
4976 	uint32_t dot11mode;
4977 	tSirNwType nw_type;
4978 	uint32_t cac_duration_ms;
4979 	uint32_t dfs_regdomain;
4980 	tSirMacRateSet opr_rates;
4981 	tSirMacRateSet ext_rates;
4982 };
4983 
4984 /* struct start_bss_config - Start BSS
4985  * request configurations
4986  * @vdev_id: vdev id
4987  * @cmd_id: serialization command id
4988  * @ssId: ssid
4989  * @dtimPeriod: dtim period
4990  * @ssidHidden: hidden ssid parameter
4991  * @privacy: ssid privacy
4992  * @authType: authentication type
4993  * @rsnIE: RSN IE of the AP
4994  * @add_ie_params: additional IEs
4995  * @oper_ch_freq: operating frequency
4996  * @vht_channel_width: channel width
4997  * @center_freq_seg0: channel center freq 0
4998  * @center_freq_seg1: channel center freq 1
4999  * @sec_ch_offset: secondary channel offset
5000  * @wps_state: wps config
5001  * @dot11mode: dot11 mode
5002  * @nwType: nw type
5003  * @operationalRateSet: operational rates
5004  * @extendedRateSet: extended rates
5005  * @beacon_tx_rate: Tx rate for beacon
5006  * @cac_duration_ms: cac duration in ms
5007  * @dfs_regdomain: dfs regdomain
5008  */
5009 struct start_bss_config {
5010 	uint8_t vdev_id;
5011 	uint32_t cmd_id;
5012 	tSirMacSSid ssId;
5013 	uint16_t beaconInterval;
5014 	uint32_t dtimPeriod;
5015 	uint8_t ssidHidden;
5016 
5017 	uint8_t privacy;
5018 	tAniAuthType authType;
5019 	tSirRSNie rsnIE;
5020 	struct add_ie_params add_ie_params;
5021 
5022 	uint32_t oper_ch_freq;
5023 	uint8_t vht_channel_width;
5024 	uint8_t center_freq_seg0;
5025 	uint8_t center_freq_seg1;
5026 	uint8_t sec_ch_offset;
5027 
5028 	uint8_t wps_state;
5029 	uint8_t dot11mode;
5030 	tSirNwType nwType;
5031 
5032 	tSirMacRateSet operationalRateSet;
5033 	tSirMacRateSet extendedRateSet;
5034 	uint16_t beacon_tx_rate;
5035 	uint32_t cac_duration_ms;
5036 	uint32_t dfs_regdomain;
5037 };
5038 
5039 #endif /* __SIR_API_H */
5040