Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame^] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -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. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limUtils.h contains the utility definitions |
| 30 | * LIM uses. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 02/13/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | */ |
| 37 | #ifndef __LIM_UTILS_H |
| 38 | #define __LIM_UTILS_H |
| 39 | |
| 40 | #include "sirApi.h" |
| 41 | #include "sirDebug.h" |
| 42 | #include "cfgApi.h" |
| 43 | |
| 44 | #include "limTypes.h" |
| 45 | #include "limScanResultUtils.h" |
| 46 | #include "limTimerUtils.h" |
| 47 | #include "limTrace.h" |
| 48 | typedef enum |
| 49 | { |
| 50 | ONE_BYTE = 1, |
| 51 | TWO_BYTE = 2 |
| 52 | } eSizeOfLenField; |
| 53 | |
| 54 | #define LIM_STA_ID_MASK 0x00FF |
| 55 | #define LIM_AID_MASK 0xC000 |
| 56 | #define LIM_SPECTRUM_MANAGEMENT_BIT_MASK 0x0100 |
Hema Aparna Medicharla | fa1d2bb | 2013-12-23 02:28:09 +0530 | [diff] [blame] | 57 | #define LIM_RRM_BIT_MASK 0x1000 |
Chandrasekaran, Manishekar | c949a8b | 2014-06-27 12:34:09 +0530 | [diff] [blame] | 58 | #define LIM_SHORT_PREAMBLE_BIT_MASK 0x0020 |
| 59 | #define LIM_IMMEDIATE_BLOCK_ACK_MASK 0x8000 |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 60 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 61 | #define LIM_MAX_REASSOC_RETRY_LIMIT 2 |
| 62 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 63 | |
| 64 | // classifier ID is coded as 0-3: tsid, 4-5:direction |
| 65 | #define LIM_MAKE_CLSID(tsid, dir) (((tsid) & 0x0F) | (((dir) & 0x03) << 4)) |
| 66 | |
| 67 | #define LIM_SET_STA_BA_STATE(pSta, tid, newVal) \ |
| 68 | {\ |
| 69 | pSta->baState = ((pSta->baState | (0x3 << tid*2)) & ((newVal << tid*2) | ~(0x3 << tid*2)));\ |
| 70 | } |
| 71 | |
| 72 | #define LIM_GET_STA_BA_STATE(pSta, tid, pCurVal)\ |
| 73 | {\ |
| 74 | *pCurVal = (tLimBAState)(((pSta->baState >> tid*2) & 0x3));\ |
| 75 | } |
| 76 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | typedef struct sAddBaInfo |
| 78 | { |
| 79 | tANI_U16 fBaEnable : 1; |
| 80 | tANI_U16 startingSeqNum: 12; |
| 81 | tANI_U16 reserved : 3; |
| 82 | }tAddBaInfo, *tpAddBaInfo; |
| 83 | |
| 84 | typedef struct sAddBaCandidate |
| 85 | { |
| 86 | tSirMacAddr staAddr; |
| 87 | tAddBaInfo baInfo[STACFG_MAX_TC]; |
| 88 | }tAddBaCandidate, *tpAddBaCandidate; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 89 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 90 | #ifdef WLAN_FEATURE_11W |
| 91 | typedef union uPmfSaQueryTimerId |
| 92 | { |
| 93 | struct |
| 94 | { |
| 95 | tANI_U8 sessionId; |
| 96 | tANI_U16 peerIdx; |
| 97 | } fields; |
| 98 | tANI_U32 value; |
| 99 | } tPmfSaQueryTimerId, *tpPmfSaQueryTimerId; |
| 100 | #endif |
| 101 | |
Atul Mittal | b849d5a | 2014-07-29 12:08:39 +0530 | [diff] [blame] | 102 | typedef enum offset { |
| 103 | BW20, |
| 104 | BW40PLUS, |
| 105 | BW40MINUS, |
| 106 | BWALL |
| 107 | } offset_t; |
| 108 | |
| 109 | typedef struct op_class_map { |
| 110 | tANI_U8 op_class; |
| 111 | tANI_U8 ch_spacing; |
| 112 | offset_t offset; |
| 113 | tANI_U8 channels[15]; |
| 114 | }op_class_map_t; |
Jeff Johnson | 1250df4 | 2012-12-10 14:31:52 -0800 | [diff] [blame] | 115 | // LIM utility functions |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 116 | tANI_BOOLEAN limCheck11BRateBitmap(tANI_U16 RateBitmap); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 117 | void limGetBssidFromPkt(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U32 *); |
| 118 | char * limMlmStateStr(tLimMlmStates state); |
| 119 | char * limSmeStateStr(tLimSmeStates state); |
| 120 | char * limMsgStr(tANI_U32 msgType); |
| 121 | char * limResultCodeStr(tSirResultCodes resultCode); |
| 122 | char* limDot11ModeStr(tpAniSirGlobal pMac, tANI_U8 dot11Mode); |
| 123 | char* limStaOpRateModeStr(tStaRateMode opRateMode); |
| 124 | void limPrintMlmState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimMlmStates state); |
| 125 | void limPrintSmeState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimSmeStates state); |
| 126 | void limPrintMsgName(tpAniSirGlobal pMac, tANI_U16 logLevel, tANI_U32 msgType); |
| 127 | void limPrintMsgInfo(tpAniSirGlobal pMac, tANI_U16 logLevel, tSirMsgQ *msg); |
| 128 | char* limBssTypeStr(tSirBssType bssType); |
| 129 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 130 | #if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 131 | extern tSirRetStatus limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac, |
| 132 | tPowerdBm txPower, |
| 133 | tpPESession pSessionEntry ); |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 134 | extern tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tANI_U8 iniTxPower); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 135 | #endif |
| 136 | |
| 137 | tANI_U32 limPostMsgApiNoWait(tpAniSirGlobal, tSirMsgQ *); |
| 138 | tANI_U8 limIsAddrBC(tSirMacAddr); |
| 139 | tANI_U8 limIsGroupAddr(tSirMacAddr); |
| 140 | |
| 141 | // check for type of scan allowed |
| 142 | tANI_U8 limActiveScanAllowed(tpAniSirGlobal, tANI_U8); |
| 143 | |
| 144 | // AID pool management functions |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 145 | void limInitPeerIdxpool(tpAniSirGlobal,tpPESession); |
| 146 | tANI_U16 limAssignPeerIdx(tpAniSirGlobal,tpPESession); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 147 | |
| 148 | void limEnableOverlap11gProtection(tpAniSirGlobal pMac, tpUpdateBeaconParams pBeaconParams, tpSirMacMgmtHdr pMh,tpPESession psessionEntry); |
| 149 | void limUpdateOverlapStaParam(tpAniSirGlobal pMac, tSirMacAddr bssId, tpLimProtStaParams pStaParams); |
| 150 | void limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry); |
| 151 | void limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry); |
| 152 | |
| 153 | /* |
| 154 | * The below 'product' check tobe removed if 'Association' is |
| 155 | * allowed in IBSS. |
| 156 | */ |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 157 | void limReleasePeerIdx(tpAniSirGlobal, tANI_U16, tpPESession); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 159 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 160 | void limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams,tpPESession); |
| 161 | void |
| 162 | limDecideApProtectionOnDelete(tpAniSirGlobal pMac, |
| 163 | tpDphHashNode pStaDs, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 164 | |
| 165 | extern tSirRetStatus limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession); |
| 166 | extern tSirRetStatus limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry); |
| 167 | extern tSirRetStatus limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry); |
| 168 | extern tSirRetStatus limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession sessionEntry); |
| 169 | extern tSirRetStatus limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession); |
| 170 | extern tSirRetStatus limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry); |
| 171 | extern tSirRetStatus limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 172 | extern tSirRetStatus limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 173 | extern tSirRetStatus limEnableHtOBSSProtection (tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams, tpPESession); |
| 174 | void limDecideStaProtection(tpAniSirGlobal pMac, tpSchBeaconStruct pBeaconStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry); |
| 175 | void limDecideStaProtectionOnAssoc(tpAniSirGlobal pMac, tpSchBeaconStruct pBeaconStruct, tpPESession psessionEntry); |
| 176 | void limUpdateStaRunTimeHTSwitchChnlParams(tpAniSirGlobal pMac, tDot11fIEHTInfo * pHTInfo, tANI_U8 bssIdx, tpPESession psessionEntry); |
| 177 | // Print MAC address utility function |
| 178 | void limPrintMacAddr(tpAniSirGlobal, tSirMacAddr, tANI_U8); |
| 179 | |
| 180 | |
| 181 | |
| 182 | // Deferred Message Queue read/write |
| 183 | tANI_U8 limWriteDeferredMsgQ(tpAniSirGlobal pMac, tpSirMsgQ limMsg); |
| 184 | tSirMsgQ* limReadDeferredMsgQ(tpAniSirGlobal pMac); |
| 185 | void limHandleDeferMsgError(tpAniSirGlobal pMac, tpSirMsgQ pLimMsg); |
| 186 | |
| 187 | // Deferred Message Queue Reset |
| 188 | void limResetDeferredMsgQ(tpAniSirGlobal pMac); |
| 189 | |
| 190 | tSirRetStatus limSysProcessMmhMsgApi(tpAniSirGlobal, tSirMsgQ*, tANI_U8); |
| 191 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 192 | void limHandleUpdateOlbcCache(tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 193 | |
| 194 | tANI_U8 limIsNullSsid( tSirMacSSid *pSsid ); |
| 195 | |
| 196 | void limProcessAddtsRspTimeout(tpAniSirGlobal pMac, tANI_U32 param); |
| 197 | |
| 198 | // 11h Support |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId); |
| 200 | void limProcessChannelSwitchTimeout(tpAniSirGlobal); |
| 201 | tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 202 | void limUpdateChannelSwitch(tpAniSirGlobal, tpSirProbeRespBeacon, tpPESession psessionEntry); |
| 203 | void limProcessQuietTimeout(tpAniSirGlobal); |
| 204 | void limProcessQuietBssTimeout(tpAniSirGlobal); |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 205 | void limInitOBSSScanParams(tpAniSirGlobal pMac, |
| 206 | tpPESession psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 207 | #if 0 |
| 208 | void limProcessWPSOverlapTimeout(tpAniSirGlobal pMac); |
| 209 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 210 | |
| 211 | void limStartQuietTimer(tpAniSirGlobal pMac, tANI_U8 sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 212 | void limSwitchPrimaryChannel(tpAniSirGlobal, tANI_U8,tpPESession); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 213 | void limSwitchPrimarySecondaryChannel(tpAniSirGlobal, tpPESession, tANI_U8, ePhyChanBondState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 214 | tAniBool limTriggerBackgroundScanDuringQuietBss(tpAniSirGlobal); |
| 215 | void limUpdateStaRunTimeHTSwtichChnlParams(tpAniSirGlobal pMac, tDot11fIEHTInfo *pRcvdHTInfo, tANI_U8 bssIdx); |
| 216 | void limUpdateStaRunTimeHTCapability(tpAniSirGlobal pMac, tDot11fIEHTCaps *pHTCaps); |
| 217 | void limUpdateStaRunTimeHTInfo(struct sAniSirGlobal *pMac, tDot11fIEHTInfo *pRcvdHTInfo, tpPESession psessionEntry); |
| 218 | void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 219 | void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 220 | tAniBool limIsChannelValidForChannelSwitch(tpAniSirGlobal pMac, tANI_U8 channel); |
| 221 | void limFrameTransmissionControl(tpAniSirGlobal pMac, tLimQuietTxMode type, tLimControlTx mode); |
| 222 | tSirRetStatus limRestorePreChannelSwitchState(tpAniSirGlobal pMac, tpPESession psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 223 | tSirRetStatus limRestorePreQuietState(tpAniSirGlobal pMac, tpPESession psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 224 | |
| 225 | void limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 226 | void limSwitchChannelCback(tpAniSirGlobal pMac, eHalStatus status, |
| 227 | tANI_U32 *data, tpPESession psessionEntry); |
| 228 | |
| 229 | static inline tSirRFBand limGetRFBand(tANI_U8 channel) |
| 230 | { |
| 231 | if ((channel >= SIR_11A_CHANNEL_BEGIN) && |
| 232 | (channel <= SIR_11A_CHANNEL_END)) |
| 233 | return SIR_BAND_5_GHZ; |
| 234 | |
| 235 | if ((channel >= SIR_11B_CHANNEL_BEGIN) && |
| 236 | (channel <= SIR_11B_CHANNEL_END)) |
| 237 | return SIR_BAND_2_4_GHZ; |
| 238 | |
| 239 | return SIR_BAND_UNKNOWN; |
| 240 | } |
| 241 | |
| 242 | |
| 243 | static inline tSirRetStatus |
| 244 | limGetMgmtStaid(tpAniSirGlobal pMac, tANI_U16 *staid, tpPESession psessionEntry) |
| 245 | { |
| 246 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 247 | *staid = 1; |
| 248 | else if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 249 | *staid = 0; |
| 250 | else |
| 251 | return eSIR_FAILURE; |
| 252 | |
| 253 | return eSIR_SUCCESS; |
| 254 | } |
| 255 | |
| 256 | static inline tANI_U8 |
| 257 | limIsSystemInSetMimopsState(tpAniSirGlobal pMac) |
| 258 | { |
| 259 | if (pMac->lim.gLimMlmState == eLIM_MLM_WT_SET_MIMOPS_STATE) |
| 260 | return true; |
| 261 | return false; |
| 262 | } |
| 263 | |
| 264 | static inline tANI_U8 |
| 265 | isEnteringMimoPS(tSirMacHTMIMOPowerSaveState curState, tSirMacHTMIMOPowerSaveState newState) |
| 266 | { |
| 267 | if (curState == eSIR_HT_MIMO_PS_NO_LIMIT && |
| 268 | (newState == eSIR_HT_MIMO_PS_DYNAMIC ||newState == eSIR_HT_MIMO_PS_STATIC)) |
| 269 | return TRUE; |
| 270 | return FALSE; |
| 271 | } |
| 272 | |
| 273 | /// ANI peer station count management and associated actions |
| 274 | void limUtilCountStaAdd(tpAniSirGlobal pMac, tpDphHashNode pSta, tpPESession psessionEntry); |
| 275 | void limUtilCountStaDel(tpAniSirGlobal pMac, tpDphHashNode pSta, tpPESession psessionEntry); |
| 276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | tANI_U8 limGetHTCapability( tpAniSirGlobal, tANI_U32, tpPESession); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | void limTxComplete( tHalHandle hHal, void *pData ); |
| 279 | |
| 280 | /**********Admit Control***************************************/ |
| 281 | |
| 282 | //callback function for HAL to issue DelTS request to PE. |
| 283 | //This function will be registered with HAL for callback when TSPEC inactivity timer fires. |
| 284 | |
| 285 | void limProcessDelTsInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg); |
| 286 | tSirRetStatus limProcessHalIndMessages(tpAniSirGlobal pMac, tANI_U32 mesgId, void *mesgParam ); |
| 287 | tSirRetStatus limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr peerMacAddr,tpPESession psessionEntry); |
| 288 | /**********************************************************/ |
| 289 | |
| 290 | //callback function registration to HAL for any indication. |
| 291 | void limRegisterHalIndCallBack(tpAniSirGlobal pMac); |
| 292 | void limPktFree ( |
| 293 | tpAniSirGlobal pMac, |
| 294 | eFrameType frmType, |
| 295 | tANI_U8 *pBD, |
| 296 | void *body); |
| 297 | |
| 298 | |
| 299 | |
| 300 | void limGetBDfromRxPacket(tpAniSirGlobal pMac, void *body, tANI_U32 **pBD); |
| 301 | |
| 302 | /** |
| 303 | * \brief Given a base(X) and power(Y), this API will return |
| 304 | * the result of base raised to power - (X ^ Y) |
| 305 | * |
| 306 | * \sa utilsPowerXY |
| 307 | * |
| 308 | * \param base Base value |
| 309 | * |
| 310 | * \param power Base raised to this Power value |
| 311 | * |
| 312 | * \return Result of X^Y |
| 313 | * |
| 314 | */ |
| 315 | static inline tANI_U32 utilsPowerXY( tANI_U16 base, tANI_U16 power ) |
| 316 | { |
| 317 | tANI_U32 result = 1, i; |
| 318 | |
| 319 | for( i = 0; i < power; i++ ) |
| 320 | result *= base; |
| 321 | |
| 322 | return result; |
| 323 | } |
| 324 | |
| 325 | |
| 326 | |
| 327 | tSirRetStatus limPostMlmAddBAReq( tpAniSirGlobal pMac, |
| 328 | tpDphHashNode pStaDs, |
| 329 | tANI_U8 tid, tANI_U16 startingSeqNum,tpPESession psessionEntry); |
| 330 | tSirRetStatus limPostMlmAddBARsp( tpAniSirGlobal pMac, |
| 331 | tSirMacAddr peerMacAddr, |
| 332 | tSirMacStatusCodes baStatusCode, |
| 333 | tANI_U8 baDialogToken, |
| 334 | tANI_U8 baTID, |
| 335 | tANI_U8 baPolicy, |
| 336 | tANI_U16 baBufferSize, |
| 337 | tANI_U16 baTimeout, |
| 338 | tpPESession psessionEntry); |
| 339 | tSirRetStatus limPostMlmDelBAReq( tpAniSirGlobal pMac, |
| 340 | tpDphHashNode pSta, |
| 341 | tANI_U8 baDirection, |
| 342 | tANI_U8 baTID, |
| 343 | tSirMacReasonCodes baReasonCode , |
| 344 | tpPESession psessionEntry); |
| 345 | tSirRetStatus limPostMsgAddBAReq( tpAniSirGlobal pMac, |
| 346 | tpDphHashNode pSta, |
| 347 | tANI_U8 baDialogToken, |
| 348 | tANI_U8 baTID, |
| 349 | tANI_U8 baPolicy, |
| 350 | tANI_U16 baBufferSize, |
| 351 | tANI_U16 baTimeout, |
| 352 | tANI_U16 baSSN, |
| 353 | tANI_U8 baDirection, |
| 354 | tpPESession psessionEntry); |
| 355 | tSirRetStatus limPostMsgDelBAInd( tpAniSirGlobal pMac, |
| 356 | tpDphHashNode pSta, |
| 357 | tANI_U8 baTID, |
| 358 | tANI_U8 baDirection, |
| 359 | tpPESession psessionEntry); |
| 360 | |
| 361 | tSirRetStatus limPostSMStateUpdate(tpAniSirGlobal pMac, |
| 362 | tANI_U16 StaIdx, |
| 363 | tSirMacHTMIMOPowerSaveState MIMOPSState); |
| 364 | |
| 365 | void limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg); |
| 366 | void limProcessAddBaInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg); |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 367 | void limDeleteBASessions(tpAniSirGlobal pMac, tpPESession pSessionEntry, |
| 368 | tANI_U32 baDirection, tSirMacReasonCodes baReasonCode); |
Leela Venkata Kiran Kumar Reddy Chirala | b8dadc2 | 2013-11-05 12:34:32 -0800 | [diff] [blame] | 369 | void limDelPerBssBASessionsBtc(tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 370 | void limDelAllBASessions(tpAniSirGlobal pMac); |
| 371 | void limDeleteDialogueTokenList(tpAniSirGlobal pMac); |
| 372 | tSirRetStatus limSearchAndDeleteDialogueToken(tpAniSirGlobal pMac, tANI_U8 token, tANI_U16 assocId, tANI_U16 tid); |
| 373 | void limRessetScanChannelInfo(tpAniSirGlobal pMac); |
| 374 | void limAddScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 channelId); |
| 375 | |
| 376 | tANI_U8 limGetChannelFromBeacon(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon); |
| 377 | tSirNwType limGetNwType(tpAniSirGlobal pMac, tANI_U8 channelNum, tANI_U32 type, tpSchBeaconStruct pBeacon); |
| 378 | void limSetTspecUapsdMask(tpAniSirGlobal pMac, tSirMacTSInfo *pTsInfo, tANI_U32 action); |
| 379 | void limHandleHeartBeatTimeout(tpAniSirGlobal pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 380 | void limHandleHeartBeatTimeoutForSession(tpAniSirGlobal pMac, tpPESession psessionEntry); |
| 381 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 382 | //void limProcessBtampAddBssRsp(tpAniSirGlobal pMac,tpSirMsgQ pMsgQ,tpPESession peSession); |
| 383 | void limProcessAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ pMsgQ); |
| 384 | |
| 385 | void limUpdateBeacon(tpAniSirGlobal pMac); |
| 386 | |
| 387 | void limProcessBtAmpApMlmAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ, tpPESession psessionEntry); |
| 388 | void limProcessBtAmpApMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry); |
| 389 | |
| 390 | void limProcessBtAmpApMlmDelStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ,tpPESession psessionEntry); |
| 391 | tpPESession limIsIBSSSessionActive(tpAniSirGlobal pMac); |
| 392 | tpPESession limIsApSessionActive(tpAniSirGlobal pMac); |
| 393 | void limHandleHeartBeatFailureTimeout(tpAniSirGlobal pMac); |
| 394 | |
| 395 | void limProcessDelStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ); |
| 396 | void limProcessAddStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ); |
| 397 | v_U8_t* limGetIEPtr(tpAniSirGlobal pMac, v_U8_t *pIes, int length, v_U8_t eid,eSizeOfLenField size_of_len_field); |
| 398 | |
| 399 | tANI_U8 limUnmapChannel(tANI_U8 mapChannel); |
| 400 | |
| 401 | #define limGetWscIEPtr(pMac, ie, ie_len) \ |
| 402 | limGetVendorIEOuiPtr(pMac, SIR_MAC_WSC_OUI, SIR_MAC_WSC_OUI_SIZE, ie, ie_len) |
| 403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 404 | #define limGetP2pIEPtr(pMac, ie, ie_len) \ |
| 405 | limGetVendorIEOuiPtr(pMac, SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE, ie, ie_len) |
| 406 | |
| 407 | v_U8_t limGetNoaAttrStreamInMultP2pIes(tpAniSirGlobal pMac,v_U8_t* noaStream,v_U8_t noaLen,v_U8_t overFlowLen); |
| 408 | v_U8_t limGetNoaAttrStream(tpAniSirGlobal pMac, v_U8_t*pNoaStream,tpPESession psessionEntry); |
| 409 | |
| 410 | v_U8_t limBuildP2pIe(tpAniSirGlobal pMac, tANI_U8 *ie, tANI_U8 *data, tANI_U8 ie_len); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 411 | tANI_BOOLEAN limIsNOAInsertReqd(tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 412 | v_U8_t* limGetVendorIEOuiPtr(tpAniSirGlobal pMac, tANI_U8 *oui, tANI_U8 oui_size, tANI_U8 *ie, tANI_U16 ie_len); |
| 413 | tANI_BOOLEAN limIsconnectedOnDFSChannel(tANI_U8 currentChannel); |
| 414 | tANI_U8 limGetCurrentOperatingChannel(tpAniSirGlobal pMac); |
| 415 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 416 | #ifdef WLAN_FEATURE_11AC |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 417 | tANI_BOOLEAN limCheckVHTOpModeChange( tpAniSirGlobal pMac, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 418 | tpPESession psessionEntry, tANI_U8 chanWidth, tANI_U8 staId); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 419 | #endif |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 420 | tANI_BOOLEAN limCheckHTChanBondModeChange(tpAniSirGlobal pMac, |
| 421 | tpPESession psessionEntry, |
| 422 | tANI_U8 beaconSecChanWidth, |
| 423 | tANI_U8 currentSecChanWidth, |
| 424 | tANI_U8 staId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 425 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 426 | |
| 427 | typedef enum |
| 428 | { |
| 429 | WLAN_PE_DIAG_SCAN_REQ_EVENT = 0, |
| 430 | WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, |
| 431 | WLAN_PE_DIAG_SCAN_RSP_EVENT, |
| 432 | WLAN_PE_DIAG_JOIN_REQ_EVENT, |
| 433 | WLAN_PE_DIAG_JOIN_RSP_EVENT, |
| 434 | WLAN_PE_DIAG_SETCONTEXT_REQ_EVENT, |
| 435 | WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, |
| 436 | WLAN_PE_DIAG_REASSOC_REQ_EVENT, |
| 437 | WLAN_PE_DIAG_REASSOC_RSP_EVENT, |
| 438 | WLAN_PE_DIAG_AUTH_REQ_EVENT, |
| 439 | WLAN_PE_DIAG_AUTH_RSP_EVENT, |
| 440 | WLAN_PE_DIAG_DISASSOC_REQ_EVENT, |
| 441 | WLAN_PE_DIAG_DISASSOC_RSP_EVENT, |
| 442 | WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
| 443 | WLAN_PE_DIAG_DISASSOC_CNF_EVENT, |
| 444 | WLAN_PE_DIAG_DEAUTH_REQ_EVENT, |
| 445 | WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
| 446 | WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
| 447 | WLAN_PE_DIAG_START_BSS_REQ_EVENT, |
| 448 | WLAN_PE_DIAG_START_BSS_RSP_EVENT, |
| 449 | WLAN_PE_DIAG_AUTH_IND_EVENT, |
| 450 | WLAN_PE_DIAG_ASSOC_IND_EVENT, |
| 451 | WLAN_PE_DIAG_ASSOC_CNF_EVENT, |
| 452 | WLAN_PE_DIAG_REASSOC_IND_EVENT, |
| 453 | WLAN_PE_DIAG_SWITCH_CHL_REQ_EVENT, |
| 454 | WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT, |
| 455 | WLAN_PE_DIAG_STOP_BSS_REQ_EVENT, |
| 456 | WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, |
| 457 | WLAN_PE_DIAG_DEAUTH_CNF_EVENT, |
| 458 | WLAN_PE_DIAG_ADDTS_REQ_EVENT, |
| 459 | WLAN_PE_DIAG_ADDTS_RSP_EVENT, |
| 460 | WLAN_PE_DIAG_DELTS_REQ_EVENT, |
| 461 | WLAN_PE_DIAG_DELTS_RSP_EVENT, |
| 462 | WLAN_PE_DIAG_DELTS_IND_EVENT, |
| 463 | WLAN_PE_DIAG_ENTER_BMPS_REQ_EVENT, |
| 464 | WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT, |
| 465 | WLAN_PE_DIAG_EXIT_BMPS_REQ_EVENT, |
| 466 | WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT, |
| 467 | WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, |
| 468 | WLAN_PE_DIAG_ENTER_IMPS_REQ_EVENT, |
| 469 | WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT, |
| 470 | WLAN_PE_DIAG_EXIT_IMPS_REQ_EVENT, |
| 471 | WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT, |
| 472 | WLAN_PE_DIAG_ENTER_UAPSD_REQ_EVENT, |
| 473 | WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT, |
| 474 | WLAN_PE_DIAG_EXIT_UAPSD_REQ_EVENT, |
| 475 | WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT, |
| 476 | WLAN_PE_DIAG_WOWL_ADD_BCAST_PTRN_EVENT, |
| 477 | WLAN_PE_DIAG_WOWL_DEL_BCAST_PTRN_EVENT, |
| 478 | WLAN_PE_DIAG_ENTER_WOWL_REQ_EVENT, |
| 479 | WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT, |
| 480 | WLAN_PE_DIAG_EXIT_WOWL_REQ_EVENT, |
| 481 | WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT, |
| 482 | WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT, |
| 483 | WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT, |
| 484 | WLAN_PE_DIAG_HAL_DELBA_IND_EVENT, |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 485 | WLAN_PE_DIAG_HB_FAILURE_TIMEOUT, |
| 486 | WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, |
| 487 | WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, |
| 488 | WLAN_PE_DIAG_PREAUTH_DONE, |
| 489 | WLAN_PE_DIAG_REASSOCIATING, |
| 490 | WLAN_PE_DIAG_CONNECTED, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 491 | }WLAN_PE_DIAG_EVENT_TYPE; |
| 492 | |
| 493 | void limDiagEventReport(tpAniSirGlobal pMac, tANI_U16 eventType, tpPESession pSessionEntry, tANI_U16 status, tANI_U16 reasonCode); |
| 494 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 495 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 496 | void peSetResumeChannel(tpAniSirGlobal pMac, tANI_U16 channel, ePhyChanBondState cbState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | /*-------------------------------------------------------------------------- |
| 498 | |
| 499 | \brief peGetResumeChannel() - Returns the channel number for scanning, from a valid session. |
| 500 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 501 | This function returns the channel to resume to during link resume. channel id of 0 means HAL will |
| 502 | resume to previous channel before link suspend |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 503 | |
| 504 | \param pMac - pointer to global adapter context |
| 505 | \return - channel to scan from valid session else zero. |
| 506 | |
| 507 | \sa |
| 508 | |
| 509 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 510 | void peGetResumeChannel(tpAniSirGlobal pMac, tANI_U8* resumeChannel, ePhyChanBondState* resumePhyCbState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 511 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 512 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 513 | tANI_U8 limTdlsFindLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac, tLimTdlsLinkSetupPeer **setupPeer); |
| 514 | void limTdlsDelLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac); |
| 515 | void limStartTdlsTimer(tpAniSirGlobal pMac, tANI_U8 sessionId, TX_TIMER *timer, tANI_U32 timerId, |
| 516 | tANI_U16 timerType, tANI_U32 timerMsg); |
| 517 | #endif |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 518 | void limGetShortSlotFromPhyMode(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U32 phyMode, |
| 519 | tANI_U8 *pShortSlotEnable); |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 520 | |
Madan Mohan Koyyalamudi | a67d433 | 2012-11-29 11:35:23 -0800 | [diff] [blame] | 521 | void limCleanUpDisassocDeauthReq(tpAniSirGlobal pMac, tANI_U8 *staMac, tANI_BOOLEAN cleanRxPath); |
| 522 | |
Madan Mohan Koyyalamudi | 25b6f8b | 2012-12-04 16:17:31 -0800 | [diff] [blame] | 523 | tANI_BOOLEAN limCheckDisassocDeauthAckPending(tpAniSirGlobal pMac, tANI_U8 *staMac); |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 524 | |
| 525 | |
| 526 | void limUtilsframeshtons(tpAniSirGlobal pCtx, |
| 527 | tANI_U8 *pOut, |
| 528 | tANI_U16 pIn, |
| 529 | tANI_U8 fMsb); |
| 530 | |
| 531 | void limUtilsframeshtonl(tpAniSirGlobal pCtx, |
| 532 | tANI_U8 *pOut, |
| 533 | tANI_U32 pIn, |
| 534 | tANI_U8 fMsb); |
| 535 | |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 536 | void limUpdateOBSSScanParams(tpPESession psessionEntry , |
| 537 | tDot11fIEOBSSScanParameters *pOBSSScanParameters); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 538 | |
| 539 | #ifdef WLAN_FEATURE_11W |
| 540 | void limPmfSaQueryTimerHandler(void *pMacGlobal, tANI_U32 param); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 541 | |
Abhishek Singh | 0ebac9c | 2014-06-25 13:34:12 +0530 | [diff] [blame] | 542 | void limSetProtectedBit(tpAniSirGlobal pMac, |
| 543 | tpPESession psessionEntry, |
| 544 | tSirMacAddr peer, |
| 545 | tpSirMacMgmtHdr pMacHdr); |
| 546 | #endif |
Atul Mittal | b849d5a | 2014-07-29 12:08:39 +0530 | [diff] [blame] | 547 | void limInitOperatingClasses(tHalHandle hHal); |
| 548 | tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, |
| 549 | tANI_U8 channel, |
| 550 | tANI_U8 offset); |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame^] | 551 | void limParseBeaconForTim(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, |
| 552 | tpPESession psessionEntry); |
| 553 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 554 | #endif /* __LIM_UTILS_H */ |