blob: 8f3aed509e6d3dc5197d920df216676462c42d2e [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam0fb93dd2014-02-19 00:32:59 -08002 * 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 Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam0fb93dd2014-02-19 00:32:59 -080021
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 Johnson295189b2012-06-20 16:38:30 -070028#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
37DESCRIPTION
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
59when who what, where, why
60-------- --- ----------------------------------------------------------
6109/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 Ahujabcb0b7e2014-11-07 13:01:24 +053084#include "wlan_hdd_dp_utils.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070085/*----------------------------------------------------------------------------
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 Johnson295189b2012-06-20 16:38:30 -0700102#define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_PE, ctx)
Jeff Johnson295189b2012-06-20 16:38:30 -0700103//MAC Address length
104#define ANI_EAPOL_KEY_RSN_NONCE_SIZE 32
105
106extern sRegulatoryChannel *regChannels;
107extern const tRfChannelProps rfChannels[NUM_RF_CHANNELS];
108
109/*----------------------------------------------------------------------------
110 * Typedefs
111 * -------------------------------------------------------------------------*/
112typedef 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 */
125typedef 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 */
140typedef struct sSapQosCfg {
141 v_U8_t WmmIsEnabled;
142} tSapQosCfg;
143
Peng Xuafc34e32014-09-25 13:23:55 +0530144typedef struct sSapAcsChannelInfo {
145 v_U32_t channelNum;
146 v_U32_t weight;
147}tSapAcsChannelInfo;
148
Sachin Ahujabcb0b7e2014-11-07 13:01:24 +0530149typedef 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 Patel1ba630f2014-11-21 04:32:05 +0530184
185#ifdef WLAN_FEATURE_AP_HT40_24G
186 /** Track HT40 Intolerant station */
187 v_BOOL_t isHT40IntolerantSet;
188#endif
Sachin Ahujabcb0b7e2014-11-07 13:01:24 +0530189} hdd_station_info_t;
190
Jeff Johnson295189b2012-06-20 16:38:30 -0700191typedef struct sSapContext {
192
193 vos_lock_t SapGlobalLock;
194
195 // Include the current channel of AP
196 v_U32_t channel;
Madan Mohan Koyyalamudi5aef2af2012-10-05 11:56:27 -0700197
Jeff Johnson295189b2012-06-20 16:38:30 -0700198 // 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 Nakkalac005b7c2013-05-14 16:04:14 +0530240 v_MACADDR_t acceptMacList[MAX_ACL_MAC_ADDRESS];
Jeff Johnson295189b2012-06-20 16:38:30 -0700241 v_U8_t nAcceptMac;
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530242 v_MACADDR_t denyMacList[MAX_ACL_MAC_ADDRESS];
Jeff Johnson295189b2012-06-20 16:38:30 -0700243 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 Gowri0f60c0f2014-09-22 18:13:29 +0530258 v_U8_t numofChannel;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700259 tSapChannelListInfo SapChnlList;
Peng Xu2446a892014-09-05 17:21:18 +0530260
261 tANI_BOOLEAN allBandScanned;
262 eCsrBand currentPreferredBand;
263 eCsrBand scanBandPreference;
Peng Xuafc34e32014-09-25 13:23:55 +0530264 v_U16_t acsBandSwitchThreshold;
265 tSapAcsChannelInfo acsBestChannelInfo;
Sachin Ahujabcb0b7e2014-11-07 13:01:24 +0530266 spinlock_t staInfo_lock; //To protect access to station Info
267 hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT];
Hardik Kantilal Pateldd107952014-11-20 15:24:52 +0530268#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 Patel1ba630f2014-11-21 04:32:05 +0530272 v_U8_t numHT40IntoSta;
Hardik Kantilal Patelce62e8b2014-11-21 16:31:38 +0530273 vos_timer_t sap_HT2040_timer;
274 v_U8_t ObssScanInterval;
275 v_U8_t ObssTransitionDelayFactor;
Hardik Kantilal Pateldd107952014-11-20 15:24:52 +0530276#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700277} *ptSapContext;
278
279
280/*----------------------------------------------------------------------------
281 * External declarations for global context
282 * -------------------------------------------------------------------------*/
283// The main per-Physical Link (per WLAN association) context.
284extern ptSapContext gpSapCtx;
285
286/*----------------------------------------------------------------------------
287 * SAP state machine event definition
288 * -------------------------------------------------------------------------*/
289/* The event structure */
290typedef 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 Pateldd107952014-11-20 15:24:52 +0530300#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
323eHalStatus sapGet24GOBSSAffectedChannel(tHalHandle halHandle,
324 ptSapContext psapCtx);
325#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700326
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============================================================================*/
353eHalStatus
354WLANSAP_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============================================================================*/
390eHalStatus
391WLANSAP_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============================================================================*/
425VOS_STATUS
426WLANSAP_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
458VOS_STATUS
459SapFsm
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============================================================================*/
487void
488WLANSAP_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 Koyyalamudi1bed5982012-10-22 14:38:06 -0700507 pSapCtx : Pointer to SAP context
Jeff Johnson295189b2012-06-20 16:38:30 -0700508 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 Koyyalamudi5aef2af2012-10-05 11:56:27 -0700516
517v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResultHandle pScanResult);
Jeff Johnson295189b2012-06-20 16:38:30 -0700518
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
542VOS_STATUS
543sapSignalHDDevent( 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============================================================================*/
566VOS_STATUS
567sapFsm
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============================================================================*/
595eSapStatus
596sapconvertToCsrProfile(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============================================================================*/
618void sapFreeRoamProfile(tCsrRoamProfile *profile);
619
Hardik Kantilal Patel1ba630f2014-11-21 04:32:05 +0530620
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
642void 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
664void sapRemoveHT40IntolerantSta(ptSapContext sapContext, tCsrRoamInfo *pCsrRoamInfo);
665#endif
666
Jeff Johnson295189b2012-06-20 16:38:30 -0700667/*==========================================================================
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============================================================================*/
688VOS_STATUS
689sapIsPeerMacAllowed(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============================================================================*/
712void
713sapSortMacList(v_MACADDR_t *macList, v_U8_t size);
714
715/*==========================================================================
716
717 FUNCTION sapAddMacToACL
718
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530719 DESCRIPTION
Jeff Johnson295189b2012-06-20 16:38:30 -0700720 Function to ADD a mac address in an ACL.
721 The function ensures that the ACL list remains sorted after the addition.
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530722 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 Johnson295189b2012-06-20 16:38:30 -0700726
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530727 DEPENDENCIES
Jeff Johnson295189b2012-06-20 16:38:30 -0700728
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530729 PARAMETERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700730
731 IN
732 macList : ACL list of mac addresses (black/white list)
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530733 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 Johnson295189b2012-06-20 16:38:30 -0700735 peerMac : Mac address of the peer to be added
736
737 RETURN VALUE
738 None.
739
Gopichand Nakkalac005b7c2013-05-14 16:04:14 +0530740 SIDE EFFECTS
Jeff Johnson295189b2012-06-20 16:38:30 -0700741
742============================================================================*/
743void
744sapAddMacToACL(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============================================================================*/
771void
772sapRemoveMacFromACL(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============================================================================*/
796void
797sapPrintACL(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============================================================================*/
826eSapBool
827sapSearchMacList(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============================================================================*/
851VOS_STATUS
852sap_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============================================================================*/
875VOS_STATUS
876sap_ReleaseGlobalLock( ptSapContext pSapCtx );
877
Ravi Joshiaeb7d9e2013-05-02 12:28:14 -0700878/*==========================================================================
879FUNCTION sapConvertSapPhyModeToCsrPhyMode
880
881DESCRIPTION Function to implement selection of CSR PhyMode using SAP PhyMode
882
883DEPENDENCIES PARAMETERS
884
885IN sapPhyMode : SAP Phy Module
886
887RETURN VALUE If SUCCESS or FAILURE
888
889SIDE EFFECTS
890============================================================================*/
891eCsrPhyMode sapConvertSapPhyModeToCsrPhyMode( eSapPhyMode sapPhyMode );
Madan Mohan Koyyalamudi527935a2012-12-04 16:41:16 -0800892
Hardik Kantilal Patelce62e8b2014-11-21 16:31:38 +0530893#ifdef WLAN_FEATURE_AP_HT40_24G
894/*==========================================================================
895FUNCTION sap_ht2040_timer_cb
896
897DESCRIPTION Function to implement ht2040 timer callback implementation
898
899SIDE EFFECTS
900============================================================================*/
901void sap_ht2040_timer_cb(v_PVOID_t usrDataForCallback);
902#endif
903
Jeff Johnson295189b2012-06-20 16:38:30 -0700904#ifdef __cplusplus
905}
906#endif
907#endif /* #ifndef WLAN_QCT_WLANSAP_INTERNAL_H */
908