blob: a1d90717c2d99cd3cd875ac4aad8983250db6386 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Hanumantha Reddy Pothula07050f52015-02-24 11:36:12 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam0fb93dd2014-02-19 00:32:59 -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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam0fb93dd2014-02-19 00:32:59 -080021
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
Jeff Johnson295189b2012-06-20 16:38:30 -070028/*===========================================================================
29
30 s a p M o d u l e . C
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -070031
Jeff Johnson295189b2012-06-20 16:38:30 -070032 OVERVIEW:
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -070033
Jeff Johnson295189b2012-06-20 16:38:30 -070034 This software unit holds the implementation of the WLAN SAP modules
35 functions providing EXTERNAL APIs. It is also where the global SAP module
36 context gets initialised
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -070037
38 DEPENDENCIES:
Jeff Johnson295189b2012-06-20 16:38:30 -070039
40 Are listed for each API below.
Jeff Johnson295189b2012-06-20 16:38:30 -070041===========================================================================*/
42
43/*===========================================================================
44
45 EDIT HISTORY FOR FILE
46
47
48 This section contains comments describing changes made to the module.
49 Notice that changes are listed in reverse chronological order.
50
51
52
53 when who what, where, why
54---------- --- --------------------------------------------------------
5503/15/10 SOFTAP team Created module
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07005606/03/10 js Added support to hostapd driven
Jeff Johnson295189b2012-06-20 16:38:30 -070057 * deauth/disassoc/mic failure
58
59===========================================================================*/
60
61/* $Header$ */
62
63/*----------------------------------------------------------------------------
64 * Include Files
65 * -------------------------------------------------------------------------*/
66#include "wlan_qct_tl.h"
67#include "vos_trace.h"
68
69// Pick up the sme callback registration API
70#include "sme_Api.h"
71
72// SAP API header file
73
74#include "sapInternal.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070075#include "smeInside.h"
76
77/*----------------------------------------------------------------------------
78 * Preprocessor Definitions and Constants
79 * -------------------------------------------------------------------------*/
80#define SAP_DEBUG
81
82/*----------------------------------------------------------------------------
83 * Type Declarations
84 * -------------------------------------------------------------------------*/
85
86
87/*----------------------------------------------------------------------------
88 * Global Data Definitions
89 * -------------------------------------------------------------------------*/
90
91/*----------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -070092 * External declarations for global context
Jeff Johnson295189b2012-06-20 16:38:30 -070093 * -------------------------------------------------------------------------*/
94// No! Get this from VOS.
95// The main per-Physical Link (per WLAN association) context.
Madan Mohan Koyyalamudidfd6aa82012-10-18 20:18:43 -070096ptSapContext gpSapCtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070097
98/*----------------------------------------------------------------------------
99 * Static Variable Definitions
100 * -------------------------------------------------------------------------*/
101
102/*----------------------------------------------------------------------------
103 * Static Function Declarations and Definitions
104 * -------------------------------------------------------------------------*/
105
106/*----------------------------------------------------------------------------
107 * Externalized Function Definitions
108* -------------------------------------------------------------------------*/
109
110/*----------------------------------------------------------------------------
111 * Function Declarations and Documentation
112 * -------------------------------------------------------------------------*/
113
114/*==========================================================================
115 FUNCTION WLANSAP_Open
116
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700117 DESCRIPTION
118 Called at driver initialization (vos_open). SAP will initialize
119 all its internal resources and will wait for the call to start to
120 register with the other modules.
121
122 DEPENDENCIES
123
124 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700125
126 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700127 pvosGCtx : Pointer to the global vos context; a handle to SAP's
128 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700129
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700130 RETURN VALUE
131 The result code associated with performing the operation
132
133 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
134 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700135 VOS_STATUS_SUCCESS: Success
136
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700137 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700138============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700139VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700140WLANSAP_Open
141(
142 v_PVOID_t pvosGCtx
143)
144{
145
146 ptSapContext pSapCtx = NULL;
147 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
148 VOS_ASSERT(pvosGCtx);
149 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700150 Allocate (and sanity check?!) SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700151 ------------------------------------------------------------------------*/
152 vos_alloc_context(pvosGCtx, VOS_MODULE_ID_SAP, (v_VOID_t **)&pSapCtx, sizeof(tSapContext));
153
154 if (NULL == pSapCtx)
155 {
156 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700157 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700158 return VOS_STATUS_E_FAULT;
159 }
160
Jeff Johnson295189b2012-06-20 16:38:30 -0700161 /*------------------------------------------------------------------------
162 Clean up SAP control block, initialize all values
163 ------------------------------------------------------------------------*/
164 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Open");
165
166 WLANSAP_CleanCB(pSapCtx, 0 /*do not empty*/);
167
Hanumantha Reddy Pothulaf30a2982015-05-15 15:02:30 +0530168 if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_init(&pSapCtx->staInfo_lock)))
169 {
170 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
171 "WLANSAP_Start failed init staInfo_lock");
172 vos_free_context(pvosGCtx, VOS_MODULE_ID_SAP, pSapCtx);
173 return VOS_STATUS_E_FAULT;
174 }
175
Jeff Johnson295189b2012-06-20 16:38:30 -0700176 // Setup the "link back" to the VOSS context
177 pSapCtx->pvosGCtx = pvosGCtx;
178
179 // Store a pointer to the SAP context provided by VOSS
180 gpSapCtx = pSapCtx;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700181
Jeff Johnson295189b2012-06-20 16:38:30 -0700182 /*------------------------------------------------------------------------
183 Allocate internal resources
184 ------------------------------------------------------------------------*/
185
186 return VOS_STATUS_SUCCESS;
187}// WLANSAP_Open
188
189/*==========================================================================
190 FUNCTION WLANSAP_Start
191
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700192 DESCRIPTION
193 Called as part of the overall start procedure (vos_start). SAP will
194 use this call to register with TL as the SAP entity for
195 SAP RSN frames.
Jeff Johnson295189b2012-06-20 16:38:30 -0700196
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700197 DEPENDENCIES
198
199 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700200
201 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700202 pvosGCtx : Pointer to the global vos context; a handle to SAP's
203 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700204
205 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700206 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700207
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700208 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
209 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700210 VOS_STATUS_SUCCESS: Success
211
212 SIDE EFFECTS
213============================================================================*/
214
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700215VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700216WLANSAP_Start
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700217(
218 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700219)
220{
Jeff Johnson295189b2012-06-20 16:38:30 -0700221 ptSapContext pSapCtx = NULL;
222
223 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
224
225 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
226 "WLANSAP_Start invoked successfully\n");
227 /*------------------------------------------------------------------------
228 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700229 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 ------------------------------------------------------------------------*/
231 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700232 if ( NULL == pSapCtx )
Jeff Johnson295189b2012-06-20 16:38:30 -0700233 {
234 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700235 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700236 return VOS_STATUS_E_FAULT;
237 }
238
239 /*------------------------------------------------------------------------
240 For now, presume security is not enabled.
241 -----------------------------------------------------------------------*/
242 pSapCtx->ucSecEnabled = WLANSAP_SECURITY_ENABLED_STATE;
243
244
245 /*------------------------------------------------------------------------
246 Now configure the roaming profile links. To SSID and bssid.
247 ------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700248 // We have room for two SSIDs.
249 pSapCtx->csrRoamProfile.SSIDs.numOfSSIDs = 1; // This is true for now.
250 pSapCtx->csrRoamProfile.SSIDs.SSIDList = pSapCtx->SSIDList; //Array of two
Jeff Johnson295189b2012-06-20 16:38:30 -0700251 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].SSID.length = 0;
252 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].handoffPermitted = VOS_FALSE;
253 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].ssidHidden = pSapCtx->SSIDList[0].ssidHidden;
254
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700255 pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; // This is true for now.
256 pSapCtx->csrRoamProfile.BSSIDs.bssid = &pSapCtx->bssid;
Jeff Johnson295189b2012-06-20 16:38:30 -0700257
258 // Now configure the auth type in the roaming profile. To open.
259 pSapCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700260
Jeff Johnson295189b2012-06-20 16:38:30 -0700261 if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pSapCtx->SapGlobalLock)))
262 {
263 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700264 "WLANSAP_Start failed init lock\n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700265 return VOS_STATUS_E_FAULT;
266 }
267
Jeff Johnson295189b2012-06-20 16:38:30 -0700268 return VOS_STATUS_SUCCESS;
269}/* WLANSAP_Start */
270
271/*==========================================================================
272
273 FUNCTION WLANSAP_Stop
274
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700275 DESCRIPTION
276 Called by vos_stop to stop operation in SAP, before close. SAP will suspend all
277 BT-AMP Protocol Adaption Layer operation and will wait for the close
278 request to clean up its resources.
Jeff Johnson295189b2012-06-20 16:38:30 -0700279
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700280 DEPENDENCIES
281
282 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700283
284 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700285 pvosGCtx : Pointer to the global vos context; a handle to SAP's
286 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700287
288 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700289 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700290
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700291 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
292 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700293 VOS_STATUS_SUCCESS: Success
294
295 SIDE EFFECTS
296============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700297VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700298WLANSAP_Stop
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700299(
300 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700301)
302{
303
Jeff Johnson295189b2012-06-20 16:38:30 -0700304 ptSapContext pSapCtx = NULL;
305
306 /*------------------------------------------------------------------------
307 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700308 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700309 ------------------------------------------------------------------------*/
310 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
311 "WLANSAP_Stop invoked successfully ");
312
313 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
314 if (NULL == pSapCtx)
315 {
316 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700317 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700318 return VOS_STATUS_E_FAULT;
319 }
320
321 sapFreeRoamProfile(&pSapCtx->csrRoamProfile);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700322
Jeff Johnson295189b2012-06-20 16:38:30 -0700323 if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pSapCtx->SapGlobalLock ) ) )
324 {
325 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700326 "WLANSAP_Stop failed destroy lock\n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700327 return VOS_STATUS_E_FAULT;
328 }
329 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700330 Stop SAP (de-register RSN handler!?)
Jeff Johnson295189b2012-06-20 16:38:30 -0700331 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700332
333 return VOS_STATUS_SUCCESS;
334}/* WLANSAP_Stop */
335
336/*==========================================================================
337 FUNCTION WLANSAP_Close
338
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700339 DESCRIPTION
340 Called by vos_close during general driver close procedure. SAP will clean up
341 all the internal resources.
Jeff Johnson295189b2012-06-20 16:38:30 -0700342
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700343 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700344
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700345 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700346
347 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700348 pvosGCtx : Pointer to the global vos context; a handle to SAP's
349 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700350
351 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700352 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700353
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700354 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
355 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700356 VOS_STATUS_SUCCESS: Success
357
358 SIDE EFFECTS
359============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700360VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700361WLANSAP_Close
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700362(
363 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700364)
365{
Jeff Johnson295189b2012-06-20 16:38:30 -0700366 ptSapContext pSapCtx = NULL;
367 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
368
369 /*------------------------------------------------------------------------
370 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700371 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 ------------------------------------------------------------------------*/
373 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
374 "WLANSAP_Close invoked");
375
376 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
377 if (NULL == pSapCtx)
378 {
379 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700380 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700381 return VOS_STATUS_E_FAULT;
382 }
383
384 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700385 Cleanup SAP control block.
Jeff Johnson295189b2012-06-20 16:38:30 -0700386 ------------------------------------------------------------------------*/
387 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Close");
388 WLANSAP_CleanCB(pSapCtx, VOS_TRUE /* empty queues/lists/pkts if any*/);
389
390 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700391 Free SAP context from VOSS global
Jeff Johnson295189b2012-06-20 16:38:30 -0700392 ------------------------------------------------------------------------*/
393 vos_free_context(pvosGCtx, VOS_MODULE_ID_SAP, pSapCtx);
394
Jeff Johnson295189b2012-06-20 16:38:30 -0700395 return VOS_STATUS_SUCCESS;
396}/* WLANSAP_Close */
397
398/*----------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700399 * Utility Function implementations
Jeff Johnson295189b2012-06-20 16:38:30 -0700400 * -------------------------------------------------------------------------*/
401
402/*==========================================================================
403
404 FUNCTION WLANSAP_CleanCB
405
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700406 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700407 Clear out all fields in the SAP context.
408
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700409 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700410
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700411 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700412
413 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700414 pvosGCtx : Pointer to the global vos context; a handle to SAP's
415 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700416
417 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700418 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700419
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700420 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
421 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700422 VOS_STATUS_SUCCESS: Success
423
424 SIDE EFFECTS
425============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700426VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700427WLANSAP_CleanCB
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700428(
Jeff Johnson295189b2012-06-20 16:38:30 -0700429 ptSapContext pSapCtx,
430 v_U32_t freeFlag // 0 /*do not empty*/);
431)
432{
Jeff Johnson295189b2012-06-20 16:38:30 -0700433 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700434 Sanity check SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700435 ------------------------------------------------------------------------*/
436
437 if (NULL == pSapCtx)
438 {
439 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700440 "%s: Invalid SAP pointer", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 return VOS_STATUS_E_FAULT;
442 }
443
444 /*------------------------------------------------------------------------
445 Clean up SAP control block, initialize all values
446 ------------------------------------------------------------------------*/
447 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_CleanCB");
448
449 vos_mem_zero( pSapCtx, sizeof(tSapContext));
450
451 pSapCtx->pvosGCtx = NULL;
452
453 pSapCtx->sapsMachine= eSAP_DISCONNECTED;
454
Gopichand Nakkala66c0bd02013-04-10 11:36:29 +0530455 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d, sapContext value = %p",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700456 __func__, pSapCtx->sapsMachine, pSapCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -0700457 pSapCtx->sessionId = 0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700458 pSapCtx->channel = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700459
Jeff Johnson295189b2012-06-20 16:38:30 -0700460 return VOS_STATUS_SUCCESS;
461}// WLANSAP_CleanCB
462
463/*==========================================================================
464 FUNCTION WLANSAP_pmcFullPwrReqCB
465
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700466 DESCRIPTION
467 Callback provide to PMC in the pmcRequestFullPower API.
Jeff Johnson295189b2012-06-20 16:38:30 -0700468
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700469 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700470
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700471 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700472
473 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700474 callbackContext: The user passed in a context to identify
475 status: The halStatus
Jeff Johnson295189b2012-06-20 16:38:30 -0700476
477 RETURN VALUE
478 None
479
480 SIDE EFFECTS
481============================================================================*/
482void
483WLANSAP_pmcFullPwrReqCB
484(
485 void *callbackContext,
486 eHalStatus status
487)
488{
489 if(HAL_STATUS_SUCCESS(status))
490 {
491 //If success what else to be handled???
492 }
493 else
494 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700495 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -0700496 "WLANSAP_pmcFullPwrReqCB: PMC failed to put the chip in Full power\n");
497
Jeff Johnson295189b2012-06-20 16:38:30 -0700498 }
499
500}// WLANSAP_pmcFullPwrReqCB
501/*==========================================================================
502 FUNCTION WLANSAP_getState
503
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700504 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700505 This api returns the current SAP state to the caller.
506
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700507 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700508
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700509 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700510
511 IN
512 pContext : Pointer to Sap Context structure
513
514 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700515 Returns the SAP FSM state.
Jeff Johnson295189b2012-06-20 16:38:30 -0700516============================================================================*/
517
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700518v_U8_t WLANSAP_getState
Jeff Johnson295189b2012-06-20 16:38:30 -0700519(
520 v_PVOID_t pvosGCtx
521)
522{
523 ptSapContext pSapCtx = NULL;
524
525 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
526
527 if ( NULL == pSapCtx )
528 {
529 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700530 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700531 return VOS_STATUS_E_FAULT;
532 }
533 return pSapCtx->sapsMachine;
534}
535
536/*==========================================================================
537 FUNCTION WLANSAP_StartBss
538
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700539 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700540 This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for
541 starting AP BSS
542
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700543 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700544
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700545 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700546
547 IN
548 pContext : Pointer to Sap Context structure
549 pQctCommitConfig : Pointer to configuration structure passed down from HDD(HostApd for Android)
550 hdd_SapEventCallback: Callback function in HDD called by SAP to inform HDD about SAP results
551 pUsrContext : Parameter that will be passed back in all the SAP callback events.
552
553 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700554 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700555
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700556 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
557 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700558 VOS_STATUS_SUCCESS: Success
559
560 SIDE EFFECTS
561============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700562VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700563WLANSAP_StartBss
564(
565 v_PVOID_t pvosGCtx,//pwextCtx
566 tpWLAN_SAPEventCB pSapEventCallback,
567 tsap_Config_t *pConfig,
568 v_PVOID_t pUsrContext
569)
570{
571 tWLAN_SAPEvent sapEvent; /* State machine event*/
572 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
573 ptSapContext pSapCtx = NULL;
574 tANI_BOOLEAN restartNeeded;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700575 tHalHandle hHal;
576
Jeff Johnson295189b2012-06-20 16:38:30 -0700577 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
578
579 /*------------------------------------------------------------------------
580 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700581 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700582 ------------------------------------------------------------------------*/
583 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
584 "WLANSAP_StartBss");
585
586 if (VOS_STA_SAP_MODE == vos_get_conparam ())
587 {
588 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
589 if ( NULL == pSapCtx )
590 {
591 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700592 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 return VOS_STATUS_E_FAULT;
594 }
595 pSapCtx->sapsMachine = eSAP_DISCONNECTED;
596
597 /* Channel selection is auto or configured */
598 pSapCtx->channel = pConfig->channel;
Peng Xu2446a892014-09-05 17:21:18 +0530599 pSapCtx->scanBandPreference = pConfig->scanBandPreference;
Peng Xuafc34e32014-09-25 13:23:55 +0530600 pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold;
Jeff Johnson295189b2012-06-20 16:38:30 -0700601 pSapCtx->pUsrContext = pUsrContext;
602
603 //Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD
604 pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1;
Jeff Johnson295189b2012-06-20 16:38:30 -0700605
606 //Save a copy to SAP context
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700607 vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700608 pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t));
609 vos_mem_copy(pSapCtx->self_mac_addr,
610 pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t));
611
612 //copy the configuration items to csrProfile
613 sapconvertToCsrProfile( pConfig, eCSR_BSS_TYPE_INFRA_AP, &pSapCtx->csrRoamProfile);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700614 hHal = (tHalHandle)VOS_GET_HAL_CB(pvosGCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -0700615 if (NULL == hHal)
616 {
617 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700618 "%s: Invalid MAC context from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700619 }
620 else
621 {
622 //If concurrent session is running that is already associated
623 //then we just follow that sessions country info (whether
624 //present or not doesn't maater as we have to follow whatever
625 //STA session does)
Rajkumar Manoharaned6fd542013-11-26 22:55:16 +0530626 if ((0 == sme_GetConcurrentOperationChannel(hHal)) &&
627 pConfig->ieee80211d)
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 {
629 /* Setting the region/country information */
630 sme_setRegInfo(hHal, pConfig->countryCode);
631 sme_ResetCountryCodeInformation(hHal, &restartNeeded);
632 }
633 }
634
635 // Copy MAC filtering settings to sap context
636 pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
637 vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac));
638 pSapCtx->nAcceptMac = pConfig->num_accept_mac;
639 sapSortMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
640 vos_mem_copy(pSapCtx->denyMacList, pConfig->deny_mac, sizeof(pConfig->deny_mac));
641 pSapCtx->nDenyMac = pConfig->num_deny_mac;
642 sapSortMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac);
643
644 /* Fill in the event structure for FSM */
645 sapEvent.event = eSAP_HDD_START_INFRA_BSS;
646 sapEvent.params = 0;//pSapPhysLinkCreate
647
648 /* Store the HDD callback in SAP context */
649 pSapCtx->pfnSapEventCallback = pSapEventCallback;
650
651 /* Handle event*/
652 vosStatus = sapFsm(pSapCtx, &sapEvent);
653 }
654 else
655 {
656 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
657 "SoftAp role has not been enabled");
658 }
659
660 return vosStatus;
661}// WLANSAP_StartBss
662
663/*==========================================================================
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -0700664 FUNCTION WLANSAP_SetMacACL
665
666 DESCRIPTION
667 This api function provides SAP to set mac list entry in accept list as well
668 as deny list
669
670 DEPENDENCIES
671
672 PARAMETERS
673
674 IN
675 pContext : Pointer to Sap Context structure
676 pQctCommitConfig : Pointer to configuration structure passed down from
677 HDD(HostApd for Android)
678
679 RETURN VALUE
680 The result code associated with performing the operation
681
682 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
683 fault
684 VOS_STATUS_SUCCESS: Success
685
686 SIDE EFFECTS
687============================================================================*/
688VOS_STATUS
689WLANSAP_SetMacACL
690(
691 v_PVOID_t pvosGCtx, //pwextCtx
692 tsap_Config_t *pConfig
693)
694{
695 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
696 ptSapContext pSapCtx = NULL;
697
698 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
699 "WLANSAP_SetMacACL");
700
701 if (VOS_STA_SAP_MODE == vos_get_conparam ())
702 {
703 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
704 if ( NULL == pSapCtx )
705 {
706 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
707 "%s: Invalid SAP pointer from pvosGCtx", __func__);
708 return VOS_STATUS_E_FAULT;
709 }
710
711 // Copy MAC filtering settings to sap context
712 pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
713
714 if (eSAP_DENY_UNLESS_ACCEPTED == pSapCtx->eSapMacAddrAclMode)
715 {
716 vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac,
717 sizeof(pConfig->accept_mac));
718 pSapCtx->nAcceptMac = pConfig->num_accept_mac;
719 sapSortMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
720 }
721 else if (eSAP_ACCEPT_UNLESS_DENIED == pSapCtx->eSapMacAddrAclMode)
722 {
723 vos_mem_copy(pSapCtx->denyMacList, pConfig->deny_mac,
724 sizeof(pConfig->deny_mac));
725 pSapCtx->nDenyMac = pConfig->num_deny_mac;
726 sapSortMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac);
727 }
728 }
729 else
730 {
731 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
732 "%s : SoftAp role has not been enabled", __func__);
733 return VOS_STATUS_E_FAULT;
734 }
735
736 return vosStatus;
737}//WLANSAP_SetMacACL
738
739/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -0700740 FUNCTION WLANSAP_StopBss
741
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700742 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700743 This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for
744 stopping AP BSS
745
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700746 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700747
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700748 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700749
750 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700751 pvosGCtx : Pointer to the global vos context; a handle to SAP's
Jeff Johnson295189b2012-06-20 16:38:30 -0700752 control block can be extracted from its contexe
753
754 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700755 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700756
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700757 VOS_STATUS_E_FAULT: Pointer to VOSS GC is NULL ; access would cause a page
758 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700759 VOS_STATUS_SUCCESS: Success
760
761 SIDE EFFECTS
762============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700763VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700764WLANSAP_StopBss
765(
766 v_PVOID_t pvosGCtx
767)
768{
769 tWLAN_SAPEvent sapEvent; /* State machine event*/
770 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
771 ptSapContext pSapCtx = NULL;
772 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
773
774 /*------------------------------------------------------------------------
775 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700776 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 ------------------------------------------------------------------------*/
778 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
779 "WLANSAP_StopBss");
780
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700781 if ( NULL == pvosGCtx )
Jeff Johnson295189b2012-06-20 16:38:30 -0700782 {
783 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700784 "%s: Invalid Global VOSS handle", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700785 return VOS_STATUS_E_FAULT;
786 }
787
788 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
789
790 if (NULL == pSapCtx )
791 {
792 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700793 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 return VOS_STATUS_E_FAULT;
795 }
796
797 /* Fill in the event structure for FSM */
798 sapEvent.event = eSAP_HDD_STOP_INFRA_BSS;
799 sapEvent.params = 0;
800
801 /* Handle event*/
802 vosStatus = sapFsm(pSapCtx, &sapEvent);
803
804 return vosStatus;
805}
806
807/*==========================================================================
808 FUNCTION WLANSAP_GetAssocStations
809
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700810 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700811 This api function is used to probe the list of associated stations from various modules of CORE stack
812
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700813 DEPENDENCIES
814 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700815
816 PARAMETERS
817
818 IN
819 pvosGCtx : Pointer to vos global context structure
820 modId : Module from whom list of associtated stations is supposed to be probed. If an invalid module is passed
821 then by default VOS_MODULE_ID_PE will be probed
822 IN/OUT
823 pAssocStas : Pointer to list of associated stations that are known to the module specified in mod parameter
824
825 NOTE: The memory for this list will be allocated by the caller of this API
826
827 RETURN VALUE
828 The VOS_STATUS code associated with performing the operation
829
830 VOS_STATUS_SUCCESS: Success
831
832 SIDE EFFECTS
833============================================================================*/
834VOS_STATUS
835WLANSAP_GetAssocStations
836(
837 v_PVOID_t pvosGCtx,
838 VOS_MODULE_ID modId,
839 tpSap_AssocMacAddr pAssocStas
840)
841{
842 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
843
844 /*------------------------------------------------------------------------
845 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700846 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700847 ------------------------------------------------------------------------*/
848 if (NULL == pSapCtx)
849 {
850 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700851 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700852 return VOS_STATUS_E_FAULT;
853 }
854
855 sme_RoamGetAssociatedStas( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
856 modId,
857 pSapCtx->pUsrContext,
858 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
859 (v_U8_t *)pAssocStas );
860
861 return VOS_STATUS_SUCCESS;
862}
863
864
865/*==========================================================================
866 FUNCTION WLANSAP_RemoveWpsSessionOverlap
867
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700868 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700869 This api function provides for Ap App/HDD to remove an entry from session session overlap info.
870
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700871 DEPENDENCIES
872 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700873
874 PARAMETERS
875
876 IN
877 pvosGCtx: Pointer to vos global context structure
878 pRemoveMac: pointer to v_MACADDR_t for session MAC address
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700879
Jeff Johnson295189b2012-06-20 16:38:30 -0700880 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700881 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700882
883 VOS_STATUS_SUCCESS: Success
884 VOS_STATUS_E_FAULT: Session is not dectected. The parameter is function not valid.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700885
886 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700887============================================================================*/
888VOS_STATUS
889WLANSAP_RemoveWpsSessionOverlap
890
891(
892 v_PVOID_t pvosGCtx,
893 v_MACADDR_t pRemoveMac
894)
895{
896 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
897
898 /*------------------------------------------------------------------------
899 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700900 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700901 ------------------------------------------------------------------------*/
902 if (NULL == pSapCtx)
903 {
904 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700905 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 return VOS_STATUS_E_FAULT;
907 }
908
909 sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
910 pSapCtx->pUsrContext,
911 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
912 pRemoveMac);
913
914 return VOS_STATUS_SUCCESS;
915}
916
917/*==========================================================================
918 FUNCTION WLANSAP_getWpsSessionOverlap
919
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700920 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700921 This api function provides for Ap App/HDD to get WPS session overlap info.
922
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700923 DEPENDENCIES
924 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700925
926 PARAMETERS
927
928 IN
929 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700930
Jeff Johnson295189b2012-06-20 16:38:30 -0700931 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700932 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700933
934 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700935
936 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700937============================================================================*/
938VOS_STATUS
939WLANSAP_getWpsSessionOverlap
940(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700941 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700942)
943{
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700944 v_MACADDR_t pRemoveMac = VOS_MAC_ADDR_ZERO_INITIALIZER;
Jeff Johnson295189b2012-06-20 16:38:30 -0700945
946 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
947
948 /*------------------------------------------------------------------------
949 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700950 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700951 ------------------------------------------------------------------------*/
952 if (NULL == pSapCtx)
953 {
954 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700955 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700956 return VOS_STATUS_E_FAULT;
957 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700958
Jeff Johnson295189b2012-06-20 16:38:30 -0700959 sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
960 pSapCtx->pUsrContext,
961 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
962 pRemoveMac);
963
964 return VOS_STATUS_SUCCESS;
965}
966
967
968/* This routine will set the mode of operation for ACL dynamically*/
969VOS_STATUS
970WLANSAP_SetMode ( v_PVOID_t pvosGCtx, v_U32_t mode)
971{
972 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
973
974 if (NULL == pSapCtx)
975 {
976 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700977 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700978 return VOS_STATUS_E_FAULT;
979 }
980
981 pSapCtx->eSapMacAddrAclMode = (eSapMacAddrACL)mode;
982 return VOS_STATUS_SUCCESS;
983}
984
985/* This routine will clear all the entries in accept list as well as deny list */
986
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700987VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700988WLANSAP_ClearACL( v_PVOID_t pvosGCtx)
989{
990 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
991 v_U8_t i;
992
993 if (NULL == pSapCtx)
994 {
995 return VOS_STATUS_E_RESOURCES;
996 }
997
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700998 if (pSapCtx->denyMacList != NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700999 {
1000 for (i = 0; i < (pSapCtx->nDenyMac-1); i++)
1001 {
1002 vos_mem_zero((pSapCtx->denyMacList+i)->bytes, sizeof(v_MACADDR_t));
1003
1004 }
1005 }
1006 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1007 pSapCtx->nDenyMac = 0;
1008
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001009 if (pSapCtx->acceptMacList!=NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001010 {
1011 for (i = 0; i < (pSapCtx->nAcceptMac-1); i++)
1012 {
1013 vos_mem_zero((pSapCtx->acceptMacList+i)->bytes, sizeof(v_MACADDR_t));
1014
1015 }
1016 }
1017 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1018 pSapCtx->nAcceptMac = 0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001019
Jeff Johnson295189b2012-06-20 16:38:30 -07001020 return VOS_STATUS_SUCCESS;
1021}
1022
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001023VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001024WLANSAP_ModifyACL
1025(
1026 v_PVOID_t pvosGCtx,
1027 v_U8_t *pPeerStaMac,
1028 eSapACLType listType,
1029 eSapACLCmdType cmd
1030)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001031{
Jeff Johnson295189b2012-06-20 16:38:30 -07001032 eSapBool staInWhiteList=eSAP_FALSE, staInBlackList=eSAP_FALSE;
1033 v_U8_t staWLIndex, staBLIndex;
1034 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1035
1036 if (NULL == pSapCtx)
1037 {
1038 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001039 "%s: Invalid SAP Context", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001040 return VOS_STATUS_E_FAULT;
1041 }
1042
1043 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"Modify ACL entered\n"
1044 "Before modification of ACL\n"
1045 "size of accept and deny lists %d %d",
1046 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1047 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***");
1048 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1049 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***");
1050 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1051
1052 /* the expectation is a mac addr will not be in both the lists at the same time.
1053 It is the responsiblity of userspace to ensure this */
1054 staInWhiteList = sapSearchMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac, pPeerStaMac, &staWLIndex);
1055 staInBlackList = sapSearchMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac, pPeerStaMac, &staBLIndex);
1056
1057 if (staInWhiteList && staInBlackList)
1058 {
1059 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001060 "Peer mac "MAC_ADDRESS_STR" found in white and black lists."
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001061 "Initial lists passed incorrect. Cannot execute this command.",
Arif Hussain24bafea2013-11-15 15:10:03 -08001062 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001063 return VOS_STATUS_E_FAILURE;
1064
1065 }
1066
1067 switch(listType)
1068 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001069 case eSAP_WHITE_LIST:
Jeff Johnson295189b2012-06-20 16:38:30 -07001070 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "cmd %d", cmd);
1071 if (cmd == ADD_STA_TO_ACL)
1072 {
1073 //error check
1074 // if list is already at max, return failure
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -07001075 if (pSapCtx->nAcceptMac == MAX_ACL_MAC_ADDRESS)
Jeff Johnson295189b2012-06-20 16:38:30 -07001076 {
1077 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001078 "White list is already maxed out. Cannot accept "MAC_ADDRESS_STR,
1079 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001080 return VOS_STATUS_E_FAILURE;
1081 }
1082 if (staInWhiteList)
1083 {
1084 //Do nothing if already present in white list. Just print a warning
1085 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001086 "MAC address already present in white list "MAC_ADDRESS_STR,
1087 MAC_ADDR_ARRAY(pPeerStaMac));
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001088 } else
Jeff Johnson295189b2012-06-20 16:38:30 -07001089 {
1090 if (staInBlackList)
1091 {
1092 //remove it from black list before adding to the white list
1093 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
1094 "STA present in black list so first remove from it");
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001095 sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001096 }
1097 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001098 "... Now add to the white list");
Jeff Johnson295189b2012-06-20 16:38:30 -07001099 sapAddMacToACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, pPeerStaMac);
1100 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d",
1101 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001102 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001103 }
1104 else if (cmd == DELETE_STA_FROM_ACL)
1105 {
1106 if (staInWhiteList)
1107 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001108 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from white list");
1109 sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001110 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d",
1111 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1112 }
1113 else
1114 {
1115 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001116 "MAC address to be deleted is not present in the white list "MAC_ADDRESS_STR,
1117 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001118 return VOS_STATUS_E_FAILURE;
1119 }
1120 }
1121 else
1122 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001123 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed");
Jeff Johnson295189b2012-06-20 16:38:30 -07001124 return VOS_STATUS_E_FAILURE;
1125 }
1126 break;
1127
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001128 case eSAP_BLACK_LIST:
Jeff Johnson295189b2012-06-20 16:38:30 -07001129 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
1130 "cmd %d", cmd);
1131 if (cmd == ADD_STA_TO_ACL)
1132 {
1133 //error check
1134 // if list is already at max, return failure
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -07001135 if (pSapCtx->nDenyMac == MAX_ACL_MAC_ADDRESS)
Jeff Johnson295189b2012-06-20 16:38:30 -07001136 {
1137 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001138 "Black list is already maxed out. Cannot accept "MAC_ADDRESS_STR,
1139 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001140 return VOS_STATUS_E_FAILURE;
1141 }
1142 if (staInBlackList)
1143 {
1144 //Do nothing if already present in white list
1145 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001146 "MAC address already present in black list "MAC_ADDRESS_STR,
1147 MAC_ADDR_ARRAY(pPeerStaMac));
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001148 } else
Jeff Johnson295189b2012-06-20 16:38:30 -07001149 {
1150 if (staInWhiteList)
1151 {
1152 //remove it from white list before adding to the white list
1153 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
1154 "Present in white list so first remove from it");
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001155 sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 }
1157 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001158 "... Now add to black list");
Jeff Johnson295189b2012-06-20 16:38:30 -07001159 sapAddMacToACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, pPeerStaMac);
1160 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"size of accept and deny lists %d %d",
1161 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001162 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 }
1164 else if (cmd == DELETE_STA_FROM_ACL)
1165 {
1166 if (staInBlackList)
1167 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001168 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from black list");
1169 sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001170 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"no accept and deny mac %d %d",
1171 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1172 }
1173 else
1174 {
1175 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001176 "MAC address to be deleted is not present in the black list "MAC_ADDRESS_STR,
1177 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001178 return VOS_STATUS_E_FAILURE;
1179 }
1180 }
1181 else
1182 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001183 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed");
Jeff Johnson295189b2012-06-20 16:38:30 -07001184 return VOS_STATUS_E_FAILURE;
1185 }
1186 break;
1187
1188 default:
1189 {
1190 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1191 "Invalid list type passed %d",listType);
1192 return VOS_STATUS_E_FAILURE;
1193 }
1194 }
1195 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"After modification of ACL");
1196 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***");
1197 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1198 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***");
1199 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1200 return VOS_STATUS_SUCCESS;
1201}
1202
1203/*==========================================================================
1204 FUNCTION WLANSAP_DisassocSta
1205
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001206 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001207 This api function provides for Ap App/HDD initiated disassociation of station
1208
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001209 DEPENDENCIES
1210 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001211
1212 PARAMETERS
1213
1214 IN
1215 pvosGCtx : Pointer to vos global context structure
1216 pPeerStaMac : Mac address of the station to disassociate
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001217
Jeff Johnson295189b2012-06-20 16:38:30 -07001218 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001219 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001220
1221 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001222
1223 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001224============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001225VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001226WLANSAP_DisassocSta
1227(
1228 v_PVOID_t pvosGCtx,
Deepthi Gowri0f7566d2015-12-14 18:41:14 +05301229#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
1230 const v_U8_t *pPeerStaMac
1231#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001232 v_U8_t *pPeerStaMac
Deepthi Gowri0f7566d2015-12-14 18:41:14 +05301233#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001234)
1235{
1236 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1237
1238 /*------------------------------------------------------------------------
1239 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001240 Extract SAP control block
1241 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 if (NULL == pSapCtx)
1243 {
1244 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001245 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001246 return VOS_STATUS_E_FAULT;
1247 }
1248
1249 sme_RoamDisconnectSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
1250 pPeerStaMac);
1251
1252 return VOS_STATUS_SUCCESS;
1253}
1254
Jeff Johnson295189b2012-06-20 16:38:30 -07001255/*==========================================================================
1256 FUNCTION WLANSAP_DeauthSta
1257
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001258 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001259 This api function provides for Ap App/HDD initiated deauthentication of station
1260
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001261 DEPENDENCIES
1262 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001263
1264 PARAMETERS
1265
1266 IN
1267 pvosGCtx : Pointer to vos global context structure
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301268 pDelStaParams : Pointer to parameters of the station to
1269 deauthenticate
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001270
Jeff Johnson295189b2012-06-20 16:38:30 -07001271 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001272 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001273
1274 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001275
1276 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001277============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001278VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001279WLANSAP_DeauthSta
1280(
1281 v_PVOID_t pvosGCtx,
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301282 struct tagCsrDelStaParams *pDelStaParams
Jeff Johnson295189b2012-06-20 16:38:30 -07001283)
1284{
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001285 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1286 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1288
1289 /*------------------------------------------------------------------------
1290 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001291 Extract SAP control block
1292 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -07001293 if (NULL == pSapCtx)
1294 {
1295 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001296 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001297 return vosStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 }
1299
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301300 halStatus = sme_RoamDeauthSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx),
1301 pSapCtx->sessionId, pDelStaParams);
Jeff Johnson295189b2012-06-20 16:38:30 -07001302
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001303 if (halStatus == eHAL_STATUS_SUCCESS)
1304 {
1305 vosStatus = VOS_STATUS_SUCCESS;
1306 }
1307 return vosStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001308}
1309/*==========================================================================
1310 FUNCTION WLANSAP_SetChannelRange
1311
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001312 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001313 This api function sets the range of channels for AP.
1314
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001315 DEPENDENCIES
1316 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001317
1318 PARAMETERS
1319
1320 IN
1321 startChannel : start channel
1322 endChannel : End channel
1323 operatingBand : Operating band (2.4GHz/5GHz)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001324
Jeff Johnson295189b2012-06-20 16:38:30 -07001325 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001326 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001327
1328 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001329
1330 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001331============================================================================*/
1332VOS_STATUS
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001333WLANSAP_SetChannelRange(tHalHandle hHal,v_U8_t startChannel, v_U8_t endChannel,
Leela Venkata Kiran Kumar Reddy Chirala9f6566c2014-09-05 19:06:58 +05301334 eSapOperatingBand operatingBand)
Jeff Johnson295189b2012-06-20 16:38:30 -07001335{
1336
1337 v_U8_t validChannelFlag =0;
1338 v_U8_t loopStartCount =0;
1339 v_U8_t loopEndCount =0;
1340 v_U8_t bandStartChannel =0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001341 v_U8_t bandEndChannel =0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001342
1343 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
1344 "WLANSAP_SetChannelRange:startChannel %d,EndChannel %d,Operatingband:%d",
1345 startChannel,endChannel,operatingBand);
1346
1347 /*------------------------------------------------------------------------
1348 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001349 ------------------------------------------------------------------------*/
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001350 if (( WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMIN > operatingBand) ||
1351 (WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMAX < operatingBand))
Jeff Johnson295189b2012-06-20 16:38:30 -07001352 {
1353 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1354 "Invalid operatingBand on WLANSAP_SetChannelRange");
1355 return VOS_STATUS_E_FAULT;
1356 }
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001357 if (( WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMIN > startChannel) ||
1358 (WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMAX < startChannel))
Jeff Johnson295189b2012-06-20 16:38:30 -07001359 {
1360 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1361 "Invalid startChannel value on WLANSAP_SetChannelRange");
1362 return VOS_STATUS_E_FAULT;
1363 }
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001364 if (( WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMIN > endChannel) ||
1365 (WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMAX < endChannel))
Jeff Johnson295189b2012-06-20 16:38:30 -07001366 {
1367 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1368 "Invalid endChannel value on WLANSAP_SetChannelRange");
1369 return VOS_STATUS_E_FAULT;
1370 }
1371 switch(operatingBand)
1372 {
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301373 case eSAP_RF_SUBBAND_2_4_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001374 bandStartChannel = RF_CHAN_1;
1375 bandEndChannel = RF_CHAN_14;
1376 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001377
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301378 case eSAP_RF_SUBBAND_5_LOW_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 bandStartChannel = RF_CHAN_36;
1380 bandEndChannel = RF_CHAN_64;
1381 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001382
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301383 case eSAP_RF_SUBBAND_5_MID_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001384 bandStartChannel = RF_CHAN_100;
Leo Chang80de3c22013-11-26 10:52:12 -08001385#ifndef FEATURE_WLAN_CH144
Jeff Johnson295189b2012-06-20 16:38:30 -07001386 bandEndChannel = RF_CHAN_140;
Leo Chang80de3c22013-11-26 10:52:12 -08001387#else
1388 bandEndChannel = RF_CHAN_144;
1389#endif /* FEATURE_WLAN_CH144 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001390 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001391
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301392 case eSAP_RF_SUBBAND_5_HIGH_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001393 bandStartChannel = RF_CHAN_149;
1394 bandEndChannel = RF_CHAN_165;
1395 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001396
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301397 case eSAP_RF_SUBBAND_5_ALL_GHZ:
1398 bandStartChannel = RF_CHAN_36;
1399 bandEndChannel = RF_CHAN_165;
1400 break;
1401
Jeff Johnson295189b2012-06-20 16:38:30 -07001402 default:
1403 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1404 "Invalid operatingBand value on WLANSAP_SetChannelRange");
1405 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001406 }
1407
Jeff Johnson295189b2012-06-20 16:38:30 -07001408 /* Validating the start channel is in range or not*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001409 for(loopStartCount = bandStartChannel ; loopStartCount <= bandEndChannel ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001410 loopStartCount++)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001411 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001412 if(rfChannels[loopStartCount].channelNum == startChannel )
1413 {
1414 /* start channel is in the range */
1415 break;
1416 }
1417 }
1418 /* Validating the End channel is in range or not*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001419 for(loopEndCount = bandStartChannel ; loopEndCount <= bandEndChannel ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001420 loopEndCount++)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001421 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001422 if(rfChannels[loopEndCount].channelNum == endChannel )
1423 {
1424 /* End channel is in the range */
1425 break;
1426 }
1427 }
1428 if((loopStartCount > bandEndChannel)||(loopEndCount > bandEndChannel))
1429 {
1430 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1431 "%s: Invalid startChannel-%d or EndChannel-%d for band -%d",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001432 __func__,startChannel,endChannel,operatingBand);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001433 /* Supplied channels are nt in the operating band so set the default
Jeff Johnson295189b2012-06-20 16:38:30 -07001434 channels for the given operating band */
1435 startChannel = rfChannels[bandStartChannel].channelNum;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -07001436 endChannel = rfChannels[bandEndChannel].channelNum;
Jeff Johnson295189b2012-06-20 16:38:30 -07001437 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001438
Jeff Johnson295189b2012-06-20 16:38:30 -07001439 /*Search for the Active channels in the given range */
1440 for( loopStartCount = bandStartChannel; loopStartCount <= bandEndChannel; loopStartCount++ )
1441 {
1442 if((startChannel <= rfChannels[loopStartCount].channelNum)&&
1443 (endChannel >= rfChannels[loopStartCount].channelNum ))
1444 {
1445 if( regChannels[loopStartCount].enabled )
1446 {
1447 validChannelFlag = 1;
1448 break;
1449 }
1450 }
1451 }
1452 if(0 == validChannelFlag)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001453 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001454 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1455 "%s-No active channels present in the given range for the current region",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001456 __func__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001457 /* There is no active channel in the supplied range.Updating the config
Jeff Johnson295189b2012-06-20 16:38:30 -07001458 with the default channels in the given band so that we can select the best channel in the sub-band*/
1459 startChannel = rfChannels[bandStartChannel].channelNum;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -07001460 endChannel = rfChannels[bandEndChannel].channelNum;
Jeff Johnson295189b2012-06-20 16:38:30 -07001461 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001462
1463 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND,
Jeff Johnson295189b2012-06-20 16:38:30 -07001464 operatingBand, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1465 {
1466 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1467 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND to CCn");
1468 return VOS_STATUS_E_FAULT;
1469 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001470 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL,
Jeff Johnson295189b2012-06-20 16:38:30 -07001471 startChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1472 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001473
Jeff Johnson295189b2012-06-20 16:38:30 -07001474 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1475 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
1476 return VOS_STATUS_E_FAULT;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001477
1478 }
1479 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL,
Jeff Johnson295189b2012-06-20 16:38:30 -07001480 endChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1481 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001482
Jeff Johnson295189b2012-06-20 16:38:30 -07001483 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1484 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
1485 return VOS_STATUS_E_FAULT;
1486 }
1487 return VOS_STATUS_SUCCESS;
1488}
Jeff Johnson295189b2012-06-20 16:38:30 -07001489
1490/*==========================================================================
1491 FUNCTION WLANSAP_SetCounterMeasure
1492
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001493 DESCRIPTION
1494 This api function is used to disassociate all the stations and prevent
1495 association for any other station.Whenever Authenticator receives 2 mic failures
1496 within 60 seconds, Authenticator will enable counter measure at SAP Layer.
1497 Authenticator will start the 60 seconds timer. Core stack will not allow any
1498 STA to associate till HDD disables counter meassure. Core stack shall kick out all the
1499 STA which are currently associated and DIASSOC Event will be propogated to HDD for
1500 each STA to clean up the HDD STA table.Once the 60 seconds timer expires, Authenticator
Jeff Johnson295189b2012-06-20 16:38:30 -07001501 will disable the counter meassure at core stack. Now core stack can allow STAs to associate.
1502
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001503 DEPENDENCIES
1504 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001505
1506 PARAMETERS
1507
1508 IN
1509pvosGCtx: Pointer to vos global context structure
1510bEnable: If TRUE than all stations will be disassociated and no more will be allowed to associate. If FALSE than CORE
1511will come out of this state.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001512
Jeff Johnson295189b2012-06-20 16:38:30 -07001513 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001514 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001515
1516 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001517
1518 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001519============================================================================*/
1520VOS_STATUS
1521WLANSAP_SetCounterMeasure
1522(
1523 v_PVOID_t pvosGCtx,
1524 v_BOOL_t bEnable
1525)
1526{
1527 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1528
1529 /*------------------------------------------------------------------------
1530 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001531 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -07001532 ------------------------------------------------------------------------*/
1533 if (NULL == pSapCtx)
1534 {
1535 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001536 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001537 return VOS_STATUS_E_FAULT;
1538 }
1539
1540 sme_RoamTKIPCounterMeasures(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, bEnable);
1541
1542 return VOS_STATUS_SUCCESS;
1543}
1544
1545/*==========================================================================
1546
1547 FUNCTION WLANSAP_SetKeysSta
1548
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001549 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001550 This api function provides for Ap App/HDD to set key for a station.
1551
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001552 DEPENDENCIES
1553 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001554
1555 PARAMETERS
1556
1557 IN
1558pvosGCtx: Pointer to vos global context structure
1559pSetKeyInfo: tCsrRoamSetKey structure for the station
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001560
Jeff Johnson295189b2012-06-20 16:38:30 -07001561 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001562 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001563
1564 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001565
1566 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001567============================================================================*/
1568VOS_STATUS
1569WLANSAP_SetKeySta
1570(
1571 v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo
1572)
1573{
1574 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
1575 ptSapContext pSapCtx = NULL;
1576 v_PVOID_t hHal = NULL;
1577 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1578 v_U32_t roamId=0xFF;
1579
1580 if (VOS_STA_SAP_MODE == vos_get_conparam ( ))
1581 {
1582 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1583 if (NULL == pSapCtx)
1584 {
1585 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001586 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001587 return VOS_STATUS_E_FAULT;
1588 }
1589 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1590 if (NULL == hHal)
1591 {
1592 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001593 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001594 return VOS_STATUS_E_FAULT;
1595 }
1596 halStatus = sme_RoamSetKey(hHal, pSapCtx->sessionId, pSetKeyInfo, &roamId);
1597
1598 if (halStatus == eHAL_STATUS_SUCCESS)
1599 {
1600 vosStatus = VOS_STATUS_SUCCESS;
1601 } else
1602 {
1603 vosStatus = VOS_STATUS_E_FAULT;
1604 }
1605 }
1606 else
1607 vosStatus = VOS_STATUS_E_FAULT;
1608
1609 return vosStatus;
1610}
1611
1612/*==========================================================================
1613 FUNCTION WLANSAP_DelKeySta
1614
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001615 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001616 This api function provides for Ap App/HDD to delete key for a station.
1617
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001618 DEPENDENCIES
1619 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001620
1621 PARAMETERS
1622
1623 IN
1624pvosGCtx: Pointer to vos global context structure
1625pSetKeyInfo: tCsrRoamRemoveKey structure for the station
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001626
Jeff Johnson295189b2012-06-20 16:38:30 -07001627 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001628 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001629
1630 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001631
1632 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001633============================================================================*/
1634VOS_STATUS
1635WLANSAP_DelKeySta
1636(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001637 v_PVOID_t pvosGCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -07001638 tCsrRoamRemoveKey *pRemoveKeyInfo
1639)
1640{
1641 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
1642 ptSapContext pSapCtx = NULL;
1643 v_PVOID_t hHal = NULL;
1644 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1645 v_U32_t roamId=0xFF;
1646 tCsrRoamRemoveKey RemoveKeyInfo;
1647
1648 if (VOS_STA_SAP_MODE == vos_get_conparam ( ))
1649 {
1650 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1651 if (NULL == pSapCtx)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001652 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001653 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001654 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001655 return VOS_STATUS_E_FAULT;
1656 }
1657
1658 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1659 if (NULL == hHal)
1660 {
1661 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001662 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001663 return VOS_STATUS_E_FAULT;
1664 }
1665
1666 vos_mem_zero(&RemoveKeyInfo, sizeof(RemoveKeyInfo));
1667 RemoveKeyInfo.encType = pRemoveKeyInfo->encType;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001668 vos_mem_copy(RemoveKeyInfo.peerMac, pRemoveKeyInfo->peerMac, WNI_CFG_BSSID_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07001669 RemoveKeyInfo.keyId = pRemoveKeyInfo->keyId;
1670
1671 halStatus = sme_RoamRemoveKey(hHal, pSapCtx->sessionId, &RemoveKeyInfo, &roamId);
1672
1673 if (HAL_STATUS_SUCCESS(halStatus))
1674 {
1675 vosStatus = VOS_STATUS_SUCCESS;
1676 }
1677 else
1678 {
1679 vosStatus = VOS_STATUS_E_FAULT;
1680 }
1681 }
1682 else
1683 vosStatus = VOS_STATUS_E_FAULT;
1684
1685 return vosStatus;
1686}
1687
1688VOS_STATUS
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001689WLANSap_getstationIE_information(v_PVOID_t pvosGCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -07001690 v_U32_t *pLen,
1691 v_U8_t *pBuf)
1692{
1693 VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE;
1694 ptSapContext pSapCtx = NULL;
1695 v_U32_t len = 0;
1696
1697 if (VOS_STA_SAP_MODE == vos_get_conparam ( )){
1698 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1699 if (NULL == pSapCtx)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001700 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001701 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001702 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001703 return VOS_STATUS_E_FAULT;
1704 }
1705 if (pLen)
1706 {
1707 len = *pLen;
1708 *pLen = pSapCtx->nStaWPARSnReqIeLength;
1709 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001710 "%s: WPAIE len : %x", __func__, *pLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07001711 if(pBuf)
1712 {
1713 if(len >= pSapCtx->nStaWPARSnReqIeLength)
1714 {
1715 vos_mem_copy( pBuf, pSapCtx->pStaWpaRsnReqIE, pSapCtx->nStaWPARSnReqIeLength);
1716 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
1717 "%s: WPAIE: %02x:%02x:%02x:%02x:%02x:%02x",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001718 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001719 pBuf[0], pBuf[1], pBuf[2],
1720 pBuf[3], pBuf[4], pBuf[5]);
1721 vosStatus = VOS_STATUS_SUCCESS;
1722 }
1723 }
1724 }
1725 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001726
Jeff Johnson295189b2012-06-20 16:38:30 -07001727 if( VOS_STATUS_E_FAILURE == vosStatus)
1728 {
1729 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1730 "%s: Error unable to populate the RSNWPAIE",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001731 __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001732 }
1733
1734 return vosStatus;
1735
1736}
1737
1738/*==========================================================================
1739 FUNCTION WLANSAP_Set_WpsIe
1740
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001741 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001742 This api function provides for Ap App/HDD to set WPS IE.
1743
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001744 DEPENDENCIES
1745 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001746
1747 PARAMETERS
1748
1749 IN
1750pvosGCtx: Pointer to vos global context structure
1751pWPSIE: tSap_WPSIE structure that include WPS IEs
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001752
Jeff Johnson295189b2012-06-20 16:38:30 -07001753 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001754 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001755
1756 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001757
1758 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001759============================================================================*/
1760VOS_STATUS
1761WLANSAP_Set_WpsIe
1762(
1763 v_PVOID_t pvosGCtx, tSap_WPSIE *pSap_WPSIe
1764)
1765{
1766 ptSapContext pSapCtx = NULL;
1767 v_PVOID_t hHal = NULL;
1768
1769 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001770 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001771
Jeff Johnson295189b2012-06-20 16:38:30 -07001772 if(VOS_STA_SAP_MODE == vos_get_conparam ( )) {
1773 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1774 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001775 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001776 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001777 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001778 return VOS_STATUS_E_FAULT;
1779 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001780
Jeff Johnson295189b2012-06-20 16:38:30 -07001781 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1782 if ( NULL == hHal ){
1783 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001784 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 return VOS_STATUS_E_FAULT;
1786 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001787
Jeff Johnson295189b2012-06-20 16:38:30 -07001788 if ( sap_AcquireGlobalLock( pSapCtx ) == VOS_STATUS_SUCCESS )
1789 {
1790 if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_BEACON_IE)
1791 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001792 vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSBeaconIE, &pSap_WPSIe->sapwpsie.sapWPSBeaconIE, sizeof(tSap_WPSBeaconIE));
Jeff Johnson295189b2012-06-20 16:38:30 -07001793 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001794 else if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_PROBE_RSP_IE)
Jeff Johnson295189b2012-06-20 16:38:30 -07001795 {
1796 vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSProbeRspIE, &pSap_WPSIe->sapwpsie.sapWPSProbeRspIE, sizeof(tSap_WPSProbeRspIE));
1797 }
1798 else
1799 {
1800 sap_ReleaseGlobalLock( pSapCtx );
1801 return VOS_STATUS_E_FAULT;
1802 }
1803 sap_ReleaseGlobalLock( pSapCtx );
1804 return VOS_STATUS_SUCCESS;
1805 }
1806 else
1807 return VOS_STATUS_E_FAULT;
1808 }
1809 else
1810 return VOS_STATUS_E_FAULT;
1811}
1812
1813/*==========================================================================
1814 FUNCTION WLANSAP_Update_WpsIe
1815
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001816 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001817 This api function provides for Ap App/HDD to update WPS IEs.
1818
1819 DEPENDENCIES
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001820 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001821
1822 PARAMETERS
1823
1824 IN
1825pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001826
Jeff Johnson295189b2012-06-20 16:38:30 -07001827 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001828 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001829
1830 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001831
1832 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001833============================================================================*/
1834VOS_STATUS
1835WLANSAP_Update_WpsIe
1836(
1837 v_PVOID_t pvosGCtx
1838)
1839{
1840 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1841 ptSapContext pSapCtx = NULL;
1842 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1843 v_PVOID_t hHal = NULL;
1844
1845 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001846 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001847
Jeff Johnson295189b2012-06-20 16:38:30 -07001848 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
1849 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1850 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001851 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001852 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001853 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001854 return VOS_STATUS_E_FAULT;
1855 }
1856
1857 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1858 if ( NULL == hHal ){
1859 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001860 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001861 return VOS_STATUS_E_FAULT;
1862 }
1863
1864 halStatus = sme_RoamUpdateAPWPSIE( hHal, pSapCtx->sessionId, &pSapCtx->APWPSIEs);
1865
1866 if(halStatus == eHAL_STATUS_SUCCESS) {
1867 vosStatus = VOS_STATUS_SUCCESS;
1868 } else
1869 {
1870 vosStatus = VOS_STATUS_E_FAULT;
1871 }
1872
1873 }
1874
1875 return vosStatus;
1876}
1877
1878/*==========================================================================
1879 FUNCTION WLANSAP_Get_WPS_State
1880
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001881 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001882 This api function provides for Ap App/HDD to check if WPS session in process.
1883
1884 DEPENDENCIES
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001885 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001886
1887 PARAMETERS
1888
1889 IN
1890pvosGCtx: Pointer to vos global context structure
1891
1892 OUT
1893pbWPSState: Pointer to variable to indicate if it is in WPS Registration state
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001894
Jeff Johnson295189b2012-06-20 16:38:30 -07001895 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001896 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001897
1898 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001899
1900 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001901============================================================================*/
1902VOS_STATUS
1903WLANSAP_Get_WPS_State
1904(
1905 v_PVOID_t pvosGCtx, v_BOOL_t *bWPSState
1906)
1907{
1908 ptSapContext pSapCtx = NULL;
1909 v_PVOID_t hHal = NULL;
1910
1911 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001912 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001913
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001915
Jeff Johnson295189b2012-06-20 16:38:30 -07001916 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1917 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001918 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001919 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001920 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001921 return VOS_STATUS_E_FAULT;
1922 }
1923
1924 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1925 if ( NULL == hHal ){
1926 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001927 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001928 return VOS_STATUS_E_FAULT;
1929 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001930
Jeff Johnson295189b2012-06-20 16:38:30 -07001931 if ( sap_AcquireGlobalLock(pSapCtx ) == VOS_STATUS_SUCCESS )
1932 {
1933 if(pSapCtx->APWPSIEs.SirWPSProbeRspIE.FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT)
1934 *bWPSState = eANI_BOOLEAN_TRUE;
1935 else
1936 *bWPSState = eANI_BOOLEAN_FALSE;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001937
Jeff Johnson295189b2012-06-20 16:38:30 -07001938 sap_ReleaseGlobalLock( pSapCtx );
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001939
Jeff Johnson295189b2012-06-20 16:38:30 -07001940 return VOS_STATUS_SUCCESS;
1941 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001942 else
Jeff Johnson295189b2012-06-20 16:38:30 -07001943 return VOS_STATUS_E_FAULT;
1944 }
1945 else
1946 return VOS_STATUS_E_FAULT;
1947
1948}
1949
1950VOS_STATUS
1951sap_AcquireGlobalLock
1952(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001953 ptSapContext pSapCtx
Jeff Johnson295189b2012-06-20 16:38:30 -07001954)
1955{
1956 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1957
1958 if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &pSapCtx->SapGlobalLock) ) )
1959 {
1960 vosStatus = VOS_STATUS_SUCCESS;
1961 }
1962
1963 return (vosStatus);
1964}
1965
1966VOS_STATUS
1967sap_ReleaseGlobalLock
1968(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001969 ptSapContext pSapCtx
Jeff Johnson295189b2012-06-20 16:38:30 -07001970)
1971{
1972 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1973
1974 if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &pSapCtx->SapGlobalLock) ) )
1975 {
1976 vosStatus = VOS_STATUS_SUCCESS;
1977 }
1978
1979 return (vosStatus);
1980}
1981
1982/*==========================================================================
1983 FUNCTION WLANSAP_Set_WPARSNIes
1984
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001985 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001986 This api function provides for Ap App/HDD to set AP WPA and RSN IE in its beacon and probe response.
1987
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001988 DEPENDENCIES
1989 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001990
1991 PARAMETERS
1992
1993 IN
1994 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001995 pWPARSNIEs: buffer to the WPA/RSN IEs
Jeff Johnson295189b2012-06-20 16:38:30 -07001996 WPARSNIEsLen: length of WPA/RSN IEs
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001997
Jeff Johnson295189b2012-06-20 16:38:30 -07001998 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001999 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002000
2001 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002002
2003 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002004============================================================================*/
2005VOS_STATUS WLANSAP_Set_WPARSNIes(v_PVOID_t pvosGCtx, v_U8_t *pWPARSNIEs, v_U32_t WPARSNIEsLen)
2006{
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002007
Jeff Johnson295189b2012-06-20 16:38:30 -07002008 ptSapContext pSapCtx = NULL;
2009 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2010 v_PVOID_t hHal = NULL;
2011
2012 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
2013 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
2014 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002015 {
Jeff Johnson295189b2012-06-20 16:38:30 -07002016 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002017 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002018 return VOS_STATUS_E_FAULT;
2019 }
2020
2021 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2022 if ( NULL == hHal ){
2023 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002024 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002025 return VOS_STATUS_E_FAULT;
2026 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002027
Jeff Johnson295189b2012-06-20 16:38:30 -07002028 pSapCtx->APWPARSNIEs.length = (tANI_U16)WPARSNIEsLen;
2029 vos_mem_copy(pSapCtx->APWPARSNIEs.rsnIEdata, pWPARSNIEs, WPARSNIEsLen);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002030
Jeff Johnson295189b2012-06-20 16:38:30 -07002031 halStatus = sme_RoamUpdateAPWPARSNIEs( hHal, pSapCtx->sessionId, &pSapCtx->APWPARSNIEs);
2032
2033 if(halStatus == eHAL_STATUS_SUCCESS) {
2034 return VOS_STATUS_SUCCESS;
2035 } else
2036 {
2037 return VOS_STATUS_E_FAULT;
2038 }
2039 }
2040
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002041 return VOS_STATUS_E_FAULT;
Jeff Johnson295189b2012-06-20 16:38:30 -07002042}
2043
2044VOS_STATUS WLANSAP_GetStatistics(v_PVOID_t pvosGCtx, tSap_SoftapStats *statBuf, v_BOOL_t bReset)
2045{
2046 if (NULL == pvosGCtx)
2047 {
2048 return VOS_STATUS_E_FAULT;
2049 }
2050
2051 return (WLANTL_GetSoftAPStatistics(pvosGCtx, statBuf, bReset));
2052}
2053
Jeff Johnson295189b2012-06-20 16:38:30 -07002054/*==========================================================================
2055
2056 FUNCTION WLANSAP_SendAction
2057
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002058 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002059 This api function provides to send action frame sent by upper layer.
2060
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002061 DEPENDENCIES
2062 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002063
2064 PARAMETERS
2065
2066 IN
2067 pvosGCtx: Pointer to vos global context structure
2068 pBuf: Pointer of the action frame to be transmitted
2069 len: Length of the action frame
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002070
Jeff Johnson295189b2012-06-20 16:38:30 -07002071 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002072 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002073
2074 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002075
2076 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002077============================================================================*/
2078VOS_STATUS WLANSAP_SendAction( v_PVOID_t pvosGCtx, const tANI_U8 *pBuf,
Jeff Johnsone7245742012-09-05 17:12:55 -07002079 tANI_U32 len, tANI_U16 wait )
Jeff Johnson295189b2012-06-20 16:38:30 -07002080{
2081 ptSapContext pSapCtx = NULL;
2082 v_PVOID_t hHal = NULL;
2083 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2084
2085 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2086 {
2087 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2088 if (NULL == pSapCtx)
2089 {
2090 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002091 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002092 return VOS_STATUS_E_FAULT;
2093 }
2094 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2095 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2096 {
2097 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2098 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002099 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002100 return VOS_STATUS_E_FAULT;
2101 }
2102
Jeff Johnsone7245742012-09-05 17:12:55 -07002103 halStatus = sme_sendAction( hHal, pSapCtx->sessionId, pBuf, len, 0 , 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002104
2105 if ( eHAL_STATUS_SUCCESS == halStatus )
2106 {
2107 return VOS_STATUS_SUCCESS;
2108 }
2109 }
2110
2111 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2112 "Failed to Send Action Frame");
2113
2114 return VOS_STATUS_E_FAULT;
2115}
2116
2117/*==========================================================================
2118
2119 FUNCTION WLANSAP_RemainOnChannel
2120
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002121 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002122 This api function provides to set Remain On channel on specified channel
2123 for specified duration.
2124
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002125 DEPENDENCIES
2126 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002127
2128 PARAMETERS
2129
2130 IN
2131 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002132 channel: Channel on which driver has to listen
Jeff Johnson295189b2012-06-20 16:38:30 -07002133 duration: Duration for which driver has to listen on specified channel
2134 callback: Callback function to be called once Listen is done.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002135 pContext: Context needs to be called in callback function.
2136
Jeff Johnson295189b2012-06-20 16:38:30 -07002137 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002138 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002139
2140 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002141
2142 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002143============================================================================*/
2144VOS_STATUS WLANSAP_RemainOnChannel( v_PVOID_t pvosGCtx,
2145 tANI_U8 channel, tANI_U32 duration,
2146 remainOnChanCallback callback,
2147 void *pContext )
2148{
2149 ptSapContext pSapCtx = NULL;
2150 v_PVOID_t hHal = NULL;
2151 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2152
2153 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2154 {
2155 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2156 if (NULL == pSapCtx)
2157 {
2158 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002159 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002160 return VOS_STATUS_E_FAULT;
2161 }
2162 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2163 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2164 {
2165 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2166 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002167 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002168 return VOS_STATUS_E_FAULT;
2169 }
2170
2171 halStatus = sme_RemainOnChannel( hHal, pSapCtx->sessionId,
Gopichand Nakkala924e4552013-05-08 19:18:14 +05302172 channel, duration, callback, pContext, TRUE );
Jeff Johnson295189b2012-06-20 16:38:30 -07002173
2174 if( eHAL_STATUS_SUCCESS == halStatus )
2175 {
2176 return VOS_STATUS_SUCCESS;
2177 }
2178 }
2179
2180 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2181 "Failed to Set Remain on Channel");
2182
2183 return VOS_STATUS_E_FAULT;
2184}
2185
2186/*==========================================================================
2187
2188 FUNCTION WLANSAP_CancelRemainOnChannel
2189
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002190 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002191 This api cancel previous remain on channel request.
2192
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002193 DEPENDENCIES
2194 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002195
2196 PARAMETERS
2197
2198 IN
2199 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002200
Jeff Johnson295189b2012-06-20 16:38:30 -07002201 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002202 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002203
2204 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002205
2206 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002207============================================================================*/
2208VOS_STATUS WLANSAP_CancelRemainOnChannel( v_PVOID_t pvosGCtx )
2209{
2210 ptSapContext pSapCtx = NULL;
2211 v_PVOID_t hHal = NULL;
2212 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2213
2214 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2215 {
2216 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2217 if (NULL == pSapCtx)
2218 {
2219 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002220 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002221 return VOS_STATUS_E_FAULT;
2222 }
2223 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2224 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2225 {
2226 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2227 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002228 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002229 return VOS_STATUS_E_FAULT;
2230 }
2231
2232 halStatus = sme_CancelRemainOnChannel( hHal, pSapCtx->sessionId );
2233
2234 if( eHAL_STATUS_SUCCESS == halStatus )
2235 {
2236 return VOS_STATUS_SUCCESS;
2237 }
2238 }
2239
2240 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2241 "Failed to Cancel Remain on Channel");
2242
2243 return VOS_STATUS_E_FAULT;
2244}
2245
2246/*==========================================================================
2247
2248 FUNCTION WLANSAP_RegisterMgmtFrame
2249
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002250 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002251 HDD use this API to register specified type of frame with CORE stack.
2252 On receiving such kind of frame CORE stack should pass this frame to HDD
2253
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002254 DEPENDENCIES
2255 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002256
2257 PARAMETERS
2258
2259 IN
2260 pvosGCtx: Pointer to vos global context structure
2261 frameType: frameType that needs to be registered with PE.
2262 matchData: Data pointer which should be matched after frame type is matched.
2263 matchLen: Length of the matchData
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002264
Jeff Johnson295189b2012-06-20 16:38:30 -07002265 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002266 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002267
2268 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002269
2270 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002271============================================================================*/
2272VOS_STATUS WLANSAP_RegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType,
2273 tANI_U8* matchData, tANI_U16 matchLen )
2274{
2275 ptSapContext pSapCtx = NULL;
2276 v_PVOID_t hHal = NULL;
2277 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2278
2279 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2280 {
2281 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2282 if (NULL == pSapCtx)
2283 {
2284 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002285 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002286 return VOS_STATUS_E_FAULT;
2287 }
2288 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2289 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2290 {
2291 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2292 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002293 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002294 return VOS_STATUS_E_FAULT;
2295 }
2296
2297 halStatus = sme_RegisterMgmtFrame(hHal, pSapCtx->sessionId,
2298 frameType, matchData, matchLen);
2299
2300 if( eHAL_STATUS_SUCCESS == halStatus )
2301 {
2302 return VOS_STATUS_SUCCESS;
2303 }
2304 }
2305
2306 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2307 "Failed to Register MGMT frame");
2308
2309 return VOS_STATUS_E_FAULT;
2310}
2311
2312/*==========================================================================
2313
2314 FUNCTION WLANSAP_DeRegisterMgmtFrame
2315
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002316 DESCRIPTION
2317 This API is used to deregister previously registered frame.
Jeff Johnson295189b2012-06-20 16:38:30 -07002318
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002319 DEPENDENCIES
2320 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002321
2322 PARAMETERS
2323
2324 IN
2325 pvosGCtx: Pointer to vos global context structure
2326 frameType: frameType that needs to be De-registered with PE.
2327 matchData: Data pointer which should be matched after frame type is matched.
2328 matchLen: Length of the matchData
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002329
Jeff Johnson295189b2012-06-20 16:38:30 -07002330 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002331 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002332
2333 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002334
2335 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002336============================================================================*/
2337VOS_STATUS WLANSAP_DeRegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType,
2338 tANI_U8* matchData, tANI_U16 matchLen )
2339{
2340 ptSapContext pSapCtx = NULL;
2341 v_PVOID_t hHal = NULL;
2342 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2343
2344 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2345 {
2346 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2347 if (NULL == pSapCtx)
2348 {
2349 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002350 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002351 return VOS_STATUS_E_FAULT;
2352 }
2353 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2354 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2355 {
2356 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2357 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002358 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002359 return VOS_STATUS_E_FAULT;
2360 }
2361
2362 halStatus = sme_DeregisterMgmtFrame( hHal, pSapCtx->sessionId,
2363 frameType, matchData, matchLen );
2364
2365 if( eHAL_STATUS_SUCCESS == halStatus )
2366 {
2367 return VOS_STATUS_SUCCESS;
2368 }
2369 }
2370
2371 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2372 "Failed to Deregister MGMT frame");
2373
2374 return VOS_STATUS_E_FAULT;
2375}
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05302376
2377/*==========================================================================
2378 FUNCTION WLANSAP_PopulateDelStaParams
2379
2380 DESCRIPTION
2381 This API is used to populate del station parameters
2382 DEPENDENCIES
2383 NA.
2384
2385 PARAMETERS
2386 IN
2387 mac: pointer to peer mac address.
2388 reason_code: Reason code for the disassoc/deauth.
2389 subtype: subtype points to either disassoc/deauth frame.
2390 pDelStaParams: address where parameters to be populated.
2391
2392 RETURN VALUE NONE
2393
2394 SIDE EFFECTS
2395============================================================================*/
2396void WLANSAP_PopulateDelStaParams(const v_U8_t *mac,
2397 v_U16_t reason_code,
2398 v_U8_t subtype,
2399 struct tagCsrDelStaParams *pDelStaParams)
2400{
2401 if (NULL == mac)
2402 memset(pDelStaParams->peerMacAddr, 0xff, VOS_MAC_ADDR_SIZE);
2403 else
2404 vos_mem_copy(pDelStaParams->peerMacAddr, mac, VOS_MAC_ADDR_SIZE);
2405
2406 if (reason_code == 0)
Sushant Kaushik4cd28f62014-12-26 14:23:50 +05302407 pDelStaParams->reason_code = eSIR_MAC_DEAUTH_LEAVING_BSS_REASON;
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05302408 else
2409 pDelStaParams->reason_code = reason_code;
2410
2411 if (subtype == (SIR_MAC_MGMT_DEAUTH >> 4) ||
2412 subtype == (SIR_MAC_MGMT_DISASSOC >> 4))
2413 pDelStaParams->subtype = subtype;
2414 else
2415 pDelStaParams->subtype = (SIR_MAC_MGMT_DEAUTH >> 4);
2416
2417 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
2418 FL("Delete STA with RC:%hu subtype:%hhu MAC::" MAC_ADDRESS_STR),
2419 pDelStaParams->reason_code, pDelStaParams->subtype,
2420 MAC_ADDR_ARRAY(pDelStaParams->peerMacAddr));
2421}