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