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