Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #ifndef WLAN_QCT_WLANSAP_INTERNAL_H |
| 29 | #define WLAN_QCT_WLANSAP_INTERNAL_H |
| 30 | |
| 31 | /*=========================================================================== |
| 32 | |
| 33 | W L A N S A P P A L L A Y E R |
| 34 | I N T E R N A L A P I |
| 35 | |
| 36 | |
| 37 | DESCRIPTION |
| 38 | This file contains the internal API exposed by the wlan SAP PAL layer |
| 39 | module. |
| 40 | |
| 41 | |
| 42 | Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. |
| 43 | Qualcomm Confidential and Proprietary |
| 44 | ===========================================================================*/ |
| 45 | |
| 46 | |
| 47 | /*=========================================================================== |
| 48 | |
| 49 | EDIT HISTORY FOR FILE |
| 50 | |
| 51 | |
| 52 | This section contains comments describing changes made to the module. |
| 53 | Notice that changes are listed in reverse chronological order. |
| 54 | |
| 55 | |
| 56 | $Header: /cygdrive/d/Builds/M7201JSDCAAPAD52240B/WM/platform/msm7200/Src/Drivers/SD/ClientDrivers/WLAN/QCT_BTAMP_RSN/CORE/BAP/src/bapInternal.h,v 1.7 2009/03/09 08:50:43 rgidvani Exp rgidvani $ $DateTime: $ $Author: jzmuda $ |
| 57 | |
| 58 | |
| 59 | when who what, where, why |
| 60 | -------- --- ---------------------------------------------------------- |
| 61 | 09/15/08 SOFTAP Created module. |
| 62 | |
| 63 | ===========================================================================*/ |
| 64 | |
| 65 | |
| 66 | |
| 67 | /*=========================================================================== |
| 68 | |
| 69 | INCLUDE FILES FOR MODULE |
| 70 | |
| 71 | ===========================================================================*/ |
| 72 | |
| 73 | /*---------------------------------------------------------------------------- |
| 74 | * Include Files |
| 75 | * -------------------------------------------------------------------------*/ |
| 76 | #include "vos_api.h" |
| 77 | #include "vos_packet.h" |
| 78 | |
| 79 | // Pick up the CSR API definitions |
| 80 | #include "csrApi.h" |
| 81 | #include "sapApi.h" |
| 82 | #include "sapFsm_ext.h" |
| 83 | #include "sapChSelect.h" |
Sachin Ahuja | bcb0b7e | 2014-11-07 13:01:24 +0530 | [diff] [blame] | 84 | #include "wlan_hdd_dp_utils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 85 | /*---------------------------------------------------------------------------- |
| 86 | * Preprocessor Definitions and Constants |
| 87 | * -------------------------------------------------------------------------*/ |
| 88 | #ifdef __cplusplus |
| 89 | extern "C" { |
| 90 | #endif |
| 91 | |
| 92 | |
| 93 | /*---------------------------------------------------------------------------- |
| 94 | * Defines |
| 95 | * -------------------------------------------------------------------------*/ |
| 96 | #define SAP_DEBUG |
| 97 | // Used to enable or disable security on the BT-AMP link |
| 98 | #define WLANSAP_SECURITY_ENABLED_STATE VOS_TRUE |
| 99 | // How do I get SAP context from voss context? |
| 100 | #define VOS_GET_SAP_CB(ctx) vos_get_context( VOS_MODULE_ID_SAP, ctx) |
| 101 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | #define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_PE, ctx) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 103 | //MAC Address length |
| 104 | #define ANI_EAPOL_KEY_RSN_NONCE_SIZE 32 |
| 105 | |
| 106 | extern sRegulatoryChannel *regChannels; |
| 107 | extern const tRfChannelProps rfChannels[NUM_RF_CHANNELS]; |
| 108 | |
| 109 | /*---------------------------------------------------------------------------- |
| 110 | * Typedefs |
| 111 | * -------------------------------------------------------------------------*/ |
| 112 | typedef struct sSapContext tSapContext; |
| 113 | // tSapContext, *ptSapContext; |
| 114 | /*---------------------------------------------------------------------------- |
| 115 | * Type Declarations - For internal SAP context information |
| 116 | * -------------------------------------------------------------------------*/ |
| 117 | /*---------------------------------------------------------------------------- |
| 118 | * Opaque SAP context Type Declaration |
| 119 | * -------------------------------------------------------------------------*/ |
| 120 | // We were only using this syntax, when this was truly opaque. |
| 121 | // (I.E., it was defined in a different file.) |
| 122 | |
| 123 | |
| 124 | /* SAP FSM states for Access Point role */ |
| 125 | typedef enum { |
| 126 | eSAP_DISCONNECTED, |
| 127 | eSAP_CH_SELECT, |
| 128 | eSAP_STARTING, |
| 129 | eSAP_STARTED, |
| 130 | eSAP_DISCONNECTING |
| 131 | } eSapFsmStates_t; |
| 132 | |
| 133 | /*---------------------------------------------------------------------------- |
| 134 | * SAP context Data Type Declaration |
| 135 | * -------------------------------------------------------------------------*/ |
| 136 | /*---------------------------------------------------------------------------- |
| 137 | * Type Declarations - QOS related |
| 138 | * -------------------------------------------------------------------------*/ |
| 139 | /* SAP QOS config */ |
| 140 | typedef struct sSapQosCfg { |
| 141 | v_U8_t WmmIsEnabled; |
| 142 | } tSapQosCfg; |
| 143 | |
Peng Xu | afc34e3 | 2014-09-25 13:23:55 +0530 | [diff] [blame] | 144 | typedef struct sSapAcsChannelInfo { |
| 145 | v_U32_t channelNum; |
| 146 | v_U32_t weight; |
| 147 | }tSapAcsChannelInfo; |
| 148 | |
Sachin Ahuja | bcb0b7e | 2014-11-07 13:01:24 +0530 | [diff] [blame] | 149 | typedef struct { |
| 150 | /** The station entry is used or not */ |
| 151 | v_BOOL_t isUsed; |
| 152 | |
| 153 | /** Station ID reported back from HAL (through SAP). Broadcast |
| 154 | * uses station ID zero by default in both libra and volans. */ |
| 155 | v_U8_t ucSTAId; |
| 156 | |
| 157 | /** MAC address of the station */ |
| 158 | v_MACADDR_t macAddrSTA; |
| 159 | |
| 160 | /** Current Station state so HDD knows how to deal with packet |
| 161 | * queue. Most recent states used to change TL STA state. */ |
| 162 | WLANTL_STAStateType tlSTAState; |
| 163 | |
| 164 | /** Transmit queues for each AC (VO,VI,BE etc). */ |
| 165 | //hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 166 | hdd_list_t wmm_tx_queue[4]; |
| 167 | |
| 168 | /** Might need to differentiate queue depth in contention case */ |
| 169 | //v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; |
| 170 | v_U16_t aTxQueueDepth[4]; |
| 171 | |
| 172 | /**Track whether OS TX queue has been disabled.*/ |
| 173 | //v_BOOL_t txSuspended[NUM_TX_QUEUES]; |
| 174 | v_BOOL_t txSuspended[4]; |
| 175 | |
| 176 | /**Track whether 3/4th of resources are used */ |
| 177 | v_BOOL_t vosLowResource; |
| 178 | |
| 179 | /** Track QoS status of station */ |
| 180 | v_BOOL_t isQosEnabled; |
| 181 | |
| 182 | /** The station entry for which Deauth is in progress */ |
| 183 | v_BOOL_t isDeauthInProgress; |
Hardik Kantilal Patel | 1ba630f | 2014-11-21 04:32:05 +0530 | [diff] [blame] | 184 | |
| 185 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 186 | /** Track HT40 Intolerant station */ |
| 187 | v_BOOL_t isHT40IntolerantSet; |
| 188 | #endif |
Sachin Ahuja | bcb0b7e | 2014-11-07 13:01:24 +0530 | [diff] [blame] | 189 | } hdd_station_info_t; |
| 190 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 191 | typedef struct sSapContext { |
| 192 | |
| 193 | vos_lock_t SapGlobalLock; |
| 194 | |
| 195 | // Include the current channel of AP |
| 196 | v_U32_t channel; |
Madan Mohan Koyyalamudi | 5aef2af | 2012-10-05 11:56:27 -0700 | [diff] [blame] | 197 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 198 | // Include the SME(CSR) sessionId here |
| 199 | v_U8_t sessionId; |
| 200 | |
| 201 | // Include the key material for this physical link |
| 202 | v_U8_t key_type; |
| 203 | v_U8_t key_length; |
| 204 | v_U8_t key_material[32]; |
| 205 | |
| 206 | // Include the associations MAC addresses |
| 207 | v_U8_t self_mac_addr[VOS_MAC_ADDRESS_LEN]; |
| 208 | |
| 209 | // Own SSID |
| 210 | v_U8_t ownSsid[MAX_SSID_LEN]; |
| 211 | v_U32_t ownSsidLen; |
| 212 | |
| 213 | // Flag for signaling if security is enabled |
| 214 | v_U8_t ucSecEnabled; |
| 215 | |
| 216 | // Include the SME(CSR) context here |
| 217 | tCsrRoamProfile csrRoamProfile; |
| 218 | v_U32_t csrRoamId; |
| 219 | |
| 220 | //Sap session |
| 221 | tANI_BOOLEAN isSapSessionOpen; |
| 222 | |
| 223 | // SAP event Callback to hdd |
| 224 | tpWLAN_SAPEventCB pfnSapEventCallback; |
| 225 | |
| 226 | // Include the enclosing VOSS context here |
| 227 | v_PVOID_t pvosGCtx; |
| 228 | |
| 229 | // Include the state machine structure here, state var that keeps track of state machine |
| 230 | eSapFsmStates_t sapsMachine; |
| 231 | |
| 232 | // Actual storage for AP and self (STA) SSID |
| 233 | tCsrSSIDInfo SSIDList[2]; |
| 234 | |
| 235 | // Actual storage for AP bssid |
| 236 | tCsrBssid bssid; |
| 237 | |
| 238 | // Mac filtering settings |
| 239 | eSapMacAddrACL eSapMacAddrAclMode; |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 240 | v_MACADDR_t acceptMacList[MAX_ACL_MAC_ADDRESS]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 241 | v_U8_t nAcceptMac; |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 242 | v_MACADDR_t denyMacList[MAX_ACL_MAC_ADDRESS]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 243 | v_U8_t nDenyMac; |
| 244 | |
| 245 | // QOS config |
| 246 | tSapQosCfg SapQosCfg; |
| 247 | |
| 248 | v_PVOID_t pUsrContext; |
| 249 | |
| 250 | v_U32_t nStaWPARSnReqIeLength; |
| 251 | v_U8_t pStaWpaRsnReqIE[MAX_ASSOC_IND_IE_LEN]; |
| 252 | tSirAPWPSIEs APWPSIEs; |
| 253 | tSirRSNie APWPARSNIEs; |
| 254 | |
| 255 | v_U32_t nStaAddIeLength; |
| 256 | v_U8_t pStaAddIE[MAX_ASSOC_IND_IE_LEN]; |
| 257 | v_U8_t *channelList; |
Deepthi Gowri | 0f60c0f | 2014-09-22 18:13:29 +0530 | [diff] [blame] | 258 | v_U8_t numofChannel; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 259 | tSapChannelListInfo SapChnlList; |
Peng Xu | 2446a89 | 2014-09-05 17:21:18 +0530 | [diff] [blame] | 260 | |
| 261 | tANI_BOOLEAN allBandScanned; |
| 262 | eCsrBand currentPreferredBand; |
| 263 | eCsrBand scanBandPreference; |
Peng Xu | afc34e3 | 2014-09-25 13:23:55 +0530 | [diff] [blame] | 264 | v_U16_t acsBandSwitchThreshold; |
| 265 | tSapAcsChannelInfo acsBestChannelInfo; |
Sachin Ahuja | bcb0b7e | 2014-11-07 13:01:24 +0530 | [diff] [blame] | 266 | spinlock_t staInfo_lock; //To protect access to station Info |
| 267 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 268 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 269 | v_U8_t affected_start; |
| 270 | v_U8_t affected_end; |
| 271 | v_U8_t sap_sec_chan; |
Hardik Kantilal Patel | 1ba630f | 2014-11-21 04:32:05 +0530 | [diff] [blame] | 272 | v_U8_t numHT40IntoSta; |
Hardik Kantilal Patel | ce62e8b | 2014-11-21 16:31:38 +0530 | [diff] [blame^] | 273 | vos_timer_t sap_HT2040_timer; |
| 274 | v_U8_t ObssScanInterval; |
| 275 | v_U8_t ObssTransitionDelayFactor; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 276 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | } *ptSapContext; |
| 278 | |
| 279 | |
| 280 | /*---------------------------------------------------------------------------- |
| 281 | * External declarations for global context |
| 282 | * -------------------------------------------------------------------------*/ |
| 283 | // The main per-Physical Link (per WLAN association) context. |
| 284 | extern ptSapContext gpSapCtx; |
| 285 | |
| 286 | /*---------------------------------------------------------------------------- |
| 287 | * SAP state machine event definition |
| 288 | * -------------------------------------------------------------------------*/ |
| 289 | /* The event structure */ |
| 290 | typedef struct sWLAN_SAPEvent { |
| 291 | v_PVOID_t params; /* A VOID pointer type for all possible inputs */ |
| 292 | v_U32_t event; /* State machine input event message */ |
| 293 | v_U32_t u1; /* introduced to handle csrRoamCompleteCallback roamStatus */ |
| 294 | v_U32_t u2; /* introduced to handle csrRoamCompleteCallback roamResult */ |
| 295 | } tWLAN_SAPEvent, *ptWLAN_SAPEvent; |
| 296 | |
| 297 | /*---------------------------------------------------------------------------- |
| 298 | * Function Declarations and Documentation |
| 299 | * -------------------------------------------------------------------------*/ |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 300 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 301 | /*========================================================================== |
| 302 | |
| 303 | FUNCTION sapGet24GOBSSAffectedChannel() |
| 304 | |
| 305 | DESCRIPTION |
| 306 | Get OBSS Affected Channel no for SAP |
| 307 | |
| 308 | DEPENDENCIES |
| 309 | NA. |
| 310 | |
| 311 | PARAMETERS |
| 312 | |
| 313 | IN |
| 314 | tHalHandle: the tHalHandle passed in with the scan request |
| 315 | ptSapContext: Pointer to SAP context |
| 316 | |
| 317 | RETURN VALUE |
| 318 | |
| 319 | SIDE EFFECTS |
| 320 | |
| 321 | ============================================================================*/ |
| 322 | |
| 323 | eHalStatus sapGet24GOBSSAffectedChannel(tHalHandle halHandle, |
| 324 | ptSapContext psapCtx); |
| 325 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | |
| 327 | /*========================================================================== |
| 328 | |
| 329 | FUNCTION WLANSAP_ScanCallback() |
| 330 | |
| 331 | DESCRIPTION |
| 332 | Callback for Scan (scan results) Events |
| 333 | |
| 334 | DEPENDENCIES |
| 335 | NA. |
| 336 | |
| 337 | PARAMETERS |
| 338 | |
| 339 | IN |
| 340 | tHalHandle: the tHalHandle passed in with the scan request |
| 341 | *p2: the second context pass in for the caller, opaque sap Handle here |
| 342 | scanID: |
| 343 | status: Status of scan -success, failure or abort |
| 344 | |
| 345 | RETURN VALUE |
| 346 | The eHalStatus code associated with performing the operation |
| 347 | |
| 348 | eHAL_STATUS_SUCCESS: Success |
| 349 | |
| 350 | SIDE EFFECTS |
| 351 | |
| 352 | ============================================================================*/ |
| 353 | eHalStatus |
| 354 | WLANSAP_ScanCallback |
| 355 | ( |
| 356 | tHalHandle halHandle, |
| 357 | void *pContext, |
| 358 | v_U32_t scanID, |
| 359 | eCsrScanStatus scanStatus |
| 360 | ); |
| 361 | |
| 362 | /*========================================================================== |
| 363 | |
| 364 | FUNCTION WLANSAP_RoamCallback() |
| 365 | |
| 366 | DESCRIPTION |
| 367 | Callback for Roam (connection status) Events |
| 368 | |
| 369 | DEPENDENCIES |
| 370 | NA. |
| 371 | |
| 372 | PARAMETERS |
| 373 | |
| 374 | IN |
| 375 | pContext: is the pContext passed in with the roam request |
| 376 | pCsrRoamInfo: is a pointer to a tCsrRoamInfo, see definition of eRoamCmdStatus and |
| 377 | eRoamCmdResult: for detail valid members. It may be NULL |
| 378 | roamId: is to identify the callback related roam request. 0 means unsolicited |
| 379 | roamStatus: is a flag indicating the status of the callback |
| 380 | roamResult: is the result |
| 381 | |
| 382 | RETURN VALUE |
| 383 | The eHalStatus code associated with performing the operation |
| 384 | |
| 385 | eHAL_STATUS_SUCCESS: Success |
| 386 | |
| 387 | SIDE EFFECTS |
| 388 | |
| 389 | ============================================================================*/ |
| 390 | eHalStatus |
| 391 | WLANSAP_RoamCallback |
| 392 | ( |
| 393 | void *pContext, |
| 394 | tCsrRoamInfo *pCsrRoamInfo, |
| 395 | v_U32_t roamId, |
| 396 | eRoamCmdStatus roamStatus, |
| 397 | eCsrRoamResult roamResult |
| 398 | ); |
| 399 | |
| 400 | /*========================================================================== |
| 401 | |
| 402 | FUNCTION WLANSAP_CleanCB |
| 403 | |
| 404 | DESCRIPTION |
| 405 | Clear out all fields in the SAP context. |
| 406 | |
| 407 | DEPENDENCIES |
| 408 | |
| 409 | PARAMETERS |
| 410 | |
| 411 | IN |
| 412 | pSapCtx: pointer to the SAP control block |
| 413 | freeFlag: flag indicating whether to free any allocations. |
| 414 | |
| 415 | RETURN VALUE |
| 416 | The result code associated with performing the operation |
| 417 | |
| 418 | VOS_STATUS_E_FAULT: pointer to SAP cb is NULL ; access would cause a page |
| 419 | fault |
| 420 | VOS_STATUS_SUCCESS: Everything is good :) |
| 421 | |
| 422 | SIDE EFFECTS |
| 423 | |
| 424 | ============================================================================*/ |
| 425 | VOS_STATUS |
| 426 | WLANSAP_CleanCB |
| 427 | ( |
| 428 | ptSapContext pSapCtx, |
| 429 | v_U32_t freeFlag /* If 0 do not empty */ |
| 430 | ); |
| 431 | /*========================================================================== |
| 432 | |
| 433 | FUNCTION WLANSapFsm |
| 434 | |
| 435 | DESCRIPTION |
| 436 | SAP forward state machine to handle the states of the SAP |
| 437 | |
| 438 | DEPENDENCIES |
| 439 | |
| 440 | PARAMETERS |
| 441 | |
| 442 | IN |
| 443 | sapContext: pointer to the SAP control block |
| 444 | sapEvent : SAP event |
| 445 | status : status of SAP state machine |
| 446 | |
| 447 | RETURN VALUE |
| 448 | Status of the SAP forward machine |
| 449 | |
| 450 | VOS_STATUS_E_FAULT: pointer to SAP cb is NULL ; access would cause a page |
| 451 | fault |
| 452 | VOS_STATUS_SUCCESS: Everything is good :) |
| 453 | |
| 454 | SIDE EFFECTS |
| 455 | |
| 456 | ============================================================================*/ |
| 457 | |
| 458 | VOS_STATUS |
| 459 | SapFsm |
| 460 | ( |
| 461 | ptSapContext sapContext, /* sapContext value */ |
| 462 | ptWLAN_SAPEvent sapEvent, /* State machine event */ |
| 463 | v_U8_t *status /* return the SAP status here */ |
| 464 | ); |
| 465 | |
| 466 | /*========================================================================== |
| 467 | |
| 468 | FUNCTION WLANSAP_pmcFullPwrReqCB |
| 469 | |
| 470 | DESCRIPTION |
| 471 | Callback provide to PMC in the pmcRequestFullPower API. |
| 472 | |
| 473 | DEPENDENCIES |
| 474 | |
| 475 | PARAMETERS |
| 476 | |
| 477 | IN |
| 478 | callbackContext: The user passed in a context to identify |
| 479 | status: The halStatus |
| 480 | |
| 481 | RETURN VALUE |
| 482 | None |
| 483 | |
| 484 | SIDE EFFECTS |
| 485 | |
| 486 | ============================================================================*/ |
| 487 | void |
| 488 | WLANSAP_pmcFullPwrReqCB |
| 489 | ( |
| 490 | void *callbackContext, |
| 491 | eHalStatus status |
| 492 | ); |
| 493 | |
| 494 | /*========================================================================== |
| 495 | |
| 496 | FUNCTION sapSelectChannel |
| 497 | |
| 498 | DESCRIPTION |
| 499 | Runs a algorithm to select the best channel to operate in for Soft AP in 2.4GHz band |
| 500 | |
| 501 | DEPENDENCIES |
| 502 | |
| 503 | PARAMETERS |
| 504 | |
| 505 | IN |
| 506 | halHandle : Pointer to HAL handle |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 507 | pSapCtx : Pointer to SAP context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 508 | pResult : Pointer to tScanResultHandle |
| 509 | |
| 510 | RETURN VALUE |
| 511 | If SUCCESS channel number or zero for FAILURE. |
| 512 | |
| 513 | SIDE EFFECTS |
| 514 | |
| 515 | ============================================================================*/ |
Madan Mohan Koyyalamudi | 5aef2af | 2012-10-05 11:56:27 -0700 | [diff] [blame] | 516 | |
| 517 | v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResultHandle pScanResult); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 518 | |
| 519 | /*========================================================================== |
| 520 | |
| 521 | FUNCTION sapSignalHDDevent |
| 522 | |
| 523 | DESCRIPTION |
| 524 | SAP HDD event callback function |
| 525 | |
| 526 | DEPENDENCIES |
| 527 | |
| 528 | PARAMETERS |
| 529 | |
| 530 | IN |
| 531 | sapContext : Pointer to SAP handle |
| 532 | pCsrRoamInfo : csrRoamprofile |
| 533 | sapHddevent : SAP HDD callback event |
| 534 | |
| 535 | RETURN VALUE |
| 536 | If SUCCESS or FAILURE. |
| 537 | |
| 538 | SIDE EFFECTS |
| 539 | |
| 540 | ============================================================================*/ |
| 541 | |
| 542 | VOS_STATUS |
| 543 | sapSignalHDDevent( ptSapContext sapContext, tCsrRoamInfo * pCsrRoamInfo, eSapHddEvent sapHddevent, void *); |
| 544 | |
| 545 | /*========================================================================== |
| 546 | |
| 547 | FUNCTION sapFsm |
| 548 | |
| 549 | DESCRIPTION |
| 550 | SAP Forward state machine |
| 551 | |
| 552 | DEPENDENCIES |
| 553 | |
| 554 | PARAMETERS |
| 555 | |
| 556 | IN |
| 557 | sapContext : Pointer to SAP handle |
| 558 | sapEvent : state machine event |
| 559 | |
| 560 | RETURN VALUE |
| 561 | If SUCCESS or FAILURE. |
| 562 | |
| 563 | SIDE EFFECTS |
| 564 | |
| 565 | ============================================================================*/ |
| 566 | VOS_STATUS |
| 567 | sapFsm |
| 568 | ( |
| 569 | ptSapContext sapContext, /* sapContext value */ |
| 570 | ptWLAN_SAPEvent sapEvent /* State machine event */ |
| 571 | ); |
| 572 | |
| 573 | /*========================================================================== |
| 574 | |
| 575 | FUNCTION sapConvertToCsrProfile |
| 576 | |
| 577 | DESCRIPTION |
| 578 | sapConvertToCsrProfile |
| 579 | |
| 580 | DEPENDENCIES |
| 581 | |
| 582 | PARAMETERS |
| 583 | |
| 584 | IN |
| 585 | pconfig_params : Pointer to configuration structure |
| 586 | bssType : SoftAP type |
| 587 | profile : pointer to a csrProfile that needs to be passed |
| 588 | |
| 589 | RETURN VALUE |
| 590 | If SUCCESS or FAILURE. |
| 591 | |
| 592 | SIDE EFFECTS |
| 593 | |
| 594 | ============================================================================*/ |
| 595 | eSapStatus |
| 596 | sapconvertToCsrProfile(tsap_Config_t *pconfig_params, eCsrRoamBssType bssType, tCsrRoamProfile *profile); |
| 597 | |
| 598 | /*========================================================================== |
| 599 | |
| 600 | FUNCTION sapFreeRoamProfile |
| 601 | |
| 602 | DESCRIPTION |
| 603 | sapConvertToCsrProfile |
| 604 | |
| 605 | DEPENDENCIES |
| 606 | |
| 607 | PARAMETERS |
| 608 | |
| 609 | IN |
| 610 | profile : pointer to a csrProfile that needs to be freed |
| 611 | |
| 612 | RETURN VALUE |
| 613 | If SUCCESS or FAILURE. |
| 614 | |
| 615 | SIDE EFFECTS |
| 616 | |
| 617 | ============================================================================*/ |
| 618 | void sapFreeRoamProfile(tCsrRoamProfile *profile); |
| 619 | |
Hardik Kantilal Patel | 1ba630f | 2014-11-21 04:32:05 +0530 | [diff] [blame] | 620 | |
| 621 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 622 | /*========================================================================== |
| 623 | FUNCTION sapAddHT40IntolerantSta |
| 624 | |
| 625 | DESCRIPTION |
| 626 | Add HT40 Intolerant STA & Move SAP from HT40 to HT20 |
| 627 | |
| 628 | DEPENDENCIES |
| 629 | NA. |
| 630 | |
| 631 | PARAMETERS |
| 632 | |
| 633 | IN |
| 634 | sapContext : Sap Context value |
| 635 | pCsrRoamInfo : Pointer to CSR info |
| 636 | |
| 637 | RETURN VALUE |
| 638 | |
| 639 | SIDE EFFECTS |
| 640 | ============================================================================*/ |
| 641 | |
| 642 | void sapAddHT40IntolerantSta(ptSapContext sapContext, tCsrRoamInfo *pCsrRoamInfo); |
| 643 | |
| 644 | /*========================================================================== |
| 645 | FUNCTION sapRemoveHT40IntolerantSta |
| 646 | |
| 647 | DESCRIPTION |
| 648 | Remove HT40 Intolerant STA & Move SAP from HT40 to HT20 |
| 649 | |
| 650 | DEPENDENCIES |
| 651 | NA. |
| 652 | |
| 653 | PARAMETERS |
| 654 | |
| 655 | IN |
| 656 | sapContext : Sap Context value |
| 657 | pCsrRoamInfo : Pointer to CSR info |
| 658 | |
| 659 | RETURN VALUE |
| 660 | |
| 661 | SIDE EFFECTS |
| 662 | ============================================================================*/ |
| 663 | |
| 664 | void sapRemoveHT40IntolerantSta(ptSapContext sapContext, tCsrRoamInfo *pCsrRoamInfo); |
| 665 | #endif |
| 666 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 667 | /*========================================================================== |
| 668 | |
| 669 | FUNCTION sapIsPeerMacAllowed |
| 670 | |
| 671 | DESCRIPTION |
| 672 | Function to implement MAC filtering for station association in SoftAP |
| 673 | |
| 674 | DEPENDENCIES |
| 675 | |
| 676 | PARAMETERS |
| 677 | |
| 678 | IN |
| 679 | sapContext : Pointer to SAP handle |
| 680 | peerMac : Mac address of the peer |
| 681 | |
| 682 | RETURN VALUE |
| 683 | If SUCCESS or FAILURE. |
| 684 | |
| 685 | SIDE EFFECTS |
| 686 | |
| 687 | ============================================================================*/ |
| 688 | VOS_STATUS |
| 689 | sapIsPeerMacAllowed(ptSapContext sapContext, v_U8_t *peerMac); |
| 690 | |
| 691 | /*========================================================================== |
| 692 | |
| 693 | FUNCTION sapSortMacList |
| 694 | |
| 695 | DESCRIPTION |
| 696 | Function to implement sorting of MAC addresses |
| 697 | |
| 698 | DEPENDENCIES |
| 699 | |
| 700 | PARAMETERS |
| 701 | |
| 702 | IN |
| 703 | macList : Pointer to mac address array |
| 704 | size : Number of entries in mac address array |
| 705 | |
| 706 | RETURN VALUE |
| 707 | None |
| 708 | |
| 709 | SIDE EFFECTS |
| 710 | |
| 711 | ============================================================================*/ |
| 712 | void |
| 713 | sapSortMacList(v_MACADDR_t *macList, v_U8_t size); |
| 714 | |
| 715 | /*========================================================================== |
| 716 | |
| 717 | FUNCTION sapAddMacToACL |
| 718 | |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 719 | DESCRIPTION |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | Function to ADD a mac address in an ACL. |
| 721 | The function ensures that the ACL list remains sorted after the addition. |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 722 | This API does not take care of buffer overflow i.e. if the list is already |
| 723 | maxed out while adding a mac address, it will still try to add. |
| 724 | The caller must take care that the ACL size is less than MAX_ACL_MAC_ADDRESS |
| 725 | before calling this function. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 726 | |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 727 | DEPENDENCIES |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 729 | PARAMETERS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | |
| 731 | IN |
| 732 | macList : ACL list of mac addresses (black/white list) |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 733 | size (I/O) : size of the ACL. It is an I/O arg. The API takes care |
| 734 | of incrementing the size by 1. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 735 | peerMac : Mac address of the peer to be added |
| 736 | |
| 737 | RETURN VALUE |
| 738 | None. |
| 739 | |
Gopichand Nakkala | c005b7c | 2013-05-14 16:04:14 +0530 | [diff] [blame] | 740 | SIDE EFFECTS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 741 | |
| 742 | ============================================================================*/ |
| 743 | void |
| 744 | sapAddMacToACL(v_MACADDR_t *macList, v_U8_t *size, v_U8_t *peerMac); |
| 745 | |
| 746 | /*========================================================================== |
| 747 | |
| 748 | FUNCTION sapRemoveMacFromACL |
| 749 | |
| 750 | DESCRIPTION |
| 751 | Function to REMOVE a mac address from an ACL. |
| 752 | The function ensures that the ACL list remains sorted after the DELETION. |
| 753 | |
| 754 | DEPENDENCIES |
| 755 | |
| 756 | PARAMETERS |
| 757 | |
| 758 | IN |
| 759 | macList : ACL list of mac addresses (black/white list) |
| 760 | size (I/O) : size of the ACL. It is an I/O arg. The API takes care of decrementing the size by 1. |
| 761 | index : index in the ACL list where the peerMac is present |
| 762 | This index can be found by using the "sapSearchMacList" API which returns the index of the MAC |
| 763 | addr, if found in an ACL, in one of the arguments passed by the caller. |
| 764 | |
| 765 | RETURN VALUE |
| 766 | None. |
| 767 | |
| 768 | SIDE EFFECTS |
| 769 | |
| 770 | ============================================================================*/ |
| 771 | void |
| 772 | sapRemoveMacFromACL(v_MACADDR_t *macList, v_U8_t *size, v_U8_t index); |
| 773 | |
| 774 | /*========================================================================== |
| 775 | |
| 776 | FUNCTION sapPrintACL |
| 777 | |
| 778 | DESCRIPTION |
| 779 | Function to print all the mac address of an ACL. |
| 780 | Useful for debug. |
| 781 | |
| 782 | DEPENDENCIES |
| 783 | |
| 784 | PARAMETERS |
| 785 | |
| 786 | IN |
| 787 | macList : ACL list of mac addresses (black/white list) |
| 788 | size : size of the ACL |
| 789 | |
| 790 | RETURN VALUE |
| 791 | None. |
| 792 | |
| 793 | SIDE EFFECTS |
| 794 | |
| 795 | ============================================================================*/ |
| 796 | void |
| 797 | sapPrintACL(v_MACADDR_t *macList, v_U8_t size); |
| 798 | |
| 799 | /*========================================================================== |
| 800 | |
| 801 | FUNCTION sapSearchMacList |
| 802 | |
| 803 | DESCRIPTION |
| 804 | Function to search for a mac address in an ACL |
| 805 | |
| 806 | DEPENDENCIES |
| 807 | |
| 808 | PARAMETERS |
| 809 | |
| 810 | IN |
| 811 | macList : list of mac addresses (black/white list) |
| 812 | num_mac : size of the ACL |
| 813 | peerMac : Mac address of the peer |
| 814 | OP |
| 815 | index : the index at which the peer mac is found |
| 816 | this value gets filled in this function. If the caller is not interested |
| 817 | in the index of the peerMac to be searched, it can pass NULL here. |
| 818 | |
| 819 | RETURN VALUE |
| 820 | SUCCESS : if the mac addr being searched for is found |
| 821 | FAILURE : if the mac addr being searched for is NOT found |
| 822 | |
| 823 | SIDE EFFECTS |
| 824 | |
| 825 | ============================================================================*/ |
| 826 | eSapBool |
| 827 | sapSearchMacList(v_MACADDR_t *macList, v_U8_t num_mac, v_U8_t *peerMac, v_U8_t *index); |
| 828 | |
| 829 | |
| 830 | /*========================================================================== |
| 831 | |
| 832 | FUNCTION sap_AcquireGlobalLock |
| 833 | |
| 834 | DESCRIPTION |
| 835 | Function to implement acquire SAP global lock |
| 836 | |
| 837 | DEPENDENCIES |
| 838 | |
| 839 | PARAMETERS |
| 840 | |
| 841 | IN |
| 842 | sapContext : Pointer to SAP handle |
| 843 | peerMac : Mac address of the peer |
| 844 | |
| 845 | RETURN VALUE |
| 846 | If SUCCESS or FAILURE. |
| 847 | |
| 848 | SIDE EFFECTS |
| 849 | |
| 850 | ============================================================================*/ |
| 851 | VOS_STATUS |
| 852 | sap_AcquireGlobalLock( ptSapContext pSapCtx ); |
| 853 | |
| 854 | /*========================================================================== |
| 855 | |
| 856 | FUNCTION sapIsPeerMacAllowed |
| 857 | |
| 858 | DESCRIPTION |
| 859 | Function to implement release SAP global lock |
| 860 | |
| 861 | DEPENDENCIES |
| 862 | |
| 863 | PARAMETERS |
| 864 | |
| 865 | IN |
| 866 | sapContext : Pointer to SAP handle |
| 867 | peerMac : Mac address of the peer |
| 868 | |
| 869 | RETURN VALUE |
| 870 | If SUCCESS or FAILURE. |
| 871 | |
| 872 | SIDE EFFECTS |
| 873 | |
| 874 | ============================================================================*/ |
| 875 | VOS_STATUS |
| 876 | sap_ReleaseGlobalLock( ptSapContext pSapCtx ); |
| 877 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 878 | /*========================================================================== |
| 879 | FUNCTION sapConvertSapPhyModeToCsrPhyMode |
| 880 | |
| 881 | DESCRIPTION Function to implement selection of CSR PhyMode using SAP PhyMode |
| 882 | |
| 883 | DEPENDENCIES PARAMETERS |
| 884 | |
| 885 | IN sapPhyMode : SAP Phy Module |
| 886 | |
| 887 | RETURN VALUE If SUCCESS or FAILURE |
| 888 | |
| 889 | SIDE EFFECTS |
| 890 | ============================================================================*/ |
| 891 | eCsrPhyMode sapConvertSapPhyModeToCsrPhyMode( eSapPhyMode sapPhyMode ); |
Madan Mohan Koyyalamudi | 527935a | 2012-12-04 16:41:16 -0800 | [diff] [blame] | 892 | |
Hardik Kantilal Patel | ce62e8b | 2014-11-21 16:31:38 +0530 | [diff] [blame^] | 893 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 894 | /*========================================================================== |
| 895 | FUNCTION sap_ht2040_timer_cb |
| 896 | |
| 897 | DESCRIPTION Function to implement ht2040 timer callback implementation |
| 898 | |
| 899 | SIDE EFFECTS |
| 900 | ============================================================================*/ |
| 901 | void sap_ht2040_timer_cb(v_PVOID_t usrDataForCallback); |
| 902 | #endif |
| 903 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 904 | #ifdef __cplusplus |
| 905 | } |
| 906 | #endif |
| 907 | #endif /* #ifndef WLAN_QCT_WLANSAP_INTERNAL_H */ |
| 908 | |