blob: a4cec67255577dac9e699547b4e888d8602aa5cf [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
bings394afdd2017-01-09 11:22:38 +08002 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WLAN_QCT_WLANSAP_H
29#define WLAN_QCT_WLANSAP_H
30
31/**
32 * W L A N S O F T A P P A L L A Y E R
33 * E X T E R N A L A P I
34 *
35 * DESCRIPTION
36 * This file contains the external API exposed by the wlan SAP PAL layer
37 * module.
38 */
39
40/*----------------------------------------------------------------------------
41 * Include Files
42 * -------------------------------------------------------------------------*/
43#include "cds_api.h"
44#include "cds_packet.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053045#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080046
47#include "p2p_api.h"
48#include "sme_api.h"
49/*----------------------------------------------------------------------------
50 * Preprocessor Definitions and Constants
51 * -------------------------------------------------------------------------*/
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56/*---------------------------------------------------------------------------
57 * defines and enum
58 *--------------------------------------------------------------------------*/
59#define MAX_SSID_LEN 32
60#define MAX_ACL_MAC_ADDRESS 32
61#define AUTO_CHANNEL_SELECT 0
62#define MAX_ASSOC_IND_IE_LEN 255
63
64/* defines for WPS config states */
65#define SAP_WPS_DISABLED 0
66#define SAP_WPS_ENABLED_UNCONFIGURED 1
67#define SAP_WPS_ENABLED_CONFIGURED 2
68#define MAX_NAME_SIZE 64
69#define MAX_TEXT_SIZE 32
70
71#define MAX_CHANNEL_LIST_LEN 256
Anurag Chouhanf04e84f2016-03-03 10:12:12 +053072#define QDF_MAX_NO_OF_SAP_MODE 2 /* max # of SAP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080073#define SAP_MAX_NUM_SESSION 5
74#define SAP_MAX_OBSS_STA_CNT 1 /* max # of OBSS STA */
75#define SAP_ACS_WEIGHT_MAX (4444)
76
77/*--------------------------------------------------------------------------
78 * reasonCode taken from 802.11 standard.
79 * ------------------------------------------------------------------------*/
80
81typedef enum {
82 eSAP_RC_RESERVED0, /*0 */
83 eSAP_RC_UNSPECIFIED, /*1 */
84 eSAP_RC_PREV_AUTH_INVALID, /*2 */
85 eSAP_RC_STA_LEFT_DEAUTH, /*3 */
86 eSAP_RC_INACTIVITY_DISASSOC, /*4 */
87 eSAP_RC_AP_CAPACITY_FULL, /*5 */
88 eSAP_RC_CLS2_FROM_NON_AUTH_STA, /*6 */
89 eSAP_RC_CLS3_FROM_NON_AUTH_STA, /*7 */
90 eSAP_RC_STA_LEFT_DISASSOC, /*8 */
91 eSAP_RC_STA_NOT_AUTH, /*9 */
92 eSAP_RC_PC_UNACCEPTABLE, /*10 */
93 eSAP_RC_SC_UNACCEPTABLE, /*11 */
94 eSAP_RC_RESERVED1, /*12 */
95 eSAP_RC_INVALID_IE, /*13 */
96 eSAP_RC_MIC_FAIL, /*14 */
97 eSAP_RC_4_WAY_HANDSHAKE_TO, /*15 */
98 eSAP_RC_GO_KEY_HANDSHAKE_TO, /*16 */
99 eSAP_RC_IE_MISMATCH, /*17 */
100 eSAP_RC_INVALID_GRP_CHIPHER, /*18 */
101 eSAP_RC_INVALID_PAIR_CHIPHER, /*19 */
102 eSAP_RC_INVALID_AKMP, /*20 */
103 eSAP_RC_UNSUPPORTED_RSN, /*21 */
104 eSAP_RC_INVALID_RSN, /*22 */
105 eSAP_RC_1X_AUTH_FAILED, /*23 */
106 eSAP_RC_CHIPER_SUITE_REJECTED, /*24 */
107} eSapReasonCode;
108
109typedef enum {
110 eSAP_ACCEPT_UNLESS_DENIED = 0,
111 eSAP_DENY_UNLESS_ACCEPTED = 1,
112 /* this type is added to support accept & deny list at the same time */
113 eSAP_SUPPORT_ACCEPT_AND_DENY = 2,
114 /*In this mode all MAC addresses are allowed to connect */
115 eSAP_ALLOW_ALL = 3,
116} eSapMacAddrACL;
117
118typedef enum {
119 eSAP_BLACK_LIST = 0, /* List of mac addresses NOT allowed to assoc */
120 eSAP_WHITE_LIST = 1, /* List of mac addresses allowed to assoc */
121} eSapACLType;
122
123typedef enum {
124 ADD_STA_TO_ACL = 0, /* cmd to add STA to access control list */
125 DELETE_STA_FROM_ACL = 1, /* cmd to del STA from access control list */
126} eSapACLCmdType;
127
128typedef enum {
129 eSAP_START_BSS_EVENT = 0, /* Event sent when BSS is started */
130 eSAP_STOP_BSS_EVENT, /* Event sent when BSS is stopped */
131 eSAP_STA_ASSOC_IND, /* Indicate assoc req to upper layers */
132 /*
133 * Event sent when we have successfully associated a station and
134 * upper layer neeeds to allocate a context
135 */
136 eSAP_STA_ASSOC_EVENT,
137 /*
138 * Event sent when we have successfully reassociated a station and
139 * upper layer neeeds to allocate a context
140 */
141 eSAP_STA_REASSOC_EVENT,
142 /*
143 * Event sent when associated a station has disassociated as a
144 * result of various conditions
145 */
146 eSAP_STA_DISASSOC_EVENT,
147 /* Event sent when user called wlansap_set_key_sta */
148 eSAP_STA_SET_KEY_EVENT,
149 /* Event sent whenever there is MIC failure detected */
150 eSAP_STA_MIC_FAILURE_EVENT,
151 /* Event sent when user called wlansap_get_assoc_stations */
152 eSAP_ASSOC_STA_CALLBACK_EVENT,
153 /* Event send when user call wlansap_get_wps_session_overlap */
154 eSAP_GET_WPSPBC_SESSION_EVENT,
155 /* Event send on WPS PBC probe request is received */
156 eSAP_WPS_PBC_PROBE_REQ_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800157 eSAP_REMAIN_CHAN_READY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800158 eSAP_DISCONNECT_ALL_P2P_CLIENT,
159 eSAP_MAC_TRIG_STOP_BSS_EVENT,
160 /*
161 * Event send when a STA in neither white list or black list tries to
162 * associate in softap mode
163 */
164 eSAP_UNKNOWN_STA_JOIN,
165 /* Event send when a new STA is rejected association since softAP
166 * max assoc limit has reached
167 */
168 eSAP_MAX_ASSOC_EXCEEDED,
169 eSAP_CHANNEL_CHANGE_EVENT,
170 eSAP_DFS_CAC_START,
171 eSAP_DFS_CAC_INTERRUPTED,
172 eSAP_DFS_CAC_END,
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530173 eSAP_DFS_PRE_CAC_END,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174 eSAP_DFS_RADAR_DETECT,
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530175 eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800176 /* Event sent when user need to get the DFS NOL from CNSS */
177 eSAP_DFS_NOL_GET,
178 /* Event sent when user need to set the DFS NOL to CNSS */
179 eSAP_DFS_NOL_SET,
180 /* No ch available after DFS RADAR detect */
181 eSAP_DFS_NO_AVAILABLE_CHANNEL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800182 eSAP_ACS_SCAN_SUCCESS_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800183 eSAP_ACS_CHANNEL_SELECTED,
Abhishek Singh518323d2015-10-19 17:42:01 +0530184 eSAP_ECSA_CHANGE_CHAN_IND,
Kapil Gupta8878ad92017-02-13 11:56:04 +0530185 eSAP_DFS_NEXT_CHANNEL_REQ,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800186} eSapHddEvent;
187
188typedef enum {
189 eSAP_OPEN_SYSTEM,
190 eSAP_SHARED_KEY,
191 eSAP_AUTO_SWITCH
192} eSapAuthType;
193
194typedef enum {
195 /* Disassociation was internally initated from CORE stack */
196 eSAP_MAC_INITATED_DISASSOC = 0x10000,
197 /*
198 * Disassociation was internally initated from host by
199 * invoking wlansap_disassoc_sta call
200 */
201 eSAP_USR_INITATED_DISASSOC
202} eSapDisassocReason;
203
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800204typedef enum {
205 eSAP_DFS_NOL_CLEAR,
206 eSAP_DFS_NOL_RANDOMIZE,
207} eSapDfsNolType;
208
209/*---------------------------------------------------------------------------
210 SAP PAL "status" and "reason" error code defines
211 ---------------------------------------------------------------------------*/
212typedef enum {
213 eSAP_STATUS_SUCCESS, /* Success. */
214 eSAP_STATUS_FAILURE, /* General Failure. */
215 /* Channel not selected during intial scan. */
216 eSAP_START_BSS_CHANNEL_NOT_SELECTED,
217 eSAP_ERROR_MAC_START_FAIL, /* Failed to start Infra BSS */
218} eSapStatus;
219
220/*---------------------------------------------------------------------------
221 SAP PAL "status" and "reason" error code defines
222 ---------------------------------------------------------------------------*/
223typedef enum {
224 eSAP_WPSPBC_OVERLAP_IN120S, /* Overlap */
225 /* no WPS probe request in 120 second */
226 eSAP_WPSPBC_NO_WPSPBC_PROBE_REQ_IN120S,
227 /* One WPS probe request in 120 second */
228 eSAP_WPSPBC_ONE_WPSPBC_PROBE_REQ_IN120S,
229} eWPSPBCOverlap;
230
Rachit Kankane2487f8f2017-04-19 14:30:19 +0530231/*---------------------------------------------------------------------------
232 SAP Associated station types
233 ---------------------------------------------------------------------------*/
234typedef enum {
235 eSTA_TYPE_NONE = 0x00000000, /* No station type */
236 eSTA_TYPE_INFRA = 0x00000001, /* legacy station */
237 eSTA_TYPE_P2P_CLI = 0x00000002, /* p2p client */
238} eStationType;
239
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800240/*----------------------------------------------------------------------------
241 * Typedefs
242 * -------------------------------------------------------------------------*/
243typedef struct sap_StartBssCompleteEvent_s {
244 uint8_t status;
245 uint8_t operatingChannel;
246 uint16_t staId; /* self StaID */
247 uint8_t sessionId; /* SoftAP SME session ID */
248} tSap_StartBssCompleteEvent;
249
250typedef struct sap_StopBssCompleteEvent_s {
251 uint8_t status;
252} tSap_StopBssCompleteEvent;
253
254typedef struct sap_StationAssocIndication_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530255 struct qdf_mac_addr staMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800256 uint8_t assoId;
257 uint8_t staId;
258 uint8_t status;
259 /* Required for indicating the frames to upper layer */
260 uint32_t beaconLength;
261 uint8_t *beaconPtr;
262 uint32_t assocReqLength;
263 uint8_t *assocReqPtr;
264 bool fWmmEnabled;
265 eCsrAuthType negotiatedAuthType;
266 eCsrEncryptionType negotiatedUCEncryptionType;
267 eCsrEncryptionType negotiatedMCEncryptionType;
268 bool fAuthRequired;
gaolez7bb1e742017-03-21 16:37:38 +0800269 uint8_t ecsa_capable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800270} tSap_StationAssocIndication;
271
272typedef struct sap_StationAssocReassocCompleteEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530273 struct qdf_mac_addr staMac;
Rachit Kankane2487f8f2017-04-19 14:30:19 +0530274 eStationType staType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800275 uint8_t staId;
276 uint8_t status;
277 uint8_t ies[MAX_ASSOC_IND_IE_LEN];
278 uint16_t iesLen;
279 uint32_t statusCode;
280 eSapAuthType SapAuthType;
281 bool wmmEnabled;
282 /* Required for indicating the frames to upper layer */
283 uint32_t beaconLength;
284 uint8_t *beaconPtr;
285 uint32_t assocReqLength;
286 uint8_t *assocReqPtr;
287 uint32_t assocRespLength;
288 uint8_t *assocRespPtr;
289 uint8_t timingMeasCap;
290 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +0800291 bool ampdu;
292 bool sgi_enable;
293 bool tx_stbc;
294 bool rx_stbc;
295 tSirMacHTChannelWidth ch_width;
296 enum sir_sme_phy_mode mode;
297 uint8_t max_supp_idx;
298 uint8_t max_ext_idx;
299 uint8_t max_mcs_idx;
300 uint8_t rx_mcs_map;
301 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +0800302 uint8_t ecsa_capable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303} tSap_StationAssocReassocCompleteEvent;
304
305typedef struct sap_StationDisassocCompleteEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530306 struct qdf_mac_addr staMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800307 uint8_t staId; /* STAID should not be used */
308 uint8_t status;
309 uint32_t statusCode;
310 eSapDisassocReason reason;
311} tSap_StationDisassocCompleteEvent;
312
313typedef struct sap_StationSetKeyCompleteEvent_s {
314 uint8_t status;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530315 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800316} tSap_StationSetKeyCompleteEvent;
317
318/*struct corresponding to SAP_STA_MIC_FAILURE_EVENT */
319typedef struct sap_StationMICFailureEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530320 struct qdf_mac_addr srcMacAddr; /* address used to compute MIC */
321 struct qdf_mac_addr staMac; /* taMacAddr transmitter address */
322 struct qdf_mac_addr dstMacAddr;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700323 bool multicast;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800324 uint8_t IV1; /* first byte of IV */
325 uint8_t keyId; /* second byte of IV */
326 uint8_t TSC[SIR_CIPHER_SEQ_CTR_SIZE]; /* sequence number */
327
328} tSap_StationMICFailureEvent;
329/*Structure to return MAC address of associated stations */
330typedef struct sap_AssocMacAddr_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530331 struct qdf_mac_addr staMac; /* Associated station's MAC address */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800332 uint8_t assocId; /* Associated station's Association ID */
333 uint8_t staId; /* Allocated station Id */
334 uint8_t ShortGI40Mhz;
335 uint8_t ShortGI20Mhz;
336 uint8_t Support40Mhz;
337 uint32_t requestedMCRate;
338 tSirSupportedRates supportedRates;
339} tSap_AssocMacAddr, *tpSap_AssocMacAddr;
340
341/*struct corresponding to SAP_ASSOC_STA_CALLBACK_EVENT */
342typedef struct sap_AssocStaListEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530343 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 /* module id that was passed in wlansap_get_assoc_stations API */
345 uint8_t noOfAssocSta; /* Number of associated stations */
346 tpSap_AssocMacAddr pAssocStas;
347 /*
348 * Pointer to pre allocated memory to obtain list of
349 * associated stations passed in wlansap_get_assoc_stations API
350 */
351} tSap_AssocStaListEvent;
352
353typedef struct sap_GetWPSPBCSessionEvent_s {
354 uint8_t status;
355 /* module id that was passed in wlansap_get_assoc_stations API */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530356 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530358 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800359 eWPSPBCOverlap wpsPBCOverlap;
360} tSap_GetWPSPBCSessionEvent;
361
362typedef struct sap_WPSPBCProbeReqEvent_s {
363 uint8_t status;
364 /* module id that was passed in wlansap_get_assoc_stations API */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530365 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800366 tSirWPSPBCProbeReq WPSPBCProbeReq;
367} tSap_WPSPBCProbeReqEvent;
368
369typedef struct sap_ManagementFrameInfo_s {
370 uint32_t nFrameLength;
371 uint8_t frameType;
372 uint32_t rxChan; /* Channel of where packet is received */
373 /*
374 * Point to a buffer contain the beacon, assoc req, assoc rsp frame,
375 * in that order user needs to use nBeaconLength, nAssocReqLength,
376 * nAssocRspLength to desice where each frame starts and ends.
377 */
378 uint8_t *pbFrames;
379} tSap_ManagementFrameInfo;
380
381typedef struct sap_SendActionCnf_s {
382 eSapStatus actionSendSuccess;
383} tSap_SendActionCnf;
384
385typedef struct sap_UnknownSTAJoinEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530386 struct qdf_mac_addr macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800387} tSap_UnknownSTAJoinEvent;
388
389typedef struct sap_MaxAssocExceededEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530390 struct qdf_mac_addr macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800391} tSap_MaxAssocExceededEvent;
392
393typedef struct sap_DfsNolInfo_s {
394 uint16_t sDfsList; /* size of pDfsList in byte */
395 void *pDfsList; /* pointer to pDfsList buffer */
396} tSap_DfsNolInfo;
397
398/**
399 * sap_acs_ch_selected_s - the structure to hold the selected channels
400 * @pri_channel: Holds the ACS selected primary channel
401 * @sec_channel: Holds the ACS selected secondary channel
402 *
403 * Holds the primary and secondary channel selected by ACS and is
404 * used to send it to the HDD.
405 */
406struct sap_ch_selected_s {
407 uint16_t pri_ch;
408 uint16_t ht_sec_ch;
409 uint16_t vht_seg0_center_ch;
410 uint16_t vht_seg1_center_ch;
411 uint16_t ch_width;
412};
413
414/**
415 * sap_roc_ready_ind_s - the structure to hold the scan id
416 * @scan_id: scan identifier
417 *
418 * Holds scan identifier
419 */
420struct sap_roc_ready_ind_s {
421 uint32_t scan_id;
422};
Abhishek Singh518323d2015-10-19 17:42:01 +0530423
424/**
Liangwei Dongaef84342016-10-21 05:28:00 -0400425 * struct sap_acs_scan_complete_event - acs scan complete event
426 * @status: status of acs scan
427 * @channellist: acs scan channels
428 * @num_of_channels: number of channels
429 */
430struct sap_acs_scan_complete_event{
431 uint8_t status;
432 uint8_t *channellist;
433 uint8_t num_of_channels;
434};
435
436/**
Abhishek Singh518323d2015-10-19 17:42:01 +0530437 * struct sap_ch_change_ind - channel change indication
438 * @new_chan: channel to change
439 */
440struct sap_ch_change_ind {
441 uint16_t new_chan;
442};
443
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800444/*
445 * This struct will be filled in and passed to tpWLAN_SAPEventCB that is
446 * provided during wlansap_start_bss call The event id corresponding to
447 * structure in the union is defined in comment next to the structure
448 */
449
450typedef struct sap_Event_s {
451 eSapHddEvent sapHddEventCode;
452 union {
453 /*SAP_START_BSS_EVENT */
454 tSap_StartBssCompleteEvent sapStartBssCompleteEvent;
455 /*SAP_STOP_BSS_EVENT */
456 tSap_StopBssCompleteEvent sapStopBssCompleteEvent;
457 /*SAP_ASSOC_INDICATION */
458 tSap_StationAssocIndication sapAssocIndication;
459 /*SAP_STA_ASSOC_EVENT, SAP_STA_REASSOC_EVENT */
460 tSap_StationAssocReassocCompleteEvent
461 sapStationAssocReassocCompleteEvent;
462 /*SAP_STA_DISASSOC_EVENT */
463 tSap_StationDisassocCompleteEvent
464 sapStationDisassocCompleteEvent;
465 /*SAP_STA_SET_KEY_EVENT */
466 tSap_StationSetKeyCompleteEvent sapStationSetKeyCompleteEvent;
467 /*SAP_STA_MIC_FAILURE_EVENT */
468 tSap_StationMICFailureEvent sapStationMICFailureEvent;
469 /*SAP_ASSOC_STA_CALLBACK_EVENT */
470 tSap_AssocStaListEvent sapAssocStaListEvent;
471 /*SAP_GET_WPSPBC_SESSION_EVENT */
472 tSap_GetWPSPBCSessionEvent sapGetWPSPBCSessionEvent;
473 /*eSAP_WPS_PBC_PROBE_REQ_EVENT */
474 tSap_WPSPBCProbeReqEvent sapPBCProbeReqEvent;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800475 tSap_SendActionCnf sapActionCnf;
476 /* eSAP_UNKNOWN_STA_JOIN */
477 tSap_UnknownSTAJoinEvent sapUnknownSTAJoin;
478 /* eSAP_MAX_ASSOC_EXCEEDED */
479 tSap_MaxAssocExceededEvent sapMaxAssocExceeded;
480 /*eSAP_DFS_NOL_XXX */
481 tSap_DfsNolInfo sapDfsNolInfo;
482 struct sap_ch_selected_s sap_ch_selected;
483 struct sap_roc_ready_ind_s sap_roc_ind;
Abhishek Singh518323d2015-10-19 17:42:01 +0530484 struct sap_ch_change_ind sap_chan_cng_ind;
Liangwei Dongaef84342016-10-21 05:28:00 -0400485 struct sap_acs_scan_complete_event sap_acs_scan_comp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 } sapevt;
487} tSap_Event, *tpSap_Event;
488
489typedef struct sap_SSID {
490 uint8_t length;
491 uint8_t ssId[MAX_SSID_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +0530492} qdf_packed tSap_SSID_t;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800493
494typedef struct sap_SSIDInfo {
495 tSap_SSID_t ssid; /* SSID of the AP */
496 /* SSID should/shouldn't be bcast in probe RSP & beacon */
497 uint8_t ssidHidden;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530498} qdf_packed tSap_SSIDInfo_t;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800499
500struct sap_acs_cfg {
501 /* ACS Algo Input */
502 uint8_t acs_mode;
503 uint32_t hw_mode;
504 uint8_t start_ch;
505 uint8_t end_ch;
506 uint8_t *ch_list;
507 uint8_t ch_list_count;
508#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
509 uint8_t skip_scan_status;
510 uint8_t skip_scan_range1_stch;
511 uint8_t skip_scan_range1_endch;
512 uint8_t skip_scan_range2_stch;
513 uint8_t skip_scan_range2_endch;
514#endif
515
516 uint16_t ch_width;
Tushnim Bhattacharyya01057702016-10-26 15:14:35 -0700517 uint8_t pcl_channels[QDF_MAX_NUM_CHAN];
Kapil Gupta8878ad92017-02-13 11:56:04 +0530518 uint8_t pcl_channels_weight_list[QDF_MAX_NUM_CHAN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519 uint32_t pcl_ch_count;
Kapil Gupta086c6202016-12-11 18:17:06 +0530520 uint8_t is_ht_enabled;
521 uint8_t is_vht_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522 /* ACS Algo Output */
523 uint8_t pri_ch;
524 uint8_t ht_sec_ch;
525 uint8_t vht_seg0_center_ch;
526 uint8_t vht_seg1_center_ch;
Kapil Guptac1224bf2017-06-22 21:22:40 +0530527 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800528};
529
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530530/*
531 * enum vendor_ie_access_policy- access policy
532 * @ACCESS_POLICY_NONE: access policy attribute is not valid
533 * @ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT: respond to probe req/assoc req
534 * only if ie is present
535 * @ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT: do not respond to probe req/
536 * assoc req if ie is present
537*/
538enum vendor_ie_access_policy {
539 ACCESS_POLICY_NONE,
540 ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT,
541 ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT,
542};
543
Agrawal Ashish65634612016-08-18 13:24:32 +0530544/*
545 * enum sap_acs_dfs_mode- state of DFS mode
546 * @ACS_DFS_MODE_NONE: DFS mode attribute is not valid
547 * @ACS_DFS_MODE_ENABLE: DFS mode is enabled
548 * @ACS_DFS_MODE_DISABLE: DFS mode is disabled
549 * @ACS_DFS_MODE_DEPRIORITIZE: Deprioritize DFS channels in scanning
550 */
551enum sap_acs_dfs_mode {
552 ACS_DFS_MODE_NONE,
553 ACS_DFS_MODE_ENABLE,
554 ACS_DFS_MODE_DISABLE,
555 ACS_DFS_MODE_DEPRIORITIZE
556};
557
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800558typedef struct sap_Config {
559 tSap_SSIDInfo_t SSIDinfo;
560 eCsrPhyMode SapHw_mode; /* Wireless Mode */
561 eSapMacAddrACL SapMacaddr_acl;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530562 struct qdf_mac_addr accept_mac[MAX_ACL_MAC_ADDRESS]; /* MAC filtering */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800563 bool ieee80211d; /* Specify if 11D is enabled or disabled */
564 bool protEnabled; /* Specify if protection is enabled or disabled */
565 /* Specify if OBSS protection is enabled or disabled */
566 bool obssProtEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530567 struct qdf_mac_addr deny_mac[MAX_ACL_MAC_ADDRESS]; /* MAC filtering */
568 struct qdf_mac_addr self_macaddr; /* self macaddress or BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569 uint8_t channel; /* Operation channel */
570 uint8_t sec_ch;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800571 struct ch_params ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800572 uint32_t ch_width_orig;
573 uint8_t max_num_sta; /* maximum number of STAs in station table */
574 uint8_t dtim_period; /* dtim interval */
575 uint8_t num_accept_mac;
576 uint8_t num_deny_mac;
577 /* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */
578 uint8_t RSNWPAReqIE[(SIR_MAC_MAX_IE_LENGTH * 2) + 4];
579 /* it is ignored if [0] is 0. */
580 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN];
581 uint8_t RSNAuthType;
582 uint8_t RSNEncryptType;
583 uint8_t mcRSNEncryptType;
584 eSapAuthType authType;
585 bool privacy;
586 bool UapsdEnable;
587 bool fwdWPSPBCProbeReq;
588 /* 0 - disabled, 1 - not configured , 2 - configured */
589 uint8_t wps_state;
590 uint16_t ht_capab;
591 uint16_t RSNWPAReqIELength; /* The byte count in the pWPAReqIE */
592 uint32_t beacon_int; /* Beacon Interval */
593 uint32_t ap_table_max_size;
594 uint32_t ap_table_expiration_time;
595 uint32_t ht_op_mode_fixed;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530596 enum tQDF_ADAPTER_MODE persona; /* Tells us which persona, GO or AP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597 uint8_t disableDFSChSwitch;
598 bool enOverLapCh;
599#ifdef WLAN_FEATURE_11W
600 bool mfpRequired;
601 bool mfpCapable;
602#endif
603#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
604 uint8_t cc_switch_mode;
605#endif
606 struct sap_acs_cfg acs_cfg;
607 uint16_t probeRespIEsBufferLen;
608 /* buffer for addn ies comes from hostapd */
609 void *pProbeRespIEsBuffer;
610 uint16_t assocRespIEsLen;
611 /* buffer for addn ies comes from hostapd */
612 void *pAssocRespIEsBuffer;
613 uint16_t probeRespBcnIEsLen;
614 /* buffer for addn ies comes from hostapd */
615 void *pProbeRespBcnIEsBuffer;
616 uint8_t sap_dot11mc; /* Specify if 11MC is enabled or disabled*/
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530617 uint8_t beacon_tx_rate;
618 uint8_t *vendor_ie;
619 enum vendor_ie_access_policy vendor_ie_access_policy;
620 uint16_t sta_inactivity_timeout;
621 uint16_t tx_pkt_fail_cnt_threshold;
622 uint8_t short_retry_limit;
623 uint8_t long_retry_limit;
624 uint8_t ampdu_size;
Agrawal Ashish06e76d22016-08-18 16:44:48 +0530625 tSirMacRateSet supported_rates;
626 tSirMacRateSet extended_rates;
Agrawal Ashish65634612016-08-18 13:24:32 +0530627 enum sap_acs_dfs_mode acs_dfs_mode;
Kapil Gupta086c6202016-12-11 18:17:06 +0530628 struct hdd_channel_info *channel_info;
Jayachandran Sreekumaran68c952c2017-04-24 12:42:03 +0530629 uint32_t channel_info_count;
Arif Hussain759a0232017-03-20 13:17:18 -0700630 bool dfs_cac_offload;
gaoleze2920bd2017-03-21 17:38:42 +0800631 /* beacon count before channel switch */
632 uint8_t sap_chanswitch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +0800633 uint8_t sap_chanswitch_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800634} tsap_Config_t;
635
636#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
637typedef enum {
638 eSAP_DO_NEW_ACS_SCAN,
639 eSAP_DO_PAR_ACS_SCAN,
640 eSAP_SKIP_ACS_SCAN
641} tSap_skip_acs_scan;
642#endif
643
644typedef enum {
645 eSAP_WPS_PROBE_RSP_IE,
646 eSAP_WPS_BEACON_IE,
647 eSAP_WPS_ASSOC_RSP_IE
648} eSapWPSIE_CODE;
649
650typedef struct sSapName {
651 uint8_t num_name;
652 uint8_t name[MAX_NAME_SIZE];
653} tSapName;
654
655typedef struct sSapText {
656 uint8_t num_text;
657 uint8_t text[MAX_TEXT_SIZE];
658} tSapText;
659
660typedef enum {
661 eSAP_DFS_DO_NOT_SKIP_CAC,
662 eSAP_DFS_SKIP_CAC
663} eSapDfsCACState_t;
664
665typedef enum {
666 eSAP_DFS_CHANNEL_USABLE,
667 eSAP_DFS_CHANNEL_AVAILABLE,
668 eSAP_DFS_CHANNEL_UNAVAILABLE
669} eSapDfsChanStatus_t;
670
671typedef struct sSapDfsNolInfo {
672 uint8_t dfs_channel_number;
673 eSapDfsChanStatus_t radar_status_flag;
674 uint64_t radar_found_timestamp;
675} tSapDfsNolInfo;
676
677typedef struct sSapDfsInfo {
Anurag Chouhan210db072016-02-22 18:42:15 +0530678 qdf_mc_timer_t sap_dfs_cac_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800679 uint8_t sap_radar_found_status;
680 /*
681 * New channel to move to when a Radar is
682 * detected on current Channel
683 */
684 uint8_t target_channel;
685 uint8_t last_radar_found_channel;
686 uint8_t ignore_cac;
687 eSapDfsCACState_t cac_state;
688 uint8_t user_provided_target_channel;
689
690 /*
691 * Requests for Channel Switch Announcement IE
692 * generation and transmission
693 */
694 uint8_t csaIERequired;
695 uint8_t numCurrentRegDomainDfsChannels;
696 tSapDfsNolInfo sapDfsChannelNolList[NUM_5GHZ_CHANNELS];
697 uint8_t is_dfs_cac_timer_running;
698 /*
699 * New channel width and new channel bonding mode
700 * will only be updated via channel fallback mechanism
701 */
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800702 enum phy_ch_width orig_chanWidth;
703 enum phy_ch_width new_chanWidth;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800704 struct ch_params new_ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705
706 /*
707 * INI param to enable/disable SAP W53
708 * channel operation.
709 */
710 uint8_t is_dfs_w53_disabled;
711
712 /*
713 * sap_operating_channel_location holds SAP indoor,
714 * outdoor location information. Currently, if this
715 * param is set this Indoor/outdoor channel interop
716 * restriction will only be implemented for JAPAN
717 * regulatory domain.
718 *
719 * 0 - Indicates that location unknown
720 * (or) SAP Indoor/outdoor interop is allowed
721 *
722 * 1 - Indicates device is operating on Indoor channels
723 * and SAP cannot pick next random channel from outdoor
724 * list of channels when a radar is found on current operating
725 * DFS channel.
726 *
727 * 2 - Indicates device is operating on Outdoor Channels
728 * and SAP cannot pick next random channel from indoor
729 * list of channels when a radar is found on current
730 * operating DFS channel.
731 */
732 uint8_t sap_operating_chan_preferred_location;
733
734 /*
735 * Flag to indicate if DFS test mode is enabled and
736 * channel switch is disabled.
737 */
738 uint8_t disable_dfs_ch_switch;
Yingying Tangb4832f72016-10-20 13:44:55 +0800739 uint16_t tx_leakage_threshold;
gaoleze2920bd2017-03-21 17:38:42 +0800740 /* beacon count before channel switch */
741 uint8_t sap_ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +0800742 uint8_t sap_ch_switch_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800743} tSapDfsInfo;
744
745typedef struct tagSapCtxList {
746 uint8_t sessionID;
747 void *pSapContext;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530748 enum tQDF_ADAPTER_MODE sapPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800749} tSapCtxList, tpSapCtxList;
750
751typedef struct tagSapStruct {
752 /* Information Required for SAP DFS Master mode */
753 tSapDfsInfo SapDfsInfo;
754 tSapCtxList sapCtxList[SAP_MAX_NUM_SESSION];
755#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
756 bool sap_channel_avoidance;
757#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
758 bool enable_dfs_phy_error_logs;
759} tSapStruct, *tpSapStruct;
760
761#define WPS_PROBRSP_VER_PRESENT 0x00000001
762#define WPS_PROBRSP_STATE_PRESENT 0x00000002
763#define WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
764#define WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
765#define WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
766#define WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
767#define WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
768#define WPS_PROBRSP_UUIDE_PRESENT 0x00000080
769#define WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
770#define WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
771#define WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
772#define WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
773#define WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
774#define WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
775#define WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
776#define WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
777
778typedef struct sap_WPSProbeRspIE_s {
779 uint32_t FieldPresent;
780 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
781 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
782 bool APSetupLocked; /* Must be included if value is true */
783 /* indicates if user has recently activated a reg to add an Enrollee. */
784 bool SelectedRegistra;
785 uint16_t DevicePasswordID; /* Device Password ID */
786 /* Selected Registrar config method */
787 uint16_t SelectedRegistraCfgMethod;
788 uint8_t ResponseType; /* Response type */
789 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
790 tSapName Manufacture;
791 tSapText ModelName;
792 tSapText ModelNumber;
793 tSapText SerialNumber;
794 /* Device Category ID: 1Computer, 2Input Device, ... */
795 uint32_t PrimaryDeviceCategory;
796 /* Vendor specific OUI for Device Sub Category */
797 uint8_t PrimaryDeviceOUI[4];
798 /*
799 * Device Sub Category ID: 1-PC,
800 * 2-Server if Device Category is computer
801 */
802 uint32_t DeviceSubCategory;
803 tSapText DeviceName;
804 uint16_t ConfigMethod; /* Configuaration method */
805 uint8_t RFBand; /* RF bands available on the AP */
806} tSap_WPSProbeRspIE;
807
808#define WPS_BEACON_VER_PRESENT 0x00000001
809#define WPS_BEACON_STATE_PRESENT 0x00000002
810#define WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
811#define WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
812#define WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
813#define WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
814#define WPS_BEACON_UUIDE_PRESENT 0x00000080
815#define WPS_BEACON_RF_BANDS_PRESENT 0x00000100
816
817typedef struct sap_WPSBeaconIE_s {
818 uint32_t FieldPresent;
819 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
820 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
821 bool APSetupLocked; /* Must be included if value is true */
822 /* indicates if user has recently activated a reg to add an Enrollee. */
823 bool SelectedRegistra;
824 uint16_t DevicePasswordID; /* Device Password ID */
825 uint16_t SelectedRegistraCfgMethod; /* Selected reg config method */
826 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
827 uint8_t RFBand; /* RF bands available on the AP */
828} tSap_WPSBeaconIE;
829
830#define WPS_ASSOCRSP_VER_PRESENT 0x00000001
831#define WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
832
833typedef struct sap_WPSAssocRspIE_s {
834 uint32_t FieldPresent;
835 uint32_t Version;
836 uint8_t ResposeType;
837} tSap_WPSAssocRspIE;
838
839typedef struct sap_WPSIE_s {
840 eSapWPSIE_CODE sapWPSIECode;
841 union {
842 tSap_WPSProbeRspIE sapWPSProbeRspIE; /* WPS Set Probe Resp IE */
843 tSap_WPSBeaconIE sapWPSBeaconIE; /* WPS Set Beacon IE */
844 tSap_WPSAssocRspIE sapWPSAssocRspIE; /* WPS Set Assoc Resp IE */
845 } sapwpsie;
846} tSap_WPSIE, *tpSap_WPSIE;
847
848#ifdef WLANTL_DEBUG
849#define MAX_RATE_INDEX 136
850#define MAX_NUM_RSSI 100
851#define MAX_RSSI_INTERVAL 5
852#endif
853
854typedef struct sap_SoftapStats_s {
855 uint32_t txUCFcnt;
856 uint32_t txMCFcnt;
857 uint32_t txBCFcnt;
858 uint32_t txUCBcnt;
859 uint32_t txMCBcnt;
860 uint32_t txBCBcnt;
861 uint32_t rxUCFcnt;
862 uint32_t rxMCFcnt;
863 uint32_t rxBCFcnt;
864 uint32_t rxUCBcnt;
865 uint32_t rxMCBcnt;
866 uint32_t rxBCBcnt;
867 uint32_t rxBcnt;
868 uint32_t rxBcntCRCok;
869 uint32_t rxRate;
870#ifdef WLANTL_DEBUG
871 uint32_t pktCounterRateIdx[MAX_RATE_INDEX];
872 uint32_t pktCounterRssi[MAX_NUM_RSSI];
873#endif
874} tSap_SoftapStats, *tpSap_SoftapStats;
Amar Singhal7a1726a2015-10-14 16:28:11 -0700875
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800876#ifdef FEATURE_WLAN_CH_AVOID
877/* Store channel safety information */
878typedef struct {
879 uint16_t channelNumber;
880 bool isSafe;
881} sapSafeChannelType;
882#endif /* FEATURE_WLAN_CH_AVOID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883void sap_cleanup_channel_list(void *sapContext);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800884void sapCleanupAllChannelList(void);
bings394afdd2017-01-09 11:22:38 +0800885
886/**
887 * sap_is_auto_channel_select() - is channel AUTO_CHANNEL_SELECT
888 * @pvos_gctx: Pointer to vos global context structure
889 *
890 * Return: true on AUTO_CHANNEL_SELECT, false otherwise
891 */
892bool sap_is_auto_channel_select(void *pvos_gctx);
893
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530894QDF_STATUS wlansap_set_wps_ie(void *p_cds_gctx, tSap_WPSIE *pWPSIe);
895QDF_STATUS wlansap_update_wps_ie(void *p_cds_gctx);
896QDF_STATUS wlansap_stop_Wps(void *p_cds_gctx);
897QDF_STATUS wlansap_get_wps_state(void *p_cds_gctx, bool *pbWPSState);
Ryan Hsu4252a2f2016-01-05 11:18:24 -0800898void *wlansap_open(void *p_cds_gctx);
Manishekar Chandrasekaranf7a1dad2016-06-23 06:43:47 +0530899QDF_STATUS wlansap_global_init(void);
900QDF_STATUS wlansap_global_deinit(void);
Peng Xu66162de2016-02-11 17:01:20 -0800901QDF_STATUS wlansap_start(void *p_cds_gctx, enum tQDF_ADAPTER_MODE mode,
Dustin Brownd28772b2017-03-17 14:16:07 -0700902 uint8_t *addr, uint32_t session_id);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530903QDF_STATUS wlansap_stop(void *p_cds_gctx);
904QDF_STATUS wlansap_close(void *p_cds_gctx);
905typedef QDF_STATUS (*tpWLAN_SAPEventCB)(tpSap_Event pSapEvent,
Peng Xu66162de2016-02-11 17:01:20 -0800906 void *pUsrContext);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800907uint8_t wlansap_get_state(void *p_cds_gctx);
908
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530909/**
910 * wlansap_is_channel_in_nol_list() - This API checks if channel is
911 * in nol list
912 * @ctx: context pointer
913 * @channel: channel
914 * @chanBondState: channel bonding state
915 *
916 * Return: True/False
917 */
918bool wlansap_is_channel_in_nol_list(void *p_cds_gctx, uint8_t channel_no,
919 ePhyChanBondState chanBondState);
920/**
921 * wlansap_is_channel_leaking_in_nol() - This API checks if channel is leaking
922 * in nol list
923 * @ctx: context pointer
924 * @channel: channel
925 * @chan_bw: channel bandwidth
926 *
927 * Return: True/False
928 */
929bool wlansap_is_channel_leaking_in_nol(void *ctx, uint8_t channel,
930 uint8_t chan_bw);
931
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530932QDF_STATUS wlansap_start_bss(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800933 tpWLAN_SAPEventCB pSapEventCallback,
934 tsap_Config_t *pConfig, void *pUsrContext);
Kapil Gupta8878ad92017-02-13 11:56:04 +0530935
936/**
937 * wlan_sap_update_next_channel() - Update next channel configured using vendor
938 * command in SAP context
939 * @ctx: SAP context
940 * @channel: channel number
941 * @chan_bw: channel width
942 *
943 * Return: QDF_STATUS
944 */
945QDF_STATUS wlan_sap_update_next_channel(void *ctx, uint8_t channel,
946 enum phy_ch_width chan_bw);
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530947QDF_STATUS wlan_sap_set_pre_cac_status(void *ctx, bool status,
948 tHalHandle handle);
949QDF_STATUS wlan_sap_set_chan_before_pre_cac(void *ctx,
950 uint8_t chan_before_pre_cac);
951QDF_STATUS wlan_sap_set_pre_cac_complete_status(void *ctx, bool status);
952bool wlan_sap_is_pre_cac_active(tHalHandle handle);
953QDF_STATUS wlan_sap_get_pre_cac_vdev_id(tHalHandle handle, uint8_t *vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800954#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
955uint16_t wlansap_check_cc_intf(void *Ctx);
956#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530957QDF_STATUS wlansap_set_mac_acl(void *p_cds_gctx, tsap_Config_t *pConfig);
958QDF_STATUS wlansap_stop_bss(void *p_cds_gctx);
959QDF_STATUS wlansap_disassoc_sta(void *p_cds_gctx,
Deepthi Gowrib3bfefd2016-09-13 15:14:34 +0530960 struct tagCsrDelStaParams *p_del_sta_params);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530961QDF_STATUS wlansap_deauth_sta(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800962 struct tagCsrDelStaParams *pDelStaParams);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530963QDF_STATUS wlansap_set_channel_change_with_csa(void *p_cds_gctx,
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800964 uint32_t targetChannel, enum phy_ch_width target_bw);
965QDF_STATUS wlansap_set_key_sta(void *p_cds_gctx,
966 tCsrRoamSetKey *pSetKeyInfo);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530967QDF_STATUS wlansap_get_assoc_stations(void *p_cds_gctx,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530968 QDF_MODULE_ID module, tpSap_AssocMacAddr pAssocStas);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530969QDF_STATUS wlansap_remove_wps_session_overlap(void *p_cds_gctx,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530970 struct qdf_mac_addr pRemoveMac);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530971QDF_STATUS wlansap_get_wps_session_overlap(void *p_cds_gctx);
972QDF_STATUS wlansap_set_counter_measure(void *p_cds_gctx, bool bEnable);
973QDF_STATUS wlan_sap_getstation_ie_information(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800974 uint32_t *pLen, uint8_t *pBuf);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530975QDF_STATUS wlansap_clear_acl(void *p_cds_gctx);
976QDF_STATUS wlansap_get_acl_accept_list(void *p_cds_gctx,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530977 struct qdf_mac_addr *pAcceptList, uint8_t *nAcceptList);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530978QDF_STATUS wlansap_get_acl_deny_list(void *pCtx,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530979 struct qdf_mac_addr *pDenyList, uint8_t *nDenyList);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530980QDF_STATUS wlansap_set_mode(void *p_cds_gctx, uint32_t mode);
981QDF_STATUS wlansap_get_acl_mode(void *p_cds_gctx, eSapMacAddrACL *mode);
982QDF_STATUS wlansap_modify_acl(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983 uint8_t *pPeerStaMac, eSapACLType listType, eSapACLCmdType cmd);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530984QDF_STATUS wlansap_set_wparsn_ies
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800985 (void *p_cds_gctx, uint8_t *pWPARSNIEs, uint32_t WPARSNIEsLen);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530986QDF_STATUS wlansap_send_action
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800987 (void *p_cds_gctx,
988 const uint8_t *pBuf, uint32_t len, uint16_t wait, uint16_t channel_freq);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530989QDF_STATUS wlansap_remain_on_channel
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990 (void *p_cds_gctx,
991 uint8_t channel,
992 uint32_t duration, remainOnChanCallback callback, void *pContext,
993 uint32_t *scan_id);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530994QDF_STATUS wlansap_cancel_remain_on_channel(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800995 uint32_t scan_id);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530996QDF_STATUS wlansap_register_mgmt_frame
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997 (void *p_cds_gctx,
998 uint16_t frameType, uint8_t *matchData, uint16_t matchLen);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530999QDF_STATUS wlansap_de_register_mgmt_frame
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001000 (void *p_cds_gctx,
1001 uint16_t frameType, uint8_t *matchData, uint16_t matchLen);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301002QDF_STATUS wlansap_channel_change_request(void *p_cds_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001003 uint8_t tArgetChannel);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301004QDF_STATUS wlansap_start_beacon_req(void *pSapCtx);
1005QDF_STATUS wlansap_dfs_send_csa_ie_request(void *pSapCtx);
1006QDF_STATUS wlansap_get_dfs_ignore_cac(tHalHandle hHal, uint8_t *pIgnore_cac);
1007QDF_STATUS wlansap_set_dfs_ignore_cac(tHalHandle hHal, uint8_t ignore_cac);
1008QDF_STATUS wlansap_set_dfs_restrict_japan_w53(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 uint8_t disable_Dfs_JapanW3);
1010
1011#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301012QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013wlan_sap_set_channel_avoidance(tHalHandle hal, bool sap_channel_avoidance);
1014#endif
1015
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301016QDF_STATUS wlansap_set_dfs_preferred_channel_location(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001017 uint8_t dfs_Preferred_Channels_location);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301018QDF_STATUS wlansap_set_dfs_target_chnl(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001019 uint8_t target_channel);
bings58ce8622017-07-10 15:55:36 +08001020
1021/**
1022 * wlan_sap_get_phymode() - Returns sap phymode.
1023 * @ctx: Pointer to cds Context or Sap Context.
1024 *
1025 * This function provides the SAP current phymode.
1026 *
1027 * Return: phymode
1028 */
1029eCsrPhyMode wlan_sap_get_phymode(void *ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001030uint32_t wlan_sap_get_vht_ch_width(void *ctx);
1031void wlan_sap_set_vht_ch_width(void *ctx, uint32_t vht_channel_width);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301032QDF_STATUS wlansap_update_sap_config_add_ie(tsap_Config_t *pConfig,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001033 const uint8_t *
1034 pAdditionIEBuffer,
1035 uint16_t additionIELength,
1036 eUpdateIEsType updateType);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301037QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_Config_t *pConfig,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001038 eUpdateIEsType updateType);
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07001039void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
1040 uint8_t *endChannelNum, uint8_t *bandStartChannel,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001041 uint8_t *bandEndChannel);
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +05301042QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len);
Arif Hussaincd151632017-02-11 16:57:19 -08001043
1044/**
1045 * wlansap_set_dfs_nol() - Set dfs nol
1046 * @sap_ctx: SAP context
1047 * @conf: set type
1048 *
1049 * Return: QDF_STATUS
1050 */
1051QDF_STATUS wlansap_set_dfs_nol(void *sap_ctx, eSapDfsNolType conf);
Kapil Gupta8878ad92017-02-13 11:56:04 +05301052
1053/**
1054 * wlan_sap_set_vendor_acs() - Set vendor specific acs in sap context
1055 * @pSapCtx: SAP context
1056 * @is_vendor_acs: if vendor specific acs is enabled
1057 *
1058 * Return: QDF_STATUS
1059 */
1060QDF_STATUS wlan_sap_set_vendor_acs(void *sap_ctx, bool is_vendor_acs);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061void wlansap_populate_del_sta_params(const uint8_t *mac,
1062 uint16_t reason_code,
1063 uint8_t subtype,
1064 struct tagCsrDelStaParams *pDelStaParams);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301065QDF_STATUS wlansap_acs_chselect(void *pvos_gctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001066 tpWLAN_SAPEventCB pacs_event_callback,
1067 tsap_Config_t *pconfig,
1068 void *pusr_context);
Yingying Tangb4832f72016-10-20 13:44:55 +08001069
Kai Liubdd5fcb2016-09-28 22:55:44 +08001070uint32_t wlansap_get_chan_width(void *cds_ctx);
1071
Yingying Tangb4832f72016-10-20 13:44:55 +08001072QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
1073 uint16_t tx_leakage_threshold);
Wu Gao36717432016-11-21 15:09:48 +08001074
1075QDF_STATUS wlansap_set_invalid_session(void *cds_ctx);
1076
Arif Hussaincd151632017-02-11 16:57:19 -08001077/**
1078 * sap_dfs_set_current_channel() - Set current channel params in dfs component
1079 * @sap_ctx: sap context
1080 *
1081 * Set current channel params in dfs component, this info will be used to mark
1082 * the channels in nol when radar is detected.
1083 *
1084 * Return: None
1085 */
1086void sap_dfs_set_current_channel(void *sap_ctx);
Wu Gao3545e642017-07-14 19:24:41 +08001087
1088/**
1089 * wlansap_cleanup_cac_timer() - Force cleanup DFS CAC timer
1090 * @sap_ctx: sap context
1091 *
1092 * Force cleanup DFS CAC timer when reset all adapters. It will not
1093 * check concurrency SAP since just called when reset all adapters.
1094 *
1095 * Return: None
1096 */
1097void wlansap_cleanup_cac_timer(void *sap_ctx);
1098
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001099#ifdef __cplusplus
1100}
1101#endif
1102#endif /* #ifndef WLAN_QCT_WLANSAP_H */