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