blob: 039cecdbf738c255de1f1029c1de264a0af9455f [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
wadesong1795e142018-01-05 11:13:07 +08002 * Copyright (c) 2012-2018 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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080047#include "sme_api.h"
48/*----------------------------------------------------------------------------
49 * Preprocessor Definitions and Constants
50 * -------------------------------------------------------------------------*/
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/*---------------------------------------------------------------------------
56 * defines and enum
57 *--------------------------------------------------------------------------*/
58#define MAX_SSID_LEN 32
59#define MAX_ACL_MAC_ADDRESS 32
60#define AUTO_CHANNEL_SELECT 0
61#define MAX_ASSOC_IND_IE_LEN 255
62
63/* defines for WPS config states */
64#define SAP_WPS_DISABLED 0
65#define SAP_WPS_ENABLED_UNCONFIGURED 1
66#define SAP_WPS_ENABLED_CONFIGURED 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080067
68#define MAX_CHANNEL_LIST_LEN 256
Anurag Chouhanf04e84f2016-03-03 10:12:12 +053069#define QDF_MAX_NO_OF_SAP_MODE 2 /* max # of SAP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080070#define SAP_MAX_NUM_SESSION 5
71#define SAP_MAX_OBSS_STA_CNT 1 /* max # of OBSS STA */
gaoleze5108942017-03-31 16:56:42 +080072#define SAP_ACS_WEIGHT_MAX (26664)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080073
74/*--------------------------------------------------------------------------
75 * reasonCode taken from 802.11 standard.
76 * ------------------------------------------------------------------------*/
77
78typedef enum {
79 eSAP_RC_RESERVED0, /*0 */
80 eSAP_RC_UNSPECIFIED, /*1 */
81 eSAP_RC_PREV_AUTH_INVALID, /*2 */
82 eSAP_RC_STA_LEFT_DEAUTH, /*3 */
83 eSAP_RC_INACTIVITY_DISASSOC, /*4 */
84 eSAP_RC_AP_CAPACITY_FULL, /*5 */
85 eSAP_RC_CLS2_FROM_NON_AUTH_STA, /*6 */
86 eSAP_RC_CLS3_FROM_NON_AUTH_STA, /*7 */
87 eSAP_RC_STA_LEFT_DISASSOC, /*8 */
88 eSAP_RC_STA_NOT_AUTH, /*9 */
89 eSAP_RC_PC_UNACCEPTABLE, /*10 */
90 eSAP_RC_SC_UNACCEPTABLE, /*11 */
91 eSAP_RC_RESERVED1, /*12 */
92 eSAP_RC_INVALID_IE, /*13 */
93 eSAP_RC_MIC_FAIL, /*14 */
94 eSAP_RC_4_WAY_HANDSHAKE_TO, /*15 */
95 eSAP_RC_GO_KEY_HANDSHAKE_TO, /*16 */
96 eSAP_RC_IE_MISMATCH, /*17 */
97 eSAP_RC_INVALID_GRP_CHIPHER, /*18 */
98 eSAP_RC_INVALID_PAIR_CHIPHER, /*19 */
99 eSAP_RC_INVALID_AKMP, /*20 */
100 eSAP_RC_UNSUPPORTED_RSN, /*21 */
101 eSAP_RC_INVALID_RSN, /*22 */
102 eSAP_RC_1X_AUTH_FAILED, /*23 */
103 eSAP_RC_CHIPER_SUITE_REJECTED, /*24 */
104} eSapReasonCode;
105
106typedef enum {
107 eSAP_ACCEPT_UNLESS_DENIED = 0,
108 eSAP_DENY_UNLESS_ACCEPTED = 1,
109 /* this type is added to support accept & deny list at the same time */
110 eSAP_SUPPORT_ACCEPT_AND_DENY = 2,
111 /*In this mode all MAC addresses are allowed to connect */
112 eSAP_ALLOW_ALL = 3,
113} eSapMacAddrACL;
114
115typedef enum {
116 eSAP_BLACK_LIST = 0, /* List of mac addresses NOT allowed to assoc */
117 eSAP_WHITE_LIST = 1, /* List of mac addresses allowed to assoc */
118} eSapACLType;
119
120typedef enum {
121 ADD_STA_TO_ACL = 0, /* cmd to add STA to access control list */
122 DELETE_STA_FROM_ACL = 1, /* cmd to del STA from access control list */
123} eSapACLCmdType;
124
125typedef enum {
126 eSAP_START_BSS_EVENT = 0, /* Event sent when BSS is started */
127 eSAP_STOP_BSS_EVENT, /* Event sent when BSS is stopped */
128 eSAP_STA_ASSOC_IND, /* Indicate assoc req to upper layers */
129 /*
130 * Event sent when we have successfully associated a station and
131 * upper layer neeeds to allocate a context
132 */
133 eSAP_STA_ASSOC_EVENT,
134 /*
135 * Event sent when we have successfully reassociated a station and
136 * upper layer neeeds to allocate a context
137 */
138 eSAP_STA_REASSOC_EVENT,
139 /*
140 * Event sent when associated a station has disassociated as a
141 * result of various conditions
142 */
143 eSAP_STA_DISASSOC_EVENT,
144 /* Event sent when user called wlansap_set_key_sta */
145 eSAP_STA_SET_KEY_EVENT,
146 /* Event sent whenever there is MIC failure detected */
147 eSAP_STA_MIC_FAILURE_EVENT,
148 /* Event sent when user called wlansap_get_assoc_stations */
149 eSAP_ASSOC_STA_CALLBACK_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800150 /* Event send on WPS PBC probe request is received */
151 eSAP_WPS_PBC_PROBE_REQ_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800152 eSAP_DISCONNECT_ALL_P2P_CLIENT,
153 eSAP_MAC_TRIG_STOP_BSS_EVENT,
154 /*
155 * Event send when a STA in neither white list or black list tries to
156 * associate in softap mode
157 */
158 eSAP_UNKNOWN_STA_JOIN,
159 /* Event send when a new STA is rejected association since softAP
160 * max assoc limit has reached
161 */
162 eSAP_MAX_ASSOC_EXCEEDED,
163 eSAP_CHANNEL_CHANGE_EVENT,
164 eSAP_DFS_CAC_START,
165 eSAP_DFS_CAC_INTERRUPTED,
166 eSAP_DFS_CAC_END,
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530167 eSAP_DFS_PRE_CAC_END,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800168 eSAP_DFS_RADAR_DETECT,
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530169 eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800170 /* No ch available after DFS RADAR detect */
171 eSAP_DFS_NO_AVAILABLE_CHANNEL,
Krunal Soni22208392017-09-29 18:10:34 -0700172 eSAP_STOP_BSS_DUE_TO_NO_CHNL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800173 eSAP_ACS_SCAN_SUCCESS_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174 eSAP_ACS_CHANNEL_SELECTED,
Abhishek Singh518323d2015-10-19 17:42:01 +0530175 eSAP_ECSA_CHANGE_CHAN_IND,
Kapil Gupta8878ad92017-02-13 11:56:04 +0530176 eSAP_DFS_NEXT_CHANNEL_REQ,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800177} eSapHddEvent;
178
179typedef enum {
180 eSAP_OPEN_SYSTEM,
181 eSAP_SHARED_KEY,
182 eSAP_AUTO_SWITCH
183} eSapAuthType;
184
185typedef enum {
186 /* Disassociation was internally initated from CORE stack */
187 eSAP_MAC_INITATED_DISASSOC = 0x10000,
188 /*
189 * Disassociation was internally initated from host by
190 * invoking wlansap_disassoc_sta call
191 */
192 eSAP_USR_INITATED_DISASSOC
193} eSapDisassocReason;
194
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800195typedef enum {
196 eSAP_DFS_NOL_CLEAR,
197 eSAP_DFS_NOL_RANDOMIZE,
198} eSapDfsNolType;
199
200/*---------------------------------------------------------------------------
201 SAP PAL "status" and "reason" error code defines
202 ---------------------------------------------------------------------------*/
203typedef enum {
204 eSAP_STATUS_SUCCESS, /* Success. */
205 eSAP_STATUS_FAILURE, /* General Failure. */
206 /* Channel not selected during intial scan. */
207 eSAP_START_BSS_CHANNEL_NOT_SELECTED,
208 eSAP_ERROR_MAC_START_FAIL, /* Failed to start Infra BSS */
209} eSapStatus;
210
211/*---------------------------------------------------------------------------
212 SAP PAL "status" and "reason" error code defines
213 ---------------------------------------------------------------------------*/
214typedef enum {
215 eSAP_WPSPBC_OVERLAP_IN120S, /* Overlap */
216 /* no WPS probe request in 120 second */
217 eSAP_WPSPBC_NO_WPSPBC_PROBE_REQ_IN120S,
218 /* One WPS probe request in 120 second */
219 eSAP_WPSPBC_ONE_WPSPBC_PROBE_REQ_IN120S,
220} eWPSPBCOverlap;
221
Rachit Kankane2487f8f2017-04-19 14:30:19 +0530222/*---------------------------------------------------------------------------
223 SAP Associated station types
224 ---------------------------------------------------------------------------*/
225typedef enum {
226 eSTA_TYPE_NONE = 0x00000000, /* No station type */
227 eSTA_TYPE_INFRA = 0x00000001, /* legacy station */
228 eSTA_TYPE_P2P_CLI = 0x00000002, /* p2p client */
229} eStationType;
230
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800231/*----------------------------------------------------------------------------
232 * Typedefs
233 * -------------------------------------------------------------------------*/
234typedef struct sap_StartBssCompleteEvent_s {
235 uint8_t status;
236 uint8_t operatingChannel;
237 uint16_t staId; /* self StaID */
238 uint8_t sessionId; /* SoftAP SME session ID */
239} tSap_StartBssCompleteEvent;
240
241typedef struct sap_StopBssCompleteEvent_s {
242 uint8_t status;
243} tSap_StopBssCompleteEvent;
244
245typedef struct sap_StationAssocIndication_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530246 struct qdf_mac_addr staMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800247 uint8_t assoId;
248 uint8_t staId;
249 uint8_t status;
250 /* Required for indicating the frames to upper layer */
251 uint32_t beaconLength;
252 uint8_t *beaconPtr;
253 uint32_t assocReqLength;
254 uint8_t *assocReqPtr;
255 bool fWmmEnabled;
256 eCsrAuthType negotiatedAuthType;
257 eCsrEncryptionType negotiatedUCEncryptionType;
258 eCsrEncryptionType negotiatedMCEncryptionType;
259 bool fAuthRequired;
gaolez7bb1e742017-03-21 16:37:38 +0800260 uint8_t ecsa_capable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800261} tSap_StationAssocIndication;
262
263typedef struct sap_StationAssocReassocCompleteEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530264 struct qdf_mac_addr staMac;
Rachit Kankane2487f8f2017-04-19 14:30:19 +0530265 eStationType staType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 uint8_t staId;
267 uint8_t status;
268 uint8_t ies[MAX_ASSOC_IND_IE_LEN];
269 uint16_t iesLen;
270 uint32_t statusCode;
271 eSapAuthType SapAuthType;
272 bool wmmEnabled;
273 /* Required for indicating the frames to upper layer */
274 uint32_t beaconLength;
275 uint8_t *beaconPtr;
276 uint32_t assocReqLength;
277 uint8_t *assocReqPtr;
278 uint32_t assocRespLength;
279 uint8_t *assocRespPtr;
280 uint8_t timingMeasCap;
281 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +0800282 bool ampdu;
283 bool sgi_enable;
284 bool tx_stbc;
285 bool rx_stbc;
286 tSirMacHTChannelWidth ch_width;
287 enum sir_sme_phy_mode mode;
288 uint8_t max_supp_idx;
289 uint8_t max_ext_idx;
290 uint8_t max_mcs_idx;
291 uint8_t rx_mcs_map;
292 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +0800293 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +0530294 tDot11fIEHTCaps ht_caps;
295 tDot11fIEVHTCaps vht_caps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800296} tSap_StationAssocReassocCompleteEvent;
297
298typedef struct sap_StationDisassocCompleteEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530299 struct qdf_mac_addr staMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800300 uint8_t staId; /* STAID should not be used */
301 uint8_t status;
302 uint32_t statusCode;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +0530303 uint32_t reason_code;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304 eSapDisassocReason reason;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +0530305 int rssi;
306 int tx_rate;
307 int rx_rate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800308} tSap_StationDisassocCompleteEvent;
309
310typedef struct sap_StationSetKeyCompleteEvent_s {
311 uint8_t status;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530312 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800313} tSap_StationSetKeyCompleteEvent;
314
315/*struct corresponding to SAP_STA_MIC_FAILURE_EVENT */
316typedef struct sap_StationMICFailureEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530317 struct qdf_mac_addr srcMacAddr; /* address used to compute MIC */
318 struct qdf_mac_addr staMac; /* taMacAddr transmitter address */
319 struct qdf_mac_addr dstMacAddr;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700320 bool multicast;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800321 uint8_t IV1; /* first byte of IV */
322 uint8_t keyId; /* second byte of IV */
323 uint8_t TSC[SIR_CIPHER_SEQ_CTR_SIZE]; /* sequence number */
324
325} tSap_StationMICFailureEvent;
326/*Structure to return MAC address of associated stations */
327typedef struct sap_AssocMacAddr_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530328 struct qdf_mac_addr staMac; /* Associated station's MAC address */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329 uint8_t assocId; /* Associated station's Association ID */
330 uint8_t staId; /* Allocated station Id */
331 uint8_t ShortGI40Mhz;
332 uint8_t ShortGI20Mhz;
333 uint8_t Support40Mhz;
334 uint32_t requestedMCRate;
335 tSirSupportedRates supportedRates;
336} tSap_AssocMacAddr, *tpSap_AssocMacAddr;
337
338/*struct corresponding to SAP_ASSOC_STA_CALLBACK_EVENT */
339typedef struct sap_AssocStaListEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530340 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800341 /* module id that was passed in wlansap_get_assoc_stations API */
342 uint8_t noOfAssocSta; /* Number of associated stations */
343 tpSap_AssocMacAddr pAssocStas;
344 /*
345 * Pointer to pre allocated memory to obtain list of
346 * associated stations passed in wlansap_get_assoc_stations API
347 */
348} tSap_AssocStaListEvent;
349
350typedef struct sap_GetWPSPBCSessionEvent_s {
351 uint8_t status;
352 /* module id that was passed in wlansap_get_assoc_stations API */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530353 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800354 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530355 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356 eWPSPBCOverlap wpsPBCOverlap;
357} tSap_GetWPSPBCSessionEvent;
358
359typedef struct sap_WPSPBCProbeReqEvent_s {
360 uint8_t status;
361 /* module id that was passed in wlansap_get_assoc_stations API */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530362 QDF_MODULE_ID module;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363 tSirWPSPBCProbeReq WPSPBCProbeReq;
364} tSap_WPSPBCProbeReqEvent;
365
366typedef struct sap_ManagementFrameInfo_s {
367 uint32_t nFrameLength;
368 uint8_t frameType;
369 uint32_t rxChan; /* Channel of where packet is received */
370 /*
371 * Point to a buffer contain the beacon, assoc req, assoc rsp frame,
372 * in that order user needs to use nBeaconLength, nAssocReqLength,
373 * nAssocRspLength to desice where each frame starts and ends.
374 */
375 uint8_t *pbFrames;
376} tSap_ManagementFrameInfo;
377
378typedef struct sap_SendActionCnf_s {
379 eSapStatus actionSendSuccess;
380} tSap_SendActionCnf;
381
382typedef struct sap_UnknownSTAJoinEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530383 struct qdf_mac_addr macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800384} tSap_UnknownSTAJoinEvent;
385
386typedef struct sap_MaxAssocExceededEvent_s {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530387 struct qdf_mac_addr macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388} tSap_MaxAssocExceededEvent;
389
390typedef struct sap_DfsNolInfo_s {
391 uint16_t sDfsList; /* size of pDfsList in byte */
392 void *pDfsList; /* pointer to pDfsList buffer */
393} tSap_DfsNolInfo;
394
395/**
396 * sap_acs_ch_selected_s - the structure to hold the selected channels
397 * @pri_channel: Holds the ACS selected primary channel
398 * @sec_channel: Holds the ACS selected secondary channel
399 *
400 * Holds the primary and secondary channel selected by ACS and is
401 * used to send it to the HDD.
402 */
403struct sap_ch_selected_s {
404 uint16_t pri_ch;
405 uint16_t ht_sec_ch;
406 uint16_t vht_seg0_center_ch;
407 uint16_t vht_seg1_center_ch;
408 uint16_t ch_width;
409};
410
411/**
412 * sap_roc_ready_ind_s - the structure to hold the scan id
413 * @scan_id: scan identifier
414 *
415 * Holds scan identifier
416 */
417struct sap_roc_ready_ind_s {
418 uint32_t scan_id;
419};
Abhishek Singh518323d2015-10-19 17:42:01 +0530420
421/**
Liangwei Dongaef84342016-10-21 05:28:00 -0400422 * struct sap_acs_scan_complete_event - acs scan complete event
423 * @status: status of acs scan
424 * @channellist: acs scan channels
425 * @num_of_channels: number of channels
426 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -0700427struct sap_acs_scan_complete_event {
Liangwei Dongaef84342016-10-21 05:28:00 -0400428 uint8_t status;
429 uint8_t *channellist;
430 uint8_t num_of_channels;
431};
432
433/**
Abhishek Singh518323d2015-10-19 17:42:01 +0530434 * struct sap_ch_change_ind - channel change indication
435 * @new_chan: channel to change
436 */
437struct sap_ch_change_ind {
438 uint16_t new_chan;
439};
440
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800441/*
442 * This struct will be filled in and passed to tpWLAN_SAPEventCB that is
443 * provided during wlansap_start_bss call The event id corresponding to
444 * structure in the union is defined in comment next to the structure
445 */
446
447typedef struct sap_Event_s {
448 eSapHddEvent sapHddEventCode;
449 union {
450 /*SAP_START_BSS_EVENT */
451 tSap_StartBssCompleteEvent sapStartBssCompleteEvent;
452 /*SAP_STOP_BSS_EVENT */
453 tSap_StopBssCompleteEvent sapStopBssCompleteEvent;
454 /*SAP_ASSOC_INDICATION */
455 tSap_StationAssocIndication sapAssocIndication;
456 /*SAP_STA_ASSOC_EVENT, SAP_STA_REASSOC_EVENT */
457 tSap_StationAssocReassocCompleteEvent
458 sapStationAssocReassocCompleteEvent;
459 /*SAP_STA_DISASSOC_EVENT */
460 tSap_StationDisassocCompleteEvent
461 sapStationDisassocCompleteEvent;
462 /*SAP_STA_SET_KEY_EVENT */
463 tSap_StationSetKeyCompleteEvent sapStationSetKeyCompleteEvent;
464 /*SAP_STA_MIC_FAILURE_EVENT */
465 tSap_StationMICFailureEvent sapStationMICFailureEvent;
466 /*SAP_ASSOC_STA_CALLBACK_EVENT */
467 tSap_AssocStaListEvent sapAssocStaListEvent;
468 /*SAP_GET_WPSPBC_SESSION_EVENT */
469 tSap_GetWPSPBCSessionEvent sapGetWPSPBCSessionEvent;
470 /*eSAP_WPS_PBC_PROBE_REQ_EVENT */
471 tSap_WPSPBCProbeReqEvent sapPBCProbeReqEvent;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800472 tSap_SendActionCnf sapActionCnf;
473 /* eSAP_UNKNOWN_STA_JOIN */
474 tSap_UnknownSTAJoinEvent sapUnknownSTAJoin;
475 /* eSAP_MAX_ASSOC_EXCEEDED */
476 tSap_MaxAssocExceededEvent sapMaxAssocExceeded;
477 /*eSAP_DFS_NOL_XXX */
478 tSap_DfsNolInfo sapDfsNolInfo;
479 struct sap_ch_selected_s sap_ch_selected;
480 struct sap_roc_ready_ind_s sap_roc_ind;
Abhishek Singh518323d2015-10-19 17:42:01 +0530481 struct sap_ch_change_ind sap_chan_cng_ind;
Liangwei Dongaef84342016-10-21 05:28:00 -0400482 struct sap_acs_scan_complete_event sap_acs_scan_comp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483 } sapevt;
484} tSap_Event, *tpSap_Event;
485
486typedef struct sap_SSID {
487 uint8_t length;
488 uint8_t ssId[MAX_SSID_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +0530489} qdf_packed tSap_SSID_t;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800490
491typedef struct sap_SSIDInfo {
492 tSap_SSID_t ssid; /* SSID of the AP */
493 /* SSID should/shouldn't be bcast in probe RSP & beacon */
494 uint8_t ssidHidden;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530495} qdf_packed tSap_SSIDInfo_t;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800496
497struct sap_acs_cfg {
498 /* ACS Algo Input */
499 uint8_t acs_mode;
wadesong1795e142018-01-05 11:13:07 +0800500 eCsrPhyMode hw_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800501 uint8_t start_ch;
502 uint8_t end_ch;
503 uint8_t *ch_list;
504 uint8_t ch_list_count;
505#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
506 uint8_t skip_scan_status;
507 uint8_t skip_scan_range1_stch;
508 uint8_t skip_scan_range1_endch;
509 uint8_t skip_scan_range2_stch;
510 uint8_t skip_scan_range2_endch;
511#endif
512
513 uint16_t ch_width;
Tushnim Bhattacharyya01057702016-10-26 15:14:35 -0700514 uint8_t pcl_channels[QDF_MAX_NUM_CHAN];
Kapil Gupta8878ad92017-02-13 11:56:04 +0530515 uint8_t pcl_channels_weight_list[QDF_MAX_NUM_CHAN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516 uint32_t pcl_ch_count;
Kapil Gupta086c6202016-12-11 18:17:06 +0530517 uint8_t is_ht_enabled;
518 uint8_t is_vht_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519 /* ACS Algo Output */
520 uint8_t pri_ch;
521 uint8_t ht_sec_ch;
522 uint8_t vht_seg0_center_ch;
523 uint8_t vht_seg1_center_ch;
Kapil Guptac1224bf2017-06-22 21:22:40 +0530524 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800525};
526
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530527/*
528 * enum vendor_ie_access_policy- access policy
529 * @ACCESS_POLICY_NONE: access policy attribute is not valid
530 * @ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT: respond to probe req/assoc req
531 * only if ie is present
532 * @ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT: do not respond to probe req/
533 * assoc req if ie is present
534*/
535enum vendor_ie_access_policy {
536 ACCESS_POLICY_NONE,
537 ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT,
538 ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT,
539};
540
Agrawal Ashish65634612016-08-18 13:24:32 +0530541/*
542 * enum sap_acs_dfs_mode- state of DFS mode
543 * @ACS_DFS_MODE_NONE: DFS mode attribute is not valid
544 * @ACS_DFS_MODE_ENABLE: DFS mode is enabled
545 * @ACS_DFS_MODE_DISABLE: DFS mode is disabled
546 * @ACS_DFS_MODE_DEPRIORITIZE: Deprioritize DFS channels in scanning
547 */
548enum sap_acs_dfs_mode {
549 ACS_DFS_MODE_NONE,
550 ACS_DFS_MODE_ENABLE,
551 ACS_DFS_MODE_DISABLE,
552 ACS_DFS_MODE_DEPRIORITIZE
553};
554
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800555typedef struct sap_Config {
556 tSap_SSIDInfo_t SSIDinfo;
557 eCsrPhyMode SapHw_mode; /* Wireless Mode */
558 eSapMacAddrACL SapMacaddr_acl;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530559 struct qdf_mac_addr accept_mac[MAX_ACL_MAC_ADDRESS]; /* MAC filtering */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800560 bool ieee80211d; /* Specify if 11D is enabled or disabled */
561 bool protEnabled; /* Specify if protection is enabled or disabled */
562 /* Specify if OBSS protection is enabled or disabled */
563 bool obssProtEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530564 struct qdf_mac_addr deny_mac[MAX_ACL_MAC_ADDRESS]; /* MAC filtering */
565 struct qdf_mac_addr self_macaddr; /* self macaddress or BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800566 uint8_t channel; /* Operation channel */
567 uint8_t sec_ch;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800568 struct ch_params ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569 uint32_t ch_width_orig;
570 uint8_t max_num_sta; /* maximum number of STAs in station table */
571 uint8_t dtim_period; /* dtim interval */
572 uint8_t num_accept_mac;
573 uint8_t num_deny_mac;
574 /* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */
575 uint8_t RSNWPAReqIE[(SIR_MAC_MAX_IE_LENGTH * 2) + 4];
576 /* it is ignored if [0] is 0. */
577 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN];
578 uint8_t RSNAuthType;
579 uint8_t RSNEncryptType;
580 uint8_t mcRSNEncryptType;
581 eSapAuthType authType;
582 bool privacy;
583 bool UapsdEnable;
584 bool fwdWPSPBCProbeReq;
585 /* 0 - disabled, 1 - not configured , 2 - configured */
586 uint8_t wps_state;
587 uint16_t ht_capab;
588 uint16_t RSNWPAReqIELength; /* The byte count in the pWPAReqIE */
589 uint32_t beacon_int; /* Beacon Interval */
590 uint32_t ap_table_max_size;
591 uint32_t ap_table_expiration_time;
592 uint32_t ht_op_mode_fixed;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800593 enum QDF_OPMODE persona; /* Tells us which persona, GO or AP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800594 uint8_t disableDFSChSwitch;
595 bool enOverLapCh;
596#ifdef WLAN_FEATURE_11W
597 bool mfpRequired;
598 bool mfpCapable;
599#endif
600#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
601 uint8_t cc_switch_mode;
602#endif
gaoleze5108942017-03-31 16:56:42 +0800603 uint32_t auto_channel_select_weight;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800604 struct sap_acs_cfg acs_cfg;
605 uint16_t probeRespIEsBufferLen;
606 /* buffer for addn ies comes from hostapd */
607 void *pProbeRespIEsBuffer;
608 uint16_t assocRespIEsLen;
609 /* buffer for addn ies comes from hostapd */
610 void *pAssocRespIEsBuffer;
611 uint16_t probeRespBcnIEsLen;
612 /* buffer for addn ies comes from hostapd */
613 void *pProbeRespBcnIEsBuffer;
614 uint8_t sap_dot11mc; /* Specify if 11MC is enabled or disabled*/
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800615 uint16_t beacon_tx_rate;
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530616 uint8_t *vendor_ie;
617 enum vendor_ie_access_policy vendor_ie_access_policy;
618 uint16_t sta_inactivity_timeout;
619 uint16_t tx_pkt_fail_cnt_threshold;
620 uint8_t short_retry_limit;
621 uint8_t long_retry_limit;
622 uint8_t ampdu_size;
Agrawal Ashish06e76d22016-08-18 16:44:48 +0530623 tSirMacRateSet supported_rates;
624 tSirMacRateSet extended_rates;
Agrawal Ashish65634612016-08-18 13:24:32 +0530625 enum sap_acs_dfs_mode acs_dfs_mode;
Kapil Gupta086c6202016-12-11 18:17:06 +0530626 struct hdd_channel_info *channel_info;
Jayachandran Sreekumaran68c952c2017-04-24 12:42:03 +0530627 uint32_t channel_info_count;
Arif Hussain759a0232017-03-20 13:17:18 -0700628 bool dfs_cac_offload;
gaoleze2920bd2017-03-21 17:38:42 +0800629 /* beacon count before channel switch */
630 uint8_t sap_chanswitch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +0800631 uint8_t sap_chanswitch_mode;
hqu16d6e082017-09-04 10:52:31 +0800632 bool chan_switch_hostapd_rate_enabled;
lifeng1c16b6b2017-09-25 13:59:55 +0800633 bool dfs_beacon_tx_enhanced;
lifeng7c607dd2017-02-21 21:16:49 +0800634 uint16_t reduced_beacon_interval;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800635} tsap_Config_t;
636
637#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
638typedef enum {
639 eSAP_DO_NEW_ACS_SCAN,
640 eSAP_DO_PAR_ACS_SCAN,
641 eSAP_SKIP_ACS_SCAN
642} tSap_skip_acs_scan;
643#endif
644
645typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646 eSAP_DFS_DO_NOT_SKIP_CAC,
647 eSAP_DFS_SKIP_CAC
648} eSapDfsCACState_t;
649
650typedef enum {
651 eSAP_DFS_CHANNEL_USABLE,
652 eSAP_DFS_CHANNEL_AVAILABLE,
653 eSAP_DFS_CHANNEL_UNAVAILABLE
654} eSapDfsChanStatus_t;
655
656typedef struct sSapDfsNolInfo {
657 uint8_t dfs_channel_number;
658 eSapDfsChanStatus_t radar_status_flag;
659 uint64_t radar_found_timestamp;
660} tSapDfsNolInfo;
661
662typedef struct sSapDfsInfo {
Anurag Chouhan210db072016-02-22 18:42:15 +0530663 qdf_mc_timer_t sap_dfs_cac_timer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800664 uint8_t sap_radar_found_status;
665 /*
666 * New channel to move to when a Radar is
667 * detected on current Channel
668 */
669 uint8_t target_channel;
670 uint8_t last_radar_found_channel;
671 uint8_t ignore_cac;
672 eSapDfsCACState_t cac_state;
673 uint8_t user_provided_target_channel;
674
675 /*
676 * Requests for Channel Switch Announcement IE
677 * generation and transmission
678 */
679 uint8_t csaIERequired;
680 uint8_t numCurrentRegDomainDfsChannels;
681 tSapDfsNolInfo sapDfsChannelNolList[NUM_5GHZ_CHANNELS];
682 uint8_t is_dfs_cac_timer_running;
683 /*
684 * New channel width and new channel bonding mode
685 * will only be updated via channel fallback mechanism
686 */
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800687 enum phy_ch_width orig_chanWidth;
688 enum phy_ch_width new_chanWidth;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800689 struct ch_params new_ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690
691 /*
692 * INI param to enable/disable SAP W53
693 * channel operation.
694 */
695 uint8_t is_dfs_w53_disabled;
696
697 /*
698 * sap_operating_channel_location holds SAP indoor,
699 * outdoor location information. Currently, if this
700 * param is set this Indoor/outdoor channel interop
701 * restriction will only be implemented for JAPAN
702 * regulatory domain.
703 *
704 * 0 - Indicates that location unknown
705 * (or) SAP Indoor/outdoor interop is allowed
706 *
707 * 1 - Indicates device is operating on Indoor channels
708 * and SAP cannot pick next random channel from outdoor
709 * list of channels when a radar is found on current operating
710 * DFS channel.
711 *
712 * 2 - Indicates device is operating on Outdoor Channels
713 * and SAP cannot pick next random channel from indoor
714 * list of channels when a radar is found on current
715 * operating DFS channel.
716 */
717 uint8_t sap_operating_chan_preferred_location;
718
719 /*
720 * Flag to indicate if DFS test mode is enabled and
721 * channel switch is disabled.
722 */
723 uint8_t disable_dfs_ch_switch;
Yingying Tangb4832f72016-10-20 13:44:55 +0800724 uint16_t tx_leakage_threshold;
gaoleze2920bd2017-03-21 17:38:42 +0800725 /* beacon count before channel switch */
726 uint8_t sap_ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +0800727 uint8_t sap_ch_switch_mode;
lifeng1c16b6b2017-09-25 13:59:55 +0800728 bool dfs_beacon_tx_enhanced;
lifeng7c607dd2017-02-21 21:16:49 +0800729 uint16_t reduced_beacon_interval;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800730} tSapDfsInfo;
731
732typedef struct tagSapCtxList {
733 uint8_t sessionID;
734 void *pSapContext;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800735 enum QDF_OPMODE sapPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800736} tSapCtxList, tpSapCtxList;
737
738typedef struct tagSapStruct {
739 /* Information Required for SAP DFS Master mode */
740 tSapDfsInfo SapDfsInfo;
741 tSapCtxList sapCtxList[SAP_MAX_NUM_SESSION];
742#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
743 bool sap_channel_avoidance;
744#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
gaoleze5108942017-03-31 16:56:42 +0800745 bool acs_with_more_param;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746 bool enable_dfs_phy_error_logs;
747} tSapStruct, *tpSapStruct;
748
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800749typedef struct sap_SoftapStats_s {
750 uint32_t txUCFcnt;
751 uint32_t txMCFcnt;
752 uint32_t txBCFcnt;
753 uint32_t txUCBcnt;
754 uint32_t txMCBcnt;
755 uint32_t txBCBcnt;
756 uint32_t rxUCFcnt;
757 uint32_t rxMCFcnt;
758 uint32_t rxBCFcnt;
759 uint32_t rxUCBcnt;
760 uint32_t rxMCBcnt;
761 uint32_t rxBCBcnt;
762 uint32_t rxBcnt;
763 uint32_t rxBcntCRCok;
764 uint32_t rxRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800765} tSap_SoftapStats, *tpSap_SoftapStats;
Amar Singhal7a1726a2015-10-14 16:28:11 -0700766
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800767#ifdef FEATURE_WLAN_CH_AVOID
768/* Store channel safety information */
769typedef struct {
770 uint16_t channelNumber;
771 bool isSafe;
772} sapSafeChannelType;
773#endif /* FEATURE_WLAN_CH_AVOID */
Jeff Johnson2bc0b722017-09-25 08:51:43 -0700774
775/**
776 * struct sap_context - per-BSS Context for SAP
777 *
778 * struct sap_context is used to share per-BSS context between SAP and
Krunal Soni59437652017-11-21 13:42:14 -0800779 * its clients. A context is generated by sap_create_ctx() and is
Krunal Sonib5d18ae2017-11-20 21:52:35 -0800780 * destroyed by sap_destroy_ctx(). During the lifetime of the BSS the
Jeff Johnson2bc0b722017-09-25 08:51:43 -0700781 * SAP context is passed as the primary parameter to SAP APIs. Note
782 * that by design the contents of the structure are opaque to the
783 * clients and a SAP context pointer must only be dereferenced by SAP.
784 */
785struct sap_context;
786
787/**
Krunal Sonib5d18ae2017-11-20 21:52:35 -0800788 * wlansap_roam_callback() - API to get the events for SAP persona
789 * @pContext: sap context
790 * @pCsrRoamInfo: pointer to SME CSR roam info structure
791 * @roamId: roam id being used
792 * @roamStatus: status of the event reported by SME to SAP
793 * @roamResult: result of the event reported by SME to SAP
794 *
795 * Any activity like start_bss, stop_bss, and etc for SAP persona
796 * happens, SME reports the result of those events to SAP through this
797 * callback.
798 *
799 * Return: QDF_STATUS based on overall result
800 */
801QDF_STATUS wlansap_roam_callback(void *pContext,
802 struct csr_roam_info *pCsrRoamInfo,
803 uint32_t roamId,
804 eRoamCmdStatus roamStatus,
805 eCsrRoamResult roamResult);
806
807/**
Krunal Soni59437652017-11-21 13:42:14 -0800808 * sap_create_ctx() - API to create the sap context
Jeff Johnson2bc0b722017-09-25 08:51:43 -0700809 *
Krunal Soni59437652017-11-21 13:42:14 -0800810 * This API assigns the sap context from global sap context pool
811 * stored in gp_sap_ctx[i] array.
Jeff Johnson2bc0b722017-09-25 08:51:43 -0700812 *
813 * Return: Pointer to the SAP context, or NULL if a context could not
814 * be allocated
815 */
Krunal Soni59437652017-11-21 13:42:14 -0800816struct sap_context *sap_create_ctx(void);
Jeff Johnson2bc0b722017-09-25 08:51:43 -0700817
Jeff Johnson70955b52017-09-25 09:19:33 -0700818/**
Krunal Soni59437652017-11-21 13:42:14 -0800819 * sap_destroy_ctx - API to destroy the sap context
Jeff Johnsone13d8062017-09-28 06:54:55 -0700820 * @sap_ctx: Pointer to the SAP context
Jeff Johnson70955b52017-09-25 09:19:33 -0700821 *
Krunal Soni59437652017-11-21 13:42:14 -0800822 * This API puts back the given sap context to global sap context pool which
823 * makes current sap session's sap context invalid.
Jeff Johnson70955b52017-09-25 09:19:33 -0700824 *
825 * Return: The result code associated with performing the operation
826 * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
827 * access would cause a page fault
828 * QDF_STATUS_SUCCESS: Success
829 */
Krunal Soni59437652017-11-21 13:42:14 -0800830QDF_STATUS sap_destroy_ctx(struct sap_context *sap_ctx);
Jeff Johnson70955b52017-09-25 09:19:33 -0700831
Jeff Johnsond8b60572017-09-15 11:25:05 -0700832/**
Krunal Soni59437652017-11-21 13:42:14 -0800833 * sap_init_ctx - Initialize the sap context
Jeff Johnsone13d8062017-09-28 06:54:55 -0700834 * @sap_ctx: Pointer to the SAP context
Jeff Johnsond8b60572017-09-15 11:25:05 -0700835 * @mode: Device mode
836 * @addr: MAC address of the SAP
837 * @session_id: Pointer to the session id
838 *
Krunal Soni59437652017-11-21 13:42:14 -0800839 * sap_create_ctx() allocates the sap context which is uninitialized.
840 * This API needs to be called to properly initialize the sap context
841 * which is just created.
Jeff Johnsond8b60572017-09-15 11:25:05 -0700842 *
843 * Return: The result code associated with performing the operation
844 * QDF_STATUS_E_FAULT: BSS could not be started
845 * QDF_STATUS_SUCCESS: Success
846 */
Krunal Soni59437652017-11-21 13:42:14 -0800847QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx,
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800848 enum QDF_OPMODE mode,
Jeff Johnsond8b60572017-09-15 11:25:05 -0700849 uint8_t *addr, uint32_t session_id);
850
Jeff Johnson3d4c7102017-09-15 11:36:19 -0700851/**
Krunal Soni59437652017-11-21 13:42:14 -0800852 * sap_deinit_ctx() - De-initialize the sap context
Jeff Johnsone13d8062017-09-28 06:54:55 -0700853 * @sap_ctx: Pointer to the SAP context
Jeff Johnson3d4c7102017-09-15 11:36:19 -0700854 *
Krunal Soni59437652017-11-21 13:42:14 -0800855 * When SAP session is about to close, this API needs to be called
856 * to de-initialize all the members of sap context structure, so that
857 * nobody can accidently start using the sap context.
Jeff Johnson3d4c7102017-09-15 11:36:19 -0700858 *
859 * Return: The result code associated with performing the operation
860 * QDF_STATUS_E_FAULT: BSS could not be stopped
861 * QDF_STATUS_SUCCESS: Success
862 */
Krunal Soni59437652017-11-21 13:42:14 -0800863QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx);
Jeff Johnson3d4c7102017-09-15 11:36:19 -0700864
Jeff Johnsone5124bb2017-09-24 19:03:02 -0700865/**
bings394afdd2017-01-09 11:22:38 +0800866 * sap_is_auto_channel_select() - is channel AUTO_CHANNEL_SELECT
Jeff Johnsonbc110a72017-09-25 15:22:18 -0700867 * @sapcontext: Pointer to the SAP context
bings394afdd2017-01-09 11:22:38 +0800868 *
869 * Return: true on AUTO_CHANNEL_SELECT, false otherwise
870 */
Jeff Johnsonbc110a72017-09-25 15:22:18 -0700871bool sap_is_auto_channel_select(struct sap_context *sapcontext);
bings394afdd2017-01-09 11:22:38 +0800872
Manishekar Chandrasekaranf7a1dad2016-06-23 06:43:47 +0530873QDF_STATUS wlansap_global_init(void);
874QDF_STATUS wlansap_global_deinit(void);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530875typedef QDF_STATUS (*tpWLAN_SAPEventCB)(tpSap_Event pSapEvent,
Peng Xu66162de2016-02-11 17:01:20 -0800876 void *pUsrContext);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800877
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530878/**
879 * wlansap_is_channel_in_nol_list() - This API checks if channel is
880 * in nol list
Jeff Johnsone13d8062017-09-28 06:54:55 -0700881 * @sap_ctx: SAP context pointer
Jeff Johnsonbb4d77c2017-09-24 19:16:50 -0700882 * @channelNumber: channel number
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530883 * @chanBondState: channel bonding state
884 *
Jeff Johnsonbb4d77c2017-09-24 19:16:50 -0700885 * Return: True if the channel is in the NOL list, false otherwise
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530886 */
Jeff Johnsone13d8062017-09-28 06:54:55 -0700887bool wlansap_is_channel_in_nol_list(struct sap_context *sap_ctx,
Jeff Johnsonbb4d77c2017-09-24 19:16:50 -0700888 uint8_t channelNumber,
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530889 ePhyChanBondState chanBondState);
Jeff Johnsonbb4d77c2017-09-24 19:16:50 -0700890
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530891/**
892 * wlansap_is_channel_leaking_in_nol() - This API checks if channel is leaking
893 * in nol list
Jeff Johnson2f6013c2017-09-24 19:40:07 -0700894 * @sap_ctx: SAP context pointer
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530895 * @channel: channel
896 * @chan_bw: channel bandwidth
897 *
898 * Return: True/False
899 */
Jeff Johnson2f6013c2017-09-24 19:40:07 -0700900bool wlansap_is_channel_leaking_in_nol(struct sap_context *sap_ctx,
901 uint8_t channel,
Kapil Gupta94ca6f62016-12-11 18:43:12 +0530902 uint8_t chan_bw);
903
Jeff Johnsone2f7d542017-09-24 20:52:24 -0700904/**
905 * wlansap_start_bss() - start BSS
Jeff Johnsone13d8062017-09-28 06:54:55 -0700906 * @sap_ctx: Pointer to the SAP context
Jeff Johnsone2f7d542017-09-24 20:52:24 -0700907 * @pSapEventCallback: Callback function in HDD called by SAP to inform HDD
908 * about SAP results
909 * @pConfig: Pointer to configuration structure passed down from
910 * HDD(HostApd for Android)
911 * @pUsrContext: Parameter that will be passed back in all the SAP callback
912 * events.
913 *
914 * This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for
915 * starting AP BSS
916 *
917 * Return: The result code associated with performing the operation
918 * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
919 * access would cause a page fault
920 * QDF_STATUS_SUCCESS: Success
921 */
Jeff Johnsone13d8062017-09-28 06:54:55 -0700922QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
Jeff Johnsone2f7d542017-09-24 20:52:24 -0700923 tpWLAN_SAPEventCB pSapEventCallback,
924 tsap_Config_t *pConfig, void *pUsrContext);
Kapil Gupta8878ad92017-02-13 11:56:04 +0530925
926/**
Jeff Johnson16e29cd2017-09-24 21:01:19 -0700927 * wlansap_stop_bss() - stop BSS.
Jeff Johnsone13d8062017-09-28 06:54:55 -0700928 * @sap_ctx: Pointer to SAP context
Jeff Johnson16e29cd2017-09-24 21:01:19 -0700929 *
930 * This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for
931 * stopping AP BSS
932 *
933 * Return: The result code associated with performing the operation
934 * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
935 * access would cause a page fault
936 * QDF_STATUS_SUCCESS: Success
937 */
Jeff Johnsone13d8062017-09-28 06:54:55 -0700938QDF_STATUS wlansap_stop_bss(struct sap_context *sap_ctx);
Jeff Johnson16e29cd2017-09-24 21:01:19 -0700939
940/**
Kapil Gupta8878ad92017-02-13 11:56:04 +0530941 * wlan_sap_update_next_channel() - Update next channel configured using vendor
942 * command in SAP context
Jeff Johnsoncd1ee1e2017-09-25 14:50:49 -0700943 * @sap_ctx: SAP context
Kapil Gupta8878ad92017-02-13 11:56:04 +0530944 * @channel: channel number
945 * @chan_bw: channel width
946 *
947 * Return: QDF_STATUS
948 */
Jeff Johnsoncd1ee1e2017-09-25 14:50:49 -0700949QDF_STATUS wlan_sap_update_next_channel(struct sap_context *sap_ctx,
950 uint8_t channel,
951 enum phy_ch_width chan_bw);
952
Jeff Johnson108566e2017-09-25 14:54:35 -0700953/**
954 * wlan_sap_set_pre_cac_status() - Set the pre cac status
955 * @sap_ctx: SAP context
956 * @status: Status of pre cac
957 * @handle: Global MAC handle
958 *
959 * Sets the pre cac status in the MAC context and updates the state
960 *
961 * Return: QDF_STATUS
962 */
963QDF_STATUS wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx,
964 bool status, tHalHandle handle);
965
Jeff Johnson2cdcfdc2017-09-25 15:00:22 -0700966/**
967 * wlan_sap_set_chan_before_pre_cac() - Save the channel before pre cac
968 * @sap_ctx: SAP context
969 * @chan_before_pre_cac: Channel before pre cac
970 *
971 * Saves the channel that was in use before pre cac operation
972 *
973 * Return: QDF_STATUS
974 */
975QDF_STATUS wlan_sap_set_chan_before_pre_cac(struct sap_context *sap_ctx,
976 uint8_t chan_before_pre_cac);
977
Jeff Johnsona68cc532017-09-25 15:18:30 -0700978/**
979 * wlan_sap_set_pre_cac_complete_status() - Sets pre cac complete status
980 * @sap_ctx: SAP context
981 * @status: Status of pre cac complete
982 *
983 * Sets the status of pre cac i.e., whether pre cac is complete or not
984 *
985 * Return: QDF_STATUS
986 */
987QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
988 bool status);
989
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530990bool wlan_sap_is_pre_cac_active(tHalHandle handle);
991QDF_STATUS wlan_sap_get_pre_cac_vdev_id(tHalHandle handle, uint8_t *vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800992#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnson5e6b0d22017-09-24 19:52:34 -0700993/**
994 * wlansap_check_cc_intf() - Get interfering concurrent channel
Jeff Johnsone13d8062017-09-28 06:54:55 -0700995 * @sap_ctx: SAP context pointer
Jeff Johnson5e6b0d22017-09-24 19:52:34 -0700996 *
997 * Determine if a Concurrent Channel is interfering.
998 *
999 * Return: Channel number of the interfering channel, or 0 if none.
1000 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001001uint16_t wlansap_check_cc_intf(struct sap_context *sap_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001002#endif
Jeff Johnson65dd6d92017-09-24 21:12:49 -07001003
1004/**
1005 * wlansap_set_mac_acl() - set MAC list entry in ACL.
Jeff Johnsone13d8062017-09-28 06:54:55 -07001006 * @sap_ctx: Pointer to the SAP context
Jeff Johnson65dd6d92017-09-24 21:12:49 -07001007 * @pConfig: Pointer to SAP config.
1008 *
1009 * This api function provides SAP to set mac list entry in accept list as well
1010 * as deny list
1011 *
1012 * Return: The result code associated with performing the operation
1013 * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
1014 * access would cause a page fault
1015 * QDF_STATUS_SUCCESS: Success
1016 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001017QDF_STATUS wlansap_set_mac_acl(struct sap_context *sap_ctx,
Jeff Johnson65dd6d92017-09-24 21:12:49 -07001018 tsap_Config_t *pConfig);
Jeff Johnson16e29cd2017-09-24 21:01:19 -07001019
Jeff Johnson92e867c2017-09-25 13:58:52 -07001020/**
1021 * wlansap_disassoc_sta() - initiate disassociation of station.
Jeff Johnsone13d8062017-09-28 06:54:55 -07001022 * @sap_ctx: Pointer to the SAP context
Jeff Johnson92e867c2017-09-25 13:58:52 -07001023 * @p_del_sta_params: pointer to station deletion parameters
1024 *
1025 * This api function provides for Ap App/HDD initiated disassociation of station
1026 *
1027 * Return: The QDF_STATUS code associated with performing the operation
1028 * QDF_STATUS_SUCCESS: Success
1029 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001030QDF_STATUS wlansap_disassoc_sta(struct sap_context *sap_ctx,
Jeff Johnsone6bf7192017-11-07 15:16:09 -08001031 struct csr_del_sta_params *p_del_sta_params);
Jeff Johnson92e867c2017-09-25 13:58:52 -07001032
Jeff Johnsone7ff1d02017-09-25 14:03:34 -07001033/**
1034 * wlansap_deauth_sta() - Ap App/HDD initiated deauthentication of station
1035 * @pStaCtx : Pointer to the SAP context
1036 * @pDelStaParams : Pointer to parameters of the station to deauthenticate
1037 *
1038 * This api function provides for Ap App/HDD initiated deauthentication of
1039 * station
1040 *
1041 * Return: The QDF_STATUS code associated with performing the operation
1042 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001043QDF_STATUS wlansap_deauth_sta(struct sap_context *sap_ctx,
Jeff Johnsone6bf7192017-11-07 15:16:09 -08001044 struct csr_del_sta_params *pDelStaParams);
Jeff Johnsone7ff1d02017-09-25 14:03:34 -07001045
Jeff Johnson52a2ce32017-09-25 14:13:27 -07001046/**
1047 * wlansap_set_channel_change_with_csa() - Set channel change with CSA
1048 * @sapContext: Pointer to SAP context
1049 * @targetChannel: Target channel
1050 * @target_bw: Target bandwidth
1051 * @strict: if true switch to the requested channel always, fail
1052 * otherwise
1053 *
1054 * This api function does a channel change to the target channel specified.
1055 * CSA IE is included in the beacons before doing a channel change.
1056 *
1057 * Return: QDF_STATUS
1058 */
1059QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sapContext,
1060 uint32_t targetChannel,
1061 enum phy_ch_width target_bw,
1062 bool strict);
1063
Jeff Johnsone6b25d92017-09-25 14:30:32 -07001064/**
1065 * wlansap_set_key_sta() - set keys for a stations.
Jeff Johnsone13d8062017-09-28 06:54:55 -07001066 * @sap_ctx: Pointer to the SAP context
Jeff Johnsone6b25d92017-09-25 14:30:32 -07001067 * @pSetKeyInfo : tCsrRoamSetKey structure for the station
1068 *
1069 * This api function provides for Ap App/HDD to set key for a station.
1070 *
1071 * Return: The QDF_STATUS code associated with performing the operation
1072 * QDF_STATUS_SUCCESS: Success
1073 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001074QDF_STATUS wlansap_set_key_sta(struct sap_context *sap_ctx,
Jeff Johnsone6b25d92017-09-25 14:30:32 -07001075 tCsrRoamSetKey *pSetKeyInfo);
Jeff Johnson617fe642017-09-24 17:52:51 -07001076
1077/**
1078 * wlan_sap_getstation_ie_information() - RSNIE Population
1079 * @sap_ctx: Pointer to the SAP context
1080 * @len: Length of @buf
1081 * @buf: RSNIE IE data
1082 *
1083 * Populate RSN IE from CSR to HDD context
1084 *
1085 * Return: QDF_STATUS enumeration
1086 */
1087
1088QDF_STATUS wlan_sap_getstation_ie_information(struct sap_context *sap_ctx,
1089 uint32_t *len, uint8_t *buf);
1090
Jeff Johnson31d1a742017-09-25 13:53:29 -07001091/**
1092 * wlansap_clear_acl() - Clear all ACLs
Jeff Johnsone13d8062017-09-28 06:54:55 -07001093 * @sap_ctx: Pointer to the SAP context
Jeff Johnson31d1a742017-09-25 13:53:29 -07001094 *
1095 * Return: QDF_STATUS. If success the ACLs were cleared, otherwise an
1096 * error occurred.
1097 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001098QDF_STATUS wlansap_clear_acl(struct sap_context *sap_ctx);
Jeff Johnson878f6d52017-09-25 08:28:53 -07001099
1100/**
1101 * wlansap_get_acl_accept_list() - Get ACL accept list
Jeff Johnsone13d8062017-09-28 06:54:55 -07001102 * @sap_ctx: Pointer to the SAP context
Jeff Johnson878f6d52017-09-25 08:28:53 -07001103 * @pAcceptList: Pointer to the buffer to store the ACL accept list
1104 * @nAcceptList: Pointer to the location to store the number of
1105 * entries in the ACL accept list.
1106 *
1107 * Return: QDF_STATUS. If success the data was returned, otherwise an
1108 * error occurred.
1109 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001110QDF_STATUS wlansap_get_acl_accept_list(struct sap_context *sap_ctx,
Jeff Johnson878f6d52017-09-25 08:28:53 -07001111 struct qdf_mac_addr *pAcceptList,
1112 uint8_t *nAcceptList);
1113
Jeff Johnson49c819f2017-09-25 13:48:36 -07001114/**
1115 * wlansap_get_acl_deny_list() - Get ACL deny list
Jeff Johnsone13d8062017-09-28 06:54:55 -07001116 * @sap_ctx: Pointer to the SAP context
Jeff Johnson49c819f2017-09-25 13:48:36 -07001117 * @pDenyList: Pointer to the buffer to store the ACL deny list
1118 * @nDenyList: Pointer to the location to store the number of
1119 * entries in the ACL deny list.
1120 *
1121 * Return: QDF_STATUS. If success the data was returned, otherwise an
1122 * error occurred.
1123 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001124QDF_STATUS wlansap_get_acl_deny_list(struct sap_context *sap_ctx,
Jeff Johnson49c819f2017-09-25 13:48:36 -07001125 struct qdf_mac_addr *pDenyList,
1126 uint8_t *nDenyList);
Jeff Johnsonf8ac7372017-09-24 21:24:25 -07001127
1128/**
1129 * wlansap_set_acl_mode() - Set the SAP ACL mode
Jeff Johnsone13d8062017-09-28 06:54:55 -07001130 * @sap_ctx: The SAP context pointer
Jeff Johnsonf8ac7372017-09-24 21:24:25 -07001131 * @mode: the desired ACL mode
1132 *
1133 * Return: QDF_STATUS
1134 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001135QDF_STATUS wlansap_set_acl_mode(struct sap_context *sap_ctx,
Jeff Johnsonf8ac7372017-09-24 21:24:25 -07001136 eSapMacAddrACL mode);
1137
Jeff Johnson1030f8c2017-09-24 21:33:40 -07001138/**
1139 * wlansap_get_acl_mode() - Get the SAP ACL mode
Jeff Johnsone13d8062017-09-28 06:54:55 -07001140 * @sap_ctx: The SAP context pointer
Jeff Johnson1030f8c2017-09-24 21:33:40 -07001141 * @mode: Pointer where to return the current ACL mode
1142 *
1143 * Return: QDF_STATUS
1144 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001145QDF_STATUS wlansap_get_acl_mode(struct sap_context *sap_ctx,
Jeff Johnson1030f8c2017-09-24 21:33:40 -07001146 eSapMacAddrACL *mode);
Jeff Johnson42fbe2f2017-09-24 17:42:11 -07001147
1148/**
1149 * wlansap_modify_acl() - Update ACL entries
1150 * @sap_ctx: Pointer to the SAP context
1151 * @peer_sta_mac: peer sta mac to be updated.
1152 * @list_type: white/Black list type.
1153 * @cmd: command to be executed on ACL.
1154 *
1155 * This function is called when a peer needs to be added or deleted from the
1156 * white/black ACL
1157 *
1158 * Return: Status
1159 */
1160QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
1161 uint8_t *peer_sta_mac,
1162 eSapACLType list_type, eSapACLCmdType cmd);
1163
Jeff Johnson730c2502017-09-25 14:33:45 -07001164/**
Jeff Johnson4a7ff432017-09-24 18:10:00 -07001165 * wlansap_register_mgmt_frame() - register management frame
Jeff Johnsone13d8062017-09-28 06:54:55 -07001166 * @sap_ctx: Pointer to SAP context
Jeff Johnson4a7ff432017-09-24 18:10:00 -07001167 * @frame_type: frame type that needs to be registered with PE.
1168 * @match_data: pointer to data which should be matched after @frame_type
1169 * is matched.
1170 * @match_len: Length of the @match_data
1171 *
1172 * HDD use this API to register specified type of frame with CORE stack.
1173 * On receiving such kind of frame CORE stack should pass this frame to HDD
1174 *
1175 * Return: The QDF_STATUS code associated with performing the operation
1176 * QDF_STATUS_SUCCESS: Success and error code otherwise
1177 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001178QDF_STATUS wlansap_register_mgmt_frame(struct sap_context *sap_ctx,
Jeff Johnson4a7ff432017-09-24 18:10:00 -07001179 uint16_t frame_type,
1180 uint8_t *match_data,
1181 uint16_t match_len);
1182
Jeff Johnson42e7c402017-09-24 18:18:10 -07001183/**
1184 * wlansap_de_register_mgmt_frame() - de register management frame
Jeff Johnsone13d8062017-09-28 06:54:55 -07001185 * @sap_ctx: Pointer to SAP context
Jeff Johnson42e7c402017-09-24 18:18:10 -07001186 * @frame_type: frame type that needs to be de-registered with PE.
1187 * @match_data: pointer to data which should be matched after @frame_type
1188 * is matched.
1189 * @match_len: Length of the @match_data
1190 *
1191 * HDD use this API to deregister a previously registered frame
1192 *
1193 * Return: The QDF_STATUS code associated with performing the operation
1194 * QDF_STATUS_SUCCESS: Success and error code otherwise
1195 */
Jeff Johnsone13d8062017-09-28 06:54:55 -07001196QDF_STATUS wlansap_de_register_mgmt_frame(struct sap_context *sap_ctx,
Jeff Johnson42e7c402017-09-24 18:18:10 -07001197 uint16_t frame_type,
1198 uint8_t *match_data,
1199 uint16_t match_len);
1200
Jeff Johnson164b3bb2017-09-25 19:34:14 -07001201/**
1202 * wlansap_channel_change_request() - Send channel change request
1203 * @sapContext: Pointer to the SAP context
1204 * @target_channel: Target channel
1205 *
1206 * This API is used to send an Indication to SME/PE to change the
1207 * current operating channel to a different target channel.
1208 *
1209 * The Channel change will be issued by SAP under the following
1210 * scenarios.
1211 * 1. A radar indication is received during SAP CAC WAIT STATE and
1212 * channel change is required.
1213 * 2. A radar indication is received during SAP STARTED STATE and
1214 * channel change is required.
1215 *
1216 * Return: The QDF_STATUS code associated with performing the operation
1217 * QDF_STATUS_SUCCESS: Success
1218 *
1219 */
1220QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext,
1221 uint8_t target_channel);
Jeff Johnson3abdd242017-09-25 19:21:33 -07001222
1223/**
1224 * wlansap_start_beacon_req() - Send Start Beaconing Request
1225 * @sap_ctx: Pointer to the SAP context
1226 *
1227 * This API is used to send an Indication to SME/PE to start
1228 * beaconing on the current operating channel.
1229 *
1230 * When SAP is started on DFS channel and when ADD BSS RESP is received
1231 * LIM temporarily holds off Beaconing for SAP to do CAC WAIT. When
1232 * CAC WAIT is done SAP resumes the Beacon Tx by sending a start beacon
1233 * request to LIM.
1234 *
1235 * Return: The QDF_STATUS code associated with performing the operation
1236 * QDF_STATUS_SUCCESS: Success
1237 */
1238QDF_STATUS wlansap_start_beacon_req(struct sap_context *sap_ctx);
Jeff Johnsonbfeafc62017-09-25 18:50:01 -07001239
1240/**
1241 * wlansap_dfs_send_csa_ie_request() - Send CSA IE
1242 * @sap_ctx: Pointer to the SAP context
1243 *
1244 * This API is used to send channel switch announcement request to PE
1245 *
1246 * Return: The QDF_STATUS code associated with performing the operation
1247 * QDF_STATUS_SUCCESS: Success
1248 */
1249QDF_STATUS wlansap_dfs_send_csa_ie_request(struct sap_context *sap_ctx);
1250
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301251QDF_STATUS wlansap_get_dfs_ignore_cac(tHalHandle hHal, uint8_t *pIgnore_cac);
1252QDF_STATUS wlansap_set_dfs_ignore_cac(tHalHandle hHal, uint8_t ignore_cac);
1253QDF_STATUS wlansap_set_dfs_restrict_japan_w53(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001254 uint8_t disable_Dfs_JapanW3);
1255
1256#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301257QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001258wlan_sap_set_channel_avoidance(tHalHandle hal, bool sap_channel_avoidance);
1259#endif
1260
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301261QDF_STATUS wlansap_set_dfs_preferred_channel_location(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001262 uint8_t dfs_Preferred_Channels_location);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301263QDF_STATUS wlansap_set_dfs_target_chnl(tHalHandle hHal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264 uint8_t target_channel);
bings58ce8622017-07-10 15:55:36 +08001265
1266/**
Nachiket Kukaded9152832017-10-16 16:18:22 +05301267 * wlan_sap_get_roam_profile() - Returns sap roam profile.
1268 * @sap_ctx: Pointer to Sap Context.
1269 *
1270 * This function provides the SAP roam profile.
1271 *
1272 * Return: SAP RoamProfile
1273 */
Jeff Johnson66ee8a92018-03-17 15:24:26 -07001274struct csr_roam_profile *wlan_sap_get_roam_profile(struct sap_context *sap_ctx);
Nachiket Kukaded9152832017-10-16 16:18:22 +05301275
1276/**
bings58ce8622017-07-10 15:55:36 +08001277 * wlan_sap_get_phymode() - Returns sap phymode.
Jeff Johnsonebb7f0a2017-09-24 20:00:13 -07001278 * @sap_ctx: Pointer to Sap Context.
bings58ce8622017-07-10 15:55:36 +08001279 *
1280 * This function provides the SAP current phymode.
1281 *
1282 * Return: phymode
1283 */
Jeff Johnsonebb7f0a2017-09-24 20:00:13 -07001284eCsrPhyMode wlan_sap_get_phymode(struct sap_context *sap_ctx);
1285
Jeff Johnsonee7a3932017-09-24 20:17:55 -07001286/**
1287 * wlan_sap_get_vht_ch_width() - Returns SAP VHT channel width.
1288 * @sap_ctx: Pointer to Sap Context
1289 *
1290 * This function provides the SAP current VHT channel with.
1291 *
1292 * Return: VHT channel width
1293 */
1294uint32_t wlan_sap_get_vht_ch_width(struct sap_context *sap_ctx);
1295
Jeff Johnson2de14da2017-09-24 20:23:37 -07001296/**
1297 * wlan_sap_set_vht_ch_width() - Sets SAP VHT channel width.
1298 * @sap_ctx: Pointer to Sap Context
1299 * @vht_channel_width: SAP VHT channel width value.
1300 *
1301 * This function sets the SAP current VHT channel width.
1302 *
1303 * Return: None
1304 */
1305void wlan_sap_set_vht_ch_width(struct sap_context *sap_ctx,
1306 uint32_t vht_channel_width);
1307
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301308QDF_STATUS wlansap_update_sap_config_add_ie(tsap_Config_t *pConfig,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001309 const uint8_t *
1310 pAdditionIEBuffer,
1311 uint16_t additionIELength,
1312 eUpdateIEsType updateType);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301313QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_Config_t *pConfig,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001314 eUpdateIEsType updateType);
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07001315void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
1316 uint8_t *endChannelNum, uint8_t *bandStartChannel,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001317 uint8_t *bandEndChannel);
Jeff Johnsonb26e2702017-09-25 18:31:14 -07001318
1319/**
Arif Hussaincd151632017-02-11 16:57:19 -08001320 * wlansap_set_dfs_nol() - Set dfs nol
1321 * @sap_ctx: SAP context
1322 * @conf: set type
1323 *
1324 * Return: QDF_STATUS
1325 */
Wen Gong01a2c632018-04-11 18:34:55 +08001326#ifdef DFS_COMPONENT_ENABLE
Jeff Johnsonb3c4f7e2017-09-25 18:23:05 -07001327QDF_STATUS wlansap_set_dfs_nol(struct sap_context *sap_ctx,
1328 eSapDfsNolType conf);
Wen Gong01a2c632018-04-11 18:34:55 +08001329#else
1330static inline QDF_STATUS wlansap_set_dfs_nol(struct sap_context *sap_ctx,
1331 eSapDfsNolType conf)
1332{
1333 return QDF_STATUS_SUCCESS;
1334}
1335#endif
Kapil Gupta8878ad92017-02-13 11:56:04 +05301336
1337/**
1338 * wlan_sap_set_vendor_acs() - Set vendor specific acs in sap context
Jeff Johnsoned4ed172017-09-25 18:36:16 -07001339 * @sap_context: SAP context
Kapil Gupta8878ad92017-02-13 11:56:04 +05301340 * @is_vendor_acs: if vendor specific acs is enabled
1341 *
1342 * Return: QDF_STATUS
1343 */
Jeff Johnsoned4ed172017-09-25 18:36:16 -07001344QDF_STATUS wlan_sap_set_vendor_acs(struct sap_context *sap_context,
1345 bool is_vendor_acs);
1346
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001347void wlansap_populate_del_sta_params(const uint8_t *mac,
1348 uint16_t reason_code,
1349 uint8_t subtype,
Jeff Johnsone6bf7192017-11-07 15:16:09 -08001350 struct csr_del_sta_params *pDelStaParams);
Jeff Johnson630fd6a2017-09-25 15:27:39 -07001351
1352/**
1353 * wlansap_acs_chselect() - Initiates acs channel selection
1354 * @sap_context: Pointer to SAP context structure
1355 * @pacs_event_callback: Callback function in hdd called by sap
1356 * to inform hdd about channel selection result
1357 * @pconfig: Pointer to configuration structure
1358 * passed down from hdd
1359 * @pusr_context: Parameter that will be passed back in all
1360 * the sap callback events.
1361 *
1362 * This function serves as an api for hdd to initiate acs scan pre
1363 * start bss.
1364 *
1365 * Return: The QDF_STATUS code associated with performing the operation.
1366 */
1367QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
1368 tpWLAN_SAPEventCB pacs_event_callback,
1369 tsap_Config_t *pconfig,
1370 void *pusr_context);
Yingying Tangb4832f72016-10-20 13:44:55 +08001371
Jeff Johnson92675a52017-09-25 15:35:19 -07001372/**
1373 * wlansap_get_chan_width() - get sap channel width.
1374 * @sap_ctx: pointer to the SAP context
1375 *
1376 * This function get channel width of sap.
1377 *
1378 * Return: sap channel width
1379 */
1380uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx);
Kai Liubdd5fcb2016-09-28 22:55:44 +08001381
bings1826d9c2018-01-23 16:14:01 +08001382/**
1383 * wlansap_set_tx_leakage_threshold() - set sap tx leakage threshold.
1384 * @hal: HAL pointer
1385 * @tx_leakage_threshold: sap tx leakage threshold
1386 *
1387 * This function set sap tx leakage threshold.
1388 *
1389 * Return: QDF_STATUS.
1390 */
Yingying Tangb4832f72016-10-20 13:44:55 +08001391QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
1392 uint16_t tx_leakage_threshold);
Wu Gao36717432016-11-21 15:09:48 +08001393
Jeff Johnson104433a2017-09-25 15:39:43 -07001394/*
1395 * wlansap_set_invalid_session() - set session ID to invalid
1396 * @sap_ctx: pointer to the SAP context
1397 *
1398 * This function sets session ID to invalid
1399 *
1400 * Return: QDF_STATUS
1401 */
1402QDF_STATUS wlansap_set_invalid_session(struct sap_context *sap_ctx);
Wu Gao36717432016-11-21 15:09:48 +08001403
Arif Hussaincd151632017-02-11 16:57:19 -08001404/**
1405 * sap_dfs_set_current_channel() - Set current channel params in dfs component
1406 * @sap_ctx: sap context
1407 *
1408 * Set current channel params in dfs component, this info will be used to mark
1409 * the channels in nol when radar is detected.
1410 *
1411 * Return: None
1412 */
1413void sap_dfs_set_current_channel(void *sap_ctx);
Wu Gao3545e642017-07-14 19:24:41 +08001414
1415/**
1416 * wlansap_cleanup_cac_timer() - Force cleanup DFS CAC timer
1417 * @sap_ctx: sap context
1418 *
1419 * Force cleanup DFS CAC timer when reset all adapters. It will not
1420 * check concurrency SAP since just called when reset all adapters.
1421 *
1422 * Return: None
1423 */
Jeff Johnson14ec0682017-09-25 15:44:03 -07001424void wlansap_cleanup_cac_timer(struct sap_context *sap_ctx);
Wu Gao3545e642017-07-14 19:24:41 +08001425
Vignesh Viswanathan200f5c12018-02-27 14:01:59 +05301426/**
1427 * wlansap_set_stop_bss_inprogress - sets the stop_bss_in_progress flag
1428 *
1429 * @sap_ctx: Pointer to the global SAP ctx
1430 * @in_progress: the value to be set to the stop_bss_in_progress_flag
1431 *
1432 * This function sets the value in in_progress parameter to the
1433 * stop_bss_in_progress flag in sap_context.
1434 *
1435 * Return: None
1436 */
1437void wlansap_set_stop_bss_inprogress(struct sap_context *sap_ctx,
1438 bool in_progress);
1439
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001440#ifdef __cplusplus
1441}
1442#endif
1443#endif /* #ifndef WLAN_QCT_WLANSAP_H */