blob: 68ea680fb8f96c5094c9f02129fbf37e2c748f86 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05302 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080020 * This file sir_api.h contains definitions exported by
21 * Sirius software.
22 * Author: Chandra Modumudi
23 * Date: 04/16/2002
24 * History:-
25 * Date Modified by Modification Information
26 * --------------------------------------------------------------------
27 */
28
29#ifndef __SIR_API_H
30#define __SIR_API_H
31
Anurag Chouhan5de8d172016-07-13 14:44:28 +053032
33/* Take care to avoid redefinition of this type, if it is */
34/* already defined in "halWmmApi.h" */
35#if !defined(_HALMAC_WMM_API_H)
36typedef struct sAniSirGlobal *tpAniSirGlobal;
37#endif
38
Amar Singhale4f28ee2015-10-21 14:36:56 -070039#include "qdf_types.h"
Amar Singhale4f28ee2015-10-21 14:36:56 -070040#include "cds_regdomain.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include "sir_types.h"
42#include "sir_mac_prot_def.h"
43#include "ani_system_defs.h"
44#include "sir_params.h"
Naveen Rawat3b6068c2016-04-14 19:01:06 -070045#include "cds_regdomain.h"
Dustin Brown877a5a92016-11-17 13:56:52 -080046#include "wmi_unified.h"
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +053047#include "wmi_unified_param.h"
Zhang Qiana6e9c102016-12-22 16:47:24 +080048#include "ol_txrx_htt_api.h"
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -070049#include "wlan_reg_services_api.h"
Anurag Chouhan5de8d172016-07-13 14:44:28 +053050#include <dot11f.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080051#include "wlan_policy_mgr_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080052
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080053#define SIR_MAX_SUPPORTED_BSS 5
54
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080055#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
56
57/* / Max supported channel list */
58#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
59
60#define SIR_MDIE_ELEMENT_ID 54
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080061#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080062
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053063#define SIR_MAX_ELEMENT_ID 255
64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080065/* Max number of channels are 165, but to access 165th element of array,
66 *array of 166 is required.
67 */
68#define SIR_MAX_24G_5G_CHANNEL_RANGE 166
69#define SIR_BCN_REPORT_MAX_BSS_DESC 4
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#define SIR_PM_SLEEP_MODE 0
75#define SIR_PM_ACTIVE_MODE 1
76
77/* hidden SSID options */
78#define SIR_SCAN_NO_HIDDEN_SSID 0
79#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
80
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081#define SIR_IPV4_ADDR_LEN 4
82
83typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
84
85#define SIR_VERSION_STRING_LEN 64
86typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
87
88/* Periodic Tx pattern offload feature */
89#define PERIODIC_TX_PTRN_MAX_SIZE 1536
90#define MAXNUM_PERIODIC_TX_PTRNS 6
91#define WIFI_SCANNING_MAC_OUI_LENGTH 3
92
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080093/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
94#define MAX_VDEV_SUPPORTED 4
95
Manjeet Singhf82ed072016-07-08 11:40:00 +053096#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053097#define QOS_MAP_MAX_EX 21
98#define QOS_MAP_LEN_MIN 16
99#define QOS_MAP_LEN_MAX \
100 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530101#define NUM_CHAINS_MAX 2
102
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530103#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530104
105/* Maximum number of realms present in fils indication element */
106#define SIR_MAX_REALM_COUNT 7
107/* Realm length */
108#define SIR_REALM_LEN 2
109/* Cache ID length */
110#define CACHE_ID_LEN 2
111
Will Huang496b36c2017-07-11 16:38:50 +0800112/* Maximum peer station number query one time */
113#define MAX_PEER_STA 12
114
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800115/* Maximum number of peers for SAP */
116#define SIR_SAP_MAX_NUM_PEERS 32
117
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800118#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800119#define SIR_BTK_KEY_LEN 32
120#define SIR_KCK_KEY_LEN 16
121#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530122#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800123#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530124#define SIR_PMK_LEN 48
125#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800126#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800127#define SIR_UAPSD_BITOFFSET_ACVO 0
128#define SIR_UAPSD_BITOFFSET_ACVI 1
129#define SIR_UAPSD_BITOFFSET_ACBK 2
130#define SIR_UAPSD_BITOFFSET_ACBE 3
131
132#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
133#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
134#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
135#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
136#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800137
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800138#endif
139
140/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700141 * enum sir_roam_op_code - Operation to be done by the callback.
142 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
143 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700144 * @SIR_ROAMING_START: Firmware started roaming operation
145 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
146 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700147 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700148 */
149enum sir_roam_op_code {
150 SIR_ROAM_SYNCH_PROPAGATION = 1,
151 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700152 SIR_ROAMING_START,
153 SIR_ROAMING_ABORT,
154 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700155 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700156 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700157};
158/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800159 * Module ID definitions.
160 */
161enum {
162 SIR_BOOT_MODULE_ID = 1,
163 SIR_HAL_MODULE_ID = 0x10,
164 SIR_CFG_MODULE_ID = 0x12,
165 SIR_LIM_MODULE_ID,
166 SIR_ARQ_MODULE_ID,
167 SIR_SCH_MODULE_ID,
168 SIR_PMM_MODULE_ID,
169 SIR_MNT_MODULE_ID,
170 SIR_DBG_MODULE_ID,
171 SIR_DPH_MODULE_ID,
172 SIR_SYS_MODULE_ID,
173 SIR_SMS_MODULE_ID,
174};
175
176#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
177
178/**
179 * First and last module definition for logging utility
180 *
181 * NOTE: The following definitions need to be updated if
182 * the above list is changed.
183 */
184#define SIR_FIRST_MODULE_ID SIR_HAL_MODULE_ID
185#define SIR_LAST_MODULE_ID SIR_SMS_MODULE_ID
186
187/* Type declarations used by Firmware and Host software */
188
189/* Scan type enum used in scan request */
190typedef enum eSirScanType {
191 eSIR_PASSIVE_SCAN,
192 eSIR_ACTIVE_SCAN,
193 eSIR_BEACON_TABLE,
194} tSirScanType;
195
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530196/* Rsn Capabilities structure */
197struct rsn_caps {
198 uint16_t PreAuthSupported:1;
199 uint16_t NoPairwise:1;
200 uint16_t PTKSAReplayCounter:2;
201 uint16_t GTKSAReplayCounter:2;
202 uint16_t MFPRequired:1;
203 uint16_t MFPCapable:1;
204 uint16_t Reserved:8;
205};
206
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800207/* / Result codes Firmware return to Host SW */
208typedef enum eSirResultCodes {
209 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530210 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800211 eSIR_SME_INVALID_PARAMETERS = 500,
212 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
213 eSIR_SME_RESOURCES_UNAVAILABLE,
214 /* Unable to find a BssDescription */
215 eSIR_SME_SCAN_FAILED,
216 /* matching requested scan criteria */
217 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
218 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
219 eSIR_SME_REFUSED,
220 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
221 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
222 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
223 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
224 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
225 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
226 eSIR_SME_AUTH_REFUSED,
227 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
228 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
229 eSIR_SME_ASSOC_REFUSED,
230 eSIR_SME_REASSOC_REFUSED,
231 /* Recvd Deauth while join/pre-auth */
232 eSIR_SME_DEAUTH_WHILE_JOIN,
233 eSIR_SME_STA_NOT_AUTHENTICATED,
234 eSIR_SME_STA_NOT_ASSOCIATED,
235 eSIR_SME_ALREADY_JOINED_A_BSS,
236 /* Given in SME_SCAN_RSP msg */
237 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
238 /* that more SME_SCAN_RSP */
239 /* messages are following. */
240 /* SME_SCAN_RSP message with */
241 /* eSIR_SME_SUCCESS status */
242 /* code is the last one. */
243 /* Sent in SME_JOIN/REASSOC_RSP */
244 eSIR_SME_INVALID_ASSOC_RSP_RXED,
245 /* messages upon receiving */
246 /* invalid Re/Assoc Rsp frame. */
247 /* STOP BSS triggered by MIC failures: MAC software to
248 * disassoc all stations
249 */
250 eSIR_SME_MIC_COUNTER_MEASURES,
251 /* with MIC_FAILURE reason code and perform the stop bss operation */
252 /* didn't get rsp from peer within timeout interval */
253 eSIR_SME_ADDTS_RSP_TIMEOUT,
254 /* didn't get success rsp from HAL */
255 eSIR_SME_ADDTS_RSP_FAILED,
256 /* failed to send ch switch act frm */
257 eSIR_SME_CHANNEL_SWITCH_FAIL,
258 eSIR_SME_INVALID_STATE,
259 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
260 eSIR_SME_HAL_SCAN_INIT_FAILED,
261 /* SIR_HAL_END_SCAN_RSP returned failed status */
262 eSIR_SME_HAL_SCAN_END_FAILED,
263 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
264 eSIR_SME_HAL_SCAN_FINISH_FAILED,
265 /* Failed to send a message to HAL */
266 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
267 /* Failed to stop the bss */
268 eSIR_SME_STOP_BSS_FAILURE,
269 eSIR_SME_WOWL_ENTER_REQ_FAILED,
270 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800271 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
272 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800273 eSIR_SME_SEND_ACTION_FAIL,
274 eSIR_SME_DEAUTH_STATUS,
275 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800276 eSIR_SME_INVALID_SESSION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
278} tSirResultCodes;
279
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530280#ifdef WLAN_FEATURE_FILS_SK
281struct fils_join_rsp_params {
282 uint8_t *fils_pmk;
283 uint8_t fils_pmk_len;
284 uint8_t fils_pmkid[PMKID_LEN];
285 uint8_t kek[MAX_KEK_LEN];
286 uint8_t kek_len;
287 uint8_t tk[MAX_TK_LEN];
288 uint8_t tk_len;
289 uint8_t gtk_len;
290 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530291 struct qdf_mac_addr dst_mac;
292 struct qdf_mac_addr src_mac;
293 uint16_t hlp_data_len;
294 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530295};
296#endif
297
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800298#define RMENABLEDCAP_MAX_LEN 5
299
300struct rrm_config_param {
301 uint8_t rrm_enabled;
302 uint8_t max_randn_interval;
303 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
304};
305
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800306/*
307 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
308 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
309 * correct basic rates for setting response rates.
310 */
311#define IERATE_BASICRATE_MASK 0x80
312#define IERATE_RATE_MASK 0x7f
313#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
314
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530315const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700316/**
317 * struct sSirSupportedRates - stores rates/MCS supported
318 * @llbRates: 11b rates in unit of 500kbps
319 * @llaRates: 11a rates in unit of 500kbps
320 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
321 * bits 0-15 and 32 should be set.
322 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
323 * rate that the STA is able to receive, in unites of 1Mbps
324 * This value is derived from "Supported MCS Set field"
325 * inside the HT capability element.
326 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
327 * number of spacial streams
328 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
329 * able to receive
330 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
331 * each number of spacial streams
332 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
333 * able to transmit
334 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
335 * number of spacial streams
336 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
337 * number of spacial streams
338 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800339typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800340 uint16_t llbRates[SIR_NUM_11B_RATES];
341 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800342 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800345 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700348#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700349 uint16_t rx_he_mcs_map_lt_80;
350 uint16_t tx_he_mcs_map_lt_80;
351 uint16_t rx_he_mcs_map_160;
352 uint16_t tx_he_mcs_map_160;
353 uint16_t rx_he_mcs_map_80_80;
354 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700355#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356} tSirSupportedRates, *tpSirSupportedRates;
357
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800358typedef struct sSirRemainOnChnReq {
359 uint16_t messageType;
360 uint16_t length;
361 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530362 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363 uint8_t chnNum;
364 uint8_t phyMode;
365 uint32_t duration;
366 uint8_t isProbeRequestAllowed;
367 uint32_t scan_id;
368 uint8_t probeRspIe[1];
369} tSirRemainOnChnReq, *tpSirRemainOnChnReq;
370
371/**
372 * struct sir_roc_rsp - Structure to store the remain on channel response
373 * @message_type: Message Type
374 * @length: Message Length
375 * @session_id: SME session Id
376 * @scan_id : scan identifier
377 * @status: result status
378 */
379struct sir_roc_rsp {
380 uint16_t message_type;
381 uint16_t length;
382 uint8_t session_id;
383 uint32_t scan_id;
384 tSirResultCodes status;
385};
386
387typedef struct sSirRegisterMgmtFrame {
388 uint16_t messageType;
389 uint16_t length;
390 uint8_t sessionId;
391 bool registerFrame;
392 uint16_t frameType;
393 uint16_t matchLen;
394 uint8_t matchData[1];
395} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
396
397/* / Generic type for sending a response message */
398/* / with result code to host software */
399typedef struct sSirSmeRsp {
400 uint16_t messageType; /* eWNI_SME_*_RSP */
401 uint16_t length;
402 uint8_t sessionId; /* To support BT-AMP */
403 uint16_t transactionId; /* To support BT-AMP */
404 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700405 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406} tSirSmeRsp, *tpSirSmeRsp;
407
408/* / Definition for indicating all modules ready on STA */
409typedef struct sSirSmeReadyReq {
410 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
411 uint16_t length;
412 uint16_t transactionId;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800413 void *csr_roam_synch_cb;
414 void *pe_roam_synch_cb;
Sandeep Puligilla1426d612017-04-12 18:22:06 -0700415 void *sme_msg_cb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800416} tSirSmeReadyReq, *tpSirSmeReadyReq;
417
418/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800419 * struct s_sir_set_hw_mode - Set HW mode request
420 * @messageType: Message type
421 * @length: Length of the message
422 * @set_hw: Params containing the HW mode index and callback
423 */
424struct s_sir_set_hw_mode {
425 uint16_t messageType;
426 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800427 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800428};
429
430/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800431 * struct sir_set_dual_mac_cfg - Set Dual mac config request
432 * @message_type: Message type
433 * @length: Length of the message
434 * @set_dual_mac: Params containing the dual mac config and callback
435 */
436struct sir_set_dual_mac_cfg {
437 uint16_t message_type;
438 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800439 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800440};
441
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800442/**
443 * struct sir_antenna_mode_param - antenna mode param
444 * @num_tx_chains: Number of TX chains
445 * @num_rx_chains: Number of RX chains
446 * @reason: Reason for setting antenna mode
447 * @set_antenna_mode_resp: callback to set antenna mode command
448 */
449struct sir_antenna_mode_param {
450 uint32_t num_tx_chains;
451 uint32_t num_rx_chains;
452 void *set_antenna_mode_resp;
453};
454
455/**
456 * struct sir_set_antenna_mode - Set antenna mode request
457 * @message_type: Message type
458 * @length: Length of the message
459 * @set_antenna_mode: Params containing antenna mode params
460 */
461struct sir_set_antenna_mode {
462 uint16_t message_type;
463 uint16_t length;
464 struct sir_antenna_mode_param set_antenna_mode;
465};
466
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700467/**
468 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
469 *
470 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
471 * @eSIR_INFRA_AP_MODE: softAP mode
472 * @eSIR_IBSS_MODE: IBSS mode
473 * @eSIR_AUTO_MODE: Auto role
474 * @eSIR_MONITOR_MODE: Monitor mode
475 * @eSIR_NDI_MODE: NAN datapath mode
476 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800477typedef enum eSirBssType {
478 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700479 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800480 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800481 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700482 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700483 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800484 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
485} tSirBssType;
486
487/* / Power Capability info used in 11H */
488typedef struct sSirMacPowerCapInfo {
489 uint8_t minTxPower;
490 uint8_t maxTxPower;
491} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
492
493/* / Supported Channel info used in 11H */
494typedef struct sSirSupChnl {
495 uint8_t numChnl;
496 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
497} tSirSupChnl, *tpSirSupChnl;
498
499typedef enum eSirNwType {
500 eSIR_11A_NW_TYPE,
501 eSIR_11B_NW_TYPE,
502 eSIR_11G_NW_TYPE,
503 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800504 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800505 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800506 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
507} tSirNwType;
508
509/* / Definition for new iBss peer info */
510typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530511 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800512 uint16_t aid;
513} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
514
515/* HT configuration values */
516typedef struct sSirHtConfig {
517 /* Enable/Disable receiving LDPC coded packets */
518 uint32_t ht_rx_ldpc:1;
519 /* Enable/Disable TX STBC */
520 uint32_t ht_tx_stbc:1;
521 /* Enable/Disable RX STBC */
522 uint32_t ht_rx_stbc:2;
523 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700524 uint32_t ht_sgi20:1;
525 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800526 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530527} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800528
Sandeep Puligilla98917432016-06-10 13:50:28 -0700529/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700530 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700531 * @max_mpdu_len: MPDU length
532 * @supported_channel_widthset: channel width set
533 * @ldpc_coding: LDPC coding capability
534 * @shortgi80: short GI 80 support
535 * @shortgi160and80plus80: short Gi 160 & 80+80 support
536 * @tx_stbc; Tx STBC cap
537 * @tx_stbc: Rx STBC cap
538 * @su_beam_former: SU beam former cap
539 * @su_beam_formee: SU beam formee cap
540 * @csnof_beamformer_antSup: Antenna support for beamforming
541 * @num_soundingdim: Sound dimensions
542 * @mu_beam_former: MU beam former cap
543 * @mu_beam_formee: MU beam formee cap
544 * @vht_txops: TXOP power save
545 * @htc_vhtcap: HTC VHT capability
546 * @max_ampdu_lenexp: AMPDU length
547 * @vht_link_adapt: VHT link adapatation capable
548 * @rx_antpattern: Rx Antenna pattern
549 * @tx_antpattern: Tx Antenna pattern
550 */
551struct sir_vht_config {
552 uint32_t max_mpdu_len:2;
553 uint32_t supported_channel_widthset:2;
554 uint32_t ldpc_coding:1;
555 uint32_t shortgi80:1;
556 uint32_t shortgi160and80plus80:1;
557 uint32_t tx_stbc:1;
558 uint32_t rx_stbc:3;
559 uint32_t su_beam_former:1;
560 uint32_t su_beam_formee:1;
561 uint32_t csnof_beamformer_antSup:3;
562 uint32_t num_soundingdim:3;
563 uint32_t mu_beam_former:1;
564 uint32_t mu_beam_formee:1;
565 uint32_t vht_txops:1;
566 uint32_t htc_vhtcap:1;
567 uint32_t max_ampdu_lenexp:3;
568 uint32_t vht_link_adapt:2;
569 uint32_t rx_antpattern:1;
570 uint32_t tx_antpattern:1;
571 uint32_t unused:2;
572};
573
574
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800575typedef struct sSirAddIeParams {
576 uint16_t probeRespDataLen;
577 uint8_t *probeRespData_buff;
578 uint16_t assocRespDataLen;
579 uint8_t *assocRespData_buff;
580 uint16_t probeRespBCNDataLen;
581 uint8_t *probeRespBCNData_buff;
582} tSirAddIeParams, *tpSirAddIeParams;
583
584/* / Definition for kick starting BSS */
585/* / ---> MAC */
586/**
587 * Usage of ssId, numSSID & ssIdList:
588 * ---------------------------------
589 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
590 * feature is enabled.
591 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
592 * and interpret the SSID list from numSSID & ssIdList.
593 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
594 * specified in the ssId field and it is expected that
595 * application will set numSSID to one (only one SSID present
596 * in the list) and SSID in the list is same as ssId field.
597 * 4. Application will always set numSSID >= 1.
598 */
599/* ***** NOTE: Please make sure all codes are updated if inserting field into
600 * this structure..********** */
601typedef struct sSirSmeStartBssReq {
602 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
603 uint16_t length;
604 uint8_t sessionId; /* Added for BT-AMP Support */
605 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530606 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
607 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800608 uint16_t beaconInterval; /* Added for BT-AMP Support */
609 uint8_t dot11mode;
610#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
611 uint8_t cc_switch_mode;
612#endif
613 tSirBssType bssType;
614 tSirMacSSid ssId;
615 uint8_t channelId;
616 ePhyChanBondState cbMode;
617 uint8_t vht_channel_width;
618 uint8_t center_freq_seg0;
619 uint8_t center_freq_seg1;
620 uint8_t sec_ch_offset;
621
622 uint8_t privacy;
623 uint8_t apUapsdEnable;
624 uint8_t ssidHidden;
625 bool fwdWPSPBCProbeReq;
626 bool protEnabled;
627 bool obssProtEnabled;
628 uint16_t ht_capab;
629 tAniAuthType authType;
630 uint32_t dtimPeriod;
631 uint8_t wps_state;
632 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800633 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800634
635 uint8_t txLdpcIniFeatureEnabled;
636
637 tSirRSNie rsnIE; /* RSN IE to be sent in */
638 /* Beacon and Probe */
639 /* Response frames */
640 tSirNwType nwType; /* Indicates 11a/b/g */
641 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
642 tSirMacRateSet extendedRateSet; /* Has 11g rates */
643 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700644 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800645#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700646 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800647#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800648#ifdef WLAN_FEATURE_11W
649 bool pmfCapable;
650 bool pmfRequired;
651#endif
652
653 tSirAddIeParams addIeParams;
654
655 bool obssEnabled;
656 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800657 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530658 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700659 uint32_t cac_duration_ms;
660 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800661
662} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
663
664#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
665 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
666 ieFields)))
667
668#define WSCIE_PROBE_RSP_LEN (317 + 2)
669
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530670#ifdef WLAN_FEATURE_FILS_SK
671/* struct fils_ind_elements: elements parsed from fils indication present
672 * in beacon/probe resp
673 * @realm_cnt: number of realm present
674 * @realm: realms
675 * @is_fils_sk_supported: if FILS SK supported
676 * @is_cache_id_present: if cache id present
677 * @cache_id: cache id
678 */
679struct fils_ind_elements {
680 uint16_t realm_cnt;
681 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
682 bool is_fils_sk_supported;
683 bool is_cache_id_present;
684 uint8_t cache_id[CACHE_ID_LEN];
685};
686#endif
687
Jeff Johnsone58271f2017-10-06 09:58:59 -0700688struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689 /* offset of the ieFields from bssId. */
690 uint16_t length;
691 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530692 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693 uint32_t timeStamp[2];
694 uint16_t beaconInterval;
695 uint16_t capabilityInfo;
696 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700698 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800699 int8_t sinr;
700 /* channelId what peer sent in beacon/probersp. */
701 uint8_t channelId;
702 /* channelId on which we are parked at. */
703 /* used only in scan case. */
704 uint8_t channelIdSelf;
705 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530706 /* Based on system time, not a relative time. */
707 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 uint32_t parentTSF;
709 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800710 uint8_t mdiePresent;
711 /* MDIE for 11r, picked from the beacons */
712 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800713#ifdef FEATURE_WLAN_ESE
714 uint16_t QBSSLoad_present;
715 uint16_t QBSSLoad_avail;
716 /* To achieve 8-byte alignment with ESE enabled */
717 uint32_t reservedPadding5;
718#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719 /* whether it is from a probe rsp */
720 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700721 /* Actual channel the beacon/probe response was received on */
722 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700723 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800724 uint32_t WscIeLen;
725 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
726 uint8_t reservedPadding4;
727 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530728#ifdef WLAN_FEATURE_FILS_SK
729 struct fils_ind_elements fils_info_element;
730#endif
731 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700733};
734typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800735
736#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
737typedef struct sSirSmeHTProfile {
738 uint8_t dot11mode;
739 uint8_t htCapability;
740 uint8_t htSupportedChannelWidthSet;
741 uint8_t htRecommendedTxWidthSet;
742 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800743 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800744 uint8_t apCenterChan;
745 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746} tSirSmeHTProfile;
747#endif
748/* / Definition for response message to previously */
749/* / issued start BSS request */
750/* / MAC ---> */
751typedef struct sSirSmeStartBssRsp {
752 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
753 uint16_t length;
754 uint8_t sessionId;
755 uint16_t transactionId; /* transaction ID for cmd */
756 tSirResultCodes statusCode;
757 tSirBssType bssType; /* Add new type for WDS mode */
758 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700759 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800760#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
761 tSirSmeHTProfile HTProfile;
762#endif
763 tSirBssDescription bssDescription; /* Peer BSS description */
764} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
765
766typedef struct sSirChannelList {
767 uint8_t numChannels;
768 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
769} tSirChannelList, *tpSirChannelList;
770
771typedef struct sSirDFSChannelList {
772 uint32_t timeStamp[SIR_MAX_24G_5G_CHANNEL_RANGE];
773
774} tSirDFSChannelList, *tpSirDFSChannelList;
775
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800776/* / Two Background Scan mode */
777typedef enum eSirBackgroundScanMode {
778 eSIR_ROAMING_SCAN = 2,
779} tSirBackgroundScanMode;
780
781/* / Two types of traffic check */
782typedef enum eSirLinkTrafficCheck {
783 eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 0,
784 eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 1,
785 eSIR_CHECK_ROAMING_SCAN = 2,
786} tSirLinkTrafficCheck;
787
788#define SIR_BG_SCAN_RETURN_CACHED_RESULTS 0x0
789#define SIR_BG_SCAN_PURGE_RESUTLS 0x80
790#define SIR_BG_SCAN_RETURN_FRESH_RESULTS 0x01
791#define SIR_SCAN_MAX_NUM_SSID 0x0A
792#define SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS 0x02
793#define SIR_BG_SCAN_PURGE_LFR_RESULTS 0x40
794
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800795typedef struct sSirSmeScanAbortReq {
796 uint16_t type;
797 uint16_t msgLen;
798 uint8_t sessionId;
799 uint32_t scan_id;
800} tSirSmeScanAbortReq, *tpSirSmeScanAbortReq;
801
802typedef struct sSirSmeScanChanReq {
803 uint16_t type;
804 uint16_t msgLen;
805 uint8_t sessionId;
806 uint16_t transcationId;
807} tSirSmeGetScanChanReq, *tpSirSmeGetScanChanReq;
808
809#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700810struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530811 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800812 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700813};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700815struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800816 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700817 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700818};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800819#endif /* FEATURE_OEM_DATA_SUPPORT */
820
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800821#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530822typedef struct ese_wmm_tspec_ie {
823 uint16_t traffic_type:1;
824 uint16_t tsid:4;
825 uint16_t direction:2;
826 uint16_t access_policy:2;
827 uint16_t aggregation:1;
828 uint16_t psb:1;
829 uint16_t user_priority:3;
830 uint16_t tsinfo_ack_pol:2;
831 uint8_t tsinfo_rsvd:7;
832 uint8_t burst_size_defn:1;
833 uint16_t size:15;
834 uint16_t fixed:1;
835 uint16_t max_msdu_size;
836 uint32_t min_service_int;
837 uint32_t max_service_int;
838 uint32_t inactivity_int;
839 uint32_t suspension_int;
840 uint32_t service_start_time;
841 uint32_t min_data_rate;
842 uint32_t mean_data_rate;
843 uint32_t peak_data_rate;
844 uint32_t burst_size;
845 uint32_t delay_bound;
846 uint32_t min_phy_rate;
847 uint16_t surplus_bw_allowance;
848 uint16_t medium_time;
849} qdf_packed ese_wmm_tspec_ie;
850
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800851typedef struct sTspecInfo {
852 uint8_t valid;
853 tSirMacTspecIE tspec;
854} tTspecInfo;
855
856#define SIR_ESE_MAX_TSPEC_IES 4
857typedef struct sESETspecTspecInfo {
858 uint8_t numTspecs;
859 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
860} tESETspecInfo;
861
862typedef struct sSirTsmIE {
863 uint8_t tsid;
864 uint8_t state;
865 uint16_t msmt_interval;
866} tSirTsmIE, *tpSirTsmIE;
867typedef struct sSirSmeTsmIEInd {
868 tSirTsmIE tsmIe;
869 uint8_t sessionId;
870} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
871typedef struct sAniTrafStrmMetrics {
872 uint16_t UplinkPktQueueDly;
873 uint16_t UplinkPktQueueDlyHist[4];
874 uint32_t UplinkPktTxDly;
875 uint16_t UplinkPktLoss;
876 uint16_t UplinkPktCount;
877 uint8_t RoamingCount;
878 uint16_t RoamingDly;
879} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
880
881typedef struct sAniGetTsmStatsReq {
882 /* Common for all types are requests */
883 uint16_t msgType; /* message type is same as the request type */
884 uint16_t msgLen; /* length of the entire request */
885 uint8_t staId;
886 uint8_t tid; /* traffic id */
887 struct qdf_mac_addr bssId;
888 void *tsmStatsCallback;
889 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800890} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
891
892typedef struct sAniGetTsmStatsRsp {
893 /* Common for all types are responses */
894 uint16_t msgType; /*
895 * message type is same as
896 * the request type
897 */
898 uint16_t msgLen; /*
899 * length of the entire request,
900 * includes the pStatsBuf length too
901 */
902 uint8_t sessionId;
903 uint32_t rc; /* success/failure */
904 uint32_t staId; /*
905 * Per STA stats request must
906 * contain valid
907 */
908 tAniTrafStrmMetrics tsmMetrics;
909 void *tsmStatsReq; /* tsm stats request backup */
910} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
911
912typedef struct sSirEseBcnReportBssInfo {
913 tBcnReportFields bcnReportFields;
914 uint8_t ieLen;
915 uint8_t *pBuf;
916} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
917
918typedef struct sSirEseBcnReportRsp {
919 uint16_t measurementToken;
920 uint8_t flag; /* Flag to report measurement done and more data */
921 uint8_t numBss;
922 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
923} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
924
925#define TSRS_11AG_RATE_6MBPS 0xC
926#define TSRS_11B_RATE_5_5MBPS 0xB
927typedef struct sSirMacESETSRSIE {
928 uint8_t tsid;
929 uint8_t rates[8];
930} tSirMacESETSRSIE;
931typedef struct sSirMacESETSMIE {
932 uint8_t tsid;
933 uint8_t state;
934 uint16_t msmt_interval;
935} tSirMacESETSMIE;
936typedef struct sTSMStats {
937 uint8_t tid;
938 struct qdf_mac_addr bssid;
939 tTrafStrmMetrics tsmMetrics;
940} tTSMStats, *tpTSMStats;
941typedef struct sEseTSMContext {
942 uint8_t tid;
943 tSirMacESETSMIE tsmInfo;
944 tTrafStrmMetrics tsmMetrics;
945} tEseTSMContext, *tpEseTSMContext;
946typedef struct sEsePEContext {
947 tEseTSMContext tsm;
948} tEsePEContext, *tpEsePEContext;
949
950typedef struct sSirPlmReq {
951 uint16_t diag_token; /* Dialog token */
952 uint16_t meas_token; /* measurement token */
953 uint16_t numBursts; /* total number of bursts */
954 uint16_t burstInt; /* burst interval in seconds */
955 uint16_t measDuration; /* in TU's,STA goes off-ch */
956 /* no of times the STA should cycle through PLM ch list */
957 uint8_t burstLen;
958 int8_t desiredTxPwr; /* desired tx power */
959 struct qdf_mac_addr mac_addr; /* MC dest addr */
960 /* no of channels */
961 uint8_t plmNumCh;
962 /* channel numbers */
963 uint8_t plmChList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
964 uint8_t sessionId;
965 bool enable;
966} tSirPlmReq, *tpSirPlmReq;
967
968#endif /* FEATURE_WLAN_ESE */
969
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970/* / Definition for response message to previously issued scan request */
971typedef struct sSirSmeScanRsp {
972 uint16_t messageType; /* eWNI_SME_SCAN_RSP */
973 uint16_t length;
974 uint8_t sessionId;
975 tSirResultCodes statusCode;
976 uint16_t transcationId;
977 uint32_t scan_id;
978} tSirSmeScanRsp, *tpSirSmeScanRsp;
979
980/* / Definition for join request */
981/* / ---> MAC */
982/* / WARNING! If you add a field in JOIN REQ. */
983/* / Make sure to add it in REASSOC REQ */
984/* / The Serdes function is the same and its */
985/* / shared with REASSOC. So if we add a field */
986/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
987typedef struct sSirSmeJoinReq {
988 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
989 uint16_t length;
990 uint8_t sessionId;
991 uint16_t transactionId;
992 tSirMacSSid ssId;
993 tSirMacAddr selfMacAddr; /* self Mac address */
994 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
995 uint8_t dot11mode; /* to support BT-AMP */
996#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
997 uint8_t cc_switch_mode;
998#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800999 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +05301000 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
1002
1003 /*This contains the UAPSD Flag for all 4 AC
1004 * B0: AC_VO UAPSD FLAG
1005 * B1: AC_VI UAPSD FLAG
1006 * B2: AC_BK UAPSD FLAG
1007 * B3: AC_BE UASPD FLAG
1008 */
1009 uint8_t uapsdPerAcBitmask;
1010
1011 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
1012 tSirMacRateSet extendedRateSet; /* Has 11g rates */
1013 tSirRSNie rsnIE; /* RSN IE to be sent in */
1014 /* (Re) Association Request */
1015#ifdef FEATURE_WLAN_ESE
1016 /* CCMK IE to be included as handler for join and reassoc is */
1017 tSirCCKMie cckmIE;
1018 /* the same. The join will never carry cckm, but will be set to */
1019 /* 0. */
1020#endif
1021
1022 tSirAddie addIEScan; /* Additional IE to be sent in */
1023 /* (unicast) Probe Request at the time of join */
1024
1025 tSirAddie addIEAssoc; /* Additional IE to be sent in */
1026 /* (Re) Association Request */
1027
1028 tAniEdType UCEncryptionType;
1029
1030 tAniEdType MCEncryptionType;
1031
1032#ifdef WLAN_FEATURE_11W
1033 tAniEdType MgmtEncryptionType;
1034#endif
1035
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001036 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001037#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001038 bool isESEFeatureIniEnabled;
1039 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001040 tESETspecInfo eseTspecInfo;
1041#endif
1042
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001043 bool isFastTransitionEnabled;
1044 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001045
1046 uint8_t txLdpcIniFeatureEnabled;
1047 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -07001048 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001049#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07001050 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001051#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001052 uint8_t enableVhtpAid;
1053 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001054 uint8_t enableAmpduPs;
1055 uint8_t enableHtSmps;
1056 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001057 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -08001058 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001059 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001060 bool isWMEenabled;
1061 bool isQosEnabled;
1062 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -08001063 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001064 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001065 tSirMacPowerCapInfo powerCap;
1066 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +05301067 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301068#ifdef WLAN_FEATURE_FILS_SK
1069 struct cds_fils_connection_info fils_con_info;
1070#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +05301071 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301072 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +05301073 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +05301074 bool force_rsne_override;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301075 tSirBssDescription bssDescription;
1076 /*
1077 * WARNING: Pls make bssDescription as last variable in struct
1078 * tSirSmeJoinReq as it has ieFields followed after this bss
1079 * description. Adding a variable after this corrupts the ieFields
1080 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001081} tSirSmeJoinReq, *tpSirSmeJoinReq;
1082
Jeff Johnson47d75242018-05-12 15:58:53 -07001083/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001084/* / MAC ---> */
1085typedef struct sSirSmeJoinRsp {
1086 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1087 uint16_t length;
1088 uint8_t sessionId; /* Session ID */
1089 uint16_t transactionId; /* Transaction ID for cmd */
1090 tSirResultCodes statusCode;
1091 tAniAuthType authType;
1092 uint32_t vht_channel_width;
1093 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1094 * Otherwise it holds status code.
1095 */
1096 uint16_t protStatusCode;
1097 uint16_t aid;
1098 uint32_t beaconLength;
1099 uint32_t assocReqLength;
1100 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001101 uint32_t parsedRicRspLen;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001102#ifdef FEATURE_WLAN_ESE
1103 uint32_t tspecIeLen;
1104#endif
1105 uint32_t staId; /* Station ID for peer */
1106
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001107 /*Timing measurement capability */
1108 uint8_t timingMeasCap;
1109
1110#ifdef FEATURE_WLAN_TDLS
1111 /* TDLS prohibited and TDLS channel switch prohibited are set as
1112 * per ExtCap IE in received assoc/re-assoc response from AP
1113 */
1114 bool tdls_prohibited;
1115 bool tdls_chan_swit_prohibited;
1116#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301117 uint8_t nss;
1118 uint32_t max_rate_flags;
1119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001120#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1121 tSirSmeHTProfile HTProfile;
1122#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001123 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301124 tDot11fIEHTCaps ht_caps;
1125 tDot11fIEVHTCaps vht_caps;
1126 tDot11fIEHTInfo ht_operation;
1127 tDot11fIEVHTOperation vht_operation;
1128 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301129 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301130 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301131#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301132 struct fils_join_rsp_params *fils_join_rsp;
1133#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001134 uint8_t frames[1];
1135} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1136
1137/* / probereq from peer, when wsc is enabled */
1138typedef struct sSirSmeProbereq {
1139 uint16_t messageType;
1140 uint16_t length;
1141 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301142 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001143 uint16_t devicePasswdId;
1144} tSirSmeProbeReq, *tpSirSmeProbeReq;
1145
1146typedef struct sSirSmeChanInfo {
1147 uint8_t chan_id;
1148 uint32_t mhz;
1149 uint32_t band_center_freq1;
1150 uint32_t band_center_freq2;
1151 uint32_t info;
1152 uint32_t reg_info_1;
1153 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301154 uint8_t nss;
1155 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301156 uint8_t sec_ch_offset;
1157 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001158} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301159
Will Huang558f8082017-05-31 16:22:24 +08001160enum sir_sme_phy_mode {
1161 SIR_SME_PHY_MODE_LEGACY = 0,
1162 SIR_SME_PHY_MODE_HT = 1,
1163 SIR_SME_PHY_MODE_VHT = 2
1164};
1165
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001166/* / Definition for Association indication from peer */
1167/* / MAC ---> */
1168typedef struct sSirSmeAssocInd {
1169 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1170 uint16_t length;
1171 uint8_t sessionId;
1172 tSirMacAddr peerMacAddr;
1173 uint16_t aid;
1174 tSirMacAddr bssId; /* Self BSSID */
1175 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001176 tAniAuthType authType;
1177 tAniSSID ssId; /* SSID used by STA to associate */
1178 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1179 tSirRSNie rsnIE; /* RSN IE received from peer */
1180 /* Additional IE received from peer, which possibly include
1181 * WSC IE and/or P2P IE
1182 */
1183 tSirAddie addIE;
1184
1185 /* powerCap & supportedChannels are present only when */
1186 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001187 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001188 tSirMacPowerCapInfo powerCap;
1189 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001190 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1191 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001192 /* Required for indicating the frames to upper layer */
1193 uint32_t beaconLength;
1194 uint8_t *beaconPtr;
1195 uint32_t assocReqLength;
1196 uint8_t *assocReqPtr;
1197
1198 /* Timing measurement capability */
1199 uint8_t timingMeasCap;
1200 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001201 bool ampdu;
1202 bool sgi_enable;
1203 bool tx_stbc;
1204 bool rx_stbc;
1205 tSirMacHTChannelWidth ch_width;
1206 enum sir_sme_phy_mode mode;
1207 uint8_t max_supp_idx;
1208 uint8_t max_ext_idx;
1209 uint8_t max_mcs_idx;
1210 uint8_t rx_mcs_map;
1211 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001212 /* Extended CSA capability of station */
1213 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301214 tDot11fIEHTCaps HTCaps;
1215 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001216} tSirSmeAssocInd, *tpSirSmeAssocInd;
1217
1218/* / Definition for Association confirm */
1219/* / ---> MAC */
1220typedef struct sSirSmeAssocCnf {
1221 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1222 uint16_t length;
1223 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301224 struct qdf_mac_addr bssid; /* Self BSSID */
1225 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001226 uint16_t aid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301227 struct qdf_mac_addr alternate_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001228 uint8_t alternateChannelId;
1229} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1230
1231/* / Enum definition for Wireless medium status change codes */
1232typedef enum eSirSmeStatusChangeCode {
1233 eSIR_SME_DEAUTH_FROM_PEER,
1234 eSIR_SME_DISASSOC_FROM_PEER,
1235 eSIR_SME_LOST_LINK_WITH_PEER,
1236 eSIR_SME_CHANNEL_SWITCH,
1237 eSIR_SME_JOINED_NEW_BSS,
1238 eSIR_SME_LEAVING_BSS,
1239 eSIR_SME_IBSS_ACTIVE,
1240 eSIR_SME_IBSS_INACTIVE,
1241 eSIR_SME_IBSS_PEER_DEPARTED,
1242 eSIR_SME_RADAR_DETECTED,
1243 eSIR_SME_IBSS_NEW_PEER,
1244 eSIR_SME_AP_CAPS_CHANGED,
1245} tSirSmeStatusChangeCode;
1246
1247typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301248 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001249 uint8_t channelNumber;
1250 uint8_t reserved;
1251 tSirMacSSid ssId;
1252} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1253
1254typedef struct sSirSmeApNewCaps {
1255 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301256 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001257 uint8_t channelId;
1258 uint8_t reserved[3];
1259 tSirMacSSid ssId;
1260} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1261
1262/**
1263 * Table below indicates what information is passed for each of
1264 * the Wireless Media status change notifications:
1265 *
1266 * Status Change code Status change info
1267 * ----------------------------------------------------------------------
1268 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1269 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1270 * eSIR_SME_LOST_LINK_WITH_PEER None
1271 * eSIR_SME_CHANNEL_SWITCH New channel number
1272 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1273 * eSIR_SME_LEAVING_BSS None
1274 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1275 * IBSS apart from this STA that
1276 * started IBSS
1277 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1278 * in IBSS
1279 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1280 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1281 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1282 * that STA is currently associated with
1283 * have changed.
1284 */
1285
1286/* / Definition for Wireless medium status change notification */
1287typedef struct sSirSmeWmStatusChangeNtf {
1288 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1289 uint16_t length;
1290 uint8_t sessionId; /* Session ID */
1291 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301292 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001293 union {
1294 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1295 /* eSIR_SME_DISASSOC_FROM_PEER */
1296 uint16_t disassocReasonCode;
1297 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1298 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1299 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1300 /* none for eSIR_SME_LEAVING_BSS */
1301 /* none for eSIR_SME_IBSS_ACTIVE */
1302 /* none for eSIR_SME_IBSS_INACTIVE */
1303 /* eSIR_SME_IBSS_NEW_PEER */
1304 tSirNewIbssPeerInfo newIbssPeerInfo;
1305 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1306 } statusChangeInfo;
1307} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1308
1309/* Definition for Disassociation request */
1310typedef struct sSirSmeDisassocReq {
1311 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1312 uint16_t length;
1313 uint8_t sessionId; /* Session ID */
1314 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301315 struct qdf_mac_addr bssid; /* Peer BSSID */
1316 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001317 uint16_t reasonCode;
1318 /* This flag tells LIM whether to send the disassoc OTA or not */
1319 /* This will be set in while handing off from one AP to other */
1320 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001321 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301322} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001323
1324/* / Definition for Tkip countermeasures request */
1325typedef struct sSirSmeTkipCntrMeasReq {
1326 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1327 uint16_t length;
1328 uint8_t sessionId; /* Session ID */
1329 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301330 struct qdf_mac_addr bssId; /* Peer BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001331 bool bEnable; /* Start/stop countermeasures */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301332} qdf_packed tSirSmeTkipCntrMeasReq, *tpSirSmeTkipCntrMeasReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001333
1334typedef struct sAni64BitCounters {
1335 uint32_t Hi;
1336 uint32_t Lo;
1337} tAni64BitCounters, *tpAni64BitCounters;
1338
1339typedef struct sAniSecurityStat {
1340 tAni64BitCounters txBlks;
1341 tAni64BitCounters rxBlks;
1342 tAni64BitCounters formatErrorCnt;
1343 tAni64BitCounters decryptErr;
1344 tAni64BitCounters protExclCnt;
1345 tAni64BitCounters unDecryptableCnt;
1346 tAni64BitCounters decryptOkCnt;
1347
1348} tAniSecurityStat, *tpAniSecurityStat;
1349
1350typedef struct sAniTxRxStats {
1351 tAni64BitCounters txFrames;
1352 tAni64BitCounters rxFrames;
1353 tAni64BitCounters nRcvBytes;
1354 tAni64BitCounters nXmitBytes;
1355
1356} tAniTxRxStats, *tpAniTxRxStats;
1357
1358typedef struct sAniSecStats {
1359 tAniSecurityStat aes;
1360 tAni64BitCounters aesReplays;
1361 tAniSecurityStat tkip;
1362 tAni64BitCounters tkipReplays;
1363 tAni64BitCounters tkipMicError;
1364
1365 tAniSecurityStat wep;
1366#if defined(FEATURE_WLAN_WAPI) && !defined(LIBRA_WAPI_SUPPORT)
1367 tAniSecurityStat wpi;
1368 tAni64BitCounters wpiReplays;
1369 tAni64BitCounters wpiMicError;
1370#endif
1371} tAniSecStats, *tpAniSecStats;
1372
1373#define SIR_MAX_RX_CHAINS 3
1374
1375typedef struct sAniStaStatStruct {
1376 /* following statistic elements till expandPktRxCntLo are not filled
1377 * with valid data. These are kept as it is, since WSM is using this
1378 * structure. These elements can be removed whenever WSM is updated.
1379 * Phystats is used to hold phystats from BD.
1380 */
1381 uint32_t sentAesBlksUcastHi;
1382 uint32_t sentAesBlksUcastLo;
1383 uint32_t recvAesBlksUcastHi;
1384 uint32_t recvAesBlksUcastLo;
1385 uint32_t aesFormatErrorUcastCnts;
1386 uint32_t aesReplaysUcast;
1387 uint32_t aesDecryptErrUcast;
1388 uint32_t singleRetryPkts;
1389 uint32_t failedTxPkts;
1390 uint32_t ackTimeouts;
1391 uint32_t multiRetryPkts;
1392 uint32_t fragTxCntsHi;
1393 uint32_t fragTxCntsLo;
1394 uint32_t transmittedPktsHi;
1395 uint32_t transmittedPktsLo;
1396 uint32_t phyStatHi; /* These are used to fill in the phystats. */
1397 uint32_t phyStatLo; /* This is only for private use. */
1398
1399 uint32_t uplinkRssi;
1400 uint32_t uplinkSinr;
1401 uint32_t uplinkRate;
1402 uint32_t downlinkRssi;
1403 uint32_t downlinkSinr;
1404 uint32_t downlinkRate;
1405 uint32_t nRcvBytes;
1406 uint32_t nXmitBytes;
1407
1408 /*
1409 * Following elements are valid and filled in correctly. They have
1410 * valid values.
1411 */
1412
1413 /* Unicast frames and bytes. */
1414 tAniTxRxStats ucStats;
1415
1416 /* Broadcast frames and bytes. */
1417 tAniTxRxStats bcStats;
1418
1419 /* Multicast frames and bytes. */
1420 tAniTxRxStats mcStats;
1421
1422 uint32_t currentTxRate;
1423 uint32_t currentRxRate; /* Rate in 100Kbps */
1424
1425 uint32_t maxTxRate;
1426 uint32_t maxRxRate;
1427
1428 int8_t rssi[SIR_MAX_RX_CHAINS];
1429
1430 tAniSecStats securityStats;
1431
1432 uint8_t currentRxRateIdx; /* This the softmac rate Index. */
1433 uint8_t currentTxRateIdx;
1434
1435} tAniStaStatStruct, *tpAniStaStatStruct;
1436
1437typedef enum sPacketType {
1438 ePACKET_TYPE_UNKNOWN,
1439 ePACKET_TYPE_11A,
1440 ePACKET_TYPE_11G,
1441 ePACKET_TYPE_11B,
1442 ePACKET_TYPE_11N
1443} tPacketType, *tpPacketType;
1444
1445/* / Definition for Disassociation response */
1446typedef struct sSirSmeDisassocRsp {
1447 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1448 uint16_t length;
1449 uint8_t sessionId; /* Session ID */
1450 uint16_t transactionId; /* Transaction ID for cmd */
1451 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301452 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001453 tAniStaStatStruct perStaStats; /* STA stats */
1454 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001455} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001456
1457/* / Definition for Disassociation indication from peer */
1458typedef struct sSirSmeDisassocInd {
1459 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1460 uint16_t length;
1461 uint8_t sessionId; /* Session Identifier */
1462 uint16_t transactionId; /* Transaction Identifier with PE */
1463 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301464 struct qdf_mac_addr bssid;
1465 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001466 tAniStaStatStruct perStaStats; /* STA stats */
1467 uint16_t staId;
1468 uint32_t reasonCode;
1469} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1470
1471/* / Definition for Disassociation confirm */
1472/* / MAC ---> */
1473typedef struct sSirSmeDisassocCnf {
1474 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1475 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301476 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001477 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301478 struct qdf_mac_addr bssid;
1479 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001480} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1481 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1482
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301483/**
1484 * struct sir_sme_discon_done_ind - disconnect done indiaction
1485 * @message_type: msg type
1486 * @length: length of msg
1487 * @session_id: session id of the indication
1488 * @reason_code: reason for disconnect indication
1489 * @peer_mac: peer mac
1490 */
1491struct sir_sme_discon_done_ind {
1492 uint16_t message_type;
1493 uint16_t length;
1494 uint8_t session_id;
1495 tSirResultCodes reason_code;
1496 tSirMacAddr peer_mac;
1497};
1498
1499
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001500/* / Definition for Deauthetication request */
1501typedef struct sSirSmeDeauthReq {
1502 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1503 uint16_t length;
1504 uint8_t sessionId; /* Session ID */
1505 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301506 struct qdf_mac_addr bssid; /* AP BSSID */
1507 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001508 uint16_t reasonCode;
1509} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1510
1511/* / Definition for Deauthetication response */
1512typedef struct sSirSmeDeauthRsp {
1513 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1514 uint16_t length;
1515 uint8_t sessionId; /* Session ID */
1516 uint16_t transactionId; /* Transaction ID for cmd */
1517 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301518 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001519} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1520
1521/* / Definition for Deauthetication indication from peer */
1522typedef struct sSirSmeDeauthInd {
1523 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1524 uint16_t length;
1525 uint8_t sessionId; /* Added for BT-AMP */
1526 uint16_t transactionId; /* Added for BT-AMP */
1527 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301528 struct qdf_mac_addr bssid; /* AP BSSID */
1529 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001530
1531 uint16_t staId;
1532 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001533 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001534} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1535
1536/* / Definition for stop BSS request message */
1537typedef struct sSirSmeStopBssReq {
1538 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1539 uint16_t length;
1540 uint8_t sessionId; /* Session ID */
1541 uint16_t transactionId; /* tranSaction ID for cmd */
1542 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301543 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001544} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1545
1546/* / Definition for stop BSS response message */
1547typedef struct sSirSmeStopBssRsp {
1548 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1549 uint16_t length;
1550 tSirResultCodes statusCode;
1551 uint8_t sessionId; /* Session ID */
1552 uint16_t transactionId; /* Transaction ID for cmd */
1553} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1554
1555/* / Definition for Channel Switch indication for station */
1556/* / MAC ---> */
1557typedef struct sSirSmeSwitchChannelInd {
1558 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1559 uint16_t length;
1560 uint8_t sessionId;
1561 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001562 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301563 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001564} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1565
1566/* / Definition for Neighbor BSS indication */
1567/* / MAC ---> */
1568/* / MAC reports this each time a new I/BSS is detected */
1569typedef struct sSirSmeNeighborBssInd {
1570 uint16_t messageType; /* eWNI_SME_NEIGHBOR_BSS_IND */
1571 uint16_t length;
1572 uint8_t sessionId;
1573 tSirBssDescription bssDescription[1];
1574} tSirSmeNeighborBssInd, *tpSirSmeNeighborBssInd;
1575
1576/* / Definition for MIC failure indication */
1577/* / MAC ---> */
1578/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1579typedef struct sSirSmeMicFailureInd {
1580 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1581 uint16_t length;
1582 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301583 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001584 tSirMicFailureInfo info;
1585} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1586
1587typedef struct sSirSmeMissedBeaconInd {
1588 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1589 uint16_t length;
1590 uint8_t bssIdx;
1591} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1592
1593/* / Definition for Set Context request */
1594/* / ---> MAC */
1595typedef struct sSirSmeSetContextReq {
1596 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1597 uint16_t length;
1598 uint8_t sessionId; /* Session ID */
1599 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301600 struct qdf_mac_addr peer_macaddr;
1601 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602 tSirKeyMaterial keyMaterial;
1603} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1604
1605/* / Definition for Set Context response */
1606/* / MAC ---> */
1607typedef struct sSirSmeSetContextRsp {
1608 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1609 uint16_t length;
1610 uint8_t sessionId; /* Session ID */
1611 uint16_t transactionId; /* Transaction ID for cmd */
1612 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301613 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001614} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1615
1616/* / Statistic definitions */
1617/* ============================================================= */
1618/* Per STA statistic structure; This same struct will be used for Aggregate */
1619/* STA stats as well. */
1620
1621/* Clear radio stats and clear per sta stats */
1622typedef enum {
1623 eANI_CLEAR_ALL_STATS, /* Clears all stats */
1624 eANI_CLEAR_RX_STATS, /* Clears RX stats of the radio interface */
1625 eANI_CLEAR_TX_STATS, /* Clears TX stats of the radio interface */
1626 eANI_CLEAR_RADIO_STATS, /* Clears all the radio stats */
1627 eANI_CLEAR_PER_STA_STATS, /* Clears Per STA stats */
1628 eANI_CLEAR_AGGR_PER_STA_STATS, /* Clears aggregate stats */
1629
1630 /* Used to distinguish between per sta to security stats. */
1631 /* Used only by AP, FW just returns the same param as it received. */
1632 eANI_LINK_STATS, /* Get Per STA stats */
1633 eANI_SECURITY_STATS, /* Get Per STA security stats */
1634
1635 eANI_CLEAR_STAT_TYPES_END
1636} tAniStatSubTypes;
1637
1638typedef struct sAniTxCtrs {
1639 /* add the rate counters here */
1640 uint32_t tx1Mbps;
1641 uint32_t tx2Mbps;
1642 uint32_t tx5_5Mbps;
1643 uint32_t tx6Mbps;
1644 uint32_t tx9Mbps;
1645 uint32_t tx11Mbps;
1646 uint32_t tx12Mbps;
1647 uint32_t tx18Mbps;
1648 uint32_t tx24Mbps;
1649 uint32_t tx36Mbps;
1650 uint32_t tx48Mbps;
1651 uint32_t tx54Mbps;
1652 uint32_t tx72Mbps;
1653 uint32_t tx96Mbps;
1654 uint32_t tx108Mbps;
1655
1656 /* tx path radio counts */
1657 uint32_t txFragHi;
1658 uint32_t txFragLo;
1659 uint32_t txFrameHi;
1660 uint32_t txFrameLo;
1661 uint32_t txMulticastFrameHi;
1662 uint32_t txMulticastFrameLo;
1663 uint32_t txFailedHi;
1664 uint32_t txFailedLo;
1665 uint32_t multipleRetryHi;
1666 uint32_t multipleRetryLo;
1667 uint32_t singleRetryHi;
1668 uint32_t singleRetryLo;
1669 uint32_t ackFailureHi;
1670 uint32_t ackFailureLo;
1671 uint32_t xmitBeacons;
1672} tAniTxCtrs, *tpAniTxCtrs;
1673
1674typedef struct sAniRxCtrs {
1675 /* receive frame rate counters */
1676 uint32_t rx1Mbps;
1677 uint32_t rx2Mbps;
1678 uint32_t rx5_5Mbps;
1679 uint32_t rx6Mbps;
1680 uint32_t rx9Mbps;
1681 uint32_t rx11Mbps;
1682 uint32_t rx12Mbps;
1683 uint32_t rx18Mbps;
1684 uint32_t rx24Mbps;
1685 uint32_t rx36Mbps;
1686 uint32_t rx48Mbps;
1687 uint32_t rx54Mbps;
1688 uint32_t rx72Mbps;
1689 uint32_t rx96Mbps;
1690 uint32_t rx108Mbps;
1691
1692 /* receive size counters; 'Lte' = Less than or equal to */
1693 uint32_t rxLte64;
1694 uint32_t rxLte128Gt64;
1695 uint32_t rxLte256Gt128;
1696 uint32_t rxLte512Gt256;
1697 uint32_t rxLte1kGt512;
1698 uint32_t rxLte1518Gt1k;
1699 uint32_t rxLte2kGt1518;
1700 uint32_t rxLte4kGt2k;
1701
1702 /* rx radio stats */
1703 uint32_t rxFrag;
1704 uint32_t rxFrame;
1705 uint32_t fcsError;
1706 uint32_t rxMulticast;
1707 uint32_t duplicate;
1708 uint32_t rtsSuccess;
1709 uint32_t rtsFailed;
1710 uint32_t wepUndecryptables;
1711 uint32_t drops;
1712 uint32_t aesFormatErrorUcastCnts;
1713 uint32_t aesReplaysUcast;
1714 uint32_t aesDecryptErrUcast;
1715} tAniRxCtrs, *tpAniRxCtrs;
1716
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001717/* *************************************************************** */
1718
1719/*******************PE Statistics*************************/
1720
1721/*
1722 * tpAniGetPEStatsReq is tied to
1723 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1724 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1725 */
1726typedef struct sAniGetPEStatsReq {
1727 /* Common for all types are requests */
1728 uint16_t msgType; /* message type is same as the request type */
1729 uint16_t msgLen; /* length of the entire request */
1730 uint32_t staId; /* Per STA stats request must contain valid */
1731 /* categories of stats requested. look at ePEStatsMask */
1732 uint32_t statsMask;
1733 uint8_t sessionId;
1734} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1735
1736/*
1737 * tpAniGetPEStatsRsp is tied to
1738 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1739 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1740 */
1741typedef struct sAniGetPEStatsRsp {
1742 /* Common for all types are responses */
1743 uint16_t msgType; /* message type is same as the request type */
1744 /* length of the entire request, includes the pStatsBuf length too */
1745 uint16_t msgLen;
1746 uint8_t sessionId;
1747 uint32_t rc; /* success/failure */
1748 uint32_t staId; /* Per STA stats request must contain valid */
1749 /* categories of stats requested. look at ePEStatsMask */
1750 uint32_t statsMask;
1751 /* void *pStatsBuf; */
1752 /*
1753 * The Stats buffer starts here and can be an aggregate of more than one
1754 * statistics structure depending on statsMask. The void pointer
1755 * "pStatsBuf" is commented out intentionally and the src code that uses
1756 * this structure should take that into account.
1757 */
1758} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1759
1760typedef struct sAniGetRssiReq {
1761 /* Common for all types are requests */
1762 uint16_t msgType; /* message type is same as the request type */
1763 uint16_t msgLen; /* length of the entire request */
1764 uint8_t sessionId;
1765 uint8_t staId;
1766 int8_t lastRSSI; /* in case of error, return last RSSI */
1767 void *rssiCallback;
1768 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001769} tAniGetRssiReq, *tpAniGetRssiReq;
1770
1771typedef struct sAniGetSnrReq {
1772 /* Common for all types are requests */
1773 uint16_t msgType; /* message type is same as the request type */
1774 uint16_t msgLen; /* length of the entire request */
1775 uint8_t sessionId;
1776 uint8_t staId;
1777 void *snrCallback;
1778 void *pDevContext; /* device context */
1779 int8_t snr;
1780} tAniGetSnrReq, *tpAniGetSnrReq;
1781
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001782/**
1783 * struct ani_scan_req - Scan request
1784 * @msg_type: Message type
1785 * @msg_len: Message Length
1786 * @session_id: SME session Id
1787 * @scan_param: scan request parameter
1788 * @callback: call back function for scan result
1789 * @ctx: Global context
1790 *
1791 * Scan request message structure
1792 */
1793struct ani_scan_req {
1794 /* message type is same as the request type */
1795 uint16_t msg_type;
1796 /* length of the entire request */
1797 uint16_t msg_len;
1798 uint16_t session_id;
1799 void *scan_param;
1800 void *callback;
1801 void *ctx;
1802};
1803
1804/**
1805 * struct ani_roc_req - Remain on channel request
1806 * @msg_type: Message type
1807 * @msg_len: Message Length
1808 * @session_id: SME session Id
1809 * @channel: channel number
1810 * @callback: call back function for scan result
1811 * @duration: Roc duration
1812 * @is_p2pprobe_allowed : flag for p2p probe request
1813 * @ctx: Global context
1814 * @scan_id: Scan Identifier
1815 *
1816 * Remain on channel request message structure
1817 */
1818struct ani_roc_req {
1819 /* message type is same as the request type */
1820 uint16_t msg_type;
1821 /* length of the entire request */
1822 uint16_t msg_len;
1823 uint16_t session_id;
1824 uint8_t channel;
1825 uint32_t duration;
1826 uint8_t is_p2pprobe_allowed;
1827 void *callback;
1828 void *ctx;
1829 uint32_t scan_id;
1830};
1831
1832/* generic country code change request MSG structure */
1833typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001834 uint16_t msgType; /* message type is same as the request type */
1835 uint16_t msgLen; /* length of the entire request */
1836 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001837} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1838
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001839/**
1840 * struct sAniDHCPStopInd - DHCP Stop indication message
1841 * @msgType: message type is same as the request type
1842 * @msgLen: length of the entire request
1843 * @device_mode: Mode of the device(ex:STA, AP)
1844 * @adapterMacAddr: MAC address of the adapter
1845 * @peerMacAddr: MAC address of the connected peer
1846 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001847typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001848 uint16_t msgType;
1849 uint16_t msgLen;
1850 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301851 struct qdf_mac_addr adapterMacAddr;
1852 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001853} tAniDHCPInd, *tpAniDHCPInd;
1854
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001855typedef struct sAniTXFailMonitorInd {
1856 uint16_t msgType; /* message type is same as the request type */
1857 uint16_t msgLen; /* length of the entire request */
1858 uint8_t tx_fail_count;
1859 void *txFailIndCallback;
1860} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1861
Naveen Rawatea1564b2018-05-17 15:56:11 -07001862#ifndef QCA_SUPPORT_CP_STATS
1863/**
1864 * enum tx_rate_info - tx_rate flags
1865 * @TX_RATE_LEGACY: Legacy rates
1866 * @TX_RATE_HT20: HT20 rates
1867 * @TX_RATE_HT40: HT40 rates
1868 * @TX_RATE_SGI: Rate with Short guard interval
1869 * @TX_RATE_LGI: Rate with Long guard interval
1870 * @TX_RATE_VHT20: VHT 20 rates
1871 * @TX_RATE_VHT40: VHT 40 rates
1872 * @TX_RATE_VHT80: VHT 80 rates
1873 */
1874enum tx_rate_info {
1875 TX_RATE_LEGACY = 0x1,
1876 TX_RATE_HT20 = 0x2,
1877 TX_RATE_HT40 = 0x4,
1878 TX_RATE_SGI = 0x8,
1879 TX_RATE_LGI = 0x10,
1880 TX_RATE_VHT20 = 0x20,
1881 TX_RATE_VHT40 = 0x40,
1882 TX_RATE_VHT80 = 0x80
1883};
1884#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001885/**********************PE Statistics end*************************/
1886
1887typedef struct sSirP2PNoaStart {
1888 uint32_t status;
1889 uint32_t bssIdx;
1890} tSirP2PNoaStart, *tpSirP2PNoaStart;
1891
1892typedef struct sSirTdlsInd {
1893 uint16_t status;
1894 uint16_t assocId;
1895 uint16_t staIdx;
1896 uint16_t reasonCode;
1897} tSirTdlsInd, *tpSirTdlsInd;
1898
1899typedef struct sSirP2PNoaAttr {
1900#ifdef ANI_BIG_BYTE_ENDIAN
1901 uint32_t index:8;
1902 uint32_t oppPsFlag:1;
1903 uint32_t ctWin:7;
1904 uint32_t rsvd1:16;
1905#else
1906 uint32_t rsvd1:16;
1907 uint32_t ctWin:7;
1908 uint32_t oppPsFlag:1;
1909 uint32_t index:8;
1910#endif
1911
1912#ifdef ANI_BIG_BYTE_ENDIAN
1913 uint32_t uNoa1IntervalCnt:8;
1914 uint32_t rsvd2:24;
1915#else
1916 uint32_t rsvd2:24;
1917 uint32_t uNoa1IntervalCnt:8;
1918#endif
1919 uint32_t uNoa1Duration;
1920 uint32_t uNoa1Interval;
1921 uint32_t uNoa1StartTime;
1922
1923#ifdef ANI_BIG_BYTE_ENDIAN
1924 uint32_t uNoa2IntervalCnt:8;
1925 uint32_t rsvd3:24;
1926#else
1927 uint32_t rsvd3:24;
1928 uint32_t uNoa2IntervalCnt:8;
1929#endif
1930 uint32_t uNoa2Duration;
1931 uint32_t uNoa2Interval;
1932 uint32_t uNoa2StartTime;
1933} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1934
1935typedef struct sSirTclasInfo {
1936 tSirMacTclasIE tclas;
1937 uint8_t version; /* applies only for classifier type ip */
1938 union {
1939 tSirMacTclasParamEthernet eth;
1940 tSirMacTclasParamIPv4 ipv4;
1941 tSirMacTclasParamIPv6 ipv6;
1942 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301943 } qdf_packed tclasParams;
1944} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001945
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001946typedef struct sSirAddtsReqInfo {
1947 uint8_t dialogToken;
1948 tSirMacTspecIE tspec;
1949
1950 uint8_t numTclas; /* number of Tclas elements */
1951 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1952 uint8_t tclasProc;
1953#if defined(FEATURE_WLAN_ESE)
1954 tSirMacESETSRSIE tsrsIE;
1955 uint8_t tsrsPresent:1;
1956#endif
1957 uint8_t wmeTspecPresent:1;
1958 uint8_t wsmTspecPresent:1;
1959 uint8_t lleTspecPresent:1;
1960 uint8_t tclasProcPresent:1;
1961} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1962
1963typedef struct sSirAddtsRspInfo {
1964 uint8_t dialogToken;
1965 tSirMacStatusCodes status;
1966 tSirMacTsDelayIE delay;
1967
1968 tSirMacTspecIE tspec;
1969 uint8_t numTclas; /* number of Tclas elements */
1970 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1971 uint8_t tclasProc;
1972 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001973#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001974 tSirMacESETSMIE tsmIE;
1975 uint8_t tsmPresent:1;
1976#endif
1977 uint8_t wmeTspecPresent:1;
1978 uint8_t wsmTspecPresent:1;
1979 uint8_t lleTspecPresent:1;
1980 uint8_t tclasProcPresent:1;
1981 uint8_t schedulePresent:1;
1982} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1983
1984typedef struct sSirDeltsReqInfo {
1985 tSirMacTSInfo tsinfo;
1986 tSirMacTspecIE tspec;
1987 uint8_t wmeTspecPresent:1;
1988 uint8_t wsmTspecPresent:1;
1989 uint8_t lleTspecPresent:1;
1990} tSirDeltsReqInfo, *tpSirDeltsReqInfo;
1991
1992/* / Add a tspec as defined */
1993typedef struct sSirAddtsReq {
1994 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1995 uint16_t length;
1996 uint8_t sessionId; /* Session ID */
1997 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301998 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001999 uint32_t timeout; /* in ms */
2000 uint8_t rspReqd;
2001 tSirAddtsReqInfo req;
2002} tSirAddtsReq, *tpSirAddtsReq;
2003
2004typedef struct sSirAddtsRsp {
2005 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
2006 uint16_t length;
2007 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2008 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2009 uint32_t rc; /* return code */
2010 tSirAddtsRspInfo rsp;
2011} tSirAddtsRsp, *tpSirAddtsRsp;
2012
2013typedef struct sSirDeltsReq {
2014 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
2015 uint16_t length;
2016 uint8_t sessionId; /* Session ID */
2017 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302018 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002019 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302020 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002021 uint8_t rspReqd;
2022 tSirDeltsReqInfo req;
2023} tSirDeltsReq, *tpSirDeltsReq;
2024
2025typedef struct sSirDeltsRsp {
2026 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
2027 uint16_t length;
2028 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2029 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2030 uint32_t rc;
2031 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302032 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002033 tSirDeltsReqInfo rsp;
2034} tSirDeltsRsp, *tpSirDeltsRsp;
2035
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002036#define SIR_QOS_NUM_AC_MAX 4
2037
2038typedef struct sSirAggrQosReqInfo {
2039 uint16_t tspecIdx;
2040 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
2041} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
2042
2043typedef struct sSirAggrQosReq {
2044 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2045 uint16_t length;
2046 uint8_t sessionId; /* Session ID */
2047 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302048 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002049 uint32_t timeout; /* in ms */
2050 uint8_t rspReqd;
2051 tSirAggrQosReqInfo aggrInfo;
2052} tSirAggrQosReq, *tpSirAggrQosReq;
2053
2054typedef struct sSirAggrQosRspInfo {
2055 uint16_t tspecIdx;
2056 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
2057} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
2058
2059typedef struct sSirAggrQosRsp {
2060 uint16_t messageType;
2061 uint16_t length;
2062 uint8_t sessionId;
2063 tSirAggrQosRspInfo aggrInfo;
2064} tSirAggrQosRsp, *tpSirAggrQosRsp;
2065
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002066
2067typedef struct sSirQosMapSet {
2068 uint8_t present;
2069 uint8_t num_dscp_exceptions;
2070 uint8_t dscp_exceptions[21][2];
2071 uint8_t dscp_range[8][2];
2072} tSirQosMapSet, *tpSirQosMapSet;
2073
2074typedef struct sSmeIbssPeerInd {
2075 uint16_t mesgType;
2076 uint16_t mesgLen;
2077 uint8_t sessionId;
2078
Anurag Chouhan6d760662016-02-20 16:05:43 +05302079 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002080 uint16_t staId;
2081
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002082 /* Beacon will be appended for new Peer indication. */
2083} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
2084
2085typedef struct sSirIbssPeerInactivityInd {
2086 uint8_t bssIdx;
2087 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302088 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002089} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
2090
2091typedef struct sLimScanChn {
2092 uint16_t numTimeScan; /* how many time this channel is scan */
2093 uint8_t channelId;
2094} tLimScanChn;
2095
gaoleze5108942017-03-31 16:56:42 +08002096/**
2097 * struct lim_channel_status
2098 * @channelfreq: Channel freq
2099 * @noise_floor: Noise Floor value
2100 * @rx_clear_count: rx clear count
2101 * @cycle_count: cycle count
2102 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
2103 * @chan_tx_pwr_throughput: channel tx power per throughput
2104 * @rx_frame_count: rx frame count (cumulative)
2105 * @bss_rx_cycle_count: BSS rx cycle count
2106 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
2107 * @tx_frame_count: BSS tx cycle count
2108 * @mac_clk_mhz: sample frequency
2109 * @channel_id: channel index
2110 * @cmd_flags: indicate which stat event is this status coming from
2111 */
2112struct lim_channel_status {
2113 uint32_t channelfreq;
2114 uint32_t noise_floor;
2115 uint32_t rx_clear_count;
2116 uint32_t cycle_count;
2117 uint32_t chan_tx_pwr_range;
2118 uint32_t chan_tx_pwr_throughput;
2119 uint32_t rx_frame_count;
2120 uint32_t bss_rx_cycle_count;
2121 uint32_t rx_11b_mode_data_duration;
2122 uint32_t tx_frame_count;
2123 uint32_t mac_clk_mhz;
2124 uint32_t channel_id;
2125 uint32_t cmd_flags;
2126};
2127
2128/**
2129 * struct lim_scan_channel_status
2130 * @total_channel: total number of be scanned channel
2131 * @channel_status_list: channel status info store in this array
2132 */
2133struct lim_scan_channel_status {
2134 uint8_t total_channel;
2135 struct lim_channel_status
2136 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2137};
2138
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002139typedef struct sSmeGetScanChnRsp {
2140 /* Message Type */
2141 uint16_t mesgType;
2142 /* Message Length */
2143 uint16_t mesgLen;
2144 uint8_t sessionId;
2145 uint8_t numChn;
2146 tLimScanChn scanChn[1];
2147} tSmeGetScanChnRsp, *tpSmeGetScanChnRsp;
2148
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002149typedef struct sSirSmeGetAssocSTAsReq {
2150 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
2151 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302152 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002153 uint16_t modId;
2154 void *pUsrContext;
2155 void *pSapEventCallback;
2156 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
2157 void *pAssocStasArray;
2158} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
2159
2160typedef struct sSmeMaxAssocInd {
2161 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
2162 uint16_t mesgLen;
2163 uint8_t sessionId;
2164 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302165 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002166} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
2167
2168typedef struct sSmeCsaOffloadInd {
2169 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
2170 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302171 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002172} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
2173
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002174#define SIR_MAX_NAME_SIZE 64
2175#define SIR_MAX_TEXT_SIZE 32
2176
2177typedef struct sSirName {
2178 uint8_t num_name;
2179 uint8_t name[SIR_MAX_NAME_SIZE];
2180} tSirName;
2181
2182typedef struct sSirText {
2183 uint8_t num_text;
2184 uint8_t text[SIR_MAX_TEXT_SIZE];
2185} tSirText;
2186
2187#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
2188#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
2189#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
2190#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
2191#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
2192#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2193#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
2194#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
2195#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
2196#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
2197#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
2198#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
2199#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
2200#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
2201#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
2202#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
2203
2204typedef struct sSirWPSProbeRspIE {
2205 uint32_t FieldPresent;
2206 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2207 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2208 bool APSetupLocked; /* Must be included if value is true */
2209 /*
2210 * BOOL: indicates if the user has recently activated a Registrar to
2211 * add an Enrollee.
2212 */
2213 bool SelectedRegistra;
2214 uint16_t DevicePasswordID; /* Device Password ID */
2215 /* Selected Registrar config method */
2216 uint16_t SelectedRegistraCfgMethod;
2217 uint8_t ResponseType; /* Response type */
2218 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
2219 tSirName Manufacture;
2220 tSirText ModelName;
2221 tSirText ModelNumber;
2222 tSirText SerialNumber;
2223 /* Device Category ID: 1Computer, 2Input Device, ... */
2224 uint32_t PrimaryDeviceCategory;
2225 /* Vendor specific OUI for Device Sub Category */
2226 uint8_t PrimaryDeviceOUI[4];
2227 /*
2228 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
2229 * is computer
2230 */
2231 uint32_t DeviceSubCategory;
2232 tSirText DeviceName;
2233 uint16_t ConfigMethod; /* Configuaration method */
2234 uint8_t RFBand; /* RF bands available on the AP */
2235} tSirWPSProbeRspIE;
2236
2237#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
2238#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
2239#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
2240#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
2241#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
2242#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2243#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
2244#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
2245#define SIR_WPS_UUID_LEN 16
2246
2247typedef struct sSirWPSBeaconIE {
2248 uint32_t FieldPresent;
2249 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2250 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2251 bool APSetupLocked; /* Must be included if value is true */
2252 /*
2253 * BOOL: indicates if the user has recently activated a Registrar to
2254 * add an Enrollee.
2255 */
2256 bool SelectedRegistra;
2257 uint16_t DevicePasswordID; /* Device Password ID */
2258 /* Selected Registrar config method */
2259 uint16_t SelectedRegistraCfgMethod;
2260 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
2261 uint8_t RFBand; /* RF bands available on the AP */
2262} tSirWPSBeaconIE;
2263
2264#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
2265#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
2266
2267typedef struct sSirWPSAssocRspIE {
2268 uint32_t FieldPresent;
2269 uint32_t Version;
2270 uint8_t ResposeType;
2271} tSirWPSAssocRspIE;
2272
2273typedef struct sSirAPWPSIEs {
2274 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
2275 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
2276 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
2277} tSirAPWPSIEs, *tpSiriAPWPSIEs;
2278
2279typedef struct sSirUpdateAPWPSIEsReq {
2280 uint16_t messageType; /* eWNI_SME_UPDATE_APWPSIE_REQ */
2281 uint16_t length;
2282 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302283 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002284 uint8_t sessionId; /* Session ID */
2285 tSirAPWPSIEs APWPSIEs;
2286} tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq;
2287
Naveen Rawat8029a402017-06-01 10:54:19 -07002288struct update_config {
2289 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
2290 uint16_t length;
2291 uint8_t sme_session_id;
2292 uint16_t capab;
2293 uint32_t value;
2294};
2295
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302296/*
2297 * enum sir_update_session_param_type - session param type
2298 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302299 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302300 */
2301enum sir_update_session_param_type {
2302 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302303 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302304};
2305
2306/*
2307 * struct sir_update_session_param
2308 * @message_type: SME message type
2309 * @length: size of struct sir_update_session_param
2310 * @session_id: Session ID
2311 * @param_type: parameter to be updated
2312 * @param_val: Parameter value to update
2313 */
2314struct sir_update_session_param {
2315 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002316 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302317 uint8_t session_id;
2318 uint32_t param_type;
2319 uint32_t param_val;
2320};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002321
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002322/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002323 * struct sir_set_he_bss_color
2324 * @message_type: SME message type
2325 * @length: size of struct sir_set_he_bss_color
2326 * @session_id: Session ID
2327 * @bss_color: bss color value
2328 */
2329struct sir_set_he_bss_color {
2330 uint16_t message_type;
2331 uint16_t length;
2332 uint8_t session_id;
2333 uint8_t bss_color;
2334};
2335
2336/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002337 * struct sir_create_session - Used for creating session in monitor mode
2338 * @type: SME host message type.
2339 * @msg_len: Length of the message.
2340 * @bss_id: bss_id for creating the session.
2341 */
2342struct sir_create_session {
2343 uint16_t type;
2344 uint16_t msg_len;
2345 struct qdf_mac_addr bss_id;
2346};
2347
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002348/* Beacon Interval */
2349typedef struct sSirChangeBIParams {
2350 uint16_t messageType;
2351 uint16_t length;
2352 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302353 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002354 uint8_t sessionId; /* Session ID */
2355} tSirChangeBIParams, *tpSirChangeBIParams;
2356
2357#ifdef QCA_HT_2040_COEX
2358typedef struct sSirSetHT2040Mode {
2359 uint16_t messageType;
2360 uint16_t length;
2361 uint8_t cbMode;
2362 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302363 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002364 uint8_t sessionId; /* Session ID */
2365} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
2366#endif
2367
2368#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
2369
2370typedef struct sSirWPSPBCSession {
2371 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302372 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002373 uint8_t uuid_e[SIR_WPS_UUID_LEN];
2374 uint32_t timestamp;
2375} tSirWPSPBCSession;
2376
2377typedef struct sSirSmeGetWPSPBCSessionsReq {
2378 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
2379 uint16_t length;
2380 void *pUsrContext;
2381 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302382 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002383 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302384 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002385} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
2386
2387typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302388 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002389 uint16_t probeReqIELen;
2390 uint8_t probeReqIE[512];
2391} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
2392
2393/* probereq from peer, when wsc is enabled */
2394typedef struct sSirSmeProbeReqInd {
2395 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
2396 uint16_t length;
2397 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302398 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002399 tSirWPSPBCProbeReq WPSPBCProbeReq;
2400} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
2401
2402typedef struct sSirUpdateAPWPARSNIEsReq {
2403 uint16_t messageType; /* eWNI_SME_SET_APWPARSNIEs_REQ */
2404 uint16_t length;
2405 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302406 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002407 uint8_t sessionId; /* Session ID */
2408 tSirRSNie APWPARSNIEs;
2409} tSirUpdateAPWPARSNIEsReq, *tpSirUpdateAPWPARSNIEsReq;
2410
2411#define SIR_ROAM_MAX_CHANNELS 80
2412#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2413/* Occupied channel list remains static */
2414#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05302415/* Occupied channel list can be dynamic */
2416#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002417#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2418#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2419#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2420
2421#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2422#define SIR_ROAM_SCAN_PSK_SIZE 32
2423#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2424#endif
2425/* SME -> HAL - This is the host offload request. */
2426#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2427#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2428#define SIR_IPV6_NS_OFFLOAD 2
2429#define SIR_OFFLOAD_DISABLE 0
2430#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002431
2432#ifdef WLAN_NS_OFFLOAD
2433typedef struct sSirNsOffloadReq {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002434 uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002435 uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
2436 uint8_t targetIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302437 struct qdf_mac_addr self_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002438 uint8_t srcIPv6AddrValid;
2439 uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairamc0873582016-07-26 17:34:57 +05302440 uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002441 uint8_t slotIdx;
2442} tSirNsOffloadReq, *tpSirNsOffloadReq;
2443#endif /* WLAN_NS_OFFLOAD */
2444
2445typedef struct sSirHostOffloadReq {
2446 uint8_t offloadType;
2447 uint8_t enableOrDisable;
2448 uint32_t num_ns_offload_count;
2449 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002450 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2451 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002452 } params;
2453#ifdef WLAN_NS_OFFLOAD
2454 tSirNsOffloadReq nsOffloadInfo;
2455#endif /* WLAN_NS_OFFLOAD */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302456 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002457} tSirHostOffloadReq, *tpSirHostOffloadReq;
2458
2459/* Packet Types. */
2460#define SIR_KEEP_ALIVE_NULL_PKT 1
2461#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2462
2463/* Keep Alive request. */
2464typedef struct sSirKeepAliveReq {
2465 uint8_t packetType;
2466 uint32_t timePeriod;
2467 tSirIpv4Addr hostIpv4Addr;
2468 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302469 struct qdf_mac_addr dest_macaddr;
2470 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002471 uint8_t sessionId;
2472} tSirKeepAliveReq, *tpSirKeepAliveReq;
2473
2474typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302475 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002476 uint32_t rxChan;
2477 uint8_t sessionId;
2478 uint8_t frameType;
2479 int8_t rxRssi;
2480 uint8_t frameBuf[1]; /* variable */
2481} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2482
Abhishek Singh7996eb72015-12-30 17:24:02 +05302483typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2484/**
2485 * struct sir_sme_mgmt_frame_cb_req - Register a
2486 * management frame callback req
2487 *
2488 * @message_type: message id
2489 * @length: msg length
2490 * @callback: callback for management frame indication
2491 */
2492struct sir_sme_mgmt_frame_cb_req {
2493 uint16_t message_type;
2494 uint16_t length;
2495 sir_mgmt_frame_ind_callback callback;
2496};
2497
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002498#ifdef WLAN_FEATURE_11W
2499typedef struct sSirSmeUnprotMgmtFrameInd {
2500 uint8_t sessionId;
2501 uint8_t frameType;
2502 uint8_t frameLen;
2503 uint8_t frameBuf[1]; /* variable */
2504} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2505#endif
2506
2507#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2508 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2509 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2510#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2511 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2512 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2513
2514/* P2P Power Save Related */
2515typedef struct sSirNoAParam {
2516 uint8_t ctWindow:7;
2517 uint8_t OppPS:1;
2518 uint8_t count;
2519 uint32_t duration;
2520 uint32_t interval;
2521 uint32_t singleNoADuration;
2522 uint8_t psSelection;
2523} tSirNoAParam, *tpSirNoAParam;
2524
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002525typedef struct sSirWlanResumeParam {
2526 uint8_t configuredMcstBcstFilterSetting;
2527} tSirWlanResumeParam, *tpSirWlanResumeParam;
2528
2529#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2530
2531typedef enum ext_wow_type {
2532 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2533 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2534 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2535} EXT_WOW_TYPE;
2536
2537typedef struct {
2538 uint8_t vdev_id;
2539 EXT_WOW_TYPE type;
2540 uint32_t wakeup_pin_num;
2541} tSirExtWoWParams, *tpSirExtWoWParams;
2542
2543typedef struct {
2544 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302545 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002546 uint8_t identification_id[8];
2547 uint8_t password[16];
2548 uint32_t id_length;
2549 uint32_t pass_length;
2550} tSirAppType1Params, *tpSirAppType1Params;
2551
2552typedef struct {
2553 uint8_t vdev_id;
2554
2555 uint8_t rc4_key[16];
2556 uint32_t rc4_key_len;
2557
2558 /** ip header parameter */
2559 uint32_t ip_id; /* NC id */
2560 uint32_t ip_device_ip; /* NC IP address */
2561 uint32_t ip_server_ip; /* Push server IP address */
2562
2563 /** tcp header parameter */
2564 uint16_t tcp_src_port; /* NC TCP port */
2565 uint16_t tcp_dst_port; /* Push server TCP port */
2566 uint32_t tcp_seq;
2567 uint32_t tcp_ack_seq;
2568
2569 uint32_t keepalive_init; /* Initial ping interval */
2570 uint32_t keepalive_min; /* Minimum ping interval */
2571 uint32_t keepalive_max; /* Maximum ping interval */
2572 uint32_t keepalive_inc; /* Increment of ping interval */
2573
Anurag Chouhan6d760662016-02-20 16:05:43 +05302574 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002575 uint32_t tcp_tx_timeout_val;
2576 uint32_t tcp_rx_timeout_val;
2577} tSirAppType2Params, *tpSirAppType2Params;
2578#endif
2579
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002580#define ANI_MAX_IBSS_ROUTE_TABLE_ENTRY 100
2581
2582typedef struct sAniDestIpNextHopMacPair {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302583 uint8_t destIpv4Addr[QDF_IPV4_ADDR_SIZE];
2584 uint8_t nextHopMacAddr[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002585} tAniDestIpNextHopMacPair;
2586
2587typedef struct sAniIbssRouteTable {
2588 uint8_t sessionId;
2589 uint16_t numEntries;
2590 tAniDestIpNextHopMacPair destIpNextHopPair[1];
2591} tAniIbssRouteTable;
2592
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002593#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2594typedef struct {
2595 uint8_t acvo_uapsd:1;
2596 uint8_t acvi_uapsd:1;
2597 uint8_t acbk_uapsd:1;
2598 uint8_t acbe_uapsd:1;
2599 uint8_t reserved:4;
2600} tSirAcUapsd, *tpSirAcUapsd;
2601#endif
2602
2603typedef struct {
2604 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302605 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002606 uint32_t authentication;
2607 uint8_t encryption;
2608 uint8_t mcencryption;
2609 uint8_t ChannelCount;
2610 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2611#ifdef WLAN_FEATURE_11W
2612 bool mfp_enabled;
2613#endif
2614
2615} tSirRoamNetworkType;
2616
2617typedef struct SirMobilityDomainInfo {
2618 uint8_t mdiePresent;
2619 uint16_t mobilityDomain;
2620} tSirMobilityDomainInfo;
2621
2622typedef enum {
2623 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2624 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2625 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2626} eSirDFSRoamScanMode;
2627#define MAX_SSID_ALLOWED_LIST 4
2628#define MAX_BSSID_AVOID_LIST 16
2629#define MAX_BSSID_FAVORED 16
2630/**
2631 * struct roam_ext_params - Structure holding roaming parameters
2632 * @num_bssid_avoid_list: The number of BSSID's that we should
2633 * avoid connecting to. It is like a
2634 * blacklist of BSSID's.
2635 * @num_ssid_allowed_list: The number of SSID profiles that are
2636 * in the Whitelist. When roaming, we
2637 * consider the BSSID's with this SSID
2638 * also for roaming apart from the connected one's
2639 * @num_bssid_favored: Number of BSSID's which have a preference over
2640 * others
2641 * @ssid_allowed_list: Whitelist SSID's
2642 * @bssid_avoid_list: Blacklist SSID's
2643 * @bssid_favored: Favorable BSSID's
2644 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2645 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2646 * raise_factor_5g (boost factor) should be
2647 * applied.
2648 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2649 * drop_factor_5g (penalty factor) should be
2650 * applied
2651 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2652 * @raise_factor_5g: Boost factor
2653 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2654 * @drop_factor_5g: Penalty factor
2655 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2656 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2657 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2658 * scan should be performed.
2659 * @rssi_diff: RSSI difference for the AP to be better over the
2660 * current AP to avoid ping pong effects
2661 * @good_rssi_roam: Lazy Roam
2662 * @is_5g_pref_enabled: 5GHz BSSID preference feature enable/disable.
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002663 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302664 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002665 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002666 *
2667 * This structure holds all the key parameters related to
2668 * initial connection and also roaming connections.
2669 * */
2670struct roam_ext_params {
2671 uint8_t num_bssid_avoid_list;
2672 uint8_t num_ssid_allowed_list;
2673 uint8_t num_bssid_favored;
2674 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302675 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2676 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002677 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2678 int raise_rssi_thresh_5g;
2679 int drop_rssi_thresh_5g;
2680 uint8_t raise_rssi_type_5g;
2681 uint8_t raise_factor_5g;
2682 uint8_t drop_rssi_type_5g;
2683 uint8_t drop_factor_5g;
2684 int max_raise_rssi_5g;
2685 int max_drop_rssi_5g;
2686 int alert_rssi_threshold;
2687 int rssi_diff;
2688 int good_rssi_roam;
2689 bool is_5g_pref_enabled;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302690 int dense_rssi_thresh_offset;
2691 int dense_min_aps_cnt;
2692 int initial_dense_status;
2693 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302694 uint8_t num_rssi_rejection_ap;
2695 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002696 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302697 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002698 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002699};
2700
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002701/**
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302702 * struct sir_weight_config - weight params to
2703 * calculate best candidate
2704 * @rssi_weightage: RSSI weightage
2705 * @ht_caps_weightage: HT caps weightage
2706 * @vht_caps_weightage: VHT caps weightage
2707 * @he_caps_weightage: HE caps weightage
2708 * @chan_width_weightage: Channel width weightage
2709 * @chan_band_weightage: Channel band weightage
2710 * @nss_weightage: NSS weightage
2711 * @beamforming_cap_weightage: Beamforming caps weightage
2712 * @pcl_weightage: PCL weightage
2713 * @channel_congestion_weightage: channel congestion weightage
2714 * @oce_wan_weightage: OCE WAN metrics weightage
2715 */
2716struct sir_weight_config {
2717 uint8_t rssi_weightage;
2718 uint8_t ht_caps_weightage;
2719 uint8_t vht_caps_weightage;
2720 uint8_t he_caps_weightage;
2721 uint8_t chan_width_weightage;
2722 uint8_t chan_band_weightage;
2723 uint8_t nss_weightage;
2724 uint8_t beamforming_cap_weightage;
2725 uint8_t pcl_weightage;
2726 uint8_t channel_congestion_weightage;
2727 uint8_t oce_wan_weightage;
2728};
2729
2730struct sir_rssi_cfg_score {
2731 uint32_t best_rssi_threshold;
2732 uint32_t good_rssi_threshold;
2733 uint32_t bad_rssi_threshold;
2734 uint32_t good_rssi_pcnt;
2735 uint32_t bad_rssi_pcnt;
2736 uint32_t good_rssi_bucket_size;
2737 uint32_t bad_rssi_bucket_size;
2738 uint32_t rssi_pref_5g_rssi_thresh;
2739};
2740
2741/**
2742 * struct sir_per_slot_scoring - define % score for differents slots for a
2743 * scoring param.
2744 * num_slot: number of slots in which the param will be divided.
2745 * Max 15. index 0 is used for 'not_present. Num_slot will
2746 * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
2747 * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
2748 * score_pcnt3_to_0: Conatins score percentage for slot 0-3
2749 * BITS 0-7 :- the scoring pcnt when not present
2750 * BITS 8-15 :- SLOT_1
2751 * BITS 16-23 :- SLOT_2
2752 * BITS 24-31 :- SLOT_3
2753 * score_pcnt7_to_4: Conatins score percentage for slot 4-7
2754 * BITS 0-7 :- SLOT_4
2755 * BITS 8-15 :- SLOT_5
2756 * BITS 16-23 :- SLOT_6
2757 * BITS 24-31 :- SLOT_7
2758 * score_pcnt11_to_8: Conatins score percentage for slot 8-11
2759 * BITS 0-7 :- SLOT_8
2760 * BITS 8-15 :- SLOT_9
2761 * BITS 16-23 :- SLOT_10
2762 * BITS 24-31 :- SLOT_11
2763 * score_pcnt15_to_12: Conatins score percentage for slot 12-15
2764 * BITS 0-7 :- SLOT_12
2765 * BITS 8-15 :- SLOT_13
2766 * BITS 16-23 :- SLOT_14
2767 * BITS 24-31 :- SLOT_15
2768 */
2769struct sir_per_slot_scoring {
2770 uint32_t num_slot;
2771 uint32_t score_pcnt3_to_0;
2772 uint32_t score_pcnt7_to_4;
2773 uint32_t score_pcnt11_to_8;
2774 uint32_t score_pcnt15_to_12;
2775};
2776
2777struct sir_score_config {
2778 bool enable_scoring_for_roam;
2779 struct sir_weight_config weight_cfg;
2780 struct sir_rssi_cfg_score rssi_score;
2781 struct sir_per_slot_scoring esp_qbss_scoring;
2782 struct sir_per_slot_scoring oce_wan_scoring;
2783 uint32_t bandwidth_weight_per_index;
2784 uint32_t nss_weight_per_index;
2785 uint32_t band_weight_per_index;
2786};
2787
2788/**
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002789 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2790 * @fw_okc: Opportunistic key caching enable in firmware
2791 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2792 * visited BSSID/PMK pairs
2793 */
2794struct pmkid_mode_bits {
2795 uint32_t fw_okc:1;
2796 uint32_t fw_pmksa_cache:1;
2797 uint32_t unused:30;
2798};
2799
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302800/**
2801 * struct lca_disallow_config_params - LCA[Last Connected AP]
2802 * disallow config params
2803 * @disallow_duration: LCA AP disallowed duration
2804 * @rssi_channel_penalization: RSSI channel Penalization
2805 * @num_disallowed_aps: Maximum number of AP's in LCA list
2806 *
2807 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002808struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302809 uint32_t disallow_duration;
2810 uint32_t rssi_channel_penalization;
2811 uint32_t num_disallowed_aps;
2812};
2813
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002814/**
2815 * struct mawc_params - Motion Aided Wireless Connectivity configuration
2816 * @MAWCEnabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
2817 * @mawc_roam_enabled: MAWC roaming enable/disable
2818 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2819 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2820 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2821 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2822 */
2823struct mawc_params {
2824 bool mawc_enabled;
2825 bool mawc_roam_enabled;
2826 uint32_t mawc_roam_traffic_threshold;
2827 int8_t mawc_roam_ap_rssi_threshold;
2828 uint8_t mawc_roam_rssi_high_adjust;
2829 uint8_t mawc_roam_rssi_low_adjust;
2830};
2831
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002832typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302833 uint16_t message_type;
2834 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002835 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002836 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002837 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002838 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002839 uint8_t delay_before_vdev_stop;
2840 uint8_t OpportunisticScanThresholdDiff;
2841 uint8_t RoamRescanRssiDiff;
2842 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302843 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302844 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002845 uint8_t ChannelCacheType;
2846 uint8_t Command;
2847 uint8_t reason;
2848 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302849 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002850 uint16_t NeighborRoamScanRefreshPeriod;
2851 uint16_t NeighborScanChannelMinTime;
2852 uint16_t NeighborScanChannelMaxTime;
2853 uint16_t EmptyRefreshScanPeriod;
2854 uint8_t ValidChannelCount;
2855 uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS];
2856 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302857 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002858 uint8_t nProbes;
2859 uint16_t HomeAwayTime;
2860 tSirRoamNetworkType ConnectedNetwork;
2861 tSirMobilityDomainInfo MDID;
2862 uint8_t sessionId;
2863 uint8_t RoamBmissFirstBcnt;
2864 uint8_t RoamBmissFinalBcnt;
2865 uint8_t RoamBeaconRssiWeight;
2866 eSirDFSRoamScanMode allowDFSChannelRoam;
2867#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2868 uint8_t RoamOffloadEnabled;
2869 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2870 uint32_t pmk_len;
2871 uint8_t Prefer5GHz;
2872 uint8_t RoamRssiCatGap;
2873 uint8_t Select5GHzMargin;
2874 uint8_t KRK[SIR_KRK_KEY_LEN];
2875 uint8_t BTK[SIR_BTK_KEY_LEN];
2876 uint32_t ReassocFailureTimeout;
2877 tSirAcUapsd AcUapsd;
2878 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2879 uint32_t R0KH_ID_Length;
2880 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002881 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002882#endif
2883 struct roam_ext_params roam_params;
2884 uint8_t middle_of_roaming;
2885 uint32_t hi_rssi_scan_max_count;
2886 uint32_t hi_rssi_scan_rssi_delta;
2887 uint32_t hi_rssi_scan_delay;
2888 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002889 uint8_t early_stop_scan_enable;
2890 int8_t early_stop_scan_min_threshold;
2891 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002892 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302893 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302894 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302895 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302896#ifdef WLAN_FEATURE_FILS_SK
2897 bool is_fils_connection;
2898 struct roam_fils_params roam_fils_params;
2899#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302900 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002901 uint32_t btm_solicited_timeout;
2902 uint32_t btm_max_attempt_cnt;
2903 uint32_t btm_sticky_time;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302904 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302905 uint32_t ho_delay_for_rx;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302906 uint32_t min_delay_btw_roam_scans;
2907 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302908 bool roam_force_rssi_trigger;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002909} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
2910
2911typedef struct sSirRoamOffloadScanRsp {
2912 uint8_t sessionId;
2913 uint32_t reason;
2914} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
2915
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002916/*---------------------------------------------------------------------------
2917 Packet Filtering Parameters
2918 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002919#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002920#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002921#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2922#define SIR_MAX_NUM_FILTERS 20
2923#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2924
Qiwei Cai4505fc62018-05-17 18:35:19 +08002925#ifdef WLAN_FEATURE_PACKET_FILTERING
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002926/* */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002927/* Filter Packet Match Count Parameters */
2928/* */
2929typedef struct sSirRcvFltPktMatchCnt {
2930 uint8_t filterId;
2931 uint32_t matchCnt;
2932} tSirRcvFltPktMatchCnt, tpSirRcvFltPktMatchCnt;
2933
2934typedef struct sSirRcvFltPktMatchRsp {
2935 uint16_t mesgType;
2936 uint16_t mesgLen;
2937
2938 /* Success or Failure */
2939 uint32_t status;
2940 tSirRcvFltPktMatchCnt filterMatchCnt[SIR_MAX_NUM_FILTERS];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302941 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002942} tSirRcvFltPktMatchRsp, *tpSirRcvFltPktMatchRsp;
2943
2944/* */
2945/* Receive Filter Clear Parameters */
2946/* */
2947typedef struct sSirRcvFltPktClearParam {
2948 uint32_t status; /* only valid for response message */
2949 uint8_t filterId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302950 struct qdf_mac_addr self_macaddr;
2951 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002952} tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
Qiwei Cai4505fc62018-05-17 18:35:19 +08002953#endif /* WLAN_FEATURE_PACKET_FILTERING */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002954
2955/* */
2956/* Multicast Address List Parameters */
2957/* */
2958typedef struct sSirRcvFltMcAddrList {
2959 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302960 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2961 struct qdf_mac_addr self_macaddr;
2962 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002963 uint8_t action;
2964} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002965
2966/* */
2967/* Generic version information */
2968/* */
2969typedef struct {
2970 uint8_t revision;
2971 uint8_t version;
2972 uint8_t minor;
2973 uint8_t major;
2974} tSirVersionType;
2975
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002976/**
2977 * struct sir_wifi_start_log - Structure to store the params sent to start/
2978 * stop logging
2979 * @name: Attribute which indicates the type of logging like per packet
2980 * statistics, connectivity etc.
2981 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302982 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002983 * @ini_triggered: triggered using ini
2984 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302985 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302986 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002987 */
2988struct sir_wifi_start_log {
2989 uint32_t ring_id;
2990 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302991 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002992 bool ini_triggered;
2993 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302994 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302995 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002996};
2997
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002998
2999/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003000 * struct sir_pcl_list - Format of PCL
3001 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303002 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003003 * @pcl_len: Number of channels in the PCL
3004 */
3005struct sir_pcl_list {
3006 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303007 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003008 uint32_t pcl_len;
3009};
3010
3011/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303012 * struct sir_pcl_chan_weights - Params to get the valid weighed list
3013 * @pcl_list: Preferred channel list already sorted in the order of preference
3014 * @pcl_len: Length of the PCL
3015 * @saved_chan_list: Valid channel list updated as part of
3016 * WMA_UPDATE_CHAN_LIST_REQ
3017 * @saved_num_chan: Length of the valid channel list
3018 * @weighed_valid_list: Weights of the valid channel list. This will have one
3019 * to one mapping with valid_chan_list. FW expects channel order and size to be
3020 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3021 * @weight_list: Weights assigned by policy manager
3022 */
3023struct sir_pcl_chan_weights {
3024 uint8_t pcl_list[128];
3025 uint32_t pcl_len;
3026 uint8_t saved_chan_list[128];
3027 uint32_t saved_num_chan;
3028 uint8_t weighed_valid_list[128];
3029 uint8_t weight_list[128];
3030};
3031
3032/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003033 * struct sir_hw_mode_params - HW mode params
3034 * @mac0_tx_ss: MAC0 Tx spatial stream
3035 * @mac0_rx_ss: MAC0 Rx spatial stream
3036 * @mac1_tx_ss: MAC1 Tx spatial stream
3037 * @mac1_rx_ss: MAC1 Rx spatial stream
3038 * @mac0_bw: MAC0 bandwidth
3039 * @mac1_bw: MAC1 bandwidth
3040 * @dbs_cap: DBS capabality
3041 * @agile_dfs_cap: Agile DFS capabality
3042 */
3043struct sir_hw_mode_params {
3044 uint8_t mac0_tx_ss;
3045 uint8_t mac0_rx_ss;
3046 uint8_t mac1_tx_ss;
3047 uint8_t mac1_rx_ss;
3048 uint8_t mac0_bw;
3049 uint8_t mac1_bw;
3050 uint8_t dbs_cap;
3051 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05303052 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003053};
3054
3055/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003056 * struct sir_set_hw_mode_resp - HW mode response
3057 * @status: Status
3058 * @cfgd_hw_mode_index: Configured HW mode index
3059 * @num_vdev_mac_entries: Number of vdev-mac id entries
3060 * @vdev_mac_map: vdev id-mac id map
3061 */
3062struct sir_set_hw_mode_resp {
3063 uint32_t status;
3064 uint32_t cfgd_hw_mode_index;
3065 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08003066 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003067};
3068
3069/**
3070 * struct sir_hw_mode_trans_ind - HW mode transition indication
3071 * @old_hw_mode_index: Index of old HW mode
3072 * @new_hw_mode_index: Index of new HW mode
3073 * @num_vdev_mac_entries: Number of vdev-mac id entries
3074 * @vdev_mac_map: vdev id-mac id map
3075 */
3076struct sir_hw_mode_trans_ind {
3077 uint32_t old_hw_mode_index;
3078 uint32_t new_hw_mode_index;
3079 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08003080 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003081};
3082
3083/**
3084 * struct sir_dual_mac_config_resp - Dual MAC config response
3085 * @status: Status of setting the dual mac configuration
3086 */
3087struct sir_dual_mac_config_resp {
3088 uint32_t status;
3089};
3090
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08003091/**
3092 * enum set_antenna_mode_status - Status of set antenna mode
3093 * command
3094 * @SET_ANTENNA_MODE_STATUS_OK: command successful
3095 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
3096 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
3097 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
3098 */
3099enum set_antenna_mode_status {
3100 SET_ANTENNA_MODE_STATUS_OK,
3101 SET_ANTENNA_MODE_STATUS_EINVAL,
3102 SET_ANTENNA_MODE_STATUS_ECANCELED,
3103 SET_ANTENNA_MODE_STATUS_ENOTSUP,
3104};
3105
3106/**
3107 * struct sir_antenna_mode_resp - set antenna mode response
3108 * @status: Status of setting the antenna mode
3109 */
3110struct sir_antenna_mode_resp {
3111 enum set_antenna_mode_status status;
3112};
3113
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003114/*---------------------------------------------------------------------------
3115 sAniSetTmLevelReq
3116 ---------------------------------------------------------------------------*/
3117typedef struct sAniSetTmLevelReq {
3118 uint16_t tmMode;
3119 uint16_t newTmLevel;
3120} tAniSetTmLevelReq, *tpAniSetTmLevelReq;
3121
3122#ifdef FEATURE_WLAN_TDLS
3123/* TDLS Request struct SME-->PE */
3124typedef struct sSirTdlsSendMgmtReq {
3125 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3126 uint16_t length;
3127 uint8_t sessionId; /* Session ID */
3128 uint16_t transactionId; /* Transaction ID for cmd */
3129 uint8_t reqType;
3130 uint8_t dialog;
3131 uint16_t statusCode;
3132 uint8_t responder;
3133 uint32_t peerCapability;
3134 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303135 struct qdf_mac_addr bssid;
3136 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05303137 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08003138 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003139 uint8_t addIe[1];
3140} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
3141
3142typedef enum TdlsAddOper {
3143 TDLS_OPER_NONE,
3144 TDLS_OPER_ADD,
3145 TDLS_OPER_UPDATE
3146} eTdlsAddOper;
3147
3148/* TDLS Request struct SME-->PE */
3149typedef struct sSirTdlsAddStaReq {
3150 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3151 uint16_t length;
3152 uint8_t sessionId; /* Session ID */
3153 uint16_t transactionId; /* Transaction ID for cmd */
3154 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303155 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003156 eTdlsAddOper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303157 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003158 uint16_t capability;
3159 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
3160 uint8_t supported_rates_length;
3161 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
3162 uint8_t htcap_present;
3163 tSirHTCap htCap;
3164 uint8_t vhtcap_present;
3165 tSirVHTCap vhtCap;
3166 uint8_t uapsd_queues;
3167 uint8_t max_sp;
3168} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
3169
3170/* TDLS Response struct PE-->SME */
3171typedef struct sSirTdlsAddStaRsp {
3172 uint16_t messageType;
3173 uint16_t length;
3174 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303175 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003176 uint8_t sessionId; /* Session ID */
3177 uint16_t staId;
3178 uint16_t staType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003179 eTdlsAddOper tdlsAddOper;
Frank Liud4b2fa02017-03-29 11:46:48 +08003180 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003181} tSirTdlsAddStaRsp;
3182
3183/* TDLS Request struct SME-->PE */
3184typedef struct {
3185 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
3186 uint16_t length;
3187 uint8_t sessionId; /* Session ID */
3188 uint16_t transactionId; /* Transaction ID for cmd */
3189 uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
3190 uint8_t maxSp; /* Peer's Supported Maximum Service Period */
3191 uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
3192 /* Does Peer Support as TDLS Off Channel. */
3193 uint8_t isOffChannelSupported;
3194 uint8_t isResponder; /* Is Peer a responder. */
3195 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303196 struct qdf_mac_addr bssid;
3197 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003198 uint8_t supportedChannelsLen;
3199 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
3200 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07003201 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003202} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
3203
3204/* TDLS Request struct SME-->PE */
3205typedef struct {
3206 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
3207 uint16_t length;
3208 uint8_t sessionId; /* Session ID */
3209 uint16_t transactionId; /* Transaction ID for cmd */
3210 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303211 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003212} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
3213
3214/* TDLS Request struct SME-->PE */
3215typedef struct sSirTdlsDelStaReq {
3216 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3217 uint16_t length;
3218 uint8_t sessionId; /* Session ID */
3219 uint16_t transactionId; /* Transaction ID for cmd */
3220 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303221 struct qdf_mac_addr bssid;
3222 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003223} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
3224/* TDLS Response struct PE-->SME */
3225typedef struct sSirTdlsDelStaRsp {
3226 uint16_t messageType;
3227 uint16_t length;
3228 uint8_t sessionId; /* Session ID */
3229 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303230 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003231 uint16_t staId;
Frank Liud4b2fa02017-03-29 11:46:48 +08003232 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003233} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
3234/* TDLS Delete Indication struct PE-->SME */
3235typedef struct sSirTdlsDelStaInd {
3236 uint16_t messageType;
3237 uint16_t length;
3238 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303239 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003240 uint16_t staId;
3241 uint16_t reasonCode;
3242} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
3243typedef struct sSirTdlsDelAllPeerInd {
3244 uint16_t messageType;
3245 uint16_t length;
3246 uint8_t sessionId; /* Session ID */
3247} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003248typedef struct sSirMgmtTxCompletionInd {
3249 uint16_t messageType;
3250 uint16_t length;
3251 uint8_t sessionId; /* Session ID */
3252 uint32_t txCompleteStatus;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -07003253 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003254} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
3255
3256typedef struct sSirTdlsEventnotify {
3257 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303258 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003259 uint16_t messageType;
3260 uint32_t peer_reason;
3261} tSirTdlsEventnotify;
3262#endif /* FEATURE_WLAN_TDLS */
3263
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003264/* Reset AP Caps Changed */
3265typedef struct sSirResetAPCapsChange {
3266 uint16_t messageType;
3267 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303268 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003269} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
3270
3271/* / Definition for Candidate found indication from FW */
3272typedef struct sSirSmeCandidateFoundInd {
3273 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
3274 uint16_t length;
3275 uint8_t sessionId; /* Session Identifier */
3276} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
3277
3278#ifdef WLAN_FEATURE_11W
3279typedef struct sSirWlanExcludeUnencryptParam {
3280 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303281 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003282} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
3283#endif
3284
3285typedef enum {
3286 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
3287 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
3288} tSirP2pScanType;
3289
3290typedef struct sAniHandoffReq {
3291 /* Common for all types are requests */
3292 uint16_t msgType; /* message type is same as the request type */
3293 uint16_t msgLen; /* length of the entire request */
3294 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303295 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003296 uint8_t channel;
3297 uint8_t handoff_src;
3298} tAniHandoffReq, *tpAniHandoffReq;
3299
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003300/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003301 * sir_scan_event_type - scan event types used in LIM
3302 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
3303 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
3304 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
3305 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
3306 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
3307 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
3308 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
3309 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
3310 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003311*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003312enum sir_scan_event_type {
3313 SIR_SCAN_EVENT_STARTED = 0x1,
3314 SIR_SCAN_EVENT_COMPLETED = 0x2,
3315 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
3316 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
3317 SIR_SCAN_EVENT_DEQUEUED = 0x10,
3318 SIR_SCAN_EVENT_PREEMPTED = 0x20,
3319 SIR_SCAN_EVENT_START_FAILED = 0x40,
3320 SIR_SCAN_EVENT_RESTARTED = 0x80,
3321 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003322};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003323
3324typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003325 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003326 tSirResultCodes reasonCode;
3327 uint32_t chanFreq;
3328 uint32_t requestor;
3329 uint32_t scanId;
3330 tSirP2pScanType p2pScanType;
3331 uint8_t sessionId;
3332} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
3333
3334/**
3335 * struct sSirUpdateChanParam - channel parameters
3336 * @chanId: ID of the channel
3337 * @pwr: power level
3338 * @dfsSet: is dfs supported or not
3339 * @half_rate: is the channel operating at 10MHz
3340 * @quarter_rate: is the channel operating at 5MHz
3341 */
3342typedef struct sSirUpdateChanParam {
3343 uint8_t chanId;
3344 uint8_t pwr;
3345 bool dfsSet;
3346 bool half_rate;
3347 bool quarter_rate;
3348} tSirUpdateChanParam, *tpSirUpdateChanParam;
3349
3350typedef struct sSirUpdateChan {
3351 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003352 uint8_t ht_en;
3353 uint8_t vht_en;
3354 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003355 tSirUpdateChanParam chanParam[1];
3356} tSirUpdateChanList, *tpSirUpdateChanList;
3357
3358typedef enum eSirAddonPsReq {
3359 eSIR_ADDON_NOTHING,
3360 eSIR_ADDON_ENABLE_UAPSD,
3361 eSIR_ADDON_DISABLE_UAPSD
3362} tSirAddonPsReq;
3363
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003364#ifdef FEATURE_WLAN_CH_AVOID
3365typedef struct sSirChAvoidUpdateReq {
3366 uint32_t reserved_param;
3367} tSirChAvoidUpdateReq;
3368#endif /* FEATURE_WLAN_CH_AVOID */
3369
3370typedef struct sSirLinkSpeedInfo {
3371 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303372 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003373 uint32_t estLinkSpeed; /* Linkspeed from firmware */
3374} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
3375
Will Huanga9814592017-05-24 15:47:58 +08003376/**
3377 * struct sir_peer_info_req - peer info request struct
3378 * @peer_macaddr: MAC address
3379 * @sessionid: vdev id
3380 *
3381 * peer info request message's struct
3382 */
3383struct sir_peer_info_req {
3384 struct qdf_mac_addr peer_macaddr;
3385 uint8_t sessionid;
3386};
3387
3388/**
3389 * struct sir_peer_info - peer information struct
3390 * @peer_macaddr: MAC address
3391 * @rssi: rssi
3392 * @tx_rate: last tx rate
3393 * @rx_rate: last rx rate
3394 *
3395 * a station's information
3396 */
3397struct sir_peer_info {
3398 struct qdf_mac_addr peer_macaddr;
3399 int8_t rssi;
3400 uint32_t tx_rate;
3401 uint32_t rx_rate;
3402};
3403
3404/**
3405 * struct sir_peer_info_resp - all peers information struct
3406 * @count: peer's number
3407 * @info: peer information
3408 *
3409 * all station's information
3410 */
3411struct sir_peer_info_resp {
3412 uint8_t count;
3413 struct sir_peer_info info[0];
3414};
3415
3416/**
3417 * struct sir_peer_info_ext_req - peer info request struct
3418 * @peer_macaddr: MAC address
3419 * @sessionid: vdev id
3420 * @reset_after_request: fw reset statistics after query
3421 *
3422 * peer info request message's struct
3423 */
3424struct sir_peer_info_ext_req {
3425 struct qdf_mac_addr peer_macaddr;
3426 uint8_t sessionid;
3427 uint8_t reset_after_request;
3428};
3429
3430/**
3431 * struct sir_peer_info_ext - peer info information struct
3432 * (refer to station_info struct in Kernel)
3433 * @peer_macaddr: MAC address
3434 * @tx_packets: packets transmitted to this station
3435 * @tx_bytes: bytes transmitted to this station
3436 * @rx_packets: packets received from this station
3437 * @rx_bytes: bytes received from this station
3438 * @rx_retries: cumulative retry counts
3439 * @tx_failed: number of failed transmissions
3440 * @rssi: The signal strength
3441 * @tx_rate: last used tx bitrate (kbps)
3442 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
3443 * @rx_rate: last used rx bitrate (kbps)
3444 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
3445 *
3446 * a station's information
3447 */
3448struct sir_peer_info_ext {
3449 struct qdf_mac_addr peer_macaddr;
3450 uint32_t tx_packets;
3451 uint64_t tx_bytes;
3452 uint32_t rx_packets;
3453 uint64_t rx_bytes;
3454 uint32_t tx_retries;
3455 uint32_t tx_failed;
3456 int32_t rssi;
3457 uint32_t tx_rate;
3458 uint32_t tx_rate_code;
3459 uint32_t rx_rate;
3460 uint32_t rx_rate_code;
3461};
3462
3463/**
3464 * struct sir_peer_info_ext_resp - all peers' information struct
3465 * @count: peer's number
3466 * @info: peer information
3467 *
3468 * all station's information
3469 */
3470struct sir_peer_info_ext_resp {
3471 uint8_t count;
3472 struct sir_peer_info_ext info[0];
3473};
3474
Will Huang496b36c2017-07-11 16:38:50 +08003475/**
3476 * @sta_num: number of peer station which has valid info
3477 * @info: peer information
3478 *
3479 * all SAP peer station's information retrieved
3480 */
3481struct sir_peer_sta_info {
3482 uint8_t sta_num;
3483 struct sir_peer_info info[MAX_PEER_STA];
3484};
3485
3486/**
3487 * @sta_num: number of peer station which has valid info
3488 * @info: peer extended information
3489 *
3490 * all SAP peer station's extended information retrieved
3491 */
3492struct sir_peer_sta_ext_info {
3493 uint8_t sta_num;
3494 struct sir_peer_info_ext info[MAX_PEER_STA];
3495};
3496
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003497typedef struct sSirAddPeriodicTxPtrn {
3498 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303499 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003500 uint8_t ucPtrnId; /* Pattern ID */
3501 uint16_t ucPtrnSize; /* Pattern size */
3502 uint32_t usPtrnIntervalMs; /* In msec */
3503 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
3504} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
3505
3506typedef struct sSirDelPeriodicTxPtrn {
3507 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303508 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003509 /* Bitmap of pattern IDs that need to be deleted */
3510 uint32_t ucPatternIdBitmap;
3511 uint8_t ucPtrnId; /* Pattern ID */
3512} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
3513
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003514/*---------------------------------------------------------------------------
3515* tSirIbssGetPeerInfoReqParams
3516*--------------------------------------------------------------------------*/
3517typedef struct {
3518 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
3519 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
3520 /* of peer with staIdx is reported */
3521} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
3522
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003523/**
3524 * typedef struct - tSirIbssGetPeerInfoParams
3525 * @mac_addr: mac address received from target
3526 * @txRate: TX rate
3527 * @mcsIndex: MCS index
3528 * @txRateFlags: TX rate flags
3529 * @rssi: RSSI
3530 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003531typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003532 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3533 uint32_t txRate;
3534 uint32_t mcsIndex;
3535 uint32_t txRateFlags;
3536 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003537} tSirIbssPeerInfoParams;
3538
3539typedef struct {
3540 uint32_t status;
3541 uint8_t numPeers;
3542 tSirIbssPeerInfoParams peerInfoParams[32];
3543} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
3544
3545/*---------------------------------------------------------------------------
3546* tSirIbssGetPeerInfoRspParams
3547*--------------------------------------------------------------------------*/
3548typedef struct {
3549 uint16_t mesgType;
3550 uint16_t mesgLen;
3551 tSirPeerInfoRspParams ibssPeerInfoRspParams;
3552} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
3553
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003554typedef struct {
3555 uint16_t mesgType;
3556 uint16_t mesgLen;
3557 bool suspended;
3558} tSirReadyToSuspendInd, *tpSirReadyToSuspendInd;
3559#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
3560typedef struct {
3561 uint16_t mesgType;
3562 uint16_t mesgLen;
3563 bool status;
3564} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
3565#endif
3566typedef struct sSirRateUpdateInd {
3567 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303568 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08003569 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003570 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
3571 /*
3572 * 0 implies RA, positive value implies fixed rate, -1 implies ignore
3573 * this param.
3574 */
3575 int32_t ucastDataRate;
3576
3577 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003578 enum tx_rate_info ucastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003579
3580 /*
3581 * 0 implies MCAST RA, positive value implies fixed rate,
3582 * -1 implies ignore this param
3583 */
3584 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
3585
3586 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003587 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003588
3589 /*
3590 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
3591 * 0 implies ignore
3592 */
3593 uint32_t mcastDataRate24GHz;
3594
3595 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003596 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003597
3598 /*
3599 * MCAST(or BCAST) fixed data rate in 5 GHz,
3600 * unit Mbpsx10, 0 implies ignore
3601 */
3602 uint32_t mcastDataRate5GHz;
3603
3604 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003605 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003606
3607} tSirRateUpdateInd, *tpSirRateUpdateInd;
3608
3609#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
3610#define SIR_CH_AVOID_MAX_RANGE 4
3611
3612typedef struct sSirChAvoidFreqType {
3613 uint32_t start_freq;
3614 uint32_t end_freq;
3615} tSirChAvoidFreqType;
3616
3617typedef struct sSirChAvoidIndType {
3618 uint32_t avoid_range_count;
3619 tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE];
3620} tSirChAvoidIndType;
3621#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
3622
3623#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08003624#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003625
3626typedef struct sSirSmeDfsChannelList {
3627 uint32_t nchannels;
3628 /* Ch num including bonded channels on which the RADAR is present */
3629 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
3630} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
3631
3632typedef struct sSirSmeDfsEventInd {
3633 uint32_t sessionId;
3634 tSirSmeDfsChannelList chan_list;
3635 uint32_t dfs_radar_status;
3636 int use_nol;
3637} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
3638
3639typedef struct sSirChanChangeRequest {
3640 uint16_t messageType;
3641 uint16_t messageLen;
3642 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08003643 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08003644 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003645 uint8_t center_freq_seg_0;
3646 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303647 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003648 uint32_t dot11mode;
3649 tSirMacRateSet operational_rateset;
3650 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07003651 uint32_t cac_duration_ms;
3652 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003653} tSirChanChangeRequest, *tpSirChanChangeRequest;
3654
3655typedef struct sSirChanChangeResponse {
3656 uint8_t sessionId;
3657 uint8_t newChannelNumber;
3658 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003659} tSirChanChangeResponse, *tpSirChanChangeResponse;
3660
3661typedef struct sSirStartBeaconIndication {
3662 uint16_t messageType;
3663 uint16_t messageLen;
3664 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303665 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003666} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
3667
3668/* additional IE type */
3669typedef enum tUpdateIEsType {
3670 eUPDATE_IE_NONE,
3671 eUPDATE_IE_PROBE_BCN,
3672 eUPDATE_IE_PROBE_RESP,
3673 eUPDATE_IE_ASSOC_RESP,
3674
3675 /* Add type above this line */
3676 /* this is used to reset all buffer */
3677 eUPDATE_IE_ALL,
3678 eUPDATE_IE_MAX
3679} eUpdateIEsType;
3680
3681/* Modify particular IE in addition IE for prob resp Bcn */
3682typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303683 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003684 uint16_t smeSessionId;
3685 bool notify;
3686 uint8_t ieID;
3687 uint8_t ieIDLen; /*ie length as per spec */
3688 uint16_t ieBufferlength;
3689 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003690 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003691
3692} tSirModifyIE, *tpSirModifyIE;
3693
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08003694struct send_add_ba_req {
3695 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3696 struct addba_send_params param;
3697};
3698
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003699/* Message format for Update IE message sent to PE */
3700typedef struct sSirModifyIEsInd {
3701 uint16_t msgType;
3702 uint16_t msgLen;
3703 tSirModifyIE modifyIE;
3704 eUpdateIEsType updateType;
3705} tSirModifyIEsInd, *tpSirModifyIEsInd;
3706
3707/* Message format for Update IE message sent to PE */
3708typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303709 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003710 uint16_t smeSessionId;
3711 bool append;
3712 bool notify;
3713 uint16_t ieBufferlength;
3714 uint8_t *pAdditionIEBuffer;
3715} tSirUpdateIE, *tpSirUpdateIE;
3716
3717/* Message format for Update IE message sent to PE */
3718typedef struct sSirUpdateIEsInd {
3719 uint16_t msgType;
3720 uint16_t msgLen;
3721 tSirUpdateIE updateIE;
3722 eUpdateIEsType updateType;
3723} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
3724
3725/* Message format for requesting channel switch announcement to lower layers */
3726typedef struct sSirDfsCsaIeRequest {
3727 uint16_t msgType;
3728 uint16_t msgLen;
3729 uint8_t targetChannel;
3730 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303731 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003732 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003733 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003734 uint8_t ch_switch_mode;
3735 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003736} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3737
3738/* Indication from lower layer indicating the completion of first beacon send
3739 * after the beacon template update
3740 */
3741typedef struct sSirFirstBeaconTxCompleteInd {
3742 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3743 uint16_t length;
3744 uint8_t bssIdx;
3745} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3746
3747typedef struct sSirSmeCSAIeTxCompleteRsp {
3748 uint8_t sessionId;
3749 uint8_t chanSwIeTxStatus;
3750} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3751
3752/* Thermal Mitigation*/
3753
3754typedef struct {
3755 uint16_t minTempThreshold;
3756 uint16_t maxTempThreshold;
3757} t_thermal_level_info, *tp_thermal_level_info;
3758
3759typedef enum {
3760 WLAN_WMA_THERMAL_LEVEL_0,
3761 WLAN_WMA_THERMAL_LEVEL_1,
3762 WLAN_WMA_THERMAL_LEVEL_2,
3763 WLAN_WMA_THERMAL_LEVEL_3,
3764 WLAN_WMA_MAX_THERMAL_LEVELS
3765} t_thermal_level;
3766
Poddar, Siddarth83905022016-04-16 17:56:08 -07003767#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3768
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003769typedef struct {
3770 /* Array of thermal levels */
3771 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3772 uint8_t thermalCurrLevel;
3773 uint8_t thermalMgmtEnabled;
3774 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003775 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003776} t_thermal_mgmt, *tp_thermal_mgmt;
3777
3778typedef struct sSirTxPowerLimit {
3779 /* Thermal limits for 2g and 5g */
3780 uint32_t txPower2g;
3781 uint32_t txPower5g;
3782} tSirTxPowerLimit;
3783
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303784enum bad_peer_thresh_levels {
3785 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3786 WLAN_WMA_IEEE80211_AG_LEVEL,
3787 WLAN_WMA_IEEE80211_N_LEVEL,
3788 WLAN_WMA_IEEE80211_AC_LEVEL,
3789 WLAN_WMA_IEEE80211_AX_LEVEL,
3790 WLAN_WMA_IEEE80211_MAX_LEVEL,
3791};
3792
3793#define NUM_OF_RATE_THRESH_MAX (4)
3794struct t_bad_peer_info {
3795 uint32_t cond;
3796 uint32_t delta;
3797 uint32_t percentage;
3798 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3799 uint32_t txlimit;
3800};
3801
3802struct t_bad_peer_txtcl_config {
3803 /* Array of thermal levels */
3804 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3805 uint32_t enable;
3806 uint32_t period;
3807 uint32_t txq_limit;
3808 uint32_t tgt_backoff;
3809 uint32_t tgt_report_prd;
3810};
3811
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003812/* notify MODEM power state to FW */
3813typedef struct {
3814 uint32_t param;
3815} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3816
3817#ifdef WLAN_FEATURE_STATS_EXT
3818typedef struct {
3819 uint32_t vdev_id;
3820 uint32_t event_data_len;
3821 uint8_t event_data[];
3822} tSirStatsExtEvent, *tpSirStatsExtEvent;
3823#endif
3824
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003825typedef struct {
3826 uint32_t event_data_len;
3827 uint8_t event_data[];
3828} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003829
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003830typedef struct sSirSmeRoamOffloadSynchInd {
3831 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3832 uint16_t length;
3833 uint16_t beaconProbeRespOffset;
3834 uint16_t beaconProbeRespLength;
3835 uint16_t reassocRespOffset;
3836 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003837 uint16_t reassoc_req_offset;
3838 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003839 uint8_t isBeacon;
3840 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303841 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003842 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003843 int8_t txMgmtPower;
3844 uint32_t authStatus;
3845 uint8_t rssi;
3846 uint8_t roamReason;
3847 uint32_t chan_freq;
3848 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303849 uint32_t kek_len;
3850 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3851 uint32_t pmk_len;
3852 uint8_t pmk[SIR_PMK_LEN];
3853 uint8_t pmkid[SIR_PMKID_LEN];
3854 bool update_erp_next_seq_num;
3855 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003856 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003857 void *add_bss_params;
3858 tpSirSmeJoinRsp join_rsp;
3859 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003860 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003861 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303862 struct qdf_mac_addr dst_mac;
3863 struct qdf_mac_addr src_mac;
3864 uint16_t hlp_data_len;
3865 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003866} roam_offload_synch_ind;
3867
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003868#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003869typedef struct sSirSmeRoamOffloadSynchCnf {
3870 uint8_t sessionId;
3871} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
3872
3873typedef struct sSirSmeHOFailureInd {
3874 uint8_t sessionId;
3875} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
3876
3877struct roam_offload_synch_fail {
3878 uint8_t session_id;
3879};
3880
3881#endif
3882
Wen Gong7952fbd2018-04-18 11:27:23 +08003883/**
3884 * struct sir_wisa_params - WISA Mode Parameters
3885 * @mode: WISA mode
3886 * @session_id: Session ID of vdev
3887 */
3888struct sir_wisa_params {
3889 bool mode;
3890 uint8_t vdev_id;
3891};
3892
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003893#ifdef FEATURE_WLAN_EXTSCAN
3894
Wen Gong7952fbd2018-04-18 11:27:23 +08003895#define WLAN_EXTSCAN_MAX_CHANNELS 36
3896#define WLAN_EXTSCAN_MAX_BUCKETS 16
3897#define WLAN_EXTSCAN_MAX_HOTLIST_APS 128
3898#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3899
3900typedef enum {
3901 eSIR_EXTSCAN_INVALID,
3902 eSIR_EXTSCAN_START_RSP,
3903 eSIR_EXTSCAN_STOP_RSP,
3904 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3905 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3906 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3907 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3908 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3909
3910 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3911 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3912 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3913 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3914 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3915 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3916 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3917 eSIR_EPNO_NETWORK_FOUND_IND,
3918 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3919 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3920 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3921
3922 /* Keep this last */
3923 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3924} tSirExtScanCallbackType;
3925
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003926/**
3927 * typedef enum wifi_scan_flags - wifi scan flags
3928 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3929 * because probes were not sent on some channels
3930 */
3931typedef enum {
3932 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3933} wifi_scan_flags;
3934
3935typedef enum {
3936 WIFI_BAND_UNSPECIFIED,
3937 WIFI_BAND_BG = 1, /* 2.4 GHz */
3938 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3939 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3940 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3941 /* 5 is reserved */
3942 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3943 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3944
3945 /* Keep it last */
3946 WIFI_BAND_MAX
3947} tWifiBand;
3948
Mukul Sharma45114d92016-08-12 19:34:14 +05303949/**
3950 * enum wifi_extscan_event_type - extscan event type
3951 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3952 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3953 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3954 * reason for the event is available; however, at most one of
3955 * these events should be reported per scan.
3956 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3957 * REPORT_EVENTS_EACH_SCAN is not set and
3958 * report_threshold_num_scans is reached.
3959 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3960 * is not set and report_threshold_percent is reached.
3961 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3962 * start_gscan will need to be called again in order to continue
3963 * scanning.
3964 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3965 * This event is consumed in driver only.
3966 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3967 * This event is consumed in driver only.
3968 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3969 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3970 */
3971enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303972 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303973 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303974 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303975 WIFI_SCAN_DISABLED,
3976
Mukul Sharmafa937be2016-08-12 18:13:36 +05303977 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3978 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3979 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303980};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003981
3982/**
3983 * enum extscan_configuration_flags - extscan config flags
3984 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3985 */
3986enum extscan_configuration_flags {
3987 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3988};
3989
3990typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303991 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003992
3993 /* Low threshold */
3994 int32_t low;
3995
3996 /* High threshold */
3997 int32_t high;
3998} tSirAPThresholdParam, *tpSirAPThresholdParam;
3999
4000typedef struct {
4001 uint32_t requestId;
4002 uint8_t sessionId;
4003} tSirGetExtScanCapabilitiesReqParams, *tpSirGetExtScanCapabilitiesReqParams;
4004
4005/**
4006 * struct ext_scan_capabilities_response - extscan capabilities response data
4007 * @requestId: request identifier
4008 * @status: status
4009 * @max_scan_cache_size: total space allocated for scan (in bytes)
4010 * @max_scan_buckets: maximum number of channel buckets
4011 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
4012 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
4013 * @ax_scan_reporting_threshold: max possible report_threshold
4014 * @max_hotlist_bssids: maximum number of entries for hotlist APs
4015 * @max_significant_wifi_change_aps: maximum number of entries for
4016 * significant wifi change APs
4017 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
4018 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
4019 * @max_number_epno_networks: max number of epno entries
4020 * @max_number_epno_networks_by_ssid: max number of epno entries
4021 * if ssid is specified, that is, epno entries for
4022 * which an exact match is required,
4023 * or entries corresponding to hidden ssids
4024 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304025 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004026 */
4027struct ext_scan_capabilities_response {
4028 uint32_t requestId;
4029 uint32_t status;
4030
4031 uint32_t max_scan_cache_size;
4032 uint32_t max_scan_buckets;
4033 uint32_t max_ap_cache_per_scan;
4034 uint32_t max_rssi_sample_size;
4035 uint32_t max_scan_reporting_threshold;
4036
4037 uint32_t max_hotlist_bssids;
4038 uint32_t max_significant_wifi_change_aps;
4039
4040 uint32_t max_bssid_history_entries;
4041 uint32_t max_hotlist_ssids;
4042 uint32_t max_number_epno_networks;
4043 uint32_t max_number_epno_networks_by_ssid;
4044 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304045 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004046};
4047
4048typedef struct {
4049 uint32_t requestId;
4050 uint8_t sessionId;
4051
4052 /*
4053 * 1 - return cached results and flush it
4054 * 0 - return cached results and do not flush
4055 */
4056 bool flush;
4057} tSirExtScanGetCachedResultsReqParams, *tpSirExtScanGetCachedResultsReqParams;
4058
4059typedef struct {
4060 uint32_t requestId;
4061 uint32_t status;
4062} tSirExtScanGetCachedResultsRspParams, *tpSirExtScanGetCachedResultsRspParams;
4063
4064typedef struct {
4065 /* Time of discovery */
4066 uint64_t ts;
4067
4068 /* Null terminated SSID */
4069 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
4070
Anurag Chouhan6d760662016-02-20 16:05:43 +05304071 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004072
4073 /* Frequency in MHz */
4074 uint32_t channel;
4075
4076 /* RSSI in dBm */
4077 int32_t rssi;
4078
4079 /* RTT in nanoseconds */
4080 uint32_t rtt;
4081
4082 /* Standard deviation in rtt */
4083 uint32_t rtt_sd;
4084
4085 /* Period advertised in the beacon */
4086 uint16_t beaconPeriod;
4087
4088 /* Capabilities advertised in the beacon */
4089 uint16_t capability;
4090
4091 uint16_t ieLength;
4092
4093 uint8_t ieData[];
4094} tSirWifiScanResult, *tpSirWifiScanResult;
4095
4096/**
4097 * struct extscan_hotlist_match - extscan hotlist match
4098 * @requestId: request identifier
4099 * @numOfAps: number of bssids retrieved by the scan
4100 * @moreData: 0 - for last fragment
4101 * 1 - still more fragment(s) coming
4102 * @ap: wifi scan result
4103 */
4104struct extscan_hotlist_match {
4105 uint32_t requestId;
4106 bool moreData;
4107 bool ap_found;
4108 uint32_t numOfAps;
4109 tSirWifiScanResult ap[];
4110};
4111
4112/**
4113 * struct extscan_cached_scan_result - extscan cached scan result
4114 * @scan_id: a unique identifier for the scan unit
4115 * @flags: a bitmask with additional information about scan
4116 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304117 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004118 * @ap: wifi scan bssid results info
4119 */
4120struct extscan_cached_scan_result {
4121 uint32_t scan_id;
4122 uint32_t flags;
4123 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304124 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004125 tSirWifiScanResult *ap;
4126};
4127
4128/**
4129 * struct tSirWifiScanResultEvent - wifi scan result event
4130 * @requestId: request identifier
4131 * @ap_found: flag to indicate ap found or not
4132 * true: AP was found
4133 * false: AP was lost
4134 * @numOfAps: number of aps
4135 * @moreData: more data
4136 * @ap: bssid information
4137 *
4138 */
4139typedef struct {
4140 uint32_t requestId;
4141 bool ap_found;
4142 uint32_t numOfAps;
4143 bool moreData;
4144 tSirWifiScanResult ap[];
4145} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent;
4146
4147/**
4148 * struct extscan_cached_scan_results - extscan cached scan results
4149 * @request_id: request identifier
4150 * @more_data: 0 - for last fragment
4151 * 1 - still more fragment(s) coming
4152 * @num_scan_ids: number of scan ids
4153 * @result: wifi scan result
4154 */
4155struct extscan_cached_scan_results {
4156 uint32_t request_id;
4157 bool more_data;
4158 uint32_t num_scan_ids;
4159 struct extscan_cached_scan_result *result;
4160};
4161
4162
4163/**
4164 * struct tSirWifiFullScanResultEvent - extscan full scan event
4165 * @request_id: request identifier
4166 * @moreData: 0 - for last fragment
4167 * 1 - still more fragment(s) coming
4168 * @ap: bssid info
4169 *
4170 * Reported when each probe response is received, if reportEvents
4171 * enabled in tSirWifiScanCmdReqParams
4172 */
4173typedef struct {
4174 uint32_t requestId;
4175 bool moreData;
4176 tSirWifiScanResult ap;
4177} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
4178
4179/**
4180 * struct pno_match_found - epno match found
4181 * @request_id: request identifier
4182 * @moreData: 0 - for last fragment
4183 * 1 - still more fragment(s) coming
4184 * @num_results: number of bssids, driver sends this event to upper layer
4185 * for every beacon, hence %num_results is always set to 1.
4186 * @ap: bssid info
4187 *
4188 * Reported when each beacon probe response is received with
4189 * epno match found tag.
4190 */
4191struct pno_match_found {
4192 uint32_t request_id;
4193 bool more_data;
4194 uint32_t num_results;
4195 tSirWifiScanResult ap[];
4196};
4197
4198typedef struct {
4199 /* Frequency in MHz */
4200 uint32_t channel;
4201
4202 uint32_t dwellTimeMs;
4203
4204 /* 0 => active
4205 1 => passive scan; ignored for DFS */
4206 bool passive;
4207
4208 uint8_t chnlClass;
4209} tSirWifiScanChannelSpec, *tpSirWifiScanChannelSpec;
4210
4211/**
4212 * struct tSirWifiScanBucketSpec - wifi scan bucket spec
4213 * @bucket: bucket identifier
4214 * @band: wifi band
4215 * @period: Desired period, in millisecond; if this is too
4216 * low, the firmware should choose to generate results as fast as
4217 * it can instead of failing the command byte
4218 * for exponential backoff bucket this is the min_period
4219 * @reportEvents: 0 => normal reporting (reporting rssi history
4220 * only, when rssi history buffer is % full)
4221 * 1 => same as 0 + report a scan completion event after scanning
4222 * this bucket
4223 * 2 => same as 1 + forward scan results
4224 * (beacons/probe responses + IEs) in real time to HAL
4225 * @max_period: if max_period is non zero or different than period,
4226 * then this bucket is an exponential backoff bucket and
4227 * the scan period will grow exponentially as per formula:
4228 * actual_period(N) = period ^ (N/(step_count+1)) to a
4229 * maximum period of max_period
4230 * @exponent: for exponential back off bucket: multiplier:
4231 * new_period = old_period * exponent
4232 * @step_count: for exponential back off bucket, number of scans performed
4233 * at a given period and until the exponent is applied
4234 * @numChannels: channels to scan; these may include DFS channels
4235 * Note that a given channel may appear in multiple buckets
4236 * @min_dwell_time_active: per bucket minimum active dwell time
4237 * @max_dwell_time_active: per bucket maximum active dwell time
4238 * @min_dwell_time_passive: per bucket minimum passive dwell time
4239 * @max_dwell_time_passive: per bucket maximum passive dwell time
4240 * @channels: Channel list
4241 */
4242typedef struct {
4243 uint8_t bucket;
4244 tWifiBand band;
4245 uint32_t period;
4246 uint32_t reportEvents;
4247 uint32_t max_period;
4248 uint32_t exponent;
4249 uint32_t step_count;
4250 uint32_t numChannels;
4251
4252 uint32_t min_dwell_time_active;
4253 uint32_t max_dwell_time_active;
4254 uint32_t min_dwell_time_passive;
4255 uint32_t max_dwell_time_passive;
4256 tSirWifiScanChannelSpec channels[WLAN_EXTSCAN_MAX_CHANNELS];
4257} tSirWifiScanBucketSpec, *tpSirWifiScanBucketSpec;
4258
4259/**
4260 * struct tSirWifiScanCmdReqParams - wifi scan command request params
4261 * @basePeriod: base timer period
4262 * @maxAPperScan: max ap per scan
4263 * @report_threshold_percent: report threshold
4264 * in %, when buffer is this much full, wake up host
4265 * @report_threshold_num_scans: report threshold number of scans
4266 * in number of scans, wake up host after these many scans
4267 * @requestId: request id
4268 * @sessionId: session id
4269 * @numBuckets: number of buckets
4270 * @min_dwell_time_active: per bucket minimum active dwell time
4271 * @max_dwell_time_active: per bucket maximum active dwell time
4272 * @min_dwell_time_passive: per bucket minimum passive dwell time
4273 * @max_dwell_time_passive: per bucket maximum passive dwell time
4274 * @configuration_flags: configuration flags
4275 * @buckets: buckets array
4276 */
4277typedef struct {
4278 uint32_t basePeriod;
4279 uint32_t maxAPperScan;
4280
4281 uint32_t report_threshold_percent;
4282 uint32_t report_threshold_num_scans;
4283
4284 uint32_t requestId;
4285 uint8_t sessionId;
4286 uint32_t numBuckets;
4287
4288 uint32_t min_dwell_time_active;
4289 uint32_t max_dwell_time_active;
4290 uint32_t min_dwell_time_passive;
4291 uint32_t max_dwell_time_passive;
4292 uint32_t configuration_flags;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07004293 enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004294 tSirWifiScanBucketSpec buckets[WLAN_EXTSCAN_MAX_BUCKETS];
4295} tSirWifiScanCmdReqParams, *tpSirWifiScanCmdReqParams;
4296
4297/**
4298 * struct sir_extscan_generic_response -
4299 * Generic ExtScan Response structure
4300 * @request_id: ID of the request
4301 * @status: operation status returned by firmware
4302 */
4303struct sir_extscan_generic_response {
4304 uint32_t request_id;
4305 uint32_t status;
4306};
4307
4308typedef struct {
4309 uint32_t requestId;
4310 uint8_t sessionId;
4311} tSirExtScanStopReqParams, *tpSirExtScanStopReqParams;
4312
4313/**
4314 * struct tSirExtScanSetBssidHotListReqParams - set hotlist request
4315 * @requestId: request identifier
4316 * @sessionId: session identifier
4317 * @lost_ap_sample_size: number of samples to confirm AP loss
4318 * @numAp: Number of hotlist APs
4319 * @ap: hotlist APs
4320 */
4321typedef struct {
4322 uint32_t requestId;
4323 uint8_t sessionId;
4324
4325 uint32_t lost_ap_sample_size;
4326 uint32_t numAp;
4327 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_HOTLIST_APS];
4328} tSirExtScanSetBssidHotListReqParams, *tpSirExtScanSetBssidHotListReqParams;
4329
4330typedef struct {
4331 uint32_t requestId;
4332 uint8_t sessionId;
4333} tSirExtScanResetBssidHotlistReqParams,
4334*tpSirExtScanResetBssidHotlistReqParams;
4335
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004336typedef struct {
4337 uint32_t requestId;
4338 uint8_t sessionId;
4339
4340 /* Number of samples for averaging RSSI */
4341 uint32_t rssiSampleSize;
4342
4343 /* Number of missed samples to confirm AP loss */
4344 uint32_t lostApSampleSize;
4345
4346 /* Number of APs breaching threshold required for firmware
4347 * to generate event
4348 */
4349 uint32_t minBreaching;
4350
4351 uint32_t numAp;
4352 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
4353} tSirExtScanSetSigChangeReqParams, *tpSirExtScanSetSigChangeReqParams;
4354
4355typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304356 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004357 uint32_t channel;
4358 uint32_t numOfRssi;
4359
4360 /* Rssi history in db */
4361 int32_t rssi[];
4362} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
4363
4364typedef struct {
4365 uint32_t requestId;
4366
4367 bool moreData;
4368 uint32_t numResults;
4369 tSirWifiSignificantChange ap[];
4370} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
4371
4372typedef struct {
4373 uint32_t requestId;
4374 uint8_t sessionId;
4375} tSirExtScanResetSignificantChangeReqParams,
4376*tpSirExtScanResetSignificantChangeReqParams;
4377
4378typedef struct {
4379 uint32_t requestId;
4380 uint32_t numResultsAvailable;
4381} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
4382
4383typedef struct {
4384 uint32_t requestId;
4385 uint32_t status;
4386 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05304387 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004388} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
4389
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304390#define MAX_EPNO_NETWORKS 64
4391
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004392/**
4393 * struct wifi_epno_network - enhanced pno network block
4394 * @ssid: ssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004395 * @flags: WIFI_PNO_FLAG_XXX
4396 * @auth_bit_field: auth bit field for matching WPA IE
4397 */
4398struct wifi_epno_network {
4399 tSirMacSSid ssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004400 uint8_t flags;
4401 uint8_t auth_bit_field;
4402};
4403
4404/**
4405 * struct wifi_epno_params - enhanced pno network params
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304406 * @request_id: request id number
4407 * @session_id: session_id number
4408 * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
4409 * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
4410 * @initial_score_max: maximum score that a network can have before bonuses
4411 * @current_connection_bonus: only report when there is a network's score this
4412 * much higher than the current connection
4413 * @same_network_bonus: score bonus for all n/w with the same network flag
4414 * @secure_bonus: score bonus for networks that are not open
4415 * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004416 * @num_networks: number of ssids
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304417 * @networks: EPNO networks
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004418 */
4419struct wifi_epno_params {
4420 uint32_t request_id;
4421 uint32_t session_id;
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304422 uint32_t min_5ghz_rssi;
4423 uint32_t min_24ghz_rssi;
4424 uint32_t initial_score_max;
4425 uint32_t current_connection_bonus;
4426 uint32_t same_network_bonus;
4427 uint32_t secure_bonus;
4428 uint32_t band_5ghz_bonus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004429 uint32_t num_networks;
4430 struct wifi_epno_network networks[];
4431};
4432
Jeff Johnson96f93a32016-11-18 11:02:24 -08004433#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004434#define SIR_PASSPOINT_REALM_LEN 256
4435#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
4436#define SIR_PASSPOINT_PLMN_LEN 3
4437/**
4438 * struct wifi_passpoint_network - passpoint network block
4439 * @id: identifier of this network block
4440 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
4441 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
4442 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
4443 */
4444struct wifi_passpoint_network {
4445 uint32_t id;
4446 uint8_t realm[SIR_PASSPOINT_REALM_LEN];
4447 int64_t roaming_consortium_ids[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
4448 uint8_t plmn[SIR_PASSPOINT_PLMN_LEN];
4449};
4450
4451/**
4452 * struct wifi_passpoint_req - passpoint request
4453 * @request_id: request identifier
4454 * @num_networks: number of networks
4455 * @networks: passpoint networks
4456 */
4457struct wifi_passpoint_req {
4458 uint32_t request_id;
4459 uint32_t session_id;
4460 uint32_t num_networks;
4461 struct wifi_passpoint_network networks[];
4462};
4463
4464/**
4465 * struct wifi_passpoint_match - wifi passpoint network match
4466 * @id: network block identifier for the matched network
4467 * @anqp_len: length of ANQP blob
4468 * @ap: scan result, with channel and beacon information
4469 * @anqp: ANQP data, in the information_element format
4470 */
4471struct wifi_passpoint_match {
4472 uint32_t request_id;
4473 uint32_t id;
4474 uint32_t anqp_len;
4475 tSirWifiScanResult ap;
4476 uint8_t anqp[];
4477};
4478#endif /* FEATURE_WLAN_EXTSCAN */
4479
4480#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
4481typedef struct {
4482 uint32_t timer_val;
4483} tSirAutoShutdownCmdParams;
4484
4485typedef struct {
4486 uint32_t shutdown_reason;
4487} tSirAutoShutdownEvtParams;
4488#endif
4489
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05304490#ifdef WLAN_POWER_DEBUGFS
4491/**
4492 * struct power_stats_response - Power stats response
4493 * @cumulative_sleep_time_ms: cumulative sleep time in ms
4494 * @cumulative_total_on_time_ms: total awake time in ms
4495 * @deep_sleep_enter_counter: deep sleep enter counter
4496 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
4497 * @debug_register_fmt: debug registers format
4498 * @num_debug_register: number of debug registers
4499 * @debug_registers: Pointer to the debug registers buffer
4500 */
4501struct power_stats_response {
4502 uint32_t cumulative_sleep_time_ms;
4503 uint32_t cumulative_total_on_time_ms;
4504 uint32_t deep_sleep_enter_counter;
4505 uint32_t last_deep_sleep_enter_tstamp_ms;
4506 uint32_t debug_register_fmt;
4507 uint32_t num_debug_register;
4508 uint32_t *debug_registers;
4509};
4510#endif
4511
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05304512/**
4513 * struct lfr_firmware_status - LFR status in firmware
4514 * @is_disabled: Is LFR disabled in FW
4515 * @disable_lfr_event: Disable attempt done in FW
4516 */
4517struct lfr_firmware_status {
4518 uint32_t is_disabled;
4519 struct completion disable_lfr_event;
4520};
4521
4522/**
4523 * struct rso_cmd_status - RSO Command status
4524 * @vdev_id: Vdev ID for which RSO command sent
4525 * @status: Status of RSO command sent to FW
4526 */
4527struct rso_cmd_status {
4528 uint32_t vdev_id;
4529 bool status;
4530};
4531
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004532typedef struct {
4533 uint8_t oui[WIFI_SCANNING_MAC_OUI_LENGTH];
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +05304534 uint32_t vdev_id;
4535 bool enb_probe_req_sno_randomization;
Rajeev Kumar Sirasanagandlaaec0b082017-06-21 11:59:41 +05304536 struct probe_req_whitelist_attr ie_whitelist;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004537} tSirScanMacOui, *tpSirScanMacOui;
4538
4539enum {
4540 SIR_AP_RX_DATA_OFFLOAD = 0x00,
4541 SIR_STA_RX_DATA_OFFLOAD = 0x01,
4542};
4543
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004544/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07004545 * struct sir_set_vdev_ies_per_band
4546 * @msg_type: message type
4547 * @len: message length
4548 * @vdev_id: vdev id
4549 *
4550 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
4551 */
4552struct sir_set_vdev_ies_per_band {
4553 uint16_t msg_type;
4554 uint16_t len;
4555 uint32_t vdev_id;
4556};
4557
4558/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004559 * struct sir_set_ht_vht_cfg - ht, vht IE config
4560 * @msg_type: message type
4561 * @len: message length
4562 * @pdev_id: pdev id
4563 * @nss: Nss value
4564 * @dot11mode: Dot11 mode.
4565 *
4566 * Message wrapper structure for set HT/VHT IE req.
4567 */
4568struct sir_set_ht_vht_cfg {
4569 uint16_t msg_type;
4570 uint16_t len;
4571 uint32_t pdev_id;
4572 uint32_t nss;
4573 uint32_t dot11mode;
4574};
4575
Qiwei Cai3719efe2018-06-11 21:09:29 +08004576#define WIFI_INVALID_PEER_ID (-1)
4577#define WIFI_INVALID_VDEV_ID (-1)
4578#define WIFI_MAX_AC (4)
4579
4580typedef struct {
4581 uint32_t paramId;
4582 uint8_t ifaceId;
4583 uint32_t rspId;
4584 uint32_t moreResultToFollow;
4585 uint32_t nr_received;
4586 union {
4587 uint32_t num_peers;
4588 uint32_t num_radio;
4589 };
4590
4591 uint32_t peer_event_number;
4592 /* Variable length field - Do not add anything after this */
4593 uint8_t results[0];
4594} tSirLLStatsResults, *tpSirLLStatsResults;
4595
4596#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004597/*---------------------------------------------------------------------------
4598 WLAN_HAL_LL_NOTIFY_STATS
4599 ---------------------------------------------------------------------------*/
4600
4601/******************************LINK LAYER Statistics**********************/
4602
4603typedef int tSirWifiRadio;
4604typedef int tSirWifiChannel;
4605typedef int tSirwifiTxRate;
4606
Qiwei Cai3719efe2018-06-11 21:09:29 +08004607typedef struct {
4608 uint32_t reqId;
4609 uint8_t staId;
4610 uint32_t mpduSizeThreshold;
4611 uint32_t aggressiveStatisticsGathering;
4612} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
4613
4614typedef struct {
4615 uint32_t reqId;
4616 uint8_t staId;
4617 uint32_t paramIdMask;
4618} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
4619
4620typedef struct {
4621 uint32_t reqId;
4622 uint8_t staId;
4623 uint32_t statsClearReqMask;
4624 uint8_t stopReq;
4625} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
4626
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004627/* channel operating width */
4628typedef enum {
4629 WIFI_CHAN_WIDTH_20 = 0,
4630 WIFI_CHAN_WIDTH_40 = 1,
4631 WIFI_CHAN_WIDTH_80 = 2,
4632 WIFI_CHAN_WIDTH_160 = 3,
4633 WIFI_CHAN_WIDTH_80P80 = 4,
4634 WIFI_CHAN_WIDTH_5 = 5,
4635 WIFI_CHAN_WIDTH_10 = 6,
4636} tSirWifiChannelWidth;
4637
4638typedef enum {
4639 WIFI_DISCONNECTED = 0,
4640 WIFI_AUTHENTICATING = 1,
4641 WIFI_ASSOCIATING = 2,
4642 WIFI_ASSOCIATED = 3,
4643 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
4644 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
4645} tSirWifiConnectionState;
4646
4647typedef enum {
4648 WIFI_ROAMING_IDLE = 0,
4649 WIFI_ROAMING_ACTIVE = 1,
4650} tSirWifiRoamState;
4651
4652typedef enum {
4653 WIFI_INTERFACE_STA = 0,
4654 WIFI_INTERFACE_SOFTAP = 1,
4655 WIFI_INTERFACE_IBSS = 2,
4656 WIFI_INTERFACE_P2P_CLIENT = 3,
4657 WIFI_INTERFACE_P2P_GO = 4,
4658 WIFI_INTERFACE_NAN = 5,
4659 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07004660 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004661} tSirWifiInterfaceMode;
4662
4663/* set for QOS association */
4664#define WIFI_CAPABILITY_QOS 0x00000001
4665/* set for protected assoc (802.11 beacon frame control protected bit set) */
4666#define WIFI_CAPABILITY_PROTECTED 0x00000002
4667/* set if 802.11 Extended Capabilities element interworking bit is set */
4668#define WIFI_CAPABILITY_INTERWORKING 0x00000004
4669/* set for HS20 association */
4670#define WIFI_CAPABILITY_HS20 0x00000008
4671/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
4672#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
4673/* set is 802.11 Country Element is present */
4674#define WIFI_CAPABILITY_COUNTRY 0x00000020
4675
4676typedef struct {
4677 /* tSirWifiInterfaceMode */
4678 /* interface mode */
4679 uint8_t mode;
4680 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304681 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004682 /* tSirWifiConnectionState */
4683 /* connection state (valid for STA, CLI only) */
4684 uint8_t state;
4685 /* tSirWifiRoamState */
4686 /* roaming state */
4687 uint32_t roaming;
4688 /* WIFI_CAPABILITY_XXX (self) */
4689 uint32_t capabilities;
4690 /* null terminated SSID */
4691 uint8_t ssid[33];
4692 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304693 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004694 /* country string advertised by AP */
4695 uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN];
4696 /* country string for this association */
4697 uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN];
4698} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
4699
4700/* channel information */
4701typedef struct {
4702 /* channel width (20, 40, 80, 80+80, 160) */
4703 tSirWifiChannelWidth width;
4704 /* primary 20 MHz channel */
4705 tSirWifiChannel centerFreq;
4706 /* center frequency (MHz) first segment */
4707 tSirWifiChannel centerFreq0;
4708 /* center frequency (MHz) second segment */
4709 tSirWifiChannel centerFreq1;
4710} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
4711
4712/* wifi rate info */
4713typedef struct {
4714 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
4715 uint32_t preamble:3;
4716 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
4717 uint32_t nss:2;
4718 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
4719 uint32_t bw:3;
4720 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
4721 /* HT/VHT it would be mcs index */
4722 uint32_t rateMcsIdx:8;
4723 /* reserved */
4724 uint32_t reserved:16;
4725 /* units of 100 Kbps */
4726 uint32_t bitrate;
4727} tSirWifiRate, *tpSirWifiRate;
4728
4729/* channel statistics */
4730typedef struct {
4731 /* channel */
4732 tSirWifiChannelInfo channel;
4733 /* msecs the radio is awake (32 bits number accruing over time) */
4734 uint32_t onTime;
4735 /* msecs the CCA register is busy (32 bits number accruing over time) */
4736 uint32_t ccaBusyTime;
4737} tSirWifiChannelStats, *tpSirWifiChannelStats;
4738
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004739#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004740/* radio statistics */
4741typedef struct {
4742 /* wifi radio (if multiple radio supported) */
4743 tSirWifiRadio radio;
4744 /* msecs the radio is awake (32 bits number accruing over time) */
4745 uint32_t onTime;
4746 /* msecs the radio is transmitting
4747 * (32 bits number accruing over time)
4748 */
4749 uint32_t txTime;
4750 /* msecs the radio is in active receive
4751 *(32 bits number accruing over time)
4752 */
4753 uint32_t rxTime;
4754 /* msecs the radio is awake due to all scan
4755 * (32 bits number accruing over time)
4756 */
4757 uint32_t onTimeScan;
4758 /* msecs the radio is awake due to NAN
4759 * (32 bits number accruing over time)
4760 */
4761 uint32_t onTimeNbd;
4762 /* msecs the radio is awake due to Gscan
4763 * (32 bits number accruing over time)
4764 */
4765 uint32_t onTimeGscan;
4766 /* msecs the radio is awake due to roam?scan
4767 * (32 bits number accruing over time)
4768 */
4769 uint32_t onTimeRoamScan;
4770 /* msecs the radio is awake due to PNO scan
4771 * (32 bits number accruing over time)
4772 */
4773 uint32_t onTimePnoScan;
4774 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
4775 * (32 bits number accruing over time)
4776 */
4777 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07004778
4779 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4780 uint32_t total_num_tx_power_levels;
4781 uint32_t *tx_time_per_power_level;
4782
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004783 /* number of channels */
4784 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004785
4786 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4787 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
4788
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004789 uint32_t on_time_host_scan;
4790 uint32_t on_time_lpi_scan;
4791
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004792 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07004793 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004794} tSirWifiRadioStat, *tpSirWifiRadioStat;
4795
4796/* per rate statistics */
4797typedef struct {
4798 /* rate information */
4799 tSirWifiRate rate;
4800 /* number of successfully transmitted data pkts (ACK rcvd) */
4801 uint32_t txMpdu;
4802 /* number of received data pkts */
4803 uint32_t rxMpdu;
4804 /* number of data packet losses (no ACK) */
4805 uint32_t mpduLost;
4806 /* total number of data pkt retries * */
4807 uint32_t retries;
4808 /* number of short data pkt retries */
4809 uint32_t retriesShort;
4810 /* number of long data pkt retries */
4811 uint32_t retriesLong;
4812} tSirWifiRateStat, *tpSirWifiRateStat;
4813
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004814/* wifi peer type */
4815typedef enum {
4816 WIFI_PEER_STA,
4817 WIFI_PEER_AP,
4818 WIFI_PEER_P2P_GO,
4819 WIFI_PEER_P2P_CLIENT,
4820 WIFI_PEER_NAN,
4821 WIFI_PEER_TDLS,
4822 WIFI_PEER_INVALID,
4823} tSirWifiPeerType;
4824
4825/* per peer statistics */
4826typedef struct {
4827 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08004828 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004829 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304830 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004831 /* peer WIFI_CAPABILITY_XXX */
4832 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08004833 union {
4834 /* peer power saving mode */
4835 uint32_t power_saving;
4836 /* number of rates */
4837 uint32_t numRate;
4838 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004839 /* per rate statistics, number of entries = num_rate */
4840 tSirWifiRateStat rateStats[0];
4841} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
4842
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004843/**
4844 * struct wifi_iface_offload_stat - Wifi Iface offload statistics
4845 * @type: type of offload stats (enum wmi_offload_stats_type)
4846 * @rx_count: Number of (MSDUs) frames Received
4847 * @drp_count: Number of frames Dropped
4848 * @fwd_count:
4849 * Number of frames for which FW Responded (Valid for ARP and NS only).(or)
4850 * Number of frames forwarded to Host (Valid for stats type except ARP and NS).
4851 */
4852struct wifi_iface_offload_stat {
4853 wmi_offload_stats_type type;
4854 uint32_t rx_count;
4855 uint32_t drp_count;
4856 uint32_t fwd_count;
4857};
4858
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004859/* per access category statistics */
4860typedef struct {
4861 /* tSirWifiTrafficAc */
4862 /* access category (VI, VO, BE, BK) */
4863 uint32_t ac;
4864 /* number of successfully transmitted unicast data pkts (ACK rcvd) */
4865 uint32_t txMpdu;
4866 /* number of received unicast mpdus */
4867 uint32_t rxMpdu;
Jeff Johnson3370f3a2018-05-11 09:54:12 -07004868 /* number of successfully transmitted multicast data packets */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004869 /* STA case: implies ACK received from AP for the unicast */
4870 /* packet in which mcast pkt was sent */
4871 uint32_t txMcast;
4872 /* number of received multicast data packets */
4873 uint32_t rxMcast;
4874 /* number of received unicast a-mpdus */
4875 uint32_t rxAmpdu;
4876 /* number of transmitted unicast a-mpdus */
4877 uint32_t txAmpdu;
4878 /* number of data pkt losses (no ACK) */
4879 uint32_t mpduLost;
4880 /* total number of data pkt retries */
4881 uint32_t retries;
4882 /* number of short data pkt retries */
4883 uint32_t retriesShort;
4884 /* number of long data pkt retries */
4885 uint32_t retriesLong;
4886 /* data pkt min contention time (usecs) */
4887 uint32_t contentionTimeMin;
4888 /* data pkt max contention time (usecs) */
4889 uint32_t contentionTimeMax;
4890 /* data pkt avg contention time (usecs) */
4891 uint32_t contentionTimeAvg;
4892 /* num of data pkts used for contention statistics */
4893 uint32_t contentionNumSamples;
4894} tSirWifiWmmAcStat, *tpSirWifiWmmAcStat;
4895
4896/* Interface statistics - corresponding to 2nd most
4897 * LSB in wifi statistics bitmap for getting statistics
4898 */
4899typedef struct {
4900 /* current state of the interface */
4901 tSirWifiInterfaceInfo info;
4902 /* access point beacon received count from connected AP */
4903 uint32_t beaconRx;
4904 /* access point mgmt frames received count from */
4905 /* connected AP (including Beacon) */
4906 uint32_t mgmtRx;
4907 /* action frames received count */
4908 uint32_t mgmtActionRx;
4909 /* action frames transmit count */
4910 uint32_t mgmtActionTx;
4911 /* access Point Beacon and Management frames RSSI (averaged) */
4912 uint32_t rssiMgmt;
4913 /* access Point Data Frames RSSI (averaged) from connected AP */
4914 uint32_t rssiData;
4915 /* access Point ACK RSSI (averaged) from connected AP */
4916 uint32_t rssiAck;
4917 /* number of peers */
4918 uint32_t num_peers;
4919 /*
4920 * Indicates how many peer_stats events will be sent depending on the
4921 * num_peers.
4922 */
4923 uint32_t num_peer_events;
4924 /* number of ac */
4925 uint32_t num_ac;
4926 /* Roaming Stat */
4927 uint32_t roam_state;
4928 /*
4929 * Average Beacon spread offset is the averaged time delay between TBTT
4930 * and beacon TSF. Upper 32 bits of averaged 64 bit beacon spread offset
4931 */
4932 uint32_t avg_bcn_spread_offset_high;
4933 /* Lower 32 bits of averaged 64 bit beacon spread offset */
4934 uint32_t avg_bcn_spread_offset_low;
4935 /*
4936 * Takes value of 1 if AP leaks packets after sending an ACK for PM=1
4937 * otherwise 0
4938 */
4939 uint32_t is_leaky_ap;
4940 /*
4941 * Average number of frames received from AP after receiving the ACK
4942 * for a frame with PM = 1
4943 */
4944 uint32_t avg_rx_frms_leaked;
4945 /*
4946 * Rx leak watch window currently in force to minimize data loss
4947 * because of leaky AP. Rx leak window is the
4948 * time driver waits before shutting down the radio or switching
4949 * the channel and after receiving an ACK for
4950 * a data frame with PM bit set.
4951 */
4952 uint32_t rx_leak_window;
gaolezb432ed92017-03-16 18:40:04 +08004953 uint32_t rts_succ_cnt;
4954 uint32_t rts_fail_cnt;
4955 uint32_t ppdu_succ_cnt;
4956 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004957
4958 uint32_t tx_rts_succ_cnt;
4959 uint32_t tx_rts_fail_cnt;
4960 uint32_t tx_ppdu_succ_cnt;
4961 uint32_t tx_ppdu_fail_cnt;
4962 uint32_t connected_duration;
4963 uint32_t disconnected_duration;
4964 uint32_t rtt_ranging_duration;
4965 uint32_t rtt_responder_duration;
4966 uint32_t num_probes_tx;
4967 uint32_t num_beacon_miss;
4968
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004969 /* per ac data packet statistics */
4970 tSirWifiWmmAcStat AccessclassStats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004971
4972 uint32_t num_offload_stats;
4973 struct wifi_iface_offload_stat offload_stat[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004974} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
4975
4976/* Peer statistics - corresponding to 3rd most LSB in
4977 * wifi statistics bitmap for getting statistics
4978 */
4979typedef struct {
4980 /* number of peers */
4981 uint32_t numPeers;
4982 /* per peer statistics */
4983 tSirWifiPeerInfo peerInfo[0];
4984} tSirWifiPeerStat, *tpSirWifiPeerStat;
4985
4986/* wifi statistics bitmap for getting statistics */
4987#define WMI_LINK_STATS_RADIO 0x00000001
4988#define WMI_LINK_STATS_IFACE 0x00000002
4989#define WMI_LINK_STATS_ALL_PEER 0x00000004
4990#define WMI_LINK_STATS_PER_PEER 0x00000008
4991
4992/* wifi statistics bitmap for clearing statistics */
4993/* all radio statistics */
4994#define WIFI_STATS_RADIO 0x00000001
4995/* cca_busy_time (within radio statistics) */
4996#define WIFI_STATS_RADIO_CCA 0x00000002
4997/* all channel statistics (within radio statistics) */
4998#define WIFI_STATS_RADIO_CHANNELS 0x00000004
4999/* all scan statistics (within radio statistics) */
5000#define WIFI_STATS_RADIO_SCAN 0x00000008
5001/* all interface statistics */
5002#define WIFI_STATS_IFACE 0x00000010
5003/* all tx rate statistics (within interface statistics) */
5004#define WIFI_STATS_IFACE_TXRATE 0x00000020
5005/* all ac statistics (within interface statistics) */
5006#define WIFI_STATS_IFACE_AC 0x00000040
5007/* all contention (min, max, avg) statistics (within ac statistics) */
5008#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05305009/* All peer stats on this interface */
5010#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
5011/* Clear particular peer stats depending on the peer_mac */
5012#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005013
Zhang Qiana6e9c102016-12-22 16:47:24 +08005014/**
5015 * struct sir_wifi_iface_tx_fail - TX failure event
5016 * @tid: TX TID
5017 * @msdu_num: TX MSDU failed counter
5018 * @status: TX status from HTT message.
5019 * Only failure status will be involved.
5020 */
5021struct sir_wifi_iface_tx_fail {
5022 uint8_t tid;
5023 uint16_t msdu_num;
5024 enum htt_tx_status status;
5025};
5026
Zhang Qian73c348a2017-03-13 16:15:55 +08005027/**
5028 * struct sir_wifi_chan_cca_stats - channal CCA stats
5029 * @vdev_id: vdev ID
5030 * @idle_time: percentage of idle time, no TX, no RX, no interference
5031 * @tx_time: percentage of time transmitting packets
5032 * @rx_in_bss_time: percentage of time receiving packets in current BSS
5033 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
5034 * @rx_busy_time: percentage of time interference detected
5035 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
5036 * or packets flagged as retransmission or seqnum discontinued.
5037 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
5038 * that haven't been ACKed.
5039 * @wlan_not_avail_time: percentage of time the chip is unable to
5040 * work in normal conditions.
5041 */
5042struct sir_wifi_chan_cca_stats {
5043 uint32_t vdev_id;
5044 uint32_t idle_time;
5045 uint32_t tx_time;
5046 uint32_t rx_in_bss_time;
5047 uint32_t rx_out_bss_time;
5048 uint32_t rx_busy_time;
5049 uint32_t rx_in_bad_cond_time;
5050 uint32_t tx_in_bad_cond_time;
5051 uint32_t wlan_not_avail_time;
5052};
5053
5054#define WIFI_MAX_CHAINS 8
5055
5056/**
5057 * struct sir_wifi_peer_signal_stats - peer signal stats
5058 * @vdev_id: vdev ID
5059 * @peer_id: peer ID
5060 * @per_ant_snr: per antenna SNR
5061 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08005062 * @per_ant_rx_mpdus: MPDUs received per antenna
5063 * @per_ant_tx_mpdus: MPDUs transferred per antenna
5064 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08005065 */
5066struct sir_wifi_peer_signal_stats {
5067 uint32_t vdev_id;
5068 uint32_t peer_id;
5069
5070 /* per antenna SNR in current bss */
5071 int32_t per_ant_snr[WIFI_MAX_CHAINS];
5072
5073 /* Background noise */
5074 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08005075
5076 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
5077 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
5078 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08005079};
5080
5081#define WIFI_VDEV_NUM 4
5082#define WFIF_MCS_NUM 10
5083#define WIFI_AGGR_NUM 8
5084#define WIFI_DELAY_SIZE 11
5085
5086/**
5087 * struct sir_wifi_tx - per AC tx stats
5088 * @msdus: number of totoal MSDUs on MAC layer in the period
5089 * @mpdus: number of totoal MPDUs on MAC layer in the period
5090 * @ppdus: number of totoal PPDUs on PHY layer in the period
5091 * @bytes: bytes of tx data on MAC layer in the period
5092 * @drops: number of TX packets cancelled due to any reason in the period,
5093 * such as WMM limitation/bandwidth limitation/radio congestion
5094 * @drop_bytes: bytes of dropped TX packets in the period
5095 * @retries: number of unacked transmissions of MPDUs
5096 * @failed: number of packets have not been ACKed despite retried
5097 * @aggr_len: length of the MPDU aggregation size buffer
5098 * @mpdu_aggr_size: histogram of MPDU aggregation size
5099 * @success_mcs_len: length of success mcs buffer
5100 * @success_mcs: histogram of successed received MPDUs encoding rate
5101 * @fail_mcs_len: length of failed mcs buffer
5102 * @fail_mcs: histogram of failed received MPDUs encoding rate
5103 * @delay_len: length of the delay histofram buffer
5104 * @delay: histogram of delays on MAC layer
5105 */
5106struct sir_wifi_tx {
5107 uint32_t msdus;
5108 uint32_t mpdus;
5109 uint32_t ppdus;
5110 uint32_t bytes;
5111 uint32_t drops;
5112 uint32_t drop_bytes;
5113 uint32_t retries;
5114 uint32_t failed;
5115 uint32_t aggr_len;
5116 uint32_t *mpdu_aggr_size;
5117 uint32_t success_mcs_len;
5118 uint32_t *success_mcs;
5119 uint32_t fail_mcs_len;
5120 uint32_t *fail_mcs;
5121 uint32_t delay_len;
5122 uint32_t *delay;
5123};
5124
5125/**
5126 * struct sir_wifi_rx - per AC rx stats
5127 * @mpdus: number of RX packets on MAC layer
5128 * @bytes: bytes of RX packets on MAC layer
5129 * @ppdus: number of RX packets on PHY layer
5130 * @ppdu_bytes: bytes of RX packets on PHY layer
5131 * @mpdu_lost: number of discontinuity in seqnum
5132 * @mpdu_retry: number of RX packets flagged as retransmissions
5133 * @mpdu_dup: number of RX packets identified as duplicates
5134 * @mpdu_discard: number of RX packets discarded
5135 * @aggr_len: length of MPDU aggregation histogram buffer
5136 * @mpdu_aggr: histogram of MPDU aggregation size
5137 * @mcs_len: length of mcs histogram buffer
5138 * @mcs: histogram of encoding rate.
5139 */
5140struct sir_wifi_rx {
5141 uint32_t mpdus;
5142 uint32_t bytes;
5143 uint32_t ppdus;
5144 uint32_t ppdu_bytes;
5145 uint32_t mpdu_lost;
5146 uint32_t mpdu_retry;
5147 uint32_t mpdu_dup;
5148 uint32_t mpdu_discard;
5149 uint32_t aggr_len;
5150 uint32_t *mpdu_aggr;
5151 uint32_t mcs_len;
5152 uint32_t *mcs;
5153};
5154
5155/**
5156 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
5157 * @type: WMM AC type
5158 * @tx_stats: pointer to TX stats
5159 * @rx_stats: pointer to RX stats
5160 */
5161struct sir_wifi_ll_ext_wmm_ac_stats {
5162 uint32_t type;
5163 struct sir_wifi_tx *tx_stats;
5164 struct sir_wifi_rx *rx_stats;
5165};
5166
Zhang Qian73c348a2017-03-13 16:15:55 +08005167/**
5168 * struct sir_wifi_ll_ext_peer_stats - per peer stats
5169 * @peer_id: peer ID
5170 * @vdev_id: VDEV ID
5171 * mac_address: MAC address
5172 * @sta_ps_inds: how many times STAs go to sleep
5173 * @sta_ps_durs: total sleep time of STAs (units in ms)
5174 * @rx_probe_reqs: number of probe requests received
5175 * @rx_oth_mgmts: number of other management frames received,
5176 * not including probe requests
5177 * @peer_signal_stat: signal stats
5178 * @ac_stats: WMM BE/BK/VI/VO stats
5179 */
5180struct sir_wifi_ll_ext_peer_stats {
5181 uint32_t peer_id;
5182 uint32_t vdev_id;
5183 tSirMacAddr mac_address;
5184 uint32_t sta_ps_inds;
5185 uint32_t sta_ps_durs;
5186 uint32_t rx_probe_reqs;
5187 uint32_t rx_oth_mgmts;
5188 struct sir_wifi_peer_signal_stats peer_signal_stats;
5189 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
5190};
5191
5192/**
5193 * struct sir_wifi_ll_ext_stats - link layer stats report
5194 * @trigger_cond_id: Indicate what triggered this event.
5195 * 1: timeout. 2: threshold
5196 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
5197 * which exceeded the thresholds
5198 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
5199 * which exceeded the thresholds
5200 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
5201 * which exceeded the thresholds
5202 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
5203 * which exceeded the thresholds
5204 * @chan_cca_stats: channel CCA stats
5205 * @peer_signal_stats: peer signal stats
5206 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
5207 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
5208 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
5209 * @tx_delay_array_len: length of delay stats buffer
5210 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
5211 * @rx_mcs_array_len: length of RX mcs stats buffer
5212 * @peer_stats: peer stats
5213 * @cca: physical channel CCA stats
5214 * @stats: pointer to stats data buffer.
5215 *
5216 * Structure of the whole statictics is like this:
5217 * ---------------------------------
5218 * | trigger_cond_i |
5219 * +-------------------------------+
5220 * | cca_chgd_bitmap |
5221 * +-------------------------------+
5222 * | sig_chgd_bitmap |
5223 * +-------------------------------+
5224 * | tx_chgd_bitmap |
5225 * +-------------------------------+
5226 * | rx_chgd_bitmap |
5227 * +-------------------------------+
5228 * | peer_num |
5229 * +-------------------------------+
5230 * | channel_num |
5231 * +-------------------------------+
5232 * | tx_mpdu_aggr_array_len |
5233 * +-------------------------------+
5234 * | tx_succ_mcs_array_len |
5235 * +-------------------------------+
5236 * | tx_fail_mcs_array_len |
5237 * +-------------------------------+
5238 * | tx_delay_array_len |
5239 * +-------------------------------+
5240 * | rx_mpdu_aggr_array_len |
5241 * +-------------------------------+
5242 * | rx_mcs_array_len |
5243 * +-------------------------------+
5244 * | pointer to CCA stats |
5245 * +-------------------------------+
5246 * | pointer to peer stats |
5247 * +-------------------------------+
5248 * | CCA stats |
5249 * +-------------------------------+
5250 * | peer_stats |----+
5251 * +-------------------------------+ |
5252 * | per peer signals stats |<---+
5253 * | peer0 ~ peern | |
5254 * +-------------------------------+ |
5255 * | TX aggr/mcs parameters array | |
5256 * | Length of this buffer is | |
5257 * | configurable for user layer. |<-+ |
5258 * +-------------------------------+ | |
5259 * | per peer tx stats |--+ |
5260 * | BE | <--+
5261 * | BK | |
5262 * | VI | |
5263 * | VO | |
5264 * +-------------------------------+ |
5265 * | TX aggr/mcs parameters array | |
5266 * | Length of this buffer is | |
5267 * | configurable for user layer. |<-+ |
5268 * +-------------------------------+ | |
5269 * | peer peer rx stats |--+ |
5270 * | BE | <--+
5271 * | BE |
5272 * | BK |
5273 * | VI |
5274 * | VO |
5275 * ---------------------------------
5276 */
5277struct sir_wifi_ll_ext_stats {
5278 uint32_t trigger_cond_id;
5279 uint32_t cca_chgd_bitmap;
5280 uint32_t sig_chgd_bitmap;
5281 uint32_t tx_chgd_bitmap;
5282 uint32_t rx_chgd_bitmap;
5283 uint8_t peer_num;
5284 uint8_t channel_num;
5285 uint32_t tx_mpdu_aggr_array_len;
5286 uint32_t tx_succ_mcs_array_len;
5287 uint32_t tx_fail_mcs_array_len;
5288 uint32_t tx_delay_array_len;
5289 uint32_t rx_mpdu_aggr_array_len;
5290 uint32_t rx_mcs_array_len;
5291 struct sir_wifi_ll_ext_peer_stats *peer_stats;
5292 struct sir_wifi_chan_cca_stats *cca;
5293 uint8_t stats[];
5294};
5295
5296/**
5297 * struct sir_channel_cca_threshold - threshold for channel CCA
5298 * @idle_time: idle time, no TX, no RX, no interference
5299 * @tx_time: time transmitting packets
5300 * @rx_in_bss_time: time receiving packets in current BSSs
5301 * @rx_out_bss_time: time receiving packets not in current BSSs
5302 * @rx_busy_time: time interference detected
5303 * @rx_in_bad_cond_time: receiving packets with errors
5304 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
5305 * @wlan_not_avail_time: wlan card cannot work
5306 */
5307struct sir_channel_cca_threshold {
5308 uint32_t idle_time;
5309 uint32_t tx_time;
5310 uint32_t rx_in_bss_time;
5311 uint32_t rx_out_bss_time;
5312 uint32_t rx_busy_time;
5313 uint32_t rx_in_bad_cond_time;
5314 uint32_t tx_in_bad_cond_time;
5315 uint32_t wlan_not_avail_time;
5316};
5317
5318/**
5319 * struct sir_signal_threshold - threshold for per peer sigbal
5320 * @snr: signal to noise rate
5321 * @nf: noise floor
5322 */
5323struct sir_signal_threshold {
5324 uint32_t snr;
5325 uint32_t nf;
5326};
5327
5328/**
5329 * struct sir_tx_threshold - threshold for TX
5330 * @msdu: TX MSDUs on MAC layer
5331 * @mpdu: TX MPDUs on MAC layer
5332 * @ppdu: TX PPDUs on MAC layer
5333 * @bytes: TX bytes on MAC layer
5334 * @msdu_drop: drooped MSDUs
5335 * @byte_drop: dropped Bytes
5336 * @mpdu_retry: MPDU not acked
5337 * @ppdu_fail: PPDUs which received no block ack
5338 * @aggregation: aggregation size
5339 * @succ_mcs: histogram of encoding rate for acked PPDUs
5340 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
5341 */
5342struct sir_tx_threshold {
5343 uint32_t msdu;
5344 uint32_t mpdu;
5345 uint32_t ppdu;
5346 uint32_t bytes;
5347 uint32_t msdu_drop;
5348 uint32_t byte_drop;
5349 uint32_t mpdu_retry;
5350 uint32_t mpdu_fail;
5351 uint32_t ppdu_fail;
5352 uint32_t aggregation;
5353 uint32_t succ_mcs;
5354 uint32_t fail_mcs;
5355 uint32_t delay;
5356};
5357
5358/**
5359 * struct sir_rx_threshold - threshold for RX
5360 * @mpdu: RX MPDUs on MAC layer
5361 * @bytes: RX bytes on MAC layer
5362 * @ppdu: RX PPDU on PHY layer
5363 * @ppdu_bytes: RX bytes on PHY layer
5364 * @disorder: discontinuity in seqnum
5365 * @mpdu_retry: MPDUs flagged as retry
5366 * @mpdu_dup: MPDUs identified as duplicated
5367 * @aggregation: aggregation size
5368 * @mcs: histogram of encoding rate for PPDUs
5369 * @ps_inds: power save indication
5370 * @ps_durs: total time in power save
5371 * @probe_reqs: probe request received
5372 * @other_mgmt: other MGMT frames received
5373 */
5374struct sir_rx_threshold {
5375 uint32_t mpdu;
5376 uint32_t bytes;
5377 uint32_t ppdu;
5378 uint32_t ppdu_bytes;
5379 uint32_t disorder;
5380 uint32_t mpdu_lost;
5381 uint32_t mpdu_retry;
5382 uint32_t mpdu_dup;
5383 uint32_t mpdu_discard;
5384 uint32_t aggregation;
5385 uint32_t mcs;
5386 uint32_t ps_inds;
5387 uint32_t ps_durs;
5388 uint32_t probe_reqs;
5389 uint32_t other_mgmt;
5390};
5391
5392/**
5393 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
5394 * @period: MAC counter indication period (unit in ms)
5395 * @enable: if threshold mechnism is enabled or disabled
5396 * @enable_bitmap: whether dedicated threshold is enabed.
5397 * Every MAC counter has a dedicated threshold. If the dedicated
5398 * threshold is not set in the bitmap, global threshold will take
5399 * effect.
5400 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07005401 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08005402 * will indicate stats periodically.
5403 * @global_threshold: global threshold value
5404 * @cca_bitmap: bitmap for CCA.
5405 * Bit0: idle time
5406 * Bit1: tx time
5407 * Bit2: RX in BSS
5408 * Bit3: RX out of BSS
5409 * Bit4: medium busy
5410 * Bit5: RX bad
5411 * Bit6: TX bad
5412 * Bit7: WLAN card not available
5413 * @signal_bitmap:
5414 * Bit0: Per channel SNR counter
5415 * Bit1: Per channel noise floor counter
5416 * @tx_bitmap: bitmap for TX counters
5417 * Bit0: TX counter unit in MSDU
5418 * Bit1: TX counter unit in MPDU
5419 * Bit2: TX counter unit in PPDU
5420 * Bit3: TX counter unit in byte
5421 * Bit4: Dropped MSDUs
5422 * Bit5: Dropped Bytes
5423 * Bit6: MPDU retry counter
5424 * Bit7: MPDU failure counter
5425 * Bit8: PPDU failure counter
5426 * Bit9: MPDU aggregation counter
5427 * Bit10: MCS counter for ACKed MPDUs
5428 * Bit11: MCS counter for Failed MPDUs
5429 * Bit12: TX Delay counter
5430 * @rx_bitmap:bitmap for RX counters
5431 * Bit0: MAC RX counter unit in MPDU
5432 * Bit1: MAC RX counter unit in byte
5433 * Bit2: PHY RX counter unit in PPDU
5434 * Bit3: PHY RX counter unit in byte
5435 * Bit4: Disorder counter
5436 * Bit5: Retry counter
5437 * Bit6: Duplication counter
5438 * Bit7: Discard counter
5439 * Bit8: MPDU aggregation size counter
5440 * Bit9: MCS counter
5441 * Bit10: Peer STA power state change (wake to sleep) counter
5442 * Bit11: Peer STA power save counter, total time in PS mode
5443 * Bit12: Probe request counter
5444 * Bit13: Other management frames counter
5445 * @cca_thresh: CCA threshold
5446 * @signal_thresh: signal threshold
5447 * @tx_thresh: TX threshold
5448 * @rx_thresh: RX threshold
5449 *
5450 * Generally, Link layer statistics is reported periodically. But if the
5451 * variation of one stats of compared to the pervious notification exceeds
5452 * a threshold, FW will report the new stats immediately.
5453 * This structure contains threshold for different counters.
5454 */
5455struct sir_ll_ext_stats_threshold {
5456 uint32_t period;
5457 uint32_t enable;
5458 uint32_t enable_bitmap;
5459 uint32_t global;
5460 uint32_t global_threshold;
5461 uint32_t cca_bitmap;
5462 uint32_t signal_bitmap;
5463 uint32_t tx_bitmap;
5464 uint32_t rx_bitmap;
5465 struct sir_channel_cca_threshold cca;
5466 struct sir_signal_threshold signal;
5467 struct sir_tx_threshold tx;
5468 struct sir_rx_threshold rx;
5469};
5470
5471#define LL_STATS_MIN_PERIOD 10
5472#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
5473
Zhang Qiana6e9c102016-12-22 16:47:24 +08005474/* Result ID for LL stats extension */
5475#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
5476#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
5477#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005478#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
5479
5480typedef struct sAniGetLinkStatus {
5481 uint16_t msgType; /* message type is same as the request type */
5482 uint16_t msgLen; /* length of the entire request */
5483 uint8_t linkStatus;
5484 uint8_t sessionId;
5485} tAniGetLinkStatus, *tpAniGetLinkStatus;
5486
5487#ifdef DHCP_SERVER_OFFLOAD
5488typedef struct {
5489 uint32_t vdev_id;
5490 uint32_t dhcpSrvOffloadEnabled;
5491 uint32_t dhcpClientNum;
5492 uint32_t dhcpSrvIP;
5493} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
5494#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05305495
5496/**
5497 * struct sir_lost_link_info - lost link information structure.
5498 *
5499 * @vdev_id: vdev_id from WMA. some modules call sessionId.
5500 * @rssi: rssi at disconnection time.
5501 *
5502 * driver uses this structure to communicate information collected at
5503 * disconnection time.
5504 */
5505struct sir_lost_link_info {
5506 uint32_t vdev_id;
5507 int32_t rssi;
5508};
5509
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005510/* find the size of given member within a structure */
5511#ifndef member_size
5512#define member_size(type, member) (sizeof(((type *)0)->member))
5513#endif
5514
5515#define RTT_INVALID 0x00
5516#define RTT_TIMING_MEAS_CAPABILITY 0x01
5517#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
5518#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
5519
5520/**
5521 * enum fine_time_meas_mask - bit mask to identify device's
5522 * fine timing measurement capability
5523 * @FINE_TIME_MEAS_STA_INITIATOR - STA role, Initiator capability is supported
5524 * @FINE_TIME_MEAS_STA_RESPONDER - STA role, Responder capability is supported
5525 * @FINE_TIME_MEAS_P2PCLI_INITIATOR - P2P-CLI supports initiator capability
5526 * @FINE_TIME_MEAS_P2PCLI_RESPONDER - P2P-CLI supports responder capability
5527 * @FINE_TIME_MEAS_P2PGO_INITIATOR - P2P-GO supports initiator capability
5528 * @FINE_TIME_MEAS_P2PGO_RESPONDER - P2P-GO supports responder capability
5529 * @FINE_TIME_MEAS_SAP_INITIATOR - SAP role, Initiator capability is supported
5530 * @FINE_TIME_MEAS_SAP_RESPONDER - SAP role, Responder capability is supported
5531 */
5532enum fine_time_meas_mask {
5533 FINE_TIME_MEAS_STA_INITIATOR = (1 << (0)),
5534 FINE_TIME_MEAS_STA_RESPONDER = (1 << (1)),
5535 FINE_TIME_MEAS_P2PCLI_INITIATOR = (1 << (2)),
5536 FINE_TIME_MEAS_P2PCLI_RESPONDER = (1 << (3)),
5537 FINE_TIME_MEAS_P2PGO_INITIATOR = (1 << (4)),
5538 FINE_TIME_MEAS_P2PGO_RESPONDER = (1 << (5)),
5539 FINE_TIME_MEAS_SAP_INITIATOR = (1 << (6)),
5540 FINE_TIME_MEAS_SAP_RESPONDER = (1 << (7)),
5541};
5542
5543/* number of neighbor reports that we can handle in Neighbor Report Response */
5544#define MAX_SUPPORTED_NEIGHBOR_RPT 15
5545
5546/**
5547 * struct sir_stats_avg_factor
5548 * @vdev_id: session id
5549 * @stats_avg_factor: average factor
5550 */
5551struct sir_stats_avg_factor {
5552 uint8_t vdev_id;
5553 uint16_t stats_avg_factor;
5554};
5555
5556/**
5557 * struct sir_guard_time_request
5558 * @vdev_id: session id
5559 * @guard_time: guard time
5560 */
5561struct sir_guard_time_request {
5562 uint8_t vdev_id;
5563 uint32_t guard_time;
5564};
5565
5566/* Max number of rates allowed in Supported Rates IE */
5567#define MAX_NUM_SUPPORTED_RATES (8)
5568
5569/*
5570 * struct rssi_monitor_req - rssi monitoring
5571 * @request_id: request id
5572 * @session_id: session id
5573 * @min_rssi: minimum rssi
5574 * @max_rssi: maximum rssi
5575 * @control: flag to indicate start or stop
5576 */
5577struct rssi_monitor_req {
5578 uint32_t request_id;
5579 uint32_t session_id;
5580 int8_t min_rssi;
5581 int8_t max_rssi;
5582 bool control;
5583};
5584
5585/**
5586 * struct rssi_breach_event - rssi breached event structure
5587 * @request_id: request id
5588 * @session_id: session id
5589 * @curr_rssi: current rssi
5590 * @curr_bssid: current bssid
5591 */
5592struct rssi_breach_event {
5593 uint32_t request_id;
5594 uint32_t session_id;
5595 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305596 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005597};
5598
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305599/**
5600 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
5601 * event params
5602 * @failure_reason_code:failure reason code
5603 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
5604 */
5605struct chip_pwr_save_fail_detected_params {
5606 uint32_t failure_reason_code;
5607 uint32_t wake_lock_bitmap[4];
5608};
5609
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005610#define MAX_NUM_FW_SEGMENTS 4
5611
5612/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305613 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
5614 * by default to the probe request
5615 */
5616#define DEFAULT_SCAN_IE_ID 256
5617
5618 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05305619#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305620
5621 /* Extended Capabilities IE header(IE Id + IE Length) length */
5622#define EXT_CAP_IE_HDR_LEN 2
5623
5624/**
5625 * struct hdd_default_scan_ie - HDD default scan IE structure
5626 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
5627 * @length: length of the struct hdd_default_scan_ie
5628 * @session_id: Session Id
5629 * @ie_len: Default scan IE length
5630 * @ie_data: Pointer to default scan IE data
5631 */
5632struct hdd_default_scan_ie {
5633 uint16_t message_type;
5634 uint16_t length;
5635 uint16_t session_id;
5636 uint16_t ie_len;
5637 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
5638};
5639
5640/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005641 * struct vdev_ie_info - IE info
5642 * @vdev_id - vdev for which the IE is being sent
5643 * @ie_id - ID of the IE
5644 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07005645 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005646 * @data - IE data
5647 *
5648 * This structure is used to store the IE information.
5649 */
5650struct vdev_ie_info {
5651 uint32_t vdev_id;
5652 uint32_t ie_id;
5653 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07005654 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005655 uint8_t *data;
5656};
5657
5658/**
5659 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
5660 * @type - MSG type
5661 * @length - length of the message
5662 * @seesion_id - session_id for which the message is intended for
5663 *
5664 * This structure is used to pass send_extcap_ie msg from SME to PE
5665 */
5666struct send_extcap_ie {
5667 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
5668 uint16_t length;
5669 uint8_t session_id;
5670};
5671
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005672typedef void (*hw_mode_transition_cb)(uint32_t old_hw_mode_index,
5673 uint32_t new_hw_mode_index,
5674 uint32_t num_vdev_mac_entries,
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08005675 struct policy_mgr_vdev_mac_map *vdev_mac_map);
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08005676typedef void (*antenna_mode_cb)(uint32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005677
5678/**
5679 * struct sir_nss_update_request
5680 * @msgType: nss update msg type
5681 * @msgLen: length of the msg
5682 * @new_nss: new spatial stream value
5683 * @vdev_id: session id
5684 */
5685struct sir_nss_update_request {
5686 uint16_t msgType;
5687 uint16_t msgLen;
5688 uint8_t new_nss;
5689 uint32_t vdev_id;
5690};
5691
5692/**
5693 * struct sir_beacon_tx_complete_rsp
5694 *
5695 * @session_id: session for which beacon update happened
5696 * @tx_status: status of the beacon tx from FW
5697 */
5698struct sir_beacon_tx_complete_rsp {
5699 uint8_t session_id;
5700 uint8_t tx_status;
5701};
5702
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005703/**
5704 * OCB structures
5705 */
5706
5707#define NUM_AC (4)
5708#define OCB_CHANNEL_MAX (5)
5709
5710struct sir_qos_params {
5711 uint8_t aifsn;
5712 uint8_t cwmin;
5713 uint8_t cwmax;
5714};
5715
5716/**
5717 * struct sir_ocb_set_config_response
5718 * @status: response status
5719 */
5720struct sir_ocb_set_config_response {
5721 uint8_t status;
5722};
5723
5724/** Callback for the dcc_stats_event */
5725typedef void (*dcc_stats_event_callback_t)(void *hdd_ctx, uint32_t vdev_id,
5726 uint32_t num_channels, uint32_t stats_per_channel_array_len,
5727 const void *stats_per_channel_array);
5728
5729/**
5730 * struct sir_ocb_config_channel
5731 * @chan_freq: frequency of the channel
5732 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
5733 * @mac_address: MAC address assigned to this channel
5734 * @qos_params: QoS parameters
5735 * @max_pwr: maximum transmit power of the channel (dBm)
5736 * @min_pwr: minimum transmit power of the channel (dBm)
5737 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
5738 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
5739 */
5740struct sir_ocb_config_channel {
5741 uint32_t chan_freq;
5742 uint32_t bandwidth;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305743 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005744 struct sir_qos_params qos_params[MAX_NUM_AC];
5745 uint32_t max_pwr;
5746 uint32_t min_pwr;
5747 uint8_t reg_pwr;
5748 uint8_t antenna_max;
5749 uint16_t flags;
5750};
5751
5752/**
5753 * OCB_CHANNEL_FLAG_NO_RX_HDR - Don't add the RX stats header to packets
5754 * received on this channel.
5755 */
5756#define OCB_CHANNEL_FLAG_DISABLE_RX_STATS_HDR (1 << 0)
5757
5758/**
5759 * struct sir_ocb_config_sched
5760 * @chan_freq: frequency of the channel
5761 * @total_duration: duration of the schedule
5762 * @guard_interval: guard interval on the start of the schedule
5763 */
5764struct sir_ocb_config_sched {
5765 uint32_t chan_freq;
5766 uint32_t total_duration;
5767 uint32_t guard_interval;
5768};
5769
5770/**
5771 * struct sir_ocb_config
5772 * @session_id: session id
5773 * @channel_count: number of channels
5774 * @schedule_size: size of the channel schedule
5775 * @flags: reserved
5776 * @channels: array of OCB channels
5777 * @schedule: array of OCB schedule elements
5778 * @dcc_ndl_chan_list_len: size of the ndl_chan array
5779 * @dcc_ndl_chan_list: array of dcc channel info
5780 * @dcc_ndl_active_state_list_len: size of the active state array
5781 * @dcc_ndl_active_state_list: array of active states
5782 * @adapter: the OCB adapter
5783 * @dcc_stats_callback: callback for the response event
5784 */
5785struct sir_ocb_config {
5786 uint8_t session_id;
5787 uint32_t channel_count;
5788 uint32_t schedule_size;
5789 uint32_t flags;
5790 struct sir_ocb_config_channel *channels;
5791 struct sir_ocb_config_sched *schedule;
5792 uint32_t dcc_ndl_chan_list_len;
5793 void *dcc_ndl_chan_list;
5794 uint32_t dcc_ndl_active_state_list_len;
5795 void *dcc_ndl_active_state_list;
5796};
5797
5798/* The size of the utc time in bytes. */
5799#define SIZE_UTC_TIME (10)
5800/* The size of the utc time error in bytes. */
5801#define SIZE_UTC_TIME_ERROR (5)
5802
5803/**
5804 * struct sir_ocb_utc
5805 * @vdev_id: session id
5806 * @utc_time: number of nanoseconds from Jan 1st 1958
5807 * @time_error: the error in the UTC time. All 1's for unknown
5808 */
5809struct sir_ocb_utc {
5810 uint32_t vdev_id;
5811 uint8_t utc_time[SIZE_UTC_TIME];
5812 uint8_t time_error[SIZE_UTC_TIME_ERROR];
5813};
5814
5815/**
5816 * struct sir_ocb_timing_advert
5817 * @vdev_id: session id
5818 * @chan_freq: frequency on which to advertise
5819 * @repeat_rate: the number of times it will send TA in 5 seconds
5820 * @timestamp_offset: offset of the timestamp field in the TA frame
5821 * @time_value_offset: offset of the time_value field in the TA frame
5822 * @template_length: size in bytes of the TA frame
5823 * @template_value: the TA frame
5824 */
5825struct sir_ocb_timing_advert {
5826 uint32_t vdev_id;
5827 uint32_t chan_freq;
5828 uint32_t repeat_rate;
5829 uint32_t timestamp_offset;
5830 uint32_t time_value_offset;
5831 uint32_t template_length;
5832 uint8_t *template_value;
5833};
5834
5835/**
5836 * struct sir_ocb_get_tsf_timer_response
5837 * @vdev_id: session id
5838 * @timer_high: higher 32-bits of the timer
5839 * @timer_low: lower 32-bits of the timer
5840 */
5841struct sir_ocb_get_tsf_timer_response {
5842 uint32_t vdev_id;
5843 uint32_t timer_high;
5844 uint32_t timer_low;
5845};
5846
5847/**
5848 * struct sir_ocb_get_tsf_timer
5849 * @vdev_id: session id
5850 */
5851struct sir_ocb_get_tsf_timer {
5852 uint32_t vdev_id;
5853};
5854
5855/**
5856 * struct sir_dcc_get_stats_response
5857 * @vdev_id: session id
5858 * @num_channels: number of dcc channels
5859 * @channel_stats_array_len: size in bytes of the stats array
5860 * @channel_stats_array: the stats array
5861 */
5862struct sir_dcc_get_stats_response {
5863 uint32_t vdev_id;
5864 uint32_t num_channels;
5865 uint32_t channel_stats_array_len;
5866 void *channel_stats_array;
5867};
5868
5869/**
5870 * struct sir_dcc_get_stats
5871 * @vdev_id: session id
5872 * @channel_count: number of dcc channels
5873 * @request_array_len: size in bytes of the request array
5874 * @request_array: the request array
5875 */
5876struct sir_dcc_get_stats {
5877 uint32_t vdev_id;
5878 uint32_t channel_count;
5879 uint32_t request_array_len;
5880 void *request_array;
5881};
5882
5883/**
5884 * struct sir_dcc_clear_stats
5885 * @vdev_id: session id
5886 * @dcc_stats_bitmap: bitmap of clear option
5887 */
5888struct sir_dcc_clear_stats {
5889 uint32_t vdev_id;
5890 uint32_t dcc_stats_bitmap;
5891};
5892
5893/**
5894 * struct sir_dcc_update_ndl_response
5895 * @vdev_id: session id
5896 * @status: response status
5897 */
5898struct sir_dcc_update_ndl_response {
5899 uint32_t vdev_id;
5900 uint32_t status;
5901};
5902
5903/**
5904 * struct sir_dcc_update_ndl
5905 * @vdev_id: session id
5906 * @channel_count: number of channels to be updated
5907 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
5908 * @dcc_ndl_chan_list: the ndl_chan array
5909 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
5910 * @dcc_ndl_active_state_list: the active state array
5911 */
5912struct sir_dcc_update_ndl {
5913 uint32_t vdev_id;
5914 uint32_t channel_count;
5915 uint32_t dcc_ndl_chan_list_len;
5916 void *dcc_ndl_chan_list;
5917 uint32_t dcc_ndl_active_state_list_len;
5918 void *dcc_ndl_active_state_list;
5919};
5920
5921/**
5922 * enum powersave_qpower_mode: QPOWER modes
5923 * @QPOWER_DISABLED: Qpower is disabled
5924 * @QPOWER_ENABLED: Qpower is enabled
5925 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
5926 */
5927enum powersave_qpower_mode {
5928 QPOWER_DISABLED = 0,
5929 QPOWER_ENABLED = 1,
5930 QPOWER_DUTY_CYCLING = 2
5931};
5932
5933/**
5934 * enum powersave_qpower_mode: powersave_mode
5935 * @PS_NOT_SUPPORTED: Power save is not supported
5936 * @PS_LEGACY_NODEEPSLEEP: Legacy power save enabled and deep sleep disabled
5937 * @PS_QPOWER_NODEEPSLEEP: QPOWER enabled and deep sleep disabled
5938 * @PS_LEGACY_DEEPSLEEP: Legacy power save enabled and deep sleep enabled
5939 * @PS_QPOWER_DEEPSLEEP: QPOWER enabled and deep sleep enabled
5940 * @PS_DUTY_CYCLING_QPOWER: QPOWER enabled in duty cycling mode
5941 */
5942enum powersave_mode {
5943 PS_NOT_SUPPORTED = 0,
5944 PS_LEGACY_NODEEPSLEEP = 1,
5945 PS_QPOWER_NODEEPSLEEP = 2,
5946 PS_LEGACY_DEEPSLEEP = 3,
5947 PS_QPOWER_DEEPSLEEP = 4,
5948 PS_DUTY_CYCLING_QPOWER = 5
5949};
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005950#ifdef FEATURE_LFR_SUBNET_DETECTION
5951/**
5952 * struct gateway_param_update_req - gateway parameter update request
5953 * @request_id: request id
5954 * @session_id: session id
5955 * @max_retries: Max ARP/NS retry attempts
5956 * @timeout: Retry interval
5957 * @ipv4_addr_type: on ipv4 network
5958 * @ipv6_addr_type: on ipv6 network
5959 * @gw_mac_addr: gateway mac addr
5960 * @ipv4_addr: ipv4 addr
5961 * @ipv6_addr: ipv6 addr
5962 */
5963struct gateway_param_update_req {
5964 uint32_t request_id;
5965 uint32_t session_id;
5966 uint32_t max_retries;
5967 uint32_t timeout;
5968 uint32_t ipv4_addr_type;
5969 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305970 struct qdf_mac_addr gw_mac_addr;
5971 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
5972 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005973};
5974#else
5975struct gateway_param_update_req;
5976#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005977
Abhishek Singh518323d2015-10-19 17:42:01 +05305978/**
5979 * struct sir_sme_ext_change_chan_req - channel change request
5980 * @message_type: message id
5981 * @length: msg length
5982 * @new_channel: new channel
5983 * @session_id: session id
5984 */
5985struct sir_sme_ext_cng_chan_req {
5986 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
5987 uint16_t length;
5988 uint32_t new_channel;
5989 uint8_t session_id;
5990};
5991
5992/**
5993 * struct sir_sme_ext_change_chan_ind.
5994 * @session_id: session id
5995 * @new_channel: new channel to change
5996 */
5997struct sir_sme_ext_cng_chan_ind {
5998 uint8_t session_id;
5999 uint8_t new_channel;
6000};
6001
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08006002/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006003 * struct stsf - the basic stsf structure
6004 *
6005 * @vdev_id: vdev id
6006 * @tsf_low: low 32bits of tsf
6007 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07006008 * @soc_timer_low: low 32bits of synced SOC timer value
6009 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006010 *
6011 * driver use this struct to store the tsf info
6012 */
6013struct stsf {
6014 uint32_t vdev_id;
6015 uint32_t tsf_low;
6016 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07006017 uint32_t soc_timer_low;
6018 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006019};
6020
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07006021#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
6022/**
6023 * struct beacon_filter_param - parameters for beacon filtering
6024 * @vdev_id: vdev id
6025 * @ie_map: bitwise map of IEs that needs to be filtered
6026 *
6027 */
6028struct beacon_filter_param {
6029 uint32_t vdev_id;
6030 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
6031};
6032
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05306033/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05306034 * struct adaptive_dwelltime_params - the adaptive dwelltime params
6035 * @vdev_id: vdev id
6036 * @is_enabled: Adaptive dwell time is enabled/disabled
6037 * @dwelltime_mode: global default adaptive dwell mode
6038 * @lpf_weight: weight to calculate the average low pass
6039 * filter for channel congestion
6040 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
6041 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
6042 *
6043 */
6044struct adaptive_dwelltime_params {
6045 uint32_t vdev_id;
6046 bool is_enabled;
6047 uint8_t dwelltime_mode;
6048 uint8_t lpf_weight;
6049 uint8_t passive_mon_intval;
6050 uint8_t wifi_act_threshold;
6051};
6052
6053/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05306054 * struct csa_offload_params - CSA offload request parameters
6055 * @channel: channel
6056 * @switch_mode: switch mode
6057 * @sec_chan_offset: second channel offset
6058 * @new_ch_width: new channel width
6059 * @new_ch_freq_seg1: channel center freq 1
6060 * @new_ch_freq_seg2: channel center freq 2
6061 * @ies_present_flag: IE present flag
6062 */
6063struct csa_offload_params {
6064 uint8_t channel;
6065 uint8_t switch_mode;
6066 uint8_t sec_chan_offset;
6067 uint8_t new_ch_width;
6068 uint8_t new_op_class;
6069 uint8_t new_ch_freq_seg1;
6070 uint8_t new_ch_freq_seg2;
6071 uint32_t ies_present_flag;
6072 tSirMacAddr bssId;
6073};
6074
6075/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08006076 * enum obss_ht40_scancmd_type - obss scan command type
6077 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
6078 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
6079 */
6080enum obss_ht40_scancmd_type {
6081 HT40_OBSS_SCAN_PARAM_START,
6082 HT40_OBSS_SCAN_PARAM_UPDATE
6083};
6084
6085/**
6086 * struct sme_obss_ht40_scanind_msg - sme obss scan params
6087 * @msg_type: message type
6088 * @length: message length
6089 * @mac_addr: mac address
6090 */
6091struct sme_obss_ht40_scanind_msg {
6092 uint16_t msg_type;
6093 uint16_t length;
6094 struct qdf_mac_addr mac_addr;
6095};
6096
6097/**
6098 * struct obss_ht40_scanind - ht40 obss scan request
6099 * @cmd: message type
6100 * @scan_type: message length
6101 * @obss_passive_dwelltime: obss passive dwelltime
6102 * @obss_active_dwelltime: obss active dwelltime
6103 * @obss_width_trigger_interval: scan interval
6104 * @obss_passive_total_per_channel: total passive scan time per channel
6105 * @obss_active_total_per_channel: total active scan time per channel
6106 * @bsswidth_ch_trans_delay: OBSS transition delay time
6107 * @obss_activity_threshold: OBSS activity threshold
6108 * @self_sta_id: self sta identification
6109 * @bss_id: BSS index
6110 * @fortymhz_intolerent: Ht40mhz intolerance
6111 * @channel_count: channel count
6112 * @channels: channel information
6113 * @current_operatingclass: operating class
6114 * @iefield_len: ie's length
6115 * @iefiled: ie's information
6116 */
6117struct obss_ht40_scanind {
6118 enum obss_ht40_scancmd_type cmd;
6119 enum eSirScanType scan_type;
6120 /* In TUs */
6121 uint16_t obss_passive_dwelltime;
6122 uint16_t obss_active_dwelltime;
6123 /* In seconds */
6124 uint16_t obss_width_trigger_interval;
6125 /* In TU's */
6126 uint16_t obss_passive_total_per_channel;
6127 uint16_t obss_active_total_per_channel;
6128 uint16_t bsswidth_ch_trans_delay;
6129 uint16_t obss_activity_threshold;
6130 uint8_t self_sta_idx;
6131 uint8_t bss_id;
6132 uint8_t fortymhz_intolerent;
6133 uint8_t channel_count;
6134 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
6135 uint8_t current_operatingclass;
6136 uint16_t iefield_len;
6137 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
6138};
6139
6140/**
6141 * struct obss_scanparam - OBSS scan parameters
6142 * @obss_passive_dwelltime: message type
6143 * @obss_active_dwelltime: message length
6144 * @obss_width_trigger_interval: obss passive dwelltime
6145 * @obss_passive_total_per_channel: obss passive total scan time
6146 * @obss_active_total_per_channel: obss active total scan time
6147 * @bsswidth_ch_trans_delay: OBSS transition delay time
6148 * @obss_activity_threshold: OBSS activity threshold
6149 */
6150struct obss_scanparam {
6151 uint16_t obss_passive_dwelltime;
6152 uint16_t obss_active_dwelltime;
6153 uint16_t obss_width_trigger_interval;
6154 uint16_t obss_passive_total_per_channel;
6155 uint16_t obss_active_total_per_channel;
6156 uint16_t bsswidth_ch_trans_delay;
6157 uint16_t obss_activity_threshold;
6158};
6159
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306160/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05306161 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306162 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05306163 * @version: host apf version
6164 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306165 * @total_length: The total length of the full instruction
6166 * total_length equal to 0 means reset
6167 * @current_offset: current offset, 0 means start a new setting
6168 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05306169 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306170 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05306171struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306172 uint8_t session_id;
6173 uint32_t version;
6174 uint32_t filter_id;
6175 uint32_t total_length;
6176 uint32_t current_offset;
6177 uint32_t current_length;
6178 uint8_t *program;
6179};
6180
6181/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05306182 * struct sir_apf_offload_capabilities - get apf Capabilities
6183 * @apf_version: fw's implement version
6184 * @max_apf_filters: max filters that fw supports
6185 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
6186 * @remaining_bytes_for_apf_inst: remaining bytes for apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306187 *
6188 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05306189struct sir_apf_get_offload {
6190 uint32_t apf_version;
6191 uint32_t max_apf_filters;
6192 uint32_t max_bytes_for_apf_inst;
6193 uint32_t remaining_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306194};
6195
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006196#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006197/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306198 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08006199 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306200 * @wow_ucast_wake_up_count: Unicast wakeup count
6201 * @wow_bcast_wake_up_count: Broadcast wakeup count
6202 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
6203 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
6204 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
6205 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
6206 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306207 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306208 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306209 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
6210 * @wow_low_rssi_wake_up_count: low rssi wakeup count
6211 * @wow_gscan_wake_up_count: gscan wakeup count
6212 * @wow_pno_complete_wake_up_count: pno complete wakeup count
6213 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006214 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306215 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306216 */
6217struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08006218 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306219 uint32_t wow_ucast_wake_up_count;
6220 uint32_t wow_bcast_wake_up_count;
6221 uint32_t wow_ipv4_mcast_wake_up_count;
6222 uint32_t wow_ipv6_mcast_wake_up_count;
6223 uint32_t wow_ipv6_mcast_ra_stats;
6224 uint32_t wow_ipv6_mcast_ns_stats;
6225 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306226 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306227 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306228 uint32_t wow_rssi_breach_wake_up_count;
6229 uint32_t wow_low_rssi_wake_up_count;
6230 uint32_t wow_gscan_wake_up_count;
6231 uint32_t wow_pno_complete_wake_up_count;
6232 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08006233 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306234 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08006235};
6236
6237/**
6238 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
6239 * @ucast: Unicast wakeup count
6240 * @bcast: Broadcast wakeup count
6241 * @ipv4_mcast: ipv4 multicast wakeup count
6242 * @ipv6_mcast: ipv6 multicast wakeup count
6243 * @ipv6_mcast_ra: ipv6 multicast ra stats
6244 * @ipv6_mcast_ns: ipv6 multicast ns stats
6245 * @ipv6_mcast_na: ipv6 multicast na stats
6246 * @icmpv4: ipv4 icmp packet count
6247 * @icmpv6: ipv6 icmp packet count
6248 * @rssi_breach: rssi breach wakeup count
6249 * @low_rssi: low rssi wakeup count
6250 * @gscan: gscan wakeup count
6251 * @pno_complete: pno complete wakeup count
6252 * @pno_match: pno match wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006253 * @oem_response: oem response wakeup coun
6254 * @scan_11d: 11d scan wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006255 */
6256struct sir_vdev_wow_stats {
6257 uint32_t ucast;
6258 uint32_t bcast;
6259 uint32_t ipv4_mcast;
6260 uint32_t ipv6_mcast;
6261 uint32_t ipv6_mcast_ra;
6262 uint32_t ipv6_mcast_ns;
6263 uint32_t ipv6_mcast_na;
6264 uint32_t icmpv4;
6265 uint32_t icmpv6;
6266 uint32_t rssi_breach;
6267 uint32_t low_rssi;
6268 uint32_t gscan;
6269 uint32_t pno_complete;
6270 uint32_t pno_match;
6271 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306272 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006273 uint32_t scan_11d;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306274};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006275#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306276
6277/**
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006278 * enum ht_capability_fields - HT Capabilities bit fields
6279 * @HT_CAPS_LDPC: ldpc coding capability bit field
6280 * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
6281 * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
6282 * @HT_CAPS_GREENFIELD: greenfield capability bit field
6283 * @HT_CAPS_SHORT_GI20: short GI 20 bit field
6284 * @HT_CAPS_SHORT_GI40: short GI 40 bit field
6285 * @HT_CAPS_TX_STBC: Tx STBC bit field
6286 * @HT_CAPS_RX_STBC: Rx STBC bit fields
6287 */
6288enum ht_capability_fields {
6289 HT_CAPS_LDPC = 0x0001,
6290 HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
6291 HT_CAPS_SM_PWR_SAVE = 0x000c,
6292 HT_CAPS_GREENFIELD = 0x0010,
6293 HT_CAPS_SHORT_GI20 = 0x0020,
6294 HT_CAPS_SHORT_GI40 = 0x0040,
6295 HT_CAPS_TX_STBC = 0x0080,
6296 HT_CAPS_RX_STBC = 0x0300
6297};
6298
Ravi Joshi412f23d2016-05-26 15:09:23 -07006299#ifdef WLAN_FEATURE_NAN_DATAPATH
6300
6301#define IFACE_NAME_SIZE 64
6302
6303/**
6304 * enum ndp_accept_policy - nan data path accept policy
6305 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
6306 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
6307 *
6308 */
6309enum ndp_accept_policy {
6310 NDP_ACCEPT_POLICY_NONE = 0,
6311 NDP_ACCEPT_POLICY_ALL = 1,
6312};
6313
6314/**
6315 * enum ndp_self_role - nan data path role
6316 * @NDP_ROLE_INITIATOR: initiator of nan data path request
6317 * @NDP_ROLE_RESPONDER: responder to nan data path request
6318 *
6319 */
6320enum ndp_self_role {
6321 NDP_ROLE_INITIATOR = 0,
6322 NDP_ROLE_RESPONDER = 1,
6323};
6324
6325/**
6326 * enum ndp_response_code - responder's response code to nan data path request
6327 * @NDP_RESPONSE_ACCEPT: ndp request accepted
6328 * @NDP_RESPONSE_REJECT: ndp request rejected
6329 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
6330 * any time later)
6331 *
6332 */
6333enum ndp_response_code {
6334 NDP_RESPONSE_ACCEPT = 0,
6335 NDP_RESPONSE_REJECT = 1,
6336 NDP_RESPONSE_DEFER = 2,
6337};
6338
6339/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006340 * enum ndp_end_type - NDP end type
6341 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
6342 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
6343 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
6344 *
6345 */
6346enum ndp_end_type {
6347 NDP_END_TYPE_UNSPECIFIED = 0x00,
6348 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
6349 NDP_END_TYPE_OTA_FRAME = 0x02,
6350};
6351
6352/**
6353 * enum ndp_end_reason_code - NDP end reason code
6354 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
6355 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
6356 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
6357 *
6358 */
6359enum ndp_end_reason_code {
6360 NDP_END_REASON_UNSPECIFIED = 0x00,
6361 NDP_END_REASON_INACTIVITY = 0x01,
6362 NDP_END_REASON_PEER_DATA_END = 0x02,
6363};
6364
6365/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07006366 * enum nan_status_type - NDP status type
6367 * @NDP_RSP_STATUS_SUCCESS: request was successful
6368 * @NDP_RSP_STATUS_ERROR: request failed
6369 */
6370enum nan_status_type {
6371 NDP_RSP_STATUS_SUCCESS = 0x00,
6372 NDP_RSP_STATUS_ERROR = 0x01,
6373};
6374
6375/**
6376 * enum nan_reason_code - NDP command rsp reason code value
6377 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
6378 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
6379 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
6380 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
6381 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
6382 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
6383 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
6384 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
6385 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
6386 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
6387 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
6388 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
6389 * @NDP_END_FAILED: ndp end failed
6390 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
6391 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
6392 */
6393enum nan_reason_code {
6394 NDP_UNSUPPORTED_CONCURRENCY = 9000,
6395 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
6396 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
6397 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
6398 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
6399 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
6400 NDP_INVALID_NDP_INSTANCE_ID = 9006,
6401 NDP_INVALID_RSP_CODE = 9007,
6402 NDP_INVALID_APP_INFO_LEN = 9008,
6403 NDP_NMF_REQ_FAIL = 9009,
6404 NDP_NMF_RSP_FAIL = 9010,
6405 NDP_NMF_CNF_FAIL = 9011,
6406 NDP_END_FAILED = 9012,
6407 NDP_NMF_END_REQ_FAIL = 9013,
6408 /* 9500 onwards vendor specific error codes */
6409 NDP_VENDOR_SPECIFIC_ERROR = 9500,
6410};
6411
6412/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006413 * struct ndp_cfg - ndp configuration
6414 * @tag: unique identifier
6415 * @ndp_cfg_len: ndp configuration length
6416 * @ndp_cfg: variable length ndp configuration
6417 *
6418 */
6419struct ndp_cfg {
6420 uint32_t tag;
6421 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006422 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006423};
6424
6425/**
6426 * struct ndp_qos_cfg - ndp qos configuration
6427 * @tag: unique identifier
6428 * @ndp_qos_cfg_len: ndp qos configuration length
6429 * @ndp_qos_cfg: variable length ndp qos configuration
6430 *
6431 */
6432struct ndp_qos_cfg {
6433 uint32_t tag;
6434 uint32_t ndp_qos_cfg_len;
6435 uint8_t ndp_qos_cfg[];
6436};
6437
6438/**
6439 * struct ndp_app_info - application info shared during ndp setup
6440 * @tag: unique identifier
6441 * @ndp_app_info_len: ndp app info length
6442 * @ndp_app_info: variable length application information
6443 *
6444 */
6445struct ndp_app_info {
6446 uint32_t tag;
6447 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006448 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006449};
6450
6451/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006452 * struct ndp_scid - structure to hold sceurity context identifier
6453 * @scid_len: length of scid
6454 * @scid: scid
6455 *
6456 */
6457struct ndp_scid {
6458 uint32_t scid_len;
6459 uint8_t *scid;
6460};
6461
6462/**
6463 * struct ndp_pmk - structure to hold pairwise master key
6464 * @pmk_len: length of pairwise master key
6465 * @pmk: buffer containing pairwise master key
6466 *
6467 */
6468struct ndp_pmk {
6469 uint32_t pmk_len;
6470 uint8_t *pmk;
6471};
6472
6473/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006474 * struct ndi_create_req - ndi create request params
6475 * @transaction_id: unique identifier
6476 * @iface_name: interface name
6477 *
6478 */
6479struct ndi_create_req {
6480 uint32_t transaction_id;
6481 char iface_name[IFACE_NAME_SIZE];
6482};
6483
6484/**
6485 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006486 * @status: request status
6487 * @reason: reason if any
6488 *
6489 */
6490struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006491 uint32_t status;
6492 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07006493 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006494};
6495
6496/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006497 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006498 * @status: request status
6499 * @reason: reason if any
6500 *
6501 */
6502struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006503 uint32_t status;
6504 uint32_t reason;
6505};
6506
6507/**
6508 * struct ndp_initiator_req - ndp initiator request params
6509 * @transaction_id: unique identifier
6510 * @vdev_id: session id of the interface over which ndp is being created
6511 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07006512 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07006513 * @service_instance_id: Service identifier
6514 * @peer_discovery_mac_addr: Peer's discovery mac address
6515 * @self_ndi_mac_addr: self NDI mac address
6516 * @ndp_config: ndp configuration params
6517 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006518 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6519 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07006520 *
6521 */
6522struct ndp_initiator_req {
6523 uint32_t transaction_id;
6524 uint32_t vdev_id;
6525 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07006526 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006527 uint32_t service_instance_id;
6528 struct qdf_mac_addr peer_discovery_mac_addr;
6529 struct qdf_mac_addr self_ndi_mac_addr;
6530 struct ndp_cfg ndp_config;
6531 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006532 uint32_t ncs_sk_type;
6533 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006534};
6535
6536/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006537 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07006538 * @transaction_id: unique identifier
6539 * @vdev_id: session id of the interface over which ndp is being created
6540 * @ndp_instance_id: locally created NDP instance ID
6541 * @status: status of the ndp request
6542 * @reason: reason for failure if any
6543 *
6544 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006545struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006546 uint32_t transaction_id;
6547 uint32_t vdev_id;
6548 uint32_t ndp_instance_id;
6549 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07006550 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006551};
6552
6553/**
6554 * struct ndp_indication_event - create ndp indication on the responder
6555 * @vdev_id: session id of the interface over which ndp is being created
6556 * @service_instance_id: Service identifier
6557 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006558 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07006559 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
6560 * @ndp_instance_id: locally created NDP instance ID
6561 * @role: self role for NDP
6562 * @ndp_accept_policy: accept policy configured by the upper layer
6563 * @ndp_config: ndp configuration params
6564 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006565 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6566 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006567 *
6568 */
6569struct ndp_indication_event {
6570 uint32_t vdev_id;
6571 uint32_t service_instance_id;
6572 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006573 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006574 uint32_t ndp_instance_id;
6575 enum ndp_self_role role;
6576 enum ndp_accept_policy policy;
6577 struct ndp_cfg ndp_config;
6578 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006579 uint32_t ncs_sk_type;
6580 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006581};
6582
6583/**
6584 * struct ndp_responder_req - responder's response to ndp create request
6585 * @transaction_id: unique identifier
6586 * @vdev_id: session id of the interface over which ndp is being created
6587 * @ndp_instance_id: locally created NDP instance ID
6588 * @ndp_rsp: response to the ndp create request
6589 * @ndp_config: ndp configuration params
6590 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006591 * @pmk: pairwise master key
6592 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07006593 *
6594 */
6595struct ndp_responder_req {
6596 uint32_t transaction_id;
6597 uint32_t vdev_id;
6598 uint32_t ndp_instance_id;
6599 enum ndp_response_code ndp_rsp;
6600 struct ndp_cfg ndp_config;
6601 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006602 struct ndp_pmk pmk;
6603 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006604};
6605
6606/**
6607 * struct ndp_responder_rsp_event - response to responder's request
6608 * @transaction_id: unique identifier
6609 * @vdev_id: session id of the interface over which ndp is being created
6610 * @status: command status
6611 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07006612 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006613 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006614 */
6615struct ndp_responder_rsp_event {
6616 uint32_t transaction_id;
6617 uint32_t vdev_id;
6618 uint32_t status;
6619 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07006620 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006621 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006622};
6623
6624/**
6625 * struct ndp_confirm_event - ndp confirmation event from FW
6626 * @vdev_id: session id of the interface over which ndp is being created
6627 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07006628 * @reason_code : reason code(opaque to driver)
6629 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006630 * @peer_ndi_mac_addr: peer NDI mac address
6631 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07006632 * @ndp_info: ndp application info
6633 *
6634 */
6635struct ndp_confirm_event {
6636 uint32_t vdev_id;
6637 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07006638 uint32_t reason_code;
6639 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006640 struct qdf_mac_addr peer_ndi_mac_addr;
6641 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006642 struct ndp_app_info ndp_info;
6643};
6644
6645/**
6646 * struct ndp_end_req - ndp end request
6647 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006648 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07006649 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07006650 *
6651 */
6652struct ndp_end_req {
6653 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006654 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006655 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006656};
6657
6658/**
6659 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
6660 * @vdev_id: session id of the interface over which ndp is being created
6661 * @peer_ndi_mac_addr: peer NDI mac address
6662 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006663 * @type: NDP end indication type
6664 * @reason_code: NDP end indication reason code
6665 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07006666 *
6667 */
6668struct peer_ndp_map {
6669 uint32_t vdev_id;
6670 struct qdf_mac_addr peer_ndi_mac_addr;
6671 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006672 enum ndp_end_type type;
6673 enum ndp_end_reason_code reason_code;
6674 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006675};
6676
6677/**
6678 * struct ndp_end_rsp_event - firmware response to ndp end request
6679 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07006680 * @status: status of operation
6681 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07006682 *
6683 */
6684struct ndp_end_rsp_event {
6685 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006686 uint32_t status;
6687 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006688};
6689
6690/**
6691 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006692 * @num_ndp_ids: number of NDP ids
6693 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07006694 *
6695 */
6696struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006697 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006698 struct peer_ndp_map ndp_map[];
6699};
6700
6701/**
6702 * struct ndp_schedule_update_req - ndp schedule update request
6703 * @transaction_id: unique identifier
6704 * @vdev_id: session id of the interface over which ndp is being created
6705 * @ndp_instance_id: ndp instance id for which schedule update is requested
6706 * @ndp_qos: new set of qos parameters
6707 *
6708 */
6709struct ndp_schedule_update_req {
6710 uint32_t transaction_id;
6711 uint32_t vdev_id;
6712 uint32_t ndp_instance_id;
6713 struct ndp_qos_cfg ndp_qos;
6714};
6715
6716/**
6717 * struct ndp_schedule_update_rsp - ndp schedule update response
6718 * @transaction_id: unique identifier
6719 * @vdev_id: session id of the interface over which ndp is being created
6720 * @status: status of the request
6721 * @reason: reason code for failure if any
6722 *
6723 */
6724struct ndp_schedule_update_rsp {
6725 uint32_t transaction_id;
6726 uint32_t vdev_id;
6727 uint32_t status;
6728 uint32_t reason;
6729};
6730
6731/**
6732 * struct sme_ndp_peer_ind - ndp peer indication
6733 * @msg_type: message id
6734 * @msg_len: message length
6735 * @session_id: session id
6736 * @peer_mac_addr: peer mac address
6737 * @sta_id: station id
6738 *
6739 */
6740struct sme_ndp_peer_ind {
6741 uint16_t msg_type;
6742 uint16_t msg_len;
6743 uint8_t session_id;
6744 struct qdf_mac_addr peer_mac_addr;
6745 uint16_t sta_id;
6746};
6747
6748#endif /* WLAN_FEATURE_NAN_DATAPATH */
6749
Peng Xu8fdaa492016-06-22 10:20:47 -07006750/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306751 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
6752 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07006753 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306754 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08006755 * @tx_aggregation_size_be: Tx aggregation size for be queue
6756 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
6757 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
6758 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306759 * @rx_aggregation_size: Rx aggregation size
6760 */
6761struct sir_set_tx_rx_aggregation_size {
6762 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07006763 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306764 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08006765 uint32_t tx_aggregation_size_be;
6766 uint32_t tx_aggregation_size_bk;
6767 uint32_t tx_aggregation_size_vi;
6768 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306769 uint32_t rx_aggregation_size;
6770};
6771
6772/**
Paul Zhang33fae272018-04-23 16:19:00 +08006773 * struct sir_set_tx_aggr_sw_retry_threshold - set sw retry threshold
6774 * @vdev_id: vdev id of the session
6775 * @tx_aggr_sw_retry_threshold_be: sw retry threshold for BE
6776 * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for BK
6777 * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for VI
6778 * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for VO
6779 */
6780struct sir_set_tx_aggr_sw_retry_threshold {
6781 uint8_t vdev_id;
6782 uint32_t tx_aggr_sw_retry_threshold_be;
6783 uint32_t tx_aggr_sw_retry_threshold_bk;
6784 uint32_t tx_aggr_sw_retry_threshold_vi;
6785 uint32_t tx_aggr_sw_retry_threshold_vo;
6786};
6787
6788/**
Peng Xu8fdaa492016-06-22 10:20:47 -07006789 * struct sir_p2p_lo_start - p2p listen offload start
6790 * @vdev_id: vdev identifier
6791 * @ctl_flags: control flag
6792 * @freq: p2p listen frequency
6793 * @period: listen offload period
6794 * @interval: listen offload interval
6795 * @count: number listen offload intervals
6796 * @device_types: device types
6797 * @dev_types_len: device types length
6798 * @probe_resp_tmplt: probe response template
6799 * @probe_resp_len: probe response template length
6800 */
6801struct sir_p2p_lo_start {
6802 uint32_t vdev_id;
6803 uint32_t ctl_flags;
6804 uint32_t freq;
6805 uint32_t period;
6806 uint32_t interval;
6807 uint32_t count;
6808 uint8_t *device_types;
6809 uint32_t dev_types_len;
6810 uint8_t *probe_resp_tmplt;
6811 uint32_t probe_resp_len;
6812};
6813
6814/**
6815 * struct sir_p2p_lo_event - P2P listen offload stop event
6816 * @vdev_id: vdev identifier
6817 * @reason_code: P2P listen offload stop reason
6818 */
6819struct sir_p2p_lo_event {
6820 uint32_t vdev_id;
6821 uint32_t reason_code;
6822};
Manjeet Singhf82ed072016-07-08 11:40:00 +05306823
6824/**
6825 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
6826 * @pdev_id: pdev id
6827 * @module_id: module id
6828 * @num_args: number of arguments
6829 * @args: arguments
6830 */
6831struct sir_mac_pwr_dbg_cmd {
6832 uint32_t pdev_id;
6833 uint32_t module_id;
6834 uint32_t num_args;
6835 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
6836};
6837
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05306838/**
6839 * struct sme_send_disassoc_frm_req - send disassoc request frame
6840 * @msg_type: message type
6841 * @length: length of message
6842 * @session_id: session id
6843 * @trans_id: transaction id
6844 * @peer_mac: peer mac address
6845 * @reason: reason for disassoc
6846 * @wait_for_ack: wait for acknowledgment
6847 **/
6848 struct sme_send_disassoc_frm_req {
6849 uint16_t msg_type;
6850 uint16_t length;
6851 uint8_t session_id;
6852 uint16_t trans_id;
6853 uint8_t peer_mac[6];
6854 uint16_t reason;
6855 uint8_t wait_for_ack;
6856 };
6857
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05306858/**
6859 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
6860 * policy
6861 * @msg_type: message id
6862 * @msg_len: message length
6863 * @sme_session_id: sme session id
6864 * @ie: vendor ie
6865 * @access_policy: access policy for vendor ie
6866 */
6867struct sme_update_access_policy_vendor_ie {
6868 uint16_t msg_type;
6869 uint16_t length;
6870 uint32_t sme_session_id;
6871 uint8_t ie[SIR_MAC_MAX_IE_LENGTH];
6872 uint8_t access_policy;
6873};
6874
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05306875/**
6876 * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params
6877 * @vdev_id: vdev id
6878 * @status: status
6879 * @data_length: data length
6880 * @data: data pointer
6881 */
6882struct sir_encrypt_decrypt_rsp_params {
6883 uint32_t vdev_id;
6884 int32_t status;
6885 uint32_t data_length;
6886 uint8_t *data;
6887};
6888
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05306889/**
6890 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
6891 * @session_id: Session id
6892 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
6893 */
6894struct sme_tx_fail_cnt_threshold {
6895 uint8_t session_id;
6896 uint32_t tx_fail_cnt_threshold;
6897};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05306898
6899/**
6900 * struct sme_short_retry_limit - transmission retry limit for short frames.
6901 * @session_id: Session id
6902 * @short_retry_limit: tranmission retry limit for short frame.
6903 *
6904 */
6905struct sme_short_retry_limit {
6906 uint8_t session_id;
6907 uint32_t short_retry_limit;
6908};
6909
6910/**
6911 * struct sme_long_retry_limit - tranmission retry limit for long frames
6912 * @session_id: Session id
6913 * @short_retry_limit: tranmission retry limit for long frames.
6914 *
6915 */
6916struct sme_long_retry_limit {
6917 uint8_t session_id;
6918 uint32_t long_retry_limit;
6919};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306920
6921/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08006922 * struct sme_addba_accept - Allow/reject the addba request frame
6923 * @session_id: Session id
6924 * @addba_accept: Allow/reject the addba request frame
6925 */
6926struct sme_addba_accept {
6927 uint8_t session_id;
6928 uint8_t addba_accept;
6929};
6930
6931/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306932 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
6933 * @session_id: session Id.
6934 * @sta_inactivity_timeout: Timeout to disconnect STA after there
6935 * is no activity.
6936 */
6937struct sme_sta_inactivity_timeout {
6938 uint8_t session_id;
6939 uint32_t sta_inactivity_timeout;
6940};
Yingying Tang95409972016-10-20 15:16:15 +08006941
6942/*
6943 * struct wow_pulse_mode - WoW Pulse set cmd struct
6944 * @wow_pulse_enable: enable or disable this feature
6945 * @wow_pulse_pin: GPIO PIN for Pulse
6946 * @wow_pulse_interval_low: Pulse interval low
6947 * @wow_pulse_interval_high: Pulse interval high
6948 *
6949 * SME uses this structure to configure wow pulse info
6950 * and send it to WMA
6951 */
6952struct wow_pulse_mode {
6953 bool wow_pulse_enable;
6954 uint8_t wow_pulse_pin;
6955 uint16_t wow_pulse_interval_high;
6956 uint16_t wow_pulse_interval_low;
6957};
6958
Rajeev Kumare406d652017-01-30 17:47:05 -08006959
6960/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08006961 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08006962 * @msg: opaque message pointer
6963 *
6964 * Return: QDF status
6965 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08006966QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08006967
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05306968/**
6969 * struct scan_chan_info - channel info
6970 * @freq: radio frequence
6971 * @cmd flag: cmd flag
6972 * @noise_floor: noise floor
6973 * @cycle_count: cycle count
6974 * @rx_clear_count: rx clear count
6975 * @tx_frame_count: TX frame count
6976 * @clock_freq: clock frequence MHZ
6977 */
6978struct scan_chan_info {
6979 uint32_t freq;
6980 uint32_t cmd_flag;
6981 uint32_t noise_floor;
6982 uint32_t cycle_count;
6983 uint32_t rx_clear_count;
6984 uint32_t tx_frame_count;
6985 uint32_t clock_freq;
6986};
Dustin Brown54096432017-02-23 13:00:44 -08006987
6988/**
6989 * enum wow_resume_trigger - resume trigger override setting values
6990 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
6991 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
6992 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
6993 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
6994 */
6995enum wow_resume_trigger {
6996 /* always first */
6997 WOW_RESUME_TRIGGER_DEFAULT = 0,
6998 WOW_RESUME_TRIGGER_HTC_WAKEUP,
6999 WOW_RESUME_TRIGGER_GPIO,
7000 /* always last */
7001 WOW_RESUME_TRIGGER_COUNT
7002};
7003
7004/**
7005 * enum wow_interface_pause - interface pause override setting values
7006 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
7007 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
7008 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
7009 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
7010 */
7011enum wow_interface_pause {
7012 /* always first */
7013 WOW_INTERFACE_PAUSE_DEFAULT = 0,
7014 WOW_INTERFACE_PAUSE_ENABLE,
7015 WOW_INTERFACE_PAUSE_DISABLE,
7016 /* always last */
7017 WOW_INTERFACE_PAUSE_COUNT
7018};
7019
7020/**
7021 * struct wow_enable_params - A collection of wow enable override parameters
7022 * @is_unit_test: true to notify fw this is a unit-test suspend
7023 * @interface_pause: used to override the interface pause indication sent to fw
7024 * @resume_trigger: used to force fw to use a particular resume method
7025 */
7026struct wow_enable_params {
7027 bool is_unit_test;
7028 enum wow_interface_pause interface_pause;
7029 enum wow_resume_trigger resume_trigger;
7030};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007031
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08007032#define HE_LTF_1X 0
7033#define HE_LTF_2X 1
7034#define HE_LTF_4X 2
7035
7036#define HE_LTF_ALL 0x7
7037#define HE_SGI_MASK 0xFF00
7038
7039#define AUTO_RATE_GI_400NS 8
7040#define AUTO_RATE_GI_800NS 9
7041#define AUTO_RATE_GI_1600NS 10
7042#define AUTO_RATE_GI_3200NS 11
7043
7044#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
7045 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
7046
7047#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
7048 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
7049
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007050#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07007051#define HE_CAP_OUI_TYPE "\x23"
7052#define HE_CAP_OUI_SIZE 1
7053#define HE_OP_OUI_TYPE "\x24"
7054#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08007055
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007056#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
7057#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
7058#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
7059#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
7060
7061/* 3 bits for NSS and 4 bits for RU Index */
7062#define HE_PPET_NSS_LEN 3
7063#define HE_PEPT_RU_IDX_LEN 4
7064#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
7065#define HE_PPET_SIZE 3
7066#define HE_BYTE_SIZE 8
7067
Naveen Rawat819158d2018-01-16 10:56:45 -08007068struct ppet_hdr {
7069 uint8_t nss:3;
7070 uint8_t ru_idx_mask:4;
7071 uint8_t remaining:1;
7072};
7073
7074/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
7075#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
7076
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08007077#define HE_MAX_PHY_CAP_SIZE 3
7078
Naveen Rawataeca1b92017-10-16 16:55:31 -07007079#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
7080#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
7081 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
7082 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07007083
Naveen Rawataeca1b92017-10-16 16:55:31 -07007084/*
7085 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
7086 * +-----------------------------------------------------+
7087 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
7088 * +-----------------------------------------------------+
7089 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
7090 * +-----------------------------------------------------+
7091 */
7092#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
7093#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
7094#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
7095#define HE_GET_MCS_4_NSS(mcs_set, nss) \
7096 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
7097#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
7098 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
7099 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
7100#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
7101 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
7102
7103#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08007104
7105#define HE_MCS_0_7 0x0
7106#define HE_MCS_0_9 0x1
7107#define HE_MCS_0_11 0x2
7108#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08007109
Naveen Rawataeca1b92017-10-16 16:55:31 -07007110/*
7111 * Following formuala has been arrived at using karnaugh map and unit tested
7112 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
7113 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
7114 * K-Maps
7115 * MCS 1\MCS 2 00 01 10 11
7116 * 00 00 00 00 11
7117 * 01 00 01 01 11
7118 * 10 00 01 10 11
7119 * 11 11 11 11 11
7120 * if output MCS is o1o0, then as per K-map reduction:
7121 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
7122 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
7123 *
7124 * Please note: Calculating MCS intersection is 80211 protocol specific and
7125 * should be implemented in PE. WMA can use this macro rather than calling any
7126 * lim API to do the intersection.
7127 */
7128#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
7129 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
7130 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
7131 (m1 & ~m0 & n1 & ~n0)) << 1))
7132
7133/* following takes MCS as 2 bits */
7134#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
7135 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
7136 (mcs_2 >> 1), (mcs_2 & 1))
7137
7138/* following takes MCS as 16 bits */
7139#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
7140 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
7141 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
7142 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
7143 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
7144 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
7145 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
7146 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
7147 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
7148 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
7149 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
7150 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
7151 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
7152 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
7153 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
7154 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
7155 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07007156
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08007157/**
7158 * struct he_capability - to store 11ax HE capabilities
7159 * @phy_cap: HE PHY capabilities
7160 * @mac_cap: HE MAC capabilities
7161 * @mcs: HE MCS
7162 * @ppet: HE PPE threshold
7163 */
7164struct he_capability {
7165 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
7166 uint32_t mac_cap;
7167 uint32_t mcs;
7168 struct wlan_psoc_host_ppe_threshold ppet;
7169};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007170#endif
7171
Naveen Rawataeca1b92017-10-16 16:55:31 -07007172#define HE_GET_NSS(mcs, nss) \
7173 do { \
7174 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07007175 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07007176 (nss)++; \
7177 } while (0)
7178
Nitesh Shah99dd9552017-03-20 19:27:47 +05307179/**
7180 * struct sir_del_all_tdls_peers - delete all tdls peers
7181 * @msg_type: type of message
7182 * @msg_len: length of message
7183 * @bssid: bssid of peer device
7184 */
7185struct sir_del_all_tdls_peers {
7186 uint16_t msg_type;
7187 uint16_t msg_len;
7188 struct qdf_mac_addr bssid;
7189};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007190
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307191/**
7192 * struct rsp_stats - arp packet stats
7193 * @arp_req_enqueue: fw tx count
7194 * @arp_req_tx_success: tx ack count
7195 * @arp_req_tx_failure: tx ack fail count
7196 * @arp_rsp_recvd: rx fw count
7197 * @out_of_order_arp_rsp_drop_cnt: out of order count
7198 * @dad_detected: dad detected
7199 * @connect_status: connection status
7200 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307201 * @connect_stats_present: connectivity stats present or not
7202 * @tcp_ack_recvd: tcp syn ack's count
7203 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307204 */
7205struct rsp_stats {
7206 uint32_t vdev_id;
7207 uint32_t arp_req_enqueue;
7208 uint32_t arp_req_tx_success;
7209 uint32_t arp_req_tx_failure;
7210 uint32_t arp_rsp_recvd;
7211 uint32_t out_of_order_arp_rsp_drop_cnt;
7212 uint32_t dad_detected;
7213 uint32_t connect_status;
7214 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307215 bool connect_stats_present;
7216 uint32_t tcp_ack_recvd;
7217 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307218};
7219
7220/**
7221 * struct set_arp_stats_params - set/reset arp stats
7222 * @vdev_id: session id
7223 * @flag: enable/disable stats
7224 * @pkt_type: type of packet(1 - arp)
7225 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307226 * @pkt_type_bitmap: pkt bitmap
7227 * @tcp_src_port: tcp src port for pkt tracking
7228 * @tcp_dst_port: tcp dst port for pkt tracking
7229 * @icmp_ipv4: target ipv4 address to track ping packets
7230 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307231 */
7232struct set_arp_stats_params {
7233 uint32_t vdev_id;
7234 uint8_t flag;
7235 uint8_t pkt_type;
7236 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307237 uint32_t pkt_type_bitmap;
7238 uint32_t tcp_src_port;
7239 uint32_t tcp_dst_port;
7240 uint32_t icmp_ipv4;
7241 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307242};
7243
7244/**
7245 * struct get_arp_stats_params - get arp stats from firmware
7246 * @pkt_type: packet type(1 - ARP)
7247 * @vdev_id: session id
7248 */
7249struct get_arp_stats_params {
7250 uint8_t pkt_type;
7251 uint32_t vdev_id;
7252};
7253
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05307254typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
7255 int32_t rcpi, QDF_STATUS status);
7256/**
7257 * struct sme_rcpi_req - structure for querying rcpi info
7258 * @session_id: session for which rcpi is required
7259 * @measurement_type: type of measurement from enum rcpi_measurement_type
7260 * @rcpi_callback: callback function to be invoked for rcpi response
7261 * @rcpi_context: context info for rcpi callback
7262 * @mac_addr: peer addr for which rcpi is required
7263 */
7264struct sme_rcpi_req {
7265 uint32_t session_id;
7266 enum rcpi_measurement_type measurement_type;
7267 sme_rcpi_callback rcpi_callback;
7268 void *rcpi_context;
7269 struct qdf_mac_addr mac_addr;
7270};
7271
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007272/*
7273 * @SCAN_REJECT_DEFAULT: default value
7274 * @CONNECTION_IN_PROGRESS: connection is in progress
7275 * @REASSOC_IN_PROGRESS: reassociation is in progress
7276 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
7277 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
7278 */
7279enum scan_reject_states {
7280 SCAN_REJECT_DEFAULT = 0,
7281 CONNECTION_IN_PROGRESS,
7282 REASSOC_IN_PROGRESS,
7283 EAPOL_IN_PROGRESS,
7284 SAP_EAPOL_IN_PROGRESS,
7285};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07007286
7287/**
lifeng66831662017-05-19 16:01:35 +08007288 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
7289 * @hole_cnt: num of holes detected
7290 * @hole_info_array: hole info
7291 */
7292struct sir_sme_rx_aggr_hole_ind {
7293 uint32_t hole_cnt;
7294 uint32_t hole_info_array[];
7295};
7296
7297/**
7298 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
7299 * @rx_timeout_pri: reorder timeout for AC
7300 * rx_timeout_pri[0] : AC_VO
7301 * rx_timeout_pri[1] : AC_VI
7302 * rx_timeout_pri[2] : AC_BE
7303 * rx_timeout_pri[3] : AC_BK
7304 */
7305struct sir_set_rx_reorder_timeout_val {
7306 uint32_t rx_timeout_pri[4];
7307};
7308
7309/**
7310 * struct sir_peer_set_rx_blocksize - set rx blocksize
7311 * @vdev_id: vdev id
7312 * @peer_macaddr: peer mac address
7313 * @rx_block_ack_win_limit: windows size limitation
7314 */
7315struct sir_peer_set_rx_blocksize {
7316 uint32_t vdev_id;
7317 struct qdf_mac_addr peer_macaddr;
7318 uint32_t rx_block_ack_win_limit;
7319};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05307320
7321/**
7322 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
7323 * list
7324 * @node: Node pointer
7325 * @bssid: BSSID of the AP
7326 * @retry_delay: Retry delay received during last rejection in ms
7327 * @ expected_rssi: RSSI at which STA can initate
7328 * @time_during_rejection: Timestamp during last rejection in millisec
7329 */
7330struct sir_rssi_disallow_lst {
7331 qdf_list_node_t node;
7332 struct qdf_mac_addr bssid;
7333 uint32_t retry_delay;
7334 int8_t expected_rssi;
7335 qdf_time_t time_during_rejection;
7336};
lifengd217d192017-05-09 19:44:16 +08007337
7338/**
7339 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07007340 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08007341 * @chain_rssi: chain rssi result as dBm unit
lifengfe6c3e22018-04-03 12:10:04 +08007342 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08007343 */
lifengfe6c3e22018-04-03 12:10:04 +08007344#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08007345struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08007346 uint32_t num_chains_valid;
7347 uint32_t chain_rssi[CHAIN_MAX_NUM];
7348 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08007349};
7350
7351/**
7352 * struct get_chain_rssi_req_params - get chain rssi req params
7353 * @peer_macaddr: specific peer mac address
7354 * @session_id: session id
7355 */
7356struct get_chain_rssi_req_params {
7357 struct qdf_mac_addr peer_macaddr;
7358 uint8_t session_id;
7359};
7360
Ganesh Kondabattini35739572017-06-21 16:26:39 +05307361/*
7362 * struct sir_limit_off_chan - limit off-channel command parameters
7363 * @vdev_id: vdev id
7364 * @is_tos_active: status of the traffic (active/inactive)
7365 * @max_off_chan_time: max allowed off channel time
7366 * @rest_time: home channel time
7367 * @skip_dfs_chans: skip dfs channels during scan
7368 */
7369struct sir_limit_off_chan {
7370 uint8_t vdev_id;
7371 bool is_tos_active;
7372 uint32_t max_off_chan_time;
7373 uint32_t rest_time;
7374 bool skip_dfs_chans;
7375};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05307376
7377/**
7378 * struct sae_info - SAE info used for commit/confirm messages
7379 * @msg_type: Message type
7380 * @msg_len: length of message
7381 * @vdev_id: vdev id
7382 * @peer_mac_addr: peer MAC address
7383 * @ssid: SSID
7384 */
7385struct sir_sae_info {
7386 uint16_t msg_type;
7387 uint16_t msg_len;
7388 uint32_t vdev_id;
7389 struct qdf_mac_addr peer_mac_addr;
7390 tSirMacSSid ssid;
7391};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05307392
7393/**
7394 * struct sir_sae_msg - SAE msg used for message posting
7395 * @message_type: message type
7396 * @length: message length
7397 * @session_id: SME session id
7398 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
7399 */
7400struct sir_sae_msg {
7401 uint16_t message_type;
7402 uint16_t length;
7403 uint16_t session_id;
7404 uint8_t sae_status;
7405};
7406
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08007407#endif /* __SIR_API_H */