blob: 898c24b0d18672977f6f0225bb1136f910248e86 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam0fb93dd2014-02-19 00:32:59 -08002 * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
3 *
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
161 vos_mem_zero(pSapCtx, sizeof(tSapContext));
162
163 /*------------------------------------------------------------------------
164 Clean up SAP control block, initialize all values
165 ------------------------------------------------------------------------*/
166 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Open");
167
168 WLANSAP_CleanCB(pSapCtx, 0 /*do not empty*/);
169
170 // Setup the "link back" to the VOSS context
171 pSapCtx->pvosGCtx = pvosGCtx;
172
173 // Store a pointer to the SAP context provided by VOSS
174 gpSapCtx = pSapCtx;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700175
Jeff Johnson295189b2012-06-20 16:38:30 -0700176 /*------------------------------------------------------------------------
177 Allocate internal resources
178 ------------------------------------------------------------------------*/
179
180 return VOS_STATUS_SUCCESS;
181}// WLANSAP_Open
182
183/*==========================================================================
184 FUNCTION WLANSAP_Start
185
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700186 DESCRIPTION
187 Called as part of the overall start procedure (vos_start). SAP will
188 use this call to register with TL as the SAP entity for
189 SAP RSN frames.
Jeff Johnson295189b2012-06-20 16:38:30 -0700190
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700191 DEPENDENCIES
192
193 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700194
195 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700196 pvosGCtx : Pointer to the global vos context; a handle to SAP's
197 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700198
199 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700200 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700201
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700202 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
203 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700204 VOS_STATUS_SUCCESS: Success
205
206 SIDE EFFECTS
207============================================================================*/
208
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700209VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700210WLANSAP_Start
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700211(
212 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700213)
214{
Jeff Johnson295189b2012-06-20 16:38:30 -0700215 ptSapContext pSapCtx = NULL;
216
217 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
218
219 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
220 "WLANSAP_Start invoked successfully\n");
221 /*------------------------------------------------------------------------
222 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700223 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700224 ------------------------------------------------------------------------*/
225 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700226 if ( NULL == pSapCtx )
Jeff Johnson295189b2012-06-20 16:38:30 -0700227 {
228 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700229 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 return VOS_STATUS_E_FAULT;
231 }
232
233 /*------------------------------------------------------------------------
234 For now, presume security is not enabled.
235 -----------------------------------------------------------------------*/
236 pSapCtx->ucSecEnabled = WLANSAP_SECURITY_ENABLED_STATE;
237
238
239 /*------------------------------------------------------------------------
240 Now configure the roaming profile links. To SSID and bssid.
241 ------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700242 // We have room for two SSIDs.
243 pSapCtx->csrRoamProfile.SSIDs.numOfSSIDs = 1; // This is true for now.
244 pSapCtx->csrRoamProfile.SSIDs.SSIDList = pSapCtx->SSIDList; //Array of two
Jeff Johnson295189b2012-06-20 16:38:30 -0700245 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].SSID.length = 0;
246 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].handoffPermitted = VOS_FALSE;
247 pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].ssidHidden = pSapCtx->SSIDList[0].ssidHidden;
248
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700249 pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; // This is true for now.
250 pSapCtx->csrRoamProfile.BSSIDs.bssid = &pSapCtx->bssid;
Jeff Johnson295189b2012-06-20 16:38:30 -0700251
252 // Now configure the auth type in the roaming profile. To open.
253 pSapCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700254
Jeff Johnson295189b2012-06-20 16:38:30 -0700255 if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pSapCtx->SapGlobalLock)))
256 {
257 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700258 "WLANSAP_Start failed init lock\n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700259 return VOS_STATUS_E_FAULT;
260 }
261
262
Jeff Johnson295189b2012-06-20 16:38:30 -0700263
264 return VOS_STATUS_SUCCESS;
265}/* WLANSAP_Start */
266
267/*==========================================================================
268
269 FUNCTION WLANSAP_Stop
270
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700271 DESCRIPTION
272 Called by vos_stop to stop operation in SAP, before close. SAP will suspend all
273 BT-AMP Protocol Adaption Layer operation and will wait for the close
274 request to clean up its resources.
Jeff Johnson295189b2012-06-20 16:38:30 -0700275
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700276 DEPENDENCIES
277
278 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700279
280 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700281 pvosGCtx : Pointer to the global vos context; a handle to SAP's
282 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700283
284 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700285 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700286
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700287 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
288 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 VOS_STATUS_SUCCESS: Success
290
291 SIDE EFFECTS
292============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700293VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700294WLANSAP_Stop
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700295(
296 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700297)
298{
299
Jeff Johnson295189b2012-06-20 16:38:30 -0700300 ptSapContext pSapCtx = NULL;
301
302 /*------------------------------------------------------------------------
303 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700304 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700305 ------------------------------------------------------------------------*/
306 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
307 "WLANSAP_Stop invoked successfully ");
308
309 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
310 if (NULL == pSapCtx)
311 {
312 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700313 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700314 return VOS_STATUS_E_FAULT;
315 }
316
317 sapFreeRoamProfile(&pSapCtx->csrRoamProfile);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700318
Jeff Johnson295189b2012-06-20 16:38:30 -0700319 if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pSapCtx->SapGlobalLock ) ) )
320 {
321 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700322 "WLANSAP_Stop failed destroy lock\n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700323 return VOS_STATUS_E_FAULT;
324 }
325 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700326 Stop SAP (de-register RSN handler!?)
Jeff Johnson295189b2012-06-20 16:38:30 -0700327 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700328
329 return VOS_STATUS_SUCCESS;
330}/* WLANSAP_Stop */
331
332/*==========================================================================
333 FUNCTION WLANSAP_Close
334
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700335 DESCRIPTION
336 Called by vos_close during general driver close procedure. SAP will clean up
337 all the internal resources.
Jeff Johnson295189b2012-06-20 16:38:30 -0700338
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700339 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700340
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700341 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700342
343 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700344 pvosGCtx : Pointer to the global vos context; a handle to SAP's
345 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700346
347 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700348 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700349
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700350 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
351 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700352 VOS_STATUS_SUCCESS: Success
353
354 SIDE EFFECTS
355============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700356VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700357WLANSAP_Close
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700358(
359 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700360)
361{
Jeff Johnson295189b2012-06-20 16:38:30 -0700362 ptSapContext pSapCtx = NULL;
363 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
364
365 /*------------------------------------------------------------------------
366 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700367 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700368 ------------------------------------------------------------------------*/
369 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
370 "WLANSAP_Close invoked");
371
372 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
373 if (NULL == pSapCtx)
374 {
375 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700376 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700377 return VOS_STATUS_E_FAULT;
378 }
379
380 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700381 Cleanup SAP control block.
Jeff Johnson295189b2012-06-20 16:38:30 -0700382 ------------------------------------------------------------------------*/
383 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Close");
384 WLANSAP_CleanCB(pSapCtx, VOS_TRUE /* empty queues/lists/pkts if any*/);
385
386 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700387 Free SAP context from VOSS global
Jeff Johnson295189b2012-06-20 16:38:30 -0700388 ------------------------------------------------------------------------*/
389 vos_free_context(pvosGCtx, VOS_MODULE_ID_SAP, pSapCtx);
390
Jeff Johnson295189b2012-06-20 16:38:30 -0700391 return VOS_STATUS_SUCCESS;
392}/* WLANSAP_Close */
393
394/*----------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700395 * Utility Function implementations
Jeff Johnson295189b2012-06-20 16:38:30 -0700396 * -------------------------------------------------------------------------*/
397
398/*==========================================================================
399
400 FUNCTION WLANSAP_CleanCB
401
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700402 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700403 Clear out all fields in the SAP context.
404
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700405 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700406
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700407 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700408
409 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700410 pvosGCtx : Pointer to the global vos context; a handle to SAP's
411 control block can be extracted from its context
Jeff Johnson295189b2012-06-20 16:38:30 -0700412
413 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700414 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700415
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700416 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
417 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700418 VOS_STATUS_SUCCESS: Success
419
420 SIDE EFFECTS
421============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700422VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700423WLANSAP_CleanCB
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700424(
Jeff Johnson295189b2012-06-20 16:38:30 -0700425 ptSapContext pSapCtx,
426 v_U32_t freeFlag // 0 /*do not empty*/);
427)
428{
Jeff Johnson295189b2012-06-20 16:38:30 -0700429 /*------------------------------------------------------------------------
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700430 Sanity check SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700431 ------------------------------------------------------------------------*/
432
433 if (NULL == pSapCtx)
434 {
435 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700436 "%s: Invalid SAP pointer", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700437 return VOS_STATUS_E_FAULT;
438 }
439
440 /*------------------------------------------------------------------------
441 Clean up SAP control block, initialize all values
442 ------------------------------------------------------------------------*/
443 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_CleanCB");
444
445 vos_mem_zero( pSapCtx, sizeof(tSapContext));
446
447 pSapCtx->pvosGCtx = NULL;
448
449 pSapCtx->sapsMachine= eSAP_DISCONNECTED;
450
Gopichand Nakkala66c0bd02013-04-10 11:36:29 +0530451 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 -0700452 __func__, pSapCtx->sapsMachine, pSapCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -0700453 pSapCtx->sessionId = 0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700454 pSapCtx->channel = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700455
Jeff Johnson295189b2012-06-20 16:38:30 -0700456 return VOS_STATUS_SUCCESS;
457}// WLANSAP_CleanCB
458
459/*==========================================================================
460 FUNCTION WLANSAP_pmcFullPwrReqCB
461
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700462 DESCRIPTION
463 Callback provide to PMC in the pmcRequestFullPower API.
Jeff Johnson295189b2012-06-20 16:38:30 -0700464
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700465 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700466
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700467 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700468
469 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700470 callbackContext: The user passed in a context to identify
471 status: The halStatus
Jeff Johnson295189b2012-06-20 16:38:30 -0700472
473 RETURN VALUE
474 None
475
476 SIDE EFFECTS
477============================================================================*/
478void
479WLANSAP_pmcFullPwrReqCB
480(
481 void *callbackContext,
482 eHalStatus status
483)
484{
485 if(HAL_STATUS_SUCCESS(status))
486 {
487 //If success what else to be handled???
488 }
489 else
490 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700491 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -0700492 "WLANSAP_pmcFullPwrReqCB: PMC failed to put the chip in Full power\n");
493
Jeff Johnson295189b2012-06-20 16:38:30 -0700494 }
495
496}// WLANSAP_pmcFullPwrReqCB
497/*==========================================================================
498 FUNCTION WLANSAP_getState
499
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700500 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700501 This api returns the current SAP state to the caller.
502
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700503 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700504
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700505 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700506
507 IN
508 pContext : Pointer to Sap Context structure
509
510 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700511 Returns the SAP FSM state.
Jeff Johnson295189b2012-06-20 16:38:30 -0700512============================================================================*/
513
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700514v_U8_t WLANSAP_getState
Jeff Johnson295189b2012-06-20 16:38:30 -0700515(
516 v_PVOID_t pvosGCtx
517)
518{
519 ptSapContext pSapCtx = NULL;
520
521 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
522
523 if ( NULL == pSapCtx )
524 {
525 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700526 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700527 return VOS_STATUS_E_FAULT;
528 }
529 return pSapCtx->sapsMachine;
530}
531
532/*==========================================================================
533 FUNCTION WLANSAP_StartBss
534
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700535 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700536 This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for
537 starting AP BSS
538
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700539 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700540
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700541 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700542
543 IN
544 pContext : Pointer to Sap Context structure
545 pQctCommitConfig : Pointer to configuration structure passed down from HDD(HostApd for Android)
546 hdd_SapEventCallback: Callback function in HDD called by SAP to inform HDD about SAP results
547 pUsrContext : Parameter that will be passed back in all the SAP callback events.
548
549 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700550 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700551
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700552 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
553 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700554 VOS_STATUS_SUCCESS: Success
555
556 SIDE EFFECTS
557============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700558VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700559WLANSAP_StartBss
560(
561 v_PVOID_t pvosGCtx,//pwextCtx
562 tpWLAN_SAPEventCB pSapEventCallback,
563 tsap_Config_t *pConfig,
564 v_PVOID_t pUsrContext
565)
566{
567 tWLAN_SAPEvent sapEvent; /* State machine event*/
568 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
569 ptSapContext pSapCtx = NULL;
570 tANI_BOOLEAN restartNeeded;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700571 tHalHandle hHal;
572
Jeff Johnson295189b2012-06-20 16:38:30 -0700573 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
574
575 /*------------------------------------------------------------------------
576 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700577 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 ------------------------------------------------------------------------*/
579 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
580 "WLANSAP_StartBss");
581
582 if (VOS_STA_SAP_MODE == vos_get_conparam ())
583 {
584 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
585 if ( NULL == pSapCtx )
586 {
587 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700588 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700589 return VOS_STATUS_E_FAULT;
590 }
591 pSapCtx->sapsMachine = eSAP_DISCONNECTED;
592
593 /* Channel selection is auto or configured */
594 pSapCtx->channel = pConfig->channel;
Peng Xu2446a892014-09-05 17:21:18 +0530595 pSapCtx->scanBandPreference = pConfig->scanBandPreference;
Peng Xuafc34e32014-09-25 13:23:55 +0530596 pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold;
Jeff Johnson295189b2012-06-20 16:38:30 -0700597 pSapCtx->pUsrContext = pUsrContext;
598
599 //Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD
600 pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700601 vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700602 pSapCtx->self_mac_addr,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700603 sizeof( tCsrBssid ) );
Jeff Johnson295189b2012-06-20 16:38:30 -0700604
605 //Save a copy to SAP context
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700606 vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700607 pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t));
608 vos_mem_copy(pSapCtx->self_mac_addr,
609 pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t));
610
611 //copy the configuration items to csrProfile
612 sapconvertToCsrProfile( pConfig, eCSR_BSS_TYPE_INFRA_AP, &pSapCtx->csrRoamProfile);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700613 hHal = (tHalHandle)VOS_GET_HAL_CB(pvosGCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -0700614 if (NULL == hHal)
615 {
616 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700617 "%s: Invalid MAC context from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700618 }
619 else
620 {
621 //If concurrent session is running that is already associated
622 //then we just follow that sessions country info (whether
623 //present or not doesn't maater as we have to follow whatever
624 //STA session does)
Rajkumar Manoharaned6fd542013-11-26 22:55:16 +0530625 if ((0 == sme_GetConcurrentOperationChannel(hHal)) &&
626 pConfig->ieee80211d)
Jeff Johnson295189b2012-06-20 16:38:30 -0700627 {
628 /* Setting the region/country information */
629 sme_setRegInfo(hHal, pConfig->countryCode);
630 sme_ResetCountryCodeInformation(hHal, &restartNeeded);
631 }
632 }
633
634 // Copy MAC filtering settings to sap context
635 pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
636 vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac));
637 pSapCtx->nAcceptMac = pConfig->num_accept_mac;
638 sapSortMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
639 vos_mem_copy(pSapCtx->denyMacList, pConfig->deny_mac, sizeof(pConfig->deny_mac));
640 pSapCtx->nDenyMac = pConfig->num_deny_mac;
641 sapSortMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac);
642
643 /* Fill in the event structure for FSM */
644 sapEvent.event = eSAP_HDD_START_INFRA_BSS;
645 sapEvent.params = 0;//pSapPhysLinkCreate
646
647 /* Store the HDD callback in SAP context */
648 pSapCtx->pfnSapEventCallback = pSapEventCallback;
649
650 /* Handle event*/
651 vosStatus = sapFsm(pSapCtx, &sapEvent);
652 }
653 else
654 {
655 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
656 "SoftAp role has not been enabled");
657 }
658
659 return vosStatus;
660}// WLANSAP_StartBss
661
662/*==========================================================================
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -0700663 FUNCTION WLANSAP_SetMacACL
664
665 DESCRIPTION
666 This api function provides SAP to set mac list entry in accept list as well
667 as deny list
668
669 DEPENDENCIES
670
671 PARAMETERS
672
673 IN
674 pContext : Pointer to Sap Context structure
675 pQctCommitConfig : Pointer to configuration structure passed down from
676 HDD(HostApd for Android)
677
678 RETURN VALUE
679 The result code associated with performing the operation
680
681 VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page
682 fault
683 VOS_STATUS_SUCCESS: Success
684
685 SIDE EFFECTS
686============================================================================*/
687VOS_STATUS
688WLANSAP_SetMacACL
689(
690 v_PVOID_t pvosGCtx, //pwextCtx
691 tsap_Config_t *pConfig
692)
693{
694 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
695 ptSapContext pSapCtx = NULL;
696
697 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
698 "WLANSAP_SetMacACL");
699
700 if (VOS_STA_SAP_MODE == vos_get_conparam ())
701 {
702 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
703 if ( NULL == pSapCtx )
704 {
705 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
706 "%s: Invalid SAP pointer from pvosGCtx", __func__);
707 return VOS_STATUS_E_FAULT;
708 }
709
710 // Copy MAC filtering settings to sap context
711 pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
712
713 if (eSAP_DENY_UNLESS_ACCEPTED == pSapCtx->eSapMacAddrAclMode)
714 {
715 vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac,
716 sizeof(pConfig->accept_mac));
717 pSapCtx->nAcceptMac = pConfig->num_accept_mac;
718 sapSortMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
719 }
720 else if (eSAP_ACCEPT_UNLESS_DENIED == pSapCtx->eSapMacAddrAclMode)
721 {
722 vos_mem_copy(pSapCtx->denyMacList, pConfig->deny_mac,
723 sizeof(pConfig->deny_mac));
724 pSapCtx->nDenyMac = pConfig->num_deny_mac;
725 sapSortMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac);
726 }
727 }
728 else
729 {
730 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
731 "%s : SoftAp role has not been enabled", __func__);
732 return VOS_STATUS_E_FAULT;
733 }
734
735 return vosStatus;
736}//WLANSAP_SetMacACL
737
738/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -0700739 FUNCTION WLANSAP_StopBss
740
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700741 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700742 This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for
743 stopping AP BSS
744
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700745 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700746
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700747 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700748
749 IN
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700750 pvosGCtx : Pointer to the global vos context; a handle to SAP's
Jeff Johnson295189b2012-06-20 16:38:30 -0700751 control block can be extracted from its contexe
752
753 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700754 The result code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700755
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700756 VOS_STATUS_E_FAULT: Pointer to VOSS GC is NULL ; access would cause a page
757 fault
Jeff Johnson295189b2012-06-20 16:38:30 -0700758 VOS_STATUS_SUCCESS: Success
759
760 SIDE EFFECTS
761============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700762VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700763WLANSAP_StopBss
764(
765 v_PVOID_t pvosGCtx
766)
767{
768 tWLAN_SAPEvent sapEvent; /* State machine event*/
769 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
770 ptSapContext pSapCtx = NULL;
771 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
772
773 /*------------------------------------------------------------------------
774 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700775 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700776 ------------------------------------------------------------------------*/
777 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
778 "WLANSAP_StopBss");
779
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700780 if ( NULL == pvosGCtx )
Jeff Johnson295189b2012-06-20 16:38:30 -0700781 {
782 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700783 "%s: Invalid Global VOSS handle", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700784 return VOS_STATUS_E_FAULT;
785 }
786
787 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
788
789 if (NULL == pSapCtx )
790 {
791 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700792 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700793 return VOS_STATUS_E_FAULT;
794 }
795
796 /* Fill in the event structure for FSM */
797 sapEvent.event = eSAP_HDD_STOP_INFRA_BSS;
798 sapEvent.params = 0;
799
800 /* Handle event*/
801 vosStatus = sapFsm(pSapCtx, &sapEvent);
802
803 return vosStatus;
804}
805
806/*==========================================================================
807 FUNCTION WLANSAP_GetAssocStations
808
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700809 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700810 This api function is used to probe the list of associated stations from various modules of CORE stack
811
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700812 DEPENDENCIES
813 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700814
815 PARAMETERS
816
817 IN
818 pvosGCtx : Pointer to vos global context structure
819 modId : Module from whom list of associtated stations is supposed to be probed. If an invalid module is passed
820 then by default VOS_MODULE_ID_PE will be probed
821 IN/OUT
822 pAssocStas : Pointer to list of associated stations that are known to the module specified in mod parameter
823
824 NOTE: The memory for this list will be allocated by the caller of this API
825
826 RETURN VALUE
827 The VOS_STATUS code associated with performing the operation
828
829 VOS_STATUS_SUCCESS: Success
830
831 SIDE EFFECTS
832============================================================================*/
833VOS_STATUS
834WLANSAP_GetAssocStations
835(
836 v_PVOID_t pvosGCtx,
837 VOS_MODULE_ID modId,
838 tpSap_AssocMacAddr pAssocStas
839)
840{
841 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
842
843 /*------------------------------------------------------------------------
844 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700845 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700846 ------------------------------------------------------------------------*/
847 if (NULL == pSapCtx)
848 {
849 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700850 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700851 return VOS_STATUS_E_FAULT;
852 }
853
854 sme_RoamGetAssociatedStas( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
855 modId,
856 pSapCtx->pUsrContext,
857 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
858 (v_U8_t *)pAssocStas );
859
860 return VOS_STATUS_SUCCESS;
861}
862
863
864/*==========================================================================
865 FUNCTION WLANSAP_RemoveWpsSessionOverlap
866
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700867 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700868 This api function provides for Ap App/HDD to remove an entry from session session overlap info.
869
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700870 DEPENDENCIES
871 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700872
873 PARAMETERS
874
875 IN
876 pvosGCtx: Pointer to vos global context structure
877 pRemoveMac: pointer to v_MACADDR_t for session MAC address
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700878
Jeff Johnson295189b2012-06-20 16:38:30 -0700879 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700880 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700881
882 VOS_STATUS_SUCCESS: Success
883 VOS_STATUS_E_FAULT: Session is not dectected. The parameter is function not valid.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700884
885 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700886============================================================================*/
887VOS_STATUS
888WLANSAP_RemoveWpsSessionOverlap
889
890(
891 v_PVOID_t pvosGCtx,
892 v_MACADDR_t pRemoveMac
893)
894{
895 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
896
897 /*------------------------------------------------------------------------
898 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700899 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700900 ------------------------------------------------------------------------*/
901 if (NULL == pSapCtx)
902 {
903 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700904 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 return VOS_STATUS_E_FAULT;
906 }
907
908 sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
909 pSapCtx->pUsrContext,
910 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
911 pRemoveMac);
912
913 return VOS_STATUS_SUCCESS;
914}
915
916/*==========================================================================
917 FUNCTION WLANSAP_getWpsSessionOverlap
918
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700919 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700920 This api function provides for Ap App/HDD to get WPS session overlap info.
921
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700922 DEPENDENCIES
923 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -0700924
925 PARAMETERS
926
927 IN
928 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700929
Jeff Johnson295189b2012-06-20 16:38:30 -0700930 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700931 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -0700932
933 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700934
935 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700936============================================================================*/
937VOS_STATUS
938WLANSAP_getWpsSessionOverlap
939(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700940 v_PVOID_t pvosGCtx
Jeff Johnson295189b2012-06-20 16:38:30 -0700941)
942{
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700943 v_MACADDR_t pRemoveMac = VOS_MAC_ADDR_ZERO_INITIALIZER;
Jeff Johnson295189b2012-06-20 16:38:30 -0700944
945 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
946
947 /*------------------------------------------------------------------------
948 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700949 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -0700950 ------------------------------------------------------------------------*/
951 if (NULL == pSapCtx)
952 {
953 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700954 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700955 return VOS_STATUS_E_FAULT;
956 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700957
Jeff Johnson295189b2012-06-20 16:38:30 -0700958 sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
959 pSapCtx->pUsrContext,
960 (v_PVOID_t *)pSapCtx->pfnSapEventCallback,
961 pRemoveMac);
962
963 return VOS_STATUS_SUCCESS;
964}
965
966
967/* This routine will set the mode of operation for ACL dynamically*/
968VOS_STATUS
969WLANSAP_SetMode ( v_PVOID_t pvosGCtx, v_U32_t mode)
970{
971 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
972
973 if (NULL == pSapCtx)
974 {
975 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700976 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700977 return VOS_STATUS_E_FAULT;
978 }
979
980 pSapCtx->eSapMacAddrAclMode = (eSapMacAddrACL)mode;
981 return VOS_STATUS_SUCCESS;
982}
983
984/* This routine will clear all the entries in accept list as well as deny list */
985
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700986VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -0700987WLANSAP_ClearACL( v_PVOID_t pvosGCtx)
988{
989 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
990 v_U8_t i;
991
992 if (NULL == pSapCtx)
993 {
994 return VOS_STATUS_E_RESOURCES;
995 }
996
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -0700997 if (pSapCtx->denyMacList != NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700998 {
999 for (i = 0; i < (pSapCtx->nDenyMac-1); i++)
1000 {
1001 vos_mem_zero((pSapCtx->denyMacList+i)->bytes, sizeof(v_MACADDR_t));
1002
1003 }
1004 }
1005 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1006 pSapCtx->nDenyMac = 0;
1007
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001008 if (pSapCtx->acceptMacList!=NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001009 {
1010 for (i = 0; i < (pSapCtx->nAcceptMac-1); i++)
1011 {
1012 vos_mem_zero((pSapCtx->acceptMacList+i)->bytes, sizeof(v_MACADDR_t));
1013
1014 }
1015 }
1016 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1017 pSapCtx->nAcceptMac = 0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001018
Jeff Johnson295189b2012-06-20 16:38:30 -07001019 return VOS_STATUS_SUCCESS;
1020}
1021
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001022VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001023WLANSAP_ModifyACL
1024(
1025 v_PVOID_t pvosGCtx,
1026 v_U8_t *pPeerStaMac,
1027 eSapACLType listType,
1028 eSapACLCmdType cmd
1029)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001030{
Jeff Johnson295189b2012-06-20 16:38:30 -07001031 eSapBool staInWhiteList=eSAP_FALSE, staInBlackList=eSAP_FALSE;
1032 v_U8_t staWLIndex, staBLIndex;
1033 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1034
1035 if (NULL == pSapCtx)
1036 {
1037 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001038 "%s: Invalid SAP Context", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001039 return VOS_STATUS_E_FAULT;
1040 }
1041
1042 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"Modify ACL entered\n"
1043 "Before modification of ACL\n"
1044 "size of accept and deny lists %d %d",
1045 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1046 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***");
1047 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1048 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***");
1049 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1050
1051 /* the expectation is a mac addr will not be in both the lists at the same time.
1052 It is the responsiblity of userspace to ensure this */
1053 staInWhiteList = sapSearchMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac, pPeerStaMac, &staWLIndex);
1054 staInBlackList = sapSearchMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac, pPeerStaMac, &staBLIndex);
1055
1056 if (staInWhiteList && staInBlackList)
1057 {
1058 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001059 "Peer mac "MAC_ADDRESS_STR" found in white and black lists."
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001060 "Initial lists passed incorrect. Cannot execute this command.",
Arif Hussain24bafea2013-11-15 15:10:03 -08001061 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001062 return VOS_STATUS_E_FAILURE;
1063
1064 }
1065
1066 switch(listType)
1067 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001068 case eSAP_WHITE_LIST:
Jeff Johnson295189b2012-06-20 16:38:30 -07001069 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "cmd %d", cmd);
1070 if (cmd == ADD_STA_TO_ACL)
1071 {
1072 //error check
1073 // if list is already at max, return failure
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -07001074 if (pSapCtx->nAcceptMac == MAX_ACL_MAC_ADDRESS)
Jeff Johnson295189b2012-06-20 16:38:30 -07001075 {
1076 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001077 "White list is already maxed out. Cannot accept "MAC_ADDRESS_STR,
1078 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001079 return VOS_STATUS_E_FAILURE;
1080 }
1081 if (staInWhiteList)
1082 {
1083 //Do nothing if already present in white list. Just print a warning
1084 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001085 "MAC address already present in white list "MAC_ADDRESS_STR,
1086 MAC_ADDR_ARRAY(pPeerStaMac));
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001087 } else
Jeff Johnson295189b2012-06-20 16:38:30 -07001088 {
1089 if (staInBlackList)
1090 {
1091 //remove it from black list before adding to the white list
1092 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
1093 "STA present in black list so first remove from it");
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001094 sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001095 }
1096 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001097 "... Now add to the white list");
Jeff Johnson295189b2012-06-20 16:38:30 -07001098 sapAddMacToACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, pPeerStaMac);
1099 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d",
1100 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001101 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001102 }
1103 else if (cmd == DELETE_STA_FROM_ACL)
1104 {
1105 if (staInWhiteList)
1106 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001107 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from white list");
1108 sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001109 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d",
1110 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1111 }
1112 else
1113 {
1114 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001115 "MAC address to be deleted is not present in the white list "MAC_ADDRESS_STR,
1116 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001117 return VOS_STATUS_E_FAILURE;
1118 }
1119 }
1120 else
1121 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001122 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed");
Jeff Johnson295189b2012-06-20 16:38:30 -07001123 return VOS_STATUS_E_FAILURE;
1124 }
1125 break;
1126
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001127 case eSAP_BLACK_LIST:
Jeff Johnson295189b2012-06-20 16:38:30 -07001128 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
1129 "cmd %d", cmd);
1130 if (cmd == ADD_STA_TO_ACL)
1131 {
1132 //error check
1133 // if list is already at max, return failure
Gopichand Nakkalacb9f2192013-06-25 16:10:38 -07001134 if (pSapCtx->nDenyMac == MAX_ACL_MAC_ADDRESS)
Jeff Johnson295189b2012-06-20 16:38:30 -07001135 {
1136 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Arif Hussain24bafea2013-11-15 15:10:03 -08001137 "Black list is already maxed out. Cannot accept "MAC_ADDRESS_STR,
1138 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001139 return VOS_STATUS_E_FAILURE;
1140 }
1141 if (staInBlackList)
1142 {
1143 //Do nothing if already present in white list
1144 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001145 "MAC address already present in black list "MAC_ADDRESS_STR,
1146 MAC_ADDR_ARRAY(pPeerStaMac));
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001147 } else
Jeff Johnson295189b2012-06-20 16:38:30 -07001148 {
1149 if (staInWhiteList)
1150 {
1151 //remove it from white list before adding to the white list
1152 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
1153 "Present in white list so first remove from it");
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001154 sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001155 }
1156 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001157 "... Now add to black list");
Jeff Johnson295189b2012-06-20 16:38:30 -07001158 sapAddMacToACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, pPeerStaMac);
1159 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"size of accept and deny lists %d %d",
1160 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001161 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001162 }
1163 else if (cmd == DELETE_STA_FROM_ACL)
1164 {
1165 if (staInBlackList)
1166 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001167 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from black list");
1168 sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -07001169 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"no accept and deny mac %d %d",
1170 pSapCtx->nAcceptMac, pSapCtx->nDenyMac);
1171 }
1172 else
1173 {
1174 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
Arif Hussain24bafea2013-11-15 15:10:03 -08001175 "MAC address to be deleted is not present in the black list "MAC_ADDRESS_STR,
1176 MAC_ADDR_ARRAY(pPeerStaMac));
Jeff Johnson295189b2012-06-20 16:38:30 -07001177 return VOS_STATUS_E_FAILURE;
1178 }
1179 }
1180 else
1181 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001182 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed");
Jeff Johnson295189b2012-06-20 16:38:30 -07001183 return VOS_STATUS_E_FAILURE;
1184 }
1185 break;
1186
1187 default:
1188 {
1189 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1190 "Invalid list type passed %d",listType);
1191 return VOS_STATUS_E_FAILURE;
1192 }
1193 }
1194 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"After modification of ACL");
1195 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***");
1196 sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac);
1197 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***");
1198 sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac);
1199 return VOS_STATUS_SUCCESS;
1200}
1201
1202/*==========================================================================
1203 FUNCTION WLANSAP_DisassocSta
1204
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001205 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001206 This api function provides for Ap App/HDD initiated disassociation of station
1207
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001208 DEPENDENCIES
1209 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001210
1211 PARAMETERS
1212
1213 IN
1214 pvosGCtx : Pointer to vos global context structure
1215 pPeerStaMac : Mac address of the station to disassociate
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001216
Jeff Johnson295189b2012-06-20 16:38:30 -07001217 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001218 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001219
1220 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001221
1222 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001223============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001224VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001225WLANSAP_DisassocSta
1226(
1227 v_PVOID_t pvosGCtx,
1228 v_U8_t *pPeerStaMac
1229)
1230{
1231 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1232
1233 /*------------------------------------------------------------------------
1234 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001235 Extract SAP control block
1236 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 if (NULL == pSapCtx)
1238 {
1239 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001240 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001241 return VOS_STATUS_E_FAULT;
1242 }
1243
1244 sme_RoamDisconnectSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId,
1245 pPeerStaMac);
1246
1247 return VOS_STATUS_SUCCESS;
1248}
1249
Jeff Johnson295189b2012-06-20 16:38:30 -07001250/*==========================================================================
1251 FUNCTION WLANSAP_DeauthSta
1252
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001253 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 This api function provides for Ap App/HDD initiated deauthentication of station
1255
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001256 DEPENDENCIES
1257 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001258
1259 PARAMETERS
1260
1261 IN
1262 pvosGCtx : Pointer to vos global context structure
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301263 pDelStaParams : Pointer to parameters of the station to
1264 deauthenticate
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001265
Jeff Johnson295189b2012-06-20 16:38:30 -07001266 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001267 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001268
1269 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001270
1271 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001272============================================================================*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001273VOS_STATUS
Jeff Johnson295189b2012-06-20 16:38:30 -07001274WLANSAP_DeauthSta
1275(
1276 v_PVOID_t pvosGCtx,
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301277 struct tagCsrDelStaParams *pDelStaParams
Jeff Johnson295189b2012-06-20 16:38:30 -07001278)
1279{
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001280 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1281 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
Jeff Johnson295189b2012-06-20 16:38:30 -07001282 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1283
1284 /*------------------------------------------------------------------------
1285 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001286 Extract SAP control block
1287 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -07001288 if (NULL == pSapCtx)
1289 {
1290 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001291 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001292 return vosStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001293 }
1294
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05301295 halStatus = sme_RoamDeauthSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx),
1296 pSapCtx->sessionId, pDelStaParams);
Jeff Johnson295189b2012-06-20 16:38:30 -07001297
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -08001298 if (halStatus == eHAL_STATUS_SUCCESS)
1299 {
1300 vosStatus = VOS_STATUS_SUCCESS;
1301 }
1302 return vosStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001303}
1304/*==========================================================================
1305 FUNCTION WLANSAP_SetChannelRange
1306
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001307 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001308 This api function sets the range of channels for AP.
1309
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001310 DEPENDENCIES
1311 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001312
1313 PARAMETERS
1314
1315 IN
1316 startChannel : start channel
1317 endChannel : End channel
1318 operatingBand : Operating band (2.4GHz/5GHz)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001319
Jeff Johnson295189b2012-06-20 16:38:30 -07001320 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001321 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001322
1323 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001324
1325 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001326============================================================================*/
1327VOS_STATUS
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001328WLANSAP_SetChannelRange(tHalHandle hHal,v_U8_t startChannel, v_U8_t endChannel,
Leela Venkata Kiran Kumar Reddy Chirala9f6566c2014-09-05 19:06:58 +05301329 eSapOperatingBand operatingBand)
Jeff Johnson295189b2012-06-20 16:38:30 -07001330{
1331
1332 v_U8_t validChannelFlag =0;
1333 v_U8_t loopStartCount =0;
1334 v_U8_t loopEndCount =0;
1335 v_U8_t bandStartChannel =0;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001336 v_U8_t bandEndChannel =0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001337
1338 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
1339 "WLANSAP_SetChannelRange:startChannel %d,EndChannel %d,Operatingband:%d",
1340 startChannel,endChannel,operatingBand);
1341
1342 /*------------------------------------------------------------------------
1343 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001344 ------------------------------------------------------------------------*/
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001345 if (( WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMIN > operatingBand) ||
1346 (WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMAX < operatingBand))
Jeff Johnson295189b2012-06-20 16:38:30 -07001347 {
1348 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1349 "Invalid operatingBand on WLANSAP_SetChannelRange");
1350 return VOS_STATUS_E_FAULT;
1351 }
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001352 if (( WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMIN > startChannel) ||
1353 (WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMAX < startChannel))
Jeff Johnson295189b2012-06-20 16:38:30 -07001354 {
1355 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1356 "Invalid startChannel value on WLANSAP_SetChannelRange");
1357 return VOS_STATUS_E_FAULT;
1358 }
Jeff Johnsonbacdbcc2013-02-26 21:23:41 -08001359 if (( WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMIN > endChannel) ||
1360 (WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMAX < endChannel))
Jeff Johnson295189b2012-06-20 16:38:30 -07001361 {
1362 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1363 "Invalid endChannel value on WLANSAP_SetChannelRange");
1364 return VOS_STATUS_E_FAULT;
1365 }
1366 switch(operatingBand)
1367 {
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301368 case eSAP_RF_SUBBAND_2_4_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 bandStartChannel = RF_CHAN_1;
1370 bandEndChannel = RF_CHAN_14;
1371 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001372
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301373 case eSAP_RF_SUBBAND_5_LOW_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001374 bandStartChannel = RF_CHAN_36;
1375 bandEndChannel = RF_CHAN_64;
1376 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001377
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301378 case eSAP_RF_SUBBAND_5_MID_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 bandStartChannel = RF_CHAN_100;
Leo Chang80de3c22013-11-26 10:52:12 -08001380#ifndef FEATURE_WLAN_CH144
Jeff Johnson295189b2012-06-20 16:38:30 -07001381 bandEndChannel = RF_CHAN_140;
Leo Chang80de3c22013-11-26 10:52:12 -08001382#else
1383 bandEndChannel = RF_CHAN_144;
1384#endif /* FEATURE_WLAN_CH144 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001385 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001386
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301387 case eSAP_RF_SUBBAND_5_HIGH_GHZ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001388 bandStartChannel = RF_CHAN_149;
1389 bandEndChannel = RF_CHAN_165;
1390 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001391
Deepthi Gowri7db41f32014-10-13 17:02:29 +05301392 case eSAP_RF_SUBBAND_5_ALL_GHZ:
1393 bandStartChannel = RF_CHAN_36;
1394 bandEndChannel = RF_CHAN_165;
1395 break;
1396
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 default:
1398 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1399 "Invalid operatingBand value on WLANSAP_SetChannelRange");
1400 break;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001401 }
1402
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 /* Validating the start channel is in range or not*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001404 for(loopStartCount = bandStartChannel ; loopStartCount <= bandEndChannel ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001405 loopStartCount++)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001406 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001407 if(rfChannels[loopStartCount].channelNum == startChannel )
1408 {
1409 /* start channel is in the range */
1410 break;
1411 }
1412 }
1413 /* Validating the End channel is in range or not*/
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001414 for(loopEndCount = bandStartChannel ; loopEndCount <= bandEndChannel ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001415 loopEndCount++)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001416 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001417 if(rfChannels[loopEndCount].channelNum == endChannel )
1418 {
1419 /* End channel is in the range */
1420 break;
1421 }
1422 }
1423 if((loopStartCount > bandEndChannel)||(loopEndCount > bandEndChannel))
1424 {
1425 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1426 "%s: Invalid startChannel-%d or EndChannel-%d for band -%d",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001427 __func__,startChannel,endChannel,operatingBand);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001428 /* Supplied channels are nt in the operating band so set the default
Jeff Johnson295189b2012-06-20 16:38:30 -07001429 channels for the given operating band */
1430 startChannel = rfChannels[bandStartChannel].channelNum;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -07001431 endChannel = rfChannels[bandEndChannel].channelNum;
Jeff Johnson295189b2012-06-20 16:38:30 -07001432 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001433
Jeff Johnson295189b2012-06-20 16:38:30 -07001434 /*Search for the Active channels in the given range */
1435 for( loopStartCount = bandStartChannel; loopStartCount <= bandEndChannel; loopStartCount++ )
1436 {
1437 if((startChannel <= rfChannels[loopStartCount].channelNum)&&
1438 (endChannel >= rfChannels[loopStartCount].channelNum ))
1439 {
1440 if( regChannels[loopStartCount].enabled )
1441 {
1442 validChannelFlag = 1;
1443 break;
1444 }
1445 }
1446 }
1447 if(0 == validChannelFlag)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001448 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001449 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1450 "%s-No active channels present in the given range for the current region",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001451 __func__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001452 /* There is no active channel in the supplied range.Updating the config
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 with the default channels in the given band so that we can select the best channel in the sub-band*/
1454 startChannel = rfChannels[bandStartChannel].channelNum;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -07001455 endChannel = rfChannels[bandEndChannel].channelNum;
Jeff Johnson295189b2012-06-20 16:38:30 -07001456 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001457
1458 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND,
Jeff Johnson295189b2012-06-20 16:38:30 -07001459 operatingBand, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1460 {
1461 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1462 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND to CCn");
1463 return VOS_STATUS_E_FAULT;
1464 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001465 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL,
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 startChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1467 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001468
Jeff Johnson295189b2012-06-20 16:38:30 -07001469 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1470 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
1471 return VOS_STATUS_E_FAULT;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001472
1473 }
1474 if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL,
Jeff Johnson295189b2012-06-20 16:38:30 -07001475 endChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
1476 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001477
Jeff Johnson295189b2012-06-20 16:38:30 -07001478 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1479 "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
1480 return VOS_STATUS_E_FAULT;
1481 }
1482 return VOS_STATUS_SUCCESS;
1483}
Jeff Johnson295189b2012-06-20 16:38:30 -07001484
1485/*==========================================================================
1486 FUNCTION WLANSAP_SetCounterMeasure
1487
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001488 DESCRIPTION
1489 This api function is used to disassociate all the stations and prevent
1490 association for any other station.Whenever Authenticator receives 2 mic failures
1491 within 60 seconds, Authenticator will enable counter measure at SAP Layer.
1492 Authenticator will start the 60 seconds timer. Core stack will not allow any
1493 STA to associate till HDD disables counter meassure. Core stack shall kick out all the
1494 STA which are currently associated and DIASSOC Event will be propogated to HDD for
1495 each STA to clean up the HDD STA table.Once the 60 seconds timer expires, Authenticator
Jeff Johnson295189b2012-06-20 16:38:30 -07001496 will disable the counter meassure at core stack. Now core stack can allow STAs to associate.
1497
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001498 DEPENDENCIES
1499 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001500
1501 PARAMETERS
1502
1503 IN
1504pvosGCtx: Pointer to vos global context structure
1505bEnable: If TRUE than all stations will be disassociated and no more will be allowed to associate. If FALSE than CORE
1506will come out of this state.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001507
Jeff Johnson295189b2012-06-20 16:38:30 -07001508 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001509 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001510
1511 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001512
1513 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001514============================================================================*/
1515VOS_STATUS
1516WLANSAP_SetCounterMeasure
1517(
1518 v_PVOID_t pvosGCtx,
1519 v_BOOL_t bEnable
1520)
1521{
1522 ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1523
1524 /*------------------------------------------------------------------------
1525 Sanity check
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001526 Extract SAP control block
Jeff Johnson295189b2012-06-20 16:38:30 -07001527 ------------------------------------------------------------------------*/
1528 if (NULL == pSapCtx)
1529 {
1530 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001531 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001532 return VOS_STATUS_E_FAULT;
1533 }
1534
1535 sme_RoamTKIPCounterMeasures(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, bEnable);
1536
1537 return VOS_STATUS_SUCCESS;
1538}
1539
1540/*==========================================================================
1541
1542 FUNCTION WLANSAP_SetKeysSta
1543
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001544 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001545 This api function provides for Ap App/HDD to set key for a station.
1546
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001547 DEPENDENCIES
1548 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001549
1550 PARAMETERS
1551
1552 IN
1553pvosGCtx: Pointer to vos global context structure
1554pSetKeyInfo: tCsrRoamSetKey structure for the station
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001555
Jeff Johnson295189b2012-06-20 16:38:30 -07001556 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001557 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001558
1559 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001560
1561 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001562============================================================================*/
1563VOS_STATUS
1564WLANSAP_SetKeySta
1565(
1566 v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo
1567)
1568{
1569 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
1570 ptSapContext pSapCtx = NULL;
1571 v_PVOID_t hHal = NULL;
1572 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1573 v_U32_t roamId=0xFF;
1574
1575 if (VOS_STA_SAP_MODE == vos_get_conparam ( ))
1576 {
1577 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1578 if (NULL == pSapCtx)
1579 {
1580 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001581 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001582 return VOS_STATUS_E_FAULT;
1583 }
1584 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1585 if (NULL == hHal)
1586 {
1587 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001588 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001589 return VOS_STATUS_E_FAULT;
1590 }
1591 halStatus = sme_RoamSetKey(hHal, pSapCtx->sessionId, pSetKeyInfo, &roamId);
1592
1593 if (halStatus == eHAL_STATUS_SUCCESS)
1594 {
1595 vosStatus = VOS_STATUS_SUCCESS;
1596 } else
1597 {
1598 vosStatus = VOS_STATUS_E_FAULT;
1599 }
1600 }
1601 else
1602 vosStatus = VOS_STATUS_E_FAULT;
1603
1604 return vosStatus;
1605}
1606
1607/*==========================================================================
1608 FUNCTION WLANSAP_DelKeySta
1609
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001610 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 This api function provides for Ap App/HDD to delete key for a station.
1612
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001613 DEPENDENCIES
1614 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001615
1616 PARAMETERS
1617
1618 IN
1619pvosGCtx: Pointer to vos global context structure
1620pSetKeyInfo: tCsrRoamRemoveKey structure for the station
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001621
Jeff Johnson295189b2012-06-20 16:38:30 -07001622 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001623 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001624
1625 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001626
1627 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001628============================================================================*/
1629VOS_STATUS
1630WLANSAP_DelKeySta
1631(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001632 v_PVOID_t pvosGCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -07001633 tCsrRoamRemoveKey *pRemoveKeyInfo
1634)
1635{
1636 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
1637 ptSapContext pSapCtx = NULL;
1638 v_PVOID_t hHal = NULL;
1639 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1640 v_U32_t roamId=0xFF;
1641 tCsrRoamRemoveKey RemoveKeyInfo;
1642
1643 if (VOS_STA_SAP_MODE == vos_get_conparam ( ))
1644 {
1645 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1646 if (NULL == pSapCtx)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001647 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001648 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001649 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001650 return VOS_STATUS_E_FAULT;
1651 }
1652
1653 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1654 if (NULL == hHal)
1655 {
1656 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001657 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001658 return VOS_STATUS_E_FAULT;
1659 }
1660
1661 vos_mem_zero(&RemoveKeyInfo, sizeof(RemoveKeyInfo));
1662 RemoveKeyInfo.encType = pRemoveKeyInfo->encType;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001663 vos_mem_copy(RemoveKeyInfo.peerMac, pRemoveKeyInfo->peerMac, WNI_CFG_BSSID_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07001664 RemoveKeyInfo.keyId = pRemoveKeyInfo->keyId;
1665
1666 halStatus = sme_RoamRemoveKey(hHal, pSapCtx->sessionId, &RemoveKeyInfo, &roamId);
1667
1668 if (HAL_STATUS_SUCCESS(halStatus))
1669 {
1670 vosStatus = VOS_STATUS_SUCCESS;
1671 }
1672 else
1673 {
1674 vosStatus = VOS_STATUS_E_FAULT;
1675 }
1676 }
1677 else
1678 vosStatus = VOS_STATUS_E_FAULT;
1679
1680 return vosStatus;
1681}
1682
1683VOS_STATUS
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001684WLANSap_getstationIE_information(v_PVOID_t pvosGCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -07001685 v_U32_t *pLen,
1686 v_U8_t *pBuf)
1687{
1688 VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE;
1689 ptSapContext pSapCtx = NULL;
1690 v_U32_t len = 0;
1691
1692 if (VOS_STA_SAP_MODE == vos_get_conparam ( )){
1693 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1694 if (NULL == pSapCtx)
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001695 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001696 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001697 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001698 return VOS_STATUS_E_FAULT;
1699 }
1700 if (pLen)
1701 {
1702 len = *pLen;
1703 *pLen = pSapCtx->nStaWPARSnReqIeLength;
1704 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001705 "%s: WPAIE len : %x", __func__, *pLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 if(pBuf)
1707 {
1708 if(len >= pSapCtx->nStaWPARSnReqIeLength)
1709 {
1710 vos_mem_copy( pBuf, pSapCtx->pStaWpaRsnReqIE, pSapCtx->nStaWPARSnReqIeLength);
1711 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
1712 "%s: WPAIE: %02x:%02x:%02x:%02x:%02x:%02x",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001713 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001714 pBuf[0], pBuf[1], pBuf[2],
1715 pBuf[3], pBuf[4], pBuf[5]);
1716 vosStatus = VOS_STATUS_SUCCESS;
1717 }
1718 }
1719 }
1720 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001721
Jeff Johnson295189b2012-06-20 16:38:30 -07001722 if( VOS_STATUS_E_FAILURE == vosStatus)
1723 {
1724 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
1725 "%s: Error unable to populate the RSNWPAIE",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001726 __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001727 }
1728
1729 return vosStatus;
1730
1731}
1732
1733/*==========================================================================
1734 FUNCTION WLANSAP_Set_WpsIe
1735
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001736 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001737 This api function provides for Ap App/HDD to set WPS IE.
1738
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001739 DEPENDENCIES
1740 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001741
1742 PARAMETERS
1743
1744 IN
1745pvosGCtx: Pointer to vos global context structure
1746pWPSIE: tSap_WPSIE structure that include WPS IEs
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001747
Jeff Johnson295189b2012-06-20 16:38:30 -07001748 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001749 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001750
1751 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001752
1753 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001754============================================================================*/
1755VOS_STATUS
1756WLANSAP_Set_WpsIe
1757(
1758 v_PVOID_t pvosGCtx, tSap_WPSIE *pSap_WPSIe
1759)
1760{
1761 ptSapContext pSapCtx = NULL;
1762 v_PVOID_t hHal = NULL;
1763
1764 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001765 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001766
Jeff Johnson295189b2012-06-20 16:38:30 -07001767 if(VOS_STA_SAP_MODE == vos_get_conparam ( )) {
1768 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1769 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001770 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001771 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001772 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001773 return VOS_STATUS_E_FAULT;
1774 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001775
Jeff Johnson295189b2012-06-20 16:38:30 -07001776 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1777 if ( NULL == hHal ){
1778 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001779 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001780 return VOS_STATUS_E_FAULT;
1781 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001782
Jeff Johnson295189b2012-06-20 16:38:30 -07001783 if ( sap_AcquireGlobalLock( pSapCtx ) == VOS_STATUS_SUCCESS )
1784 {
1785 if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_BEACON_IE)
1786 {
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001787 vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSBeaconIE, &pSap_WPSIe->sapwpsie.sapWPSBeaconIE, sizeof(tSap_WPSBeaconIE));
Jeff Johnson295189b2012-06-20 16:38:30 -07001788 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001789 else if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_PROBE_RSP_IE)
Jeff Johnson295189b2012-06-20 16:38:30 -07001790 {
1791 vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSProbeRspIE, &pSap_WPSIe->sapwpsie.sapWPSProbeRspIE, sizeof(tSap_WPSProbeRspIE));
1792 }
1793 else
1794 {
1795 sap_ReleaseGlobalLock( pSapCtx );
1796 return VOS_STATUS_E_FAULT;
1797 }
1798 sap_ReleaseGlobalLock( pSapCtx );
1799 return VOS_STATUS_SUCCESS;
1800 }
1801 else
1802 return VOS_STATUS_E_FAULT;
1803 }
1804 else
1805 return VOS_STATUS_E_FAULT;
1806}
1807
1808/*==========================================================================
1809 FUNCTION WLANSAP_Update_WpsIe
1810
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001811 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001812 This api function provides for Ap App/HDD to update WPS IEs.
1813
1814 DEPENDENCIES
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001815 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001816
1817 PARAMETERS
1818
1819 IN
1820pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001821
Jeff Johnson295189b2012-06-20 16:38:30 -07001822 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001823 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001824
1825 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001826
1827 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001828============================================================================*/
1829VOS_STATUS
1830WLANSAP_Update_WpsIe
1831(
1832 v_PVOID_t pvosGCtx
1833)
1834{
1835 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1836 ptSapContext pSapCtx = NULL;
1837 eHalStatus halStatus = eHAL_STATUS_FAILURE;
1838 v_PVOID_t hHal = NULL;
1839
1840 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001841 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001842
Jeff Johnson295189b2012-06-20 16:38:30 -07001843 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
1844 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1845 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001846 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001847 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001848 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001849 return VOS_STATUS_E_FAULT;
1850 }
1851
1852 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1853 if ( NULL == hHal ){
1854 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001855 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001856 return VOS_STATUS_E_FAULT;
1857 }
1858
1859 halStatus = sme_RoamUpdateAPWPSIE( hHal, pSapCtx->sessionId, &pSapCtx->APWPSIEs);
1860
1861 if(halStatus == eHAL_STATUS_SUCCESS) {
1862 vosStatus = VOS_STATUS_SUCCESS;
1863 } else
1864 {
1865 vosStatus = VOS_STATUS_E_FAULT;
1866 }
1867
1868 }
1869
1870 return vosStatus;
1871}
1872
1873/*==========================================================================
1874 FUNCTION WLANSAP_Get_WPS_State
1875
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001876 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001877 This api function provides for Ap App/HDD to check if WPS session in process.
1878
1879 DEPENDENCIES
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001880 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001881
1882 PARAMETERS
1883
1884 IN
1885pvosGCtx: Pointer to vos global context structure
1886
1887 OUT
1888pbWPSState: Pointer to variable to indicate if it is in WPS Registration state
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001889
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001891 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001892
1893 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001894
1895 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001896============================================================================*/
1897VOS_STATUS
1898WLANSAP_Get_WPS_State
1899(
1900 v_PVOID_t pvosGCtx, v_BOOL_t *bWPSState
1901)
1902{
1903 ptSapContext pSapCtx = NULL;
1904 v_PVOID_t hHal = NULL;
1905
1906 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001907 "%s, %d", __func__, __LINE__);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001908
Jeff Johnson295189b2012-06-20 16:38:30 -07001909 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001910
Jeff Johnson295189b2012-06-20 16:38:30 -07001911 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
1912 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001913 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001915 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001916 return VOS_STATUS_E_FAULT;
1917 }
1918
1919 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
1920 if ( NULL == hHal ){
1921 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001922 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001923 return VOS_STATUS_E_FAULT;
1924 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001925
Jeff Johnson295189b2012-06-20 16:38:30 -07001926 if ( sap_AcquireGlobalLock(pSapCtx ) == VOS_STATUS_SUCCESS )
1927 {
1928 if(pSapCtx->APWPSIEs.SirWPSProbeRspIE.FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT)
1929 *bWPSState = eANI_BOOLEAN_TRUE;
1930 else
1931 *bWPSState = eANI_BOOLEAN_FALSE;
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001932
Jeff Johnson295189b2012-06-20 16:38:30 -07001933 sap_ReleaseGlobalLock( pSapCtx );
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001934
Jeff Johnson295189b2012-06-20 16:38:30 -07001935 return VOS_STATUS_SUCCESS;
1936 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001937 else
Jeff Johnson295189b2012-06-20 16:38:30 -07001938 return VOS_STATUS_E_FAULT;
1939 }
1940 else
1941 return VOS_STATUS_E_FAULT;
1942
1943}
1944
1945VOS_STATUS
1946sap_AcquireGlobalLock
1947(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001948 ptSapContext pSapCtx
Jeff Johnson295189b2012-06-20 16:38:30 -07001949)
1950{
1951 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1952
1953 if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &pSapCtx->SapGlobalLock) ) )
1954 {
1955 vosStatus = VOS_STATUS_SUCCESS;
1956 }
1957
1958 return (vosStatus);
1959}
1960
1961VOS_STATUS
1962sap_ReleaseGlobalLock
1963(
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001964 ptSapContext pSapCtx
Jeff Johnson295189b2012-06-20 16:38:30 -07001965)
1966{
1967 VOS_STATUS vosStatus = VOS_STATUS_E_FAULT;
1968
1969 if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &pSapCtx->SapGlobalLock) ) )
1970 {
1971 vosStatus = VOS_STATUS_SUCCESS;
1972 }
1973
1974 return (vosStatus);
1975}
1976
1977/*==========================================================================
1978 FUNCTION WLANSAP_Set_WPARSNIes
1979
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001980 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07001981 This api function provides for Ap App/HDD to set AP WPA and RSN IE in its beacon and probe response.
1982
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001983 DEPENDENCIES
1984 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07001985
1986 PARAMETERS
1987
1988 IN
1989 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001990 pWPARSNIEs: buffer to the WPA/RSN IEs
Jeff Johnson295189b2012-06-20 16:38:30 -07001991 WPARSNIEsLen: length of WPA/RSN IEs
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001992
Jeff Johnson295189b2012-06-20 16:38:30 -07001993 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001994 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07001995
1996 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07001997
1998 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07001999============================================================================*/
2000VOS_STATUS WLANSAP_Set_WPARSNIes(v_PVOID_t pvosGCtx, v_U8_t *pWPARSNIEs, v_U32_t WPARSNIEsLen)
2001{
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002002
Jeff Johnson295189b2012-06-20 16:38:30 -07002003 ptSapContext pSapCtx = NULL;
2004 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2005 v_PVOID_t hHal = NULL;
2006
2007 if(VOS_STA_SAP_MODE == vos_get_conparam ( )){
2008 pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
2009 if ( NULL == pSapCtx )
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002010 {
Jeff Johnson295189b2012-06-20 16:38:30 -07002011 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002012 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002013 return VOS_STATUS_E_FAULT;
2014 }
2015
2016 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2017 if ( NULL == hHal ){
2018 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002019 "%s: Invalid HAL pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002020 return VOS_STATUS_E_FAULT;
2021 }
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002022
Jeff Johnson295189b2012-06-20 16:38:30 -07002023 pSapCtx->APWPARSNIEs.length = (tANI_U16)WPARSNIEsLen;
2024 vos_mem_copy(pSapCtx->APWPARSNIEs.rsnIEdata, pWPARSNIEs, WPARSNIEsLen);
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002025
Jeff Johnson295189b2012-06-20 16:38:30 -07002026 halStatus = sme_RoamUpdateAPWPARSNIEs( hHal, pSapCtx->sessionId, &pSapCtx->APWPARSNIEs);
2027
2028 if(halStatus == eHAL_STATUS_SUCCESS) {
2029 return VOS_STATUS_SUCCESS;
2030 } else
2031 {
2032 return VOS_STATUS_E_FAULT;
2033 }
2034 }
2035
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002036 return VOS_STATUS_E_FAULT;
Jeff Johnson295189b2012-06-20 16:38:30 -07002037}
2038
2039VOS_STATUS WLANSAP_GetStatistics(v_PVOID_t pvosGCtx, tSap_SoftapStats *statBuf, v_BOOL_t bReset)
2040{
2041 if (NULL == pvosGCtx)
2042 {
2043 return VOS_STATUS_E_FAULT;
2044 }
2045
2046 return (WLANTL_GetSoftAPStatistics(pvosGCtx, statBuf, bReset));
2047}
2048
Jeff Johnson295189b2012-06-20 16:38:30 -07002049/*==========================================================================
2050
2051 FUNCTION WLANSAP_SendAction
2052
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002053 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002054 This api function provides to send action frame sent by upper layer.
2055
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002056 DEPENDENCIES
2057 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002058
2059 PARAMETERS
2060
2061 IN
2062 pvosGCtx: Pointer to vos global context structure
2063 pBuf: Pointer of the action frame to be transmitted
2064 len: Length of the action frame
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002065
Jeff Johnson295189b2012-06-20 16:38:30 -07002066 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002067 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002068
2069 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002070
2071 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002072============================================================================*/
2073VOS_STATUS WLANSAP_SendAction( v_PVOID_t pvosGCtx, const tANI_U8 *pBuf,
Jeff Johnsone7245742012-09-05 17:12:55 -07002074 tANI_U32 len, tANI_U16 wait )
Jeff Johnson295189b2012-06-20 16:38:30 -07002075{
2076 ptSapContext pSapCtx = NULL;
2077 v_PVOID_t hHal = NULL;
2078 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2079
2080 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2081 {
2082 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2083 if (NULL == pSapCtx)
2084 {
2085 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002086 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002087 return VOS_STATUS_E_FAULT;
2088 }
2089 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2090 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2091 {
2092 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2093 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002094 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002095 return VOS_STATUS_E_FAULT;
2096 }
2097
Jeff Johnsone7245742012-09-05 17:12:55 -07002098 halStatus = sme_sendAction( hHal, pSapCtx->sessionId, pBuf, len, 0 , 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002099
2100 if ( eHAL_STATUS_SUCCESS == halStatus )
2101 {
2102 return VOS_STATUS_SUCCESS;
2103 }
2104 }
2105
2106 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2107 "Failed to Send Action Frame");
2108
2109 return VOS_STATUS_E_FAULT;
2110}
2111
2112/*==========================================================================
2113
2114 FUNCTION WLANSAP_RemainOnChannel
2115
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002116 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002117 This api function provides to set Remain On channel on specified channel
2118 for specified duration.
2119
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002120 DEPENDENCIES
2121 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002122
2123 PARAMETERS
2124
2125 IN
2126 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002127 channel: Channel on which driver has to listen
Jeff Johnson295189b2012-06-20 16:38:30 -07002128 duration: Duration for which driver has to listen on specified channel
2129 callback: Callback function to be called once Listen is done.
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002130 pContext: Context needs to be called in callback function.
2131
Jeff Johnson295189b2012-06-20 16:38:30 -07002132 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002133 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002134
2135 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002136
2137 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002138============================================================================*/
2139VOS_STATUS WLANSAP_RemainOnChannel( v_PVOID_t pvosGCtx,
2140 tANI_U8 channel, tANI_U32 duration,
2141 remainOnChanCallback callback,
2142 void *pContext )
2143{
2144 ptSapContext pSapCtx = NULL;
2145 v_PVOID_t hHal = NULL;
2146 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2147
2148 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2149 {
2150 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2151 if (NULL == pSapCtx)
2152 {
2153 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002154 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002155 return VOS_STATUS_E_FAULT;
2156 }
2157 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2158 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2159 {
2160 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2161 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002162 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002163 return VOS_STATUS_E_FAULT;
2164 }
2165
2166 halStatus = sme_RemainOnChannel( hHal, pSapCtx->sessionId,
Gopichand Nakkala924e4552013-05-08 19:18:14 +05302167 channel, duration, callback, pContext, TRUE );
Jeff Johnson295189b2012-06-20 16:38:30 -07002168
2169 if( eHAL_STATUS_SUCCESS == halStatus )
2170 {
2171 return VOS_STATUS_SUCCESS;
2172 }
2173 }
2174
2175 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2176 "Failed to Set Remain on Channel");
2177
2178 return VOS_STATUS_E_FAULT;
2179}
2180
2181/*==========================================================================
2182
2183 FUNCTION WLANSAP_CancelRemainOnChannel
2184
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002185 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002186 This api cancel previous remain on channel request.
2187
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002188 DEPENDENCIES
2189 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002190
2191 PARAMETERS
2192
2193 IN
2194 pvosGCtx: Pointer to vos global context structure
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002195
Jeff Johnson295189b2012-06-20 16:38:30 -07002196 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002197 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002198
2199 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002200
2201 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002202============================================================================*/
2203VOS_STATUS WLANSAP_CancelRemainOnChannel( v_PVOID_t pvosGCtx )
2204{
2205 ptSapContext pSapCtx = NULL;
2206 v_PVOID_t hHal = NULL;
2207 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2208
2209 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2210 {
2211 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2212 if (NULL == pSapCtx)
2213 {
2214 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002215 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002216 return VOS_STATUS_E_FAULT;
2217 }
2218 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2219 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2220 {
2221 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2222 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002223 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002224 return VOS_STATUS_E_FAULT;
2225 }
2226
2227 halStatus = sme_CancelRemainOnChannel( hHal, pSapCtx->sessionId );
2228
2229 if( eHAL_STATUS_SUCCESS == halStatus )
2230 {
2231 return VOS_STATUS_SUCCESS;
2232 }
2233 }
2234
2235 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2236 "Failed to Cancel Remain on Channel");
2237
2238 return VOS_STATUS_E_FAULT;
2239}
2240
2241/*==========================================================================
2242
2243 FUNCTION WLANSAP_RegisterMgmtFrame
2244
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002245 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -07002246 HDD use this API to register specified type of frame with CORE stack.
2247 On receiving such kind of frame CORE stack should pass this frame to HDD
2248
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002249 DEPENDENCIES
2250 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002251
2252 PARAMETERS
2253
2254 IN
2255 pvosGCtx: Pointer to vos global context structure
2256 frameType: frameType that needs to be registered with PE.
2257 matchData: Data pointer which should be matched after frame type is matched.
2258 matchLen: Length of the matchData
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002259
Jeff Johnson295189b2012-06-20 16:38:30 -07002260 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002261 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002262
2263 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002264
2265 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002266============================================================================*/
2267VOS_STATUS WLANSAP_RegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType,
2268 tANI_U8* matchData, tANI_U16 matchLen )
2269{
2270 ptSapContext pSapCtx = NULL;
2271 v_PVOID_t hHal = NULL;
2272 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2273
2274 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2275 {
2276 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2277 if (NULL == pSapCtx)
2278 {
2279 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002280 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002281 return VOS_STATUS_E_FAULT;
2282 }
2283 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2284 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2285 {
2286 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2287 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002288 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002289 return VOS_STATUS_E_FAULT;
2290 }
2291
2292 halStatus = sme_RegisterMgmtFrame(hHal, pSapCtx->sessionId,
2293 frameType, matchData, matchLen);
2294
2295 if( eHAL_STATUS_SUCCESS == halStatus )
2296 {
2297 return VOS_STATUS_SUCCESS;
2298 }
2299 }
2300
2301 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2302 "Failed to Register MGMT frame");
2303
2304 return VOS_STATUS_E_FAULT;
2305}
2306
2307/*==========================================================================
2308
2309 FUNCTION WLANSAP_DeRegisterMgmtFrame
2310
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002311 DESCRIPTION
2312 This API is used to deregister previously registered frame.
Jeff Johnson295189b2012-06-20 16:38:30 -07002313
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002314 DEPENDENCIES
2315 NA.
Jeff Johnson295189b2012-06-20 16:38:30 -07002316
2317 PARAMETERS
2318
2319 IN
2320 pvosGCtx: Pointer to vos global context structure
2321 frameType: frameType that needs to be De-registered with PE.
2322 matchData: Data pointer which should be matched after frame type is matched.
2323 matchLen: Length of the matchData
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002324
Jeff Johnson295189b2012-06-20 16:38:30 -07002325 RETURN VALUE
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002326 The VOS_STATUS code associated with performing the operation
Jeff Johnson295189b2012-06-20 16:38:30 -07002327
2328 VOS_STATUS_SUCCESS: Success
Madan Mohan Koyyalamudi33a178c2012-09-18 18:17:13 -07002329
2330 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -07002331============================================================================*/
2332VOS_STATUS WLANSAP_DeRegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType,
2333 tANI_U8* matchData, tANI_U16 matchLen )
2334{
2335 ptSapContext pSapCtx = NULL;
2336 v_PVOID_t hHal = NULL;
2337 eHalStatus halStatus = eHAL_STATUS_FAILURE;
2338
2339 if( VOS_STA_SAP_MODE == vos_get_conparam ( ) )
2340 {
2341 pSapCtx = VOS_GET_SAP_CB( pvosGCtx );
2342 if (NULL == pSapCtx)
2343 {
2344 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002345 "%s: Invalid SAP pointer from pvosGCtx", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07002346 return VOS_STATUS_E_FAULT;
2347 }
2348 hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
2349 if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) )
2350 {
2351 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2352 "%s: HAL pointer (%p) NULL OR SME session is not open (%d)",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002353 __func__, hHal, pSapCtx->isSapSessionOpen );
Jeff Johnson295189b2012-06-20 16:38:30 -07002354 return VOS_STATUS_E_FAULT;
2355 }
2356
2357 halStatus = sme_DeregisterMgmtFrame( hHal, pSapCtx->sessionId,
2358 frameType, matchData, matchLen );
2359
2360 if( eHAL_STATUS_SUCCESS == halStatus )
2361 {
2362 return VOS_STATUS_SUCCESS;
2363 }
2364 }
2365
2366 VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
2367 "Failed to Deregister MGMT frame");
2368
2369 return VOS_STATUS_E_FAULT;
2370}
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05302371
2372/*==========================================================================
2373 FUNCTION WLANSAP_PopulateDelStaParams
2374
2375 DESCRIPTION
2376 This API is used to populate del station parameters
2377 DEPENDENCIES
2378 NA.
2379
2380 PARAMETERS
2381 IN
2382 mac: pointer to peer mac address.
2383 reason_code: Reason code for the disassoc/deauth.
2384 subtype: subtype points to either disassoc/deauth frame.
2385 pDelStaParams: address where parameters to be populated.
2386
2387 RETURN VALUE NONE
2388
2389 SIDE EFFECTS
2390============================================================================*/
2391void WLANSAP_PopulateDelStaParams(const v_U8_t *mac,
2392 v_U16_t reason_code,
2393 v_U8_t subtype,
2394 struct tagCsrDelStaParams *pDelStaParams)
2395{
2396 if (NULL == mac)
2397 memset(pDelStaParams->peerMacAddr, 0xff, VOS_MAC_ADDR_SIZE);
2398 else
2399 vos_mem_copy(pDelStaParams->peerMacAddr, mac, VOS_MAC_ADDR_SIZE);
2400
2401 if (reason_code == 0)
Sushant Kaushik4cd28f62014-12-26 14:23:50 +05302402 pDelStaParams->reason_code = eSIR_MAC_DEAUTH_LEAVING_BSS_REASON;
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +05302403 else
2404 pDelStaParams->reason_code = reason_code;
2405
2406 if (subtype == (SIR_MAC_MGMT_DEAUTH >> 4) ||
2407 subtype == (SIR_MAC_MGMT_DISASSOC >> 4))
2408 pDelStaParams->subtype = subtype;
2409 else
2410 pDelStaParams->subtype = (SIR_MAC_MGMT_DEAUTH >> 4);
2411
2412 VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
2413 FL("Delete STA with RC:%hu subtype:%hhu MAC::" MAC_ADDRESS_STR),
2414 pDelStaParams->reason_code, pDelStaParams->subtype,
2415 MAC_ADDR_ARRAY(pDelStaParams->peerMacAddr));
2416}