Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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. |
| 20 | */ |
| 21 | |
| 22 | /*=========================================================================== |
| 23 | |
| 24 | s a p M o d u l e . C |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 25 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26 | OVERVIEW: |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | This software unit holds the implementation of the WLAN SAP modules |
| 29 | functions providing EXTERNAL APIs. It is also where the global SAP module |
| 30 | context gets initialised |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 31 | |
| 32 | DEPENDENCIES: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 33 | |
| 34 | Are listed for each API below. |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 35 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 36 | Copyright (c) 2010 QUALCOMM Incorporated. |
| 37 | All Rights Reserved. |
| 38 | Qualcomm Confidential and Proprietary |
| 39 | ===========================================================================*/ |
| 40 | |
| 41 | /*=========================================================================== |
| 42 | |
| 43 | EDIT HISTORY FOR FILE |
| 44 | |
| 45 | |
| 46 | This section contains comments describing changes made to the module. |
| 47 | Notice that changes are listed in reverse chronological order. |
| 48 | |
| 49 | |
| 50 | |
| 51 | when who what, where, why |
| 52 | ---------- --- -------------------------------------------------------- |
| 53 | 03/15/10 SOFTAP team Created module |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 54 | 06/03/10 js Added support to hostapd driven |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | * deauth/disassoc/mic failure |
| 56 | |
| 57 | ===========================================================================*/ |
| 58 | |
| 59 | /* $Header$ */ |
| 60 | |
| 61 | /*---------------------------------------------------------------------------- |
| 62 | * Include Files |
| 63 | * -------------------------------------------------------------------------*/ |
| 64 | #include "wlan_qct_tl.h" |
| 65 | #include "vos_trace.h" |
| 66 | |
| 67 | // Pick up the sme callback registration API |
| 68 | #include "sme_Api.h" |
| 69 | |
| 70 | // SAP API header file |
| 71 | |
| 72 | #include "sapInternal.h" |
| 73 | #if defined(FEATURE_WLAN_NON_INTEGRATED_SOC) |
| 74 | #include "halInternal.h" |
| 75 | #endif |
| 76 | #include "smeInside.h" |
| 77 | |
| 78 | /*---------------------------------------------------------------------------- |
| 79 | * Preprocessor Definitions and Constants |
| 80 | * -------------------------------------------------------------------------*/ |
| 81 | #define SAP_DEBUG |
| 82 | |
| 83 | /*---------------------------------------------------------------------------- |
| 84 | * Type Declarations |
| 85 | * -------------------------------------------------------------------------*/ |
| 86 | |
| 87 | |
| 88 | /*---------------------------------------------------------------------------- |
| 89 | * Global Data Definitions |
| 90 | * -------------------------------------------------------------------------*/ |
| 91 | |
| 92 | /*---------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 93 | * External declarations for global context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | * -------------------------------------------------------------------------*/ |
| 95 | // No! Get this from VOS. |
| 96 | // The main per-Physical Link (per WLAN association) context. |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame^] | 97 | ptSapContext gpSapCtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 98 | |
| 99 | /*---------------------------------------------------------------------------- |
| 100 | * Static Variable Definitions |
| 101 | * -------------------------------------------------------------------------*/ |
| 102 | |
| 103 | /*---------------------------------------------------------------------------- |
| 104 | * Static Function Declarations and Definitions |
| 105 | * -------------------------------------------------------------------------*/ |
| 106 | |
| 107 | /*---------------------------------------------------------------------------- |
| 108 | * Externalized Function Definitions |
| 109 | * -------------------------------------------------------------------------*/ |
| 110 | |
| 111 | /*---------------------------------------------------------------------------- |
| 112 | * Function Declarations and Documentation |
| 113 | * -------------------------------------------------------------------------*/ |
| 114 | |
| 115 | /*========================================================================== |
| 116 | FUNCTION WLANSAP_Open |
| 117 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 118 | DESCRIPTION |
| 119 | Called at driver initialization (vos_open). SAP will initialize |
| 120 | all its internal resources and will wait for the call to start to |
| 121 | register with the other modules. |
| 122 | |
| 123 | DEPENDENCIES |
| 124 | |
| 125 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 126 | |
| 127 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 128 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
| 129 | control block can be extracted from its context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 131 | RETURN VALUE |
| 132 | The result code associated with performing the operation |
| 133 | |
| 134 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 135 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 136 | VOS_STATUS_SUCCESS: Success |
| 137 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 138 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 139 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 140 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | WLANSAP_Open |
| 142 | ( |
| 143 | v_PVOID_t pvosGCtx |
| 144 | ) |
| 145 | { |
| 146 | |
| 147 | ptSapContext pSapCtx = NULL; |
| 148 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 149 | VOS_ASSERT(pvosGCtx); |
| 150 | /*------------------------------------------------------------------------ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 151 | Allocate (and sanity check?!) SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 152 | ------------------------------------------------------------------------*/ |
| 153 | vos_alloc_context(pvosGCtx, VOS_MODULE_ID_SAP, (v_VOID_t **)&pSapCtx, sizeof(tSapContext)); |
| 154 | |
| 155 | if (NULL == pSapCtx) |
| 156 | { |
| 157 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 158 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 159 | return VOS_STATUS_E_FAULT; |
| 160 | } |
| 161 | |
| 162 | vos_mem_zero(pSapCtx, sizeof(tSapContext)); |
| 163 | |
| 164 | /*------------------------------------------------------------------------ |
| 165 | Clean up SAP control block, initialize all values |
| 166 | ------------------------------------------------------------------------*/ |
| 167 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Open"); |
| 168 | |
| 169 | WLANSAP_CleanCB(pSapCtx, 0 /*do not empty*/); |
| 170 | |
| 171 | // Setup the "link back" to the VOSS context |
| 172 | pSapCtx->pvosGCtx = pvosGCtx; |
| 173 | |
| 174 | // Store a pointer to the SAP context provided by VOSS |
| 175 | gpSapCtx = pSapCtx; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 177 | /*------------------------------------------------------------------------ |
| 178 | Allocate internal resources |
| 179 | ------------------------------------------------------------------------*/ |
| 180 | |
| 181 | return VOS_STATUS_SUCCESS; |
| 182 | }// WLANSAP_Open |
| 183 | |
| 184 | /*========================================================================== |
| 185 | FUNCTION WLANSAP_Start |
| 186 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 187 | DESCRIPTION |
| 188 | Called as part of the overall start procedure (vos_start). SAP will |
| 189 | use this call to register with TL as the SAP entity for |
| 190 | SAP RSN frames. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 191 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 192 | DEPENDENCIES |
| 193 | |
| 194 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 195 | |
| 196 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 197 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
| 198 | control block can be extracted from its context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | |
| 200 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 201 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 203 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 204 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 205 | VOS_STATUS_SUCCESS: Success |
| 206 | |
| 207 | SIDE EFFECTS |
| 208 | ============================================================================*/ |
| 209 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 210 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | WLANSAP_Start |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 212 | ( |
| 213 | v_PVOID_t pvosGCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 214 | ) |
| 215 | { |
| 216 | #ifdef WLAN_SOFTAP_FEATURE |
| 217 | ptSapContext pSapCtx = NULL; |
| 218 | |
| 219 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 220 | |
| 221 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 222 | "WLANSAP_Start invoked successfully\n"); |
| 223 | /*------------------------------------------------------------------------ |
| 224 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 225 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 226 | ------------------------------------------------------------------------*/ |
| 227 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 228 | if ( NULL == pSapCtx ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 229 | { |
| 230 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 231 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 232 | return VOS_STATUS_E_FAULT; |
| 233 | } |
| 234 | |
| 235 | /*------------------------------------------------------------------------ |
| 236 | For now, presume security is not enabled. |
| 237 | -----------------------------------------------------------------------*/ |
| 238 | pSapCtx->ucSecEnabled = WLANSAP_SECURITY_ENABLED_STATE; |
| 239 | |
| 240 | |
| 241 | /*------------------------------------------------------------------------ |
| 242 | Now configure the roaming profile links. To SSID and bssid. |
| 243 | ------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 244 | // We have room for two SSIDs. |
| 245 | pSapCtx->csrRoamProfile.SSIDs.numOfSSIDs = 1; // This is true for now. |
| 246 | pSapCtx->csrRoamProfile.SSIDs.SSIDList = pSapCtx->SSIDList; //Array of two |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 247 | pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].SSID.length = 0; |
| 248 | pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].handoffPermitted = VOS_FALSE; |
| 249 | pSapCtx->csrRoamProfile.SSIDs.SSIDList[0].ssidHidden = pSapCtx->SSIDList[0].ssidHidden; |
| 250 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 251 | pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; // This is true for now. |
| 252 | pSapCtx->csrRoamProfile.BSSIDs.bssid = &pSapCtx->bssid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 253 | |
| 254 | // Now configure the auth type in the roaming profile. To open. |
| 255 | pSapCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 257 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pSapCtx->SapGlobalLock))) |
| 258 | { |
| 259 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 260 | "WLANSAP_Start failed init lock\n"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | return VOS_STATUS_E_FAULT; |
| 262 | } |
| 263 | |
| 264 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 265 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | |
| 267 | return VOS_STATUS_SUCCESS; |
| 268 | }/* WLANSAP_Start */ |
| 269 | |
| 270 | /*========================================================================== |
| 271 | |
| 272 | FUNCTION WLANSAP_Stop |
| 273 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 274 | DESCRIPTION |
| 275 | Called by vos_stop to stop operation in SAP, before close. SAP will suspend all |
| 276 | BT-AMP Protocol Adaption Layer operation and will wait for the close |
| 277 | request to clean up its resources. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 279 | DEPENDENCIES |
| 280 | |
| 281 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | |
| 283 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 284 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
| 285 | control block can be extracted from its context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 286 | |
| 287 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 288 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 289 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 290 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 291 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | VOS_STATUS_SUCCESS: Success |
| 293 | |
| 294 | SIDE EFFECTS |
| 295 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 296 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 297 | WLANSAP_Stop |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 298 | ( |
| 299 | v_PVOID_t pvosGCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | ) |
| 301 | { |
| 302 | |
| 303 | #ifdef WLAN_SOFTAP_FEATURE |
| 304 | ptSapContext pSapCtx = NULL; |
| 305 | |
| 306 | /*------------------------------------------------------------------------ |
| 307 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 308 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 309 | ------------------------------------------------------------------------*/ |
| 310 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 311 | "WLANSAP_Stop invoked successfully "); |
| 312 | |
| 313 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 314 | if (NULL == pSapCtx) |
| 315 | { |
| 316 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 317 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 318 | return VOS_STATUS_E_FAULT; |
| 319 | } |
| 320 | |
| 321 | sapFreeRoamProfile(&pSapCtx->csrRoamProfile); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pSapCtx->SapGlobalLock ) ) ) |
| 324 | { |
| 325 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 326 | "WLANSAP_Stop failed destroy lock\n"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 327 | return VOS_STATUS_E_FAULT; |
| 328 | } |
| 329 | /*------------------------------------------------------------------------ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 330 | Stop SAP (de-register RSN handler!?) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 331 | ------------------------------------------------------------------------*/ |
| 332 | #endif |
| 333 | |
| 334 | return VOS_STATUS_SUCCESS; |
| 335 | }/* WLANSAP_Stop */ |
| 336 | |
| 337 | /*========================================================================== |
| 338 | FUNCTION WLANSAP_Close |
| 339 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 340 | DESCRIPTION |
| 341 | Called by vos_close during general driver close procedure. SAP will clean up |
| 342 | all the internal resources. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 343 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 344 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 346 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 347 | |
| 348 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 349 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
| 350 | control block can be extracted from its context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 351 | |
| 352 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 353 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 354 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 355 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 356 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | VOS_STATUS_SUCCESS: Success |
| 358 | |
| 359 | SIDE EFFECTS |
| 360 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 361 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 362 | WLANSAP_Close |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 363 | ( |
| 364 | v_PVOID_t pvosGCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | ) |
| 366 | { |
| 367 | #ifdef WLAN_SOFTAP_FEATURE |
| 368 | ptSapContext pSapCtx = NULL; |
| 369 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 370 | |
| 371 | /*------------------------------------------------------------------------ |
| 372 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 373 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | ------------------------------------------------------------------------*/ |
| 375 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 376 | "WLANSAP_Close invoked"); |
| 377 | |
| 378 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 379 | if (NULL == pSapCtx) |
| 380 | { |
| 381 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 382 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 383 | return VOS_STATUS_E_FAULT; |
| 384 | } |
| 385 | |
| 386 | /*------------------------------------------------------------------------ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 387 | Cleanup SAP control block. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | ------------------------------------------------------------------------*/ |
| 389 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_Close"); |
| 390 | WLANSAP_CleanCB(pSapCtx, VOS_TRUE /* empty queues/lists/pkts if any*/); |
| 391 | |
| 392 | /*------------------------------------------------------------------------ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 393 | Free SAP context from VOSS global |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 394 | ------------------------------------------------------------------------*/ |
| 395 | vos_free_context(pvosGCtx, VOS_MODULE_ID_SAP, pSapCtx); |
| 396 | |
| 397 | #endif |
| 398 | return VOS_STATUS_SUCCESS; |
| 399 | }/* WLANSAP_Close */ |
| 400 | |
| 401 | /*---------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 402 | * Utility Function implementations |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | * -------------------------------------------------------------------------*/ |
| 404 | |
| 405 | /*========================================================================== |
| 406 | |
| 407 | FUNCTION WLANSAP_CleanCB |
| 408 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 409 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 410 | Clear out all fields in the SAP context. |
| 411 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 412 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 413 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 414 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | |
| 416 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 417 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
| 418 | control block can be extracted from its context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 419 | |
| 420 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 421 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 422 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 423 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 424 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 425 | VOS_STATUS_SUCCESS: Success |
| 426 | |
| 427 | SIDE EFFECTS |
| 428 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 429 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 430 | WLANSAP_CleanCB |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 431 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 432 | ptSapContext pSapCtx, |
| 433 | v_U32_t freeFlag // 0 /*do not empty*/); |
| 434 | ) |
| 435 | { |
| 436 | #ifdef WLAN_SOFTAP_FEATURE |
| 437 | /*------------------------------------------------------------------------ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 438 | Sanity check SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | ------------------------------------------------------------------------*/ |
| 440 | |
| 441 | if (NULL == pSapCtx) |
| 442 | { |
| 443 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 444 | "%s: Invalid SAP pointer", __FUNCTION__); |
| 445 | return VOS_STATUS_E_FAULT; |
| 446 | } |
| 447 | |
| 448 | /*------------------------------------------------------------------------ |
| 449 | Clean up SAP control block, initialize all values |
| 450 | ------------------------------------------------------------------------*/ |
| 451 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANSAP_CleanCB"); |
| 452 | |
| 453 | vos_mem_zero( pSapCtx, sizeof(tSapContext)); |
| 454 | |
| 455 | pSapCtx->pvosGCtx = NULL; |
| 456 | |
| 457 | pSapCtx->sapsMachine= eSAP_DISCONNECTED; |
| 458 | |
| 459 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d, sapContext value = %x", |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 460 | __FUNCTION__, pSapCtx->sapsMachine, pSapCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 461 | pSapCtx->sessionId = 0; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 462 | pSapCtx->channel = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | |
| 464 | #endif |
| 465 | return VOS_STATUS_SUCCESS; |
| 466 | }// WLANSAP_CleanCB |
| 467 | |
| 468 | /*========================================================================== |
| 469 | FUNCTION WLANSAP_pmcFullPwrReqCB |
| 470 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 471 | DESCRIPTION |
| 472 | Callback provide to PMC in the pmcRequestFullPower API. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 474 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 475 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 476 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | |
| 478 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 479 | callbackContext: The user passed in a context to identify |
| 480 | status: The halStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 481 | |
| 482 | RETURN VALUE |
| 483 | None |
| 484 | |
| 485 | SIDE EFFECTS |
| 486 | ============================================================================*/ |
| 487 | void |
| 488 | WLANSAP_pmcFullPwrReqCB |
| 489 | ( |
| 490 | void *callbackContext, |
| 491 | eHalStatus status |
| 492 | ) |
| 493 | { |
| 494 | if(HAL_STATUS_SUCCESS(status)) |
| 495 | { |
| 496 | //If success what else to be handled??? |
| 497 | } |
| 498 | else |
| 499 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 500 | VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 501 | "WLANSAP_pmcFullPwrReqCB: PMC failed to put the chip in Full power\n"); |
| 502 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | }// WLANSAP_pmcFullPwrReqCB |
| 506 | /*========================================================================== |
| 507 | FUNCTION WLANSAP_getState |
| 508 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 509 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | This api returns the current SAP state to the caller. |
| 511 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 512 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 513 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 514 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 515 | |
| 516 | IN |
| 517 | pContext : Pointer to Sap Context structure |
| 518 | |
| 519 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 520 | Returns the SAP FSM state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 521 | ============================================================================*/ |
| 522 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 523 | v_U8_t WLANSAP_getState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | ( |
| 525 | v_PVOID_t pvosGCtx |
| 526 | ) |
| 527 | { |
| 528 | ptSapContext pSapCtx = NULL; |
| 529 | |
| 530 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 531 | |
| 532 | if ( NULL == pSapCtx ) |
| 533 | { |
| 534 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 535 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 536 | return VOS_STATUS_E_FAULT; |
| 537 | } |
| 538 | return pSapCtx->sapsMachine; |
| 539 | } |
| 540 | |
| 541 | /*========================================================================== |
| 542 | FUNCTION WLANSAP_StartBss |
| 543 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 544 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 545 | This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for |
| 546 | starting AP BSS |
| 547 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 548 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 549 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 550 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 551 | |
| 552 | IN |
| 553 | pContext : Pointer to Sap Context structure |
| 554 | pQctCommitConfig : Pointer to configuration structure passed down from HDD(HostApd for Android) |
| 555 | hdd_SapEventCallback: Callback function in HDD called by SAP to inform HDD about SAP results |
| 556 | pUsrContext : Parameter that will be passed back in all the SAP callback events. |
| 557 | |
| 558 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 559 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 561 | VOS_STATUS_E_FAULT: Pointer to SAP cb is NULL ; access would cause a page |
| 562 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 563 | VOS_STATUS_SUCCESS: Success |
| 564 | |
| 565 | SIDE EFFECTS |
| 566 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 567 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 568 | WLANSAP_StartBss |
| 569 | ( |
| 570 | v_PVOID_t pvosGCtx,//pwextCtx |
| 571 | tpWLAN_SAPEventCB pSapEventCallback, |
| 572 | tsap_Config_t *pConfig, |
| 573 | v_PVOID_t pUsrContext |
| 574 | ) |
| 575 | { |
| 576 | tWLAN_SAPEvent sapEvent; /* State machine event*/ |
| 577 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 578 | ptSapContext pSapCtx = NULL; |
| 579 | tANI_BOOLEAN restartNeeded; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 580 | tHalHandle hHal; |
| 581 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 582 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 583 | |
| 584 | /*------------------------------------------------------------------------ |
| 585 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 586 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | ------------------------------------------------------------------------*/ |
| 588 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 589 | "WLANSAP_StartBss"); |
| 590 | |
| 591 | if (VOS_STA_SAP_MODE == vos_get_conparam ()) |
| 592 | { |
| 593 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 594 | if ( NULL == pSapCtx ) |
| 595 | { |
| 596 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 597 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 598 | return VOS_STATUS_E_FAULT; |
| 599 | } |
| 600 | pSapCtx->sapsMachine = eSAP_DISCONNECTED; |
| 601 | |
| 602 | /* Channel selection is auto or configured */ |
| 603 | pSapCtx->channel = pConfig->channel; |
| 604 | pSapCtx->pUsrContext = pUsrContext; |
| 605 | |
| 606 | //Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD |
| 607 | pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 608 | vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | pSapCtx->self_mac_addr, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 610 | sizeof( tCsrBssid ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | |
| 612 | //Save a copy to SAP context |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 613 | vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 614 | pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t)); |
| 615 | vos_mem_copy(pSapCtx->self_mac_addr, |
| 616 | pConfig->self_macaddr.bytes, sizeof(v_MACADDR_t)); |
| 617 | |
| 618 | //copy the configuration items to csrProfile |
| 619 | sapconvertToCsrProfile( pConfig, eCSR_BSS_TYPE_INFRA_AP, &pSapCtx->csrRoamProfile); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 620 | hHal = (tHalHandle)VOS_GET_HAL_CB(pvosGCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 621 | if (NULL == hHal) |
| 622 | { |
| 623 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 624 | "%s: Invalid MAC context from pvosGCtx", __FUNCTION__); |
| 625 | } |
| 626 | else |
| 627 | { |
| 628 | //If concurrent session is running that is already associated |
| 629 | //then we just follow that sessions country info (whether |
| 630 | //present or not doesn't maater as we have to follow whatever |
| 631 | //STA session does) |
| 632 | if (0 == sme_GetConcurrentOperationChannel(hHal)) |
| 633 | { |
| 634 | /* Setting the region/country information */ |
| 635 | sme_setRegInfo(hHal, pConfig->countryCode); |
| 636 | sme_ResetCountryCodeInformation(hHal, &restartNeeded); |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | // Copy MAC filtering settings to sap context |
| 641 | pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl; |
| 642 | vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac)); |
| 643 | pSapCtx->nAcceptMac = pConfig->num_accept_mac; |
| 644 | sapSortMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac); |
| 645 | vos_mem_copy(pSapCtx->denyMacList, pConfig->deny_mac, sizeof(pConfig->deny_mac)); |
| 646 | pSapCtx->nDenyMac = pConfig->num_deny_mac; |
| 647 | sapSortMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac); |
| 648 | |
| 649 | /* Fill in the event structure for FSM */ |
| 650 | sapEvent.event = eSAP_HDD_START_INFRA_BSS; |
| 651 | sapEvent.params = 0;//pSapPhysLinkCreate |
| 652 | |
| 653 | /* Store the HDD callback in SAP context */ |
| 654 | pSapCtx->pfnSapEventCallback = pSapEventCallback; |
| 655 | |
| 656 | /* Handle event*/ |
| 657 | vosStatus = sapFsm(pSapCtx, &sapEvent); |
| 658 | } |
| 659 | else |
| 660 | { |
| 661 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 662 | "SoftAp role has not been enabled"); |
| 663 | } |
| 664 | |
| 665 | return vosStatus; |
| 666 | }// WLANSAP_StartBss |
| 667 | |
| 668 | /*========================================================================== |
| 669 | FUNCTION WLANSAP_StopBss |
| 670 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 671 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 672 | This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for |
| 673 | stopping AP BSS |
| 674 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 675 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 676 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 677 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 678 | |
| 679 | IN |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 680 | pvosGCtx : Pointer to the global vos context; a handle to SAP's |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 681 | control block can be extracted from its contexe |
| 682 | |
| 683 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 684 | The result code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 686 | VOS_STATUS_E_FAULT: Pointer to VOSS GC is NULL ; access would cause a page |
| 687 | fault |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 688 | VOS_STATUS_SUCCESS: Success |
| 689 | |
| 690 | SIDE EFFECTS |
| 691 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 692 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | WLANSAP_StopBss |
| 694 | ( |
| 695 | v_PVOID_t pvosGCtx |
| 696 | ) |
| 697 | { |
| 698 | tWLAN_SAPEvent sapEvent; /* State machine event*/ |
| 699 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 700 | ptSapContext pSapCtx = NULL; |
| 701 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 702 | |
| 703 | /*------------------------------------------------------------------------ |
| 704 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 705 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 706 | ------------------------------------------------------------------------*/ |
| 707 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, |
| 708 | "WLANSAP_StopBss"); |
| 709 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 710 | if ( NULL == pvosGCtx ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 711 | { |
| 712 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 713 | "%s: Invalid Global VOSS handle", __FUNCTION__); |
| 714 | return VOS_STATUS_E_FAULT; |
| 715 | } |
| 716 | |
| 717 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 718 | |
| 719 | if (NULL == pSapCtx ) |
| 720 | { |
| 721 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 722 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 723 | return VOS_STATUS_E_FAULT; |
| 724 | } |
| 725 | |
| 726 | /* Fill in the event structure for FSM */ |
| 727 | sapEvent.event = eSAP_HDD_STOP_INFRA_BSS; |
| 728 | sapEvent.params = 0; |
| 729 | |
| 730 | /* Handle event*/ |
| 731 | vosStatus = sapFsm(pSapCtx, &sapEvent); |
| 732 | |
| 733 | return vosStatus; |
| 734 | } |
| 735 | |
| 736 | /*========================================================================== |
| 737 | FUNCTION WLANSAP_GetAssocStations |
| 738 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 739 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | This api function is used to probe the list of associated stations from various modules of CORE stack |
| 741 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 742 | DEPENDENCIES |
| 743 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 744 | |
| 745 | PARAMETERS |
| 746 | |
| 747 | IN |
| 748 | pvosGCtx : Pointer to vos global context structure |
| 749 | modId : Module from whom list of associtated stations is supposed to be probed. If an invalid module is passed |
| 750 | then by default VOS_MODULE_ID_PE will be probed |
| 751 | IN/OUT |
| 752 | pAssocStas : Pointer to list of associated stations that are known to the module specified in mod parameter |
| 753 | |
| 754 | NOTE: The memory for this list will be allocated by the caller of this API |
| 755 | |
| 756 | RETURN VALUE |
| 757 | The VOS_STATUS code associated with performing the operation |
| 758 | |
| 759 | VOS_STATUS_SUCCESS: Success |
| 760 | |
| 761 | SIDE EFFECTS |
| 762 | ============================================================================*/ |
| 763 | VOS_STATUS |
| 764 | WLANSAP_GetAssocStations |
| 765 | ( |
| 766 | v_PVOID_t pvosGCtx, |
| 767 | VOS_MODULE_ID modId, |
| 768 | tpSap_AssocMacAddr pAssocStas |
| 769 | ) |
| 770 | { |
| 771 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 772 | |
| 773 | /*------------------------------------------------------------------------ |
| 774 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 775 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | ------------------------------------------------------------------------*/ |
| 777 | if (NULL == pSapCtx) |
| 778 | { |
| 779 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 780 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 781 | return VOS_STATUS_E_FAULT; |
| 782 | } |
| 783 | |
| 784 | sme_RoamGetAssociatedStas( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, |
| 785 | modId, |
| 786 | pSapCtx->pUsrContext, |
| 787 | (v_PVOID_t *)pSapCtx->pfnSapEventCallback, |
| 788 | (v_U8_t *)pAssocStas ); |
| 789 | |
| 790 | return VOS_STATUS_SUCCESS; |
| 791 | } |
| 792 | |
| 793 | |
| 794 | /*========================================================================== |
| 795 | FUNCTION WLANSAP_RemoveWpsSessionOverlap |
| 796 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 797 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 798 | This api function provides for Ap App/HDD to remove an entry from session session overlap info. |
| 799 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 800 | DEPENDENCIES |
| 801 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 802 | |
| 803 | PARAMETERS |
| 804 | |
| 805 | IN |
| 806 | pvosGCtx: Pointer to vos global context structure |
| 807 | pRemoveMac: pointer to v_MACADDR_t for session MAC address |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 808 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 809 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 810 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 811 | |
| 812 | VOS_STATUS_SUCCESS: Success |
| 813 | VOS_STATUS_E_FAULT: Session is not dectected. The parameter is function not valid. |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 814 | |
| 815 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 816 | ============================================================================*/ |
| 817 | VOS_STATUS |
| 818 | WLANSAP_RemoveWpsSessionOverlap |
| 819 | |
| 820 | ( |
| 821 | v_PVOID_t pvosGCtx, |
| 822 | v_MACADDR_t pRemoveMac |
| 823 | ) |
| 824 | { |
| 825 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 826 | |
| 827 | /*------------------------------------------------------------------------ |
| 828 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 829 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 830 | ------------------------------------------------------------------------*/ |
| 831 | if (NULL == pSapCtx) |
| 832 | { |
| 833 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 834 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 835 | return VOS_STATUS_E_FAULT; |
| 836 | } |
| 837 | |
| 838 | sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, |
| 839 | pSapCtx->pUsrContext, |
| 840 | (v_PVOID_t *)pSapCtx->pfnSapEventCallback, |
| 841 | pRemoveMac); |
| 842 | |
| 843 | return VOS_STATUS_SUCCESS; |
| 844 | } |
| 845 | |
| 846 | /*========================================================================== |
| 847 | FUNCTION WLANSAP_getWpsSessionOverlap |
| 848 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 849 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 850 | This api function provides for Ap App/HDD to get WPS session overlap info. |
| 851 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 852 | DEPENDENCIES |
| 853 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 854 | |
| 855 | PARAMETERS |
| 856 | |
| 857 | IN |
| 858 | pvosGCtx: Pointer to vos global context structure |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 859 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 860 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 861 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 862 | |
| 863 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 864 | |
| 865 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 866 | ============================================================================*/ |
| 867 | VOS_STATUS |
| 868 | WLANSAP_getWpsSessionOverlap |
| 869 | ( |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 870 | v_PVOID_t pvosGCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 871 | ) |
| 872 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 873 | v_MACADDR_t pRemoveMac = VOS_MAC_ADDR_ZERO_INITIALIZER; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 874 | |
| 875 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 876 | |
| 877 | /*------------------------------------------------------------------------ |
| 878 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 879 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 880 | ------------------------------------------------------------------------*/ |
| 881 | if (NULL == pSapCtx) |
| 882 | { |
| 883 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 884 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 885 | return VOS_STATUS_E_FAULT; |
| 886 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 887 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 888 | sme_RoamGetWpsSessionOverlap( VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, |
| 889 | pSapCtx->pUsrContext, |
| 890 | (v_PVOID_t *)pSapCtx->pfnSapEventCallback, |
| 891 | pRemoveMac); |
| 892 | |
| 893 | return VOS_STATUS_SUCCESS; |
| 894 | } |
| 895 | |
| 896 | |
| 897 | /* This routine will set the mode of operation for ACL dynamically*/ |
| 898 | VOS_STATUS |
| 899 | WLANSAP_SetMode ( v_PVOID_t pvosGCtx, v_U32_t mode) |
| 900 | { |
| 901 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 902 | |
| 903 | if (NULL == pSapCtx) |
| 904 | { |
| 905 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 906 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 907 | return VOS_STATUS_E_FAULT; |
| 908 | } |
| 909 | |
| 910 | pSapCtx->eSapMacAddrAclMode = (eSapMacAddrACL)mode; |
| 911 | return VOS_STATUS_SUCCESS; |
| 912 | } |
| 913 | |
| 914 | /* This routine will clear all the entries in accept list as well as deny list */ |
| 915 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 916 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 917 | WLANSAP_ClearACL( v_PVOID_t pvosGCtx) |
| 918 | { |
| 919 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 920 | v_U8_t i; |
| 921 | |
| 922 | if (NULL == pSapCtx) |
| 923 | { |
| 924 | return VOS_STATUS_E_RESOURCES; |
| 925 | } |
| 926 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 927 | if (pSapCtx->denyMacList != NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 928 | { |
| 929 | for (i = 0; i < (pSapCtx->nDenyMac-1); i++) |
| 930 | { |
| 931 | vos_mem_zero((pSapCtx->denyMacList+i)->bytes, sizeof(v_MACADDR_t)); |
| 932 | |
| 933 | } |
| 934 | } |
| 935 | sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac); |
| 936 | pSapCtx->nDenyMac = 0; |
| 937 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 938 | if (pSapCtx->acceptMacList!=NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 939 | { |
| 940 | for (i = 0; i < (pSapCtx->nAcceptMac-1); i++) |
| 941 | { |
| 942 | vos_mem_zero((pSapCtx->acceptMacList+i)->bytes, sizeof(v_MACADDR_t)); |
| 943 | |
| 944 | } |
| 945 | } |
| 946 | sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac); |
| 947 | pSapCtx->nAcceptMac = 0; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 948 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 949 | return VOS_STATUS_SUCCESS; |
| 950 | } |
| 951 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 952 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 953 | WLANSAP_ModifyACL |
| 954 | ( |
| 955 | v_PVOID_t pvosGCtx, |
| 956 | v_U8_t *pPeerStaMac, |
| 957 | eSapACLType listType, |
| 958 | eSapACLCmdType cmd |
| 959 | ) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 960 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 961 | eSapBool staInWhiteList=eSAP_FALSE, staInBlackList=eSAP_FALSE; |
| 962 | v_U8_t staWLIndex, staBLIndex; |
| 963 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 964 | |
| 965 | if (NULL == pSapCtx) |
| 966 | { |
| 967 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 968 | "%s: Invalid SAP Context", __FUNCTION__); |
| 969 | return VOS_STATUS_E_FAULT; |
| 970 | } |
| 971 | |
| 972 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"Modify ACL entered\n" |
| 973 | "Before modification of ACL\n" |
| 974 | "size of accept and deny lists %d %d", |
| 975 | pSapCtx->nAcceptMac, pSapCtx->nDenyMac); |
| 976 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***"); |
| 977 | sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac); |
| 978 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***"); |
| 979 | sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac); |
| 980 | |
| 981 | /* the expectation is a mac addr will not be in both the lists at the same time. |
| 982 | It is the responsiblity of userspace to ensure this */ |
| 983 | staInWhiteList = sapSearchMacList(pSapCtx->acceptMacList, pSapCtx->nAcceptMac, pPeerStaMac, &staWLIndex); |
| 984 | staInBlackList = sapSearchMacList(pSapCtx->denyMacList, pSapCtx->nDenyMac, pPeerStaMac, &staBLIndex); |
| 985 | |
| 986 | if (staInWhiteList && staInBlackList) |
| 987 | { |
| 988 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 989 | "Peer mac %02x:%02x:%02x:%02x:%02x:%02x found in white and black lists." |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 990 | "Initial lists passed incorrect. Cannot execute this command.", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 992 | pPeerStaMac[4], pPeerStaMac[5]); |
| 993 | return VOS_STATUS_E_FAILURE; |
| 994 | |
| 995 | } |
| 996 | |
| 997 | switch(listType) |
| 998 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 999 | case eSAP_WHITE_LIST: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1000 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "cmd %d", cmd); |
| 1001 | if (cmd == ADD_STA_TO_ACL) |
| 1002 | { |
| 1003 | //error check |
| 1004 | // if list is already at max, return failure |
| 1005 | if (pSapCtx->nAcceptMac == MAX_MAC_ADDRESS_ACCEPTED) |
| 1006 | { |
| 1007 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1008 | "White list is already maxed out. Cannot accept %02x:%02x:%02x:%02x:%02x:%02x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1009 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1010 | pPeerStaMac[4], pPeerStaMac[5]); |
| 1011 | return VOS_STATUS_E_FAILURE; |
| 1012 | } |
| 1013 | if (staInWhiteList) |
| 1014 | { |
| 1015 | //Do nothing if already present in white list. Just print a warning |
| 1016 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1017 | "MAC address already present in white list %02x:%02x:%02x:%02x:%02x:%02x", |
| 1018 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1019 | pPeerStaMac[4], pPeerStaMac[5]); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1020 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1021 | { |
| 1022 | if (staInBlackList) |
| 1023 | { |
| 1024 | //remove it from black list before adding to the white list |
| 1025 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1026 | "STA present in black list so first remove from it"); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1027 | sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1028 | } |
| 1029 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1030 | "... Now add to the white list"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1031 | sapAddMacToACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, pPeerStaMac); |
| 1032 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d", |
| 1033 | pSapCtx->nAcceptMac, pSapCtx->nDenyMac); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1034 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1035 | } |
| 1036 | else if (cmd == DELETE_STA_FROM_ACL) |
| 1037 | { |
| 1038 | if (staInWhiteList) |
| 1039 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1040 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from white list"); |
| 1041 | sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1042 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, "size of accept and deny lists %d %d", |
| 1043 | pSapCtx->nAcceptMac, pSapCtx->nDenyMac); |
| 1044 | } |
| 1045 | else |
| 1046 | { |
| 1047 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1048 | "MAC address to be deleted is not present in the white list %02x:%02x:%02x:%02x:%02x:%02x", |
| 1049 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1050 | pPeerStaMac[4], pPeerStaMac[5]); |
| 1051 | return VOS_STATUS_E_FAILURE; |
| 1052 | } |
| 1053 | } |
| 1054 | else |
| 1055 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1056 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1057 | return VOS_STATUS_E_FAILURE; |
| 1058 | } |
| 1059 | break; |
| 1060 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1061 | case eSAP_BLACK_LIST: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1062 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW, |
| 1063 | "cmd %d", cmd); |
| 1064 | if (cmd == ADD_STA_TO_ACL) |
| 1065 | { |
| 1066 | //error check |
| 1067 | // if list is already at max, return failure |
| 1068 | if (pSapCtx->nDenyMac == MAX_MAC_ADDRESS_ACCEPTED) |
| 1069 | { |
| 1070 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1071 | "Black list is already maxed out. Cannot accept %02x:%02x:%02x:%02x:%02x:%02x", |
| 1072 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1073 | pPeerStaMac[4], pPeerStaMac[5]); |
| 1074 | return VOS_STATUS_E_FAILURE; |
| 1075 | } |
| 1076 | if (staInBlackList) |
| 1077 | { |
| 1078 | //Do nothing if already present in white list |
| 1079 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1080 | "MAC address already present in black list %02x:%02x:%02x:%02x:%02x:%02x", |
| 1081 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1082 | pPeerStaMac[4], pPeerStaMac[5]); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1083 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1084 | { |
| 1085 | if (staInWhiteList) |
| 1086 | { |
| 1087 | //remove it from white list before adding to the white list |
| 1088 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1089 | "Present in white list so first remove from it"); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1090 | sapRemoveMacFromACL(pSapCtx->acceptMacList, &pSapCtx->nAcceptMac, staWLIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1091 | } |
| 1092 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1093 | "... Now add to black list"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1094 | sapAddMacToACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, pPeerStaMac); |
| 1095 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"size of accept and deny lists %d %d", |
| 1096 | pSapCtx->nAcceptMac, pSapCtx->nDenyMac); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1097 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1098 | } |
| 1099 | else if (cmd == DELETE_STA_FROM_ACL) |
| 1100 | { |
| 1101 | if (staInBlackList) |
| 1102 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1103 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "Delete from black list"); |
| 1104 | sapRemoveMacFromACL(pSapCtx->denyMacList, &pSapCtx->nDenyMac, staBLIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1105 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"no accept and deny mac %d %d", |
| 1106 | pSapCtx->nAcceptMac, pSapCtx->nDenyMac); |
| 1107 | } |
| 1108 | else |
| 1109 | { |
| 1110 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN, |
| 1111 | "MAC address to be deleted is not present in the black list %02x:%02x:%02x:%02x:%02x:%02x", |
| 1112 | pPeerStaMac[0], pPeerStaMac[1], pPeerStaMac[2], pPeerStaMac[3], |
| 1113 | pPeerStaMac[4], pPeerStaMac[5]); |
| 1114 | return VOS_STATUS_E_FAILURE; |
| 1115 | } |
| 1116 | } |
| 1117 | else |
| 1118 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1119 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "Invalid cmd type passed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1120 | return VOS_STATUS_E_FAILURE; |
| 1121 | } |
| 1122 | break; |
| 1123 | |
| 1124 | default: |
| 1125 | { |
| 1126 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1127 | "Invalid list type passed %d",listType); |
| 1128 | return VOS_STATUS_E_FAILURE; |
| 1129 | } |
| 1130 | } |
| 1131 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,"After modification of ACL"); |
| 1132 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** WHITE LIST ***"); |
| 1133 | sapPrintACL(pSapCtx->acceptMacList, pSapCtx->nAcceptMac); |
| 1134 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,"*** BLACK LIST ***"); |
| 1135 | sapPrintACL(pSapCtx->denyMacList, pSapCtx->nDenyMac); |
| 1136 | return VOS_STATUS_SUCCESS; |
| 1137 | } |
| 1138 | |
| 1139 | /*========================================================================== |
| 1140 | FUNCTION WLANSAP_DisassocSta |
| 1141 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1142 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1143 | This api function provides for Ap App/HDD initiated disassociation of station |
| 1144 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1145 | DEPENDENCIES |
| 1146 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1147 | |
| 1148 | PARAMETERS |
| 1149 | |
| 1150 | IN |
| 1151 | pvosGCtx : Pointer to vos global context structure |
| 1152 | pPeerStaMac : Mac address of the station to disassociate |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1153 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1154 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1155 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1156 | |
| 1157 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1158 | |
| 1159 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1160 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1161 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1162 | WLANSAP_DisassocSta |
| 1163 | ( |
| 1164 | v_PVOID_t pvosGCtx, |
| 1165 | v_U8_t *pPeerStaMac |
| 1166 | ) |
| 1167 | { |
| 1168 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1169 | |
| 1170 | /*------------------------------------------------------------------------ |
| 1171 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1172 | Extract SAP control block |
| 1173 | ------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | if (NULL == pSapCtx) |
| 1175 | { |
| 1176 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1177 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1178 | return VOS_STATUS_E_FAULT; |
| 1179 | } |
| 1180 | |
| 1181 | sme_RoamDisconnectSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, |
| 1182 | pPeerStaMac); |
| 1183 | |
| 1184 | return VOS_STATUS_SUCCESS; |
| 1185 | } |
| 1186 | |
| 1187 | #ifdef WLAN_SOFTAP_FEATURE |
| 1188 | /*========================================================================== |
| 1189 | FUNCTION WLANSAP_DeauthSta |
| 1190 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1191 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1192 | This api function provides for Ap App/HDD initiated deauthentication of station |
| 1193 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1194 | DEPENDENCIES |
| 1195 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1196 | |
| 1197 | PARAMETERS |
| 1198 | |
| 1199 | IN |
| 1200 | pvosGCtx : Pointer to vos global context structure |
| 1201 | pPeerStaMac : Mac address of the station to deauthenticate |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1203 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1204 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1205 | |
| 1206 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1207 | |
| 1208 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1210 | VOS_STATUS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1211 | WLANSAP_DeauthSta |
| 1212 | ( |
| 1213 | v_PVOID_t pvosGCtx, |
| 1214 | v_U8_t *pPeerStaMac |
| 1215 | ) |
| 1216 | { |
| 1217 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1218 | |
| 1219 | /*------------------------------------------------------------------------ |
| 1220 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1221 | Extract SAP control block |
| 1222 | ------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1223 | if (NULL == pSapCtx) |
| 1224 | { |
| 1225 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1226 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1227 | return VOS_STATUS_E_FAULT; |
| 1228 | } |
| 1229 | |
| 1230 | sme_RoamDeauthSta(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, |
| 1231 | pPeerStaMac); |
| 1232 | |
| 1233 | return VOS_STATUS_SUCCESS; |
| 1234 | } |
| 1235 | /*========================================================================== |
| 1236 | FUNCTION WLANSAP_SetChannelRange |
| 1237 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1238 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1239 | This api function sets the range of channels for AP. |
| 1240 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1241 | DEPENDENCIES |
| 1242 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1243 | |
| 1244 | PARAMETERS |
| 1245 | |
| 1246 | IN |
| 1247 | startChannel : start channel |
| 1248 | endChannel : End channel |
| 1249 | operatingBand : Operating band (2.4GHz/5GHz) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1250 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1251 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1252 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1253 | |
| 1254 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1255 | |
| 1256 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1257 | ============================================================================*/ |
| 1258 | VOS_STATUS |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1259 | WLANSAP_SetChannelRange(tHalHandle hHal,v_U8_t startChannel, v_U8_t endChannel, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1260 | v_U8_t operatingBand) |
| 1261 | { |
| 1262 | |
| 1263 | v_U8_t validChannelFlag =0; |
| 1264 | v_U8_t loopStartCount =0; |
| 1265 | v_U8_t loopEndCount =0; |
| 1266 | v_U8_t bandStartChannel =0; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1267 | v_U8_t bandEndChannel =0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1268 | |
| 1269 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 1270 | "WLANSAP_SetChannelRange:startChannel %d,EndChannel %d,Operatingband:%d", |
| 1271 | startChannel,endChannel,operatingBand); |
| 1272 | |
| 1273 | /*------------------------------------------------------------------------ |
| 1274 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1275 | ------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1276 | if (( WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_APMIN > operatingBand)|| |
| 1277 | (WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_APMAX < operatingBand)) |
| 1278 | { |
| 1279 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1280 | "Invalid operatingBand on WLANSAP_SetChannelRange"); |
| 1281 | return VOS_STATUS_E_FAULT; |
| 1282 | } |
| 1283 | if (( WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_APMIN > startChannel)|| |
| 1284 | (WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_APMAX < startChannel)) |
| 1285 | { |
| 1286 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1287 | "Invalid startChannel value on WLANSAP_SetChannelRange"); |
| 1288 | return VOS_STATUS_E_FAULT; |
| 1289 | } |
| 1290 | if (( WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_APMIN > endChannel)|| |
| 1291 | (WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_APMAX < endChannel)) |
| 1292 | { |
| 1293 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1294 | "Invalid endChannel value on WLANSAP_SetChannelRange"); |
| 1295 | return VOS_STATUS_E_FAULT; |
| 1296 | } |
| 1297 | switch(operatingBand) |
| 1298 | { |
| 1299 | case RF_SUBBAND_2_4_GHZ: |
| 1300 | bandStartChannel = RF_CHAN_1; |
| 1301 | bandEndChannel = RF_CHAN_14; |
| 1302 | break; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1303 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1304 | case RF_SUBBAND_5_LOW_GHZ: |
| 1305 | bandStartChannel = RF_CHAN_36; |
| 1306 | bandEndChannel = RF_CHAN_64; |
| 1307 | break; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1309 | case RF_SUBBAND_5_MID_GHZ: |
| 1310 | bandStartChannel = RF_CHAN_100; |
| 1311 | bandEndChannel = RF_CHAN_140; |
| 1312 | break; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1313 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1314 | case RF_SUBBAND_5_HIGH_GHZ: |
| 1315 | bandStartChannel = RF_CHAN_149; |
| 1316 | bandEndChannel = RF_CHAN_165; |
| 1317 | break; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1319 | default: |
| 1320 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1321 | "Invalid operatingBand value on WLANSAP_SetChannelRange"); |
| 1322 | break; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1323 | } |
| 1324 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | /* Validating the start channel is in range or not*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1326 | for(loopStartCount = bandStartChannel ; loopStartCount <= bandEndChannel ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1327 | loopStartCount++) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1328 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1329 | if(rfChannels[loopStartCount].channelNum == startChannel ) |
| 1330 | { |
| 1331 | /* start channel is in the range */ |
| 1332 | break; |
| 1333 | } |
| 1334 | } |
| 1335 | /* Validating the End channel is in range or not*/ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1336 | for(loopEndCount = bandStartChannel ; loopEndCount <= bandEndChannel ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1337 | loopEndCount++) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1338 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1339 | if(rfChannels[loopEndCount].channelNum == endChannel ) |
| 1340 | { |
| 1341 | /* End channel is in the range */ |
| 1342 | break; |
| 1343 | } |
| 1344 | } |
| 1345 | if((loopStartCount > bandEndChannel)||(loopEndCount > bandEndChannel)) |
| 1346 | { |
| 1347 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1348 | "%s: Invalid startChannel-%d or EndChannel-%d for band -%d", |
| 1349 | __FUNCTION__,startChannel,endChannel,operatingBand); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1350 | /* Supplied channels are nt in the operating band so set the default |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1351 | channels for the given operating band */ |
| 1352 | startChannel = rfChannels[bandStartChannel].channelNum; |
| 1353 | endChannel = rfChannels[bandEndChannel].channelNum;; |
| 1354 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1355 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1356 | /*Search for the Active channels in the given range */ |
| 1357 | for( loopStartCount = bandStartChannel; loopStartCount <= bandEndChannel; loopStartCount++ ) |
| 1358 | { |
| 1359 | if((startChannel <= rfChannels[loopStartCount].channelNum)&& |
| 1360 | (endChannel >= rfChannels[loopStartCount].channelNum )) |
| 1361 | { |
| 1362 | if( regChannels[loopStartCount].enabled ) |
| 1363 | { |
| 1364 | validChannelFlag = 1; |
| 1365 | break; |
| 1366 | } |
| 1367 | } |
| 1368 | } |
| 1369 | if(0 == validChannelFlag) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1370 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1371 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1372 | "%s-No active channels present in the given range for the current region", |
| 1373 | __FUNCTION__); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1374 | /* There is no active channel in the supplied range.Updating the config |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1375 | with the default channels in the given band so that we can select the best channel in the sub-band*/ |
| 1376 | startChannel = rfChannels[bandStartChannel].channelNum; |
| 1377 | endChannel = rfChannels[bandEndChannel].channelNum;; |
| 1378 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1379 | |
| 1380 | if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1381 | operatingBand, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 1382 | { |
| 1383 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1384 | "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND to CCn"); |
| 1385 | return VOS_STATUS_E_FAULT; |
| 1386 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1387 | if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | startChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 1389 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1392 | "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM"); |
| 1393 | return VOS_STATUS_E_FAULT; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1394 | |
| 1395 | } |
| 1396 | if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1397 | endChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 1398 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1400 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1401 | "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM"); |
| 1402 | return VOS_STATUS_E_FAULT; |
| 1403 | } |
| 1404 | return VOS_STATUS_SUCCESS; |
| 1405 | } |
| 1406 | #endif |
| 1407 | |
| 1408 | /*========================================================================== |
| 1409 | FUNCTION WLANSAP_SetCounterMeasure |
| 1410 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1411 | DESCRIPTION |
| 1412 | This api function is used to disassociate all the stations and prevent |
| 1413 | association for any other station.Whenever Authenticator receives 2 mic failures |
| 1414 | within 60 seconds, Authenticator will enable counter measure at SAP Layer. |
| 1415 | Authenticator will start the 60 seconds timer. Core stack will not allow any |
| 1416 | STA to associate till HDD disables counter meassure. Core stack shall kick out all the |
| 1417 | STA which are currently associated and DIASSOC Event will be propogated to HDD for |
| 1418 | each STA to clean up the HDD STA table.Once the 60 seconds timer expires, Authenticator |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1419 | will disable the counter meassure at core stack. Now core stack can allow STAs to associate. |
| 1420 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1421 | DEPENDENCIES |
| 1422 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1423 | |
| 1424 | PARAMETERS |
| 1425 | |
| 1426 | IN |
| 1427 | pvosGCtx: Pointer to vos global context structure |
| 1428 | bEnable: If TRUE than all stations will be disassociated and no more will be allowed to associate. If FALSE than CORE |
| 1429 | will come out of this state. |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1430 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1431 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1432 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1433 | |
| 1434 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1435 | |
| 1436 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1437 | ============================================================================*/ |
| 1438 | VOS_STATUS |
| 1439 | WLANSAP_SetCounterMeasure |
| 1440 | ( |
| 1441 | v_PVOID_t pvosGCtx, |
| 1442 | v_BOOL_t bEnable |
| 1443 | ) |
| 1444 | { |
| 1445 | ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1446 | |
| 1447 | /*------------------------------------------------------------------------ |
| 1448 | Sanity check |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1449 | Extract SAP control block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1450 | ------------------------------------------------------------------------*/ |
| 1451 | if (NULL == pSapCtx) |
| 1452 | { |
| 1453 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1454 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1455 | return VOS_STATUS_E_FAULT; |
| 1456 | } |
| 1457 | |
| 1458 | sme_RoamTKIPCounterMeasures(VOS_GET_HAL_CB(pSapCtx->pvosGCtx), pSapCtx->sessionId, bEnable); |
| 1459 | |
| 1460 | return VOS_STATUS_SUCCESS; |
| 1461 | } |
| 1462 | |
| 1463 | /*========================================================================== |
| 1464 | |
| 1465 | FUNCTION WLANSAP_SetKeysSta |
| 1466 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1467 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1468 | This api function provides for Ap App/HDD to set key for a station. |
| 1469 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1470 | DEPENDENCIES |
| 1471 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1472 | |
| 1473 | PARAMETERS |
| 1474 | |
| 1475 | IN |
| 1476 | pvosGCtx: Pointer to vos global context structure |
| 1477 | pSetKeyInfo: tCsrRoamSetKey structure for the station |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1479 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1480 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1481 | |
| 1482 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1483 | |
| 1484 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1485 | ============================================================================*/ |
| 1486 | VOS_STATUS |
| 1487 | WLANSAP_SetKeySta |
| 1488 | ( |
| 1489 | v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo |
| 1490 | ) |
| 1491 | { |
| 1492 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 1493 | ptSapContext pSapCtx = NULL; |
| 1494 | v_PVOID_t hHal = NULL; |
| 1495 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 1496 | v_U32_t roamId=0xFF; |
| 1497 | |
| 1498 | if (VOS_STA_SAP_MODE == vos_get_conparam ( )) |
| 1499 | { |
| 1500 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1501 | if (NULL == pSapCtx) |
| 1502 | { |
| 1503 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1504 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1505 | return VOS_STATUS_E_FAULT; |
| 1506 | } |
| 1507 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1508 | if (NULL == hHal) |
| 1509 | { |
| 1510 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1511 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1512 | return VOS_STATUS_E_FAULT; |
| 1513 | } |
| 1514 | halStatus = sme_RoamSetKey(hHal, pSapCtx->sessionId, pSetKeyInfo, &roamId); |
| 1515 | |
| 1516 | if (halStatus == eHAL_STATUS_SUCCESS) |
| 1517 | { |
| 1518 | vosStatus = VOS_STATUS_SUCCESS; |
| 1519 | } else |
| 1520 | { |
| 1521 | vosStatus = VOS_STATUS_E_FAULT; |
| 1522 | } |
| 1523 | } |
| 1524 | else |
| 1525 | vosStatus = VOS_STATUS_E_FAULT; |
| 1526 | |
| 1527 | return vosStatus; |
| 1528 | } |
| 1529 | |
| 1530 | /*========================================================================== |
| 1531 | FUNCTION WLANSAP_DelKeySta |
| 1532 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1533 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1534 | This api function provides for Ap App/HDD to delete key for a station. |
| 1535 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1536 | DEPENDENCIES |
| 1537 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1538 | |
| 1539 | PARAMETERS |
| 1540 | |
| 1541 | IN |
| 1542 | pvosGCtx: Pointer to vos global context structure |
| 1543 | pSetKeyInfo: tCsrRoamRemoveKey structure for the station |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1546 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1547 | |
| 1548 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1549 | |
| 1550 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1551 | ============================================================================*/ |
| 1552 | VOS_STATUS |
| 1553 | WLANSAP_DelKeySta |
| 1554 | ( |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1555 | v_PVOID_t pvosGCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1556 | tCsrRoamRemoveKey *pRemoveKeyInfo |
| 1557 | ) |
| 1558 | { |
| 1559 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 1560 | ptSapContext pSapCtx = NULL; |
| 1561 | v_PVOID_t hHal = NULL; |
| 1562 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 1563 | v_U32_t roamId=0xFF; |
| 1564 | tCsrRoamRemoveKey RemoveKeyInfo; |
| 1565 | |
| 1566 | if (VOS_STA_SAP_MODE == vos_get_conparam ( )) |
| 1567 | { |
| 1568 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1569 | if (NULL == pSapCtx) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1570 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1572 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1573 | return VOS_STATUS_E_FAULT; |
| 1574 | } |
| 1575 | |
| 1576 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1577 | if (NULL == hHal) |
| 1578 | { |
| 1579 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1580 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1581 | return VOS_STATUS_E_FAULT; |
| 1582 | } |
| 1583 | |
| 1584 | vos_mem_zero(&RemoveKeyInfo, sizeof(RemoveKeyInfo)); |
| 1585 | RemoveKeyInfo.encType = pRemoveKeyInfo->encType; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1586 | vos_mem_copy(RemoveKeyInfo.peerMac, pRemoveKeyInfo->peerMac, WNI_CFG_BSSID_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1587 | RemoveKeyInfo.keyId = pRemoveKeyInfo->keyId; |
| 1588 | |
| 1589 | halStatus = sme_RoamRemoveKey(hHal, pSapCtx->sessionId, &RemoveKeyInfo, &roamId); |
| 1590 | |
| 1591 | if (HAL_STATUS_SUCCESS(halStatus)) |
| 1592 | { |
| 1593 | vosStatus = VOS_STATUS_SUCCESS; |
| 1594 | } |
| 1595 | else |
| 1596 | { |
| 1597 | vosStatus = VOS_STATUS_E_FAULT; |
| 1598 | } |
| 1599 | } |
| 1600 | else |
| 1601 | vosStatus = VOS_STATUS_E_FAULT; |
| 1602 | |
| 1603 | return vosStatus; |
| 1604 | } |
| 1605 | |
| 1606 | VOS_STATUS |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1607 | WLANSap_getstationIE_information(v_PVOID_t pvosGCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1608 | v_U32_t *pLen, |
| 1609 | v_U8_t *pBuf) |
| 1610 | { |
| 1611 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 1612 | ptSapContext pSapCtx = NULL; |
| 1613 | v_U32_t len = 0; |
| 1614 | |
| 1615 | if (VOS_STA_SAP_MODE == vos_get_conparam ( )){ |
| 1616 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1617 | if (NULL == pSapCtx) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1618 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1619 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1620 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1621 | return VOS_STATUS_E_FAULT; |
| 1622 | } |
| 1623 | if (pLen) |
| 1624 | { |
| 1625 | len = *pLen; |
| 1626 | *pLen = pSapCtx->nStaWPARSnReqIeLength; |
| 1627 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 1628 | "%s: WPAIE len : %x", __FUNCTION__, *pLen); |
| 1629 | if(pBuf) |
| 1630 | { |
| 1631 | if(len >= pSapCtx->nStaWPARSnReqIeLength) |
| 1632 | { |
| 1633 | vos_mem_copy( pBuf, pSapCtx->pStaWpaRsnReqIE, pSapCtx->nStaWPARSnReqIeLength); |
| 1634 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 1635 | "%s: WPAIE: %02x:%02x:%02x:%02x:%02x:%02x", |
| 1636 | __FUNCTION__, |
| 1637 | pBuf[0], pBuf[1], pBuf[2], |
| 1638 | pBuf[3], pBuf[4], pBuf[5]); |
| 1639 | vosStatus = VOS_STATUS_SUCCESS; |
| 1640 | } |
| 1641 | } |
| 1642 | } |
| 1643 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1644 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1645 | if( VOS_STATUS_E_FAILURE == vosStatus) |
| 1646 | { |
| 1647 | VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1648 | "%s: Error unable to populate the RSNWPAIE", |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1649 | __FUNCTION__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | } |
| 1651 | |
| 1652 | return vosStatus; |
| 1653 | |
| 1654 | } |
| 1655 | |
| 1656 | /*========================================================================== |
| 1657 | FUNCTION WLANSAP_Set_WpsIe |
| 1658 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1659 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1660 | This api function provides for Ap App/HDD to set WPS IE. |
| 1661 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1662 | DEPENDENCIES |
| 1663 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1664 | |
| 1665 | PARAMETERS |
| 1666 | |
| 1667 | IN |
| 1668 | pvosGCtx: Pointer to vos global context structure |
| 1669 | pWPSIE: tSap_WPSIE structure that include WPS IEs |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1671 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1672 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1673 | |
| 1674 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1675 | |
| 1676 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1677 | ============================================================================*/ |
| 1678 | VOS_STATUS |
| 1679 | WLANSAP_Set_WpsIe |
| 1680 | ( |
| 1681 | v_PVOID_t pvosGCtx, tSap_WPSIE *pSap_WPSIe |
| 1682 | ) |
| 1683 | { |
| 1684 | ptSapContext pSapCtx = NULL; |
| 1685 | v_PVOID_t hHal = NULL; |
| 1686 | |
| 1687 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1688 | "%s, %d", __FUNCTION__, __LINE__); |
| 1689 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1690 | if(VOS_STA_SAP_MODE == vos_get_conparam ( )) { |
| 1691 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1692 | if ( NULL == pSapCtx ) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1693 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1694 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1695 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1696 | return VOS_STATUS_E_FAULT; |
| 1697 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1698 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1699 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1700 | if ( NULL == hHal ){ |
| 1701 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1702 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1703 | return VOS_STATUS_E_FAULT; |
| 1704 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1705 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1706 | if ( sap_AcquireGlobalLock( pSapCtx ) == VOS_STATUS_SUCCESS ) |
| 1707 | { |
| 1708 | if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_BEACON_IE) |
| 1709 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1710 | vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSBeaconIE, &pSap_WPSIe->sapwpsie.sapWPSBeaconIE, sizeof(tSap_WPSBeaconIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1712 | else if (pSap_WPSIe->sapWPSIECode == eSAP_WPS_PROBE_RSP_IE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | { |
| 1714 | vos_mem_copy(&pSapCtx->APWPSIEs.SirWPSProbeRspIE, &pSap_WPSIe->sapwpsie.sapWPSProbeRspIE, sizeof(tSap_WPSProbeRspIE)); |
| 1715 | } |
| 1716 | else |
| 1717 | { |
| 1718 | sap_ReleaseGlobalLock( pSapCtx ); |
| 1719 | return VOS_STATUS_E_FAULT; |
| 1720 | } |
| 1721 | sap_ReleaseGlobalLock( pSapCtx ); |
| 1722 | return VOS_STATUS_SUCCESS; |
| 1723 | } |
| 1724 | else |
| 1725 | return VOS_STATUS_E_FAULT; |
| 1726 | } |
| 1727 | else |
| 1728 | return VOS_STATUS_E_FAULT; |
| 1729 | } |
| 1730 | |
| 1731 | /*========================================================================== |
| 1732 | FUNCTION WLANSAP_Update_WpsIe |
| 1733 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1734 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1735 | This api function provides for Ap App/HDD to update WPS IEs. |
| 1736 | |
| 1737 | DEPENDENCIES |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1738 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1739 | |
| 1740 | PARAMETERS |
| 1741 | |
| 1742 | IN |
| 1743 | pvosGCtx: Pointer to vos global context structure |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1744 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1745 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1746 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1747 | |
| 1748 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1749 | |
| 1750 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1751 | ============================================================================*/ |
| 1752 | VOS_STATUS |
| 1753 | WLANSAP_Update_WpsIe |
| 1754 | ( |
| 1755 | v_PVOID_t pvosGCtx |
| 1756 | ) |
| 1757 | { |
| 1758 | VOS_STATUS vosStatus = VOS_STATUS_E_FAULT; |
| 1759 | ptSapContext pSapCtx = NULL; |
| 1760 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 1761 | v_PVOID_t hHal = NULL; |
| 1762 | |
| 1763 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1764 | "%s, %d", __FUNCTION__, __LINE__); |
| 1765 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1766 | if(VOS_STA_SAP_MODE == vos_get_conparam ( )){ |
| 1767 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1768 | if ( NULL == pSapCtx ) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1769 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1770 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1771 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1772 | return VOS_STATUS_E_FAULT; |
| 1773 | } |
| 1774 | |
| 1775 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1776 | if ( NULL == hHal ){ |
| 1777 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1778 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1779 | return VOS_STATUS_E_FAULT; |
| 1780 | } |
| 1781 | |
| 1782 | halStatus = sme_RoamUpdateAPWPSIE( hHal, pSapCtx->sessionId, &pSapCtx->APWPSIEs); |
| 1783 | |
| 1784 | if(halStatus == eHAL_STATUS_SUCCESS) { |
| 1785 | vosStatus = VOS_STATUS_SUCCESS; |
| 1786 | } else |
| 1787 | { |
| 1788 | vosStatus = VOS_STATUS_E_FAULT; |
| 1789 | } |
| 1790 | |
| 1791 | } |
| 1792 | |
| 1793 | return vosStatus; |
| 1794 | } |
| 1795 | |
| 1796 | /*========================================================================== |
| 1797 | FUNCTION WLANSAP_Get_WPS_State |
| 1798 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1799 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1800 | This api function provides for Ap App/HDD to check if WPS session in process. |
| 1801 | |
| 1802 | DEPENDENCIES |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1803 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1804 | |
| 1805 | PARAMETERS |
| 1806 | |
| 1807 | IN |
| 1808 | pvosGCtx: Pointer to vos global context structure |
| 1809 | |
| 1810 | OUT |
| 1811 | pbWPSState: Pointer to variable to indicate if it is in WPS Registration state |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1812 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1813 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1814 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | |
| 1816 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1817 | |
| 1818 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1819 | ============================================================================*/ |
| 1820 | VOS_STATUS |
| 1821 | WLANSAP_Get_WPS_State |
| 1822 | ( |
| 1823 | v_PVOID_t pvosGCtx, v_BOOL_t *bWPSState |
| 1824 | ) |
| 1825 | { |
| 1826 | ptSapContext pSapCtx = NULL; |
| 1827 | v_PVOID_t hHal = NULL; |
| 1828 | |
| 1829 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1830 | "%s, %d", __FUNCTION__, __LINE__); |
| 1831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1832 | if(VOS_STA_SAP_MODE == vos_get_conparam ( )){ |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1833 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1834 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1835 | if ( NULL == pSapCtx ) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1836 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1837 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1838 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1839 | return VOS_STATUS_E_FAULT; |
| 1840 | } |
| 1841 | |
| 1842 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1843 | if ( NULL == hHal ){ |
| 1844 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1845 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1846 | return VOS_STATUS_E_FAULT; |
| 1847 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1848 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1849 | if ( sap_AcquireGlobalLock(pSapCtx ) == VOS_STATUS_SUCCESS ) |
| 1850 | { |
| 1851 | if(pSapCtx->APWPSIEs.SirWPSProbeRspIE.FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT) |
| 1852 | *bWPSState = eANI_BOOLEAN_TRUE; |
| 1853 | else |
| 1854 | *bWPSState = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1856 | sap_ReleaseGlobalLock( pSapCtx ); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1857 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | return VOS_STATUS_SUCCESS; |
| 1859 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1860 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1861 | return VOS_STATUS_E_FAULT; |
| 1862 | } |
| 1863 | else |
| 1864 | return VOS_STATUS_E_FAULT; |
| 1865 | |
| 1866 | } |
| 1867 | |
| 1868 | VOS_STATUS |
| 1869 | sap_AcquireGlobalLock |
| 1870 | ( |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1871 | ptSapContext pSapCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1872 | ) |
| 1873 | { |
| 1874 | VOS_STATUS vosStatus = VOS_STATUS_E_FAULT; |
| 1875 | |
| 1876 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &pSapCtx->SapGlobalLock) ) ) |
| 1877 | { |
| 1878 | vosStatus = VOS_STATUS_SUCCESS; |
| 1879 | } |
| 1880 | |
| 1881 | return (vosStatus); |
| 1882 | } |
| 1883 | |
| 1884 | VOS_STATUS |
| 1885 | sap_ReleaseGlobalLock |
| 1886 | ( |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1887 | ptSapContext pSapCtx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1888 | ) |
| 1889 | { |
| 1890 | VOS_STATUS vosStatus = VOS_STATUS_E_FAULT; |
| 1891 | |
| 1892 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &pSapCtx->SapGlobalLock) ) ) |
| 1893 | { |
| 1894 | vosStatus = VOS_STATUS_SUCCESS; |
| 1895 | } |
| 1896 | |
| 1897 | return (vosStatus); |
| 1898 | } |
| 1899 | |
| 1900 | /*========================================================================== |
| 1901 | FUNCTION WLANSAP_Set_WPARSNIes |
| 1902 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1903 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1904 | This api function provides for Ap App/HDD to set AP WPA and RSN IE in its beacon and probe response. |
| 1905 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1906 | DEPENDENCIES |
| 1907 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1908 | |
| 1909 | PARAMETERS |
| 1910 | |
| 1911 | IN |
| 1912 | pvosGCtx: Pointer to vos global context structure |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1913 | pWPARSNIEs: buffer to the WPA/RSN IEs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | WPARSNIEsLen: length of WPA/RSN IEs |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1915 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1916 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1917 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1918 | |
| 1919 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1920 | |
| 1921 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1922 | ============================================================================*/ |
| 1923 | VOS_STATUS WLANSAP_Set_WPARSNIes(v_PVOID_t pvosGCtx, v_U8_t *pWPARSNIEs, v_U32_t WPARSNIEsLen) |
| 1924 | { |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1925 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1926 | ptSapContext pSapCtx = NULL; |
| 1927 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 1928 | v_PVOID_t hHal = NULL; |
| 1929 | |
| 1930 | if(VOS_STA_SAP_MODE == vos_get_conparam ( )){ |
| 1931 | pSapCtx = VOS_GET_SAP_CB(pvosGCtx); |
| 1932 | if ( NULL == pSapCtx ) |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1933 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1934 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1935 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 1936 | return VOS_STATUS_E_FAULT; |
| 1937 | } |
| 1938 | |
| 1939 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 1940 | if ( NULL == hHal ){ |
| 1941 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 1942 | "%s: Invalid HAL pointer from pvosGCtx", __FUNCTION__); |
| 1943 | return VOS_STATUS_E_FAULT; |
| 1944 | } |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1945 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1946 | pSapCtx->APWPARSNIEs.length = (tANI_U16)WPARSNIEsLen; |
| 1947 | vos_mem_copy(pSapCtx->APWPARSNIEs.rsnIEdata, pWPARSNIEs, WPARSNIEsLen); |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1948 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1949 | halStatus = sme_RoamUpdateAPWPARSNIEs( hHal, pSapCtx->sessionId, &pSapCtx->APWPARSNIEs); |
| 1950 | |
| 1951 | if(halStatus == eHAL_STATUS_SUCCESS) { |
| 1952 | return VOS_STATUS_SUCCESS; |
| 1953 | } else |
| 1954 | { |
| 1955 | return VOS_STATUS_E_FAULT; |
| 1956 | } |
| 1957 | } |
| 1958 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1959 | return VOS_STATUS_E_FAULT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | } |
| 1961 | |
| 1962 | VOS_STATUS WLANSAP_GetStatistics(v_PVOID_t pvosGCtx, tSap_SoftapStats *statBuf, v_BOOL_t bReset) |
| 1963 | { |
| 1964 | if (NULL == pvosGCtx) |
| 1965 | { |
| 1966 | return VOS_STATUS_E_FAULT; |
| 1967 | } |
| 1968 | |
| 1969 | return (WLANTL_GetSoftAPStatistics(pvosGCtx, statBuf, bReset)); |
| 1970 | } |
| 1971 | |
| 1972 | #ifdef WLAN_FEATURE_P2P |
| 1973 | /*========================================================================== |
| 1974 | |
| 1975 | FUNCTION WLANSAP_SendAction |
| 1976 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1977 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | This api function provides to send action frame sent by upper layer. |
| 1979 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1980 | DEPENDENCIES |
| 1981 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1982 | |
| 1983 | PARAMETERS |
| 1984 | |
| 1985 | IN |
| 1986 | pvosGCtx: Pointer to vos global context structure |
| 1987 | pBuf: Pointer of the action frame to be transmitted |
| 1988 | len: Length of the action frame |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1989 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1990 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1991 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1992 | |
| 1993 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 1994 | |
| 1995 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1996 | ============================================================================*/ |
| 1997 | VOS_STATUS WLANSAP_SendAction( v_PVOID_t pvosGCtx, const tANI_U8 *pBuf, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1998 | tANI_U32 len, tANI_U16 wait ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1999 | { |
| 2000 | ptSapContext pSapCtx = NULL; |
| 2001 | v_PVOID_t hHal = NULL; |
| 2002 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 2003 | |
| 2004 | if( VOS_STA_SAP_MODE == vos_get_conparam ( ) ) |
| 2005 | { |
| 2006 | pSapCtx = VOS_GET_SAP_CB( pvosGCtx ); |
| 2007 | if (NULL == pSapCtx) |
| 2008 | { |
| 2009 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2010 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 2011 | return VOS_STATUS_E_FAULT; |
| 2012 | } |
| 2013 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 2014 | if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) |
| 2015 | { |
| 2016 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2017 | "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", |
| 2018 | __FUNCTION__, hHal, pSapCtx->isSapSessionOpen ); |
| 2019 | return VOS_STATUS_E_FAULT; |
| 2020 | } |
| 2021 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2022 | halStatus = sme_sendAction( hHal, pSapCtx->sessionId, pBuf, len, 0 , 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2023 | |
| 2024 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 2025 | { |
| 2026 | return VOS_STATUS_SUCCESS; |
| 2027 | } |
| 2028 | } |
| 2029 | |
| 2030 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2031 | "Failed to Send Action Frame"); |
| 2032 | |
| 2033 | return VOS_STATUS_E_FAULT; |
| 2034 | } |
| 2035 | |
| 2036 | /*========================================================================== |
| 2037 | |
| 2038 | FUNCTION WLANSAP_RemainOnChannel |
| 2039 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2040 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2041 | This api function provides to set Remain On channel on specified channel |
| 2042 | for specified duration. |
| 2043 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2044 | DEPENDENCIES |
| 2045 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2046 | |
| 2047 | PARAMETERS |
| 2048 | |
| 2049 | IN |
| 2050 | pvosGCtx: Pointer to vos global context structure |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2051 | channel: Channel on which driver has to listen |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2052 | duration: Duration for which driver has to listen on specified channel |
| 2053 | callback: Callback function to be called once Listen is done. |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2054 | pContext: Context needs to be called in callback function. |
| 2055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2056 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2057 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2058 | |
| 2059 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2060 | |
| 2061 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2062 | ============================================================================*/ |
| 2063 | VOS_STATUS WLANSAP_RemainOnChannel( v_PVOID_t pvosGCtx, |
| 2064 | tANI_U8 channel, tANI_U32 duration, |
| 2065 | remainOnChanCallback callback, |
| 2066 | void *pContext ) |
| 2067 | { |
| 2068 | ptSapContext pSapCtx = NULL; |
| 2069 | v_PVOID_t hHal = NULL; |
| 2070 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 2071 | |
| 2072 | if( VOS_STA_SAP_MODE == vos_get_conparam ( ) ) |
| 2073 | { |
| 2074 | pSapCtx = VOS_GET_SAP_CB( pvosGCtx ); |
| 2075 | if (NULL == pSapCtx) |
| 2076 | { |
| 2077 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2078 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 2079 | return VOS_STATUS_E_FAULT; |
| 2080 | } |
| 2081 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 2082 | if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) |
| 2083 | { |
| 2084 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2085 | "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", |
| 2086 | __FUNCTION__, hHal, pSapCtx->isSapSessionOpen ); |
| 2087 | return VOS_STATUS_E_FAULT; |
| 2088 | } |
| 2089 | |
| 2090 | halStatus = sme_RemainOnChannel( hHal, pSapCtx->sessionId, |
| 2091 | channel, duration, callback, pContext ); |
| 2092 | |
| 2093 | if( eHAL_STATUS_SUCCESS == halStatus ) |
| 2094 | { |
| 2095 | return VOS_STATUS_SUCCESS; |
| 2096 | } |
| 2097 | } |
| 2098 | |
| 2099 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2100 | "Failed to Set Remain on Channel"); |
| 2101 | |
| 2102 | return VOS_STATUS_E_FAULT; |
| 2103 | } |
| 2104 | |
| 2105 | /*========================================================================== |
| 2106 | |
| 2107 | FUNCTION WLANSAP_CancelRemainOnChannel |
| 2108 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2109 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2110 | This api cancel previous remain on channel request. |
| 2111 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2112 | DEPENDENCIES |
| 2113 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2114 | |
| 2115 | PARAMETERS |
| 2116 | |
| 2117 | IN |
| 2118 | pvosGCtx: Pointer to vos global context structure |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2120 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2121 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2122 | |
| 2123 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2124 | |
| 2125 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2126 | ============================================================================*/ |
| 2127 | VOS_STATUS WLANSAP_CancelRemainOnChannel( v_PVOID_t pvosGCtx ) |
| 2128 | { |
| 2129 | ptSapContext pSapCtx = NULL; |
| 2130 | v_PVOID_t hHal = NULL; |
| 2131 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 2132 | |
| 2133 | if( VOS_STA_SAP_MODE == vos_get_conparam ( ) ) |
| 2134 | { |
| 2135 | pSapCtx = VOS_GET_SAP_CB( pvosGCtx ); |
| 2136 | if (NULL == pSapCtx) |
| 2137 | { |
| 2138 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2139 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 2140 | return VOS_STATUS_E_FAULT; |
| 2141 | } |
| 2142 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 2143 | if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) |
| 2144 | { |
| 2145 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2146 | "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", |
| 2147 | __FUNCTION__, hHal, pSapCtx->isSapSessionOpen ); |
| 2148 | return VOS_STATUS_E_FAULT; |
| 2149 | } |
| 2150 | |
| 2151 | halStatus = sme_CancelRemainOnChannel( hHal, pSapCtx->sessionId ); |
| 2152 | |
| 2153 | if( eHAL_STATUS_SUCCESS == halStatus ) |
| 2154 | { |
| 2155 | return VOS_STATUS_SUCCESS; |
| 2156 | } |
| 2157 | } |
| 2158 | |
| 2159 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2160 | "Failed to Cancel Remain on Channel"); |
| 2161 | |
| 2162 | return VOS_STATUS_E_FAULT; |
| 2163 | } |
| 2164 | |
| 2165 | /*========================================================================== |
| 2166 | |
| 2167 | FUNCTION WLANSAP_RegisterMgmtFrame |
| 2168 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2169 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2170 | HDD use this API to register specified type of frame with CORE stack. |
| 2171 | On receiving such kind of frame CORE stack should pass this frame to HDD |
| 2172 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2173 | DEPENDENCIES |
| 2174 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | |
| 2176 | PARAMETERS |
| 2177 | |
| 2178 | IN |
| 2179 | pvosGCtx: Pointer to vos global context structure |
| 2180 | frameType: frameType that needs to be registered with PE. |
| 2181 | matchData: Data pointer which should be matched after frame type is matched. |
| 2182 | matchLen: Length of the matchData |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2183 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2184 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2185 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2186 | |
| 2187 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2188 | |
| 2189 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2190 | ============================================================================*/ |
| 2191 | VOS_STATUS WLANSAP_RegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType, |
| 2192 | tANI_U8* matchData, tANI_U16 matchLen ) |
| 2193 | { |
| 2194 | ptSapContext pSapCtx = NULL; |
| 2195 | v_PVOID_t hHal = NULL; |
| 2196 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 2197 | |
| 2198 | if( VOS_STA_SAP_MODE == vos_get_conparam ( ) ) |
| 2199 | { |
| 2200 | pSapCtx = VOS_GET_SAP_CB( pvosGCtx ); |
| 2201 | if (NULL == pSapCtx) |
| 2202 | { |
| 2203 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2204 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 2205 | return VOS_STATUS_E_FAULT; |
| 2206 | } |
| 2207 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 2208 | if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) |
| 2209 | { |
| 2210 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2211 | "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", |
| 2212 | __FUNCTION__, hHal, pSapCtx->isSapSessionOpen ); |
| 2213 | return VOS_STATUS_E_FAULT; |
| 2214 | } |
| 2215 | |
| 2216 | halStatus = sme_RegisterMgmtFrame(hHal, pSapCtx->sessionId, |
| 2217 | frameType, matchData, matchLen); |
| 2218 | |
| 2219 | if( eHAL_STATUS_SUCCESS == halStatus ) |
| 2220 | { |
| 2221 | return VOS_STATUS_SUCCESS; |
| 2222 | } |
| 2223 | } |
| 2224 | |
| 2225 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2226 | "Failed to Register MGMT frame"); |
| 2227 | |
| 2228 | return VOS_STATUS_E_FAULT; |
| 2229 | } |
| 2230 | |
| 2231 | /*========================================================================== |
| 2232 | |
| 2233 | FUNCTION WLANSAP_DeRegisterMgmtFrame |
| 2234 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2235 | DESCRIPTION |
| 2236 | This API is used to deregister previously registered frame. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2237 | |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2238 | DEPENDENCIES |
| 2239 | NA. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2240 | |
| 2241 | PARAMETERS |
| 2242 | |
| 2243 | IN |
| 2244 | pvosGCtx: Pointer to vos global context structure |
| 2245 | frameType: frameType that needs to be De-registered with PE. |
| 2246 | matchData: Data pointer which should be matched after frame type is matched. |
| 2247 | matchLen: Length of the matchData |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2248 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2249 | RETURN VALUE |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2250 | The VOS_STATUS code associated with performing the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2251 | |
| 2252 | VOS_STATUS_SUCCESS: Success |
Madan Mohan Koyyalamudi | 33a178c | 2012-09-18 18:17:13 -0700 | [diff] [blame] | 2253 | |
| 2254 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | ============================================================================*/ |
| 2256 | VOS_STATUS WLANSAP_DeRegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType, |
| 2257 | tANI_U8* matchData, tANI_U16 matchLen ) |
| 2258 | { |
| 2259 | ptSapContext pSapCtx = NULL; |
| 2260 | v_PVOID_t hHal = NULL; |
| 2261 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 2262 | |
| 2263 | if( VOS_STA_SAP_MODE == vos_get_conparam ( ) ) |
| 2264 | { |
| 2265 | pSapCtx = VOS_GET_SAP_CB( pvosGCtx ); |
| 2266 | if (NULL == pSapCtx) |
| 2267 | { |
| 2268 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2269 | "%s: Invalid SAP pointer from pvosGCtx", __FUNCTION__); |
| 2270 | return VOS_STATUS_E_FAULT; |
| 2271 | } |
| 2272 | hHal = VOS_GET_HAL_CB(pSapCtx->pvosGCtx); |
| 2273 | if( ( NULL == hHal ) || ( eSAP_TRUE != pSapCtx->isSapSessionOpen ) ) |
| 2274 | { |
| 2275 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2276 | "%s: HAL pointer (%p) NULL OR SME session is not open (%d)", |
| 2277 | __FUNCTION__, hHal, pSapCtx->isSapSessionOpen ); |
| 2278 | return VOS_STATUS_E_FAULT; |
| 2279 | } |
| 2280 | |
| 2281 | halStatus = sme_DeregisterMgmtFrame( hHal, pSapCtx->sessionId, |
| 2282 | frameType, matchData, matchLen ); |
| 2283 | |
| 2284 | if( eHAL_STATUS_SUCCESS == halStatus ) |
| 2285 | { |
| 2286 | return VOS_STATUS_SUCCESS; |
| 2287 | } |
| 2288 | } |
| 2289 | |
| 2290 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, |
| 2291 | "Failed to Deregister MGMT frame"); |
| 2292 | |
| 2293 | return VOS_STATUS_E_FAULT; |
| 2294 | } |
| 2295 | #endif // WLAN_FEATURE_P2P |