blob: 9bce575d6b5e521f11af8e15851342ed623313b7 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Amar Singhal7a1726a2015-10-14 16:28:11 -07002 * Copyright (c) 2011-2016 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/** ------------------------------------------------------------------------- *
29 ------------------------------------------------------------------------- *
30
31 \file csr_inside_api.h
32
33 Define interface only used by CSR.
34 ========================================================================== */
35#ifndef CSR_INSIDE_API_H__
36#define CSR_INSIDE_API_H__
37
38#include "csr_support.h"
39#include "sme_inside.h"
40#include "cds_reg_service.h"
41
42#define CSR_PASSIVE_MAX_CHANNEL_TIME 110
43#define CSR_PASSIVE_MIN_CHANNEL_TIME 60
44
45#define CSR_ACTIVE_MAX_CHANNEL_TIME 40
46#define CSR_ACTIVE_MIN_CHANNEL_TIME 20
47
48#ifdef WLAN_AP_STA_CONCURRENCY
49#define CSR_PASSIVE_MAX_CHANNEL_TIME_CONC 110
50#define CSR_PASSIVE_MIN_CHANNEL_TIME_CONC 60
51
52#define CSR_ACTIVE_MAX_CHANNEL_TIME_CONC 27
53#define CSR_ACTIVE_MIN_CHANNEL_TIME_CONC 20
54
55#define CSR_REST_TIME_CONC 100
Agrawal Ashish17bb3902016-05-05 13:29:40 +053056#define CSR_MIN_REST_TIME_CONC 50
57#define CSR_IDLE_TIME_CONC 25
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058
59#define CSR_NUM_STA_CHAN_COMBINED_CONC 3
60#define CSR_NUM_P2P_CHAN_COMBINED_CONC 1
61#endif
62
63#define CSR_MAX_NUM_SUPPORTED_CHANNELS 55
64
65#define CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS 14
66
67#define CSR_MAX_BSS_SUPPORT 300
68#define SYSTEM_TIME_MSEC_TO_USEC 1000
69
70/* This number minus 1 means the number of times a channel is scanned before a BSS is remvoed from */
71/* cache scan result */
72#define CSR_AGING_COUNT 3
Anurag Chouhan210db072016-02-22 18:42:15 +053073#define CSR_SCAN_GET_RESULT_INTERVAL (5 * QDF_MC_TIMER_TO_SEC_UNIT) /* 5 seconds */
74#define CSR_MIC_ERROR_TIMEOUT (60 * QDF_MC_TIMER_TO_SEC_UNIT) /* 60 seconds */
75#define CSR_TKIP_COUNTER_MEASURE_TIMEOUT (60 * QDF_MC_TIMER_TO_SEC_UNIT) /* 60 seconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080076
Anurag Chouhan210db072016-02-22 18:42:15 +053077#define CSR_SCAN_RESULT_CFG_AGING_INTERVAL (QDF_MC_TIMER_TO_SEC_UNIT) /* 1 second */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080078/* the following defines are NOT used by palTimer */
79#define CSR_SCAN_AGING_TIME_NOT_CONNECT_NO_PS 50 /* 50 seconds */
80#define CSR_SCAN_AGING_TIME_NOT_CONNECT_W_PS 300 /* 300 seconds */
81#define CSR_SCAN_AGING_TIME_CONNECT_NO_PS 150 /* 150 seconds */
82#define CSR_SCAN_AGING_TIME_CONNECT_W_PS 600 /* 600 seconds */
83#define CSR_JOIN_FAILURE_TIMEOUT_DEFAULT (3000)
84#define CSR_JOIN_FAILURE_TIMEOUT_MIN (1000) /* minimal value */
85/* These are going against the signed RSSI (int8_t) so it is between -+127 */
86#define CSR_BEST_RSSI_VALUE (-30) /* RSSI >= this is in CAT4 */
87#define CSR_DEFAULT_RSSI_DB_GAP 30 /* every 30 dbm for one category */
88#define CSR_BSS_CAP_VALUE_NONE 0 /* not much value */
89#define CSR_BSS_CAP_VALUE_HT 1
90#define CSR_BSS_CAP_VALUE_VHT 2
91#define CSR_BSS_CAP_VALUE_WMM 1
92#define CSR_BSS_CAP_VALUE_UAPSD 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080093#define CSR_BSS_CAP_VALUE_5GHZ 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080094#define CSR_DEFAULT_ROAMING_TIME 10 /* 10 seconds */
95
96#define CSR_ROAMING_DFS_CHANNEL_DISABLED (0)
97#define CSR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL (1)
98#define CSR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE (2)
99
100/* ***************************************************************************
101 * The MAX BSSID Count should be lower than the command timeout value and it
102 * can be of a fraction of 3/4 of the total command timeout value.
103 * ***************************************************************************/
104#define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE (1000*30*4)
Sandeep Puligilla1ed781f2016-03-16 12:18:50 -0700105#ifdef QCA_WIFI_3_0_EMU
106#define CSR_ACTIVE_SCAN_LIST_CMD_TIMEOUT (1000*30*20)
107#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800108#define CSR_ACTIVE_SCAN_LIST_CMD_TIMEOUT (1000*30)
Sandeep Puligilla1ed781f2016-03-16 12:18:50 -0700109#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800110#define CSR_MAX_BSSID_COUNT ((CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE/4000) * 3)
111#define CSR_CUSTOM_CONC_GO_BI 100
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800112
113typedef enum {
114 eCsrNextScanNothing,
115 eCsrNextLostLinkScan1Success,
116 eCsrNextLostLinkScan1Failed,
117 eCsrNextLostLinkScan2Success,
118 eCsrNextLostLinkScan2Failed,
119 eCsrNextLostLinkScan3Success,
120 eCsrNexteScanForSsidSuccess,
121 eCsrNextLostLinkScan3Failed,
122 eCsrNext11dScan1Failure,
123 eCsrNext11dScan1Success,
124 eCsrNext11dScan2Failure,
125 eCsrNext11dScan2Success,
126 eCsrNext11dScanComplete,
127 eCsrNexteScanForSsidFailure,
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +0530128 eCsrNextCheckAllowConc,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129
130} eCsrScanCompleteNextCommand;
131
132typedef enum {
133 eCsrJoinSuccess,
134 eCsrJoinFailure,
135 eCsrReassocSuccess,
136 eCsrReassocFailure,
137 eCsrNothingToJoin,
138 eCsrStartBssSuccess,
139 eCsrStartBssFailure,
140 eCsrSilentlyStopRoaming,
141 eCsrSilentlyStopRoamingSaveState,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142 eCsrJoinFailureDueToConcurrency,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -0700143 eCsrStopBssSuccess,
144 eCsrStopBssFailure,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800145} eCsrRoamCompleteResult;
146
147typedef struct tagScanReqParam {
148 uint8_t bReturnAfter1stMatch;
149 uint8_t fUniqueResult;
150 uint8_t freshScan;
151 uint8_t hiddenSsid;
152 uint8_t reserved;
153} tScanReqParam;
154
155typedef struct tagCsrScanResult {
156 tListElem Link;
157 int32_t AgingCount; /* This BSS is removed when it reaches 0 or less */
158 uint32_t preferValue; /* The bigger the number, the better the BSS. This value override capValue */
159 uint32_t capValue; /* The biggger the better. This value is in use only if we have equal preferValue */
160 /* This member must be the last in the structure because the end of tSirBssDescription (inside) is an */
161 /* array with nonknown size at this time */
162
163 eCsrEncryptionType ucEncryptionType; /* Preferred Encryption type that matched with profile. */
164 eCsrEncryptionType mcEncryptionType;
165 eCsrAuthType authType; /* Preferred auth type that matched with the profile. */
166
167 tCsrScanResultInfo Result;
168} tCsrScanResult;
169
170typedef struct {
171 tDblLinkList List;
172 tListElem *pCurEntry;
173} tScanResultList;
174
175#define CSR_IS_ROAM_REASON(pCmd, reason) ((reason) == (pCmd)->roamCmd.roamReason)
176#define CSR_IS_BETTER_PREFER_VALUE(v1, v2) ((v1) > (v2))
177#define CSR_IS_EQUAL_PREFER_VALUE(v1, v2) ((v1) == (v2))
178#define CSR_IS_BETTER_CAP_VALUE(v1, v2) ((v1) > (v2))
179#define CSR_IS_EQUAL_CAP_VALUE(v1, v2) ((v1) == (v2))
180#define CSR_IS_BETTER_RSSI(v1, v2) ((v1) > (v2))
181#define CSR_IS_ENC_TYPE_STATIC(encType) ((eCSR_ENCRYPT_TYPE_NONE == (encType)) || \
182 (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == (encType)) || \
183 (eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == (encType)))
184#define CSR_IS_WAIT_FOR_KEY(pMac, sessionId) \
185 (CSR_IS_ROAM_JOINED(pMac, sessionId) && \
186 CSR_IS_ROAM_SUBSTATE_WAITFORKEY(pMac, sessionId))
187/* WIFI has a test case for not using HT rates with TKIP as encryption */
188/* We may need to add WEP but for now, TKIP only. */
189
190#define CSR_IS_11n_ALLOWED(encType) ((eCSR_ENCRYPT_TYPE_TKIP != (encType)) && \
191 (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY != (encType)) && \
192 (eCSR_ENCRYPT_TYPE_WEP104_STATICKEY != (encType)) && \
193 (eCSR_ENCRYPT_TYPE_WEP40 != (encType)) && \
194 (eCSR_ENCRYPT_TYPE_WEP104 != (encType)))
195
196#define CSR_IS_DISCONNECT_COMMAND(pCommand) ((eSmeCommandRoam == (pCommand)->command) && \
197 ((eCsrForcedDisassoc == (pCommand)->u.roamCmd.roamReason) || \
198 (eCsrForcedDeauth == (pCommand)->u.roamCmd.roamReason) || \
199 (eCsrSmeIssuedDisassocForHandoff == \
200 (pCommand)->u.roamCmd.roamReason) || \
201 (eCsrForcedDisassocMICFailure == \
202 (pCommand)->u.roamCmd.roamReason)))
203
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800204eCsrRoamState csr_roam_state_change(tpAniSirGlobal pMac,
205 eCsrRoamState NewRoamState, uint8_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530206QDF_STATUS csr_scanning_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800207void csr_roaming_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf);
208void csr_roam_joined_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf);
209bool csr_scan_complete(tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp);
210void csr_release_command_roam(tpAniSirGlobal pMac, tSmeCmd *pCommand);
211void csr_release_command_scan(tpAniSirGlobal pMac, tSmeCmd *pCommand);
212void csr_release_command_wm_status_change(tpAniSirGlobal pMac, tSmeCmd *pCommand);
213extern void csr_release_roc_req_cmd(tpAniSirGlobal mac_ctx);
214
215bool csr_is_duplicate_bss_description(tpAniSirGlobal pMac,
216 tSirBssDescription *pSirBssDesc1,
217 tSirBssDescription *pSirBssDesc2,
218 tDot11fBeaconIEs *pIes2, bool fForced);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530219QDF_STATUS csr_roam_save_connected_bss_desc(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800220 tSirBssDescription *pBssDesc);
221bool csr_is_network_type_equal(tSirBssDescription *pSirBssDesc1,
222 tSirBssDescription *pSirBssDesc2);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530223QDF_STATUS csr_scan_sme_scan_response(tpAniSirGlobal pMac, void *pMsgBuf);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800224/*
225 Prepare a filter base on a profile for parsing the scan results.
226 Upon successful return, caller MUST call csr_free_scan_filter on
227 pScanFilter when it is done with the filter.
228 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530229QDF_STATUS csr_roam_prepare_filter_from_profile(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800230 tCsrRoamProfile *pProfile,
231 tCsrScanResultFilter *pScanFilter);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530232QDF_STATUS csr_roam_copy_profile(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233 tCsrRoamProfile *pDstProfile,
234 tCsrRoamProfile *pSrcProfile);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530235QDF_STATUS csr_roam_start(tpAniSirGlobal pMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800236void csr_roam_stop(tpAniSirGlobal pMac, uint32_t sessionId);
237void csr_roam_startMICFailureTimer(tpAniSirGlobal pMac);
238void csr_roam_stopMICFailureTimer(tpAniSirGlobal pMac);
239void csr_roam_startTKIPCounterMeasureTimer(tpAniSirGlobal pMac);
240void csr_roam_stopTKIPCounterMeasureTimer(tpAniSirGlobal pMac);
241
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530242QDF_STATUS csr_scan_open(tpAniSirGlobal pMac);
243QDF_STATUS csr_scan_close(tpAniSirGlobal pMac);
244QDF_STATUS csr_scan_request_lost_link1(tpAniSirGlobal pMac, uint32_t sessionId);
245QDF_STATUS csr_scan_request_lost_link2(tpAniSirGlobal pMac, uint32_t sessionId);
246QDF_STATUS csr_scan_request_lost_link3(tpAniSirGlobal pMac, uint32_t sessionId);
247QDF_STATUS csr_scan_handle_failed_lostlink1(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800248 uint32_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530249QDF_STATUS csr_scan_handle_failed_lostlink2(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800250 uint32_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530251QDF_STATUS csr_scan_handle_failed_lostlink3(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800252 uint32_t sessionId);
253tCsrScanResult *csr_scan_append_bss_description(tpAniSirGlobal pMac,
254 tSirBssDescription *
255 pSirBssDescription,
256 tDot11fBeaconIEs *pIes,
257 bool fForced, uint8_t sessionId);
258void csr_scan_call_callback(tpAniSirGlobal pMac, tSmeCmd *pCommand,
259 eCsrScanStatus scanStatus);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530260QDF_STATUS csr_scan_copy_request(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800261 tCsrScanRequest *pSrcReq);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530262QDF_STATUS csr_scan_free_request(tpAniSirGlobal pMac, tCsrScanRequest *pReq);
263QDF_STATUS csr_scan_copy_result_list(tpAniSirGlobal pMac, tScanResultHandle hIn,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800264 tScanResultHandle *phResult);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530265QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 tCsrRoamProfile *pProfile, uint32_t roamId,
267 bool notify);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530268QDF_STATUS csr_scan_start_result_cfg_aging_timer(tpAniSirGlobal pMac);
269QDF_STATUS csr_scan_stop_result_cfg_aging_timer(tpAniSirGlobal pMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800270void csr_scan_stop_timers(tpAniSirGlobal pMac);
271/* To remove fresh scan commands from the pending queue */
272bool csr_scan_remove_fresh_scan_command(tpAniSirGlobal pMac, uint8_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530273QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800274 eCsrAbortReason reason);
275void csr_remove_cmd_from_pending_list(tpAniSirGlobal pMac, tDblLinkList *pList,
276 eSmeCommandType commandType);
277void csr_remove_cmd_with_session_id_from_pending_list(tpAniSirGlobal pMac,
278 uint8_t sessionId,
279 tDblLinkList *pList,
280 eSmeCommandType commandType);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530281QDF_STATUS csr_scan_abort_mac_scan_not_for_connect(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800282 uint8_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530283QDF_STATUS csr_scan_abort_scan_for_ssid(tpAniSirGlobal pMac, uint32_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800284void csr_remove_scan_for_ssid_from_pending_list(tpAniSirGlobal pMac,
285 tDblLinkList *pList,
286 uint32_t sessionId);
287
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530288QDF_STATUS csr_abort_scan_from_active_list(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800289 tDblLinkList *pList, uint32_t sessionId,
290 eSmeCommandType scan_cmd_type, eCsrAbortReason abort_reason);
291
292/* To age out scan results base. tSmeGetScanChnRsp is a pointer returned by LIM that */
293/* has the information regarding scanned channels. */
294/* The logic is that whenever CSR add a BSS to scan result, it set the age count to */
295/* a value. This function deduct the age count if channelId matches the BSS' channelId */
296/* The BSS is remove if the count reaches 0. */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530297QDF_STATUS csr_scan_age_results(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800298 tSmeGetScanChnRsp *pScanChnInfo);
299
300/* If fForce is true we will save the new String that is learn't. */
301/* Typically it will be true in case of Join or user initiated ioctl */
302bool csr_learn_11dcountry_information(tpAniSirGlobal pMac,
303 tSirBssDescription *pSirBssDesc,
304 tDot11fBeaconIEs *pIes, bool fForce);
305void csr_apply_country_information(tpAniSirGlobal pMac);
306void csr_set_cfg_scan_control_list(tpAniSirGlobal pMac, uint8_t *countryCode,
307 tCsrChannel *pChannelList);
308void csr_reinit_scan_cmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
309void csr_free_scan_result_entry(tpAniSirGlobal pMac, tCsrScanResult *pResult);
310
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530311QDF_STATUS csr_roam_call_callback(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800312 tCsrRoamInfo *pRoamInfo, uint32_t roamId,
313 eRoamCmdStatus u1, eCsrRoamResult u2);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530314QDF_STATUS csr_roam_issue_connect(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800315 tCsrRoamProfile *pProfile,
316 tScanResultHandle hBSSList,
317 eCsrRoamReason reason, uint32_t roamId,
318 bool fImediate, bool fClearScan);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530319QDF_STATUS csr_roam_issue_reassoc(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800320 tCsrRoamProfile *pProfile,
321 tCsrRoamModifyProfileFields *pModProfileFields,
322 eCsrRoamReason reason, uint32_t roamId,
323 bool fImediate);
324void csr_roam_complete(tpAniSirGlobal pMac, eCsrRoamCompleteResult Result,
325 void *Context);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530326QDF_STATUS csr_roam_issue_set_context_req(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800327 eCsrEncryptionType EncryptType,
328 tSirBssDescription *pBssDescription,
329 tSirMacAddr *bssId, bool addKey,
330 bool fUnicast,
331 tAniKeyDirection aniKeyDirection,
332 uint8_t keyId, uint16_t keyLength,
333 uint8_t *pKey, uint8_t paeRole);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530334QDF_STATUS csr_roam_process_disassoc_deauth(tpAniSirGlobal pMac, tSmeCmd *pCommand,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 bool fDisassoc, bool fMICFailure);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530336QDF_STATUS csr_roam_save_connected_infomation(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337 uint32_t sessionId,
338 tCsrRoamProfile *pProfile,
339 tSirBssDescription *pSirBssDesc,
340 tDot11fBeaconIEs *pIes);
341void csr_roam_check_for_link_status_change(tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg);
342void csr_roam_stats_rsp_processor(tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530343QDF_STATUS csr_roam_issue_start_bss(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 tCsrRoamStartBssParams *pParam,
345 tCsrRoamProfile *pProfile,
346 tSirBssDescription *pBssDesc, uint32_t roamId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530347QDF_STATUS csr_roam_issue_stop_bss(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348 eCsrRoamSubState NewSubstate);
349bool csr_is_same_profile(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pProfile1,
350 tCsrRoamProfile *pProfile2);
351bool csr_is_roam_command_waiting(tpAniSirGlobal pMac);
352bool csr_is_roam_command_waiting_for_session(tpAniSirGlobal pMac, uint32_t sessionId);
353bool csr_is_scan_for_roam_command_active(tpAniSirGlobal pMac);
354eRoamCmdStatus csr_get_roam_complete_status(tpAniSirGlobal pMac,
355 uint32_t sessionId);
356/* pBand can be NULL if caller doesn't need to get it */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530357QDF_STATUS csr_roam_issue_disassociate_cmd(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800358 eCsrRoamDisconnectReason reason);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530359QDF_STATUS csr_roam_disconnect_internal(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360 eCsrRoamDisconnectReason reason);
361/* pCommand may be NULL */
362void csr_roam_remove_duplicate_command(tpAniSirGlobal pMac, uint32_t sessionId,
363 tSmeCmd *pCommand,
364 eCsrRoamReason eRoamReason);
365
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530366QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367 tSirBssDescription *pBssDescription,
368 tCsrRoamProfile *pProfile,
369 tDot11fBeaconIEs *pIes, uint16_t messageType);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530370QDF_STATUS csr_send_mb_disassoc_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371 tSirMacAddr bssId, uint16_t reasonCode);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530372QDF_STATUS csr_send_mb_deauth_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373 tSirMacAddr bssId, uint16_t reasonCode);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530374QDF_STATUS csr_send_mb_disassoc_cnf_msg(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800375 tpSirSmeDisassocInd pDisassocInd);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530376QDF_STATUS csr_send_mb_deauth_cnf_msg(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800377 tpSirSmeDeauthInd pDeauthInd);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530378QDF_STATUS csr_send_assoc_cnf_msg(tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd,
379 QDF_STATUS status);
380QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381 tpSirSmeAssocInd pAssocInd,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530382 QDF_STATUS Halstatus,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383 uint8_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530384QDF_STATUS csr_send_mb_start_bss_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385 eCsrRoamBssType bssType,
386 tCsrRoamStartBssParams *pParam,
387 tSirBssDescription *pBssDesc);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530388QDF_STATUS csr_send_mb_stop_bss_req_msg(tpAniSirGlobal pMac, uint32_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800389
390/* Caller should put the BSS' ssid to fiedl bssSsid when comparing SSID for a BSS. */
391bool csr_is_ssid_match(tpAniSirGlobal pMac, uint8_t *ssid1, uint8_t ssid1Len,
392 uint8_t *bssSsid, uint8_t bssSsidLen, bool fSsidRequired);
393bool csr_is_phy_mode_match(tpAniSirGlobal pMac, uint32_t phyMode,
394 tSirBssDescription *pSirBssDesc,
395 tCsrRoamProfile *pProfile,
396 eCsrCfgDot11Mode *pReturnCfgDot11Mode,
397 tDot11fBeaconIEs *pIes);
398bool csr_roam_is_channel_valid(tpAniSirGlobal pMac, uint8_t channel);
399
400/* pNumChan is a caller allocated space with the sizeof pChannels */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530401QDF_STATUS csr_get_cfg_valid_channels(tpAniSirGlobal pMac, uint8_t *pChannels,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402 uint32_t *pNumChan);
403void csr_roam_ccm_cfg_set_callback(tpAniSirGlobal pMac, int32_t result);
404
Amar Singhala297bfa2015-10-15 15:07:29 -0700405int8_t csr_get_cfg_max_tx_power(tpAniSirGlobal pMac, uint8_t channel);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406
407/* To free the last roaming profile */
408void csr_free_roam_profile(tpAniSirGlobal pMac, uint32_t sessionId);
409void csr_free_connect_bss_desc(tpAniSirGlobal pMac, uint32_t sessionId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530410QDF_STATUS csr_move_bss_to_head_from_bssid(tpAniSirGlobal pMac,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530411 struct qdf_mac_addr *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800412 tScanResultHandle hScanResult);
413bool csr_check_ps_ready(void *pv);
414bool csr_check_ps_offload_ready(void *pv, uint32_t sessionId);
415
416/* to free memory allocated inside the profile structure */
417void csr_release_profile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile);
418/* To free memory allocated inside scanFilter */
419void csr_free_scan_filter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter);
420eCsrCfgDot11Mode csr_get_cfg_dot11_mode_from_csr_phy_mode(tCsrRoamProfile *pProfile,
421 eCsrPhyMode phyMode,
422 bool fProprietary);
423uint32_t csr_translate_to_wni_cfg_dot11_mode(tpAniSirGlobal pMac,
424 eCsrCfgDot11Mode csrDot11Mode);
425void csr_save_channel_power_for_band(tpAniSirGlobal pMac, bool fPopulate5GBand);
426void csr_apply_channel_power_info_to_fw(tpAniSirGlobal pMac,
427 tCsrChannel *pChannelList,
428 uint8_t *countryCode);
429void csr_apply_power2_current(tpAniSirGlobal pMac);
430void csr_assign_rssi_for_category(tpAniSirGlobal pMac, int8_t bestApRssi,
431 uint8_t catOffset);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530432QDF_STATUS csr_roam_remove_connected_bss_from_scan_cache(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800433 tCsrRoamConnectedProfile *
434 pConnProfile);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530435QDF_STATUS csr_roam_start_roaming(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800436 eCsrRoamingReason roamingReason);
437/* return a bool to indicate whether roaming completed or continue. */
438bool csr_roam_complete_roaming(tpAniSirGlobal pMac, uint32_t sessionId,
439 bool fForce, eCsrRoamResult roamResult);
440void csr_roam_completion(tpAniSirGlobal pMac, uint32_t sessionId,
441 tCsrRoamInfo *pRoamInfo, tSmeCmd *pCommand,
442 eCsrRoamResult roamResult, bool fSuccess);
443void csr_roam_cancel_roaming(tpAniSirGlobal pMac, uint32_t sessionId);
444void csr_apply_channel_power_info_wrapper(tpAniSirGlobal pMac);
445void csr_reset_pmkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId);
446#ifdef FEATURE_WLAN_WAPI
447void csr_reset_bkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId);
448#endif /* FEATURE_WLAN_WAPI */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530449QDF_STATUS csr_save_to_channel_power2_g_5_g(tpAniSirGlobal pMac, uint32_t tableSize,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800450 tSirMacChanInfo *channelTable);
451
452/* To check whether a country code matches the one in the IE */
453/* Only check the first two characters, ignoring in/outdoor */
454/* pCountry -- caller allocated buffer contain the country code that is checking against */
455/* the one in pIes. It can be NULL. */
456/* caller must provide pIes, it cannot be NULL */
457/* This function always return true if 11d support is not turned on. */
458/* pIes cannot be NULL */
459bool csr_match_country_code(tpAniSirGlobal pMac, uint8_t *pCountry,
460 tDot11fBeaconIEs *pIes);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530461QDF_STATUS csr_roam_set_key(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800462 tCsrRoamSetKey *pSetKey, uint32_t roamId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530463QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800464 csr_roam_completeCallback callback, void *pContext,
465 uint8_t *pSelfMacAddr, uint8_t *pbSessionId,
466 uint32_t type, uint32_t subType);
467/* fSync: true means cleanupneeds to handle synchronously. */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530468QDF_STATUS csr_roam_close_session(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469 bool fSync,
470 csr_roamSessionCloseCallback callback,
471 void *pContext);
472void csr_cleanup_session(tpAniSirGlobal pMac, uint32_t sessionId);
Anurag Chouhan6d760662016-02-20 16:05:43 +0530473QDF_STATUS csr_roam_get_session_id_from_bssid(tpAniSirGlobal pMac, struct qdf_mac_addr *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474 uint32_t *pSessionId);
475eCsrCfgDot11Mode csr_find_best_phy_mode(tpAniSirGlobal pMac, uint32_t phyMode);
476
477/* ---------------------------------------------------------------------------
478 \fn csr_scan_enable
479 \brief Enable the scanning feature of CSR. It must be called before any scan request can be performed.
480 \param tHalHandle - HAL context handle
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530481 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800482 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530483QDF_STATUS csr_scan_enable(tpAniSirGlobal);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800484
485/* ---------------------------------------------------------------------------
486 \fn csr_scan_disable
487 \brief Disableing the scanning feature of CSR. After this function return success, no scan is performed until
488 a successfull to csr_scan_enable
489 \param tHalHandle - HAL context handle
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530490 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800491 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530492QDF_STATUS csr_scan_disable(tpAniSirGlobal);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800493/* ---------------------------------------------------------------------------
494 \fn csr_scan_request
495 \brief Request a 11d or full scan.
496 \param callback - a callback function that scan calls upon finish, will not be called if csr_scan_request returns error
497 \param pContext - a pointer passed in for the callback
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530498 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800499 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530500QDF_STATUS csr_scan_request(tpAniSirGlobal, uint16_t, tCsrScanRequest *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800501 csr_scan_completeCallback callback, void *pContext);
502
503/* ---------------------------------------------------------------------------
504 \fn csrScanAbort
505 \brief If a scan request is abort, the scan complete callback will be called first before csrScanAbort returns.
506 \param pScanRequestID - The request ID returned from csr_scan_request
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530507 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800508 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530509QDF_STATUS csrScanAbort(tpAniSirGlobal, uint32_t scanRequestID);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800510
511/* ---------------------------------------------------------------------------
512 \fn csr_scan_get_result
513 \brief Return scan results.
514 \param pFilter - If pFilter is NULL, all cached results are returned
515 \param phResult - an object for the result.
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530516 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800517 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530518QDF_STATUS csr_scan_get_result(tpAniSirGlobal, tCsrScanResultFilter *pFilter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519 tScanResultHandle *phResult);
520
521/* ---------------------------------------------------------------------------
522 \fn csr_scan_flush_result
523 \brief Clear scan results.
524 \param pMac - pMac global pointer
525 \param sessionId - Session Identifier
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530526 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800527 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530528QDF_STATUS csr_scan_flush_result(tpAniSirGlobal);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800529/* ---------------------------------------------------------------------------
530 * \fn csr_scan_filter_results
531 * \brief Filter scan results based on valid channel list.
532 * \param pMac - Pointer to Global MAC structure
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530533 * \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800534 ***-------------------------------------------------------------------------------
535 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530536QDF_STATUS csr_scan_filter_results(tpAniSirGlobal pMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800537
538void csr_save_scan_results(tpAniSirGlobal pMac, uint8_t reason,
539 uint8_t sessionId);
540
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530541QDF_STATUS csr_scan_flush_selective_result(tpAniSirGlobal, bool flushP2P);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800542
543/* ---------------------------------------------------------------------------
544 \fn csr_scan_result_get_first
545 \brief Returns the first element of scan result.
546 \param hScanResult - returned from csr_scan_get_result
547 \return tCsrScanResultInfo * - NULL if no result
548 -------------------------------------------------------------------------------*/
549tCsrScanResultInfo *csr_scan_result_get_first(tpAniSirGlobal,
550 tScanResultHandle hScanResult);
551/* ---------------------------------------------------------------------------
552 \fn csr_scan_result_get_next
553 \brief Returns the next element of scan result. It can be called without calling csr_scan_result_get_first first
554 \param hScanResult - returned from csr_scan_get_result
555 \return Null if no result or reach the end
556 -------------------------------------------------------------------------------*/
557tCsrScanResultInfo *csr_scan_result_get_next(tpAniSirGlobal,
558 tScanResultHandle hScanResult);
559
560/* ---------------------------------------------------------------------------
561 \fn csr_get_country_code
562 \brief this function is to get the country code current being used
563 \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, this has the country code
564 \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return,
565 this contains the length of the data in pBuf
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530566 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800567 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530568QDF_STATUS csr_get_country_code(tpAniSirGlobal pMac, uint8_t *pBuf,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569 uint8_t *pbLen);
570
571/* ---------------------------------------------------------------------------
572 \fn csr_set_country_code
573 \brief this function is to set the country code so channel/power setting matches the countrycode and
574 the domain it belongs to.
575 \param pCountry - Caller allocated buffer with at least 3 bytes specifying the country code
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530576 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800577 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530578QDF_STATUS csr_set_country_code(tpAniSirGlobal pMac, uint8_t *pCountry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800579
580/* ---------------------------------------------------------------------------
581 \fn csr_get_regulatory_domain_for_country
582 \brief this function is to get the regulatory domain for a country.
583 This function must be called after CFG is downloaded and all the band/mode setting already passed into
584 CSR.
585 \param pCountry - Caller allocated buffer with at least 3 bytes specifying the country code
586 \param pDomainId - Caller allocated buffer to get the return domain ID upon success return. Can be NULL.
587 \param source - the source of country information.
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530588 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800589 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530590QDF_STATUS csr_get_regulatory_domain_for_country(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800591 uint8_t *pCountry,
592 v_REGDOMAIN_t *pDomainId,
Amar Singhala297bfa2015-10-15 15:07:29 -0700593 enum country_src source);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800594
595/* some support functions */
596bool csr_is11d_supported(tpAniSirGlobal pMac);
597bool csr_is11h_supported(tpAniSirGlobal pMac);
598bool csr_is11e_supported(tpAniSirGlobal pMac);
599bool csr_is_wmm_supported(tpAniSirGlobal pMac);
600bool csr_is_mcc_supported(tpAniSirGlobal pMac);
601
602/* Return SUCCESS is the command is queued, failed */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530603QDF_STATUS csr_queue_sme_command(tpAniSirGlobal pMac, tSmeCmd *pCommand,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800604 bool fHighPriority);
605tSmeCmd *csr_get_command_buffer(tpAniSirGlobal pMac);
606void csr_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
607void csr_scan_flush_bss_entry(tpAniSirGlobal pMac,
608 tpSmeCsaOffloadInd pCsaOffloadInd);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530609QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac, uint32_t scan_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800610 tListElem **entry);
611
612#ifdef FEATURE_WLAN_WAPI
613bool csr_is_profile_wapi(tCsrRoamProfile *pProfile);
614#endif /* FEATURE_WLAN_WAPI */
615
Tushnim Bhattacharyyaf44a9d82016-07-05 10:52:06 -0700616void csr_get_vdev_type_nss(tpAniSirGlobal mac_ctx,
617 enum tQDF_ADAPTER_MODE dev_mode,
618 uint8_t *nss_2g, uint8_t *nss_5g);
619
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800620#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
621
622/* Security */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800623#define WLAN_SECURITY_EVENT_REMOVE_KEY_REQ 5
624#define WLAN_SECURITY_EVENT_REMOVE_KEY_RSP 6
625#define WLAN_SECURITY_EVENT_PMKID_CANDIDATE_FOUND 7
626#define WLAN_SECURITY_EVENT_PMKID_UPDATE 8
627#define WLAN_SECURITY_EVENT_MIC_ERROR 9
Abhishek Singh7a995582016-04-27 13:53:36 +0530628#define WLAN_SECURITY_EVENT_SET_UNICAST_REQ 10
629#define WLAN_SECURITY_EVENT_SET_UNICAST_RSP 11
630#define WLAN_SECURITY_EVENT_SET_BCAST_REQ 12
631#define WLAN_SECURITY_EVENT_SET_BCAST_RSP 13
632
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800633
634#define AUTH_OPEN 0
635#define AUTH_SHARED 1
636#define AUTH_WPA_EAP 2
637#define AUTH_WPA_PSK 3
638#define AUTH_WPA2_EAP 4
639#define AUTH_WPA2_PSK 5
640#ifdef FEATURE_WLAN_WAPI
641#define AUTH_WAPI_CERT 6
642#define AUTH_WAPI_PSK 7
643#endif /* FEATURE_WLAN_WAPI */
644
645#define ENC_MODE_OPEN 0
646#define ENC_MODE_WEP40 1
647#define ENC_MODE_WEP104 2
648#define ENC_MODE_TKIP 3
649#define ENC_MODE_AES 4
650#ifdef FEATURE_WLAN_WAPI
651#define ENC_MODE_SMS4 5 /* WAPI */
652#endif /* FEATURE_WLAN_WAPI */
653
654#define NO_MATCH 0
655#define MATCH 1
656
657#define WLAN_SECURITY_STATUS_SUCCESS 0
658#define WLAN_SECURITY_STATUS_FAILURE 1
659
660/* Scan */
661#define WLAN_SCAN_EVENT_ACTIVE_SCAN_REQ 1
662#define WLAN_SCAN_EVENT_ACTIVE_SCAN_RSP 2
663#define WLAN_SCAN_EVENT_PASSIVE_SCAN_REQ 3
664#define WLAN_SCAN_EVENT_PASSIVE_SCAN_RSP 4
665#define WLAN_SCAN_EVENT_HO_SCAN_REQ 5
666#define WLAN_SCAN_EVENT_HO_SCAN_RSP 6
667
668#define WLAN_SCAN_STATUS_SUCCESS 0
669#define WLAN_SCAN_STATUS_FAILURE 1
670#define WLAN_SCAN_STATUS_ABORT 2
671
672/* Ibss */
673#define WLAN_IBSS_EVENT_START_IBSS_REQ 0
674#define WLAN_IBSS_EVENT_START_IBSS_RSP 1
675#define WLAN_IBSS_EVENT_JOIN_IBSS_REQ 2
676#define WLAN_IBSS_EVENT_JOIN_IBSS_RSP 3
677#define WLAN_IBSS_EVENT_COALESCING 4
678#define WLAN_IBSS_EVENT_PEER_JOIN 5
679#define WLAN_IBSS_EVENT_PEER_LEAVE 6
680#define WLAN_IBSS_EVENT_STOP_REQ 7
681#define WLAN_IBSS_EVENT_STOP_RSP 8
682
683#define AUTO_PICK 0
684#define SPECIFIED 1
685
686#define WLAN_IBSS_STATUS_SUCCESS 0
687#define WLAN_IBSS_STATUS_FAILURE 1
688
689/* 11d */
690#define WLAN_80211D_EVENT_COUNTRY_SET 0
691#define WLAN_80211D_EVENT_RESET 1
692
693#define WLAN_80211D_DISABLED 0
694#define WLAN_80211D_SUPPORT_MULTI_DOMAIN 1
695#define WLAN_80211D_NOT_SUPPORT_MULTI_DOMAIN 2
696
697int diag_auth_type_from_csr_type(eCsrAuthType authType);
698int diag_enc_type_from_csr_type(eCsrEncryptionType encType);
699#endif /* #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR */
700/* ---------------------------------------------------------------------------
701 \fn csr_scan_result_purge
702 \brief remove all items(tCsrScanResult) in the list and free memory for each item
703 \param hScanResult - returned from csr_scan_get_result. hScanResult is considered gone by
704 calling this function and even before this function reutrns.
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530705 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800706 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530707QDF_STATUS csr_scan_result_purge(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 tScanResultHandle hScanResult);
709
710/* /////////////////////////////////////////Common Scan ends */
711
712/* ---------------------------------------------------------------------------
713 \fn csr_roam_connect
714 \brief To inititiate an association
715 \param pProfile - can be NULL to join to any open ones
716 \param pRoamId - to get back the request ID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530717 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800718 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530719QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800720 tCsrRoamProfile *pProfile,
721 uint32_t *pRoamId);
722
723/* ---------------------------------------------------------------------------
724 \fn csr_roam_reassoc
725 \brief To inititiate a re-association
726 \param pProfile - can be NULL to join the currently connected AP. In that
727 case modProfileFields should carry the modified field(s) which could trigger
728 reassoc
729 \param modProfileFields - fields which are part of tCsrRoamConnectedProfile
730 that might need modification dynamically once STA is up & running and this
731 could trigger a reassoc
732 \param pRoamId - to get back the request ID
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530733 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800734 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530735QDF_STATUS csr_roam_reassoc(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800736 tCsrRoamProfile *pProfile,
737 tCsrRoamModifyProfileFields modProfileFields,
738 uint32_t *pRoamId);
739
740/* ---------------------------------------------------------------------------
741 \fn csr_roam_reconnect
742 \brief To disconnect and reconnect with the same profile
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530743 \return QDF_STATUS. It returns fail if currently not connected
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800744 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530745QDF_STATUS csr_roam_reconnect(tpAniSirGlobal pMac, uint32_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746
747/* ---------------------------------------------------------------------------
748 \fn csr_roam_set_pmkid_cache
749 \brief return the PMKID candidate list
750 \param pPMKIDCache - caller allocated buffer point to an array of tPmkidCacheInfo
751 \param numItems - a variable that has the number of tPmkidCacheInfo allocated
752 when retruning, this is either the number needed or number of items put into pPMKIDCache
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530753 \return QDF_STATUS - when fail, it usually means the buffer allocated is not big enough and pNumItems
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754 has the number of tPmkidCacheInfo.
755 \Note: pNumItems is a number of tPmkidCacheInfo, not sizeof(tPmkidCacheInfo) * something
756 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530757QDF_STATUS csr_roam_set_pmkid_cache(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800758 tPmkidCacheInfo *pPMKIDCache,
759 uint32_t numItems, bool update_entire_cache);
760
761#ifdef WLAN_FEATURE_ROAM_OFFLOAD
762/* ---------------------------------------------------------------------------
763 *\fn csr_roam_set_psk_pmk
764 *\brief store PSK/PMK
765 *\param pMac - pointer to global structure for MAC
766 *\param sessionId - Sme session id
767 *\param pPSK_PMK - pointer to an array of Psk/Pmk
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530768 *\return QDF_STATUS - usually it succeed unless sessionId is not found
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800769 *\Note:
770 *-------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530771QDF_STATUS csr_roam_set_psk_pmk(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800772 uint8_t *pPSK_PMK, size_t pmk_len);
773
Deepak Dhamdheref2a7d8b2016-08-19 16:17:38 -0700774QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal mac_ctx,
775 uint32_t session_id,
776 bool roam_key_mgmt_offload_enabled,
777 bool okc_enabled);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800778#endif
779/* ---------------------------------------------------------------------------
780 \fn csr_roam_get_wpa_rsn_req_ie
781 \brief return the WPA or RSN IE CSR passes to PE to JOIN request or START_BSS request
782 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
783 needed or IE length in pBuf.
784 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530785 \return QDF_STATUS - when fail, it usually means the buffer allocated is not big enough
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800786 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530787QDF_STATUS csr_roam_get_wpa_rsn_req_ie(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800788 uint32_t *pLen, uint8_t *pBuf);
789
790/* ---------------------------------------------------------------------------
791 \fn csr_roam_get_wpa_rsn_rsp_ie
792 \brief return the WPA or RSN IE from the beacon or probe rsp if connected
793 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
794 needed or IE length in pBuf.
795 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530796 \return QDF_STATUS - when fail, it usually means the buffer allocated is not big enough
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800797 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530798QDF_STATUS csr_roam_get_wpa_rsn_rsp_ie(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800799 uint32_t *pLen, uint8_t *pBuf);
800
801/* ---------------------------------------------------------------------------
802 \fn csr_roam_get_num_pmkid_cache
803 \brief return number of PMKID cache entries
804 \return uint32_t - the number of PMKID cache entries
805 -------------------------------------------------------------------------------*/
806uint32_t csr_roam_get_num_pmkid_cache(tpAniSirGlobal pMac, uint32_t sessionId);
807
808/* ---------------------------------------------------------------------------
809 \fn csr_roam_get_pmkid_cache
810 \brief return PMKID cache from CSR
811 \param pNum - caller allocated memory that has the space of the number of pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the
812 needed or actually number in tPmkidCacheInfo.
813 \param pPmkidCache - Caller allocated memory that contains PMKID cache, if any, upon return
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530814 \return QDF_STATUS - when fail, it usually means the buffer allocated is not big enough
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800815 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530816QDF_STATUS csr_roam_get_pmkid_cache(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800817 uint32_t *pNum, tPmkidCacheInfo *pPmkidCache);
818
819/**
820 * csr_roam_get_connect_profile() - To return the current connect profile,
821 * caller must call csr_roam_free_connect_profile after it is done and before
822 * reuse for another csr_roam_get_connect_profile call.
823 *
824 * @pMac: pointer to global adapter context
825 * @sessionId: session ID
826 * @pProfile: pointer to a caller allocated structure
827 * tCsrRoamConnectedProfile
828 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530829 * Return: QDF_STATUS. Failure if not connected, success otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530831QDF_STATUS csr_roam_get_connect_profile(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800832 tCsrRoamConnectedProfile *pProfile);
833
834/* ---------------------------------------------------------------------------
835 \fn csr_roam_get_connect_state
836 \brief To return the current connect state of Roaming
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530837 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800838 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530839QDF_STATUS csr_roam_get_connect_state(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800840 eCsrConnectState *pState);
841
Naveen Rawatdf0a7e72016-01-06 18:35:53 -0800842void csr_roam_free_connect_profile(tCsrRoamConnectedProfile *profile);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800843
844/* ---------------------------------------------------------------------------
845 \fn csr_apply_channel_and_power_list
846 \brief HDD calls this function to set the WNI_CFG_VALID_CHANNEL_LIST base on the band/mode settings.
847 This function must be called after CFG is downloaded and all the band/mode setting already passed into
848 CSR.
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530849 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800850 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530851QDF_STATUS csr_apply_channel_and_power_list(tpAniSirGlobal pMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800852
853/**
854 * csr_change_config_params() - The CSR API exposed for HDD to provide config
855 * params to CSR during SMEs stop -> start sequence.
856 *
857 * @pMac: pointer to global adapter context
858 * @pUpdateConfigParam: a pointer to a structure (tCsrUpdateConfigParam) that
859 * currently provides 11d related information like country code, Regulatory
860 * domain, valid channel list, Tx power per channel, a list with active/passive
861 * scan allowed per valid channel.
862 *
863 * If HDD changed the domain that will cause a reset. This function will
864 * provide the new set of 11d information for the new domain. Currrently this
865 * API provides info regarding 11d only at reset but we can extend this for
866 * other params (PMC, QoS) which needs to be initialized again at reset.
867 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530868 * Return: QDF_STATUS. status of operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800869 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530870QDF_STATUS csr_change_config_params(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800871 tCsrUpdateConfigParam *pUpdateConfigParam);
872
873/* ---------------------------------------------------------------------------
874 \fn csr_roam_connect_to_last_profile
875 \brief To disconnect and reconnect with the same profile
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530876 \return QDF_STATUS. It returns fail if currently connected
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800877 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530878QDF_STATUS csr_roam_connect_to_last_profile(tpAniSirGlobal pMac, uint32_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800879
880/* ---------------------------------------------------------------------------
881 \fn csr_roam_disconnect
882 \brief To disconnect from a network
883 \param reason -- To indicate the reason for disconnecting. Currently, only eCSR_DISCONNECT_REASON_MIC_ERROR is meanful.
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530884 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800885 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530886QDF_STATUS csr_roam_disconnect(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800887 eCsrRoamDisconnectReason reason);
888
889/* ---------------------------------------------------------------------------
890 \fn csr_scan_get_pmkid_candidate_list
891 \brief return the PMKID candidate list
892 \param pPmkidList - caller allocated buffer point to an array of tPmkidCandidateInfo
893 \param pNumItems - pointer to a variable that has the number of tPmkidCandidateInfo allocated
894 when retruning, this is either the number needed or number of items put into pPmkidList
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530895 \return QDF_STATUS - when fail, it usually means the buffer allocated is not big enough and pNumItems
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800896 has the number of tPmkidCandidateInfo.
897 \Note: pNumItems is a number of tPmkidCandidateInfo, not sizeof(tPmkidCandidateInfo) * something
898 -------------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530899QDF_STATUS csr_scan_get_pmkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800900 tPmkidCandidateInfo *pPmkidList,
901 uint32_t *pNumItems);
902
903/* This function is used to stop a BSS. It is similar of csr_roamIssueDisconnect but this function */
904/* doesn't have any logic other than blindly trying to stop BSS */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530905QDF_STATUS csr_roam_issue_stop_bss_cmd(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800906 bool fHighPriority);
907
908void csr_call_roaming_completion_callback(tpAniSirGlobal pMac,
909 tCsrRoamSession *pSession,
910 tCsrRoamInfo *pRoamInfo, uint32_t roamId,
911 eCsrRoamResult roamResult);
Deepthi Gowrib3bfefd2016-09-13 15:14:34 +0530912/**
913 * csr_roam_issue_disassociate_sta_cmd() - disassociate a associated station
914 * @pMac: Pointer to global structure for MAC
915 * @sessionId: Session Id for Soft AP
916 * @p_del_sta_params: Pointer to parameters of the station to disassoc
917 *
918 * CSR function that HDD calls to issue a deauthenticate station command
919 *
920 * Return: QDF_STATUS_SUCCESS on success or another QDF_STATUS_* on error
921 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530922QDF_STATUS csr_roam_issue_disassociate_sta_cmd(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800923 uint32_t sessionId,
Deepthi Gowrib3bfefd2016-09-13 15:14:34 +0530924 struct tagCsrDelStaParams
925 *p_del_sta_params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800926/**
927 * csr_roam_issue_deauth_sta_cmd() - issue deauthenticate station command
928 * @pMac: Pointer to global structure for MAC
929 * @sessionId: Session Id for Soft AP
930 * @pDelStaParams: Pointer to parameters of the station to deauthenticate
931 *
932 * CSR function that HDD calls to issue a deauthenticate station command
933 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530934 * Return: QDF_STATUS_SUCCESS on success or another QDF_STATUS_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530936QDF_STATUS csr_roam_issue_deauth_sta_cmd(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800937 uint32_t sessionId,
938 struct tagCsrDelStaParams *pDelStaParams);
939
940/* ---------------------------------------------------------------------------
941 \fn csr_roam_issue_tkip_counter_measures
942 \brief csr function that HDD calls to start and stop tkip countermeasures
943 \param sessionId - session Id for Soft AP
944 \param bEnable - Flag to start/stop countermeasures
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530945 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800946 ---------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530947QDF_STATUS csr_roam_issue_tkip_counter_measures(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948 uint32_t sessionId, bool bEnable);
949
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800950/* ---------------------------------------------------------------------------
951 \fn csr_roam_get_associated_stas
952 \brief csr function that HDD calls to get list of associated stations based on module ID
953 \param sessionId - session Id for Soft AP
954 \param modId - module ID - PE/HAL/TL
955 \param pUsrContext - Opaque HDD context
956 \param pfnSapEventCallback - Sap event callback in HDD
957 \param pAssocStasBuf - Caller allocated memory to be filled with associatd stations info
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530958 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800959 ---------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530960QDF_STATUS csr_roam_get_associated_stas(tpAniSirGlobal pMac, uint32_t sessionId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530961 QDF_MODULE_ID modId, void *pUsrContext,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800962 void *pfnSapEventCallback,
963 uint8_t *pAssocStasBuf);
964
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530965QDF_STATUS csr_send_mb_get_associated_stas_req_msg(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800966 uint32_t sessionId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530967 QDF_MODULE_ID modId,
968 struct qdf_mac_addr bssId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800969 void *pUsrContext,
970 void *pfnSapEventCallback,
971 uint8_t *pAssocStasBuf);
972
973/* ---------------------------------------------------------------------------
974 \fn csr_roam_get_wps_session_overlap
975 \brief csr function that HDD calls to get WPS PBC session overlap information
976 \param sessionId - session Id for Soft AP
977 \param pUsrContext - Opaque HDD context
978 \param pfnSapEventCallback - Sap event callback in HDD
979 \param pRemoveMac - pointer to MAC address of session to be removed
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530980 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800981 ---------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530982QDF_STATUS csr_roam_get_wps_session_overlap(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983 void *pUsrContext,
984 void *pfnSapEventCallback,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530985 struct qdf_mac_addr pRemoveMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800986
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530987QDF_STATUS csr_send_mb_get_wpspbc_sessions(tpAniSirGlobal pMac,
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800988 uint32_t sessionId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530989 struct qdf_mac_addr bssId,
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800990 void *pUsrContext,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800991 void *pfnSapEventCallback,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530992 struct qdf_mac_addr pRemoveMac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800993
994/* ---------------------------------------------------------------------------
995 \fn csr_send_chng_mcc_beacon_interval
996 \brief csr function that HDD calls to send Update beacon interval
997 \param sessionId - session Id for Soft AP
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530998 \return QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800999 ---------------------------------------------------------------------------*/
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301000QDF_STATUS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001csr_send_chng_mcc_beacon_interval(tpAniSirGlobal pMac, uint32_t sessionId);
1002
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001003#ifdef WLAN_FEATURE_HOST_ROAM
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001004void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001005 tpSirFTPreAuthRsp pFTPreAuthRsp);
1006void csr_release_command_preauth(tpAniSirGlobal mac_ctx, tSmeCmd *command);
1007#else
1008static inline void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
1009 tpSirFTPreAuthRsp pFTPreAuthRsp)
1010{}
1011static inline void csr_release_command_preauth(tpAniSirGlobal mac_ctx,
1012 tSmeCmd *command)
1013{}
1014#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001015
1016#if defined(FEATURE_WLAN_ESE)
1017void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1,
1018 uint32_t *incr);
1019#endif
1020
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301021QDF_STATUS csr_roam_enqueue_preauth(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001022 tpSirBssDescription pBssDescription,
1023 eCsrRoamReason reason, bool fImmediate);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301024QDF_STATUS csr_dequeue_roam_command(tpAniSirGlobal pMac, eCsrRoamReason reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025void csr_init_occupied_channels_list(tpAniSirGlobal pMac, uint8_t sessionId);
1026bool csr_neighbor_roam_is_new_connected_profile(tpAniSirGlobal pMac,
1027 uint8_t sessionId);
1028bool csr_neighbor_roam_connected_profile_match(tpAniSirGlobal pMac,
1029 uint8_t sessionId,
1030 tCsrScanResult *pResult,
1031 tDot11fBeaconIEs *pIes);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301033QDF_STATUS csr_scan_create_entry_in_scan_cache(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001034 uint32_t sessionId,
Anurag Chouhan6d760662016-02-20 16:05:43 +05301035 struct qdf_mac_addr bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001036 uint8_t channel);
1037
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301038QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac);
1039QDF_STATUS csr_roam_del_pmkid_from_cache(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001040 uint32_t sessionId,
1041 const uint8_t *pBSSId,
1042 bool flush_cache);
1043
1044bool csr_elected_country_info(tpAniSirGlobal pMac);
1045void csr_add_vote_for_country_info(tpAniSirGlobal pMac, uint8_t *pCountryCode);
1046void csr_clear_votes_for_country_info(tpAniSirGlobal pMac);
1047
1048#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301049QDF_STATUS csr_send_ext_change_channel(tpAniSirGlobal mac_ctx,
Abhishek Singh518323d2015-10-19 17:42:01 +05301050 uint32_t channel, uint8_t session_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001051
1052#ifdef QCA_HT_2040_COEX
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301053QDF_STATUS csr_set_ht2040_mode(tpAniSirGlobal pMac, uint32_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001054 ePhyChanBondState cbMode, bool obssEnabled);
1055#endif
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301056QDF_STATUS csr_scan_handle_search_for_ssid(tpAniSirGlobal mac,
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +05301057 tSmeCmd *command);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301058QDF_STATUS csr_scan_handle_search_for_ssid_failure(tpAniSirGlobal mac,
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +05301059 tSmeCmd *command);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060tSirBssDescription*
1061csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
1062 tSirBssDescription *bss_descr);
1063void csr_release_scan_command(tpAniSirGlobal pMac, tSmeCmd *pCommand,
1064 eCsrScanStatus scanStatus);
Abhishek Singhb1d73ab2015-12-03 16:14:00 +05301065bool is_disconnect_pending(tpAniSirGlobal mac_ctx,
1066 uint8_t sessionid);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001067void csr_scan_active_list_timeout_handle(void *userData);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301068QDF_STATUS csr_prepare_disconnect_command(tpAniSirGlobal mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001069 uint32_t session_id, tSmeCmd **sme_cmd);
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001070QDF_STATUS csr_roam_prepare_bss_config_from_profile(tpAniSirGlobal mac_ctx,
1071 tCsrRoamProfile *profile, tBssConfigParam *bss_cfg,
1072 tSirBssDescription *bss_desc);
1073void csr_roam_prepare_bss_params(tpAniSirGlobal mac_ctx, uint32_t session_id,
1074 tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
1075 tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies);
1076
Abhishek Singhc9941602016-08-09 16:06:22 +05301077void csr_remove_bssid_from_scan_list(tpAniSirGlobal mac_ctx,
1078 tSirMacAddr bssid);
1079
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001080QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal mac_ctx,
1081 uint32_t session_id,
1082 tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
1083 tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies,
1084 bool reset_country);
1085