Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Abhishek Singh | 09d4e4a | 2016-01-12 11:20:22 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2016. 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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [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 | |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 28 | |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 29 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | * This file limUtils.cc contains the utility functions |
| 31 | * LIM uses. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 02/13/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | */ |
| 38 | |
| 39 | #include "schApi.h" |
| 40 | #include "limUtils.h" |
| 41 | #include "limTypes.h" |
| 42 | #include "limSecurityUtils.h" |
| 43 | #include "limPropExtsUtils.h" |
| 44 | #include "limSendMessages.h" |
| 45 | #include "limSerDesUtils.h" |
| 46 | #include "limAdmitControl.h" |
| 47 | #include "limStaHashApi.h" |
| 48 | #include "dot11f.h" |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 49 | #include "dot11fdefs.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 50 | #include "wmmApsd.h" |
| 51 | #include "limTrace.h" |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 52 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | #include "vos_diag_core_event.h" |
| 54 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 55 | #include "limIbssPeerMgmt.h" |
| 56 | #include "limSessionUtils.h" |
| 57 | #include "limSession.h" |
| 58 | #include "vos_nvitem.h" |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 59 | #ifdef WLAN_FEATURE_11W |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 60 | #include "wniCfg.h" |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 61 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | |
| 63 | /* Static global used to mark situations where pMac->lim.gLimTriggerBackgroundScanDuringQuietBss is SET |
| 64 | * and limTriggerBackgroundScanDuringQuietBss() returned failure. In this case, we will stop data |
| 65 | * traffic instead of going into scan. The recover function limProcessQuietBssTimeout() needs to have |
| 66 | * this information. */ |
| 67 | static tAniBool glimTriggerBackgroundScanDuringQuietBss_Status = eSIR_TRUE; |
| 68 | |
| 69 | /* 11A Channel list to decode RX BD channel information */ |
| 70 | static const tANI_U8 abChannel[]= {36,40,44,48,52,56,60,64,100,104,108,112,116, |
Arif Hussain | 6af3862 | 2014-03-12 12:39:57 -0700 | [diff] [blame] | 71 | 120,124,128,132,136,140,149,153,157,161,165,144}; |
Manjunathappa Prakash | eb5a3a3 | 2014-02-13 19:57:55 -0800 | [diff] [blame] | 72 | #define abChannelSize (sizeof(abChannel)/ \ |
| 73 | sizeof(abChannel[0])) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 74 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 75 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 76 | static const tANI_U8 aUnsortedChannelList[]= {52,56,60,64,100,104,108,112,116, |
Arif Hussain | 6af3862 | 2014-03-12 12:39:57 -0700 | [diff] [blame] | 77 | 120,124,128,132,136,140,36,40,44,48,149,153,157,161,165,144}; |
Manjunathappa Prakash | eb5a3a3 | 2014-02-13 19:57:55 -0800 | [diff] [blame] | 78 | #define aUnsortedChannelListSize (sizeof(aUnsortedChannelList)/ \ |
| 79 | sizeof(aUnsortedChannelList[0])) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 80 | #endif |
| 81 | |
Arif Hussain | 6af3862 | 2014-03-12 12:39:57 -0700 | [diff] [blame] | 82 | //#define LIM_MAX_ACTIVE_SESSIONS 3 //defined temporarily for BT-AMP SUPPORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 83 | #define SUCCESS 1 //defined temporarily for BT-AMP |
| 84 | |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 85 | #define MAX_BA_WINDOW_SIZE_FOR_CISCO 25 |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame] | 86 | #define MAX_DTIM_PERIOD 15 |
| 87 | #define MAX_DTIM_COUNT 15 |
| 88 | #define DTIM_PERIOD_DEFAULT 1 |
| 89 | #define DTIM_COUNT_DEFAULT 1 |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 90 | static void |
| 91 | limProcessChannelSwitchSuspendLink(tpAniSirGlobal pMac, |
| 92 | eHalStatus status, |
| 93 | tANI_U32 *ctx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | /** ------------------------------------------------------------- |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 95 | \fn limCheck11BRateBitmap |
| 96 | \brief Verifies if basic rates are set. |
| 97 | \param tANI_U16 pRateBitmap |
| 98 | \return tANI_BOOLEAN - true or false |
| 99 | -------------------------------------------------------------*/ |
| 100 | |
| 101 | tANI_BOOLEAN limCheck11BRateBitmap(tANI_U16 pRateBitmap) |
| 102 | { |
| 103 | return ( ( pRateBitmap & ( 1 << 0 ) ) || ( pRateBitmap & ( 1 << 1 ) ) || |
| 104 | ( pRateBitmap & ( 1 << 2 ) ) || |
| 105 | ( pRateBitmap & ( 1 << 3 ) ) ? 1 : 0 ) ; |
| 106 | } |
| 107 | |
| 108 | /** ------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | \fn limAssignDialogueToken |
| 110 | \brief Assigns dialogue token. |
| 111 | \param tpAniSirGlobal pMac |
| 112 | \return tpDialogueToken - dialogueToken data structure. |
| 113 | -------------------------------------------------------------*/ |
| 114 | |
| 115 | tpDialogueToken |
| 116 | limAssignDialogueToken(tpAniSirGlobal pMac) |
| 117 | { |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 118 | static tANI_U8 token; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 119 | tpDialogueToken pCurrNode; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 120 | pCurrNode = vos_mem_malloc(sizeof(tDialogueToken)); |
| 121 | if ( NULL == pCurrNode ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 122 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 123 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 124 | return NULL; |
| 125 | } |
| 126 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 127 | vos_mem_set((void *) pCurrNode, sizeof(tDialogueToken), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | //first node in the list is being added. |
| 129 | if(NULL == pMac->lim.pDialogueTokenHead) |
| 130 | { |
| 131 | pMac->lim.pDialogueTokenHead = pMac->lim.pDialogueTokenTail = pCurrNode; |
| 132 | } |
| 133 | else |
| 134 | { |
| 135 | pMac->lim.pDialogueTokenTail->next = pCurrNode; |
| 136 | pMac->lim.pDialogueTokenTail = pCurrNode; |
| 137 | } |
| 138 | //assocId and tid of the node will be filled in by caller. |
| 139 | pCurrNode->next = NULL; |
| 140 | pCurrNode->token = token++; |
Praveen Kumar Sirisilla | 539f742 | 2013-08-28 17:01:05 -0700 | [diff] [blame] | 141 | |
| 142 | /* Dialog token should be a non-zero value */ |
| 143 | if (0 == pCurrNode->token) |
| 144 | pCurrNode->token = token; |
| 145 | |
| 146 | PELOG4(limLog(pMac, LOG4, FL("token assigned = %d"), pCurrNode->token);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 147 | return pCurrNode; |
| 148 | } |
| 149 | |
| 150 | /** ------------------------------------------------------------- |
| 151 | \fn limSearchAndDeleteDialogueToken |
| 152 | \brief search dialogue token in the list and deletes it if found. returns failure if not found. |
| 153 | \param tpAniSirGlobal pMac |
| 154 | \param tANI_U8 token |
| 155 | \param tANI_U16 assocId |
| 156 | \param tANI_U16 tid |
| 157 | \return eSirRetStatus - status of the search |
| 158 | -------------------------------------------------------------*/ |
| 159 | |
| 160 | |
| 161 | tSirRetStatus |
| 162 | limSearchAndDeleteDialogueToken(tpAniSirGlobal pMac, tANI_U8 token, tANI_U16 assocId, tANI_U16 tid) |
| 163 | { |
| 164 | tpDialogueToken pCurrNode = pMac->lim.pDialogueTokenHead; |
| 165 | tpDialogueToken pPrevNode = pMac->lim.pDialogueTokenHead; |
| 166 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 167 | /* if the list is empty */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 168 | if(NULL == pCurrNode) |
| 169 | return eSIR_FAILURE; |
| 170 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 171 | /* If the matching node is the first node.*/ |
| 172 | if ((token == pCurrNode->token) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 173 | (assocId == pCurrNode->assocId) && |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 174 | (tid == pCurrNode->tid)) { |
| 175 | pMac->lim.pDialogueTokenHead = pCurrNode->next; |
| 176 | /* There was only one node in the list. |
| 177 | * So tail pointer also needs to be adjusted. |
| 178 | */ |
| 179 | if (NULL == pMac->lim.pDialogueTokenHead) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 180 | pMac->lim.pDialogueTokenTail = NULL; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 181 | vos_mem_free(pCurrNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 182 | return eSIR_SUCCESS; |
| 183 | } |
| 184 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 185 | /* first node did not match. so move to the next one. */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 186 | pCurrNode = pCurrNode->next; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 188 | while (NULL != pCurrNode) { |
| 189 | if ((token == pCurrNode->token) && |
| 190 | (assocId == pCurrNode->assocId) && |
| 191 | (tid == pCurrNode->tid)) { |
| 192 | break; |
| 193 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 194 | pPrevNode = pCurrNode; |
| 195 | pCurrNode = pCurrNode->next; |
| 196 | } |
| 197 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 198 | if (pCurrNode) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | pPrevNode->next = pCurrNode->next; |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 200 | /* if the node being deleted is the last one |
| 201 | * then we also need to move the tail pointer |
| 202 | * to the prevNode. |
| 203 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 204 | if(NULL == pCurrNode->next) |
| 205 | pMac->lim.pDialogueTokenTail = pPrevNode; |
Kiet Lam | 842c3e1 | 2013-11-16 22:40:57 +0530 | [diff] [blame] | 206 | vos_mem_free(pCurrNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 207 | return eSIR_SUCCESS; |
| 208 | } |
| 209 | |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 210 | limLog(pMac, LOGW, |
| 211 | FL("LIM does not have matching dialogue token node")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 212 | return eSIR_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | |
| 216 | /** ------------------------------------------------------------- |
| 217 | \fn limDeleteDialogueTokenList |
| 218 | \brief deletes the complete lim dialogue token linked list. |
| 219 | \param tpAniSirGlobal pMac |
| 220 | \return None |
| 221 | -------------------------------------------------------------*/ |
| 222 | void |
| 223 | limDeleteDialogueTokenList(tpAniSirGlobal pMac) |
| 224 | { |
| 225 | tpDialogueToken pCurrNode = pMac->lim.pDialogueTokenHead; |
| 226 | |
| 227 | while(NULL != pMac->lim.pDialogueTokenHead) |
| 228 | { |
| 229 | pCurrNode = pMac->lim.pDialogueTokenHead; |
| 230 | pMac->lim.pDialogueTokenHead = pMac->lim.pDialogueTokenHead->next; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 231 | vos_mem_free(pCurrNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 232 | pCurrNode = NULL; |
| 233 | } |
| 234 | pMac->lim.pDialogueTokenTail = NULL; |
| 235 | } |
| 236 | |
| 237 | void |
| 238 | limGetBssidFromBD(tpAniSirGlobal pMac, tANI_U8 * pRxPacketInfo, tANI_U8 *bssId, tANI_U32 *pIgnore) |
| 239 | { |
| 240 | tpSirMacDataHdr3a pMh = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo); |
| 241 | *pIgnore = 0; |
| 242 | |
| 243 | if (pMh->fc.toDS == 1 && pMh->fc.fromDS == 0) |
| 244 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 245 | vos_mem_copy( bssId, pMh->addr1, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 246 | *pIgnore = 1; |
| 247 | } |
| 248 | else if (pMh->fc.toDS == 0 && pMh->fc.fromDS == 1) |
| 249 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 250 | vos_mem_copy ( bssId, pMh->addr2, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 251 | *pIgnore = 1; |
| 252 | } |
| 253 | else if (pMh->fc.toDS == 0 && pMh->fc.fromDS == 0) |
| 254 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 255 | vos_mem_copy( bssId, pMh->addr3, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | *pIgnore = 0; |
| 257 | } |
| 258 | else |
| 259 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 260 | vos_mem_copy( bssId, pMh->addr1, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | *pIgnore = 1; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | char * |
| 266 | limMlmStateStr(tLimMlmStates state) |
| 267 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 268 | switch (state) |
| 269 | { |
| 270 | case eLIM_MLM_OFFLINE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 271 | return "eLIM_MLM_OFFLINE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | case eLIM_MLM_IDLE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 273 | return "eLIM_MLM_IDLE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 274 | case eLIM_MLM_WT_PROBE_RESP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 275 | return "eLIM_MLM_WT_PROBE_RESP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 276 | case eLIM_MLM_PASSIVE_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 277 | return "eLIM_MLM_PASSIVE_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | case eLIM_MLM_WT_JOIN_BEACON_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 279 | return "eLIM_MLM_WT_JOIN_BEACON_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | case eLIM_MLM_JOINED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 281 | return "eLIM_MLM_JOINED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | case eLIM_MLM_BSS_STARTED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 283 | return "eLIM_MLM_BSS_STARTED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | case eLIM_MLM_WT_AUTH_FRAME2_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 285 | return "eLIM_MLM_WT_AUTH_FRAME2_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 286 | case eLIM_MLM_WT_AUTH_FRAME3_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 287 | return "eLIM_MLM_WT_AUTH_FRAME3_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 288 | case eLIM_MLM_WT_AUTH_FRAME4_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 289 | return "eLIM_MLM_WT_AUTH_FRAME4_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | case eLIM_MLM_AUTH_RSP_TIMEOUT_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 291 | return "eLIM_MLM_AUTH_RSP_TIMEOUT_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | case eLIM_MLM_AUTHENTICATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 293 | return "eLIM_MLM_AUTHENTICATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | case eLIM_MLM_WT_ASSOC_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 295 | return "eLIM_MLM_WT_ASSOC_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 296 | case eLIM_MLM_WT_REASSOC_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 297 | return "eLIM_MLM_WT_REASSOC_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 298 | case eLIM_MLM_WT_FT_REASSOC_RSP_STATE: |
| 299 | return "eLIM_MLM_WT_FT_REASSOC_RSP_STATE"; |
| 300 | case eLIM_MLM_WT_DEL_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 301 | return "eLIM_MLM_WT_DEL_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 302 | case eLIM_MLM_WT_DEL_BSS_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 303 | return "eLIM_MLM_WT_DEL_BSS_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 304 | case eLIM_MLM_WT_ADD_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 305 | return "eLIM_MLM_WT_ADD_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | case eLIM_MLM_WT_ADD_BSS_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 307 | return "eLIM_MLM_WT_ADD_BSS_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 308 | case eLIM_MLM_REASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 309 | return "eLIM_MLM_REASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 310 | case eLIM_MLM_LINK_ESTABLISHED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 311 | return "eLIM_MLM_LINK_ESTABLISHED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | case eLIM_MLM_WT_ASSOC_CNF_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 313 | return "eLIM_MLM_WT_ASSOC_CNF_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 314 | case eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 315 | return "eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 316 | case eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 317 | return "eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | case eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE: |
| 319 | return "eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE"; |
| 320 | case eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 321 | return "eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 322 | case eLIM_MLM_WT_SET_BSS_KEY_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 323 | return "eLIM_MLM_WT_SET_BSS_KEY_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 324 | case eLIM_MLM_WT_SET_STA_KEY_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 325 | return "eLIM_MLM_WT_SET_STA_KEY_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 327 | return "INVALID MLM state"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | void |
| 332 | limPrintMlmState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimMlmStates state) |
| 333 | { |
| 334 | limLog(pMac, logLevel, limMlmStateStr(state)); |
| 335 | } |
| 336 | |
| 337 | char * |
| 338 | limSmeStateStr(tLimSmeStates state) |
| 339 | { |
| 340 | #ifdef FIXME_GEN6 |
| 341 | switch (state) |
| 342 | { |
| 343 | case eLIM_SME_OFFLINE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 344 | return "eLIM_SME_OFFLINE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | case eLIM_SME_IDLE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 346 | return "eLIM_SME_IDLE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 347 | case eLIM_SME_SUSPEND_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 348 | return "eLIM_SME_SUSPEND_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | case eLIM_SME_WT_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 350 | return "eLIM_SME_WT_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 351 | case eLIM_SME_WT_JOIN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 352 | return "eLIM_SME_WT_JOIN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | case eLIM_SME_WT_AUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 354 | return "eLIM_SME_WT_AUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | case eLIM_SME_WT_ASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 356 | return "eLIM_SME_WT_ASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | case eLIM_SME_WT_REASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 358 | return "eLIM_SME_WT_REASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 360 | return "eLIM_SME_WT_REASSOC_LINK_FAIL_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 361 | case eLIM_SME_JOIN_FAILURE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 362 | return "eLIM_SME_JOIN_FAILURE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 363 | case eLIM_SME_ASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 364 | return "eLIM_SME_ASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | case eLIM_SME_REASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 366 | return "eLIM_SME_REASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 367 | case eLIM_SME_LINK_EST_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 368 | return "eLIM_SME_LINK_EST_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | case eLIM_SME_LINK_EST_WT_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 370 | return "eLIM_SME_LINK_EST_WT_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 371 | case eLIM_SME_WT_PRE_AUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 372 | return "eLIM_SME_WT_PRE_AUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | case eLIM_SME_WT_DISASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 374 | return "eLIM_SME_WT_DISASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 375 | case eLIM_SME_WT_DEAUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 376 | return "eLIM_SME_WT_DEAUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 377 | case eLIM_SME_WT_START_BSS_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 378 | return "eLIM_SME_WT_START_BSS_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | case eLIM_SME_WT_STOP_BSS_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 380 | return "eLIM_SME_WT_STOP_BSS_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | case eLIM_SME_NORMAL_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 382 | return "eLIM_SME_NORMAL_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | case eLIM_SME_CHANNEL_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 384 | return "eLIM_SME_CHANNEL_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 385 | case eLIM_SME_NORMAL_CHANNEL_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 386 | return "eLIM_SME_NORMAL_CHANNEL_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 387 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 388 | return "INVALID SME state"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 389 | } |
| 390 | #endif |
| 391 | return ""; |
| 392 | } |
| 393 | |
| 394 | |
| 395 | char* limDot11ModeStr(tpAniSirGlobal pMac, tANI_U8 dot11Mode) |
| 396 | { |
| 397 | #ifdef FIXME_GEN6 |
| 398 | |
| 399 | switch(dot11Mode) |
| 400 | { |
| 401 | case WNI_CFG_DOT11_MODE_ALL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 402 | return "ALL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | case WNI_CFG_DOT11_MODE_11A: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 404 | return "11A"; |
| 405 | case WNI_CFG_DOT11_MODE_11B: |
| 406 | return "11B"; |
| 407 | case WNI_CFG_DOT11_MODE_11G: |
| 408 | return "11G"; |
| 409 | case WNI_CFG_DOT11_MODE_11N: |
| 410 | return "11N"; |
| 411 | case WNI_CFG_DOT11_MODE_POLARIS: |
| 412 | return "Polaris"; |
| 413 | case WNI_CFG_DOT11_MODE_TITAN: |
| 414 | return "Titan"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | case WNI_CFG_DOT11_MODE_TAURUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 416 | return "Taurus"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 417 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 418 | return "Invalid Dot11 Mode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 419 | } |
| 420 | #endif |
| 421 | return ""; |
| 422 | } |
| 423 | |
| 424 | |
| 425 | char* limStaOpRateModeStr(tStaRateMode opRateMode) |
| 426 | { |
| 427 | #ifdef FIXME_GEN6 |
| 428 | |
| 429 | switch(opRateMode) |
| 430 | { |
| 431 | case eSTA_TAURUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 432 | return "Taurus"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 433 | case eSTA_11a: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 434 | return "11A"; |
| 435 | case eSTA_11b: |
| 436 | return "11B"; |
| 437 | case eSTA_11bg: |
| 438 | return "11G"; |
| 439 | case eSTA_11n: |
| 440 | return "11N"; |
| 441 | case eSTA_POLARIS: |
| 442 | return "Polaris"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 443 | case eSTA_TITAN: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 444 | return "Titan"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 445 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 446 | return "Invalid Dot11 Mode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 447 | } |
| 448 | #endif |
| 449 | return ""; |
| 450 | } |
| 451 | |
| 452 | char* limBssTypeStr(tSirBssType bssType) |
| 453 | { |
| 454 | switch(bssType) |
| 455 | { |
| 456 | case eSIR_INFRASTRUCTURE_MODE: |
| 457 | return "eSIR_INFRASTRUCTURE_MODE"; |
| 458 | case eSIR_IBSS_MODE: |
| 459 | return "eSIR_IBSS_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 460 | case eSIR_BTAMP_STA_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 461 | return "eSIR_BTAMP_STA_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 462 | case eSIR_BTAMP_AP_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | return "eSIR_BTAMP_AP_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 464 | case eSIR_AUTO_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 465 | return "eSIR_AUTO_MODE"; |
| 466 | default: |
| 467 | return "Invalid BSS Type"; |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | void |
| 472 | limPrintSmeState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimSmeStates state) |
| 473 | { |
| 474 | limLog(pMac, logLevel, limSmeStateStr(state)); |
| 475 | } |
| 476 | |
| 477 | char *limMsgStr(tANI_U32 msgType) |
| 478 | { |
| 479 | #ifdef FIXME_GEN6 |
| 480 | switch (msgType) |
| 481 | { |
| 482 | case eWNI_SME_START_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 483 | return "eWNI_SME_START_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | case eWNI_SME_START_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 485 | return "eWNI_SME_START_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | case eWNI_SME_SYS_READY_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 487 | return "eWNI_SME_SYS_READY_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 488 | case eWNI_SME_SCAN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 489 | return "eWNI_SME_SCAN_REQ"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 490 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 491 | case eWNI_SME_OEM_DATA_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 492 | return "eWNI_SME_OEM_DATA_REQ"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 493 | case eWNI_SME_OEM_DATA_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 494 | return "eWNI_SME_OEM_DATA_RSP"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 495 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 496 | case eWNI_SME_SCAN_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 497 | return "eWNI_SME_SCAN_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 498 | case eWNI_SME_JOIN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 499 | return "eWNI_SME_JOIN_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 500 | case eWNI_SME_JOIN_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 501 | return "eWNI_SME_JOIN_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | case eWNI_SME_SETCONTEXT_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 503 | return "eWNI_SME_SETCONTEXT_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | case eWNI_SME_SETCONTEXT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 505 | return "eWNI_SME_SETCONTEXT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | case eWNI_SME_REASSOC_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 507 | return "eWNI_SME_REASSOC_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 508 | case eWNI_SME_REASSOC_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 509 | return "eWNI_SME_REASSOC_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | case eWNI_SME_AUTH_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 511 | return "eWNI_SME_AUTH_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 512 | case eWNI_SME_AUTH_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 513 | return "eWNI_SME_AUTH_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 514 | case eWNI_SME_DISASSOC_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 515 | return "eWNI_SME_DISASSOC_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 516 | case eWNI_SME_DISASSOC_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 517 | return "eWNI_SME_DISASSOC_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 518 | case eWNI_SME_DISASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 519 | return "eWNI_SME_DISASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 520 | case eWNI_SME_DISASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 521 | return "eWNI_SME_DISASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | case eWNI_SME_DEAUTH_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 523 | return "eWNI_SME_DEAUTH_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | case eWNI_SME_DEAUTH_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 525 | return "eWNI_SME_DEAUTH_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | case eWNI_SME_DEAUTH_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 527 | return "eWNI_SME_DEAUTH_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 528 | case eWNI_SME_WM_STATUS_CHANGE_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 529 | return "eWNI_SME_WM_STATUS_CHANGE_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | case eWNI_SME_START_BSS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 531 | return "eWNI_SME_START_BSS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 532 | case eWNI_SME_START_BSS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 533 | return "eWNI_SME_START_BSS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 534 | case eWNI_SME_AUTH_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 535 | return "eWNI_SME_AUTH_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | case eWNI_SME_ASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 537 | return "eWNI_SME_ASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 538 | case eWNI_SME_ASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 539 | return "eWNI_SME_ASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 540 | case eWNI_SME_REASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 541 | return "eWNI_SME_REASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 542 | case eWNI_SME_REASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 543 | return "eWNI_SME_REASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 544 | case eWNI_SME_SWITCH_CHL_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 545 | return "eWNI_SME_SWITCH_CHL_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | case eWNI_SME_SWITCH_CHL_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 547 | return "eWNI_SME_SWITCH_CHL_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 549 | return "eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 550 | case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 551 | return "eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 552 | case eWNI_SME_STOP_BSS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 553 | return "eWNI_SME_STOP_BSS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 554 | case eWNI_SME_STOP_BSS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 555 | return "eWNI_SME_STOP_BSS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 556 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 557 | return "eWNI_SME_PROMISCUOUS_MODE_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 558 | case eWNI_SME_PROMISCUOUS_MODE_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 559 | return "eWNI_SME_PROMISCUOUS_MODE_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | case eWNI_SME_NEIGHBOR_BSS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 561 | return "eWNI_SME_NEIGHBOR_BSS_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 562 | case eWNI_SME_MEASUREMENT_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 563 | return "eWNI_SME_MEASUREMENT_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 564 | case eWNI_SME_MEASUREMENT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 565 | return "eWNI_SME_MEASUREMENT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 566 | case eWNI_SME_MEASUREMENT_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 567 | return "eWNI_SME_MEASUREMENT_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 568 | case eWNI_SME_SET_WDS_INFO_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 569 | return "eWNI_SME_SET_WDS_INFO_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 570 | case eWNI_SME_SET_WDS_INFO_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 571 | return "eWNI_SME_SET_WDS_INFO_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 572 | case eWNI_SME_WDS_INFO_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 573 | return "eWNI_SME_WDS_INFO_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | case eWNI_SME_DEAUTH_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 575 | return "eWNI_SME_DEAUTH_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 576 | case eWNI_SME_MIC_FAILURE_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 577 | return "eWNI_SME_MIC_FAILURE_IND"; |
Sachin Ahuja | 3d47fcd | 2015-08-28 16:02:06 +0530 | [diff] [blame] | 578 | case eWNI_SME_LOST_LINK_PARAMS_IND: |
| 579 | return "eWNI_SME_LOST_LINK_PARAMS_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 580 | case eWNI_SME_ADDTS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 581 | return "eWNI_SME_ADDTS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 582 | case eWNI_SME_ADDTS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 583 | return "eWNI_SME_ADDTS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 584 | case eWNI_SME_ADDTS_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 585 | return "eWNI_SME_ADDTS_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 586 | case eWNI_SME_ADDTS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 587 | return "eWNI_SME_ADDTS_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 588 | case eWNI_SME_DELTS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 589 | return "eWNI_SME_DELTS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 590 | case eWNI_SME_DELTS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 591 | return "eWNI_SME_DELTS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 592 | case eWNI_SME_DELTS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 593 | return "eWNI_SME_DELTS_IND"; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 594 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 595 | case eWNI_SME_GET_ROAM_RSSI_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 596 | return "eWNI_SME_GET_ROAM_RSSI_REQ"; |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 597 | case eWNI_SME_GET_ROAM_RSSI_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 598 | return "eWNI_SME_GET_ROAM_RSSI_RSP"; |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 599 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 600 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 601 | case WDA_SUSPEND_ACTIVITY_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 602 | return "WDA_SUSPEND_ACTIVITY_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 604 | return "SIR_LIM_RETRY_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 605 | case SIR_BB_XPORT_MGMT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 606 | return "SIR_BB_XPORT_MGMT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 607 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 608 | return "SIR_LIM_INV_KEY_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 610 | return "SIR_LIM_KEY_ID_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 612 | return "SIR_LIM_REPLAY_THRES_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 613 | case SIR_LIM_MIN_CHANNEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 614 | return "SIR_LIM_MIN_CHANNEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 615 | case SIR_LIM_MAX_CHANNEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 616 | return "SIR_LIM_MAX_CHANNEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 617 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 618 | return "SIR_LIM_JOIN_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 619 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 620 | return "SIR_LIM_AUTH_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 621 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 622 | return "SIR_LIM_AUTH_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 623 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 624 | return "SIR_LIM_ASSOC_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 625 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 626 | return "SIR_LIM_REASSOC_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 627 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 628 | return "SIR_LIM_HEART_BEAT_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 630 | return "SIR_LIM_ADDTS_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 631 | case SIR_LIM_CHANNEL_SCAN_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 632 | return "SIR_LIM_CHANNEL_SCAN_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 633 | case SIR_LIM_LINK_TEST_DURATION_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 634 | return "SIR_LIM_LINK_TEST_DURATION_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 635 | case SIR_LIM_KEEPALIVE_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 636 | return "SIR_LIM_KEEPALIVE_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 637 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 638 | return "SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 639 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 640 | return "SIR_LIM_CNF_WAIT_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 641 | case SIR_LIM_RADAR_DETECT_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 642 | return "SIR_LIM_RADAR_DETECT_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 643 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 644 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 645 | return "SIR_LIM_FT_PREAUTH_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 646 | #endif |
| 647 | |
| 648 | case SIR_HAL_APP_SETUP_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 649 | return "SIR_HAL_APP_SETUP_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 650 | case SIR_HAL_INITIAL_CAL_FAILED_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 651 | return "SIR_HAL_INITIAL_CAL_FAILED_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | case SIR_HAL_NIC_OPER_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 653 | return "SIR_HAL_NIC_OPER_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 654 | case SIR_HAL_INIT_START_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 655 | return "SIR_HAL_INIT_START_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 656 | case SIR_HAL_SHUTDOWN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 657 | return "SIR_HAL_SHUTDOWN_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 658 | case SIR_HAL_SHUTDOWN_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 659 | return "SIR_HAL_SHUTDOWN_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 660 | case SIR_HAL_RESET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 661 | return "SIR_HAL_RESET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 662 | case SIR_HAL_RESET_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 663 | return "SIR_HAL_RESET_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 664 | case SIR_WRITE_TO_TD: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 665 | return "SIR_WRITE_TO_TD"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 666 | |
| 667 | case WNI_CFG_PARAM_UPDATE_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 668 | return "WNI_CFG_PARAM_UPDATE_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | case WNI_CFG_DNLD_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 670 | return "WNI_CFG_DNLD_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 671 | case WNI_CFG_DNLD_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 672 | return "WNI_CFG_DNLD_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | case WNI_CFG_GET_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 674 | return "WNI_CFG_GET_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 675 | case WNI_CFG_SET_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 676 | return "WNI_CFG_SET_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | case WNI_CFG_GET_ATTRIB_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 678 | return "WNI_CFG_GET_ATTRIB_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 679 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 680 | return "WNI_CFG_ADD_GRP_ADDR_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 681 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 682 | return "WNI_CFG_DEL_GRP_ADDR_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 683 | case ANI_CFG_GET_RADIO_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 684 | return "ANI_CFG_GET_RADIO_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | case ANI_CFG_GET_PER_STA_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 686 | return "ANI_CFG_GET_PER_STA_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | case ANI_CFG_GET_AGG_STA_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 688 | return "ANI_CFG_GET_AGG_STA_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 689 | case ANI_CFG_CLEAR_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 690 | return "ANI_CFG_CLEAR_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 691 | case WNI_CFG_DNLD_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 692 | return "WNI_CFG_DNLD_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | case WNI_CFG_GET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 694 | return "WNI_CFG_GET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 695 | case WNI_CFG_SET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 696 | return "WNI_CFG_SET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 697 | case WNI_CFG_SET_REQ_NO_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 698 | return "WNI_CFG_SET_REQ_NO_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | case eWNI_PMC_ENTER_IMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 700 | return "eWNI_PMC_ENTER_IMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 701 | case eWNI_PMC_EXIT_IMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 702 | return "eWNI_PMC_EXIT_IMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 703 | case eWNI_PMC_ENTER_BMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 704 | return "eWNI_PMC_ENTER_BMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | case eWNI_PMC_EXIT_BMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 706 | return "eWNI_PMC_EXIT_BMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 707 | case eWNI_PMC_EXIT_BMPS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 708 | return "eWNI_PMC_EXIT_BMPS_IND"; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 709 | case eWNI_SME_SET_BCN_FILTER_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 710 | return "eWNI_SME_SET_BCN_FILTER_REQ"; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 711 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 712 | case eWNI_SME_GET_TSM_STATS_REQ: |
| 713 | return "eWNI_SME_GET_TSM_STATS_REQ"; |
| 714 | case eWNI_SME_GET_TSM_STATS_RSP: |
| 715 | return "eWNI_SME_GET_TSM_STATS_RSP"; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 716 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 717 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 718 | return "INVALID SME message"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 719 | } |
| 720 | #endif |
| 721 | return ""; |
| 722 | } |
| 723 | |
| 724 | |
| 725 | |
| 726 | char *limResultCodeStr(tSirResultCodes resultCode) |
| 727 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | switch (resultCode) |
| 729 | { |
| 730 | case eSIR_SME_SUCCESS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 731 | return "eSIR_SME_SUCCESS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | case eSIR_EOF_SOF_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 733 | return "eSIR_EOF_SOF_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | case eSIR_BMU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 735 | return "eSIR_BMU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | case eSIR_LOW_PDU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 737 | return "eSIR_LOW_PDU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | case eSIR_USER_TRIG_RESET: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 739 | return"eSIR_USER_TRIG_RESET"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | case eSIR_LOGP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 741 | return "eSIR_LOGP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | case eSIR_CP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 743 | return "eSIR_CP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 744 | case eSIR_STOP_BSS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 745 | return "eSIR_STOP_BSS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 746 | case eSIR_AHB_HANG_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 747 | return "eSIR_AHB_HANG_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 748 | case eSIR_DPU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 749 | return "eSIR_DPU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 750 | case eSIR_RXP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 751 | return "eSIR_RXP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 752 | case eSIR_MCPU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 753 | return "eSIR_MCPU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | case eSIR_MCU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 755 | return "eSIR_MCU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 756 | case eSIR_MTU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 757 | return "eSIR_MTU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 758 | case eSIR_MIF_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 759 | return "eSIR_MIF_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 760 | case eSIR_FW_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 761 | return "eSIR_FW_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 762 | case eSIR_MAILBOX_SANITY_CHK_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 763 | return "eSIR_MAILBOX_SANITY_CHK_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | case eSIR_RADIO_HW_SWITCH_STATUS_IS_OFF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 765 | return "eSIR_RADIO_HW_SWITCH_STATUS_IS_OFF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | case eSIR_CFB_FLAG_STUCK_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 767 | return "eSIR_CFB_FLAG_STUCK_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | case eSIR_SME_BASIC_RATES_NOT_SUPPORTED_STATUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 769 | return "eSIR_SME_BASIC_RATES_NOT_SUPPORTED_STATUS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | case eSIR_SME_INVALID_PARAMETERS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 771 | return "eSIR_SME_INVALID_PARAMETERS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 772 | case eSIR_SME_UNEXPECTED_REQ_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 773 | return "eSIR_SME_UNEXPECTED_REQ_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | case eSIR_SME_RESOURCES_UNAVAILABLE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 775 | return "eSIR_SME_RESOURCES_UNAVAILABLE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | case eSIR_SME_SCAN_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 777 | return "eSIR_SME_SCAN_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 778 | case eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 779 | return "eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 780 | case eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 781 | return "eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 782 | case eSIR_SME_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 783 | return "eSIR_SME_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 784 | case eSIR_SME_JOIN_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 785 | return "eSIR_SME_JOIN_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | case eSIR_SME_AUTH_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 787 | return "eSIR_SME_AUTH_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 788 | case eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 789 | return "eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 790 | case eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 791 | return "eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 792 | case eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 793 | return "eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 794 | case eSIR_SME_AUTH_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 795 | return "eSIR_SME_AUTH_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 796 | case eSIR_SME_INVALID_WEP_DEFAULT_KEY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 797 | return "eSIR_SME_INVALID_WEP_DEFAULT_KEY"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 798 | case eSIR_SME_ASSOC_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 799 | return "eSIR_SME_ASSOC_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 800 | case eSIR_SME_REASSOC_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 801 | return "eSIR_SME_REASSOC_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 802 | case eSIR_SME_STA_NOT_AUTHENTICATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 803 | return "eSIR_SME_STA_NOT_AUTHENTICATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 804 | case eSIR_SME_STA_NOT_ASSOCIATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 805 | return "eSIR_SME_STA_NOT_ASSOCIATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 806 | case eSIR_SME_STA_DISASSOCIATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 807 | return "eSIR_SME_STA_DISASSOCIATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 808 | case eSIR_SME_ALREADY_JOINED_A_BSS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 809 | return "eSIR_SME_ALREADY_JOINED_A_BSS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 810 | case eSIR_ULA_COMPLETED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 811 | return "eSIR_ULA_COMPLETED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 812 | case eSIR_ULA_FAILURE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 813 | return "eSIR_ULA_FAILURE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 814 | case eSIR_SME_LINK_ESTABLISHED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 815 | return "eSIR_SME_LINK_ESTABLISHED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 816 | case eSIR_SME_UNABLE_TO_PERFORM_MEASUREMENTS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 817 | return "eSIR_SME_UNABLE_TO_PERFORM_MEASUREMENTS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 818 | case eSIR_SME_UNABLE_TO_PERFORM_DFS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 819 | return "eSIR_SME_UNABLE_TO_PERFORM_DFS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 820 | case eSIR_SME_DFS_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 821 | return "eSIR_SME_DFS_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 822 | case eSIR_SME_TRANSFER_STA: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 823 | return "eSIR_SME_TRANSFER_STA"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 824 | case eSIR_SME_INVALID_LINK_TEST_PARAMETERS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 825 | return "eSIR_SME_INVALID_LINK_TEST_PARAMETERS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | case eSIR_SME_LINK_TEST_MAX_EXCEEDED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 827 | return "eSIR_SME_LINK_TEST_MAX_EXCEEDED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 828 | case eSIR_SME_UNSUPPORTED_RATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 829 | return "eSIR_SME_UNSUPPORTED_RATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 830 | case eSIR_SME_LINK_TEST_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 831 | return "eSIR_SME_LINK_TEST_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 832 | case eSIR_SME_LINK_TEST_COMPLETE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 833 | return "eSIR_SME_LINK_TEST_COMPLETE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 834 | case eSIR_SME_LINK_TEST_INVALID_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 835 | return "eSIR_SME_LINK_TEST_INVALID_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 836 | case eSIR_SME_LINK_TEST_INVALID_ADDRESS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 837 | return "eSIR_SME_LINK_TEST_INVALID_ADDRESS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 838 | case eSIR_SME_POLARIS_RESET: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 839 | return "eSIR_SME_POLARIS_RESET"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | case eSIR_SME_SETCONTEXT_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 841 | return "eSIR_SME_SETCONTEXT_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 842 | case eSIR_SME_BSS_RESTART: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 843 | return "eSIR_SME_BSS_RESTART"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | case eSIR_SME_MORE_SCAN_RESULTS_FOLLOW: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 845 | return "eSIR_SME_MORE_SCAN_RESULTS_FOLLOW"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | case eSIR_SME_INVALID_ASSOC_RSP_RXED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 847 | return "eSIR_SME_INVALID_ASSOC_RSP_RXED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 848 | case eSIR_SME_MIC_COUNTER_MEASURES: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 849 | return "eSIR_SME_MIC_COUNTER_MEASURES"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 850 | case eSIR_SME_ADDTS_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 851 | return "eSIR_SME_ADDTS_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 852 | case eSIR_SME_RECEIVED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 853 | return "eSIR_SME_RECEIVED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 854 | case eSIR_SME_CHANNEL_SWITCH_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 855 | return "eSIR_SME_CHANNEL_SWITCH_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 856 | #ifdef GEN4_SCAN |
| 857 | case eSIR_SME_CHANNEL_SWITCH_DISABLED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 858 | return "eSIR_SME_CHANNEL_SWITCH_DISABLED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 859 | case eSIR_SME_HAL_SCAN_INIT_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 860 | return "eSIR_SME_HAL_SCAN_INIT_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 861 | case eSIR_SME_HAL_SCAN_START_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 862 | return "eSIR_SME_HAL_SCAN_START_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 863 | case eSIR_SME_HAL_SCAN_END_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 864 | return "eSIR_SME_HAL_SCAN_END_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 865 | case eSIR_SME_HAL_SCAN_FINISH_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 866 | return "eSIR_SME_HAL_SCAN_FINISH_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 867 | case eSIR_SME_HAL_SEND_MESSAGE_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 868 | return "eSIR_SME_HAL_SEND_MESSAGE_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 869 | #else // GEN4_SCAN |
| 870 | case eSIR_SME_CHANNEL_SWITCH_DISABLED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 871 | return "eSIR_SME_CHANNEL_SWITCH_DISABLED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 872 | case eSIR_SME_HAL_SEND_MESSAGE_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 873 | return "eSIR_SME_HAL_SEND_MESSAGE_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 874 | #endif // GEN4_SCAN |
| 875 | |
| 876 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 877 | return "INVALID resultCode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 878 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 879 | } |
| 880 | |
| 881 | void |
| 882 | limPrintMsgName(tpAniSirGlobal pMac, tANI_U16 logLevel, tANI_U32 msgType) |
| 883 | { |
| 884 | limLog(pMac, logLevel, limMsgStr(msgType)); |
| 885 | } |
| 886 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 887 | void |
| 888 | limPrintMsgInfo(tpAniSirGlobal pMac, tANI_U16 logLevel, tSirMsgQ *msg) |
| 889 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 890 | if (logLevel <= pMac->utils.gLogDbgLevel[SIR_LIM_MODULE_ID - LOG_FIRST_MODULE_ID]) |
| 891 | { |
| 892 | switch (msg->type) |
| 893 | { |
| 894 | case SIR_BB_XPORT_MGMT_MSG: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 895 | limPrintMsgName(pMac, logLevel,msg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 896 | break; |
| 897 | default: |
| 898 | limPrintMsgName(pMac, logLevel,msg->type); |
| 899 | break; |
| 900 | } |
| 901 | } |
| 902 | } |
| 903 | |
| 904 | /** |
| 905 | * limInitMlm() |
| 906 | * |
| 907 | *FUNCTION: |
| 908 | * This function is called by limProcessSmeMessages() to |
| 909 | * initialize MLM state machine on STA |
| 910 | * |
| 911 | *PARAMS: |
| 912 | * |
| 913 | *LOGIC: |
| 914 | * |
| 915 | *ASSUMPTIONS: |
| 916 | * NA |
| 917 | * |
| 918 | *NOTE: |
| 919 | * NA |
| 920 | * |
| 921 | * @param pMac Pointer to Global MAC structure |
| 922 | * @return None |
| 923 | */ |
| 924 | void |
| 925 | limInitMlm(tpAniSirGlobal pMac) |
| 926 | { |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 927 | tANI_U32 retVal; |
| 928 | |
| 929 | pMac->lim.gLimTimersCreated = 0; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 930 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 931 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 932 | |
| 933 | /// Initialize scan result hash table |
| 934 | limReInitScanResults(pMac); //sep26th review |
| 935 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 936 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 937 | /// Initialize lfr scan result hash table |
| 938 | // Could there be a problem in multisession with SAP/P2P GO, when in the |
| 939 | // middle of FW bg scan, SAP started; Again that could be a problem even on |
| 940 | // infra + SAP/P2P GO too - TBD |
| 941 | limReInitLfrScanResults(pMac); |
| 942 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 943 | |
| 944 | /// Initialize number of pre-auth contexts |
| 945 | pMac->lim.gLimNumPreAuthContexts = 0; |
| 946 | |
| 947 | /// Initialize MAC based Authentication STA list |
| 948 | limInitPreAuthList(pMac); |
| 949 | |
| 950 | //pMac->lim.gpLimMlmJoinReq = NULL; |
| 951 | |
| 952 | if (pMac->lim.gLimTimersCreated) |
| 953 | return; |
| 954 | |
| 955 | // Create timers used by LIM |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 956 | retVal = limCreateTimers(pMac); |
| 957 | if(retVal == TX_SUCCESS) |
| 958 | { |
| 959 | pMac->lim.gLimTimersCreated = 1; |
| 960 | } |
| 961 | else |
| 962 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 963 | limLog(pMac, LOGP, FL(" limCreateTimers Failed to create lim timers ")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 964 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 965 | } /*** end limInitMlm() ***/ |
| 966 | |
| 967 | |
| 968 | |
| 969 | /** |
| 970 | * limCleanupMlm() |
| 971 | * |
| 972 | *FUNCTION: |
| 973 | * This function is called to cleanup any resources |
| 974 | * allocated by the MLM state machine. |
| 975 | * |
| 976 | *PARAMS: |
| 977 | * |
| 978 | *LOGIC: |
| 979 | * |
| 980 | *ASSUMPTIONS: |
| 981 | * NA |
| 982 | * |
| 983 | *NOTE: |
| 984 | * It is assumed that BSS is already informed that we're leaving it |
| 985 | * before this function is called. |
| 986 | * |
| 987 | * @param pMac Pointer to Global MAC structure |
| 988 | * @param None |
| 989 | * @return None |
| 990 | */ |
| 991 | void |
| 992 | limCleanupMlm(tpAniSirGlobal pMac) |
| 993 | { |
| 994 | tANI_U32 n; |
| 995 | tLimPreAuthNode *pAuthNode; |
Agarwal Ashish | 888ca02 | 2014-11-05 14:25:56 +0530 | [diff] [blame] | 996 | #ifdef WLAN_FEATURE_11W |
| 997 | tANI_U32 bss_entry, sta_entry; |
| 998 | tpDphHashNode pStaDs = NULL; |
| 999 | tpPESession psessionEntry = NULL; |
| 1000 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1001 | |
| 1002 | if (pMac->lim.gLimTimersCreated == 1) |
| 1003 | { |
| 1004 | // Deactivate and delete MIN/MAX channel timers. |
| 1005 | tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer); |
| 1006 | tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer); |
| 1007 | tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer); |
| 1008 | tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer); |
| 1009 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 1010 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 1011 | |
| 1012 | |
| 1013 | // Deactivate and delete channel switch timer. |
| 1014 | tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 1015 | tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 1016 | |
| 1017 | |
| 1018 | // Deactivate and delete addts response timer. |
| 1019 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 1020 | tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 1021 | |
| 1022 | // Deactivate and delete Join failure timer. |
| 1023 | tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 1024 | tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 1025 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1026 | // Deactivate and delete Periodic Join Probe Request timer. |
| 1027 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
| 1028 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
| 1029 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 1030 | // Deactivate and delete Auth Retry timer. |
| 1031 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer); |
| 1032 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicAuthRetryTimer); |
| 1033 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1034 | // Deactivate and delete Association failure timer. |
| 1035 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 1036 | tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 1037 | |
| 1038 | // Deactivate and delete Reassociation failure timer. |
| 1039 | tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer); |
| 1040 | tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer); |
| 1041 | |
| 1042 | // Deactivate and delete Authentication failure timer. |
| 1043 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 1044 | tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 1045 | |
| 1046 | // Deactivate and delete Heartbeat timer. |
| 1047 | tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1048 | tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1049 | |
| 1050 | // Deactivate and delete wait-for-probe-after-Heartbeat timer. |
| 1051 | tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 1052 | tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 1053 | |
| 1054 | // Deactivate and delete Quiet timer. |
| 1055 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer); |
| 1056 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer); |
| 1057 | |
| 1058 | // Deactivate and delete Quiet BSS timer. |
| 1059 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 1060 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 1061 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1062 | // Deactivate and delete LIM background scan timer. |
| 1063 | tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer); |
| 1064 | tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1065 | |
| 1066 | |
| 1067 | // Deactivate and delete cnf wait timer |
| 1068 | for (n = 0; n < pMac->lim.maxStation; n++) |
| 1069 | { |
| 1070 | tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[n]); |
| 1071 | tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[n]); |
| 1072 | } |
| 1073 | |
| 1074 | // Deactivate and delete keepalive timer |
| 1075 | tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer); |
| 1076 | tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer); |
| 1077 | |
| 1078 | pAuthNode = pMac->lim.gLimPreAuthTimerTable.pTable; |
| 1079 | |
| 1080 | //Deactivate any Authentication response timers |
| 1081 | limDeletePreAuthList(pMac); |
| 1082 | |
| 1083 | for (n = 0; n < pMac->lim.gLimPreAuthTimerTable.numEntry; n++,pAuthNode++) |
| 1084 | { |
| 1085 | // Delete any Authentication response |
| 1086 | // timers, which might have been started. |
| 1087 | tx_timer_delete(&pAuthNode->timer); |
| 1088 | } |
| 1089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1090 | tx_timer_deactivate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 1091 | tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 1092 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer); |
| 1093 | tx_timer_delete(&pMac->lim.limTimers.gLimPreAuthClnupTimer); |
| 1094 | |
| 1095 | #if 0 // The WPS PBC clean up timer is disabled |
| 1096 | if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) |
| 1097 | { |
| 1098 | if(pMac->lim.limTimers.gLimWPSOverlapTimerObj.isTimerCreated == eANI_BOOLEAN_TRUE) |
| 1099 | { |
| 1100 | tx_timer_deactivate(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer); |
| 1101 | tx_timer_delete(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer); |
| 1102 | pMac->lim.limTimers.gLimWPSOverlapTimerObj.isTimerCreated = eANI_BOOLEAN_FALSE; |
| 1103 | } |
| 1104 | } |
| 1105 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1106 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1107 | // Deactivate and delete FT Preauth response timer |
| 1108 | tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer); |
| 1109 | tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer); |
| 1110 | #endif |
| 1111 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1112 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1113 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1114 | // Deactivate and delete TSM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1115 | tx_timer_deactivate(&pMac->lim.limTimers.gLimEseTsmTimer); |
| 1116 | tx_timer_delete(&pMac->lim.limTimers.gLimEseTsmTimer); |
| 1117 | #endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1118 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1119 | tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer); |
| 1120 | tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer); |
| 1121 | |
| 1122 | tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer); |
| 1123 | tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer); |
| 1124 | |
Hoonki Lee | f63df0d | 2013-01-16 19:29:14 -0800 | [diff] [blame] | 1125 | tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer); |
| 1126 | tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer); |
Hoonki Lee | f63df0d | 2013-01-16 19:29:14 -0800 | [diff] [blame] | 1127 | |
Gopichand Nakkala | 0d6e4ad | 2013-05-17 02:30:25 +0530 | [diff] [blame] | 1128 | tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
| 1129 | tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
| 1130 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1131 | pMac->lim.gLimTimersCreated = 0; |
| 1132 | } |
| 1133 | |
Agarwal Ashish | 888ca02 | 2014-11-05 14:25:56 +0530 | [diff] [blame] | 1134 | #ifdef WLAN_FEATURE_11W |
| 1135 | /* |
| 1136 | * When SSR is triggered, we need to loop through |
| 1137 | * each STA associated per BSSId and deactivate/delete |
| 1138 | * the pmfSaQueryTimer for it |
| 1139 | */ |
| 1140 | if (vos_is_logp_in_progress(VOS_MODULE_ID_PE, NULL)) |
| 1141 | { |
| 1142 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
| 1143 | FL("SSR is detected, proceed to clean up pmfSaQueryTimer")); |
| 1144 | for (bss_entry = 0; bss_entry < pMac->lim.maxBssId; bss_entry++) |
| 1145 | { |
| 1146 | if (pMac->lim.gpSession[bss_entry].valid) |
| 1147 | { |
| 1148 | for (sta_entry = 1; sta_entry < pMac->lim.gLimAssocStaLimit; |
| 1149 | sta_entry++) |
| 1150 | { |
| 1151 | psessionEntry = &pMac->lim.gpSession[bss_entry]; |
| 1152 | pStaDs = dphGetHashEntry(pMac, sta_entry, |
| 1153 | &psessionEntry->dph.dphHashTable); |
| 1154 | if (NULL == pStaDs) |
| 1155 | { |
| 1156 | continue; |
| 1157 | } |
| 1158 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
| 1159 | FL("Deleting pmfSaQueryTimer for staid[%d]"), |
| 1160 | pStaDs->staIndex) ; |
| 1161 | tx_timer_deactivate(&pStaDs->pmfSaQueryTimer); |
| 1162 | tx_timer_delete(&pStaDs->pmfSaQueryTimer); |
| 1163 | } |
| 1164 | } |
| 1165 | } |
| 1166 | } |
| 1167 | #endif |
| 1168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1169 | /// Cleanup cached scan list |
| 1170 | limReInitScanResults(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1171 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1172 | /// Cleanup cached scan list |
| 1173 | limReInitLfrScanResults(pMac); |
| 1174 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1175 | |
| 1176 | } /*** end limCleanupMlm() ***/ |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | /** |
| 1181 | * limCleanupLmm() |
| 1182 | * |
| 1183 | *FUNCTION: |
| 1184 | * This function is called to cleanup any resources |
| 1185 | * allocated by LMM sub-module. |
| 1186 | * |
| 1187 | *PARAMS: |
| 1188 | * |
| 1189 | *LOGIC: |
| 1190 | * |
| 1191 | *ASSUMPTIONS: |
| 1192 | * NA |
| 1193 | * |
| 1194 | *NOTE: |
| 1195 | * NA |
| 1196 | * |
| 1197 | * @param pMac Pointer to Global MAC structure |
| 1198 | * @return None |
| 1199 | */ |
| 1200 | |
| 1201 | void |
| 1202 | limCleanupLmm(tpAniSirGlobal pMac) |
| 1203 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | } /*** end limCleanupLmm() ***/ |
| 1205 | |
| 1206 | |
| 1207 | |
| 1208 | /** |
| 1209 | * limIsAddrBC() |
| 1210 | * |
| 1211 | *FUNCTION: |
| 1212 | * This function is called in various places within LIM code |
| 1213 | * to determine whether passed MAC address is a broadcast or not |
| 1214 | * |
| 1215 | *LOGIC: |
| 1216 | * |
| 1217 | *ASSUMPTIONS: |
| 1218 | * NA |
| 1219 | * |
| 1220 | *NOTE: |
| 1221 | * NA |
| 1222 | * |
| 1223 | * @param macAddr Indicates MAC address that need to be determined |
| 1224 | * whether it is Broadcast address or not |
| 1225 | * |
| 1226 | * @return true if passed address is Broadcast address else false |
| 1227 | */ |
| 1228 | |
| 1229 | tANI_U8 |
| 1230 | limIsAddrBC(tSirMacAddr macAddr) |
| 1231 | { |
| 1232 | int i; |
| 1233 | for (i = 0; i < 6; i++) |
| 1234 | { |
| 1235 | if ((macAddr[i] & 0xFF) != 0xFF) |
| 1236 | return false; |
| 1237 | } |
| 1238 | |
| 1239 | return true; |
| 1240 | } /****** end limIsAddrBC() ******/ |
| 1241 | |
| 1242 | |
| 1243 | |
| 1244 | /** |
| 1245 | * limIsGroupAddr() |
| 1246 | * |
| 1247 | *FUNCTION: |
| 1248 | * This function is called in various places within LIM code |
| 1249 | * to determine whether passed MAC address is a group address or not |
| 1250 | * |
| 1251 | *LOGIC: |
| 1252 | * If least significant bit of first octet of the MAC address is |
| 1253 | * set to 1, it is a Group address. |
| 1254 | * |
| 1255 | *ASSUMPTIONS: |
| 1256 | * NA |
| 1257 | * |
| 1258 | *NOTE: |
| 1259 | * NA |
| 1260 | * |
| 1261 | * @param macAddr Indicates MAC address that need to be determined |
| 1262 | * whether it is Group address or not |
| 1263 | * |
| 1264 | * @return true if passed address is Group address else false |
| 1265 | */ |
| 1266 | |
| 1267 | tANI_U8 |
| 1268 | limIsGroupAddr(tSirMacAddr macAddr) |
| 1269 | { |
| 1270 | if ((macAddr[0] & 0x01) == 0x01) |
| 1271 | return true; |
| 1272 | else |
| 1273 | return false; |
| 1274 | } /****** end limIsGroupAddr() ******/ |
| 1275 | |
| 1276 | /** |
| 1277 | * limPostMsgApiNoWait() |
| 1278 | * |
| 1279 | *FUNCTION: |
| 1280 | * This function is called from other thread while posting a |
| 1281 | * message to LIM message Queue gSirLimMsgQ with NO_WAIT option |
| 1282 | * |
| 1283 | *LOGIC: |
| 1284 | * NA |
| 1285 | * |
| 1286 | *ASSUMPTIONS: |
| 1287 | * NA |
| 1288 | * |
| 1289 | *NOTE: |
| 1290 | * NA |
| 1291 | * |
| 1292 | * @param pMsg - Pointer to the Global MAC structure |
| 1293 | * @param pMsg - Pointer to the message structure |
| 1294 | * @return None |
| 1295 | */ |
| 1296 | |
| 1297 | tANI_U32 |
| 1298 | limPostMsgApiNoWait(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 1299 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | limProcessMessages(pMac, pMsg); |
| 1301 | return TX_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1302 | } /*** end limPostMsgApiNoWait() ***/ |
| 1303 | |
| 1304 | |
| 1305 | |
| 1306 | /** |
| 1307 | * limPrintMacAddr() |
| 1308 | * |
| 1309 | *FUNCTION: |
| 1310 | * This function is called to print passed MAC address |
| 1311 | * in : format. |
| 1312 | * |
| 1313 | *LOGIC: |
| 1314 | * |
| 1315 | *ASSUMPTIONS: |
| 1316 | * NA |
| 1317 | * |
| 1318 | *NOTE: |
| 1319 | * @param macAddr - MacAddr to be printed |
| 1320 | * @param logLevel - Loglevel to be used |
| 1321 | * |
| 1322 | * @return None. |
| 1323 | */ |
| 1324 | |
| 1325 | void |
| 1326 | limPrintMacAddr(tpAniSirGlobal pMac, tSirMacAddr macAddr, tANI_U8 logLevel) |
| 1327 | { |
| 1328 | limLog(pMac, logLevel, |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 1329 | FL(MAC_ADDRESS_STR), MAC_ADDR_ARRAY(macAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | } /****** end limPrintMacAddr() ******/ |
| 1331 | |
| 1332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1333 | /* |
| 1334 | * limResetDeferredMsgQ() |
| 1335 | * |
| 1336 | *FUNCTION: |
| 1337 | * This function resets the deferred message queue parameters. |
| 1338 | * |
| 1339 | *PARAMS: |
| 1340 | * @param pMac - Pointer to Global MAC structure |
| 1341 | * |
| 1342 | *LOGIC: |
| 1343 | * |
| 1344 | *ASSUMPTIONS: |
| 1345 | * NA |
| 1346 | * |
| 1347 | *NOTE: |
| 1348 | * NA |
| 1349 | * |
| 1350 | *RETURNS: |
| 1351 | * None |
| 1352 | */ |
| 1353 | |
| 1354 | void limResetDeferredMsgQ(tpAniSirGlobal pMac) |
| 1355 | { |
| 1356 | pMac->lim.gLimDeferredMsgQ.size = |
| 1357 | pMac->lim.gLimDeferredMsgQ.write = |
| 1358 | pMac->lim.gLimDeferredMsgQ.read = 0; |
| 1359 | |
| 1360 | } |
| 1361 | |
| 1362 | |
| 1363 | #define LIM_DEFERRED_Q_CHECK_THRESHOLD (MAX_DEFERRED_QUEUE_LEN/2) |
| 1364 | #define LIM_MAX_NUM_MGMT_FRAME_DEFERRED (MAX_DEFERRED_QUEUE_LEN/2) |
| 1365 | |
| 1366 | /* |
| 1367 | * limWriteDeferredMsgQ() |
| 1368 | * |
| 1369 | *FUNCTION: |
| 1370 | * This function queues up a deferred message for later processing on the |
| 1371 | * STA side. |
| 1372 | * |
| 1373 | *PARAMS: |
| 1374 | * @param pMac - Pointer to Global MAC structure |
| 1375 | * @param limMsg - a LIM message |
| 1376 | * |
| 1377 | *LOGIC: |
| 1378 | * |
| 1379 | *ASSUMPTIONS: |
| 1380 | * NA |
| 1381 | * |
| 1382 | *NOTE: |
| 1383 | * NA |
| 1384 | * |
| 1385 | *RETURNS: |
| 1386 | * None |
| 1387 | */ |
| 1388 | |
| 1389 | tANI_U8 limWriteDeferredMsgQ(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1390 | { |
| 1391 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1392 | FL("** Queue a deferred message (size %d, write %d) - type 0x%x **"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1393 | pMac->lim.gLimDeferredMsgQ.size, pMac->lim.gLimDeferredMsgQ.write, |
| 1394 | limMsg->type);) |
| 1395 | |
| 1396 | /* |
| 1397 | ** check if the deferred message queue is full |
| 1398 | **/ |
| 1399 | if (pMac->lim.gLimDeferredMsgQ.size >= MAX_DEFERRED_QUEUE_LEN) |
| 1400 | { |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 1401 | if (!(pMac->lim.deferredMsgCnt & 0xF)) |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1402 | { |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 1403 | limLog(pMac, LOGE, |
| 1404 | FL("Deferred Message Queue is full. Msg:%d Messages Failed:%d"), |
| 1405 | limMsg->type, ++pMac->lim.deferredMsgCnt); |
| 1406 | vos_fatal_event_logs_req(WLAN_LOG_TYPE_NON_FATAL, |
| 1407 | WLAN_LOG_INDICATOR_HOST_DRIVER, |
| 1408 | WLAN_LOG_REASON_QUEUE_FULL, |
| 1409 | FALSE, TRUE); |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1410 | } |
| 1411 | else |
| 1412 | { |
| 1413 | pMac->lim.deferredMsgCnt++; |
| 1414 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | return TX_QUEUE_FULL; |
| 1416 | } |
| 1417 | |
| 1418 | /* |
| 1419 | ** In the application, there should not be more than 1 message get |
| 1420 | ** queued up. If happens, flags a warning. In the future, this can |
| 1421 | ** happen. |
| 1422 | **/ |
| 1423 | if (pMac->lim.gLimDeferredMsgQ.size > 0) |
| 1424 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1425 | PELOGW(limLog(pMac, LOGW, FL("%d Deferred messages (type 0x%x, scan %d, global sme %d, global mlme %d, addts %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1426 | pMac->lim.gLimDeferredMsgQ.size, limMsg->type, |
| 1427 | limIsSystemInScanState(pMac), |
| 1428 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1429 | pMac->lim.gLimAddtsSent);) |
| 1430 | } |
| 1431 | |
| 1432 | /* |
| 1433 | ** To prevent the deferred Q is full of management frames, only give them certain space |
| 1434 | **/ |
| 1435 | if( SIR_BB_XPORT_MGMT_MSG == limMsg->type ) |
| 1436 | { |
| 1437 | if( LIM_DEFERRED_Q_CHECK_THRESHOLD < pMac->lim.gLimDeferredMsgQ.size ) |
| 1438 | { |
| 1439 | tANI_U16 idx, count = 0; |
| 1440 | for(idx = 0; idx < pMac->lim.gLimDeferredMsgQ.size; idx++) |
| 1441 | { |
| 1442 | if( SIR_BB_XPORT_MGMT_MSG == pMac->lim.gLimDeferredMsgQ.deferredQueue[idx].type ) |
| 1443 | { |
| 1444 | count++; |
| 1445 | } |
| 1446 | } |
| 1447 | if( LIM_MAX_NUM_MGMT_FRAME_DEFERRED < count ) |
| 1448 | { |
| 1449 | //We reach the quota for management frames, drop this one |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 1450 | PELOGW(limLog(pMac, LOGW, FL("Cannot deferred. Msg: %d Too many (count=%d) already"), limMsg->type, count);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | //Return error, caller knows what to do |
| 1452 | return TX_QUEUE_FULL; |
| 1453 | } |
| 1454 | } |
| 1455 | } |
| 1456 | |
| 1457 | ++pMac->lim.gLimDeferredMsgQ.size; |
| 1458 | |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1459 | /* reset the count here since we are able to defer the message */ |
| 1460 | if(pMac->lim.deferredMsgCnt != 0) |
| 1461 | { |
| 1462 | pMac->lim.deferredMsgCnt = 0; |
| 1463 | } |
| 1464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1465 | /* |
| 1466 | ** if the write pointer hits the end of the queue, rewind it |
| 1467 | **/ |
| 1468 | if (pMac->lim.gLimDeferredMsgQ.write >= MAX_DEFERRED_QUEUE_LEN) |
| 1469 | pMac->lim.gLimDeferredMsgQ.write = 0; |
| 1470 | |
| 1471 | /* |
| 1472 | ** save the message to the queue and advanced the write pointer |
| 1473 | **/ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 1474 | vos_mem_copy( (tANI_U8 *)&pMac->lim.gLimDeferredMsgQ.deferredQueue[ |
| 1475 | pMac->lim.gLimDeferredMsgQ.write++], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1476 | (tANI_U8 *)limMsg, |
| 1477 | sizeof(tSirMsgQ)); |
| 1478 | return TX_SUCCESS; |
| 1479 | |
| 1480 | } |
| 1481 | |
| 1482 | /* |
| 1483 | * limReadDeferredMsgQ() |
| 1484 | * |
| 1485 | *FUNCTION: |
| 1486 | * This function dequeues a deferred message for processing on the |
| 1487 | * STA side. |
| 1488 | * |
| 1489 | *PARAMS: |
| 1490 | * @param pMac - Pointer to Global MAC structure |
| 1491 | * |
| 1492 | *LOGIC: |
| 1493 | * |
| 1494 | *ASSUMPTIONS: |
| 1495 | * NA |
| 1496 | * |
| 1497 | *NOTE: |
| 1498 | * |
| 1499 | * |
| 1500 | *RETURNS: |
| 1501 | * Returns the message at the head of the deferred message queue |
| 1502 | */ |
| 1503 | |
| 1504 | tSirMsgQ* limReadDeferredMsgQ(tpAniSirGlobal pMac) |
| 1505 | { |
| 1506 | tSirMsgQ *msg; |
| 1507 | |
| 1508 | /* |
| 1509 | ** check any messages left. If no, return |
| 1510 | **/ |
| 1511 | if (pMac->lim.gLimDeferredMsgQ.size <= 0) |
| 1512 | return NULL; |
| 1513 | |
| 1514 | /* |
| 1515 | ** decrement the queue size |
| 1516 | **/ |
| 1517 | pMac->lim.gLimDeferredMsgQ.size--; |
| 1518 | |
| 1519 | /* |
| 1520 | ** retrieve the message from the head of the queue |
| 1521 | **/ |
| 1522 | msg = &pMac->lim.gLimDeferredMsgQ.deferredQueue[pMac->lim.gLimDeferredMsgQ.read]; |
| 1523 | |
| 1524 | /* |
| 1525 | ** advance the read pointer |
| 1526 | **/ |
| 1527 | pMac->lim.gLimDeferredMsgQ.read++; |
| 1528 | |
| 1529 | /* |
| 1530 | ** if the read pointer hits the end of the queue, rewind it |
| 1531 | **/ |
| 1532 | if (pMac->lim.gLimDeferredMsgQ.read >= MAX_DEFERRED_QUEUE_LEN) |
| 1533 | pMac->lim.gLimDeferredMsgQ.read = 0; |
| 1534 | |
| 1535 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1536 | FL("** DeQueue a deferred message (size %d read %d) - type 0x%x **"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1537 | pMac->lim.gLimDeferredMsgQ.size, pMac->lim.gLimDeferredMsgQ.read, |
| 1538 | msg->type);) |
| 1539 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1540 | PELOG1(limLog(pMac, LOG1, FL("DQ msg -- scan %d, global sme %d, global mlme %d, addts %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1541 | limIsSystemInScanState(pMac), |
| 1542 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1543 | pMac->lim.gLimAddtsSent);) |
| 1544 | |
| 1545 | return(msg); |
| 1546 | } |
| 1547 | |
| 1548 | tSirRetStatus |
| 1549 | limSysProcessMmhMsgApi(tpAniSirGlobal pMac, |
| 1550 | tSirMsgQ *pMsg, |
| 1551 | tANI_U8 qType) |
| 1552 | { |
| 1553 | // FIXME |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1554 | SysProcessMmhMsg(pMac, pMsg); |
| 1555 | return eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1556 | } |
| 1557 | |
| 1558 | char *limFrameStr(tANI_U32 type, tANI_U32 subType) |
| 1559 | { |
| 1560 | #ifdef FIXME_GEN6 |
| 1561 | |
| 1562 | if (type == SIR_MAC_MGMT_FRAME) |
| 1563 | { |
| 1564 | switch (subType) |
| 1565 | { |
| 1566 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 1567 | return "MAC_MGMT_ASSOC_REQ"; |
| 1568 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 1569 | return "MAC_MGMT_ASSOC_RSP"; |
| 1570 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 1571 | return "MAC_MGMT_REASSOC_REQ"; |
| 1572 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 1573 | return "MAC_MGMT_REASSOC_RSP"; |
| 1574 | case SIR_MAC_MGMT_PROBE_REQ: |
| 1575 | return "MAC_MGMT_PROBE_REQ"; |
| 1576 | case SIR_MAC_MGMT_PROBE_RSP: |
| 1577 | return "MAC_MGMT_PROBE_RSP"; |
| 1578 | case SIR_MAC_MGMT_BEACON: |
| 1579 | return "MAC_MGMT_BEACON"; |
| 1580 | case SIR_MAC_MGMT_ATIM: |
| 1581 | return "MAC_MGMT_ATIM"; |
| 1582 | case SIR_MAC_MGMT_DISASSOC: |
| 1583 | return "MAC_MGMT_DISASSOC"; |
| 1584 | case SIR_MAC_MGMT_AUTH: |
| 1585 | return "MAC_MGMT_AUTH"; |
| 1586 | case SIR_MAC_MGMT_DEAUTH: |
| 1587 | return "MAC_MGMT_DEAUTH"; |
| 1588 | case SIR_MAC_MGMT_ACTION: |
| 1589 | return "MAC_MGMT_ACTION"; |
| 1590 | case SIR_MAC_MGMT_RESERVED15: |
| 1591 | return "MAC_MGMT_RESERVED15"; |
| 1592 | default: |
| 1593 | return "Unknown MGMT Frame"; |
| 1594 | } |
| 1595 | } |
| 1596 | |
| 1597 | else if (type == SIR_MAC_CTRL_FRAME) |
| 1598 | { |
| 1599 | switch (subType) |
| 1600 | { |
| 1601 | case SIR_MAC_CTRL_RR: |
| 1602 | return "MAC_CTRL_RR"; |
| 1603 | case SIR_MAC_CTRL_BAR: |
| 1604 | return "MAC_CTRL_BAR"; |
| 1605 | case SIR_MAC_CTRL_BA: |
| 1606 | return "MAC_CTRL_BA"; |
| 1607 | case SIR_MAC_CTRL_PS_POLL: |
| 1608 | return "MAC_CTRL_PS_POLL"; |
| 1609 | case SIR_MAC_CTRL_RTS: |
| 1610 | return "MAC_CTRL_RTS"; |
| 1611 | case SIR_MAC_CTRL_CTS: |
| 1612 | return "MAC_CTRL_CTS"; |
| 1613 | case SIR_MAC_CTRL_ACK: |
| 1614 | return "MAC_CTRL_ACK"; |
| 1615 | case SIR_MAC_CTRL_CF_END: |
| 1616 | return "MAC_CTRL_CF_END"; |
| 1617 | case SIR_MAC_CTRL_CF_END_ACK: |
| 1618 | return "MAC_CTRL_CF_END_ACK"; |
| 1619 | default: |
| 1620 | return "Unknown CTRL Frame"; |
| 1621 | } |
| 1622 | } |
| 1623 | |
| 1624 | else if (type == SIR_MAC_DATA_FRAME) |
| 1625 | { |
| 1626 | switch (subType) |
| 1627 | { |
| 1628 | case SIR_MAC_DATA_DATA: |
| 1629 | return "MAC_DATA_DATA"; |
| 1630 | case SIR_MAC_DATA_DATA_ACK: |
| 1631 | return "MAC_DATA_DATA_ACK"; |
| 1632 | case SIR_MAC_DATA_DATA_POLL: |
| 1633 | return "MAC_DATA_DATA_POLL"; |
| 1634 | case SIR_MAC_DATA_DATA_ACK_POLL: |
| 1635 | return "MAC_DATA_DATA_ACK_POLL"; |
| 1636 | case SIR_MAC_DATA_NULL: |
| 1637 | return "MAC_DATA_NULL"; |
| 1638 | case SIR_MAC_DATA_NULL_ACK: |
| 1639 | return "MAC_DATA_NULL_ACK"; |
| 1640 | case SIR_MAC_DATA_NULL_POLL: |
| 1641 | return "MAC_DATA_NULL_POLL"; |
| 1642 | case SIR_MAC_DATA_NULL_ACK_POLL: |
| 1643 | return "MAC_DATA_NULL_ACK_POLL"; |
| 1644 | case SIR_MAC_DATA_QOS_DATA: |
| 1645 | return "MAC_DATA_QOS_DATA"; |
| 1646 | case SIR_MAC_DATA_QOS_DATA_ACK: |
| 1647 | return "MAC_DATA_QOS_DATA_ACK"; |
| 1648 | case SIR_MAC_DATA_QOS_DATA_POLL: |
| 1649 | return "MAC_DATA_QOS_DATA_POLL"; |
| 1650 | case SIR_MAC_DATA_QOS_DATA_ACK_POLL: |
| 1651 | return "MAC_DATA_QOS_DATA_ACK_POLL"; |
| 1652 | case SIR_MAC_DATA_QOS_NULL: |
| 1653 | return "MAC_DATA_QOS_NULL"; |
| 1654 | case SIR_MAC_DATA_QOS_NULL_ACK: |
| 1655 | return "MAC_DATA_QOS_NULL_ACK"; |
| 1656 | case SIR_MAC_DATA_QOS_NULL_POLL: |
| 1657 | return "MAC_DATA_QOS_NULL_POLL"; |
| 1658 | case SIR_MAC_DATA_QOS_NULL_ACK_POLL: |
| 1659 | return "MAC_DATA_QOS_NULL_ACK_POLL"; |
| 1660 | default: |
| 1661 | return "Unknown Data Frame"; |
| 1662 | } |
| 1663 | } |
| 1664 | else |
| 1665 | return "Unknown"; |
| 1666 | #endif |
| 1667 | return ""; |
| 1668 | } |
| 1669 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1670 | void limHandleUpdateOlbcCache(tpAniSirGlobal pMac) |
| 1671 | { |
| 1672 | int i; |
| 1673 | static int enable; |
| 1674 | tUpdateBeaconParams beaconParams; |
| 1675 | |
| 1676 | tpPESession psessionEntry = limIsApSessionActive(pMac); |
| 1677 | |
| 1678 | if (psessionEntry == NULL) |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1679 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1680 | PELOGE(limLog(pMac, LOGE, FL(" Session not found"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1681 | return; |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1682 | } |
Pratik Bhalgat | b44ea3f | 2012-11-22 16:41:39 +0530 | [diff] [blame] | 1683 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 1684 | vos_mem_set( ( tANI_U8* )&beaconParams, sizeof( tUpdateBeaconParams), 0); |
Madan Mohan Koyyalamudi | b273314 | 2012-10-31 13:59:17 -0700 | [diff] [blame] | 1685 | beaconParams.bssIdx = psessionEntry->bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1686 | |
| 1687 | beaconParams.paramChangeBitmap = 0; |
| 1688 | /* |
| 1689 | ** This is doing a 2 pass check. The first pass is to invalidate |
| 1690 | ** all the cache entries. The second pass is to decide whether to |
| 1691 | ** disable protection. |
| 1692 | **/ |
| 1693 | if (!enable) |
| 1694 | { |
| 1695 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1696 | PELOG2(limLog(pMac, LOG2, FL("Resetting OLBC cache"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | psessionEntry->gLimOlbcParams.numSta = 0; |
| 1698 | psessionEntry->gLimOverlap11gParams.numSta = 0; |
| 1699 | psessionEntry->gLimOverlapHt20Params.numSta = 0; |
| 1700 | psessionEntry->gLimNonGfParams.numSta = 0; |
| 1701 | psessionEntry->gLimLsigTxopParams.numSta = 0; |
| 1702 | |
| 1703 | for (i=0; i < LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++) |
| 1704 | pMac->lim.protStaOverlapCache[i].active = false; |
| 1705 | |
| 1706 | enable = 1; |
| 1707 | } |
| 1708 | else |
| 1709 | { |
| 1710 | |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1711 | if (!psessionEntry->gLimOlbcParams.numSta) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1712 | { |
| 1713 | if (psessionEntry->gLimOlbcParams.protectionEnabled) |
| 1714 | { |
| 1715 | if (!psessionEntry->gLim11bParams.protectionEnabled) |
| 1716 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1717 | PELOG1(limLog(pMac, LOG1, FL("Overlap cache all clear and no 11B STA detected"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1718 | limEnable11gProtection(pMac, false, true, &beaconParams, psessionEntry); |
| 1719 | } |
| 1720 | } |
| 1721 | } |
| 1722 | |
| 1723 | if (!psessionEntry->gLimOverlap11gParams.numSta) |
| 1724 | { |
| 1725 | if (psessionEntry->gLimOverlap11gParams.protectionEnabled) |
| 1726 | { |
| 1727 | if (!psessionEntry->gLim11gParams.protectionEnabled) |
| 1728 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1729 | PELOG1(limLog(pMac, LOG1, FL("Overlap cache all clear and no 11G STA detected"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | limEnableHtProtectionFrom11g(pMac, false, true, &beaconParams,psessionEntry); |
| 1731 | } |
| 1732 | } |
| 1733 | } |
| 1734 | |
| 1735 | if (!psessionEntry->gLimOverlapHt20Params.numSta) |
| 1736 | { |
| 1737 | if (psessionEntry->gLimOverlapHt20Params.protectionEnabled) |
| 1738 | { |
| 1739 | if (!psessionEntry->gLimHt20Params.protectionEnabled) |
| 1740 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1741 | PELOG1(limLog(pMac, LOG1, FL("Overlap cache all clear and no HT20 STA detected"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1742 | limEnable11gProtection(pMac, false, true, &beaconParams,psessionEntry); |
| 1743 | } |
| 1744 | } |
| 1745 | } |
| 1746 | |
| 1747 | enable = 0; |
| 1748 | } |
| 1749 | |
| 1750 | if(beaconParams.paramChangeBitmap) |
| 1751 | { |
| 1752 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 1753 | limSendBeaconParams(pMac, &beaconParams, psessionEntry); |
| 1754 | } |
| 1755 | |
| 1756 | // Start OLBC timer |
| 1757 | if (tx_timer_activate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer) != TX_SUCCESS) |
| 1758 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1759 | limLog(pMac, LOGE, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1760 | } |
| 1761 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1762 | |
| 1763 | /** |
| 1764 | * limIsNullSsid() |
| 1765 | * |
| 1766 | *FUNCTION: |
| 1767 | * This function checks if Ssid supplied is Null SSID |
| 1768 | * |
| 1769 | * |
| 1770 | *LOGIC: |
| 1771 | * |
| 1772 | *ASSUMPTIONS: |
| 1773 | * NA |
| 1774 | * |
| 1775 | *NOTE: |
| 1776 | * NA |
| 1777 | * |
| 1778 | * @param tSirMacSSid * |
| 1779 | * |
| 1780 | * |
| 1781 | * @return true if SSID is Null SSID else false |
| 1782 | */ |
| 1783 | |
| 1784 | tANI_U8 |
| 1785 | limIsNullSsid( tSirMacSSid *pSsid ) |
| 1786 | { |
| 1787 | tANI_U8 fNullSsid = false; |
| 1788 | tANI_U32 SsidLength; |
| 1789 | tANI_U8 *pSsidStr; |
| 1790 | |
| 1791 | do |
| 1792 | { |
| 1793 | if ( 0 == pSsid->length ) |
| 1794 | { |
| 1795 | fNullSsid = true; |
| 1796 | break; |
| 1797 | } |
| 1798 | |
| 1799 | #define ASCII_SPACE_CHARACTER 0x20 |
Sandeep Puligilla | f67f9ae | 2014-03-28 22:40:20 +0530 | [diff] [blame] | 1800 | /* If the first charactes is space and SSID length is 1 |
| 1801 | * then consider it as NULL SSID*/ |
| 1802 | if ((ASCII_SPACE_CHARACTER == pSsid->ssId[0]) && |
| 1803 | (pSsid->length == 1)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1804 | { |
Sandeep Puligilla | f67f9ae | 2014-03-28 22:40:20 +0530 | [diff] [blame] | 1805 | fNullSsid = true; |
| 1806 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | } |
| 1808 | else |
| 1809 | { |
| 1810 | /* check if all the charactes in SSID are NULL*/ |
| 1811 | SsidLength = pSsid->length; |
| 1812 | pSsidStr = pSsid->ssId; |
| 1813 | |
| 1814 | while ( SsidLength ) |
| 1815 | { |
| 1816 | if( *pSsidStr ) |
| 1817 | break; |
| 1818 | |
| 1819 | pSsidStr++; |
| 1820 | SsidLength--; |
| 1821 | } |
| 1822 | |
| 1823 | if( 0 == SsidLength ) |
| 1824 | { |
| 1825 | fNullSsid = true; |
| 1826 | break; |
| 1827 | } |
| 1828 | } |
| 1829 | } |
| 1830 | while( 0 ); |
| 1831 | |
| 1832 | return fNullSsid; |
| 1833 | } /****** end limIsNullSsid() ******/ |
| 1834 | |
| 1835 | |
| 1836 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1837 | |
| 1838 | /** ------------------------------------------------------------- |
| 1839 | \fn limUpdateProtStaParams |
| 1840 | \brief updates protection related counters. |
| 1841 | \param tpAniSirGlobal pMac |
| 1842 | \param tSirMacAddr peerMacAddr |
| 1843 | \param tLimProtStaCacheType protStaCacheType |
| 1844 | \param tHalBitVal gfSupported |
| 1845 | \param tHalBitVal lsigTxopSupported |
| 1846 | \return None |
| 1847 | -------------------------------------------------------------*/ |
| 1848 | void |
| 1849 | limUpdateProtStaParams(tpAniSirGlobal pMac, |
| 1850 | tSirMacAddr peerMacAddr, tLimProtStaCacheType protStaCacheType, |
| 1851 | tHalBitVal gfSupported, tHalBitVal lsigTxopSupported, |
| 1852 | tpPESession psessionEntry) |
| 1853 | { |
| 1854 | tANI_U32 i; |
| 1855 | |
| 1856 | PELOG1(limLog(pMac,LOG1, FL("A STA is associated:")); |
| 1857 | limLog(pMac,LOG1, FL("Addr : ")); |
| 1858 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 1859 | |
| 1860 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1861 | { |
| 1862 | if (psessionEntry->protStaCache[i].active) |
| 1863 | { |
| 1864 | PELOG1(limLog(pMac, LOG1, FL("Addr: "));) |
| 1865 | PELOG1(limPrintMacAddr(pMac, psessionEntry->protStaCache[i].addr, LOG1);) |
| 1866 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 1867 | if (vos_mem_compare( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | psessionEntry->protStaCache[i].addr, |
| 1869 | peerMacAddr, sizeof(tSirMacAddr))) |
| 1870 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1871 | PELOG1(limLog(pMac, LOG1, FL("matching cache entry at %d already active."), i);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1872 | return; |
| 1873 | } |
| 1874 | } |
| 1875 | } |
| 1876 | |
| 1877 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1878 | { |
| 1879 | if (!psessionEntry->protStaCache[i].active) |
| 1880 | break; |
| 1881 | } |
| 1882 | |
| 1883 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 1884 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1885 | PELOGE(limLog(pMac, LOGE, FL("No space in ProtStaCache"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1886 | return; |
| 1887 | } |
| 1888 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 1889 | vos_mem_copy( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1890 | peerMacAddr, |
| 1891 | sizeof(tSirMacAddr)); |
| 1892 | |
| 1893 | psessionEntry->protStaCache[i].protStaCacheType = protStaCacheType; |
| 1894 | psessionEntry->protStaCache[i].active = true; |
| 1895 | if(eLIM_PROT_STA_CACHE_TYPE_llB == protStaCacheType) |
| 1896 | { |
| 1897 | psessionEntry->gLim11bParams.numSta++; |
| 1898 | limLog(pMac,LOG1, FL("11B, ")); |
| 1899 | } |
| 1900 | else if(eLIM_PROT_STA_CACHE_TYPE_llG == protStaCacheType) |
| 1901 | { |
| 1902 | psessionEntry->gLim11gParams.numSta++; |
| 1903 | limLog(pMac,LOG1, FL("11G, ")); |
| 1904 | } |
| 1905 | else if(eLIM_PROT_STA_CACHE_TYPE_HT20 == protStaCacheType) |
| 1906 | { |
| 1907 | psessionEntry->gLimHt20Params.numSta++; |
| 1908 | limLog(pMac,LOG1, FL("HT20, ")); |
| 1909 | } |
| 1910 | |
| 1911 | if(!gfSupported) |
| 1912 | { |
| 1913 | psessionEntry->gLimNonGfParams.numSta++; |
| 1914 | limLog(pMac,LOG1, FL("NonGf, ")); |
| 1915 | } |
| 1916 | if(!lsigTxopSupported) |
| 1917 | { |
| 1918 | psessionEntry->gLimLsigTxopParams.numSta++; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1919 | limLog(pMac,LOG1, FL("!lsigTxopSupported")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1920 | } |
| 1921 | }// --------------------------------------------------------------------- |
| 1922 | |
| 1923 | /** ------------------------------------------------------------- |
| 1924 | \fn limDecideApProtection |
| 1925 | \brief Decides all the protection related staiton coexistence and also sets |
| 1926 | \ short preamble and short slot appropriately. This function will be called |
| 1927 | \ when AP is ready to send assocRsp tp the station joining right now. |
| 1928 | \param tpAniSirGlobal pMac |
| 1929 | \param tSirMacAddr peerMacAddr |
| 1930 | \return None |
| 1931 | -------------------------------------------------------------*/ |
| 1932 | void |
| 1933 | limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 1934 | { |
| 1935 | tANI_U16 tmpAid; |
| 1936 | tpDphHashNode pStaDs; |
| 1937 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 1938 | tANI_U32 phyMode; |
| 1939 | tLimProtStaCacheType protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_INVALID; |
| 1940 | tHalBitVal gfSupported = eHAL_SET, lsigTxopSupported = eHAL_SET; |
| 1941 | |
| 1942 | pBeaconParams->paramChangeBitmap = 0; |
| 1943 | // check whether to enable protection or not |
| 1944 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 1945 | if(NULL == pStaDs) |
| 1946 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1947 | limLog(pMac, LOG1, FL("pStaDs is NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1948 | return; |
| 1949 | } |
| 1950 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 1951 | //if we are in 5 GHZ band |
| 1952 | if(SIR_BAND_5_GHZ == rfBand) |
| 1953 | { |
| 1954 | //We are 11N. we need to protect from 11A and Ht20. we don't need any other protection in 5 GHZ. |
| 1955 | //HT20 case is common between both the bands and handled down as common code. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1956 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1957 | { |
| 1958 | //we are 11N and 11A station is joining. |
| 1959 | //protection from 11A required. |
| 1960 | if(false == pStaDs->mlmStaContext.htCapability) |
| 1961 | { |
| 1962 | limEnable11aProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 1963 | return; |
| 1964 | } |
| 1965 | } |
| 1966 | } |
| 1967 | else if(SIR_BAND_2_4_GHZ== rfBand) |
| 1968 | { |
| 1969 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1970 | |
| 1971 | //We are 11G. Check if we need protection from 11b Stations. |
| 1972 | if ((phyMode == WNI_CFG_PHY_MODE_11G) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1973 | (false == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1974 | { |
| 1975 | |
| 1976 | if (pStaDs->erpEnabled== eHAL_CLEAR) |
| 1977 | { |
| 1978 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llB; |
| 1979 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1980 | PELOG3(limLog(pMac, LOG3, FL("Enabling protection from 11B"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1981 | limEnable11gProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 1982 | } |
| 1983 | } |
| 1984 | |
| 1985 | //HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1986 | if (true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1987 | { |
| 1988 | //check if we need protection from 11b station |
| 1989 | if ((pStaDs->erpEnabled == eHAL_CLEAR) && |
| 1990 | (!pStaDs->mlmStaContext.htCapability)) |
| 1991 | { |
| 1992 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llB; |
| 1993 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1994 | PELOG3(limLog(pMac, LOG3, FL("Enabling protection from 11B"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1995 | limEnable11gProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 1996 | } |
| 1997 | //station being joined is non-11b and non-ht ==> 11g device |
| 1998 | else if(!pStaDs->mlmStaContext.htCapability) |
| 1999 | { |
| 2000 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llG; |
| 2001 | //enable protection |
| 2002 | limEnableHtProtectionFrom11g(pMac, true, false, pBeaconParams, psessionEntry); |
| 2003 | } |
| 2004 | //ERP mode is enabled for the latest station joined |
| 2005 | //latest station joined is HT capable |
| 2006 | //This case is being handled in common code (commn between both the bands) below. |
| 2007 | } |
| 2008 | } |
| 2009 | |
| 2010 | //we are HT and HT station is joining. This code is common for both the bands. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2011 | if((true == psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2012 | (true == pStaDs->mlmStaContext.htCapability)) |
| 2013 | { |
| 2014 | if(!pStaDs->htGreenfield) |
| 2015 | { |
| 2016 | limEnableHTNonGfProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 2017 | gfSupported = eHAL_CLEAR; |
| 2018 | } |
| 2019 | //Station joining is HT 20Mhz |
| 2020 | if(eHT_CHANNEL_WIDTH_20MHZ == pStaDs->htSupportedChannelWidthSet) |
| 2021 | { |
| 2022 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_HT20; |
| 2023 | limEnableHT20Protection(pMac, true, false, pBeaconParams, psessionEntry); |
| 2024 | } |
| 2025 | //Station joining does not support LSIG TXOP Protection |
| 2026 | if(!pStaDs->htLsigTXOPProtection) |
| 2027 | { |
| 2028 | limEnableHTLsigTxopProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2029 | lsigTxopSupported = eHAL_CLEAR; |
| 2030 | } |
| 2031 | } |
| 2032 | |
| 2033 | limUpdateProtStaParams(pMac, peerMacAddr, protStaCacheType, |
| 2034 | gfSupported, lsigTxopSupported, psessionEntry); |
| 2035 | |
| 2036 | return; |
| 2037 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | |
| 2039 | |
| 2040 | /** ------------------------------------------------------------- |
| 2041 | \fn limEnableOverlap11gProtection |
| 2042 | \brief wrapper function for setting overlap 11g protection. |
| 2043 | \param tpAniSirGlobal pMac |
| 2044 | \param tpUpdateBeaconParams pBeaconParams |
| 2045 | \param tpSirMacMgmtHdr pMh |
| 2046 | \return None |
| 2047 | -------------------------------------------------------------*/ |
| 2048 | void |
| 2049 | limEnableOverlap11gProtection(tpAniSirGlobal pMac, |
| 2050 | tpUpdateBeaconParams pBeaconParams, tpSirMacMgmtHdr pMh,tpPESession psessionEntry) |
| 2051 | { |
| 2052 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOlbcParams)); |
| 2053 | |
| 2054 | if (psessionEntry->gLimOlbcParams.numSta && |
| 2055 | !psessionEntry->gLimOlbcParams.protectionEnabled) |
| 2056 | { |
| 2057 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2058 | PELOG1(limLog(pMac, LOG1, FL("OLBC happens!!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2059 | limEnable11gProtection(pMac, true, true, pBeaconParams,psessionEntry); |
| 2060 | } |
| 2061 | } |
| 2062 | |
| 2063 | |
| 2064 | /** ------------------------------------------------------------- |
| 2065 | \fn limUpdateShortPreamble |
| 2066 | \brief Updates short preamble if needed when a new station joins. |
| 2067 | \param tpAniSirGlobal pMac |
| 2068 | \param tSirMacAddr peerMacAddr |
| 2069 | \param tpUpdateBeaconParams pBeaconParams |
| 2070 | \return None |
| 2071 | -------------------------------------------------------------*/ |
| 2072 | void |
| 2073 | limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2074 | tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2075 | { |
| 2076 | tANI_U16 tmpAid; |
| 2077 | tpDphHashNode pStaDs; |
| 2078 | tANI_U32 phyMode; |
| 2079 | tANI_U16 i; |
| 2080 | |
| 2081 | // check whether to enable protection or not |
| 2082 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 2083 | |
| 2084 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2085 | |
| 2086 | if (pStaDs != NULL && phyMode == WNI_CFG_PHY_MODE_11G) |
| 2087 | |
| 2088 | { |
| 2089 | if (pStaDs->shortPreambleEnabled == eHAL_CLEAR) |
| 2090 | { |
| 2091 | PELOG1(limLog(pMac,LOG1,FL("Short Preamble is not enabled in Assoc Req from ")); |
| 2092 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 2093 | |
| 2094 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2095 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2097 | psessionEntry->gLimNoShortParams.staNoShortCache[i].active) |
| 2098 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2099 | if (vos_mem_compare( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2100 | psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, |
| 2101 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2102 | return; |
| 2103 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2104 | { |
| 2105 | if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active) |
| 2106 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2107 | if (vos_mem_compare( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2108 | pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, |
| 2109 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2110 | return; |
| 2111 | } |
| 2112 | } |
| 2113 | } |
| 2114 | |
| 2115 | |
| 2116 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2117 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2118 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2119 | !psessionEntry->gLimNoShortParams.staNoShortCache[i].active) |
| 2120 | break; |
| 2121 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2122 | { |
| 2123 | if (!pMac->lim.gLimNoShortParams.staNoShortCache[i].active) |
| 2124 | break; |
| 2125 | } |
| 2126 | } |
| 2127 | |
| 2128 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 2129 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2130 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2131 | limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), |
| 2132 | i, psessionEntry->gLimNoShortParams.numNonShortPreambleSta); |
| 2133 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2134 | return; |
| 2135 | } |
| 2136 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | { |
| 2138 | limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), |
| 2139 | i, pMac->lim.gLimNoShortParams.numNonShortPreambleSta); |
| 2140 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2141 | return; |
| 2142 | } |
| 2143 | |
| 2144 | } |
| 2145 | |
| 2146 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2147 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2148 | vos_mem_copy( psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2149 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2150 | psessionEntry->gLimNoShortParams.staNoShortCache[i].active = true; |
| 2151 | psessionEntry->gLimNoShortParams.numNonShortPreambleSta++; |
| 2152 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2153 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2154 | vos_mem_copy( pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2155 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2156 | pMac->lim.gLimNoShortParams.staNoShortCache[i].active = true; |
| 2157 | pMac->lim.gLimNoShortParams.numNonShortPreambleSta++; |
| 2158 | } |
| 2159 | |
| 2160 | |
| 2161 | // enable long preamble |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2162 | PELOG1(limLog(pMac, LOG1, FL("Disabling short preamble"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2164 | if (limEnableShortPreamble(pMac, false, pBeaconParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2165 | PELOGE(limLog(pMac, LOGE, FL("Cannot enable long preamble"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2166 | } |
| 2167 | } |
| 2168 | } |
| 2169 | |
| 2170 | /** ------------------------------------------------------------- |
| 2171 | \fn limUpdateShortSlotTime |
| 2172 | \brief Updates short slot time if needed when a new station joins. |
| 2173 | \param tpAniSirGlobal pMac |
| 2174 | \param tSirMacAddr peerMacAddr |
| 2175 | \param tpUpdateBeaconParams pBeaconParams |
| 2176 | \return None |
| 2177 | -------------------------------------------------------------*/ |
| 2178 | |
| 2179 | void |
| 2180 | limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2181 | tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2182 | { |
| 2183 | tANI_U16 tmpAid; |
| 2184 | tpDphHashNode pStaDs; |
| 2185 | tANI_U32 phyMode; |
| 2186 | tANI_U32 val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2187 | tANI_U16 i; |
| 2188 | |
| 2189 | // check whether to enable protection or not |
| 2190 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 2191 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2193 | /* Only in case of softap in 11g mode, slot time might change depending on the STA being added. In 11a case, it should |
| 2194 | * be always 1 and in 11b case, it should be always 0 |
| 2195 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | if (pStaDs != NULL && phyMode == WNI_CFG_PHY_MODE_11G) |
| 2197 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2198 | /* Only when the new STA has short slot time disabled, we need to change softap's overall slot time settings |
| 2199 | * else the default for softap is always short slot enabled. When the last long slot STA leaves softAP, we take care of |
| 2200 | * it in limDecideShortSlot |
| 2201 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2202 | if (pStaDs->shortSlotTimeEnabled == eHAL_CLEAR) |
| 2203 | { |
| 2204 | PELOG1(limLog(pMac, LOG1, FL("Short Slot Time is not enabled in Assoc Req from ")); |
| 2205 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 2206 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2207 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2208 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2209 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2210 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2211 | if (vos_mem_compare( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2213 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2214 | return; |
| 2215 | } |
| 2216 | else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2217 | { |
| 2218 | if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2219 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2220 | if (vos_mem_compare( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2221 | pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2222 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2223 | return; |
| 2224 | } |
| 2225 | } |
| 2226 | } |
| 2227 | |
| 2228 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2229 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2230 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2231 | !psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2232 | break; |
| 2233 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | { |
| 2235 | if (!pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2236 | break; |
| 2237 | } |
| 2238 | } |
| 2239 | |
| 2240 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 2241 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2243 | limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), |
| 2244 | i, psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta); |
| 2245 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2246 | return; |
| 2247 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2248 | { |
| 2249 | limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), |
| 2250 | i, pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta); |
| 2251 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2252 | return; |
| 2253 | } |
| 2254 | } |
| 2255 | |
| 2256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2257 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2258 | vos_mem_copy( psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2259 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2260 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; |
| 2261 | psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta++; |
| 2262 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2263 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 2264 | vos_mem_copy( pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2265 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2266 | pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; |
| 2267 | pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta++; |
| 2268 | } |
| 2269 | wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val); |
| 2270 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2271 | /* Here we check if we are AP role and short slot enabled (both admin and oper modes) but we have atleast one STA connected with |
| 2272 | * only long slot enabled, we need to change our beacon/pb rsp to broadcast short slot disabled |
| 2273 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2275 | (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2276 | { |
| 2277 | // enable long slot time |
| 2278 | pBeaconParams->fShortSlotTime = false; |
| 2279 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2280 | PELOG1(limLog(pMac, LOG1, FL("Disable short slot time. Enable long slot time."));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2281 | psessionEntry->shortSlotTimeSupported = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2282 | } |
| 2283 | else if ( psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2285 | if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2286 | { |
| 2287 | // enable long slot time |
| 2288 | pBeaconParams->fShortSlotTime = false; |
| 2289 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2290 | PELOG1(limLog(pMac, LOG1, FL("Disable short slot time. Enable long slot time."));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2291 | psessionEntry->shortSlotTimeSupported = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2292 | } |
| 2293 | } |
| 2294 | } |
| 2295 | } |
| 2296 | } |
| 2297 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2298 | |
| 2299 | /** ------------------------------------------------------------- |
| 2300 | \fn limDecideStaProtectionOnAssoc |
| 2301 | \brief Decide protection related settings on Sta while association. |
| 2302 | \param tpAniSirGlobal pMac |
| 2303 | \param tpSchBeaconStruct pBeaconStruct |
| 2304 | \return None |
| 2305 | -------------------------------------------------------------*/ |
| 2306 | void |
| 2307 | limDecideStaProtectionOnAssoc(tpAniSirGlobal pMac, |
| 2308 | tpSchBeaconStruct pBeaconStruct, tpPESession psessionEntry) |
| 2309 | { |
| 2310 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 2311 | tANI_U32 phyMode = WNI_CFG_PHY_MODE_NONE; |
| 2312 | |
| 2313 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 2314 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2315 | |
| 2316 | if(SIR_BAND_5_GHZ == rfBand) |
| 2317 | { |
| 2318 | if((eSIR_HT_OP_MODE_MIXED == pBeaconStruct->HTInfo.opMode) || |
| 2319 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBeaconStruct->HTInfo.opMode)) |
| 2320 | { |
| 2321 | if(pMac->lim.cfgProtection.fromlla) |
| 2322 | psessionEntry->beaconParams.llaCoexist = true; |
| 2323 | } |
| 2324 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBeaconStruct->HTInfo.opMode) |
| 2325 | { |
| 2326 | if(pMac->lim.cfgProtection.ht20) |
| 2327 | psessionEntry->beaconParams.ht20Coexist = true; |
| 2328 | } |
| 2329 | |
| 2330 | } |
| 2331 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 2332 | { |
| 2333 | //spec 7.3.2.13 |
| 2334 | //UseProtection will be set when nonERP STA is associated. |
| 2335 | //NonERPPresent bit will be set when: |
| 2336 | //--nonERP Sta is associated OR |
| 2337 | //--nonERP Sta exists in overlapping BSS |
| 2338 | //when useProtection is not set then protection from nonERP stations is optional. |
| 2339 | |
| 2340 | //CFG protection from 11b is enabled and |
| 2341 | //11B device in the BSS |
| 2342 | /* TODO, This is not sessionized */ |
| 2343 | if (phyMode != WNI_CFG_PHY_MODE_11B) |
| 2344 | { |
| 2345 | if (pMac->lim.cfgProtection.fromllb && |
| 2346 | pBeaconStruct->erpPresent && |
| 2347 | (pBeaconStruct->erpIEInfo.useProtection || |
| 2348 | pBeaconStruct->erpIEInfo.nonErpPresent)) |
| 2349 | { |
| 2350 | psessionEntry->beaconParams.llbCoexist = true; |
| 2351 | } |
| 2352 | //AP has no 11b station associated. |
| 2353 | else |
| 2354 | { |
| 2355 | psessionEntry->beaconParams.llbCoexist = false; |
| 2356 | } |
| 2357 | } |
| 2358 | //following code block is only for HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2359 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2360 | (pBeaconStruct->HTInfo.present)) |
| 2361 | { |
| 2362 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2363 | |
| 2364 | //Obss Non HT STA present mode |
| 2365 | psessionEntry->beaconParams.gHTObssMode = (tANI_U8)htInfo.obssNonHTStaPresent; |
| 2366 | |
| 2367 | |
| 2368 | //CFG protection from 11G is enabled and |
| 2369 | //our AP has at least one 11G station associated. |
| 2370 | if(pMac->lim.cfgProtection.fromllg && |
| 2371 | ((eSIR_HT_OP_MODE_MIXED == htInfo.opMode) || |
| 2372 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == htInfo.opMode))&& |
| 2373 | (!psessionEntry->beaconParams.llbCoexist)) |
| 2374 | { |
| 2375 | if(pMac->lim.cfgProtection.fromllg) |
| 2376 | psessionEntry->beaconParams.llgCoexist = true; |
| 2377 | } |
| 2378 | |
| 2379 | //AP has only HT stations associated and at least one station is HT 20 |
| 2380 | //disable protection from any non-HT devices. |
| 2381 | //decision for disabling protection from 11b has already been taken above. |
| 2382 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == htInfo.opMode) |
| 2383 | { |
| 2384 | //Disable protection from 11G station. |
| 2385 | psessionEntry->beaconParams.llgCoexist = false; |
| 2386 | //CFG protection from HT 20 is enabled. |
| 2387 | if(pMac->lim.cfgProtection.ht20) |
| 2388 | psessionEntry->beaconParams.ht20Coexist = true; |
| 2389 | } |
| 2390 | //Disable protection from non-HT and HT20 devices. |
| 2391 | //decision for disabling protection from 11b has already been taken above. |
| 2392 | if(eSIR_HT_OP_MODE_PURE == htInfo.opMode) |
| 2393 | { |
| 2394 | psessionEntry->beaconParams.llgCoexist = false; |
| 2395 | psessionEntry->beaconParams.ht20Coexist = false; |
| 2396 | } |
| 2397 | |
| 2398 | } |
| 2399 | } |
| 2400 | |
| 2401 | //protection related factors other than HT operating mode. Applies to 2.4 GHZ as well as 5 GHZ. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2402 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2403 | (pBeaconStruct->HTInfo.present)) |
| 2404 | { |
| 2405 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2406 | psessionEntry->beaconParams.fRIFSMode = |
| 2407 | ( tANI_U8 ) htInfo.rifsMode; |
| 2408 | psessionEntry->beaconParams.llnNonGFCoexist = |
| 2409 | ( tANI_U8 )htInfo.nonGFDevicesPresent; |
| 2410 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2411 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport; |
| 2412 | } |
| 2413 | } |
| 2414 | |
| 2415 | |
| 2416 | /** ------------------------------------------------------------- |
| 2417 | \fn limDecideStaProtection |
| 2418 | \brief Decides protection related settings on Sta while processing beacon. |
| 2419 | \param tpAniSirGlobal pMac |
| 2420 | \param tpUpdateBeaconParams pBeaconParams |
| 2421 | \return None |
| 2422 | -------------------------------------------------------------*/ |
| 2423 | void |
| 2424 | limDecideStaProtection(tpAniSirGlobal pMac, |
| 2425 | tpSchBeaconStruct pBeaconStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2426 | { |
| 2427 | |
| 2428 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 2429 | tANI_U32 phyMode = WNI_CFG_PHY_MODE_NONE; |
| 2430 | |
| 2431 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 2432 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2433 | |
| 2434 | if(SIR_BAND_5_GHZ == rfBand) |
| 2435 | { |
| 2436 | //we are HT capable. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2437 | if((true == psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2438 | (pBeaconStruct->HTInfo.present)) |
| 2439 | { |
| 2440 | //we are HT capable, AP's HT OPMode is mixed / overlap legacy ==> need protection from 11A. |
| 2441 | if((eSIR_HT_OP_MODE_MIXED == pBeaconStruct->HTInfo.opMode) || |
| 2442 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBeaconStruct->HTInfo.opMode)) |
| 2443 | { |
| 2444 | limEnable11aProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2445 | } |
| 2446 | //we are HT capable, AP's HT OPMode is HT20 ==> disable protection from 11A if enabled. enabled |
| 2447 | //protection from HT20 if needed. |
| 2448 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT== pBeaconStruct->HTInfo.opMode) |
| 2449 | { |
| 2450 | limEnable11aProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2451 | limEnableHT20Protection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2452 | } |
| 2453 | else if(eSIR_HT_OP_MODE_PURE == pBeaconStruct->HTInfo.opMode) |
| 2454 | { |
| 2455 | limEnable11aProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2456 | limEnableHT20Protection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2457 | } |
| 2458 | } |
| 2459 | } |
| 2460 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 2461 | { |
| 2462 | /* spec 7.3.2.13 |
| 2463 | * UseProtection will be set when nonERP STA is associated. |
| 2464 | * NonERPPresent bit will be set when: |
| 2465 | * --nonERP Sta is associated OR |
| 2466 | * --nonERP Sta exists in overlapping BSS |
| 2467 | * when useProtection is not set then protection from nonERP stations is optional. |
| 2468 | */ |
| 2469 | |
| 2470 | if (phyMode != WNI_CFG_PHY_MODE_11B) |
| 2471 | { |
| 2472 | if (pBeaconStruct->erpPresent && |
| 2473 | (pBeaconStruct->erpIEInfo.useProtection || |
| 2474 | pBeaconStruct->erpIEInfo.nonErpPresent)) |
| 2475 | { |
| 2476 | limEnable11gProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 2477 | } |
| 2478 | //AP has no 11b station associated. |
| 2479 | else |
| 2480 | { |
| 2481 | //disable protection from 11b station |
| 2482 | limEnable11gProtection(pMac, false, false, pBeaconParams, psessionEntry); |
| 2483 | } |
| 2484 | } |
| 2485 | |
| 2486 | //following code block is only for HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2487 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2488 | (pBeaconStruct->HTInfo.present)) |
| 2489 | { |
| 2490 | |
| 2491 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2492 | //AP has at least one 11G station associated. |
| 2493 | if(((eSIR_HT_OP_MODE_MIXED == htInfo.opMode) || |
| 2494 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == htInfo.opMode))&& |
| 2495 | (!psessionEntry->beaconParams.llbCoexist)) |
| 2496 | { |
| 2497 | limEnableHtProtectionFrom11g(pMac, true, false, pBeaconParams,psessionEntry); |
| 2498 | |
| 2499 | } |
| 2500 | |
| 2501 | //no HT operating mode change ==> no change in protection settings except for MIXED_MODE/Legacy Mode. |
| 2502 | //in Mixed mode/legacy Mode even if there is no change in HT operating mode, there might be change in 11bCoexist |
| 2503 | //or 11gCoexist. that is why this check is being done after mixed/legacy mode check. |
| 2504 | if ( pMac->lim.gHTOperMode != ( tSirMacHTOperatingMode )htInfo.opMode ) |
| 2505 | { |
| 2506 | pMac->lim.gHTOperMode = ( tSirMacHTOperatingMode )htInfo.opMode; |
| 2507 | |
| 2508 | //AP has only HT stations associated and at least one station is HT 20 |
| 2509 | //disable protection from any non-HT devices. |
| 2510 | //decision for disabling protection from 11b has already been taken above. |
| 2511 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == htInfo.opMode) |
| 2512 | { |
| 2513 | //Disable protection from 11G station. |
| 2514 | limEnableHtProtectionFrom11g(pMac, false, false, pBeaconParams,psessionEntry); |
| 2515 | |
| 2516 | limEnableHT20Protection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2517 | } |
| 2518 | //Disable protection from non-HT and HT20 devices. |
| 2519 | //decision for disabling protection from 11b has already been taken above. |
| 2520 | else if(eSIR_HT_OP_MODE_PURE == htInfo.opMode) |
| 2521 | { |
| 2522 | limEnableHtProtectionFrom11g(pMac, false, false, pBeaconParams,psessionEntry); |
| 2523 | limEnableHT20Protection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2524 | |
| 2525 | } |
| 2526 | } |
| 2527 | } |
| 2528 | } |
| 2529 | |
| 2530 | //following code block is only for HT station. ( 2.4 GHZ as well as 5 GHZ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2531 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2532 | (pBeaconStruct->HTInfo.present)) |
| 2533 | { |
| 2534 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2535 | //Check for changes in protection related factors other than HT operating mode. |
| 2536 | //Check for changes in RIFS mode, nonGFDevicesPresent, lsigTXOPProtectionFullSupport. |
| 2537 | if ( psessionEntry->beaconParams.fRIFSMode != |
| 2538 | ( tANI_U8 ) htInfo.rifsMode ) |
| 2539 | { |
| 2540 | pBeaconParams->fRIFSMode = |
| 2541 | psessionEntry->beaconParams.fRIFSMode = |
| 2542 | ( tANI_U8 ) htInfo.rifsMode; |
| 2543 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 2544 | } |
| 2545 | |
| 2546 | if ( psessionEntry->beaconParams.llnNonGFCoexist != |
| 2547 | htInfo.nonGFDevicesPresent ) |
| 2548 | { |
| 2549 | pBeaconParams->llnNonGFCoexist = |
| 2550 | psessionEntry->beaconParams.llnNonGFCoexist = |
| 2551 | ( tANI_U8 )htInfo.nonGFDevicesPresent; |
| 2552 | pBeaconParams->paramChangeBitmap |= |
| 2553 | PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 2554 | } |
| 2555 | |
| 2556 | if ( psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport != |
| 2557 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport ) |
| 2558 | { |
| 2559 | pBeaconParams->fLsigTXOPProtectionFullSupport = |
| 2560 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2561 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport; |
| 2562 | pBeaconParams->paramChangeBitmap |= |
| 2563 | PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 2564 | } |
| 2565 | |
| 2566 | // For Station just update the global lim variable, no need to send message to HAL |
| 2567 | // Station already taking care of HT OPR Mode=01, meaning AP is seeing legacy |
| 2568 | //stations in overlapping BSS. |
| 2569 | if ( psessionEntry->beaconParams.gHTObssMode != ( tANI_U8 )htInfo.obssNonHTStaPresent ) |
| 2570 | psessionEntry->beaconParams.gHTObssMode = ( tANI_U8 )htInfo.obssNonHTStaPresent ; |
| 2571 | |
| 2572 | } |
| 2573 | } |
| 2574 | |
| 2575 | |
| 2576 | /** |
| 2577 | * limProcessChannelSwitchTimeout() |
| 2578 | * |
| 2579 | *FUNCTION: |
| 2580 | * This function is invoked when Channel Switch Timer expires at |
| 2581 | * the STA. Now, STA must stop traffic, and then change/disable |
| 2582 | * primary or secondary channel. |
| 2583 | * |
| 2584 | * |
| 2585 | *NOTE: |
| 2586 | * @param pMac - Pointer to Global MAC structure |
| 2587 | * @return None |
| 2588 | */ |
| 2589 | void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac) |
| 2590 | { |
| 2591 | tpPESession psessionEntry = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2592 | tANI_U8 channel; // This is received and stored from channelSwitch Action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2593 | |
| 2594 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId))== NULL) |
| 2595 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2596 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2597 | return; |
| 2598 | } |
| 2599 | |
| 2600 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2601 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2602 | PELOGW(limLog(pMac, LOGW, "Channel switch can be done only in STA role, Current Role = %d", psessionEntry->limSystemRole);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2603 | return; |
| 2604 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2605 | channel = psessionEntry->gLimChannelSwitch.primaryChannel; |
Mukul Sharma | 6b888db | 2015-08-24 20:56:07 +0530 | [diff] [blame] | 2606 | |
| 2607 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2608 | * This potentially can create issues if the function tries to set |
| 2609 | * channel while device is in power-save, hence putting an extra check |
| 2610 | * to verify if the device is in power-save or not |
| 2611 | */ |
| 2612 | if(!limIsSystemInActiveState(pMac)) |
| 2613 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2614 | PELOGW(limLog(pMac, LOGW, FL("Device is not in active state, cannot switch channel"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2615 | return; |
| 2616 | } |
| 2617 | |
| 2618 | // Restore Channel Switch parameters to default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2619 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2620 | |
| 2621 | /* Channel-switch timeout has occurred. reset the state */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2622 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_END; |
Abhishek Singh | cb255b8 | 2015-10-01 12:37:57 +0530 | [diff] [blame] | 2623 | |
| 2624 | /* |
| 2625 | * If Lim allows Switch channel on same channel on which preauth |
| 2626 | * is going on then LIM will not post resume link(WDA_FINISH_SCAN) |
| 2627 | * during preauth rsp handling hence firmware may crash on ENTER/ |
| 2628 | * EXIT BMPS request. |
| 2629 | */ |
| 2630 | if(pMac->ft.ftPEContext.pFTPreAuthReq) |
| 2631 | { |
| 2632 | limLog(pMac, LOGE, |
| 2633 | FL("Avoid Switch Channel req during pre auth")); |
| 2634 | return; |
| 2635 | } |
| 2636 | /* If link is already suspended mean some off |
| 2637 | * channel operation or scan is in progress, Allowing |
| 2638 | * Change channel here will lead to either Init Scan |
| 2639 | * sent twice or missing Finish scan when change |
| 2640 | * channel is completed, this may lead |
| 2641 | * to driver in invalid state and crash. |
| 2642 | */ |
| 2643 | if (limIsLinkSuspended(pMac)) |
| 2644 | { |
| 2645 | limLog(pMac, LOGE, FL("Link is already suspended for " |
| 2646 | "some other reason. Return here for sessionId:%d"), |
| 2647 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId); |
| 2648 | return; |
| 2649 | } |
| 2650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | /* Check if the AP is switching to a channel that we support. |
| 2652 | * Else, just don't bother to switch. Indicate HDD to look for a |
| 2653 | * better AP to associate |
| 2654 | */ |
| 2655 | if(!limIsChannelValidForChannelSwitch(pMac, channel)) |
| 2656 | { |
| 2657 | /* We need to restore pre-channelSwitch state on the STA */ |
| 2658 | if(limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2659 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2660 | limLog(pMac, LOGP, FL("Could not restore pre-channelSwitch (11h) state, resetting the system")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2661 | return; |
| 2662 | } |
| 2663 | |
| 2664 | /* If the channel-list that AP is asking us to switch is invalid, |
| 2665 | * then we cannot switch the channel. Just disassociate from AP. |
| 2666 | * We will find a better AP !!! |
| 2667 | */ |
| 2668 | limTearDownLinkWithAp(pMac, |
| 2669 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId, |
| 2670 | eSIR_MAC_UNSPEC_FAILURE_REASON); |
| 2671 | return; |
| 2672 | } |
Kiran Kumar Lokere | b8bb684 | 2013-08-12 16:40:24 -0700 | [diff] [blame] | 2673 | limCovertChannelScanType(pMac, psessionEntry->currentOperChannel, false); |
| 2674 | pMac->lim.dfschannelList.timeStamp[psessionEntry->currentOperChannel] = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2675 | switch(psessionEntry->gLimChannelSwitch.state) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2676 | { |
| 2677 | case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY: |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 2678 | case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY: |
| 2679 | if ( isLimSessionOffChannel(pMac, |
| 2680 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId) ) |
| 2681 | { |
| 2682 | limSuspendLink(pMac, |
| 2683 | eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN, |
| 2684 | limProcessChannelSwitchSuspendLink, |
| 2685 | (tANI_U32*)psessionEntry ); |
| 2686 | } |
| 2687 | else |
| 2688 | { |
| 2689 | limProcessChannelSwitchSuspendLink(pMac, |
| 2690 | eHAL_STATUS_SUCCESS, |
| 2691 | (tANI_U32*)psessionEntry); |
| 2692 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2693 | break; |
| 2694 | |
| 2695 | case eLIM_CHANNEL_SWITCH_SECONDARY_ONLY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2696 | PELOGW(limLog(pMac, LOGW, FL("CHANNEL_SWITCH_SECONDARY_ONLY "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2697 | limSwitchPrimarySecondaryChannel(pMac, psessionEntry, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2698 | psessionEntry->currentOperChannel, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2699 | psessionEntry->gLimChannelSwitch.secondarySubBand); |
| 2700 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2701 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2702 | case eLIM_CHANNEL_SWITCH_IDLE: |
| 2703 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2704 | PELOGE(limLog(pMac, LOGE, FL("incorrect state "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | if(limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2706 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2707 | limLog(pMac, LOGP, FL("Could not restore pre-channelSwitch (11h) state, resetting the system")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | } |
| 2709 | return; /* Please note, this is 'return' and not 'break' */ |
| 2710 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2711 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2712 | |
| 2713 | /** |
| 2714 | * limUpdateChannelSwitch() |
| 2715 | * |
| 2716 | *FUNCTION: |
| 2717 | * This function is invoked whenever Station receives |
| 2718 | * either 802.11h channel switch IE or airgo proprietary |
| 2719 | * channel switch IE. |
| 2720 | * |
| 2721 | *NOTE: |
| 2722 | * @param pMac - Pointer to Global MAC structure |
| 2723 | * @return tpSirProbeRespBeacon - Pointer to Beacon/Probe Rsp |
| 2724 | * @param psessionentry |
| 2725 | */ |
| 2726 | void |
| 2727 | limUpdateChannelSwitch(struct sAniSirGlobal *pMac, tpSirProbeRespBeacon pBeacon, tpPESession psessionEntry) |
| 2728 | { |
| 2729 | |
| 2730 | tANI_U16 beaconPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2731 | tChannelSwitchPropIEStruct *pPropChnlSwitch; |
| 2732 | tDot11fIEChanSwitchAnn *pChnlSwitch; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2733 | #ifdef WLAN_FEATURE_11AC |
| 2734 | tDot11fIEWiderBWChanSwitchAnn *pWiderChnlSwitch; |
| 2735 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2736 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2737 | beaconPeriod = psessionEntry->beaconParams.beaconInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2738 | |
| 2739 | /* STA either received proprietary channel switch IE or 802.11h |
| 2740 | * standard channel switch IE. |
| 2741 | */ |
| 2742 | if (pBeacon->propIEinfo.propChannelSwitchPresent) |
| 2743 | { |
| 2744 | pPropChnlSwitch = &(pBeacon->propIEinfo.channelSwitch); |
| 2745 | |
| 2746 | /* Add logic to determine which change this is: */ |
| 2747 | /* primary, secondary, both. For now assume both. */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2748 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2749 | psessionEntry->gLimChannelSwitch.primaryChannel = pPropChnlSwitch->primaryChannel; |
| 2750 | psessionEntry->gLimChannelSwitch.secondarySubBand = (ePhyChanBondState)pPropChnlSwitch->subBand; |
| 2751 | psessionEntry->gLimChannelSwitch.switchCount = pPropChnlSwitch->channelSwitchCount; |
| 2752 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2753 | SYS_MS_TO_TICKS(beaconPeriod)* (pPropChnlSwitch->channelSwitchCount); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2754 | psessionEntry->gLimChannelSwitch.switchMode = pPropChnlSwitch->mode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2755 | } |
| 2756 | else |
| 2757 | { |
| 2758 | pChnlSwitch = &(pBeacon->channelSwitchIE); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2759 | psessionEntry->gLimChannelSwitch.primaryChannel = pChnlSwitch->newChannel; |
| 2760 | psessionEntry->gLimChannelSwitch.switchCount = pChnlSwitch->switchCount; |
| 2761 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2762 | SYS_MS_TO_TICKS(beaconPeriod)* (pChnlSwitch->switchCount); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2763 | psessionEntry->gLimChannelSwitch.switchMode = pChnlSwitch->switchMode; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2764 | #ifdef WLAN_FEATURE_11AC |
| 2765 | pWiderChnlSwitch = &(pBeacon->WiderBWChanSwitchAnn); |
| 2766 | if(pBeacon->WiderBWChanSwitchAnnPresent) |
| 2767 | { |
| 2768 | psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pWiderChnlSwitch->newChanWidth; |
| 2769 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pWiderChnlSwitch->newCenterChanFreq0; |
| 2770 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pWiderChnlSwitch->newCenterChanFreq1; |
| 2771 | } |
| 2772 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2773 | |
| 2774 | /* Only primary channel switch element is present */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2775 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 2776 | psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2777 | |
| 2778 | /* Do not bother to look and operate on extended channel switch element |
| 2779 | * if our own channel-bonding state is not enabled |
| 2780 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2781 | if (psessionEntry->htSupportedChannelWidthSet) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2782 | { |
| 2783 | if (pBeacon->extChannelSwitchPresent) |
| 2784 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2785 | if ((pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 2786 | (pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2787 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2788 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2789 | psessionEntry->gLimChannelSwitch.secondarySubBand = pBeacon->extChannelSwitchIE.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2790 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2791 | #ifdef WLAN_FEATURE_11AC |
| 2792 | if(psessionEntry->vhtCapability && pBeacon->WiderBWChanSwitchAnnPresent) |
| 2793 | { |
| 2794 | if (pWiderChnlSwitch->newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 2795 | { |
| 2796 | if(pBeacon->extChannelSwitchPresent) |
| 2797 | { |
| 2798 | if ((pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 2799 | (pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
| 2800 | { |
| 2801 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2802 | psessionEntry->gLimChannelSwitch.secondarySubBand = limGet11ACPhyCBState(pMac, |
| 2803 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 2804 | pBeacon->extChannelSwitchIE.secondaryChannelOffset, |
| 2805 | pWiderChnlSwitch->newCenterChanFreq0, |
| 2806 | psessionEntry); |
| 2807 | } |
| 2808 | } |
| 2809 | } |
| 2810 | } |
| 2811 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2812 | } |
| 2813 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2814 | } |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 2815 | |
| 2816 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2817 | if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry)) |
| 2818 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2819 | PELOGW(limLog(pMac, LOGW, FL("Could not start Channel Switch"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2820 | } |
| 2821 | |
| 2822 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2823 | FL("session %d primary chl %d, subband %d, count %d (%d ticks) "), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2824 | psessionEntry->peSessionId, |
| 2825 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 2826 | psessionEntry->gLimChannelSwitch.secondarySubBand, |
| 2827 | psessionEntry->gLimChannelSwitch.switchCount, |
| 2828 | psessionEntry->gLimChannelSwitch.switchTimeoutValue); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2829 | return; |
| 2830 | } |
| 2831 | |
| 2832 | /** |
| 2833 | * limCancelDot11hChannelSwitch |
| 2834 | * |
| 2835 | *FUNCTION: |
| 2836 | * This function is called when STA does not send updated channel-swith IE |
| 2837 | * after indicating channel-switch start. This will cancel the channel-swith |
| 2838 | * timer which is already running. |
| 2839 | * |
| 2840 | *LOGIC: |
| 2841 | * |
| 2842 | *ASSUMPTIONS: |
| 2843 | * |
| 2844 | *NOTE: |
| 2845 | * |
| 2846 | * @param pMac - Pointer to Global MAC structure |
| 2847 | * |
| 2848 | * @return None |
| 2849 | */ |
| 2850 | void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 2851 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2852 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2853 | return; |
| 2854 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2855 | PELOGW(limLog(pMac, LOGW, FL("Received a beacon without channel switch IE"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2856 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2857 | |
| 2858 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 2859 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2860 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2861 | } |
| 2862 | |
| 2863 | /* We need to restore pre-channelSwitch state on the STA */ |
| 2864 | if (limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2865 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2866 | PELOGE(limLog(pMac, LOGE, FL("LIM: Could not restore pre-channelSwitch (11h) state, resetting the system"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2867 | |
| 2868 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2869 | } |
| 2870 | |
| 2871 | /**---------------------------------------------- |
| 2872 | \fn limCancelDot11hQuiet |
| 2873 | \brief Cancel the quieting on Station if latest |
| 2874 | beacon doesn't contain quiet IE in it. |
| 2875 | |
| 2876 | \param pMac |
| 2877 | \return NONE |
| 2878 | -----------------------------------------------*/ |
| 2879 | void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 2880 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2881 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2882 | return; |
| 2883 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2884 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2885 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2886 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2887 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS) |
| 2888 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2889 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2890 | } |
| 2891 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2892 | else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2893 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2894 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2895 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS) |
| 2896 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2897 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2898 | } |
| 2899 | /** |
| 2900 | * If the channel switch is already running in silent mode, dont resume the |
| 2901 | * transmission. Channel switch timer when timeout, transmission will be resumed. |
| 2902 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2903 | if(!((psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) && |
| 2904 | (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2905 | { |
| 2906 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2907 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2908 | } |
| 2909 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2910 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2911 | } |
| 2912 | |
| 2913 | /** |
| 2914 | * limProcessQuietTimeout |
| 2915 | * |
| 2916 | * FUNCTION: |
| 2917 | * This function is active only on the STA. |
| 2918 | * Handles SIR_LIM_QUIET_TIMEOUT |
| 2919 | * |
| 2920 | * LOGIC: |
| 2921 | * This timeout can occur under only one circumstance: |
| 2922 | * |
| 2923 | * 1) When gLimQuietState = eLIM_QUIET_BEGIN |
| 2924 | * This indicates that the timeout "interval" has |
| 2925 | * expired. This is a trigger for the STA to now |
| 2926 | * shut-off Tx/Rx for the specified gLimQuietDuration |
| 2927 | * -> The TIMER object gLimQuietBssTimer is |
| 2928 | * activated |
| 2929 | * -> With timeout = gLimQuietDuration |
| 2930 | * -> gLimQuietState is set to eLIM_QUIET_RUNNING |
| 2931 | * |
| 2932 | * ASSUMPTIONS: |
| 2933 | * Using two TIMER objects - |
| 2934 | * gLimQuietTimer & gLimQuietBssTimer |
| 2935 | * |
| 2936 | * NOTE: |
| 2937 | * |
| 2938 | * @param pMac - Pointer to Global MAC structure |
| 2939 | * |
| 2940 | * @return None |
| 2941 | */ |
| 2942 | void limProcessQuietTimeout(tpAniSirGlobal pMac) |
| 2943 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2944 | //fetch the sessionEntry based on the sessionId |
| 2945 | //priority - MEDIUM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2946 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2947 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2948 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimQuietTimer.sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2949 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2950 | limLog(pMac, LOGE,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2951 | return; |
| 2952 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2953 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2954 | limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2955 | switch( psessionEntry->gLimSpecMgmt.quietState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | { |
| 2957 | case eLIM_QUIET_BEGIN: |
| 2958 | // Time to Stop data traffic for quietDuration |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2959 | //limDeactivateAndChangeTimer(pMac, eLIM_QUIET_BSS_TIMER); |
| 2960 | if (TX_SUCCESS != |
| 2961 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer)) |
| 2962 | { |
| 2963 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2964 | FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2965 | } |
| 2966 | |
| 2967 | // gLimQuietDuration appears to be in units of ticks |
| 2968 | // Use it as is |
| 2969 | if (TX_SUCCESS != |
| 2970 | tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer, |
| 2971 | psessionEntry->gLimSpecMgmt.quietDuration, |
| 2972 | 0)) |
| 2973 | { |
| 2974 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2975 | FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2976 | } |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 2977 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, pMac->lim.limTimers.gLimQuietTimer.sessionId, eLIM_QUIET_BSS_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2978 | #ifdef GEN6_TODO |
| 2979 | /* revisit this piece of code to assign the appropriate sessionId below |
| 2980 | * priority - HIGH |
| 2981 | */ |
| 2982 | pMac->lim.limTimers.gLimQuietBssTimer.sessionId = sessionId; |
| 2983 | #endif |
| 2984 | if( TX_SUCCESS != |
| 2985 | tx_timer_activate( &pMac->lim.limTimers.gLimQuietBssTimer )) |
| 2986 | { |
| 2987 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2988 | FL("Unable to activate gLimQuietBssTimer! The STA will be unable to honor Quiet BSS...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2989 | } |
| 2990 | else |
| 2991 | { |
| 2992 | // Transition to eLIM_QUIET_RUNNING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2993 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_RUNNING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2994 | |
| 2995 | /* If we have sta bk scan triggered and trigger bk scan actually started successfully, */ |
| 2996 | /* print message, otherwise, stop data traffic and stay quiet */ |
| 2997 | if( pMac->lim.gLimTriggerBackgroundScanDuringQuietBss && |
| 2998 | (eSIR_TRUE == (glimTriggerBackgroundScanDuringQuietBss_Status = limTriggerBackgroundScanDuringQuietBss( pMac ))) ) |
| 2999 | { |
| 3000 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3001 | FL("Attempting to trigger a background scan...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3002 | } |
| 3003 | else |
| 3004 | { |
| 3005 | // Shut-off Tx/Rx for gLimSpecMgmt.quietDuration |
| 3006 | /* freeze the transmission */ |
| 3007 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX); |
| 3008 | |
| 3009 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3010 | FL("Quiet BSS: STA shutting down for %d ticks"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3011 | psessionEntry->gLimSpecMgmt.quietDuration ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3012 | } |
| 3013 | } |
| 3014 | break; |
| 3015 | |
| 3016 | case eLIM_QUIET_RUNNING: |
| 3017 | case eLIM_QUIET_INIT: |
| 3018 | case eLIM_QUIET_END: |
| 3019 | default: |
| 3020 | // |
| 3021 | // As of now, nothing to be done |
| 3022 | // |
| 3023 | break; |
| 3024 | } |
| 3025 | } |
| 3026 | |
| 3027 | /** |
| 3028 | * limProcessQuietBssTimeout |
| 3029 | * |
| 3030 | * FUNCTION: |
| 3031 | * This function is active on the AP and STA. |
| 3032 | * Handles SIR_LIM_QUIET_BSS_TIMEOUT |
| 3033 | * |
| 3034 | * LOGIC: |
| 3035 | * On the AP - |
| 3036 | * When the SIR_LIM_QUIET_BSS_TIMEOUT is triggered, it is |
| 3037 | * an indication for the AP to START sending out the |
| 3038 | * Quiet BSS IE. |
| 3039 | * If 802.11H is enabled, the Quiet BSS IE is sent as per |
| 3040 | * the 11H spec |
| 3041 | * If 802.11H is not enabled, the Quiet BSS IE is sent as |
| 3042 | * a Proprietary IE. This will be understood by all the |
| 3043 | * TITAN STA's |
| 3044 | * Transitioning gLimQuietState to eLIM_QUIET_BEGIN will |
| 3045 | * initiate the SCH to include the Quiet BSS IE in all |
| 3046 | * its subsequent Beacons/PR's. |
| 3047 | * The Quiet BSS IE will be included in all the Beacons |
| 3048 | * & PR's until the next DTIM period |
| 3049 | * |
| 3050 | * On the STA - |
| 3051 | * When gLimQuietState = eLIM_QUIET_RUNNING |
| 3052 | * This indicates that the STA was successfully shut-off |
| 3053 | * for the specified gLimQuietDuration. This is a trigger |
| 3054 | * for the STA to now resume data traffic. |
| 3055 | * -> gLimQuietState is set to eLIM_QUIET_INIT |
| 3056 | * |
| 3057 | * ASSUMPTIONS: |
| 3058 | * |
| 3059 | * NOTE: |
| 3060 | * |
| 3061 | * @param pMac - Pointer to Global MAC structure |
| 3062 | * |
| 3063 | * @return None |
| 3064 | */ |
| 3065 | void limProcessQuietBssTimeout( tpAniSirGlobal pMac ) |
| 3066 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3067 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3068 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3069 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimQuietBssTimer.sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3070 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3071 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3072 | return; |
| 3073 | } |
| 3074 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3075 | limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3076 | if (eLIM_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3077 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3078 | } |
| 3079 | else |
| 3080 | { |
| 3081 | // eLIM_STA_ROLE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3082 | switch( psessionEntry->gLimSpecMgmt.quietState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3083 | { |
| 3084 | case eLIM_QUIET_RUNNING: |
| 3085 | // Transition to eLIM_QUIET_INIT |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3086 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3087 | |
| 3088 | if( !pMac->lim.gLimTriggerBackgroundScanDuringQuietBss || (glimTriggerBackgroundScanDuringQuietBss_Status == eSIR_FALSE) ) |
| 3089 | { |
| 3090 | // Resume data traffic only if channel switch is not running in silent mode. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3091 | if (!((psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) && |
| 3092 | (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3093 | { |
| 3094 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3095 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | } |
| 3097 | |
| 3098 | /* Reset status flag */ |
| 3099 | if(glimTriggerBackgroundScanDuringQuietBss_Status == eSIR_FALSE) |
| 3100 | glimTriggerBackgroundScanDuringQuietBss_Status = eSIR_TRUE; |
| 3101 | |
| 3102 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3103 | FL("Quiet BSS: Resuming traffic...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3104 | } |
| 3105 | else |
| 3106 | { |
| 3107 | // |
| 3108 | // Nothing specific to be done in this case |
| 3109 | // A background scan that was triggered during |
| 3110 | // SIR_LIM_QUIET_TIMEOUT will complete on its own |
| 3111 | // |
| 3112 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3113 | FL("Background scan should be complete now...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | } |
| 3115 | break; |
| 3116 | |
| 3117 | case eLIM_QUIET_INIT: |
| 3118 | case eLIM_QUIET_BEGIN: |
| 3119 | case eLIM_QUIET_END: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3120 | PELOG2(limLog(pMac, LOG2, FL("Quiet state not in RUNNING"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3121 | /* If the quiet period has ended, then resume the frame transmission */ |
| 3122 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3123 | limRestorePreQuietState(pMac, psessionEntry); |
| 3124 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3125 | break; |
| 3126 | |
| 3127 | default: |
| 3128 | // |
| 3129 | // As of now, nothing to be done |
| 3130 | // |
| 3131 | break; |
| 3132 | } |
| 3133 | } |
| 3134 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3135 | /** |
| 3136 | * limProcessWPSOverlapTimeout |
| 3137 | * |
| 3138 | * FUNCTION: This function call limWPSPBCTimeout() to clean WPS PBC probe request entries |
| 3139 | * |
| 3140 | * LOGIC: |
| 3141 | * |
| 3142 | * ASSUMPTIONS: |
| 3143 | * |
| 3144 | * NOTE: |
| 3145 | * |
| 3146 | * @param pMac - Pointer to Global MAC structure |
| 3147 | * |
| 3148 | * @return None |
| 3149 | */ |
| 3150 | #if 0 |
| 3151 | void limProcessWPSOverlapTimeout(tpAniSirGlobal pMac) |
| 3152 | { |
| 3153 | |
| 3154 | tpPESession psessionEntry; |
| 3155 | tANI_U32 sessionId; |
| 3156 | |
| 3157 | if (tx_timer_activate(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS) |
| 3158 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3159 | limLog(pMac, LOGP, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3160 | } |
| 3161 | |
| 3162 | sessionId = pMac->lim.limTimers.gLimWPSOverlapTimerObj.sessionId; |
| 3163 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3164 | PELOGE(limLog(pMac, LOGE, FL("WPS overlap timeout, sessionId=%d"), sessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3165 | |
| 3166 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId)) == NULL) |
| 3167 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3168 | PELOGE(limLog(pMac, LOGP,FL("Session Does not exist for given sessionID"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3169 | return; |
| 3170 | } |
| 3171 | |
| 3172 | limWPSPBCTimeout(pMac, psessionEntry); |
| 3173 | } |
| 3174 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3176 | /**---------------------------------------------- |
| 3177 | \fn limStartQuietTimer |
| 3178 | \brief Starts the quiet timer. |
| 3179 | |
| 3180 | \param pMac |
| 3181 | \return NONE |
| 3182 | -----------------------------------------------*/ |
| 3183 | void limStartQuietTimer(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 3184 | { |
| 3185 | tpPESession psessionEntry; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 3186 | psessionEntry = peFindSessionBySessionId(pMac, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3187 | |
| 3188 | if(psessionEntry == NULL) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3189 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | return; |
| 3191 | } |
| 3192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3193 | |
| 3194 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 3195 | return; |
| 3196 | // First, de-activate Timer, if its already active |
| 3197 | limCancelDot11hQuiet(pMac, psessionEntry); |
| 3198 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3199 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_QUIET_TIMER)); |
| 3200 | if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 3201 | { |
| 3202 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3203 | FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3204 | } |
| 3205 | |
| 3206 | // Set the NEW timeout value, in ticks |
| 3207 | if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer, |
| 3208 | SYS_MS_TO_TICKS(psessionEntry->gLimSpecMgmt.quietTimeoutValue), 0)) |
| 3209 | { |
| 3210 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3211 | FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3212 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3213 | |
| 3214 | pMac->lim.limTimers.gLimQuietTimer.sessionId = sessionId; |
| 3215 | if( TX_SUCCESS != tx_timer_activate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 3216 | { |
| 3217 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3218 | FL("Unable to activate gLimQuietTimer! STA cannot honor Quiet BSS!")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3219 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3221 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3222 | return; |
| 3223 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3224 | } |
| 3225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3226 | |
| 3227 | /** ------------------------------------------------------------------------ **/ |
| 3228 | /** |
| 3229 | * keep track of the number of ANI peers associated in the BSS |
| 3230 | * For the first and last ANI peer, we have to update EDCA params as needed |
| 3231 | * |
| 3232 | * When the first ANI peer joins the BSS, we notify SCH |
| 3233 | * When the last ANI peer leaves the BSS, we notfiy SCH |
| 3234 | */ |
| 3235 | void |
| 3236 | limUtilCountStaAdd( |
| 3237 | tpAniSirGlobal pMac, |
| 3238 | tpDphHashNode pSta, |
| 3239 | tpPESession psessionEntry) |
| 3240 | { |
| 3241 | |
| 3242 | if ((! pSta) || (! pSta->valid) || (! pSta->aniPeer) || (pSta->fAniCount)) |
| 3243 | return; |
| 3244 | |
| 3245 | pSta->fAniCount = 1; |
| 3246 | |
| 3247 | if (pMac->lim.gLimNumOfAniSTAs++ != 0) |
| 3248 | return; |
| 3249 | |
| 3250 | // get here only if this is the first ANI peer in the BSS |
| 3251 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 3252 | } |
| 3253 | |
| 3254 | void |
| 3255 | limUtilCountStaDel( |
| 3256 | tpAniSirGlobal pMac, |
| 3257 | tpDphHashNode pSta, |
| 3258 | tpPESession psessionEntry) |
| 3259 | { |
| 3260 | |
| 3261 | if ((pSta == NULL) || (pSta->aniPeer == eHAL_CLEAR) || (! pSta->fAniCount)) |
| 3262 | return; |
| 3263 | |
| 3264 | /* Only if sta is invalid and the validInDummyState bit is set to 1, |
| 3265 | * then go ahead and update the count and profiles. This ensures |
| 3266 | * that the "number of ani station" count is properly incremented/decremented. |
| 3267 | */ |
| 3268 | if (pSta->valid == 1) |
| 3269 | return; |
| 3270 | |
| 3271 | pSta->fAniCount = 0; |
| 3272 | |
| 3273 | if (pMac->lim.gLimNumOfAniSTAs <= 0) |
| 3274 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3275 | limLog(pMac, LOGE, FL("CountStaDel: ignoring Delete Req when AniPeer count is %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3276 | pMac->lim.gLimNumOfAniSTAs); |
| 3277 | return; |
| 3278 | } |
| 3279 | |
| 3280 | pMac->lim.gLimNumOfAniSTAs--; |
| 3281 | |
| 3282 | if (pMac->lim.gLimNumOfAniSTAs != 0) |
| 3283 | return; |
| 3284 | |
| 3285 | // get here only if this is the last ANI peer in the BSS |
| 3286 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 3287 | } |
| 3288 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3289 | /** |
| 3290 | * limSwitchChannelCback() |
| 3291 | * |
| 3292 | *FUNCTION: |
| 3293 | * This is the callback function registered while requesting to switch channel |
| 3294 | * after AP indicates a channel switch for spectrum management (11h). |
| 3295 | * |
| 3296 | *NOTE: |
| 3297 | * @param pMac Pointer to Global MAC structure |
| 3298 | * @param status Status of channel switch request |
| 3299 | * @param data User data |
| 3300 | * @param psessionEntry Session information |
| 3301 | * @return NONE |
| 3302 | */ |
| 3303 | void limSwitchChannelCback(tpAniSirGlobal pMac, eHalStatus status, |
| 3304 | tANI_U32 *data, tpPESession psessionEntry) |
| 3305 | { |
| 3306 | tSirMsgQ mmhMsg = {0}; |
| 3307 | tSirSmeSwitchChannelInd *pSirSmeSwitchChInd; |
| 3308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3309 | psessionEntry->currentOperChannel = psessionEntry->currentReqChannel; |
| 3310 | |
| 3311 | /* We need to restore pre-channelSwitch state on the STA */ |
| 3312 | if (limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 3313 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3314 | limLog(pMac, LOGP, FL("Could not restore pre-channelSwitch (11h) state, resetting the system")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3315 | return; |
| 3316 | } |
| 3317 | |
| 3318 | mmhMsg.type = eWNI_SME_SWITCH_CHL_REQ; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 3319 | pSirSmeSwitchChInd = vos_mem_malloc(sizeof(tSirSmeSwitchChannelInd)); |
| 3320 | if ( NULL == pSirSmeSwitchChInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3321 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3322 | limLog(pMac, LOGP, FL("Failed to allocate buffer for buffer descriptor")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | return; |
| 3324 | } |
| 3325 | |
| 3326 | pSirSmeSwitchChInd->messageType = eWNI_SME_SWITCH_CHL_REQ; |
| 3327 | pSirSmeSwitchChInd->length = sizeof(tSirSmeSwitchChannelInd); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3328 | pSirSmeSwitchChInd->newChannelId = psessionEntry->gLimChannelSwitch.primaryChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3329 | pSirSmeSwitchChInd->sessionId = psessionEntry->smeSessionId; |
| 3330 | //BSS ID |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 3331 | vos_mem_copy( pSirSmeSwitchChInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3332 | mmhMsg.bodyptr = pSirSmeSwitchChInd; |
| 3333 | mmhMsg.bodyval = 0; |
| 3334 | |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 3335 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, |
| 3336 | mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3337 | SysProcessMmhMsg(pMac, &mmhMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3338 | } |
| 3339 | |
| 3340 | /** |
| 3341 | * limSwitchPrimaryChannel() |
| 3342 | * |
| 3343 | *FUNCTION: |
| 3344 | * This function changes the current operating channel |
| 3345 | * and sets the new new channel ID in WNI_CFG_CURRENT_CHANNEL. |
| 3346 | * |
| 3347 | *NOTE: |
| 3348 | * @param pMac Pointer to Global MAC structure |
| 3349 | * @param newChannel new chnannel ID |
| 3350 | * @return NONE |
| 3351 | */ |
| 3352 | void limSwitchPrimaryChannel(tpAniSirGlobal pMac, tANI_U8 newChannel,tpPESession psessionEntry) |
| 3353 | { |
| 3354 | #if !defined WLAN_FEATURE_VOWIFI |
| 3355 | tANI_U32 localPwrConstraint; |
| 3356 | #endif |
| 3357 | |
Abhishek Singh | 127a844 | 2014-12-15 17:31:27 +0530 | [diff] [blame] | 3358 | limLog(pMac, LOG1, FL(" old chnl %d --> new chnl %d "), |
| 3359 | psessionEntry->currentOperChannel, newChannel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | psessionEntry->currentReqChannel = newChannel; |
| 3361 | psessionEntry->limRFBand = limGetRFBand(newChannel); |
| 3362 | |
| 3363 | psessionEntry->channelChangeReasonCode=LIM_SWITCH_CHANNEL_OPERATION; |
| 3364 | |
| 3365 | pMac->lim.gpchangeChannelCallback = limSwitchChannelCback; |
| 3366 | pMac->lim.gpchangeChannelData = NULL; |
| 3367 | |
| 3368 | #if defined WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3369 | limSendSwitchChnlParams(pMac, newChannel, PHY_SINGLE_CHANNEL_CENTERED, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3370 | psessionEntry->maxTxPower, psessionEntry->peSessionId); |
| 3371 | #else |
| 3372 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) |
| 3373 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3374 | limLog( pMac, LOGP, FL( "Unable to read Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3375 | return; |
| 3376 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3377 | limSendSwitchChnlParams(pMac, newChannel, PHY_SINGLE_CHANNEL_CENTERED, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3378 | (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
| 3379 | #endif |
| 3380 | return; |
| 3381 | } |
| 3382 | |
| 3383 | /** |
| 3384 | * limSwitchPrimarySecondaryChannel() |
| 3385 | * |
| 3386 | *FUNCTION: |
| 3387 | * This function changes the primary and secondary channel. |
| 3388 | * If 11h is enabled and user provides a "new channel ID" |
| 3389 | * that is different from the current operating channel, |
| 3390 | * then we must set this new channel in WNI_CFG_CURRENT_CHANNEL, |
| 3391 | * assign notify LIM of such change. |
| 3392 | * |
| 3393 | *NOTE: |
| 3394 | * @param pMac Pointer to Global MAC structure |
| 3395 | * @param newChannel New chnannel ID (or current channel ID) |
| 3396 | * @param subband CB secondary info: |
| 3397 | * - eANI_CB_SECONDARY_NONE |
| 3398 | * - eANI_CB_SECONDARY_UP |
| 3399 | * - eANI_CB_SECONDARY_DOWN |
| 3400 | * @return NONE |
| 3401 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3402 | void limSwitchPrimarySecondaryChannel(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U8 newChannel, ePhyChanBondState subband) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3403 | { |
| 3404 | #if !defined WLAN_FEATURE_VOWIFI |
| 3405 | tANI_U32 localPwrConstraint; |
| 3406 | #endif |
| 3407 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3408 | #if !defined WLAN_FEATURE_VOWIFI |
| 3409 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3410 | limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3411 | return; |
| 3412 | } |
| 3413 | #endif |
Abhishek Singh | 27924ba | 2014-11-18 13:11:11 +0530 | [diff] [blame] | 3414 | /* Assign the callback to resume TX once channel is changed. |
| 3415 | */ |
| 3416 | psessionEntry->currentReqChannel = newChannel; |
| 3417 | psessionEntry->limRFBand = limGetRFBand(newChannel); |
| 3418 | |
| 3419 | psessionEntry->channelChangeReasonCode=LIM_SWITCH_CHANNEL_OPERATION; |
| 3420 | |
| 3421 | pMac->lim.gpchangeChannelCallback = limSwitchChannelCback; |
| 3422 | pMac->lim.gpchangeChannelData = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3424 | #if defined WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3425 | limSendSwitchChnlParams(pMac, newChannel, subband, psessionEntry->maxTxPower, psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3426 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3427 | limSendSwitchChnlParams(pMac, newChannel, subband, (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3428 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3429 | |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 3430 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 3431 | limDiagEventReport(pMac, WLAN_PE_DIAG_CHANNEL_SWITCH_ANOUNCEMENT, |
| 3432 | psessionEntry, eSIR_SUCCESS, LIM_SWITCH_CHANNEL_OPERATION); |
| 3433 | #endif |
| 3434 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3435 | // Store the new primary and secondary channel in session entries if different |
| 3436 | if (psessionEntry->currentOperChannel != newChannel) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3437 | { |
| 3438 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3439 | FL("switch old chnl %d --> new chnl %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3440 | psessionEntry->currentOperChannel, newChannel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3441 | psessionEntry->currentOperChannel = newChannel; |
| 3442 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3443 | if (psessionEntry->htSecondaryChannelOffset != subband) |
| 3444 | { |
| 3445 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3446 | FL("switch old sec chnl %d --> new sec chnl %d "), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3447 | psessionEntry->htSecondaryChannelOffset, subband); |
| 3448 | psessionEntry->htSecondaryChannelOffset = subband; |
| 3449 | if (psessionEntry->htSecondaryChannelOffset == PHY_SINGLE_CHANNEL_CENTERED) |
| 3450 | { |
| 3451 | psessionEntry->htSupportedChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3452 | } |
| 3453 | else |
| 3454 | { |
| 3455 | psessionEntry->htSupportedChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3456 | } |
| 3457 | psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; |
| 3458 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | |
| 3460 | return; |
| 3461 | } |
| 3462 | |
| 3463 | |
| 3464 | /** |
| 3465 | * limActiveScanAllowed() |
| 3466 | * |
| 3467 | *FUNCTION: |
| 3468 | * Checks if active scans are permitted on the given channel |
| 3469 | * |
| 3470 | *LOGIC: |
| 3471 | * The config variable SCAN_CONTROL_LIST contains pairs of (channelNum, activeScanAllowed) |
| 3472 | * Need to check if the channelNum matches, then depending on the corresponding |
| 3473 | * scan flag, return true (for activeScanAllowed==1) or false (otherwise). |
| 3474 | * |
| 3475 | *ASSUMPTIONS: |
| 3476 | * |
| 3477 | *NOTE: |
| 3478 | * |
| 3479 | * @param pMac Pointer to Global MAC structure |
| 3480 | * @param channelNum channel number |
| 3481 | * @return None |
| 3482 | */ |
| 3483 | |
| 3484 | tANI_U8 limActiveScanAllowed( |
| 3485 | tpAniSirGlobal pMac, |
| 3486 | tANI_U8 channelNum) |
| 3487 | { |
| 3488 | tANI_U32 i; |
| 3489 | tANI_U8 channelPair[WNI_CFG_SCAN_CONTROL_LIST_LEN]; |
| 3490 | tANI_U32 len = WNI_CFG_SCAN_CONTROL_LIST_LEN; |
| 3491 | if (wlan_cfgGetStr(pMac, WNI_CFG_SCAN_CONTROL_LIST, channelPair, &len) |
| 3492 | != eSIR_SUCCESS) |
| 3493 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3494 | PELOGE(limLog(pMac, LOGE, FL("Unable to get scan control list"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3495 | return false; |
| 3496 | } |
| 3497 | |
| 3498 | if (len > WNI_CFG_SCAN_CONTROL_LIST_LEN) |
| 3499 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3500 | limLog(pMac, LOGE, FL("Invalid scan control list length:%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3501 | len); |
| 3502 | return false; |
| 3503 | } |
| 3504 | |
| 3505 | for (i=0; (i+1) < len; i+=2) |
| 3506 | { |
| 3507 | if (channelPair[i] == channelNum) |
| 3508 | return ((channelPair[i+1] == eSIR_ACTIVE_SCAN) ? true : false); |
| 3509 | } |
| 3510 | return false; |
| 3511 | } |
| 3512 | |
| 3513 | /** |
| 3514 | * limTriggerBackgroundScanDuringQuietBss() |
| 3515 | * |
| 3516 | *FUNCTION: |
| 3517 | * This function is applicable to the STA only. |
| 3518 | * This function is called by limProcessQuietTimeout(), |
| 3519 | * when it is time to honor the Quiet BSS IE from the AP. |
| 3520 | * |
| 3521 | *LOGIC: |
| 3522 | * If 11H is enabled: |
| 3523 | * We cannot trigger a background scan. The STA needs to |
| 3524 | * shut-off Tx/Rx. |
| 3525 | * If 11 is not enabled: |
| 3526 | * Determine if the next channel that we are going to |
| 3527 | * scan is NOT the same channel (or not) on which the |
| 3528 | * Quiet BSS was requested. |
| 3529 | * If yes, then we cannot trigger a background scan on |
| 3530 | * this channel. Return with a false. |
| 3531 | * If no, then trigger a background scan. Return with |
| 3532 | * a true. |
| 3533 | * |
| 3534 | *ASSUMPTIONS: |
| 3535 | * |
| 3536 | *NOTE: |
| 3537 | * This API is redundant if the existing API, |
| 3538 | * limTriggerBackgroundScan(), were to return a valid |
| 3539 | * response instead of returning void. |
| 3540 | * If possible, try to revisit this API |
| 3541 | * |
| 3542 | * @param pMac Pointer to Global MAC structure |
| 3543 | * @return eSIR_TRUE, if a background scan was attempted |
| 3544 | * eSIR_FALSE, if not |
| 3545 | */ |
| 3546 | tAniBool limTriggerBackgroundScanDuringQuietBss( tpAniSirGlobal pMac ) |
| 3547 | { |
| 3548 | tAniBool bScanTriggered = eSIR_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | |
| 3550 | |
| 3551 | |
| 3552 | //TBD-RAJESH HOW TO GET sessionEntry????? |
| 3553 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 3554 | |
| 3555 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 3556 | return bScanTriggered; |
| 3557 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3558 | if( !psessionEntry->lim11hEnable ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3559 | { |
| 3560 | tSirMacChanNum bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN]; |
| 3561 | tANI_U32 len = WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN; |
| 3562 | |
| 3563 | // Determine the next scan channel |
| 3564 | |
| 3565 | // Get background scan channel list from CFG |
| 3566 | if( eSIR_SUCCESS == wlan_cfgGetStr( pMac, |
| 3567 | WNI_CFG_BG_SCAN_CHANNEL_LIST, |
| 3568 | (tANI_U8 *) bgScanChannelList, |
| 3569 | (tANI_U32 *) &len )) |
| 3570 | { |
| 3571 | // Ensure that we do not go off scanning on the same |
| 3572 | // channel on which the Quiet BSS was requested |
| 3573 | if( psessionEntry->currentOperChannel!= |
| 3574 | bgScanChannelList[pMac->lim.gLimBackgroundScanChannelId] ) |
| 3575 | { |
| 3576 | // For now, try and attempt a background scan. It will |
| 3577 | // be ideal if this API actually returns a success or |
| 3578 | // failure instead of having a void return type |
| 3579 | limTriggerBackgroundScan( pMac ); |
| 3580 | |
| 3581 | bScanTriggered = eSIR_TRUE; |
| 3582 | } |
| 3583 | else |
| 3584 | { |
| 3585 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3586 | FL("The next SCAN channel is the current operating channel on which a Quiet BSS is requested.! A background scan will not be triggered during this Quiet BSS period...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3587 | } |
| 3588 | } |
| 3589 | else |
| 3590 | { |
| 3591 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3592 | FL("Unable to retrieve WNI_CFG_VALID_CHANNEL_LIST from CFG! A background scan will not be triggered during this Quiet BSS period...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | } |
| 3594 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3595 | return bScanTriggered; |
| 3596 | } |
| 3597 | |
| 3598 | |
| 3599 | /** |
| 3600 | * limGetHTCapability() |
| 3601 | * |
| 3602 | *FUNCTION: |
| 3603 | * A utility function that returns the "current HT capability state" for the HT |
| 3604 | * capability of interest (as requested in the API) |
| 3605 | * |
| 3606 | *LOGIC: |
| 3607 | * This routine will return with the "current" setting of a requested HT |
| 3608 | * capability. This state info could be retrieved from - |
| 3609 | * a) CFG (for static entries) |
| 3610 | * b) Run time info |
| 3611 | * - Dynamic state maintained by LIM |
| 3612 | * - Configured at radio init time by SME |
| 3613 | * |
| 3614 | * |
| 3615 | *ASSUMPTIONS: |
| 3616 | * NA |
| 3617 | * |
| 3618 | *NOTE: |
| 3619 | * |
| 3620 | * @param pMac Pointer to Global MAC structure |
| 3621 | * @param htCap The HT capability being queried |
| 3622 | * @return tANI_U8 The current state of the requested HT capability is returned in a |
| 3623 | * tANI_U8 variable |
| 3624 | */ |
| 3625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3626 | tANI_U8 limGetHTCapability( tpAniSirGlobal pMac, |
| 3627 | tANI_U32 htCap, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3628 | { |
| 3629 | tANI_U8 retVal = 0; |
| 3630 | tANI_U8 *ptr; |
| 3631 | tANI_U32 cfgValue; |
| 3632 | tSirMacHTCapabilityInfo macHTCapabilityInfo = {0}; |
| 3633 | tSirMacExtendedHTCapabilityInfo macExtHTCapabilityInfo = {0}; |
| 3634 | tSirMacTxBFCapabilityInfo macTxBFCapabilityInfo = {0}; |
| 3635 | tSirMacASCapabilityInfo macASCapabilityInfo = {0}; |
| 3636 | |
| 3637 | // |
| 3638 | // Determine which CFG to read from. Not ALL of the HT |
| 3639 | // related CFG's need to be read each time this API is |
| 3640 | // accessed |
| 3641 | // |
| 3642 | if( htCap >= eHT_ANTENNA_SELECTION && |
| 3643 | htCap < eHT_SI_GRANULARITY ) |
| 3644 | { |
| 3645 | // Get Antenna Seletion HT Capabilities |
| 3646 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_AS_CAP, &cfgValue )) |
| 3647 | cfgValue = 0; |
| 3648 | ptr = (tANI_U8 *) &macASCapabilityInfo; |
| 3649 | *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff); |
| 3650 | } |
| 3651 | else |
| 3652 | { |
| 3653 | if( htCap >= eHT_TX_BEAMFORMING && |
| 3654 | htCap < eHT_ANTENNA_SELECTION ) |
| 3655 | { |
| 3656 | // Get Transmit Beam Forming HT Capabilities |
| 3657 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_TX_BF_CAP, &cfgValue )) |
| 3658 | cfgValue = 0; |
| 3659 | ptr = (tANI_U8 *) &macTxBFCapabilityInfo; |
| 3660 | *((tANI_U32 *)ptr) = (tANI_U32) (cfgValue); |
| 3661 | } |
| 3662 | else |
| 3663 | { |
| 3664 | if( htCap >= eHT_PCO && |
| 3665 | htCap < eHT_TX_BEAMFORMING ) |
| 3666 | { |
| 3667 | // Get Extended HT Capabilities |
| 3668 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_EXT_HT_CAP_INFO, &cfgValue )) |
| 3669 | cfgValue = 0; |
| 3670 | ptr = (tANI_U8 *) &macExtHTCapabilityInfo; |
| 3671 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 3672 | } |
| 3673 | else |
| 3674 | { |
| 3675 | if( htCap < eHT_MAX_RX_AMPDU_FACTOR ) |
| 3676 | { |
| 3677 | // Get HT Capabilities |
| 3678 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_HT_CAP_INFO, &cfgValue )) |
| 3679 | cfgValue = 0; |
| 3680 | ptr = (tANI_U8 *) &macHTCapabilityInfo; |
| 3681 | // CR 265282 MDM SoftAP 2.4PL: SoftAP boot up crash in 2.4 PL builds while same WLAN SU is working on 2.1 PL |
| 3682 | *ptr++ = cfgValue & 0xff; |
| 3683 | *ptr = (cfgValue >> 8) & 0xff; |
| 3684 | } |
| 3685 | } |
| 3686 | } |
| 3687 | } |
| 3688 | |
| 3689 | switch( htCap ) |
| 3690 | { |
| 3691 | case eHT_LSIG_TXOP_PROTECTION: |
| 3692 | retVal = pMac->lim.gHTLsigTXOPProtection; |
| 3693 | break; |
| 3694 | |
| 3695 | case eHT_STBC_CONTROL_FRAME: |
| 3696 | retVal = (tANI_U8) macHTCapabilityInfo.stbcControlFrame; |
| 3697 | break; |
| 3698 | |
| 3699 | case eHT_PSMP: |
| 3700 | retVal = pMac->lim.gHTPSMPSupport; |
| 3701 | break; |
| 3702 | |
| 3703 | case eHT_DSSS_CCK_MODE_40MHZ: |
| 3704 | retVal = pMac->lim.gHTDsssCckRate40MHzSupport; |
| 3705 | break; |
| 3706 | |
| 3707 | case eHT_MAX_AMSDU_LENGTH: |
| 3708 | retVal = (tANI_U8) macHTCapabilityInfo.maximalAMSDUsize; |
| 3709 | break; |
| 3710 | |
| 3711 | case eHT_DELAYED_BA: |
| 3712 | retVal = (tANI_U8) macHTCapabilityInfo.delayedBA; |
| 3713 | break; |
| 3714 | |
| 3715 | case eHT_RX_STBC: |
| 3716 | retVal = (tANI_U8) macHTCapabilityInfo.rxSTBC; |
| 3717 | break; |
| 3718 | |
| 3719 | case eHT_TX_STBC: |
| 3720 | retVal = (tANI_U8) macHTCapabilityInfo.txSTBC; |
| 3721 | break; |
| 3722 | |
| 3723 | case eHT_SHORT_GI_40MHZ: |
| 3724 | retVal = (tANI_U8) macHTCapabilityInfo.shortGI40MHz; |
| 3725 | break; |
| 3726 | |
| 3727 | case eHT_SHORT_GI_20MHZ: |
| 3728 | retVal = (tANI_U8) macHTCapabilityInfo.shortGI20MHz; |
| 3729 | break; |
| 3730 | |
| 3731 | case eHT_GREENFIELD: |
| 3732 | retVal = (tANI_U8) macHTCapabilityInfo.greenField; |
| 3733 | break; |
| 3734 | |
| 3735 | case eHT_MIMO_POWER_SAVE: |
| 3736 | retVal = (tANI_U8) pMac->lim.gHTMIMOPSState; |
| 3737 | break; |
| 3738 | |
| 3739 | case eHT_SUPPORTED_CHANNEL_WIDTH_SET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3740 | retVal = (tANI_U8) psessionEntry->htSupportedChannelWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3741 | break; |
| 3742 | |
| 3743 | case eHT_ADVANCED_CODING: |
| 3744 | retVal = (tANI_U8) macHTCapabilityInfo.advCodingCap; |
| 3745 | break; |
| 3746 | |
| 3747 | case eHT_MAX_RX_AMPDU_FACTOR: |
| 3748 | retVal = pMac->lim.gHTMaxRxAMpduFactor; |
| 3749 | break; |
| 3750 | |
| 3751 | case eHT_MPDU_DENSITY: |
| 3752 | retVal = pMac->lim.gHTAMpduDensity; |
| 3753 | break; |
| 3754 | |
| 3755 | case eHT_PCO: |
| 3756 | retVal = (tANI_U8) macExtHTCapabilityInfo.pco; |
| 3757 | break; |
| 3758 | |
| 3759 | case eHT_TRANSITION_TIME: |
| 3760 | retVal = (tANI_U8) macExtHTCapabilityInfo.transitionTime; |
| 3761 | break; |
| 3762 | |
| 3763 | case eHT_MCS_FEEDBACK: |
| 3764 | retVal = (tANI_U8) macExtHTCapabilityInfo.mcsFeedback; |
| 3765 | break; |
| 3766 | |
| 3767 | case eHT_TX_BEAMFORMING: |
| 3768 | retVal = (tANI_U8) macTxBFCapabilityInfo.txBF; |
| 3769 | break; |
| 3770 | |
| 3771 | case eHT_ANTENNA_SELECTION: |
| 3772 | retVal = (tANI_U8) macASCapabilityInfo.antennaSelection; |
| 3773 | break; |
| 3774 | |
| 3775 | case eHT_SI_GRANULARITY: |
| 3776 | retVal = pMac->lim.gHTServiceIntervalGranularity; |
| 3777 | break; |
| 3778 | |
| 3779 | case eHT_CONTROLLED_ACCESS: |
| 3780 | retVal = pMac->lim.gHTControlledAccessOnly; |
| 3781 | break; |
| 3782 | |
| 3783 | case eHT_RIFS_MODE: |
| 3784 | retVal = psessionEntry->beaconParams.fRIFSMode; |
| 3785 | break; |
| 3786 | |
| 3787 | case eHT_RECOMMENDED_TX_WIDTH_SET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3788 | retVal = psessionEntry->htRecommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3789 | break; |
| 3790 | |
| 3791 | case eHT_EXTENSION_CHANNEL_OFFSET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3792 | retVal = psessionEntry->htSecondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3793 | break; |
| 3794 | |
| 3795 | case eHT_OP_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3796 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 3797 | retVal = psessionEntry->htOperMode; |
| 3798 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3799 | retVal = pMac->lim.gHTOperMode; |
| 3800 | break; |
| 3801 | |
| 3802 | case eHT_BASIC_STBC_MCS: |
| 3803 | retVal = pMac->lim.gHTSTBCBasicMCS; |
| 3804 | break; |
| 3805 | |
| 3806 | case eHT_DUAL_CTS_PROTECTION: |
| 3807 | retVal = pMac->lim.gHTDualCTSProtection; |
| 3808 | break; |
| 3809 | |
| 3810 | case eHT_LSIG_TXOP_PROTECTION_FULL_SUPPORT: |
| 3811 | retVal = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport; |
| 3812 | break; |
| 3813 | |
| 3814 | case eHT_PCO_ACTIVE: |
| 3815 | retVal = pMac->lim.gHTPCOActive; |
| 3816 | break; |
| 3817 | |
| 3818 | case eHT_PCO_PHASE: |
| 3819 | retVal = pMac->lim.gHTPCOPhase; |
| 3820 | break; |
| 3821 | |
| 3822 | default: |
| 3823 | break; |
| 3824 | } |
| 3825 | |
| 3826 | return retVal; |
| 3827 | } |
| 3828 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3829 | void limGetMyMacAddr(tpAniSirGlobal pMac, tANI_U8 *mac) |
| 3830 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 3831 | vos_mem_copy( mac, pMac->lim.gLimMyMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3832 | return; |
| 3833 | } |
| 3834 | |
| 3835 | |
| 3836 | |
| 3837 | |
| 3838 | /** ------------------------------------------------------------- |
| 3839 | \fn limEnable11aProtection |
| 3840 | \brief based on config setting enables\disables 11a protection. |
| 3841 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 3842 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 3843 | \param tpUpdateBeaconParams pBeaconParams |
| 3844 | \return None |
| 3845 | -------------------------------------------------------------*/ |
| 3846 | tSirRetStatus |
| 3847 | limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 3848 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 3849 | { |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3850 | if(NULL == psessionEntry) |
| 3851 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3852 | PELOG3(limLog(pMac, LOG3, FL("psessionEntry is NULL"));) |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3853 | return eSIR_FAILURE; |
| 3854 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3855 | //overlapping protection configuration check. |
| 3856 | if(overlap) |
| 3857 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3858 | } |
| 3859 | else |
| 3860 | { |
| 3861 | //normal protection config check |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3862 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3863 | (!psessionEntry->cfgProtection.fromlla)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3864 | { |
| 3865 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3866 | PELOG3(limLog(pMac, LOG3, FL("protection from 11a is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3867 | return eSIR_SUCCESS; |
| 3868 | } |
| 3869 | } |
| 3870 | |
| 3871 | if (enable) |
| 3872 | { |
| 3873 | //If we are AP and HT capable, we need to set the HT OP mode |
| 3874 | //appropriately. |
| 3875 | if(((eLIM_AP_ROLE == psessionEntry->limSystemRole)||(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole))&& |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3876 | (true == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3877 | { |
| 3878 | if(overlap) |
| 3879 | { |
| 3880 | pMac->lim.gLimOverlap11aParams.protectionEnabled = true; |
| 3881 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 3882 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 3883 | { |
| 3884 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3885 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3886 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3887 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3888 | } |
| 3889 | } |
| 3890 | else |
| 3891 | { |
| 3892 | psessionEntry->gLim11aParams.protectionEnabled = true; |
| 3893 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 3894 | { |
| 3895 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3896 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3897 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3898 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3899 | |
| 3900 | } |
| 3901 | } |
| 3902 | } |
| 3903 | |
| 3904 | //This part is common for staiton as well. |
| 3905 | if(false == psessionEntry->beaconParams.llaCoexist) |
| 3906 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3907 | PELOG1(limLog(pMac, LOG1, FL(" => protection from 11A Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3908 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = true; |
| 3909 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3910 | } |
| 3911 | } |
| 3912 | else if (true == psessionEntry->beaconParams.llaCoexist) |
| 3913 | { |
| 3914 | //for AP role. |
| 3915 | //we need to take care of HT OP mode change if needed. |
| 3916 | //We need to take care of Overlap cases. |
| 3917 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 3918 | { |
| 3919 | if(overlap) |
| 3920 | { |
| 3921 | //Overlap Legacy protection disabled. |
| 3922 | pMac->lim.gLimOverlap11aParams.protectionEnabled = false; |
| 3923 | |
| 3924 | //We need to take care of HT OP mode iff we are HT AP. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3925 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3926 | { |
| 3927 | // no HT op mode change if any of the overlap protection enabled. |
| 3928 | if(!(pMac->lim.gLimOverlap11aParams.protectionEnabled || |
| 3929 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 3930 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 3931 | |
| 3932 | { |
| 3933 | //Check if there is a need to change HT OP mode. |
| 3934 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 3935 | { |
| 3936 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3937 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3938 | |
| 3939 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 3940 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 3941 | else |
| 3942 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 3943 | } |
| 3944 | } |
| 3945 | } |
| 3946 | } |
| 3947 | else |
| 3948 | { |
| 3949 | //Disable protection from 11A stations. |
| 3950 | psessionEntry->gLim11aParams.protectionEnabled = false; |
| 3951 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3952 | |
| 3953 | //Check if any other non-HT protection enabled. |
| 3954 | //Right now we are in HT OP Mixed mode. |
| 3955 | //Change HT op mode appropriately. |
| 3956 | |
| 3957 | //Change HT OP mode to 01 if any overlap protection enabled |
| 3958 | if(pMac->lim.gLimOverlap11aParams.protectionEnabled || |
| 3959 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 3960 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 3961 | |
| 3962 | { |
| 3963 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3964 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3965 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3966 | } |
| 3967 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 3968 | { |
| 3969 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3970 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3971 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3972 | } |
| 3973 | else |
| 3974 | { |
| 3975 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3976 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3977 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3978 | } |
| 3979 | } |
| 3980 | if(!pMac->lim.gLimOverlap11aParams.protectionEnabled && |
| 3981 | !psessionEntry->gLim11aParams.protectionEnabled) |
| 3982 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3983 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11A Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3984 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = false; |
| 3985 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3986 | } |
| 3987 | } |
| 3988 | //for station role |
| 3989 | else |
| 3990 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3991 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11A Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3992 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = false; |
| 3993 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3994 | } |
| 3995 | } |
| 3996 | |
| 3997 | return eSIR_SUCCESS; |
| 3998 | } |
| 3999 | |
| 4000 | /** ------------------------------------------------------------- |
| 4001 | \fn limEnable11gProtection |
| 4002 | \brief based on config setting enables\disables 11g protection. |
| 4003 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4004 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4005 | \param tpUpdateBeaconParams pBeaconParams |
| 4006 | \return None |
| 4007 | -------------------------------------------------------------*/ |
| 4008 | |
| 4009 | tSirRetStatus |
| 4010 | limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4011 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4012 | { |
| 4013 | |
| 4014 | //overlapping protection configuration check. |
| 4015 | if(overlap) |
| 4016 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4017 | } |
| 4018 | else |
| 4019 | { |
| 4020 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4021 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4022 | !psessionEntry->cfgProtection.fromllb) |
| 4023 | { |
| 4024 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4025 | PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4026 | return eSIR_SUCCESS; |
| 4027 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4028 | { |
| 4029 | if(!pMac->lim.cfgProtection.fromllb) |
| 4030 | { |
| 4031 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4032 | PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4033 | return eSIR_SUCCESS; |
| 4034 | } |
| 4035 | } |
| 4036 | } |
| 4037 | |
| 4038 | if (enable) |
| 4039 | { |
| 4040 | //If we are AP and HT capable, we need to set the HT OP mode |
| 4041 | //appropriately. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4042 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4043 | { |
| 4044 | if(overlap) |
| 4045 | { |
| 4046 | psessionEntry->gLimOlbcParams.protectionEnabled = true; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4047 | PELOGE(limLog(pMac, LOGE, FL("protection from olbc is enabled"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4048 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4049 | { |
| 4050 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 4051 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 4052 | { |
| 4053 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4054 | } |
| 4055 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 4056 | // This fixes issue of OBSS bit not set after 11b, 11g station leaves |
| 4057 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4058 | //Not processing OBSS bit from other APs, as we are already taking care |
| 4059 | //of Protection from overlapping BSS based on erp IE or useProtection bit |
| 4060 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams, psessionEntry); |
| 4061 | } |
| 4062 | } |
| 4063 | else |
| 4064 | { |
| 4065 | psessionEntry->gLim11bParams.protectionEnabled = true; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4066 | PELOGE(limLog(pMac, LOGE, FL("protection from 11b is enabled"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4067 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4068 | { |
| 4069 | if(eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode) |
| 4070 | { |
| 4071 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4072 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4073 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4074 | } |
| 4075 | } |
| 4076 | } |
| 4077 | }else if ((eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4078 | (true == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4079 | { |
| 4080 | if(overlap) |
| 4081 | { |
| 4082 | psessionEntry->gLimOlbcParams.protectionEnabled = true; |
| 4083 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 4084 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 4085 | { |
| 4086 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4087 | } |
| 4088 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 4089 | // This fixes issue of OBSS bit not set after 11b, 11g station leaves |
| 4090 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4091 | //Not processing OBSS bit from other APs, as we are already taking care |
| 4092 | //of Protection from overlapping BSS based on erp IE or useProtection bit |
| 4093 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams, psessionEntry); |
| 4094 | } |
| 4095 | else |
| 4096 | { |
| 4097 | psessionEntry->gLim11bParams.protectionEnabled = true; |
| 4098 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 4099 | { |
| 4100 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4101 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4102 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4103 | } |
| 4104 | } |
| 4105 | } |
| 4106 | |
| 4107 | //This part is common for staiton as well. |
| 4108 | if(false == psessionEntry->beaconParams.llbCoexist) |
| 4109 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4110 | PELOG1(limLog(pMac, LOG1, FL("=> 11G Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4111 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = true; |
| 4112 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4113 | } |
| 4114 | } |
| 4115 | else if (true == psessionEntry->beaconParams.llbCoexist) |
| 4116 | { |
| 4117 | //for AP role. |
| 4118 | //we need to take care of HT OP mode change if needed. |
| 4119 | //We need to take care of Overlap cases. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4120 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4121 | { |
| 4122 | if(overlap) |
| 4123 | { |
| 4124 | //Overlap Legacy protection disabled. |
| 4125 | psessionEntry->gLimOlbcParams.protectionEnabled = false; |
| 4126 | |
| 4127 | //We need to take care of HT OP mode if we are HT AP. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4128 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4129 | { |
| 4130 | // no HT op mode change if any of the overlap protection enabled. |
| 4131 | if(!(psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4132 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4133 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4134 | { |
| 4135 | //Check if there is a need to change HT OP mode. |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 4136 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4137 | { |
| 4138 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4139 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4140 | if(psessionEntry->gLimHt20Params.protectionEnabled){ |
| 4141 | //Commenting out beacuse of CR 258588 WFA cert |
| 4142 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4143 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4144 | } |
| 4145 | else |
| 4146 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4147 | } |
| 4148 | } |
| 4149 | } |
| 4150 | } |
| 4151 | else |
| 4152 | { |
| 4153 | //Disable protection from 11B stations. |
| 4154 | psessionEntry->gLim11bParams.protectionEnabled = false; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4155 | PELOGE(limLog(pMac, LOGE, FL("===> 11B Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4156 | //Check if any other non-HT protection enabled. |
| 4157 | if(!psessionEntry->gLim11gParams.protectionEnabled) |
| 4158 | { |
| 4159 | //Right now we are in HT OP Mixed mode. |
| 4160 | //Change HT op mode appropriately. |
| 4161 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4162 | |
| 4163 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4164 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4165 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4166 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4167 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled) |
| 4168 | { |
| 4169 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4170 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4171 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4172 | } |
| 4173 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4174 | { |
| 4175 | //Commenting because of CR 258588 WFA cert |
| 4176 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4177 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4178 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4179 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4180 | } |
| 4181 | else |
| 4182 | { |
| 4183 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4184 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4185 | } |
| 4186 | } |
| 4187 | } |
| 4188 | if(!psessionEntry->gLimOlbcParams.protectionEnabled && |
| 4189 | !psessionEntry->gLim11bParams.protectionEnabled) |
| 4190 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4191 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4192 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4193 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4194 | } |
| 4195 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4196 | { |
| 4197 | if(overlap) |
| 4198 | { |
| 4199 | //Overlap Legacy protection disabled. |
| 4200 | psessionEntry->gLimOlbcParams.protectionEnabled = false; |
| 4201 | |
| 4202 | //We need to take care of HT OP mode iff we are HT AP. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4203 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4204 | { |
| 4205 | // no HT op mode change if any of the overlap protection enabled. |
| 4206 | if(!(pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4207 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4208 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 4209 | |
| 4210 | { |
| 4211 | //Check if there is a need to change HT OP mode. |
| 4212 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4213 | { |
| 4214 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4215 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4216 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4217 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4218 | else |
| 4219 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4220 | } |
| 4221 | } |
| 4222 | } |
| 4223 | } |
| 4224 | else |
| 4225 | { |
| 4226 | //Disable protection from 11B stations. |
| 4227 | psessionEntry->gLim11bParams.protectionEnabled = false; |
| 4228 | //Check if any other non-HT protection enabled. |
| 4229 | if(!psessionEntry->gLim11gParams.protectionEnabled) |
| 4230 | { |
| 4231 | //Right now we are in HT OP Mixed mode. |
| 4232 | //Change HT op mode appropriately. |
| 4233 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4234 | |
| 4235 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4236 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4237 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4238 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4239 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 4240 | |
| 4241 | { |
| 4242 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4243 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4244 | } |
| 4245 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4246 | { |
| 4247 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4248 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4249 | } |
| 4250 | else |
| 4251 | { |
| 4252 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4253 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4254 | } |
| 4255 | } |
| 4256 | } |
| 4257 | if(!psessionEntry->gLimOlbcParams.protectionEnabled && |
| 4258 | !psessionEntry->gLim11bParams.protectionEnabled) |
| 4259 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4260 | PELOG1(limLog(pMac, LOG1, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4261 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4262 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4263 | } |
| 4264 | } |
| 4265 | //for station role |
| 4266 | else |
| 4267 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4268 | PELOG1(limLog(pMac, LOG1, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4269 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4270 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4271 | } |
| 4272 | } |
| 4273 | return eSIR_SUCCESS; |
| 4274 | } |
| 4275 | |
| 4276 | /** ------------------------------------------------------------- |
| 4277 | \fn limEnableHtProtectionFrom11g |
| 4278 | \brief based on cofig enables\disables protection from 11g. |
| 4279 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4280 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4281 | \param tpUpdateBeaconParams pBeaconParams |
| 4282 | \return None |
| 4283 | -------------------------------------------------------------*/ |
| 4284 | tSirRetStatus |
| 4285 | limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4286 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4287 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4288 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4289 | return eSIR_SUCCESS; // protection from 11g is only for HT stations. |
| 4290 | |
| 4291 | //overlapping protection configuration check. |
| 4292 | if(overlap) |
| 4293 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4294 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && (!psessionEntry->cfgProtection.overlapFromllg)) |
| 4295 | { |
| 4296 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4297 | PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4298 | return eSIR_SUCCESS; |
| 4299 | }else if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) && (!pMac->lim.cfgProtection.overlapFromllg)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4300 | { |
| 4301 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4302 | PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4303 | return eSIR_SUCCESS; |
| 4304 | } |
| 4305 | } |
| 4306 | else |
| 4307 | { |
| 4308 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4309 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4310 | !psessionEntry->cfgProtection.fromllg){ |
| 4311 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4312 | PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4313 | return eSIR_SUCCESS; |
| 4314 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4315 | { |
| 4316 | if(!pMac->lim.cfgProtection.fromllg) |
| 4317 | { |
| 4318 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4319 | PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4320 | return eSIR_SUCCESS; |
| 4321 | } |
| 4322 | } |
| 4323 | } |
| 4324 | if (enable) |
| 4325 | { |
| 4326 | //If we are AP and HT capable, we need to set the HT OP mode |
| 4327 | //appropriately. |
| 4328 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4329 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4330 | { |
| 4331 | if(overlap) |
| 4332 | { |
| 4333 | psessionEntry->gLimOverlap11gParams.protectionEnabled = true; |
| 4334 | //11g exists in overlap BSS. |
| 4335 | //need not to change the operating mode to overlap_legacy |
| 4336 | //if higher or same protection operating mode is enabled right now. |
| 4337 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 4338 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 4339 | { |
| 4340 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4341 | } |
| 4342 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 4343 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4344 | } |
| 4345 | else |
| 4346 | { |
| 4347 | //11g is associated to an AP operating in 11n mode. |
| 4348 | //Change the HT operating mode to 'mixed mode'. |
| 4349 | psessionEntry->gLim11gParams.protectionEnabled = true; |
| 4350 | if(eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode) |
| 4351 | { |
| 4352 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4353 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 4354 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4355 | } |
| 4356 | } |
| 4357 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4358 | { |
| 4359 | if(overlap) |
| 4360 | { |
| 4361 | pMac->lim.gLimOverlap11gParams.protectionEnabled = true; |
| 4362 | //11g exists in overlap BSS. |
| 4363 | //need not to change the operating mode to overlap_legacy |
| 4364 | //if higher or same protection operating mode is enabled right now. |
| 4365 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 4366 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 4367 | { |
| 4368 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4369 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4370 | } |
| 4371 | } |
| 4372 | else |
| 4373 | { |
| 4374 | //11g is associated to an AP operating in 11n mode. |
| 4375 | //Change the HT operating mode to 'mixed mode'. |
| 4376 | psessionEntry->gLim11gParams.protectionEnabled = true; |
| 4377 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 4378 | { |
| 4379 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4380 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 4381 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4382 | } |
| 4383 | } |
| 4384 | } |
| 4385 | |
| 4386 | //This part is common for staiton as well. |
| 4387 | if(false == psessionEntry->beaconParams.llgCoexist) |
| 4388 | { |
| 4389 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = true; |
| 4390 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4391 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4392 | else if (true == psessionEntry->gLimOverlap11gParams.protectionEnabled) |
| 4393 | { |
| 4394 | // As operating mode changed after G station assoc some way to update beacon |
| 4395 | // This addresses the issue of mode not changing to - 11 in beacon when OBSS overlap is enabled |
| 4396 | //pMac->sch.schObject.fBeaconChanged = 1; |
| 4397 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4398 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4399 | } |
| 4400 | else if (true == psessionEntry->beaconParams.llgCoexist) |
| 4401 | { |
| 4402 | //for AP role. |
| 4403 | //we need to take care of HT OP mode change if needed. |
| 4404 | //We need to take care of Overlap cases. |
| 4405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4406 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4407 | { |
| 4408 | if(overlap) |
| 4409 | { |
| 4410 | //Overlap Legacy protection disabled. |
| 4411 | if (psessionEntry->gLim11gParams.numSta == 0) |
| 4412 | psessionEntry->gLimOverlap11gParams.protectionEnabled = false; |
| 4413 | |
| 4414 | // no HT op mode change if any of the overlap protection enabled. |
| 4415 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4416 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4417 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4418 | { |
| 4419 | //Check if there is a need to change HT OP mode. |
| 4420 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
| 4421 | { |
| 4422 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4423 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4424 | |
| 4425 | if(psessionEntry->gLimHt20Params.protectionEnabled){ |
| 4426 | //Commenting because of CR 258588 WFA cert |
| 4427 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4428 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4429 | } |
| 4430 | else |
| 4431 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4432 | } |
| 4433 | } |
| 4434 | } |
| 4435 | else |
| 4436 | { |
| 4437 | //Disable protection from 11G stations. |
| 4438 | psessionEntry->gLim11gParams.protectionEnabled = false; |
| 4439 | //Check if any other non-HT protection enabled. |
| 4440 | if(!psessionEntry->gLim11bParams.protectionEnabled) |
| 4441 | { |
| 4442 | |
| 4443 | //Right now we are in HT OP Mixed mode. |
| 4444 | //Change HT op mode appropriately. |
| 4445 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4446 | |
| 4447 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4448 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4449 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4450 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4451 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled) |
| 4452 | |
| 4453 | { |
| 4454 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4455 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4456 | } |
| 4457 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4458 | { |
| 4459 | //Commenting because of CR 258588 WFA cert |
| 4460 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4461 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4462 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4463 | } |
| 4464 | else |
| 4465 | { |
| 4466 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4467 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4468 | } |
| 4469 | } |
| 4470 | } |
| 4471 | if(!psessionEntry->gLimOverlap11gParams.protectionEnabled && |
| 4472 | !psessionEntry->gLim11gParams.protectionEnabled) |
| 4473 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4474 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4475 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4476 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4477 | } |
| 4478 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4479 | { |
| 4480 | if(overlap) |
| 4481 | { |
| 4482 | //Overlap Legacy protection disabled. |
| 4483 | pMac->lim.gLimOverlap11gParams.protectionEnabled = false; |
| 4484 | |
| 4485 | // no HT op mode change if any of the overlap protection enabled. |
| 4486 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4487 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4488 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4489 | { |
| 4490 | //Check if there is a need to change HT OP mode. |
| 4491 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4492 | { |
| 4493 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4494 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4495 | |
| 4496 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4497 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4498 | else |
| 4499 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4500 | } |
| 4501 | } |
| 4502 | } |
| 4503 | else |
| 4504 | { |
| 4505 | //Disable protection from 11G stations. |
| 4506 | psessionEntry->gLim11gParams.protectionEnabled = false; |
| 4507 | //Check if any other non-HT protection enabled. |
| 4508 | if(!psessionEntry->gLim11bParams.protectionEnabled) |
| 4509 | { |
| 4510 | |
| 4511 | //Right now we are in HT OP Mixed mode. |
| 4512 | //Change HT op mode appropriately. |
| 4513 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4514 | |
| 4515 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4516 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4517 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4518 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4519 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 4520 | |
| 4521 | { |
| 4522 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4523 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4524 | } |
| 4525 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4526 | { |
| 4527 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4528 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4529 | } |
| 4530 | else |
| 4531 | { |
| 4532 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4533 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4534 | } |
| 4535 | } |
| 4536 | } |
| 4537 | if(!pMac->lim.gLimOverlap11gParams.protectionEnabled && |
| 4538 | !psessionEntry->gLim11gParams.protectionEnabled) |
| 4539 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4540 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4541 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4542 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4543 | } |
| 4544 | } |
| 4545 | //for station role |
| 4546 | else |
| 4547 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4548 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4549 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4550 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4551 | } |
| 4552 | } |
| 4553 | return eSIR_SUCCESS; |
| 4554 | } |
| 4555 | //FIXME_PROTECTION : need to check for no APSD whenever we want to enable this protection. |
| 4556 | //This check will be done at the caller. |
| 4557 | |
| 4558 | /** ------------------------------------------------------------- |
| 4559 | \fn limEnableHtObssProtection |
| 4560 | \brief based on cofig enables\disables obss protection. |
| 4561 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4562 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4563 | \param tpUpdateBeaconParams pBeaconParams |
| 4564 | \return None |
| 4565 | -------------------------------------------------------------*/ |
| 4566 | tSirRetStatus |
| 4567 | limEnableHtOBSSProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4568 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4569 | { |
| 4570 | |
| 4571 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4572 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4573 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4574 | |
| 4575 | //overlapping protection configuration check. |
| 4576 | if(overlap) |
| 4577 | { |
| 4578 | //overlapping protection configuration check. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4579 | } |
| 4580 | else |
| 4581 | { |
| 4582 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4583 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && !psessionEntry->cfgProtection.obss) |
| 4584 | { //ToDo Update this field |
| 4585 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4586 | PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4587 | return eSIR_SUCCESS; |
| 4588 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4589 | { |
| 4590 | if(!pMac->lim.cfgProtection.obss) |
| 4591 | { //ToDo Update this field |
| 4592 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4593 | PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4594 | return eSIR_SUCCESS; |
| 4595 | } |
| 4596 | } |
| 4597 | } |
| 4598 | |
| 4599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4600 | if (eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4601 | if ((enable) && (false == psessionEntry->beaconParams.gHTObssMode) ) |
| 4602 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4603 | PELOG1(limLog(pMac, LOG1, FL("=>obss protection enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4604 | psessionEntry->beaconParams.gHTObssMode = true; |
| 4605 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; // UPDATE AN ENUM FOR OBSS MODE <todo> |
| 4606 | |
| 4607 | } |
| 4608 | else if (!enable && (true == psessionEntry->beaconParams.gHTObssMode)) |
| 4609 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4610 | PELOG1(limLog(pMac, LOG1, FL("===> obss Protection disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4611 | psessionEntry->beaconParams.gHTObssMode = false; |
| 4612 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; |
| 4613 | |
| 4614 | } |
| 4615 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 4616 | if (!enable && !overlap) |
| 4617 | { |
| 4618 | psessionEntry->gLimOverlap11gParams.protectionEnabled = false; |
| 4619 | } |
| 4620 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4621 | { |
| 4622 | if ((enable) && (false == psessionEntry->beaconParams.gHTObssMode) ) |
| 4623 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4624 | PELOG1(limLog(pMac, LOG1, FL("=>obss protection enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4625 | psessionEntry->beaconParams.gHTObssMode = true; |
| 4626 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; // UPDATE AN ENUM FOR OBSS MODE <todo> |
| 4627 | |
| 4628 | } |
| 4629 | else if (!enable && (true == psessionEntry->beaconParams.gHTObssMode)) |
| 4630 | { |
| 4631 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4632 | PELOG1(limLog(pMac, LOG1, FL("===> obss Protection disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4633 | psessionEntry->beaconParams.gHTObssMode = false; |
| 4634 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; |
| 4635 | |
| 4636 | } |
| 4637 | } |
| 4638 | return eSIR_SUCCESS; |
| 4639 | } |
| 4640 | /** ------------------------------------------------------------- |
| 4641 | \fn limEnableHT20Protection |
| 4642 | \brief based on cofig enables\disables protection from Ht20. |
| 4643 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4644 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4645 | \param tpUpdateBeaconParams pBeaconParams |
| 4646 | \return None |
| 4647 | -------------------------------------------------------------*/ |
| 4648 | tSirRetStatus |
| 4649 | limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4650 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4651 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4652 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4653 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4654 | |
| 4655 | //overlapping protection configuration check. |
| 4656 | if(overlap) |
| 4657 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4658 | } |
| 4659 | else |
| 4660 | { |
| 4661 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4662 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4663 | !psessionEntry->cfgProtection.ht20) |
| 4664 | { |
| 4665 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4666 | PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4667 | return eSIR_SUCCESS; |
| 4668 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4669 | { |
| 4670 | if(!pMac->lim.cfgProtection.ht20) |
| 4671 | { |
| 4672 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4673 | PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4674 | return eSIR_SUCCESS; |
| 4675 | } |
| 4676 | } |
| 4677 | } |
| 4678 | |
| 4679 | if (enable) |
| 4680 | { |
| 4681 | //If we are AP and HT capable, we need to set the HT OP mode |
| 4682 | //appropriately. |
| 4683 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4684 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4685 | if(overlap) |
| 4686 | { |
| 4687 | psessionEntry->gLimOverlapHt20Params.protectionEnabled = true; |
| 4688 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 4689 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 4690 | { |
| 4691 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4692 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4693 | } |
| 4694 | } |
| 4695 | else |
| 4696 | { |
| 4697 | psessionEntry->gLimHt20Params.protectionEnabled = true; |
| 4698 | if(eSIR_HT_OP_MODE_PURE == psessionEntry->htOperMode) |
| 4699 | { |
| 4700 | //Commenting because of CR 258588 WFA cert |
| 4701 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4702 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4703 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4704 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4705 | } |
| 4706 | } |
| 4707 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4708 | { |
| 4709 | if(overlap) |
| 4710 | { |
| 4711 | pMac->lim.gLimOverlapHt20Params.protectionEnabled = true; |
| 4712 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 4713 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 4714 | { |
| 4715 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4716 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4717 | } |
| 4718 | } |
| 4719 | else |
| 4720 | { |
| 4721 | psessionEntry->gLimHt20Params.protectionEnabled = true; |
| 4722 | if(eSIR_HT_OP_MODE_PURE == pMac->lim.gHTOperMode) |
| 4723 | { |
| 4724 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4725 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4726 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4727 | } |
| 4728 | } |
| 4729 | } |
| 4730 | |
| 4731 | //This part is common for staiton as well. |
| 4732 | if(false == psessionEntry->beaconParams.ht20Coexist) |
| 4733 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4734 | PELOG1(limLog(pMac, LOG1, FL("=> Prtection from HT20 Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4735 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = true; |
| 4736 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4737 | } |
| 4738 | } |
| 4739 | else if (true == psessionEntry->beaconParams.ht20Coexist) |
| 4740 | { |
| 4741 | //for AP role. |
| 4742 | //we need to take care of HT OP mode change if needed. |
| 4743 | //We need to take care of Overlap cases. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4744 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4745 | if(overlap) |
| 4746 | { |
| 4747 | //Overlap Legacy protection disabled. |
| 4748 | psessionEntry->gLimOverlapHt20Params.protectionEnabled = false; |
| 4749 | |
| 4750 | // no HT op mode change if any of the overlap protection enabled. |
| 4751 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4752 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4753 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4754 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4755 | { |
| 4756 | |
| 4757 | //Check if there is a need to change HT OP mode. |
| 4758 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
| 4759 | { |
| 4760 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4761 | { |
| 4762 | //Commented beacuse of CR 258588 for WFA Cert |
| 4763 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4764 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4765 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4766 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4767 | } |
| 4768 | else |
| 4769 | { |
| 4770 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4771 | } |
| 4772 | } |
| 4773 | } |
| 4774 | } |
| 4775 | else |
| 4776 | { |
| 4777 | //Disable protection from 11G stations. |
| 4778 | psessionEntry->gLimHt20Params.protectionEnabled = false; |
| 4779 | |
| 4780 | //Change HT op mode appropriately. |
| 4781 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == psessionEntry->htOperMode) |
| 4782 | { |
| 4783 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4784 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4785 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4786 | } |
| 4787 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4788 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT 20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4789 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4790 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4791 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4792 | { |
| 4793 | if(overlap) |
| 4794 | { |
| 4795 | //Overlap Legacy protection disabled. |
| 4796 | pMac->lim.gLimOverlapHt20Params.protectionEnabled = false; |
| 4797 | |
| 4798 | // no HT op mode change if any of the overlap protection enabled. |
| 4799 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4800 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4801 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4802 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 4803 | { |
| 4804 | |
| 4805 | //Check if there is a need to change HT OP mode. |
| 4806 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4807 | { |
| 4808 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4809 | { |
| 4810 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4811 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4812 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4813 | } |
| 4814 | else |
| 4815 | { |
| 4816 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4817 | } |
| 4818 | } |
| 4819 | } |
| 4820 | } |
| 4821 | else |
| 4822 | { |
| 4823 | //Disable protection from 11G stations. |
| 4824 | psessionEntry->gLimHt20Params.protectionEnabled = false; |
| 4825 | |
| 4826 | //Change HT op mode appropriately. |
| 4827 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pMac->lim.gHTOperMode) |
| 4828 | { |
| 4829 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4830 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4831 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4832 | } |
| 4833 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4834 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT 20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4835 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4836 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4837 | } |
| 4838 | //for station role |
| 4839 | else |
| 4840 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4841 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4842 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4843 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4844 | } |
| 4845 | } |
| 4846 | |
| 4847 | return eSIR_SUCCESS; |
| 4848 | } |
| 4849 | |
| 4850 | /** ------------------------------------------------------------- |
| 4851 | \fn limEnableHTNonGfProtection |
| 4852 | \brief based on cofig enables\disables protection from NonGf. |
| 4853 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4854 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4855 | \param tpUpdateBeaconParams pBeaconParams |
| 4856 | \return None |
| 4857 | -------------------------------------------------------------*/ |
| 4858 | tSirRetStatus |
| 4859 | limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4860 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4861 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4862 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4863 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4864 | |
| 4865 | //overlapping protection configuration check. |
| 4866 | if(overlap) |
| 4867 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4868 | } |
| 4869 | else |
| 4870 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4871 | //normal protection config check |
| 4872 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4873 | !psessionEntry->cfgProtection.nonGf) |
| 4874 | { |
| 4875 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4876 | PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4877 | return eSIR_SUCCESS; |
| 4878 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4879 | { |
| 4880 | //normal protection config check |
| 4881 | if(!pMac->lim.cfgProtection.nonGf) |
| 4882 | { |
| 4883 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4884 | PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4885 | return eSIR_SUCCESS; |
| 4886 | } |
| 4887 | } |
| 4888 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4889 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 4890 | if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4891 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4892 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from non GF Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4893 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = true; |
| 4894 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4895 | } |
| 4896 | else if (!enable && (true == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4897 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4898 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from Non GF Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4899 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = false; |
| 4900 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4901 | } |
| 4902 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4903 | { |
| 4904 | if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4905 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4906 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from non GF Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4907 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = true; |
| 4908 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4909 | } |
| 4910 | else if (!enable && (true == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4911 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4912 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from Non GF Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4913 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = false; |
| 4914 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4915 | } |
| 4916 | } |
| 4917 | |
| 4918 | return eSIR_SUCCESS; |
| 4919 | } |
| 4920 | |
| 4921 | /** ------------------------------------------------------------- |
| 4922 | \fn limEnableHTLsigTxopProtection |
| 4923 | \brief based on cofig enables\disables LsigTxop protection. |
| 4924 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4925 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4926 | \param tpUpdateBeaconParams pBeaconParams |
| 4927 | \return None |
| 4928 | -------------------------------------------------------------*/ |
| 4929 | tSirRetStatus |
| 4930 | limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4931 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4932 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4933 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4934 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4935 | |
| 4936 | //overlapping protection configuration check. |
| 4937 | if(overlap) |
| 4938 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4939 | } |
| 4940 | else |
| 4941 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4942 | //normal protection config check |
| 4943 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4944 | !psessionEntry->cfgProtection.lsigTxop) |
| 4945 | { |
| 4946 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4947 | PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4948 | return eSIR_SUCCESS; |
| 4949 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4950 | { |
| 4951 | //normal protection config check |
| 4952 | if(!pMac->lim.cfgProtection.lsigTxop) |
| 4953 | { |
| 4954 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4955 | PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4956 | return eSIR_SUCCESS; |
| 4957 | } |
| 4958 | } |
| 4959 | } |
| 4960 | |
| 4961 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4962 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 4963 | if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4964 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4965 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from LsigTxop Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4966 | pBeaconParams->fLsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = true; |
| 4967 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4968 | } |
| 4969 | else if (!enable && (true == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4970 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4971 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from LsigTxop Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4972 | pBeaconParams->fLsigTXOPProtectionFullSupport= psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = false; |
| 4973 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4974 | } |
| 4975 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4976 | { |
| 4977 | if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4978 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4979 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from LsigTxop Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4980 | pBeaconParams->fLsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = true; |
| 4981 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4982 | } |
| 4983 | else if (!enable && (true == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4984 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4985 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from LsigTxop Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4986 | pBeaconParams->fLsigTXOPProtectionFullSupport= psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = false; |
| 4987 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4988 | } |
| 4989 | } |
| 4990 | return eSIR_SUCCESS; |
| 4991 | } |
| 4992 | //FIXME_PROTECTION : need to check for no APSD whenever we want to enable this protection. |
| 4993 | //This check will be done at the caller. |
| 4994 | /** ------------------------------------------------------------- |
| 4995 | \fn limEnableHtRifsProtection |
| 4996 | \brief based on cofig enables\disables Rifs protection. |
| 4997 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4998 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4999 | \param tpUpdateBeaconParams pBeaconParams |
| 5000 | \return None |
| 5001 | -------------------------------------------------------------*/ |
| 5002 | tSirRetStatus |
| 5003 | limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 5004 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 5005 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5006 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5007 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 5008 | |
| 5009 | |
| 5010 | //overlapping protection configuration check. |
| 5011 | if(overlap) |
| 5012 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5013 | } |
| 5014 | else |
| 5015 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5016 | //normal protection config check |
| 5017 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
| 5018 | !psessionEntry->cfgProtection.rifs) |
| 5019 | { |
| 5020 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5021 | PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | return eSIR_SUCCESS; |
| 5023 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5024 | { |
| 5025 | //normal protection config check |
| 5026 | if(!pMac->lim.cfgProtection.rifs) |
| 5027 | { |
| 5028 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5029 | PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5030 | return eSIR_SUCCESS; |
| 5031 | } |
| 5032 | } |
| 5033 | } |
| 5034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5035 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 5036 | // Disabling the RIFS Protection means Enable the RIFS mode of operation in the BSS |
| 5037 | if ((!enable) && (false == psessionEntry->beaconParams.fRIFSMode)) |
| 5038 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5039 | PELOG1(limLog(pMac, LOG1, FL(" => Rifs protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5040 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = true; |
| 5041 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 5042 | } |
| 5043 | // Enabling the RIFS Protection means Disable the RIFS mode of operation in the BSS |
| 5044 | else if (enable && (true == psessionEntry->beaconParams.fRIFSMode)) |
| 5045 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5046 | PELOG1(limLog(pMac, LOG1, FL("===> Rifs Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5047 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = false; |
| 5048 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 5049 | } |
| 5050 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5051 | { |
| 5052 | // Disabling the RIFS Protection means Enable the RIFS mode of operation in the BSS |
| 5053 | if ((!enable) && (false == psessionEntry->beaconParams.fRIFSMode)) |
| 5054 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5055 | PELOG1(limLog(pMac, LOG1, FL(" => Rifs protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5056 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = true; |
| 5057 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 5058 | } |
| 5059 | // Enabling the RIFS Protection means Disable the RIFS mode of operation in the BSS |
| 5060 | else if (enable && (true == psessionEntry->beaconParams.fRIFSMode)) |
| 5061 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5062 | PELOG1(limLog(pMac, LOG1, FL("===> Rifs Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5063 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = false; |
| 5064 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 5065 | } |
| 5066 | } |
| 5067 | return eSIR_SUCCESS; |
| 5068 | } |
| 5069 | |
| 5070 | // --------------------------------------------------------------------- |
| 5071 | /** |
| 5072 | * limEnableShortPreamble |
| 5073 | * |
| 5074 | * FUNCTION: |
| 5075 | * Enable/Disable short preamble |
| 5076 | * |
| 5077 | * LOGIC: |
| 5078 | * |
| 5079 | * ASSUMPTIONS: |
| 5080 | * |
| 5081 | * NOTE: |
| 5082 | * |
| 5083 | * @param enable Flag to enable/disable short preamble |
| 5084 | * @return None |
| 5085 | */ |
| 5086 | |
| 5087 | tSirRetStatus |
| 5088 | limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 5089 | { |
| 5090 | tANI_U32 val; |
| 5091 | |
| 5092 | if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) |
| 5093 | { |
| 5094 | /* Could not get short preamble enabled flag from CFG. Log error. */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5095 | limLog(pMac, LOGP, FL("could not retrieve short preamble flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5096 | return eSIR_FAILURE; |
| 5097 | } |
| 5098 | |
| 5099 | if (!val) |
| 5100 | return eSIR_SUCCESS; |
| 5101 | |
| 5102 | if (wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED, &val) != eSIR_SUCCESS) |
| 5103 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5104 | limLog(pMac, LOGP, FL("could not retrieve 11G short preamble switching enabled flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5105 | return eSIR_FAILURE; |
| 5106 | } |
| 5107 | |
| 5108 | if (!val) // 11G short preamble switching is disabled. |
| 5109 | return eSIR_SUCCESS; |
| 5110 | |
| 5111 | if ( psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 5112 | { |
| 5113 | if (enable && (psessionEntry->beaconParams.fShortPreamble == 0)) |
| 5114 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5115 | PELOG1(limLog(pMac, LOG1, FL("===> Short Preamble Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5116 | psessionEntry->beaconParams.fShortPreamble = true; |
| 5117 | pBeaconParams->fShortPreamble = (tANI_U8) psessionEntry->beaconParams.fShortPreamble; |
| 5118 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_PREAMBLE_CHANGED; |
| 5119 | } |
| 5120 | else if (!enable && (psessionEntry->beaconParams.fShortPreamble == 1)) |
| 5121 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5122 | PELOG1(limLog(pMac, LOG1, FL("===> Short Preamble Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5123 | psessionEntry->beaconParams.fShortPreamble = false; |
| 5124 | pBeaconParams->fShortPreamble = (tANI_U8) psessionEntry->beaconParams.fShortPreamble; |
| 5125 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_PREAMBLE_CHANGED; |
| 5126 | } |
| 5127 | } |
| 5128 | |
| 5129 | return eSIR_SUCCESS; |
| 5130 | } |
| 5131 | |
| 5132 | /** |
| 5133 | * limTxComplete |
| 5134 | * |
| 5135 | * Function: |
| 5136 | * This is LIM's very own "TX MGMT frame complete" completion routine. |
| 5137 | * |
| 5138 | * Logic: |
| 5139 | * LIM wants to send a MGMT frame (broadcast or unicast) |
| 5140 | * LIM allocates memory using palPktAlloc( ..., **pData, **pPacket ) |
| 5141 | * LIM transmits the MGMT frame using the API: |
| 5142 | * halTxFrame( ... pPacket, ..., (void *) limTxComplete, pData ) |
| 5143 | * HDD, via halTxFrame/DXE, "transfers" the packet over to BMU |
| 5144 | * HDD, if it determines that a TX completion routine (in this case |
| 5145 | * limTxComplete) has been provided, will invoke this callback |
| 5146 | * LIM will try to free the TX MGMT packet that was earlier allocated, in order |
| 5147 | * to send this MGMT frame, using the PAL API palPktFree( ... pData, pPacket ) |
| 5148 | * |
| 5149 | * Assumptions: |
| 5150 | * Presently, this is ONLY being used for MGMT frames/packets |
| 5151 | * TODO: |
| 5152 | * Would it do good for LIM to have some sort of "signature" validation to |
| 5153 | * ensure that the pData argument passed in was a buffer that was actually |
| 5154 | * allocated by LIM and/or is not corrupted? |
| 5155 | * |
| 5156 | * Note: FIXME and TODO |
| 5157 | * Looks like palPktFree() is interested in pPacket. But, when this completion |
| 5158 | * routine is called, only pData is made available to LIM!! |
| 5159 | * |
| 5160 | * @param void A pointer to pData. Shouldn't it be pPacket?! |
| 5161 | * |
| 5162 | * @return none |
| 5163 | */ |
| 5164 | void limTxComplete( tHalHandle hHal, void *pData ) |
| 5165 | { |
| 5166 | tpAniSirGlobal pMac; |
| 5167 | pMac = (tpAniSirGlobal)hHal; |
| 5168 | |
| 5169 | #ifdef FIXME_PRIMA |
| 5170 | /* the trace logic needs to be fixed for Prima. Refer to CR 306075 */ |
| 5171 | #ifdef TRACE_RECORD |
| 5172 | { |
| 5173 | tpSirMacMgmtHdr mHdr; |
| 5174 | v_U8_t *pRxBd; |
| 5175 | vos_pkt_t *pVosPkt; |
| 5176 | VOS_STATUS vosStatus; |
| 5177 | |
| 5178 | |
| 5179 | |
| 5180 | pVosPkt = (vos_pkt_t *)pData; |
| 5181 | vosStatus = vos_pkt_peek_data( pVosPkt, 0, (v_PVOID_t *)&pRxBd, WLANHAL_RX_BD_HEADER_SIZE); |
| 5182 | |
| 5183 | if(VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 5184 | { |
| 5185 | mHdr = WDA_GET_RX_MAC_HEADER(pRxBd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5186 | |
| 5187 | } |
| 5188 | } |
| 5189 | #endif |
| 5190 | #endif |
| 5191 | |
| 5192 | palPktFree( pMac->hHdd, |
| 5193 | HAL_TXRX_FRM_802_11_MGMT, |
| 5194 | (void *) NULL, // this is ignored and will likely be removed from this API |
| 5195 | (void *) pData ); // lim passed in pPacket in the pData pointer that is given in this completion routine |
| 5196 | } |
| 5197 | |
| 5198 | /** |
| 5199 | * \brief This function updates lim global structure, if CB parameters in the BSS |
| 5200 | * have changed, and sends an indication to HAL also with the |
| 5201 | * updated HT Parameters. |
| 5202 | * This function does not detect the change in the primary channel, that is done as part |
| 5203 | * of channel Swtich IE processing. |
| 5204 | * If STA is configured with '20Mhz only' mode, then this function does not do anything |
| 5205 | * This function changes the CB mode, only if the self capability is set to '20 as well as 40Mhz' |
| 5206 | * |
| 5207 | * |
| 5208 | * \param pMac Pointer to global MAC structure |
| 5209 | * |
| 5210 | * \param pRcvdHTInfo Pointer to HT Info IE obtained from a Beacon or |
| 5211 | * Probe Response |
| 5212 | * |
| 5213 | * \param bssIdx BSS Index of the Bss to which Station is associated. |
| 5214 | * |
| 5215 | * |
| 5216 | */ |
| 5217 | |
| 5218 | void limUpdateStaRunTimeHTSwitchChnlParams( tpAniSirGlobal pMac, |
| 5219 | tDot11fIEHTInfo *pHTInfo, |
| 5220 | tANI_U8 bssIdx, |
| 5221 | tpPESession psessionEntry) |
| 5222 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5223 | ePhyChanBondState secondaryChnlOffset = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5224 | #if !defined WLAN_FEATURE_VOWIFI |
| 5225 | tANI_U32 localPwrConstraint; |
| 5226 | #endif |
| 5227 | |
| 5228 | //If self capability is set to '20Mhz only', then do not change the CB mode. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5229 | if( !limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5230 | return; |
| 5231 | |
| 5232 | #if !defined WLAN_FEATURE_VOWIFI |
| 5233 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5234 | limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5235 | return; |
| 5236 | } |
| 5237 | #endif |
| 5238 | |
Mihir Shete | 8fdc9f1 | 2014-08-22 11:25:04 +0530 | [diff] [blame] | 5239 | if (pMac->ft.ftPEContext.pFTPreAuthReq) |
| 5240 | { |
| 5241 | limLog( pMac, LOGE, FL( "FT PREAUTH channel change is in progress")); |
| 5242 | return; |
| 5243 | } |
| 5244 | |
Mihir Shete | bc160b7 | 2014-08-22 14:10:39 +0530 | [diff] [blame] | 5245 | /* |
| 5246 | * Do not try to switch channel if RoC is in progress. RoC code path uses |
| 5247 | * pMac->lim.gpLimRemainOnChanReq to notify the upper layers that the device |
| 5248 | * has started listening on the channel requested as part of RoC, if we set |
| 5249 | * pMac->lim.gpLimRemainOnChanReq to NULL as we do below then the |
| 5250 | * upper layers will think that the channel change is not successful and the |
| 5251 | * RoC from the upper layer perspective will never end... |
| 5252 | */ |
| 5253 | if (pMac->lim.gpLimRemainOnChanReq) |
| 5254 | { |
| 5255 | limLog( pMac, LOGE, FL( "RoC is in progress")); |
| 5256 | return; |
| 5257 | } |
| 5258 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5259 | if ( psessionEntry->htSecondaryChannelOffset != ( tANI_U8 ) pHTInfo->secondaryChannelOffset || |
| 5260 | psessionEntry->htRecommendedTxWidthSet != ( tANI_U8 ) pHTInfo->recommendedTxWidthSet ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5261 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5262 | psessionEntry->htSecondaryChannelOffset = ( ePhyChanBondState ) pHTInfo->secondaryChannelOffset; |
| 5263 | psessionEntry->htRecommendedTxWidthSet = ( tANI_U8 ) pHTInfo->recommendedTxWidthSet; |
| 5264 | if ( eHT_CHANNEL_WIDTH_40MHZ == psessionEntry->htRecommendedTxWidthSet ) |
| 5265 | secondaryChnlOffset = (ePhyChanBondState)pHTInfo->secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5266 | |
| 5267 | // Notify HAL |
| 5268 | limLog( pMac, LOGW, FL( "Channel Information in HT IE change" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5269 | "d; sending notification to HAL." ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5270 | limLog( pMac, LOGW, FL( "Primary Channel: %d, Secondary Chan" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5271 | "nel Offset: %d, Channel Width: %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5272 | pHTInfo->primaryChannel, secondaryChnlOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5273 | psessionEntry->htRecommendedTxWidthSet ); |
Madan Mohan Koyyalamudi | fd322a0 | 2012-10-05 12:01:26 -0700 | [diff] [blame] | 5274 | psessionEntry->channelChangeReasonCode=LIM_SWITCH_CHANNEL_OPERATION; |
| 5275 | pMac->lim.gpchangeChannelCallback = NULL; |
| 5276 | pMac->lim.gpchangeChannelData = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5277 | |
| 5278 | #if defined WLAN_FEATURE_VOWIFI |
| 5279 | limSendSwitchChnlParams( pMac, ( tANI_U8 ) pHTInfo->primaryChannel, |
| 5280 | secondaryChnlOffset, psessionEntry->maxTxPower, psessionEntry->peSessionId); |
| 5281 | #else |
| 5282 | limSendSwitchChnlParams( pMac, ( tANI_U8 ) pHTInfo->primaryChannel, |
| 5283 | secondaryChnlOffset, (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
| 5284 | #endif |
| 5285 | |
| 5286 | //In case of IBSS, if STA should update HT Info IE in its beacons. |
| 5287 | if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) |
| 5288 | { |
| 5289 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 5290 | } |
| 5291 | |
| 5292 | } |
| 5293 | } // End limUpdateStaRunTimeHTParams. |
| 5294 | |
| 5295 | /** |
| 5296 | * \brief This function updates the lim global structure, if any of the |
| 5297 | * HT Capabilities have changed. |
| 5298 | * |
| 5299 | * |
| 5300 | * \param pMac Pointer to Global MAC structure |
| 5301 | * |
| 5302 | * \param pHTCapability Pointer to HT Capability Information Element |
| 5303 | * obtained from a Beacon or Probe Response |
| 5304 | * |
| 5305 | * |
| 5306 | * |
| 5307 | */ |
| 5308 | |
| 5309 | void limUpdateStaRunTimeHTCapability( tpAniSirGlobal pMac, |
| 5310 | tDot11fIEHTCaps *pHTCaps ) |
| 5311 | { |
| 5312 | |
| 5313 | if ( pMac->lim.gHTLsigTXOPProtection != ( tANI_U8 ) pHTCaps->lsigTXOPProtection ) |
| 5314 | { |
| 5315 | pMac->lim.gHTLsigTXOPProtection = ( tANI_U8 ) pHTCaps->lsigTXOPProtection; |
| 5316 | // Send change notification to HAL |
| 5317 | } |
| 5318 | |
| 5319 | if ( pMac->lim.gHTAMpduDensity != ( tANI_U8 ) pHTCaps->mpduDensity ) |
| 5320 | { |
| 5321 | pMac->lim.gHTAMpduDensity = ( tANI_U8 ) pHTCaps->mpduDensity; |
| 5322 | // Send change notification to HAL |
| 5323 | } |
| 5324 | |
| 5325 | if ( pMac->lim.gHTMaxRxAMpduFactor != ( tANI_U8 ) pHTCaps->maxRxAMPDUFactor ) |
| 5326 | { |
| 5327 | pMac->lim.gHTMaxRxAMpduFactor = ( tANI_U8 ) pHTCaps->maxRxAMPDUFactor; |
| 5328 | // Send change notification to HAL |
| 5329 | } |
| 5330 | |
| 5331 | |
| 5332 | } // End limUpdateStaRunTimeHTCapability. |
| 5333 | |
| 5334 | /** |
| 5335 | * \brief This function updates lim global structure, if any of the HT |
| 5336 | * Info Parameters have changed. |
| 5337 | * |
| 5338 | * |
| 5339 | * \param pMac Pointer to the global MAC structure |
| 5340 | * |
| 5341 | * \param pHTInfo Pointer to the HT Info IE obtained from a Beacon or |
| 5342 | * Probe Response |
| 5343 | * |
| 5344 | * |
| 5345 | */ |
| 5346 | |
| 5347 | void limUpdateStaRunTimeHTInfo( tpAniSirGlobal pMac, |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5348 | tDot11fIEHTInfo *pHTInfo, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5349 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5350 | if ( psessionEntry->htRecommendedTxWidthSet != ( tANI_U8 )pHTInfo->recommendedTxWidthSet ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5351 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5352 | psessionEntry->htRecommendedTxWidthSet = ( tANI_U8 )pHTInfo->recommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5353 | // Send change notification to HAL |
| 5354 | } |
| 5355 | |
| 5356 | if ( psessionEntry->beaconParams.fRIFSMode != ( tANI_U8 )pHTInfo->rifsMode ) |
| 5357 | { |
| 5358 | psessionEntry->beaconParams.fRIFSMode = ( tANI_U8 )pHTInfo->rifsMode; |
| 5359 | // Send change notification to HAL |
| 5360 | } |
| 5361 | |
| 5362 | if ( pMac->lim.gHTServiceIntervalGranularity != ( tANI_U8 )pHTInfo->serviceIntervalGranularity ) |
| 5363 | { |
| 5364 | pMac->lim.gHTServiceIntervalGranularity = ( tANI_U8 )pHTInfo->serviceIntervalGranularity; |
| 5365 | // Send change notification to HAL |
| 5366 | } |
| 5367 | |
| 5368 | if ( pMac->lim.gHTOperMode != ( tSirMacHTOperatingMode )pHTInfo->opMode ) |
| 5369 | { |
| 5370 | pMac->lim.gHTOperMode = ( tSirMacHTOperatingMode )pHTInfo->opMode; |
| 5371 | // Send change notification to HAL |
| 5372 | } |
| 5373 | |
| 5374 | if ( psessionEntry->beaconParams.llnNonGFCoexist != pHTInfo->nonGFDevicesPresent ) |
| 5375 | { |
| 5376 | psessionEntry->beaconParams.llnNonGFCoexist = ( tANI_U8 )pHTInfo->nonGFDevicesPresent; |
| 5377 | } |
| 5378 | |
| 5379 | if ( pMac->lim.gHTSTBCBasicMCS != ( tANI_U8 )pHTInfo->basicSTBCMCS ) |
| 5380 | { |
| 5381 | pMac->lim.gHTSTBCBasicMCS = ( tANI_U8 )pHTInfo->basicSTBCMCS; |
| 5382 | // Send change notification to HAL |
| 5383 | } |
| 5384 | |
| 5385 | if ( pMac->lim.gHTDualCTSProtection != ( tANI_U8 )pHTInfo->dualCTSProtection ) |
| 5386 | { |
| 5387 | pMac->lim.gHTDualCTSProtection = ( tANI_U8 )pHTInfo->dualCTSProtection; |
| 5388 | // Send change notification to HAL |
| 5389 | } |
| 5390 | |
| 5391 | if ( pMac->lim.gHTSecondaryBeacon != ( tANI_U8 )pHTInfo->secondaryBeacon ) |
| 5392 | { |
| 5393 | pMac->lim.gHTSecondaryBeacon = ( tANI_U8 )pHTInfo->secondaryBeacon; |
| 5394 | // Send change notification to HAL |
| 5395 | } |
| 5396 | |
| 5397 | if ( psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport != ( tANI_U8 )pHTInfo->lsigTXOPProtectionFullSupport ) |
| 5398 | { |
| 5399 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = ( tANI_U8 )pHTInfo->lsigTXOPProtectionFullSupport; |
| 5400 | // Send change notification to HAL |
| 5401 | } |
| 5402 | |
| 5403 | if ( pMac->lim.gHTPCOActive != ( tANI_U8 )pHTInfo->pcoActive ) |
| 5404 | { |
| 5405 | pMac->lim.gHTPCOActive = ( tANI_U8 )pHTInfo->pcoActive; |
| 5406 | // Send change notification to HAL |
| 5407 | } |
| 5408 | |
| 5409 | if ( pMac->lim.gHTPCOPhase != ( tANI_U8 )pHTInfo->pcoPhase ) |
| 5410 | { |
| 5411 | pMac->lim.gHTPCOPhase = ( tANI_U8 )pHTInfo->pcoPhase; |
| 5412 | // Send change notification to HAL |
| 5413 | } |
| 5414 | |
| 5415 | } // End limUpdateStaRunTimeHTInfo. |
| 5416 | |
| 5417 | |
| 5418 | /** ------------------------------------------------------------- |
| 5419 | \fn limProcessHalIndMessages |
| 5420 | \brief callback function for HAL indication |
| 5421 | \param tpAniSirGlobal pMac |
| 5422 | \param tANI_U32 mesgId |
| 5423 | \param void *mesgParam |
| 5424 | \return tSirRetStatu - status |
| 5425 | -------------------------------------------------------------*/ |
| 5426 | |
| 5427 | tSirRetStatus limProcessHalIndMessages(tpAniSirGlobal pMac, tANI_U32 msgId, void *msgParam ) |
| 5428 | { |
| 5429 | //its PE's responsibility to free msgparam when its done extracting the message parameters. |
| 5430 | tSirMsgQ msg; |
| 5431 | |
| 5432 | switch(msgId) |
| 5433 | { |
| 5434 | case SIR_LIM_DEL_TS_IND: |
| 5435 | case SIR_LIM_ADD_BA_IND: |
| 5436 | case SIR_LIM_DEL_BA_ALL_IND: |
| 5437 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 5438 | case SIR_LIM_BEACON_GEN_IND: |
Abhishek Singh | 66c1676 | 2014-08-14 19:13:19 +0530 | [diff] [blame] | 5439 | case SIR_LIM_DEL_BA_IND: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5440 | msg.type = (tANI_U16) msgId; |
| 5441 | msg.bodyptr = msgParam; |
| 5442 | msg.bodyval = 0; |
| 5443 | break; |
| 5444 | |
| 5445 | default: |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5446 | vos_mem_free(msgParam); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5447 | limLog(pMac, LOGP, FL("invalid message id = %d received"), msgId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5448 | return eSIR_FAILURE; |
| 5449 | } |
| 5450 | |
| 5451 | if (limPostMsgApi(pMac, &msg) != eSIR_SUCCESS) |
| 5452 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5453 | vos_mem_free(msgParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5454 | limLog(pMac, LOGP, FL("limPostMsgApi failed for msgid = %d"), msg.type); |
| 5455 | return eSIR_FAILURE; |
| 5456 | } |
| 5457 | return eSIR_SUCCESS; |
| 5458 | } |
| 5459 | |
| 5460 | /** ------------------------------------------------------------- |
| 5461 | \fn limValidateDeltsReq |
| 5462 | \brief Validates DelTs req originated by SME or by HAL and also sends halMsg_DelTs to HAL |
| 5463 | \param tpAniSirGlobal pMac |
| 5464 | \param tpSirDeltsReq pDeltsReq |
| 5465 | \param tSirMacAddr peerMacAddr |
| 5466 | \return eSirRetStatus - status |
| 5467 | -------------------------------------------------------------*/ |
| 5468 | |
| 5469 | tSirRetStatus |
| 5470 | limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr peerMacAddr,tpPESession psessionEntry) |
| 5471 | { |
| 5472 | tpDphHashNode pSta; |
| 5473 | tANI_U8 tsStatus; |
| 5474 | tSirMacTSInfo *tsinfo; |
| 5475 | tANI_U32 i; |
| 5476 | tANI_U8 tspecIdx; |
| 5477 | /* if sta |
| 5478 | * - verify assoc state |
| 5479 | * - del tspec locally |
| 5480 | * if ap, |
| 5481 | * - verify sta is in assoc state |
| 5482 | * - del sta tspec locally |
| 5483 | */ |
| 5484 | if(pDeltsReq == NULL) |
| 5485 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5486 | PELOGE(limLog(pMac, LOGE, FL("Delete TS request pointer is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5487 | return eSIR_FAILURE; |
| 5488 | } |
| 5489 | |
| 5490 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 5491 | { |
| 5492 | tANI_U32 val; |
| 5493 | |
| 5494 | // station always talks to the AP |
| 5495 | pSta = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 5496 | |
| 5497 | val = sizeof(tSirMacAddr); |
| 5498 | #if 0 |
| 5499 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, peerMacAddr, &val) != eSIR_SUCCESS) |
| 5500 | { |
| 5501 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5502 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5503 | return eSIR_FAILURE; |
| 5504 | } |
| 5505 | #endif// TO SUPPORT BT-AMP |
| 5506 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 5507 | |
| 5508 | } |
| 5509 | else |
| 5510 | { |
| 5511 | tANI_U16 assocId; |
| 5512 | tANI_U8 *macaddr = (tANI_U8 *) peerMacAddr; |
| 5513 | |
| 5514 | assocId = pDeltsReq->aid; |
| 5515 | if (assocId != 0) |
| 5516 | pSta = dphGetHashEntry(pMac, assocId, &psessionEntry->dph.dphHashTable); |
| 5517 | else |
| 5518 | pSta = dphLookupHashEntry(pMac, pDeltsReq->macAddr, &assocId, &psessionEntry->dph.dphHashTable); |
| 5519 | |
| 5520 | if (pSta != NULL) |
| 5521 | // TBD: check sta assoc state as well |
| 5522 | for (i =0; i < sizeof(tSirMacAddr); i++) |
| 5523 | macaddr[i] = pSta->staAddr[i]; |
| 5524 | } |
| 5525 | |
| 5526 | if (pSta == NULL) |
| 5527 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5528 | PELOGE(limLog(pMac, LOGE, "Cannot find station context for delts req");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5529 | return eSIR_FAILURE; |
| 5530 | } |
| 5531 | |
| 5532 | if ((! pSta->valid) || |
| 5533 | (pSta->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)) |
| 5534 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5535 | PELOGE(limLog(pMac, LOGE, "Invalid Sta (or state) for DelTsReq");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5536 | return eSIR_FAILURE; |
| 5537 | } |
| 5538 | |
| 5539 | pDeltsReq->req.wsmTspecPresent = 0; |
| 5540 | pDeltsReq->req.wmeTspecPresent = 0; |
| 5541 | pDeltsReq->req.lleTspecPresent = 0; |
| 5542 | |
| 5543 | if ((pSta->wsmEnabled) && |
| 5544 | (pDeltsReq->req.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA)) |
| 5545 | pDeltsReq->req.wsmTspecPresent = 1; |
| 5546 | else if (pSta->wmeEnabled) |
| 5547 | pDeltsReq->req.wmeTspecPresent = 1; |
| 5548 | else if (pSta->lleEnabled) |
| 5549 | pDeltsReq->req.lleTspecPresent = 1; |
| 5550 | else |
| 5551 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5552 | PELOGW(limLog(pMac, LOGW, FL("DELTS_REQ ignore - qos is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5553 | return eSIR_FAILURE; |
| 5554 | } |
| 5555 | |
| 5556 | tsinfo = pDeltsReq->req.wmeTspecPresent ? &pDeltsReq->req.tspec.tsinfo |
| 5557 | : &pDeltsReq->req.tsinfo; |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5558 | limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5559 | FL("received DELTS_REQ message (wmeTspecPresent = %d, lleTspecPresent = %d, wsmTspecPresent = %d, tsid %d, up %d, direction = %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5560 | pDeltsReq->req.wmeTspecPresent, pDeltsReq->req.lleTspecPresent, pDeltsReq->req.wsmTspecPresent, |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5561 | tsinfo->traffic.tsid, tsinfo->traffic.userPrio, tsinfo->traffic.direction); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5562 | |
| 5563 | // if no Access Control, ignore the request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5564 | |
| 5565 | if (limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx) |
| 5566 | != eSIR_SUCCESS) |
| 5567 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5568 | PELOGE(limLog(pMac, LOGE, "ERROR DELTS request for sta assocId %d (tsid %d, up %d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5569 | pSta->assocId, tsinfo->traffic.tsid, tsinfo->traffic.userPrio);) |
| 5570 | return eSIR_FAILURE; |
| 5571 | } |
| 5572 | else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 5573 | (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) |
| 5574 | { |
| 5575 | //edca only now. |
| 5576 | } |
| 5577 | else |
| 5578 | { |
| 5579 | if((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) && |
| 5580 | psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm) |
| 5581 | { |
| 5582 | //send message to HAL to delete TS |
Madan Mohan Koyyalamudi | c0a75a4 | 2013-10-07 04:20:49 +0530 | [diff] [blame] | 5583 | if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, |
| 5584 | pSta->staIndex, |
| 5585 | tspecIdx, |
| 5586 | pDeltsReq->req, |
| 5587 | psessionEntry->peSessionId, |
| 5588 | psessionEntry->bssId)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5589 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5590 | limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5591 | tsinfo->traffic.userPrio); |
| 5592 | return eSIR_FAILURE; |
| 5593 | } |
| 5594 | } |
| 5595 | } |
| 5596 | return eSIR_SUCCESS; |
| 5597 | } |
| 5598 | |
| 5599 | /** ------------------------------------------------------------- |
| 5600 | \fn limRegisterHalIndCallBack |
| 5601 | \brief registers callback function to HAL for any indication. |
| 5602 | \param tpAniSirGlobal pMac |
| 5603 | \return none. |
| 5604 | -------------------------------------------------------------*/ |
| 5605 | void |
| 5606 | limRegisterHalIndCallBack(tpAniSirGlobal pMac) |
| 5607 | { |
| 5608 | tSirMsgQ msg; |
| 5609 | tpHalIndCB pHalCB; |
| 5610 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5611 | pHalCB = vos_mem_malloc(sizeof(tHalIndCB)); |
| 5612 | if ( NULL == pHalCB ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5613 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5614 | limLog(pMac, LOGP, FL("AllocateMemory() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5615 | return; |
| 5616 | } |
| 5617 | |
| 5618 | pHalCB->pHalIndCB = limProcessHalIndMessages; |
| 5619 | |
| 5620 | msg.type = WDA_REGISTER_PE_CALLBACK; |
| 5621 | msg.bodyptr = pHalCB; |
| 5622 | msg.bodyval = 0; |
| 5623 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5624 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5625 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5626 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5627 | vos_mem_free(pHalCB); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5628 | limLog(pMac, LOGP, FL("wdaPostCtrlMsg() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5629 | } |
| 5630 | |
| 5631 | return; |
| 5632 | } |
| 5633 | |
| 5634 | |
| 5635 | /** ------------------------------------------------------------- |
| 5636 | \fn limProcessAddBaInd |
| 5637 | |
| 5638 | \brief handles the BA activity check timeout indication coming from HAL. |
| 5639 | Validates the request, posts request for sending addBaReq message for every candidate in the list. |
| 5640 | \param tpAniSirGlobal pMac |
| 5641 | \param tSirMsgQ limMsg |
| 5642 | \return None |
| 5643 | -------------------------------------------------------------*/ |
| 5644 | void |
| 5645 | limProcessAddBaInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 5646 | { |
| 5647 | tANI_U8 i; |
| 5648 | tANI_U8 tid; |
| 5649 | tANI_U16 assocId; |
| 5650 | tpDphHashNode pSta; |
| 5651 | tpAddBaCandidate pBaCandidate; |
| 5652 | tANI_U32 baCandidateCnt; |
| 5653 | tpBaActivityInd pBaActivityInd; |
| 5654 | tpPESession psessionEntry; |
| 5655 | tANI_U8 sessionId; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5656 | #ifdef FEATURE_WLAN_TDLS |
| 5657 | boolean htCapable = FALSE; |
| 5658 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5659 | |
| 5660 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5661 | if (limMsg->bodyptr == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5662 | return; |
| 5663 | |
| 5664 | pBaActivityInd = (tpBaActivityInd)limMsg->bodyptr; |
| 5665 | baCandidateCnt = pBaActivityInd->baCandidateCnt; |
| 5666 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5667 | if ((psessionEntry = peFindSessionByBssid(pMac,pBaActivityInd->bssId,&sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5668 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5669 | limLog(pMac, LOGE,FL("session does not exist for given BSSId")); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5670 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5671 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5672 | return; |
| 5673 | } |
| 5674 | |
| 5675 | //if we are not HT capable we don't need to handle BA timeout indication from HAL. |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5676 | #ifdef FEATURE_WLAN_TDLS |
| 5677 | if ((baCandidateCnt > pMac->lim.maxStation)) |
| 5678 | #else |
| 5679 | if ((baCandidateCnt > pMac->lim.maxStation) || !psessionEntry->htCapability ) |
| 5680 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5681 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5682 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5683 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5684 | return; |
| 5685 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5686 | |
| 5687 | #ifdef FEATURE_WLAN_TDLS |
| 5688 | //if we have TDLS peers, we should look at peers HT capability, which can be different than |
| 5689 | //AP capability |
| 5690 | pBaCandidate = (tpAddBaCandidate) (((tANI_U8*)pBaActivityInd) + sizeof(tBaActivityInd)); |
| 5691 | |
| 5692 | for (i=0; i<baCandidateCnt; i++, pBaCandidate++) |
| 5693 | { |
| 5694 | pSta = dphLookupHashEntry(pMac, pBaCandidate->staAddr, &assocId, &psessionEntry->dph.dphHashTable); |
| 5695 | if ((NULL == pSta) || (!pSta->valid)) |
| 5696 | continue; |
| 5697 | |
| 5698 | if (STA_ENTRY_TDLS_PEER == pSta->staType) |
| 5699 | htCapable = pSta->mlmStaContext.htCapability; |
| 5700 | else |
| 5701 | htCapable = psessionEntry->htCapability; |
| 5702 | |
| 5703 | if (htCapable) |
| 5704 | break; |
| 5705 | } |
| 5706 | if (!htCapable) |
| 5707 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5708 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5709 | limMsg->bodyptr = NULL; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5710 | return; |
| 5711 | } |
| 5712 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5713 | |
| 5714 | //delete the complete dialoguetoken linked list |
| 5715 | limDeleteDialogueTokenList(pMac); |
| 5716 | pBaCandidate = (tpAddBaCandidate) (((tANI_U8*)pBaActivityInd) + sizeof(tBaActivityInd)); |
| 5717 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5718 | for (i=0; i<baCandidateCnt; i++, pBaCandidate++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5719 | { |
| 5720 | pSta = dphLookupHashEntry(pMac, pBaCandidate->staAddr, &assocId, &psessionEntry->dph.dphHashTable); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5721 | if ((NULL == pSta) || (!pSta->valid)) |
| 5722 | continue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5723 | |
| 5724 | for (tid=0; tid<STACFG_MAX_TC; tid++) |
| 5725 | { |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5726 | if((eBA_DISABLE == pSta->tcCfg[tid].fUseBATx) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5727 | (pBaCandidate->baInfo[tid].fBaEnable)) |
| 5728 | { |
Abhishek Singh | 58749d6 | 2016-02-03 15:27:20 +0530 | [diff] [blame] | 5729 | limLog(pMac, LOG1, |
| 5730 | FL("BA setup for staId = %d, TID: %d, SSN: %d"), |
| 5731 | pSta->staIndex, tid, |
| 5732 | pBaCandidate->baInfo[tid].startingSeqNum); |
| 5733 | limPostMlmAddBAReq(pMac, pSta, tid, |
| 5734 | pBaCandidate->baInfo[tid].startingSeqNum,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5735 | } |
| 5736 | } |
| 5737 | } |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5738 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5739 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5740 | return; |
| 5741 | } |
| 5742 | |
| 5743 | |
| 5744 | /** ------------------------------------------------------------- |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5745 | \fn limDeleteBASessions |
| 5746 | \brief Deletes all the exisitng BA sessions for given session |
| 5747 | and BA direction. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5748 | \param tpAniSirGlobal pMac |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5749 | \param tpPESession pSessionEntry |
| 5750 | \param tANI_U32 baDirection |
| 5751 | \return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5752 | -------------------------------------------------------------*/ |
| 5753 | |
| 5754 | void |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5755 | limDeleteBASessions(tpAniSirGlobal pMac, tpPESession pSessionEntry, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5756 | tANI_U32 baDirection, tSirMacReasonCodes baReasonCode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5757 | { |
| 5758 | tANI_U32 i; |
| 5759 | tANI_U8 tid; |
| 5760 | tpDphHashNode pSta; |
| 5761 | |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5762 | if (NULL == pSessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5763 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5764 | limLog(pMac, LOGE, FL("Session does not exist")); |
| 5765 | } |
| 5766 | else |
| 5767 | { |
| 5768 | for(tid = 0; tid < STACFG_MAX_TC; tid++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5769 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5770 | if ((eLIM_AP_ROLE == pSessionEntry->limSystemRole) || |
| 5771 | (pSessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || |
| 5772 | (eLIM_STA_IN_IBSS_ROLE == pSessionEntry->limSystemRole) || |
| 5773 | (pSessionEntry->limSystemRole == eLIM_P2P_DEVICE_GO)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5774 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5775 | for (i = 0; i < pMac->lim.maxStation; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5776 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5777 | pSta = pSessionEntry->dph.dphHashTable.pDphNodeArray + i; |
| 5778 | if (pSta && pSta->added) |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5779 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5780 | if ((eBA_ENABLE == pSta->tcCfg[tid].fUseBATx) && |
| 5781 | (baDirection & BA_INITIATOR)) |
| 5782 | { |
| 5783 | limPostMlmDelBAReq(pMac, pSta, eBA_INITIATOR, tid, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5784 | baReasonCode, |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5785 | pSessionEntry); |
| 5786 | } |
| 5787 | if ((eBA_ENABLE == pSta->tcCfg[tid].fUseBARx) && |
| 5788 | (baDirection & BA_RECIPIENT)) |
| 5789 | { |
| 5790 | limPostMlmDelBAReq(pMac, pSta, eBA_RECIPIENT, tid, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5791 | baReasonCode, |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5792 | pSessionEntry); |
| 5793 | } |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5794 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5795 | } |
| 5796 | } |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5797 | else if ((eLIM_STA_ROLE == pSessionEntry->limSystemRole) || |
| 5798 | (eLIM_BT_AMP_STA_ROLE == pSessionEntry->limSystemRole) || |
| 5799 | (eLIM_P2P_DEVICE_ROLE == pSessionEntry->limSystemRole)) |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5800 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5801 | pSta = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, |
| 5802 | &pSessionEntry->dph.dphHashTable); |
| 5803 | if (pSta && pSta->added) |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5804 | { |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5805 | if ((eBA_ENABLE == pSta->tcCfg[tid].fUseBATx) && |
| 5806 | (baDirection & BA_INITIATOR)) |
| 5807 | { |
| 5808 | limPostMlmDelBAReq(pMac, pSta, eBA_INITIATOR, tid, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5809 | baReasonCode, |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5810 | pSessionEntry); |
| 5811 | } |
| 5812 | if ((eBA_ENABLE == pSta->tcCfg[tid].fUseBARx) && |
| 5813 | (baDirection & BA_RECIPIENT)) |
| 5814 | { |
| 5815 | limPostMlmDelBAReq(pMac, pSta, eBA_RECIPIENT, tid, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5816 | baReasonCode, |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5817 | pSessionEntry); |
| 5818 | } |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5819 | } |
| 5820 | } |
| 5821 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | } |
| 5823 | } |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5824 | |
| 5825 | /** ------------------------------------------------------------- |
| 5826 | \fn limDelAllBASessions |
| 5827 | \brief Deletes all the exisitng BA sessions. |
| 5828 | \param tpAniSirGlobal pMac |
| 5829 | \return None |
| 5830 | -------------------------------------------------------------*/ |
| 5831 | |
| 5832 | void limDelAllBASessions(tpAniSirGlobal pMac) |
| 5833 | { |
| 5834 | tANI_U32 i; |
| 5835 | tpPESession pSessionEntry; |
| 5836 | |
| 5837 | for (i = 0; i < pMac->lim.maxBssId; i++) |
| 5838 | { |
| 5839 | pSessionEntry = peFindSessionBySessionId(pMac, i); |
| 5840 | if (pSessionEntry) |
| 5841 | { |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5842 | limDeleteBASessions(pMac, pSessionEntry, BA_BOTH_DIRECTIONS, |
| 5843 | eSIR_MAC_UNSPEC_FAILURE_REASON); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5844 | } |
| 5845 | } |
| 5846 | } |
| 5847 | |
| 5848 | /** ------------------------------------------------------------- |
| 5849 | \fn limDelAllBASessionsBtc |
| 5850 | \brief Deletes all the exisitng BA receipent sessions in 2.4GHz |
| 5851 | band. |
| 5852 | \param tpAniSirGlobal pMac |
| 5853 | \return None |
| 5854 | -------------------------------------------------------------*/ |
| 5855 | |
Leela Venkata Kiran Kumar Reddy Chirala | b8dadc2 | 2013-11-05 12:34:32 -0800 | [diff] [blame] | 5856 | void limDelPerBssBASessionsBtc(tpAniSirGlobal pMac) |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5857 | { |
Leela Venkata Kiran Kumar Reddy Chirala | b8dadc2 | 2013-11-05 12:34:32 -0800 | [diff] [blame] | 5858 | tANI_U8 sessionId; |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5859 | tpPESession pSessionEntry; |
Leela Venkata Kiran Kumar Reddy Chirala | b8dadc2 | 2013-11-05 12:34:32 -0800 | [diff] [blame] | 5860 | pSessionEntry = peFindSessionByBssid(pMac,pMac->btc.btcBssfordisableaggr, |
| 5861 | &sessionId); |
| 5862 | if (pSessionEntry) |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5863 | { |
Leela Venkata Kiran Kumar Reddy Chirala | b8dadc2 | 2013-11-05 12:34:32 -0800 | [diff] [blame] | 5864 | PELOGW(limLog(pMac, LOGW, |
| 5865 | "Deleting the BA for session %d as host got BTC event", sessionId);) |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 5866 | limDeleteBASessions(pMac, pSessionEntry, BA_BOTH_DIRECTIONS, |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 5867 | eSIR_MAC_PEER_TIMEDOUT_REASON); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5868 | } |
| 5869 | } |
| 5870 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5871 | /** ------------------------------------------------------------- |
| 5872 | \fn limProcessDelTsInd |
| 5873 | \brief handles the DeleteTS indication coming from HAL or generated by PE itself in some error cases. |
| 5874 | Validates the request, sends the DelTs action frame to the Peer and sends DelTs indicatoin to HDD. |
| 5875 | \param tpAniSirGlobal pMac |
| 5876 | \param tSirMsgQ limMsg |
| 5877 | \return None |
| 5878 | -------------------------------------------------------------*/ |
| 5879 | void |
| 5880 | limProcessDelTsInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 5881 | { |
| 5882 | tpDphHashNode pSta; |
| 5883 | tpDelTsParams pDelTsParam = (tpDelTsParams) (limMsg->bodyptr); |
| 5884 | tpSirDeltsReq pDelTsReq = NULL; |
| 5885 | tSirMacAddr peerMacAddr; |
| 5886 | tpSirDeltsReqInfo pDelTsReqInfo; |
| 5887 | tpLimTspecInfo pTspecInfo; |
| 5888 | tpPESession psessionEntry; |
| 5889 | tANI_U8 sessionId; |
| 5890 | |
| 5891 | if((psessionEntry = peFindSessionByBssid(pMac,pDelTsParam->bssId,&sessionId))== NULL) |
| 5892 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5893 | limLog(pMac, LOGE,FL("session does not exist for given BssId")); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5894 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5895 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5896 | return; |
| 5897 | } |
| 5898 | |
| 5899 | pTspecInfo = &(pMac->lim.tspecInfo[pDelTsParam->tspecIdx]); |
| 5900 | if(pTspecInfo->inuse == false) |
| 5901 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5902 | PELOGE(limLog(pMac, LOGE, FL("tspec entry with index %d is not in use"), pDelTsParam->tspecIdx);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5903 | goto error1; |
| 5904 | } |
| 5905 | |
| 5906 | pSta = dphGetHashEntry(pMac, pTspecInfo->assocId, &psessionEntry->dph.dphHashTable); |
| 5907 | if(pSta == NULL) |
| 5908 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5909 | limLog(pMac, LOGE, FL("Could not find entry in DPH table for assocId = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5910 | pTspecInfo->assocId); |
| 5911 | goto error1; |
| 5912 | } |
| 5913 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5914 | pDelTsReq = vos_mem_malloc(sizeof(tSirDeltsReq)); |
| 5915 | if ( NULL == pDelTsReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5916 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5917 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5918 | goto error1; |
| 5919 | } |
| 5920 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5921 | vos_mem_set( (tANI_U8 *)pDelTsReq, sizeof(tSirDeltsReq), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5922 | |
| 5923 | if(pSta->wmeEnabled) |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5924 | vos_mem_copy( &(pDelTsReq->req.tspec), &(pTspecInfo->tspec), sizeof(tSirMacTspecIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5925 | else |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5926 | vos_mem_copy( &(pDelTsReq->req.tsinfo), &(pTspecInfo->tspec.tsinfo), sizeof(tSirMacTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5927 | |
| 5928 | |
| 5929 | //validate the req |
| 5930 | if (eSIR_SUCCESS != limValidateDeltsReq(pMac, pDelTsReq, peerMacAddr,psessionEntry)) |
| 5931 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5932 | PELOGE(limLog(pMac, LOGE, FL("limValidateDeltsReq failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5933 | goto error2; |
| 5934 | } |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5935 | limLog(pMac, LOG1, "Sent DELTS request to station with " |
| 5936 | "assocId = %d MacAddr = "MAC_ADDRESS_STR, |
| 5937 | pDelTsReq->aid, MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5938 | |
| 5939 | limSendDeltsReqActionFrame(pMac, peerMacAddr, pDelTsReq->req.wmeTspecPresent, &pDelTsReq->req.tsinfo, &pDelTsReq->req.tspec, |
| 5940 | psessionEntry); |
| 5941 | |
| 5942 | // prepare and send an sme indication to HDD |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5943 | pDelTsReqInfo = vos_mem_malloc(sizeof(tSirDeltsReqInfo)); |
| 5944 | if ( NULL == pDelTsReqInfo ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5945 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5946 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5947 | goto error3; |
| 5948 | } |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5949 | vos_mem_set( (tANI_U8 *)pDelTsReqInfo, sizeof(tSirDeltsReqInfo), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5950 | |
| 5951 | if(pSta->wmeEnabled) |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5952 | vos_mem_copy( &(pDelTsReqInfo->tspec), &(pTspecInfo->tspec), sizeof(tSirMacTspecIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5953 | else |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5954 | vos_mem_copy( &(pDelTsReqInfo->tsinfo), &(pTspecInfo->tspec.tsinfo), sizeof(tSirMacTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5955 | |
| 5956 | limSendSmeDeltsInd(pMac, pDelTsReqInfo, pDelTsReq->aid,psessionEntry); |
| 5957 | |
| 5958 | error3: |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5959 | vos_mem_free(pDelTsReqInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5960 | error2: |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5961 | vos_mem_free(pDelTsReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5962 | error1: |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 5963 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 5964 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5965 | return; |
| 5966 | } |
| 5967 | |
| 5968 | /** |
| 5969 | * \brief Setup an A-MPDU/BA session |
| 5970 | * |
| 5971 | * \sa limPostMlmAddBAReq |
| 5972 | * |
| 5973 | * \param pMac The global tpAniSirGlobal object |
| 5974 | * |
| 5975 | * \param pStaDs DPH Hash Node object of peer STA |
| 5976 | * |
| 5977 | * \param tid TID for which a BA is being setup. |
| 5978 | * If this is set to 0xFFFF, then we retrieve |
| 5979 | * the default TID from the CFG |
| 5980 | * |
| 5981 | * \return eSIR_SUCCESS if setup completes successfully |
| 5982 | * eSIR_FAILURE is some problem is encountered |
| 5983 | */ |
| 5984 | tSirRetStatus limPostMlmAddBAReq( tpAniSirGlobal pMac, |
| 5985 | tpDphHashNode pStaDs, |
| 5986 | tANI_U8 tid, tANI_U16 startingSeqNum,tpPESession psessionEntry) |
| 5987 | { |
| 5988 | tSirRetStatus status = eSIR_SUCCESS; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5989 | tpLimMlmAddBAReq pMlmAddBAReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5990 | tpDialogueToken dialogueTokenNode; |
| 5991 | tANI_U32 val = 0; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5993 | // Check if the peer is a 11n capable STA |
| 5994 | // FIXME - Need a 11n peer indication in DPH. |
| 5995 | // For now, using the taurusPeer attribute |
| 5996 | //if( 0 == pStaDs->taurusPeer == ) |
| 5997 | //return eSIR_SUCCESS; |
| 5998 | |
| 5999 | // Allocate for LIM_MLM_ADDBA_REQ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6000 | pMlmAddBAReq = vos_mem_malloc(sizeof( tLimMlmAddBAReq )); |
| 6001 | if ( NULL == pMlmAddBAReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6002 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6003 | limLog( pMac, LOGP, FL("AllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6004 | status = eSIR_MEM_ALLOC_FAILED; |
| 6005 | goto returnFailure; |
| 6006 | } |
| 6007 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6008 | vos_mem_set( (void *) pMlmAddBAReq, sizeof( tLimMlmAddBAReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6009 | |
| 6010 | // Copy the peer MAC |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6011 | vos_mem_copy( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6012 | pMlmAddBAReq->peerMacAddr, |
| 6013 | pStaDs->staAddr, |
| 6014 | sizeof( tSirMacAddr )); |
| 6015 | |
| 6016 | // Update the TID |
| 6017 | pMlmAddBAReq->baTID = tid; |
| 6018 | |
| 6019 | // Determine the supported BA policy of local STA |
| 6020 | // for the TID of interest |
| 6021 | pMlmAddBAReq->baPolicy = (pStaDs->baPolicyFlag >> tid) & 0x1; |
| 6022 | |
| 6023 | // BA Buffer Size |
| 6024 | // Requesting the ADDBA recipient to populate the size. |
| 6025 | // If ADDBA is accepted, a non-zero buffer size should |
| 6026 | // be returned in the ADDBA Rsp |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 6027 | if ((TRUE == psessionEntry->isCiscoVendorAP) && |
| 6028 | (eHT_CHANNEL_WIDTH_80MHZ != pStaDs->htSupportedChannelWidthSet)) |
| 6029 | { |
| 6030 | /* Cisco AP has issues in receiving more than 25 "mpdu in ampdu" |
| 6031 | causing very low throughput in HT40 case */ |
| 6032 | limLog( pMac, LOGW, |
| 6033 | FL( "Requesting ADDBA with Cisco 1225 AP, window size 25")); |
| 6034 | pMlmAddBAReq->baBufferSize = MAX_BA_WINDOW_SIZE_FOR_CISCO; |
| 6035 | } |
Abhishek Singh | 01c73d1 | 2015-03-12 15:13:44 +0530 | [diff] [blame] | 6036 | else if (pMac->miracastVendorConfig) |
| 6037 | { |
| 6038 | if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS) |
| 6039 | { |
| 6040 | limLog(pMac, LOGE, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT")); |
| 6041 | status = eSIR_FAILURE; |
| 6042 | goto returnFailure; |
| 6043 | } |
| 6044 | |
| 6045 | pMlmAddBAReq->baBufferSize = val; |
| 6046 | } |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 6047 | else |
| 6048 | pMlmAddBAReq->baBufferSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6049 | |
| 6050 | limLog( pMac, LOGW, |
Abhishek Singh | 01c73d1 | 2015-03-12 15:13:44 +0530 | [diff] [blame] | 6051 | FL( "Requesting an ADDBA to setup a %s BA session with STA %d for TID %d buff = %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6052 | (pMlmAddBAReq->baPolicy ? "Immediate": "Delayed"), |
| 6053 | pStaDs->staIndex, |
Abhishek Singh | 01c73d1 | 2015-03-12 15:13:44 +0530 | [diff] [blame] | 6054 | tid, pMlmAddBAReq->baBufferSize ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6055 | |
| 6056 | // BA Timeout |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 6057 | if (wlan_cfgGetInt(pMac, WNI_CFG_BA_TIMEOUT, &val) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6058 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6059 | limLog(pMac, LOGE, FL("could not retrieve BA TIME OUT Param CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6060 | status = eSIR_FAILURE; |
| 6061 | goto returnFailure; |
| 6062 | } |
| 6063 | pMlmAddBAReq->baTimeout = val; // In TU's |
| 6064 | |
| 6065 | // ADDBA Failure Timeout |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 6066 | // FIXME_AMPDU - Need to retrieve this from CFG. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6067 | //right now we are not checking for response timeout. so this field is dummy just to be compliant with the spec. |
| 6068 | pMlmAddBAReq->addBAFailureTimeout = 2000; // In TU's |
| 6069 | |
| 6070 | // BA Starting Sequence Number |
| 6071 | pMlmAddBAReq->baSSN = startingSeqNum; |
| 6072 | |
| 6073 | /* Update PE session Id*/ |
| 6074 | pMlmAddBAReq->sessionId = psessionEntry->peSessionId; |
| 6075 | |
| 6076 | LIM_SET_STA_BA_STATE(pStaDs, tid, eLIM_BA_STATE_WT_ADD_RSP); |
| 6077 | |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 6078 | dialogueTokenNode = limAssignDialogueToken(pMac); |
| 6079 | if (NULL == dialogueTokenNode) |
| 6080 | { |
| 6081 | limLog(pMac, LOGE, FL("could not assign dialogue token")); |
| 6082 | status = eSIR_FAILURE; |
| 6083 | goto returnFailure; |
| 6084 | } |
| 6085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6086 | pMlmAddBAReq->baDialogToken = dialogueTokenNode->token; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 6087 | //set assocId and tid information in the lim linked list |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6088 | dialogueTokenNode->assocId = pStaDs->assocId; |
| 6089 | dialogueTokenNode->tid = tid; |
| 6090 | // Send ADDBA Req to MLME |
| 6091 | limPostMlmMessage( pMac, |
| 6092 | LIM_MLM_ADDBA_REQ, |
| 6093 | (tANI_U32 *) pMlmAddBAReq ); |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 6094 | return eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6095 | |
| 6096 | returnFailure: |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6097 | vos_mem_free(pMlmAddBAReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6098 | return status; |
| 6099 | } |
| 6100 | |
| 6101 | /** |
| 6102 | * \brief Post LIM_MLM_ADDBA_RSP to MLME. MLME |
| 6103 | * will then send an ADDBA Rsp to peer MAC entity |
| 6104 | * with the appropriate ADDBA status code |
| 6105 | * |
| 6106 | * \sa limPostMlmAddBARsp |
| 6107 | * |
| 6108 | * \param pMac The global tpAniSirGlobal object |
| 6109 | * |
| 6110 | * \param peerMacAddr MAC address of peer entity that will |
| 6111 | * be the recipient of this ADDBA Rsp |
| 6112 | * |
| 6113 | * \param baStatusCode ADDBA Rsp status code |
| 6114 | * |
| 6115 | * \param baDialogToken ADDBA Rsp dialog token |
| 6116 | * |
| 6117 | * \param baTID TID of interest |
| 6118 | * |
| 6119 | * \param baPolicy The BA policy |
| 6120 | * |
| 6121 | * \param baBufferSize The BA buffer size |
| 6122 | * |
| 6123 | * \param baTimeout BA timeout in TU's |
| 6124 | * |
| 6125 | * \return eSIR_SUCCESS if setup completes successfully |
| 6126 | * eSIR_FAILURE is some problem is encountered |
| 6127 | */ |
| 6128 | tSirRetStatus limPostMlmAddBARsp( tpAniSirGlobal pMac, |
| 6129 | tSirMacAddr peerMacAddr, |
| 6130 | tSirMacStatusCodes baStatusCode, |
| 6131 | tANI_U8 baDialogToken, |
| 6132 | tANI_U8 baTID, |
| 6133 | tANI_U8 baPolicy, |
| 6134 | tANI_U16 baBufferSize, |
| 6135 | tANI_U16 baTimeout, |
| 6136 | tpPESession psessionEntry) |
| 6137 | { |
| 6138 | tSirRetStatus status = eSIR_SUCCESS; |
| 6139 | tpLimMlmAddBARsp pMlmAddBARsp; |
| 6140 | |
| 6141 | // Allocate for LIM_MLM_ADDBA_RSP |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6142 | pMlmAddBARsp = vos_mem_malloc(sizeof( tLimMlmAddBARsp )); |
| 6143 | if ( NULL == pMlmAddBARsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6144 | { |
| 6145 | limLog( pMac, LOGE, |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6146 | FL("AllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6147 | status ); |
| 6148 | |
| 6149 | status = eSIR_MEM_ALLOC_FAILED; |
| 6150 | goto returnFailure; |
| 6151 | } |
| 6152 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6153 | vos_mem_set( (void *) pMlmAddBARsp, sizeof( tLimMlmAddBARsp ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6154 | |
| 6155 | // Copy the peer MAC |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6156 | vos_mem_copy( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6157 | pMlmAddBARsp->peerMacAddr, |
| 6158 | peerMacAddr, |
| 6159 | sizeof( tSirMacAddr )); |
| 6160 | |
| 6161 | pMlmAddBARsp->baDialogToken = baDialogToken; |
| 6162 | pMlmAddBARsp->addBAResultCode = baStatusCode; |
| 6163 | pMlmAddBARsp->baTID = baTID; |
| 6164 | pMlmAddBARsp->baPolicy = baPolicy; |
| 6165 | pMlmAddBARsp->baBufferSize = baBufferSize; |
| 6166 | pMlmAddBARsp->baTimeout = baTimeout; |
| 6167 | |
| 6168 | /* UPdate PE session ID*/ |
| 6169 | pMlmAddBARsp->sessionId = psessionEntry->peSessionId; |
| 6170 | |
| 6171 | // Send ADDBA Rsp to MLME |
| 6172 | limPostMlmMessage( pMac, |
| 6173 | LIM_MLM_ADDBA_RSP, |
| 6174 | (tANI_U32 *) pMlmAddBARsp ); |
| 6175 | |
| 6176 | returnFailure: |
| 6177 | |
| 6178 | return status; |
| 6179 | } |
| 6180 | |
| 6181 | /** |
| 6182 | * \brief Post LIM_MLM_DELBA_REQ to MLME. MLME |
| 6183 | * will then send an DELBA Ind to peer MAC entity |
| 6184 | * with the appropriate DELBA status code |
| 6185 | * |
| 6186 | * \sa limPostMlmDelBAReq |
| 6187 | * |
| 6188 | * \param pMac The global tpAniSirGlobal object |
| 6189 | * |
| 6190 | * \param pSta DPH Hash Node object of peer MAC entity |
| 6191 | * for which the BA session is being deleted |
| 6192 | * |
| 6193 | * \param baDirection DELBA direction |
| 6194 | * |
| 6195 | * \param baTID TID for which the BA session is being deleted |
| 6196 | * |
| 6197 | * \param baReasonCode DELBA Req reason code |
| 6198 | * |
| 6199 | * \return eSIR_SUCCESS if setup completes successfully |
| 6200 | * eSIR_FAILURE is some problem is encountered |
| 6201 | */ |
| 6202 | tSirRetStatus limPostMlmDelBAReq( tpAniSirGlobal pMac, |
| 6203 | tpDphHashNode pSta, |
| 6204 | tANI_U8 baDirection, |
| 6205 | tANI_U8 baTID, |
| 6206 | tSirMacReasonCodes baReasonCode, |
| 6207 | tpPESession psessionEntry) |
| 6208 | { |
| 6209 | tSirRetStatus status = eSIR_SUCCESS; |
| 6210 | tpLimMlmDelBAReq pMlmDelBAReq; |
| 6211 | tLimBAState curBaState; |
| 6212 | |
| 6213 | if(NULL == pSta) |
| 6214 | return eSIR_FAILURE; |
| 6215 | |
| 6216 | LIM_GET_STA_BA_STATE(pSta, baTID, &curBaState); |
| 6217 | |
| 6218 | // Need to validate the current BA State. |
| 6219 | if( eLIM_BA_STATE_IDLE != curBaState) |
| 6220 | { |
| 6221 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6222 | FL( "Received unexpected DELBA REQ when STA BA state for tid = %d is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6223 | baTID, |
| 6224 | curBaState); |
| 6225 | |
| 6226 | status = eSIR_FAILURE; |
| 6227 | goto returnFailure; |
| 6228 | } |
| 6229 | |
| 6230 | // Allocate for LIM_MLM_DELBA_REQ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6231 | pMlmDelBAReq = vos_mem_malloc(sizeof( tLimMlmDelBAReq )); |
| 6232 | if ( NULL == pMlmDelBAReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6233 | { |
| 6234 | limLog( pMac, LOGE, |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6235 | FL("AllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6236 | status ); |
| 6237 | |
| 6238 | status = eSIR_MEM_ALLOC_FAILED; |
| 6239 | goto returnFailure; |
| 6240 | } |
| 6241 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6242 | vos_mem_set( (void *) pMlmDelBAReq, sizeof( tLimMlmDelBAReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6243 | |
| 6244 | // Copy the peer MAC |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6245 | vos_mem_copy( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6246 | pMlmDelBAReq->peerMacAddr, |
| 6247 | pSta->staAddr, |
| 6248 | sizeof( tSirMacAddr )); |
| 6249 | |
| 6250 | pMlmDelBAReq->baDirection = baDirection; |
| 6251 | pMlmDelBAReq->baTID = baTID; |
| 6252 | pMlmDelBAReq->delBAReasonCode = baReasonCode; |
| 6253 | |
| 6254 | /* Update PE session ID*/ |
| 6255 | pMlmDelBAReq->sessionId = psessionEntry->peSessionId; |
| 6256 | |
| 6257 | //we don't have valid BA session for the given direction. |
| 6258 | // HDD wants to get the BA session deleted on PEER in this case. |
| 6259 | // in this case we just need to send DelBA to the peer. |
| 6260 | if(((eBA_RECIPIENT == baDirection) && (eBA_DISABLE == pSta->tcCfg[baTID].fUseBARx)) || |
| 6261 | ((eBA_INITIATOR == baDirection) && (eBA_DISABLE == pSta->tcCfg[baTID].fUseBATx))) |
| 6262 | { |
| 6263 | // Send DELBA Ind over the air |
| 6264 | if( eSIR_SUCCESS != |
| 6265 | (status = limSendDelBAInd( pMac, pMlmDelBAReq,psessionEntry))) |
| 6266 | status = eSIR_FAILURE; |
| 6267 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6268 | vos_mem_free(pMlmDelBAReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6269 | return status; |
| 6270 | } |
| 6271 | |
| 6272 | |
| 6273 | // Update the BA state in STA |
| 6274 | LIM_SET_STA_BA_STATE(pSta, pMlmDelBAReq->baTID, eLIM_BA_STATE_WT_DEL_RSP); |
| 6275 | |
| 6276 | // Send DELBA Req to MLME |
| 6277 | limPostMlmMessage( pMac, |
| 6278 | LIM_MLM_DELBA_REQ, |
| 6279 | (tANI_U32 *) pMlmDelBAReq ); |
| 6280 | |
| 6281 | returnFailure: |
| 6282 | |
| 6283 | return status; |
| 6284 | } |
| 6285 | |
| 6286 | /** |
| 6287 | * \brief Send WDA_ADDBA_REQ to HAL, in order |
| 6288 | * to setup a new BA session with a peer |
| 6289 | * |
| 6290 | * \sa limPostMsgAddBAReq |
| 6291 | * |
| 6292 | * \param pMac The global tpAniSirGlobal object |
| 6293 | * |
| 6294 | * \param pSta Runtime, STA-related configuration cached |
| 6295 | * in the HashNode object |
| 6296 | * |
| 6297 | * \param baDialogToken The Action Frame dialog token |
| 6298 | * |
| 6299 | * \param baTID TID for which the BA session is being setup |
| 6300 | * |
| 6301 | * \param baPolicy BA Policy |
| 6302 | * |
| 6303 | * \param baBufferSize The requested BA buffer size |
| 6304 | * |
| 6305 | * \param baTimeout BA Timeout. 0 indicates no BA timeout enforced |
| 6306 | * |
| 6307 | * \param baSSN Starting Sequence Number for this BA session |
| 6308 | * |
| 6309 | * \param baDirection BA Direction: 1 - Initiator, 0 - Recipient |
| 6310 | * |
| 6311 | * \return none |
| 6312 | * |
| 6313 | */ |
| 6314 | tSirRetStatus limPostMsgAddBAReq( tpAniSirGlobal pMac, |
| 6315 | tpDphHashNode pSta, |
| 6316 | tANI_U8 baDialogToken, |
| 6317 | tANI_U8 baTID, |
| 6318 | tANI_U8 baPolicy, |
| 6319 | tANI_U16 baBufferSize, |
| 6320 | tANI_U16 baTimeout, |
| 6321 | tANI_U16 baSSN, |
| 6322 | tANI_U8 baDirection, |
| 6323 | tpPESession psessionEntry) |
| 6324 | { |
| 6325 | tpAddBAParams pAddBAParams = NULL; |
| 6326 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6327 | tSirMsgQ msgQ; |
| 6328 | |
| 6329 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 6330 | // we can only do BA on "hard" STAs |
| 6331 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 6332 | { |
| 6333 | retCode = eHAL_STATUS_FAILURE; |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 6334 | limLog( pMac, LOGE, |
| 6335 | FL( "Sta Id is not HW Sta Id, return code is %d " ), retCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6336 | goto returnFailure; |
| 6337 | } |
| 6338 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 6339 | |
| 6340 | // Allocate for WDA_ADDBA_REQ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6341 | pAddBAParams = vos_mem_malloc(sizeof( tAddBAParams )); |
| 6342 | if ( NULL == pAddBAParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6343 | { |
| 6344 | limLog( pMac, LOGE, |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6345 | FL("AllocateMemory failed") |
| 6346 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6347 | |
| 6348 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 6349 | goto returnFailure; |
| 6350 | } |
| 6351 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6352 | vos_mem_set( (void *) pAddBAParams, sizeof( tAddBAParams ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6353 | |
| 6354 | // Copy the peer MAC address |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6355 | vos_mem_copy( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6356 | (void *) pAddBAParams->peerMacAddr, |
| 6357 | (void *) pSta->staAddr, |
| 6358 | sizeof( tSirMacAddr )); |
| 6359 | |
| 6360 | // Populate the REQ parameters |
| 6361 | pAddBAParams->staIdx = pSta->staIndex; |
| 6362 | pAddBAParams->baDialogToken = baDialogToken; |
| 6363 | pAddBAParams->baTID = baTID; |
| 6364 | pAddBAParams->baPolicy = baPolicy; |
| 6365 | pAddBAParams->baBufferSize = baBufferSize; |
| 6366 | pAddBAParams->baTimeout = baTimeout; |
| 6367 | pAddBAParams->baSSN = baSSN; |
| 6368 | pAddBAParams->baDirection = baDirection; |
| 6369 | pAddBAParams->respReqd = 1; |
| 6370 | |
| 6371 | /* UPdate PE session ID */ |
| 6372 | pAddBAParams->sessionId = psessionEntry->peSessionId; |
| 6373 | |
| 6374 | // Post WDA_ADDBA_REQ to HAL. |
| 6375 | msgQ.type = WDA_ADDBA_REQ; |
| 6376 | // |
| 6377 | // FIXME_AMPDU |
| 6378 | // A global counter (dialog token) is required to keep track of |
| 6379 | // all PE <-> HAL communication(s) |
| 6380 | // |
| 6381 | msgQ.reserved = 0; |
| 6382 | msgQ.bodyptr = pAddBAParams; |
| 6383 | msgQ.bodyval = 0; |
| 6384 | |
| 6385 | limLog( pMac, LOGW, |
Kaushik, Sushant | 335328c | 2014-07-31 19:15:31 +0530 | [diff] [blame] | 6386 | FL( "Sending WDA_ADDBA_REQ... Buff size = %d , staId = %d , timeout = %d " |
| 6387 | "Tid = %d, Direction = %d , Policy = %d, sessionId = %d , baSSN = %d " ), |
| 6388 | pAddBAParams->baBufferSize, pAddBAParams->staIdx, |
| 6389 | pAddBAParams->baTimeout, pAddBAParams->baTID, |
| 6390 | pAddBAParams->baDirection, pAddBAParams->baPolicy, |
| 6391 | pAddBAParams->sessionId, pAddBAParams->baSSN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6392 | |
| 6393 | //defer any other message until we get response back. |
| 6394 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 6395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6396 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6397 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 6398 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT, psessionEntry, 0, 0); |
| 6399 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 6400 | |
| 6401 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 6402 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6403 | FL("Posting WDA_ADDBA_REQ to HAL failed! Reason = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6404 | retCode ); |
| 6405 | else |
| 6406 | return retCode; |
| 6407 | |
| 6408 | returnFailure: |
| 6409 | |
| 6410 | // Clean-up... |
| 6411 | if( NULL != pAddBAParams ) |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6412 | vos_mem_free( pAddBAParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6413 | |
| 6414 | return retCode; |
| 6415 | |
| 6416 | } |
| 6417 | |
| 6418 | /** |
| 6419 | * \brief Send WDA_DELBA_IND to HAL, in order |
| 6420 | * to delete an existing BA session with peer |
| 6421 | * |
| 6422 | * \sa limPostMsgDelBAInd |
| 6423 | * |
| 6424 | * \param pMac The global tpAniSirGlobal object |
| 6425 | * |
| 6426 | * \param pSta Runtime, STA-related configuration cached |
| 6427 | * in the HashNode object |
| 6428 | * |
| 6429 | * \param baTID TID for which the BA session is being setup |
| 6430 | * |
| 6431 | * \param baDirection Identifies whether the DELBA Ind was |
| 6432 | * sent by the BA initiator or recipient |
| 6433 | * |
| 6434 | * \return none |
| 6435 | * |
| 6436 | */ |
| 6437 | tSirRetStatus limPostMsgDelBAInd( tpAniSirGlobal pMac, |
| 6438 | tpDphHashNode pSta, |
| 6439 | tANI_U8 baTID, |
| 6440 | tANI_U8 baDirection, |
| 6441 | tpPESession psessionEntry) |
| 6442 | { |
| 6443 | tpDelBAParams pDelBAParams = NULL; |
| 6444 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6445 | tSirMsgQ msgQ; |
| 6446 | |
| 6447 | // Allocate for SIR_HAL_DELBA_IND |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6448 | pDelBAParams = vos_mem_malloc(sizeof( tDelBAParams )); |
| 6449 | if ( NULL == pDelBAParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6450 | { |
| 6451 | limLog( pMac, LOGE, |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6452 | FL("AllocateMemory failed") |
| 6453 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6454 | |
| 6455 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 6456 | goto returnFailure; |
| 6457 | } |
| 6458 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6459 | vos_mem_set( (void *) pDelBAParams, sizeof( tDelBAParams ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6460 | |
| 6461 | // Populate the REQ parameters |
| 6462 | pDelBAParams->staIdx = pSta->staIndex; |
| 6463 | pDelBAParams->baTID = baTID; |
| 6464 | pDelBAParams->baDirection = baDirection; |
| 6465 | |
| 6466 | /* Update PE session ID */ |
| 6467 | |
| 6468 | |
| 6469 | //TBD-RAJESH Updating of the session ID is requird for SIR_HAL_DELBA_IND????? |
| 6470 | //pDelBAParams->sessionId = psessionEntry->peSessionId; |
| 6471 | |
| 6472 | // Post WDA_DELBA_IND to HAL. |
| 6473 | msgQ.type = WDA_DELBA_IND; |
| 6474 | // |
| 6475 | // FIXME: |
| 6476 | // A global counter (dialog token) is required to keep track of |
| 6477 | // all PE <-> HAL communication(s) |
| 6478 | // |
| 6479 | msgQ.reserved = 0; |
| 6480 | msgQ.bodyptr = pDelBAParams; |
| 6481 | msgQ.bodyval = 0; |
| 6482 | |
| 6483 | limLog( pMac, LOGW, |
| 6484 | FL( "Sending SIR_HAL_DELBA_IND..." )); |
| 6485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6486 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6487 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 6488 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_DELBA_IND_EVENT, psessionEntry, 0, 0); |
| 6489 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 6490 | |
| 6491 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 6492 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6493 | FL("Posting WDA_DELBA_IND to HAL failed! Reason = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6494 | retCode ); |
| 6495 | else |
| 6496 | { |
| 6497 | // Update LIM's internal cache... |
| 6498 | if( eBA_INITIATOR == baDirection) |
| 6499 | { |
| 6500 | pSta->tcCfg[baTID].fUseBATx = 0; |
| 6501 | pSta->tcCfg[baTID].txBufSize = 0; |
| 6502 | } |
| 6503 | else |
| 6504 | { |
| 6505 | pSta->tcCfg[baTID].fUseBARx = 0; |
| 6506 | pSta->tcCfg[baTID].rxBufSize = 0; |
| 6507 | } |
| 6508 | |
| 6509 | return retCode; |
| 6510 | } |
| 6511 | |
| 6512 | returnFailure: |
| 6513 | |
| 6514 | // Clean-up... |
| 6515 | if( NULL != pDelBAParams ) |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6516 | vos_mem_free( pDelBAParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6517 | |
| 6518 | return retCode; |
| 6519 | |
| 6520 | } |
| 6521 | |
| 6522 | /** |
| 6523 | * @function : limPostSMStateUpdate() |
| 6524 | * |
| 6525 | * @brief : This function Updates the HAL and Softmac about the change in the STA's SMPS state. |
| 6526 | * |
| 6527 | * LOGIC: |
| 6528 | * |
| 6529 | * ASSUMPTIONS: |
| 6530 | * NA |
| 6531 | * |
| 6532 | * NOTE: |
| 6533 | * NA |
| 6534 | * |
| 6535 | * @param pMac - Pointer to Global MAC structure |
| 6536 | * @param limMsg - Lim Message structure object with the MimoPSparam in body |
| 6537 | * @return None |
| 6538 | */ |
| 6539 | tSirRetStatus |
| 6540 | limPostSMStateUpdate(tpAniSirGlobal pMac, |
| 6541 | tANI_U16 staIdx, tSirMacHTMIMOPowerSaveState state) |
| 6542 | { |
| 6543 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 6544 | tSirMsgQ msgQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6545 | tpSetMIMOPS pMIMO_PSParams; |
| 6546 | |
| 6547 | msgQ.reserved = 0; |
| 6548 | msgQ.type = WDA_SET_MIMOPS_REQ; |
| 6549 | |
| 6550 | // Allocate for WDA_SET_MIMOPS_REQ |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6551 | pMIMO_PSParams = vos_mem_malloc(sizeof(tSetMIMOPS)); |
| 6552 | if ( NULL == pMIMO_PSParams ) |
| 6553 | { |
| 6554 | limLog( pMac, LOGP,FL(" AllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6555 | return eSIR_MEM_ALLOC_FAILED; |
| 6556 | } |
| 6557 | |
| 6558 | pMIMO_PSParams->htMIMOPSState = state; |
| 6559 | pMIMO_PSParams->staIdx = staIdx; |
| 6560 | pMIMO_PSParams->fsendRsp = true; |
| 6561 | msgQ.bodyptr = pMIMO_PSParams; |
| 6562 | msgQ.bodyval = 0; |
| 6563 | |
| 6564 | limLog( pMac, LOG2, FL( "Sending WDA_SET_MIMOPS_REQ..." )); |
| 6565 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6566 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 6568 | if (eSIR_SUCCESS != retCode) |
| 6569 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6570 | limLog( pMac, LOGP, FL("Posting WDA_SET_MIMOPS_REQ to HAL failed! Reason = %d"), retCode ); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6571 | vos_mem_free(pMIMO_PSParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6572 | return retCode; |
| 6573 | } |
| 6574 | |
| 6575 | return retCode; |
| 6576 | } |
| 6577 | |
| 6578 | void limPktFree ( |
| 6579 | tpAniSirGlobal pMac, |
| 6580 | eFrameType frmType, |
| 6581 | tANI_U8 *pRxPacketInfo, |
| 6582 | void *pBody) |
| 6583 | { |
| 6584 | (void) pMac; (void) frmType; (void) pRxPacketInfo; (void) pBody; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6585 | } |
| 6586 | |
| 6587 | /** |
| 6588 | * limGetBDfromRxPacket() |
| 6589 | * |
| 6590 | *FUNCTION: |
| 6591 | * This function is called to get pointer to Polaris |
| 6592 | * Buffer Descriptor containing MAC header & other control |
| 6593 | * info from the body of the message posted to LIM. |
| 6594 | * |
| 6595 | *LOGIC: |
| 6596 | * NA |
| 6597 | * |
| 6598 | *ASSUMPTIONS: |
| 6599 | * NA |
| 6600 | * |
| 6601 | *NOTE: |
| 6602 | * NA |
| 6603 | * |
| 6604 | * @param body - Received message body |
| 6605 | * @param pRxPacketInfo - Pointer to received BD |
| 6606 | * @return None |
| 6607 | */ |
| 6608 | |
| 6609 | void |
| 6610 | limGetBDfromRxPacket(tpAniSirGlobal pMac, void *body, tANI_U32 **pRxPacketInfo) |
| 6611 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6612 | *pRxPacketInfo = (tANI_U32 *) body; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6613 | } /*** end limGetBDfromRxPacket() ***/ |
| 6614 | |
| 6615 | |
| 6616 | |
| 6617 | |
| 6618 | |
| 6619 | void limRessetScanChannelInfo(tpAniSirGlobal pMac) |
| 6620 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6621 | vos_mem_set(&pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6622 | } |
| 6623 | |
| 6624 | |
| 6625 | void limAddScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 channelId) |
| 6626 | { |
| 6627 | tANI_U8 i; |
| 6628 | tANI_BOOLEAN fFound = eANI_BOOLEAN_FALSE; |
| 6629 | |
| 6630 | for(i = 0; i < pMac->lim.scanChnInfo.numChnInfo; i++) |
| 6631 | { |
| 6632 | if(pMac->lim.scanChnInfo.scanChn[i].channelId == channelId) |
| 6633 | { |
| 6634 | pMac->lim.scanChnInfo.scanChn[i].numTimeScan++; |
| 6635 | fFound = eANI_BOOLEAN_TRUE; |
| 6636 | break; |
| 6637 | } |
| 6638 | } |
| 6639 | if(eANI_BOOLEAN_FALSE == fFound) |
| 6640 | { |
| 6641 | if(pMac->lim.scanChnInfo.numChnInfo < SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 6642 | { |
| 6643 | pMac->lim.scanChnInfo.scanChn[pMac->lim.scanChnInfo.numChnInfo].channelId = channelId; |
| 6644 | pMac->lim.scanChnInfo.scanChn[pMac->lim.scanChnInfo.numChnInfo++].numTimeScan = 1; |
| 6645 | } |
| 6646 | else |
| 6647 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6648 | PELOGW(limLog(pMac, LOGW, FL(" -- number of channels exceed mac"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6649 | } |
| 6650 | } |
| 6651 | } |
| 6652 | |
| 6653 | |
| 6654 | /** |
| 6655 | * @function : limIsChannelValidForChannelSwitch() |
| 6656 | * |
| 6657 | * @brief : This function checks if the channel to which AP |
| 6658 | * is expecting us to switch, is a valid channel for us. |
| 6659 | * LOGIC: |
| 6660 | * |
| 6661 | * ASSUMPTIONS: |
| 6662 | * NA |
| 6663 | * |
| 6664 | * NOTE: |
| 6665 | * NA |
| 6666 | * |
| 6667 | * @param pMac - Pointer to Global MAC structure |
| 6668 | * @param channel - New channel to which we are expected to move |
| 6669 | * @return None |
| 6670 | */ |
| 6671 | tAniBool |
| 6672 | limIsChannelValidForChannelSwitch(tpAniSirGlobal pMac, tANI_U8 channel) |
| 6673 | { |
| 6674 | tANI_U8 index; |
| 6675 | tANI_U32 validChannelListLen = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 6676 | tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 6677 | |
| 6678 | if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, |
| 6679 | (tANI_U8 *)validChannelList, |
| 6680 | (tANI_U32 *)&validChannelListLen) != eSIR_SUCCESS) |
| 6681 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6682 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve valid channel list"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6683 | return (eSIR_FALSE); |
| 6684 | } |
| 6685 | |
| 6686 | for(index = 0; index < validChannelListLen; index++) |
| 6687 | { |
| 6688 | if(validChannelList[index] == channel) |
| 6689 | return (eSIR_TRUE); |
| 6690 | } |
| 6691 | |
| 6692 | /* channel does not belong to list of valid channels */ |
| 6693 | return (eSIR_FALSE); |
| 6694 | } |
| 6695 | |
| 6696 | /**------------------------------------------------------ |
| 6697 | \fn __limFillTxControlParams |
| 6698 | \brief Fill the message for stopping/resuming tx. |
| 6699 | |
| 6700 | \param pMac |
| 6701 | \param pTxCtrlMsg - Pointer to tx control message. |
| 6702 | \param type - Which way we want to stop/ resume tx. |
| 6703 | \param mode - To stop/resume. |
| 6704 | -------------------------------------------------------*/ |
| 6705 | static eHalStatus |
| 6706 | __limFillTxControlParams(tpAniSirGlobal pMac, tpTxControlParams pTxCtrlMsg, |
| 6707 | tLimQuietTxMode type, tLimControlTx mode) |
| 6708 | { |
| 6709 | |
| 6710 | //TBD-RAJESH HOW TO GET sessionEntry????? |
| 6711 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 6712 | |
| 6713 | if (mode == eLIM_STOP_TX) |
| 6714 | pTxCtrlMsg->stopTx = eANI_BOOLEAN_TRUE; |
| 6715 | else |
| 6716 | pTxCtrlMsg->stopTx = eANI_BOOLEAN_FALSE; |
| 6717 | |
| 6718 | switch (type) |
| 6719 | { |
| 6720 | case eLIM_TX_ALL: |
| 6721 | /** Stops/resumes transmission completely */ |
| 6722 | pTxCtrlMsg->fCtrlGlobal = 1; |
| 6723 | break; |
| 6724 | |
| 6725 | case eLIM_TX_BSS_BUT_BEACON: |
| 6726 | /** Stops/resumes transmission on a particular BSS. Stopping BSS, doesnt |
| 6727 | * stop beacon transmission. |
| 6728 | */ |
| 6729 | pTxCtrlMsg->ctrlBss = 1; |
| 6730 | pTxCtrlMsg->bssBitmap |= (1 << psessionEntry->bssIdx); |
| 6731 | break; |
| 6732 | |
| 6733 | case eLIM_TX_STA: |
| 6734 | /** Memory for station bitmap is allocated dynamically in caller of this |
| 6735 | * so decode properly here and fill the bitmap. Now not implemented, |
| 6736 | * fall through. |
| 6737 | */ |
| 6738 | case eLIM_TX_BSS: |
| 6739 | //Fall thru... |
| 6740 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6741 | PELOGW(limLog(pMac, LOGW, FL("Invalid case: Not Handled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6742 | return eHAL_STATUS_FAILURE; |
| 6743 | } |
| 6744 | |
| 6745 | return eHAL_STATUS_SUCCESS; |
| 6746 | } |
| 6747 | |
| 6748 | /** |
| 6749 | * @function : limFrameTransmissionControl() |
| 6750 | * |
| 6751 | * @brief : This API is called by the user to halt/resume any frame |
| 6752 | * transmission from the device. If stopped, all frames will be |
| 6753 | * queued starting from hardware. Then back-pressure |
| 6754 | * is built till the driver. |
| 6755 | * LOGIC: |
| 6756 | * |
| 6757 | * ASSUMPTIONS: |
| 6758 | * NA |
| 6759 | * |
| 6760 | * NOTE: |
| 6761 | * NA |
| 6762 | * |
| 6763 | * @param pMac - Pointer to Global MAC structure |
| 6764 | * @return None |
| 6765 | */ |
| 6766 | void limFrameTransmissionControl(tpAniSirGlobal pMac, tLimQuietTxMode type, tLimControlTx mode) |
| 6767 | { |
| 6768 | |
| 6769 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6770 | tpTxControlParams pTxCtrlMsg; |
| 6771 | tSirMsgQ msgQ; |
| 6772 | tANI_U8 nBytes = 0; // No of bytes required for station bitmap. |
| 6773 | |
| 6774 | /** Allocate only required number of bytes for station bitmap |
| 6775 | * Make it to align to 4 byte boundary */ |
| 6776 | nBytes = (tANI_U8)HALMSG_NUMBYTES_STATION_BITMAP(pMac->lim.maxStation); |
| 6777 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6778 | pTxCtrlMsg = vos_mem_malloc(sizeof(*pTxCtrlMsg) + nBytes); |
| 6779 | if ( NULL == pTxCtrlMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6780 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6781 | limLog(pMac, LOGP, FL("AllocateMemory() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6782 | return; |
| 6783 | } |
| 6784 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6785 | vos_mem_set((void *) pTxCtrlMsg, |
| 6786 | (sizeof(*pTxCtrlMsg) + nBytes), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6787 | status = __limFillTxControlParams(pMac, pTxCtrlMsg, type, mode); |
| 6788 | if (status != eHAL_STATUS_SUCCESS) |
| 6789 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6790 | vos_mem_free(pTxCtrlMsg); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6791 | limLog(pMac, LOGP, FL("__limFillTxControlParams failed, status = %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6792 | return; |
| 6793 | } |
| 6794 | |
| 6795 | msgQ.bodyptr = (void *) pTxCtrlMsg; |
| 6796 | msgQ.bodyval = 0; |
| 6797 | msgQ.reserved = 0; |
| 6798 | msgQ.type = WDA_TRANSMISSION_CONTROL_IND; |
| 6799 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6800 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6801 | if(wdaPostCtrlMsg( pMac, &msgQ) != eSIR_SUCCESS) |
| 6802 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 6803 | vos_mem_free(pTxCtrlMsg); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6804 | limLog( pMac, LOGP, FL("Posting Message to HAL failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6805 | return; |
| 6806 | } |
| 6807 | |
| 6808 | if (mode == eLIM_STOP_TX) |
| 6809 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 6810 | limLog(pMac, LOG1, FL("Stopping the transmission of all packets, indicated softmac")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6811 | } |
| 6812 | else |
| 6813 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 6814 | limLog(pMac, LOG1, FL("Resuming the transmission of all packets, indicated softmac")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6815 | } |
| 6816 | return; |
| 6817 | } |
| 6818 | |
| 6819 | |
| 6820 | /** |
| 6821 | * @function : limRestorePreChannelSwitchState() |
| 6822 | * |
| 6823 | * @brief : This API is called by the user to undo any |
| 6824 | * specific changes done on the device during |
| 6825 | * channel switch. |
| 6826 | * LOGIC: |
| 6827 | * |
| 6828 | * ASSUMPTIONS: |
| 6829 | * NA |
| 6830 | * |
| 6831 | * NOTE: |
| 6832 | * NA |
| 6833 | * |
| 6834 | * @param pMac - Pointer to Global MAC structure |
| 6835 | * @return None |
| 6836 | */ |
| 6837 | |
| 6838 | tSirRetStatus |
| 6839 | limRestorePreChannelSwitchState(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 6840 | { |
| 6841 | |
| 6842 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6843 | tANI_U32 val = 0; |
| 6844 | |
| 6845 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 6846 | return retCode; |
| 6847 | |
| 6848 | /* Channel switch should be ready for the next time */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6849 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6850 | |
| 6851 | /* Restore the frame transmission, all the time. */ |
| 6852 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 6853 | |
| 6854 | /* Free to enter BMPS */ |
| 6855 | limSendSmePostChannelSwitchInd(pMac); |
| 6856 | |
| 6857 | //Background scan is now enabled by SME |
| 6858 | if(pMac->lim.gLimBackgroundScanTerminate == FALSE) |
| 6859 | { |
| 6860 | /* Enable background scan if already enabled, else don't bother */ |
| 6861 | if ((retCode = wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 6862 | &val)) != eSIR_SUCCESS) |
| 6863 | |
| 6864 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6865 | limLog(pMac, LOGP, FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6866 | return (retCode); |
| 6867 | } |
| 6868 | |
| 6869 | if (val > 0 && TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer)) |
| 6870 | { |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 6871 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, |
| 6872 | psessionEntry->peSessionId, eLIM_BACKGROUND_SCAN_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6873 | if(tx_timer_activate(&pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 6874 | { |
| 6875 | limLog(pMac, LOGP, FL("Could not restart background scan timer, doing LOGP")); |
| 6876 | return (eSIR_FAILURE); |
| 6877 | } |
| 6878 | |
| 6879 | } |
| 6880 | } |
| 6881 | |
| 6882 | /* Enable heartbeat timer */ |
| 6883 | if (TX_TIMER_VALID(pMac->lim.limTimers.gLimHeartBeatTimer)) |
| 6884 | { |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 6885 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, |
| 6886 | psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
| 6887 | if((limActivateHearBeatTimer(pMac, psessionEntry) != TX_SUCCESS) && |
| 6888 | (!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6889 | { |
| 6890 | limLog(pMac, LOGP, FL("Could not restart heartbeat timer, doing LOGP")); |
| 6891 | return (eSIR_FAILURE); |
| 6892 | } |
| 6893 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6894 | return (retCode); |
| 6895 | } |
| 6896 | |
| 6897 | |
| 6898 | /**-------------------------------------------- |
| 6899 | \fn limRestorePreQuietState |
| 6900 | \brief Restore the pre quiet state |
| 6901 | |
| 6902 | \param pMac |
| 6903 | \return NONE |
| 6904 | ---------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6905 | tSirRetStatus limRestorePreQuietState(tpAniSirGlobal pMac, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6906 | { |
| 6907 | |
| 6908 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6909 | tANI_U32 val = 0; |
| 6910 | |
| 6911 | if (pMac->lim.gLimSystemRole != eLIM_STA_ROLE) |
| 6912 | return retCode; |
| 6913 | |
| 6914 | /* Quiet should be ready for the next time */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6915 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6916 | |
| 6917 | /* Restore the frame transmission, all the time. */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6918 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6919 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 6920 | |
| 6921 | |
| 6922 | //Background scan is now enabled by SME |
| 6923 | if(pMac->lim.gLimBackgroundScanTerminate == FALSE) |
| 6924 | { |
| 6925 | /* Enable background scan if already enabled, else don't bother */ |
| 6926 | if ((retCode = wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 6927 | &val)) != eSIR_SUCCESS) |
| 6928 | |
| 6929 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6930 | limLog(pMac, LOGP, FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6931 | return (retCode); |
| 6932 | } |
| 6933 | |
| 6934 | if (val > 0 && TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer)) |
| 6935 | { |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 6936 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_BACKGROUND_SCAN_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6937 | if(tx_timer_activate(&pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 6938 | { |
| 6939 | limLog(pMac, LOGP, FL("Could not restart background scan timer, doing LOGP")); |
| 6940 | return (eSIR_FAILURE); |
| 6941 | } |
| 6942 | |
| 6943 | } |
| 6944 | } |
| 6945 | |
| 6946 | /* Enable heartbeat timer */ |
| 6947 | if (TX_TIMER_VALID(pMac->lim.limTimers.gLimHeartBeatTimer)) |
| 6948 | { |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 6949 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 6950 | if(limActivateHearBeatTimer(pMac, psessionEntry) != TX_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6951 | { |
| 6952 | limLog(pMac, LOGP, FL("Could not restart heartbeat timer, doing LOGP")); |
| 6953 | return (eSIR_FAILURE); |
| 6954 | } |
| 6955 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6956 | return (retCode); |
| 6957 | } |
| 6958 | |
| 6959 | |
| 6960 | /** |
| 6961 | * @function: limPrepareFor11hChannelSwitch() |
| 6962 | * |
| 6963 | * @brief : This API is called by the user to prepare for |
| 6964 | * 11h channel switch. As of now, the API does |
| 6965 | * very minimal work. User can add more into the |
| 6966 | * same API if needed. |
| 6967 | * LOGIC: |
| 6968 | * |
| 6969 | * ASSUMPTIONS: |
| 6970 | * NA |
| 6971 | * |
| 6972 | * NOTE: |
| 6973 | * NA |
| 6974 | * |
| 6975 | * @param pMac - Pointer to Global MAC structure |
| 6976 | * @param psessionEntry |
| 6977 | * @return None |
| 6978 | */ |
| 6979 | void |
| 6980 | limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 6981 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6982 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 6983 | return; |
| 6984 | |
| 6985 | /* Flag to indicate 11h channel switch in progress */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6986 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6987 | |
| 6988 | /* Disable, Stop background scan if enabled and running */ |
| 6989 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 6990 | |
| 6991 | /* Stop heart-beat timer to stop heartbeat disassociation */ |
| 6992 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
| 6993 | |
| 6994 | if(pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE || |
| 6995 | pMac->lim.gLimSmeState == eLIM_SME_CHANNEL_SCAN_STATE) |
| 6996 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6997 | PELOGE(limLog(pMac, LOGE, FL("Posting finish scan as we are in scan state"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6998 | /* Stop ongoing scanning if any */ |
| 6999 | if (GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 7000 | { |
| 7001 | //Set the resume channel to Any valid channel (invalid). |
| 7002 | //This will instruct HAL to set it to any previous valid channel. |
| 7003 | peSetResumeChannel(pMac, 0, 0); |
| 7004 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 7005 | } |
| 7006 | else |
| 7007 | { |
| 7008 | limRestorePreChannelSwitchState(pMac, psessionEntry); |
| 7009 | } |
| 7010 | return; |
| 7011 | } |
| 7012 | else |
| 7013 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7014 | PELOGE(limLog(pMac, LOGE, FL("Not in scan state, start channel switch timer"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7015 | /** We are safe to switch channel at this point */ |
| 7016 | limStopTxAndSwitchChannel(pMac, psessionEntry->peSessionId); |
| 7017 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7018 | } |
| 7019 | |
| 7020 | |
| 7021 | |
| 7022 | /**---------------------------------------------------- |
| 7023 | \fn limGetNwType |
| 7024 | |
| 7025 | \brief Get type of the network from data packet or beacon |
| 7026 | \param pMac |
| 7027 | \param channelNum - Channel number |
| 7028 | \param type - Type of packet. |
| 7029 | \param pBeacon - Pointer to beacon or probe response |
| 7030 | |
| 7031 | \return Network type a/b/g. |
| 7032 | -----------------------------------------------------*/ |
| 7033 | tSirNwType limGetNwType(tpAniSirGlobal pMac, tANI_U8 channelNum, tANI_U32 type, tpSchBeaconStruct pBeacon) |
| 7034 | { |
| 7035 | tSirNwType nwType = eSIR_11B_NW_TYPE; |
| 7036 | |
| 7037 | if (type == SIR_MAC_DATA_FRAME) |
| 7038 | { |
| 7039 | if ((channelNum > 0) && (channelNum < 15)) |
| 7040 | { |
| 7041 | nwType = eSIR_11G_NW_TYPE; |
| 7042 | } |
| 7043 | else |
| 7044 | { |
| 7045 | nwType = eSIR_11A_NW_TYPE; |
| 7046 | } |
| 7047 | } |
| 7048 | else |
| 7049 | { |
| 7050 | if ((channelNum > 0) && (channelNum < 15)) |
| 7051 | { |
| 7052 | int i; |
| 7053 | // 11b or 11g packet |
| 7054 | // 11g iff extended Rate IE is present or |
| 7055 | // if there is an A rate in suppRate IE |
| 7056 | for (i = 0; i < pBeacon->supportedRates.numRates; i++) |
| 7057 | { |
| 7058 | if (sirIsArate(pBeacon->supportedRates.rate[i] & 0x7f)) |
| 7059 | { |
| 7060 | nwType = eSIR_11G_NW_TYPE; |
| 7061 | break; |
| 7062 | } |
| 7063 | } |
| 7064 | if (pBeacon->extendedRatesPresent) |
| 7065 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7066 | PELOG3(limLog(pMac, LOG3, FL("Beacon, nwtype=G"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7067 | nwType = eSIR_11G_NW_TYPE; |
| 7068 | } |
| 7069 | } |
| 7070 | else |
| 7071 | { |
| 7072 | // 11a packet |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7073 | PELOG3(limLog(pMac, LOG3,FL("Beacon, nwtype=A"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7074 | nwType = eSIR_11A_NW_TYPE; |
| 7075 | } |
| 7076 | } |
| 7077 | return nwType; |
| 7078 | } |
| 7079 | |
| 7080 | |
| 7081 | /**--------------------------------------------------------- |
| 7082 | \fn limGetChannelFromBeacon |
| 7083 | \brief To extract channel number from beacon |
| 7084 | |
| 7085 | \param pMac |
| 7086 | \param pBeacon - Pointer to beacon or probe rsp |
| 7087 | \return channel number |
| 7088 | -----------------------------------------------------------*/ |
| 7089 | tANI_U8 limGetChannelFromBeacon(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon) |
| 7090 | { |
| 7091 | tANI_U8 channelNum = 0; |
| 7092 | |
| 7093 | if (pBeacon->dsParamsPresent) |
| 7094 | channelNum = pBeacon->channelNumber; |
| 7095 | else if(pBeacon->HTInfo.present) |
| 7096 | channelNum = pBeacon->HTInfo.primaryChannel; |
| 7097 | else |
| 7098 | channelNum = pBeacon->channelNumber; |
| 7099 | |
| 7100 | return channelNum; |
| 7101 | } |
| 7102 | |
| 7103 | |
| 7104 | /** --------------------------------------------------------- |
| 7105 | \fn limSetTspecUapsdMask |
| 7106 | \brief This function sets the PE global variable: |
| 7107 | \ 1) gUapsdPerAcTriggerEnableMask and |
| 7108 | \ 2) gUapsdPerAcDeliveryEnableMask |
| 7109 | \ based on the user priority field and direction field |
| 7110 | \ in the TS Info Fields. |
| 7111 | \ |
| 7112 | \ An AC is a trigger-enabled AC if the PSB subfield |
| 7113 | \ is set to 1 in the uplink direction. |
| 7114 | \ An AC is a delivery-enabled AC if the PSB subfield |
| 7115 | \ is set to 1 in the down-link direction. |
| 7116 | \ |
| 7117 | \param tpAniSirGlobal pMac |
| 7118 | \param tSirMacTSInfo pTsInfo |
| 7119 | \param tANI_U32 action |
| 7120 | \return None |
| 7121 | ------------------------------------------------------------*/ |
| 7122 | void limSetTspecUapsdMask(tpAniSirGlobal pMac, tSirMacTSInfo *pTsInfo, tANI_U32 action) |
| 7123 | { |
| 7124 | tANI_U8 userPrio = (tANI_U8)pTsInfo->traffic.userPrio; |
| 7125 | tANI_U16 direction = pTsInfo->traffic.direction; |
| 7126 | tANI_U8 ac = upToAc(userPrio); |
| 7127 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 7128 | limLog(pMac, LOG1, FL(" Set UAPSD mask for AC %d, direction %d, action=%d (1=set,0=clear) "),ac, direction, action ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7129 | |
| 7130 | /* Converting AC to appropriate Uapsd Bit Mask |
| 7131 | * AC_BE(0) --> UAPSD_BITOFFSET_ACVO(3) |
| 7132 | * AC_BK(1) --> UAPSD_BITOFFSET_ACVO(2) |
| 7133 | * AC_VI(2) --> UAPSD_BITOFFSET_ACVO(1) |
| 7134 | * AC_VO(3) --> UAPSD_BITOFFSET_ACVO(0) |
| 7135 | */ |
| 7136 | ac = ((~ac) & 0x3); |
| 7137 | |
| 7138 | if (action == CLEAR_UAPSD_MASK) |
| 7139 | { |
| 7140 | if (direction == SIR_MAC_DIRECTION_UPLINK) |
| 7141 | pMac->lim.gUapsdPerAcTriggerEnableMask &= ~(1 << ac); |
| 7142 | else if (direction == SIR_MAC_DIRECTION_DNLINK) |
| 7143 | pMac->lim.gUapsdPerAcDeliveryEnableMask &= ~(1 << ac); |
| 7144 | else if (direction == SIR_MAC_DIRECTION_BIDIR) |
| 7145 | { |
| 7146 | pMac->lim.gUapsdPerAcTriggerEnableMask &= ~(1 << ac); |
| 7147 | pMac->lim.gUapsdPerAcDeliveryEnableMask &= ~(1 << ac); |
| 7148 | } |
| 7149 | } |
| 7150 | else if (action == SET_UAPSD_MASK) |
| 7151 | { |
| 7152 | if (direction == SIR_MAC_DIRECTION_UPLINK) |
| 7153 | pMac->lim.gUapsdPerAcTriggerEnableMask |= (1 << ac); |
| 7154 | else if (direction == SIR_MAC_DIRECTION_DNLINK) |
| 7155 | pMac->lim.gUapsdPerAcDeliveryEnableMask |= (1 << ac); |
| 7156 | else if (direction == SIR_MAC_DIRECTION_BIDIR) |
| 7157 | { |
| 7158 | pMac->lim.gUapsdPerAcTriggerEnableMask |= (1 << ac); |
| 7159 | pMac->lim.gUapsdPerAcDeliveryEnableMask |= (1 << ac); |
| 7160 | } |
| 7161 | } |
| 7162 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7163 | limLog(pMac, LOGE, FL("New pMac->lim.gUapsdPerAcTriggerEnableMask = 0x%x "), pMac->lim.gUapsdPerAcTriggerEnableMask ); |
| 7164 | limLog(pMac, LOGE, FL("New pMac->lim.gUapsdPerAcDeliveryEnableMask = 0x%x "), pMac->lim.gUapsdPerAcDeliveryEnableMask ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7165 | |
| 7166 | return; |
| 7167 | } |
| 7168 | |
| 7169 | |
| 7170 | |
| 7171 | void limHandleHeartBeatTimeout(tpAniSirGlobal pMac ) |
| 7172 | { |
| 7173 | |
| 7174 | tANI_U8 i; |
| 7175 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7176 | { |
| 7177 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7178 | { |
| 7179 | if(pMac->lim.gpSession[i].bssType == eSIR_IBSS_MODE) |
| 7180 | { |
| 7181 | limIbssHeartBeatHandle(pMac,&pMac->lim.gpSession[i]); |
| 7182 | break; |
| 7183 | } |
| 7184 | |
| 7185 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7186 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 7187 | { |
| 7188 | limHandleHeartBeatFailure(pMac,&pMac->lim.gpSession[i]); |
| 7189 | } |
| 7190 | } |
| 7191 | } |
| 7192 | for(i=0; i< pMac->lim.maxBssId; i++) |
| 7193 | { |
| 7194 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7195 | { |
| 7196 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7197 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 7198 | { |
| 7199 | if(pMac->lim.gpSession[i].LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 7200 | { |
| 7201 | /* Activate Probe After HeartBeat Timer incase HB Failure detected */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7202 | PELOGW(limLog(pMac, LOGW,FL("Sending Probe for Session: %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7203 | i);) |
| 7204 | limDeactivateAndChangeTimer(pMac, eLIM_PROBE_AFTER_HB_TIMER); |
| 7205 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_PROBE_AFTER_HB_TIMER)); |
| 7206 | if (tx_timer_activate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != TX_SUCCESS) |
| 7207 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7208 | limLog(pMac, LOGP, FL("Fail to re-activate Probe-after-heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7209 | limReactivateHeartBeatTimer(pMac, &pMac->lim.gpSession[i]); |
| 7210 | } |
| 7211 | break; |
| 7212 | } |
| 7213 | } |
| 7214 | } |
| 7215 | } |
| 7216 | } |
| 7217 | |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 7218 | void limHandleHeartBeatTimeoutForSession(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 7219 | { |
| 7220 | if(psessionEntry->valid == TRUE ) |
| 7221 | { |
| 7222 | if(psessionEntry->bssType == eSIR_IBSS_MODE) |
| 7223 | { |
| 7224 | limIbssHeartBeatHandle(pMac,psessionEntry); |
| 7225 | } |
| 7226 | if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7227 | (psessionEntry->limSystemRole == eLIM_STA_ROLE)) |
| 7228 | { |
| 7229 | limHandleHeartBeatFailure(pMac,psessionEntry); |
| 7230 | } |
| 7231 | } |
| 7232 | /* In the function limHandleHeartBeatFailure things can change so check for the session entry valid |
| 7233 | and the other things again */ |
| 7234 | if(psessionEntry->valid == TRUE ) |
| 7235 | { |
| 7236 | if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7237 | (psessionEntry->limSystemRole == eLIM_STA_ROLE)) |
| 7238 | { |
| 7239 | if(psessionEntry->LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 7240 | { |
| 7241 | /* Activate Probe After HeartBeat Timer incase HB Failure detected */ |
| 7242 | PELOGW(limLog(pMac, LOGW,FL("Sending Probe for Session: %d"), |
| 7243 | psessionEntry->bssIdx);) |
| 7244 | limDeactivateAndChangeTimer(pMac, eLIM_PROBE_AFTER_HB_TIMER); |
| 7245 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_PROBE_AFTER_HB_TIMER)); |
| 7246 | if (tx_timer_activate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != TX_SUCCESS) |
| 7247 | { |
| 7248 | limLog(pMac, LOGP, FL("Fail to re-activate Probe-after-heartbeat timer")); |
| 7249 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7250 | } |
| 7251 | } |
| 7252 | } |
| 7253 | } |
| 7254 | } |
| 7255 | |
| 7256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7257 | tANI_U8 limGetCurrentOperatingChannel(tpAniSirGlobal pMac) |
| 7258 | { |
| 7259 | tANI_U8 i; |
| 7260 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7261 | { |
| 7262 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7263 | { |
| 7264 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7265 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 7266 | { |
| 7267 | return pMac->lim.gpSession[i].currentOperChannel; |
| 7268 | } |
| 7269 | } |
| 7270 | } |
| 7271 | return 0; |
| 7272 | } |
| 7273 | |
| 7274 | void limProcessAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7275 | { |
| 7276 | |
| 7277 | tpPESession psessionEntry; |
| 7278 | // tANI_U8 sessionId; |
| 7279 | tpAddStaParams pAddStaParams; |
| 7280 | |
| 7281 | pAddStaParams = (tpAddStaParams)limMsgQ->bodyptr; |
| 7282 | |
| 7283 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddStaParams->sessionId))==NULL) |
| 7284 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7285 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7286 | vos_mem_free(pAddStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7287 | return; |
| 7288 | } |
| 7289 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 7290 | (void) limIbssAddStaRsp(pMac, limMsgQ->bodyptr,psessionEntry); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 7291 | #ifdef FEATURE_WLAN_TDLS |
| 7292 | else if(pMac->lim.gLimAddStaTdls) |
| 7293 | { |
| 7294 | limProcessTdlsAddStaRsp(pMac, limMsgQ->bodyptr, psessionEntry) ; |
| 7295 | pMac->lim.gLimAddStaTdls = FALSE ; |
| 7296 | } |
| 7297 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7298 | else |
| 7299 | limProcessMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
| 7300 | |
| 7301 | } |
| 7302 | |
| 7303 | |
| 7304 | void limUpdateBeacon(tpAniSirGlobal pMac) |
| 7305 | { |
| 7306 | tANI_U8 i; |
| 7307 | |
| 7308 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7309 | { |
| 7310 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7311 | { |
| 7312 | if( ( (pMac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) || |
| 7313 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_IN_IBSS_ROLE) ) |
| 7314 | && (eLIM_SME_NORMAL_STATE == pMac->lim.gpSession[i].limSmeState) |
| 7315 | ) |
| 7316 | { |
| 7317 | schSetFixedBeaconFields(pMac,&pMac->lim.gpSession[i]); |
| 7318 | limSendBeaconInd(pMac, &pMac->lim.gpSession[i]); |
| 7319 | } |
| 7320 | else |
| 7321 | { |
| 7322 | if( (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_AP_ROLE)|| |
| 7323 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 7324 | { |
| 7325 | |
| 7326 | if(pMac->lim.gpSession[i].statypeForBss == STA_ENTRY_SELF) |
| 7327 | { |
| 7328 | schSetFixedBeaconFields(pMac,&pMac->lim.gpSession[i]); |
| 7329 | } |
| 7330 | } |
| 7331 | } |
| 7332 | } |
| 7333 | } |
| 7334 | } |
| 7335 | |
| 7336 | void limHandleHeartBeatFailureTimeout(tpAniSirGlobal pMac) |
| 7337 | { |
| 7338 | tANI_U8 i; |
| 7339 | tpPESession psessionEntry; |
| 7340 | /* Probe response is not received after HB failure. This is handled by LMM sub module. */ |
| 7341 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 7342 | { |
| 7343 | if(pMac->lim.gpSession[i].valid == TRUE) |
| 7344 | { |
| 7345 | psessionEntry = &pMac->lim.gpSession[i]; |
| 7346 | if(psessionEntry->LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 7347 | { |
Abhishek Singh | 514e070 | 2014-12-05 13:49:37 +0530 | [diff] [blame] | 7348 | limLog(pMac, LOGE, |
| 7349 | FL("Probe_hb_failure: SME %d, MLME %d, HB-Count %d BCN count %d"), |
| 7350 | psessionEntry->limSmeState, psessionEntry->limMlmState, |
| 7351 | psessionEntry->LimRxedBeaconCntDuringHB, |
| 7352 | psessionEntry->currentBssBeaconCnt); |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 7353 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 7354 | limDiagEventReport(pMac, WLAN_PE_DIAG_HB_FAILURE_TIMEOUT, psessionEntry, 0, 0); |
| 7355 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7356 | if (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 7357 | { |
Abhishek Singh | 514e070 | 2014-12-05 13:49:37 +0530 | [diff] [blame] | 7358 | /* Disconnect even if we have not received a single beacon |
| 7359 | * after connection. |
| 7360 | */ |
| 7361 | if (((!LIM_IS_CONNECTION_ACTIVE(psessionEntry)) || |
| 7362 | (0 == psessionEntry->currentBssBeaconCnt)) && |
Kaushik, Sushant | 65b1971 | 2014-05-13 11:52:24 +0530 | [diff] [blame] | 7363 | (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE)&& |
| 7364 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7365 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7366 | limLog(pMac, LOGE, FL("Probe_hb_failure: for session:%d " ),psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7367 | /* AP did not respond to Probe Request. Tear down link with it.*/ |
| 7368 | limTearDownLinkWithAp(pMac, |
| 7369 | psessionEntry->peSessionId, |
| 7370 | eSIR_BEACON_MISSED); |
| 7371 | pMac->lim.gLimProbeFailureAfterHBfailedCnt++ ; |
| 7372 | } |
| 7373 | else // restart heartbeat timer |
| 7374 | { |
| 7375 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7376 | } |
| 7377 | } |
| 7378 | else |
| 7379 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7380 | limLog(pMac, LOGE, FL("Unexpected wt-probe-timeout in state ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7381 | limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); |
| 7382 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7383 | } |
| 7384 | |
| 7385 | } |
| 7386 | } |
| 7387 | } |
| 7388 | /* Deactivate Timer ProbeAfterHB Timer -> As its a oneshot timer, need not deactivate the timer */ |
| 7389 | // tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 7390 | } |
| 7391 | |
| 7392 | |
| 7393 | /* |
| 7394 | * This function assumes there will not be more than one IBSS session active at any time. |
| 7395 | */ |
| 7396 | tpPESession limIsIBSSSessionActive(tpAniSirGlobal pMac) |
| 7397 | { |
| 7398 | tANI_U8 i; |
| 7399 | |
| 7400 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7401 | { |
| 7402 | if( (pMac->lim.gpSession[i].valid) && |
| 7403 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_IN_IBSS_ROLE)) |
| 7404 | return (&pMac->lim.gpSession[i]); |
| 7405 | } |
| 7406 | |
| 7407 | return NULL; |
| 7408 | } |
| 7409 | |
| 7410 | tpPESession limIsApSessionActive(tpAniSirGlobal pMac) |
| 7411 | { |
| 7412 | tANI_U8 i; |
| 7413 | |
| 7414 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7415 | { |
| 7416 | if( (pMac->lim.gpSession[i].valid) && |
| 7417 | ( (pMac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) || |
| 7418 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_AP_ROLE))) |
| 7419 | return (&pMac->lim.gpSession[i]); |
| 7420 | } |
| 7421 | |
| 7422 | return NULL; |
| 7423 | } |
| 7424 | |
| 7425 | /**--------------------------------------------------------- |
| 7426 | \fn limHandleDeferMsgError |
| 7427 | \brief handles error scenario, when the msg can not be deferred. |
| 7428 | \param pMac |
| 7429 | \param pLimMsg LIM msg, which could not be deferred. |
| 7430 | \return void |
| 7431 | -----------------------------------------------------------*/ |
| 7432 | |
| 7433 | void limHandleDeferMsgError(tpAniSirGlobal pMac, tpSirMsgQ pLimMsg) |
| 7434 | { |
| 7435 | if(SIR_BB_XPORT_MGMT_MSG == pLimMsg->type) |
| 7436 | { |
Abhishek Singh | 035e34f | 2015-04-08 18:04:54 +0530 | [diff] [blame] | 7437 | /*Decrement the Pending count before droping */ |
| 7438 | limDecrementPendingMgmtCount (pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7439 | vos_pkt_return_packet((vos_pkt_t*)pLimMsg->bodyptr); |
| 7440 | } |
| 7441 | else if(pLimMsg->bodyptr != NULL) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 7442 | { |
| 7443 | vos_mem_free( pLimMsg->bodyptr); |
| 7444 | pLimMsg->bodyptr = NULL; |
| 7445 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7446 | } |
| 7447 | |
| 7448 | |
| 7449 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 7450 | /**--------------------------------------------------------- |
| 7451 | \fn limDiagEventReport |
| 7452 | \brief This function reports Diag event |
| 7453 | \param pMac |
| 7454 | \param eventType |
| 7455 | \param bssid |
| 7456 | \param status |
| 7457 | \param reasonCode |
| 7458 | \return void |
| 7459 | -----------------------------------------------------------*/ |
| 7460 | void limDiagEventReport(tpAniSirGlobal pMac, tANI_U16 eventType, tpPESession pSessionEntry, tANI_U16 status, tANI_U16 reasonCode) |
| 7461 | { |
| 7462 | tSirMacAddr nullBssid = { 0, 0, 0, 0, 0, 0 }; |
| 7463 | WLAN_VOS_DIAG_EVENT_DEF(peEvent, vos_event_wlan_pe_payload_type); |
| 7464 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7465 | vos_mem_set(&peEvent, sizeof(vos_event_wlan_pe_payload_type), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7466 | |
| 7467 | if (NULL == pSessionEntry) |
| 7468 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7469 | vos_mem_copy( peEvent.bssid, nullBssid, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7470 | peEvent.sme_state = (tANI_U16)pMac->lim.gLimSmeState; |
| 7471 | peEvent.mlm_state = (tANI_U16)pMac->lim.gLimMlmState; |
| 7472 | |
| 7473 | } |
| 7474 | else |
| 7475 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7476 | vos_mem_copy(peEvent.bssid, pSessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7477 | peEvent.sme_state = (tANI_U16)pSessionEntry->limSmeState; |
| 7478 | peEvent.mlm_state = (tANI_U16)pSessionEntry->limMlmState; |
| 7479 | } |
| 7480 | peEvent.event_type = eventType; |
| 7481 | peEvent.status = status; |
| 7482 | peEvent.reason_code = reasonCode; |
| 7483 | |
| 7484 | WLAN_VOS_DIAG_EVENT_REPORT(&peEvent, EVENT_WLAN_PE); |
| 7485 | return; |
| 7486 | } |
| 7487 | |
| 7488 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 7489 | |
| 7490 | void limProcessAddStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7491 | { |
| 7492 | |
| 7493 | tpAddStaSelfParams pAddStaSelfParams; |
| 7494 | tSirMsgQ mmhMsg; |
| 7495 | tpSirSmeAddStaSelfRsp pRsp; |
| 7496 | |
| 7497 | |
| 7498 | pAddStaSelfParams = (tpAddStaSelfParams)limMsgQ->bodyptr; |
| 7499 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7500 | pRsp = vos_mem_malloc(sizeof(tSirSmeAddStaSelfRsp)); |
| 7501 | if ( NULL == pRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7502 | { |
| 7503 | /// Buffer not available. Log error |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7504 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for Add Sta self RSP")); |
| 7505 | vos_mem_free(pAddStaSelfParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 7506 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7507 | return; |
| 7508 | } |
| 7509 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7510 | vos_mem_set((tANI_U8*)pRsp, sizeof(tSirSmeAddStaSelfRsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7511 | |
| 7512 | pRsp->mesgType = eWNI_SME_ADD_STA_SELF_RSP; |
| 7513 | pRsp->mesgLen = (tANI_U16) sizeof(tSirSmeAddStaSelfRsp); |
| 7514 | pRsp->status = pAddStaSelfParams->status; |
| 7515 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7516 | vos_mem_copy( pRsp->selfMacAddr, pAddStaSelfParams->selfMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7517 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7518 | vos_mem_free(pAddStaSelfParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 7519 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7520 | |
| 7521 | mmhMsg.type = eWNI_SME_ADD_STA_SELF_RSP; |
| 7522 | mmhMsg.bodyptr = pRsp; |
| 7523 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 7524 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7525 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 7526 | |
| 7527 | } |
| 7528 | |
| 7529 | void limProcessDelStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7530 | { |
| 7531 | |
| 7532 | tpDelStaSelfParams pDelStaSelfParams; |
| 7533 | tSirMsgQ mmhMsg; |
| 7534 | tpSirSmeDelStaSelfRsp pRsp; |
| 7535 | |
| 7536 | |
| 7537 | pDelStaSelfParams = (tpDelStaSelfParams)limMsgQ->bodyptr; |
| 7538 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7539 | pRsp = vos_mem_malloc(sizeof(tSirSmeDelStaSelfRsp)); |
| 7540 | if ( NULL == pRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7541 | { |
| 7542 | /// Buffer not available. Log error |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7543 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for Add Sta self RSP")); |
| 7544 | vos_mem_free(pDelStaSelfParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 7545 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7546 | return; |
| 7547 | } |
| 7548 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7549 | vos_mem_set((tANI_U8*)pRsp, sizeof(tSirSmeDelStaSelfRsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7550 | |
| 7551 | pRsp->mesgType = eWNI_SME_DEL_STA_SELF_RSP; |
| 7552 | pRsp->mesgLen = (tANI_U16) sizeof(tSirSmeDelStaSelfRsp); |
| 7553 | pRsp->status = pDelStaSelfParams->status; |
| 7554 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7555 | vos_mem_copy( pRsp->selfMacAddr, pDelStaSelfParams->selfMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7556 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7557 | vos_mem_free(pDelStaSelfParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 7558 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7559 | |
| 7560 | mmhMsg.type = eWNI_SME_DEL_STA_SELF_RSP; |
| 7561 | mmhMsg.bodyptr = pRsp; |
| 7562 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 7563 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7564 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 7565 | |
| 7566 | } |
| 7567 | |
| 7568 | /*************************************************************** |
| 7569 | * tANI_U8 limUnmapChannel(tANI_U8 mapChannel) |
| 7570 | * To unmap the channel to reverse the effect of mapping |
| 7571 | * a band channel in hal .Mapping was done hal to overcome the |
| 7572 | * limitation of the rxbd which use only 4 bit for channel number. |
| 7573 | *****************************************************************/ |
| 7574 | tANI_U8 limUnmapChannel(tANI_U8 mapChannel) |
| 7575 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 7576 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Manjunathappa Prakash | b8ac023 | 2014-03-06 17:58:20 -0800 | [diff] [blame] | 7577 | if( mapChannel > 0 && mapChannel <= aUnsortedChannelListSize ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 7578 | if (IS_ROAM_SCAN_OFFLOAD_FEATURE_ENABLE) |
| 7579 | return aUnsortedChannelList[mapChannel -1]; |
| 7580 | else |
Manjunathappa Prakash | eb5a3a3 | 2014-02-13 19:57:55 -0800 | [diff] [blame] | 7581 | #else |
Manjunathappa Prakash | b8ac023 | 2014-03-06 17:58:20 -0800 | [diff] [blame] | 7582 | if( mapChannel > 0 && mapChannel <= abChannelSize ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 7583 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7584 | return abChannel[mapChannel -1]; |
| 7585 | else |
| 7586 | return 0; |
| 7587 | } |
| 7588 | |
| 7589 | |
| 7590 | v_U8_t* limGetIEPtr(tpAniSirGlobal pMac, v_U8_t *pIes, int length, v_U8_t eid,eSizeOfLenField size_of_len_field) |
| 7591 | { |
| 7592 | int left = length; |
| 7593 | v_U8_t *ptr = pIes; |
| 7594 | v_U8_t elem_id; |
| 7595 | v_U16_t elem_len; |
| 7596 | |
| 7597 | while(left >= (size_of_len_field+1)) |
| 7598 | { |
| 7599 | elem_id = ptr[0]; |
| 7600 | if (size_of_len_field == TWO_BYTE) |
| 7601 | { |
| 7602 | elem_len = ((v_U16_t) ptr[1]) | (ptr[2]<<8); |
| 7603 | } |
| 7604 | else |
| 7605 | { |
| 7606 | elem_len = ptr[1]; |
| 7607 | } |
| 7608 | |
| 7609 | |
| 7610 | left -= (size_of_len_field+1); |
| 7611 | if(elem_len > left) |
| 7612 | { |
| 7613 | limLog(pMac, LOGE, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 7614 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7615 | eid,elem_len,left); |
| 7616 | return NULL; |
| 7617 | } |
| 7618 | if (elem_id == eid) |
| 7619 | { |
| 7620 | return ptr; |
| 7621 | } |
| 7622 | |
| 7623 | left -= elem_len; |
| 7624 | ptr += (elem_len + (size_of_len_field+1)); |
| 7625 | } |
| 7626 | return NULL; |
| 7627 | } |
| 7628 | |
| 7629 | /* return NULL if oui is not found in ie |
| 7630 | return !NULL pointer to vendor IE (starting from 0xDD) if oui is found |
| 7631 | */ |
| 7632 | v_U8_t* limGetVendorIEOuiPtr(tpAniSirGlobal pMac, tANI_U8 *oui, tANI_U8 oui_size, tANI_U8 *ie, tANI_U16 ie_len) |
| 7633 | { |
| 7634 | int left = ie_len; |
| 7635 | v_U8_t *ptr = ie; |
| 7636 | v_U8_t elem_id, elem_len; |
| 7637 | |
| 7638 | while(left >= 2) |
| 7639 | { |
| 7640 | elem_id = ptr[0]; |
| 7641 | elem_len = ptr[1]; |
| 7642 | left -= 2; |
| 7643 | if(elem_len > left) |
| 7644 | { |
| 7645 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7646 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7647 | elem_id,elem_len,left); |
| 7648 | return NULL; |
| 7649 | } |
| 7650 | if (SIR_MAC_EID_VENDOR == elem_id) |
| 7651 | { |
| 7652 | if(memcmp(&ptr[2], oui, oui_size)==0) |
| 7653 | return ptr; |
| 7654 | } |
| 7655 | |
| 7656 | left -= elem_len; |
| 7657 | ptr += (elem_len + 2); |
| 7658 | } |
| 7659 | return NULL; |
| 7660 | } |
| 7661 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7662 | //Returns length of P2P stream and Pointer ie passed to this function is filled with noa stream |
| 7663 | |
| 7664 | v_U8_t limBuildP2pIe(tpAniSirGlobal pMac, tANI_U8 *ie, tANI_U8 *data, tANI_U8 ie_len) |
| 7665 | { |
| 7666 | int length = 0; |
| 7667 | tANI_U8 *ptr = ie; |
| 7668 | |
| 7669 | ptr[length++] = SIR_MAC_EID_VENDOR; |
| 7670 | ptr[length++] = ie_len + SIR_MAC_P2P_OUI_SIZE; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7671 | vos_mem_copy(&ptr[length], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE); |
| 7672 | vos_mem_copy(&ptr[length + SIR_MAC_P2P_OUI_SIZE], data, ie_len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7673 | return (ie_len + SIR_P2P_IE_HEADER_LEN); |
| 7674 | } |
| 7675 | |
| 7676 | //Returns length of NoA stream and Pointer pNoaStream passed to this function is filled with noa stream |
| 7677 | |
| 7678 | v_U8_t limGetNoaAttrStreamInMultP2pIes(tpAniSirGlobal pMac,v_U8_t* noaStream,v_U8_t noaLen,v_U8_t overFlowLen) |
| 7679 | { |
| 7680 | v_U8_t overFlowP2pStream[SIR_MAX_NOA_ATTR_LEN]; |
Krunal Soni | c768a93 | 2013-05-15 19:26:30 -0700 | [diff] [blame] | 7681 | |
| 7682 | if ((noaLen <= (SIR_MAX_NOA_ATTR_LEN+SIR_P2P_IE_HEADER_LEN)) && |
| 7683 | (noaLen >= overFlowLen) && (overFlowLen <= SIR_MAX_NOA_ATTR_LEN)) |
| 7684 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7685 | vos_mem_copy(overFlowP2pStream, |
Krunal Soni | c768a93 | 2013-05-15 19:26:30 -0700 | [diff] [blame] | 7686 | noaStream + noaLen - overFlowLen, overFlowLen); |
| 7687 | noaStream[noaLen - overFlowLen] = SIR_MAC_EID_VENDOR; |
| 7688 | noaStream[noaLen - overFlowLen + 1] = overFlowLen + SIR_MAC_P2P_OUI_SIZE; |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7689 | vos_mem_copy(noaStream+noaLen-overFlowLen + 2, |
Krunal Soni | c768a93 | 2013-05-15 19:26:30 -0700 | [diff] [blame] | 7690 | SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame] | 7691 | vos_mem_copy(noaStream+noaLen + 2 + SIR_MAC_P2P_OUI_SIZE - overFlowLen, |
| 7692 | overFlowP2pStream, overFlowLen); |
Krunal Soni | c768a93 | 2013-05-15 19:26:30 -0700 | [diff] [blame] | 7693 | } |
| 7694 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7695 | return (noaLen + SIR_P2P_IE_HEADER_LEN); |
| 7696 | |
| 7697 | } |
| 7698 | |
| 7699 | //Returns length of NoA stream and Pointer pNoaStream passed to this function is filled with noa stream |
| 7700 | v_U8_t limGetNoaAttrStream(tpAniSirGlobal pMac, v_U8_t*pNoaStream,tpPESession psessionEntry) |
| 7701 | { |
| 7702 | v_U8_t len=0; |
| 7703 | |
| 7704 | v_U8_t *pBody = pNoaStream; |
| 7705 | |
| 7706 | |
| 7707 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
| 7708 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 7709 | { |
| 7710 | if ((!(psessionEntry->p2pGoPsUpdate.uNoa1Duration)) && (!(psessionEntry->p2pGoPsUpdate.uNoa2Duration)) |
| 7711 | && (!psessionEntry->p2pGoPsUpdate.oppPsFlag) |
| 7712 | ) |
| 7713 | return 0; //No NoA Descriptor then return 0 |
| 7714 | |
| 7715 | |
| 7716 | pBody[0] = SIR_P2P_NOA_ATTR; |
| 7717 | |
| 7718 | pBody[3] = psessionEntry->p2pGoPsUpdate.index; |
| 7719 | pBody[4] = psessionEntry->p2pGoPsUpdate.ctWin | (psessionEntry->p2pGoPsUpdate.oppPsFlag<<7); |
| 7720 | len = 5; |
| 7721 | pBody += len; |
| 7722 | |
| 7723 | |
| 7724 | if (psessionEntry->p2pGoPsUpdate.uNoa1Duration) |
| 7725 | { |
| 7726 | *pBody = psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt; |
| 7727 | pBody += 1; |
| 7728 | len +=1; |
| 7729 | |
| 7730 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1Duration); |
| 7731 | pBody += sizeof(tANI_U32); |
| 7732 | len +=4; |
| 7733 | |
| 7734 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1Interval); |
| 7735 | pBody += sizeof(tANI_U32); |
| 7736 | len +=4; |
| 7737 | |
| 7738 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1StartTime); |
| 7739 | pBody += sizeof(tANI_U32); |
| 7740 | len +=4; |
| 7741 | |
| 7742 | } |
| 7743 | |
| 7744 | if (psessionEntry->p2pGoPsUpdate.uNoa2Duration) |
| 7745 | { |
| 7746 | *pBody = psessionEntry->p2pGoPsUpdate.uNoa2IntervalCnt; |
| 7747 | pBody += 1; |
| 7748 | len +=1; |
| 7749 | |
| 7750 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2Duration); |
| 7751 | pBody += sizeof(tANI_U32); |
| 7752 | len +=4; |
| 7753 | |
| 7754 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2Interval); |
| 7755 | pBody += sizeof(tANI_U32); |
| 7756 | len +=4; |
| 7757 | |
| 7758 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2StartTime); |
| 7759 | pBody += sizeof(tANI_U32); |
| 7760 | len +=4; |
| 7761 | |
| 7762 | } |
| 7763 | |
| 7764 | |
| 7765 | pBody = pNoaStream + 1; |
| 7766 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(len-3);/*one byte for Attr and 2 bytes for length*/ |
| 7767 | |
| 7768 | return (len); |
| 7769 | |
| 7770 | } |
| 7771 | return 0; |
| 7772 | |
| 7773 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7774 | |
| 7775 | void peSetResumeChannel(tpAniSirGlobal pMac, tANI_U16 channel, ePhyChanBondState phyCbState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7776 | { |
| 7777 | |
| 7778 | pMac->lim.gResumeChannel = channel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7779 | pMac->lim.gResumePhyCbState = phyCbState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7780 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7782 | /*-------------------------------------------------------------------------- |
| 7783 | |
| 7784 | \brief peGetResumeChannel() - Returns the channel number for scanning, from a valid session. |
| 7785 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7786 | This function returns the channel to resume to during link resume. channel id of 0 means HAL will |
| 7787 | resume to previous channel before link suspend |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7788 | |
| 7789 | \param pMac - pointer to global adapter context |
| 7790 | \return - channel to scan from valid session else zero. |
| 7791 | |
| 7792 | \sa |
| 7793 | |
| 7794 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7795 | void peGetResumeChannel(tpAniSirGlobal pMac, tANI_U8* resumeChannel, ePhyChanBondState* resumePhyCbState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7796 | { |
| 7797 | |
| 7798 | //Rationale - this could be the suspend/resume for assoc and it is essential that |
| 7799 | //the new BSS is active for some time. Other BSS was anyway suspended. |
| 7800 | //TODO: Comeup with a better alternative. Sending NULL with PM=0 on other BSS means |
| 7801 | //there will be trouble. But since it is sent on current channel, it will be missed by peer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7802 | //and hence should be ok. Need to discuss this further |
| 7803 | if( !limIsInMCC(pMac) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7804 | { |
| 7805 | //Get current active session channel |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7806 | peGetActiveSessionChannel(pMac, resumeChannel, resumePhyCbState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | } |
| 7808 | else |
| 7809 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7810 | *resumeChannel = pMac->lim.gResumeChannel; |
| 7811 | *resumePhyCbState = pMac->lim.gResumePhyCbState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7812 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7813 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7814 | } |
| 7815 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 7816 | tANI_BOOLEAN limIsNOAInsertReqd(tpAniSirGlobal pMac) |
| 7817 | { |
| 7818 | tANI_U8 i; |
| 7819 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 7820 | { |
| 7821 | if(pMac->lim.gpSession[i].valid == TRUE) |
| 7822 | { |
| 7823 | if( (eLIM_AP_ROLE == pMac->lim.gpSession[i].limSystemRole ) |
| 7824 | && ( VOS_P2P_GO_MODE == pMac->lim.gpSession[i].pePersona ) |
| 7825 | ) |
| 7826 | { |
| 7827 | return TRUE; |
| 7828 | } |
| 7829 | } |
| 7830 | } |
| 7831 | return FALSE; |
| 7832 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7833 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7834 | |
| 7835 | tANI_BOOLEAN limIsconnectedOnDFSChannel(tANI_U8 currentChannel) |
| 7836 | { |
| 7837 | if(NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(currentChannel)) |
| 7838 | { |
| 7839 | return eANI_BOOLEAN_TRUE; |
| 7840 | } |
| 7841 | else |
| 7842 | { |
| 7843 | return eANI_BOOLEAN_FALSE; |
| 7844 | } |
| 7845 | } |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7846 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 7847 | /** |
| 7848 | * \brief verify the changes in channel bonding |
| 7849 | * |
| 7850 | * \param pMac Pointer to the global MAC structure |
| 7851 | * |
| 7852 | * \param psessionEntry session entry |
| 7853 | * beaconSecChanWidth Secondary channel width |
| 7854 | * advertized in beacon |
| 7855 | * currentSecChanWidth Current configured width |
| 7856 | * staId Station Id |
| 7857 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 7858 | */ |
| 7859 | tANI_BOOLEAN limCheckHTChanBondModeChange(tpAniSirGlobal pMac, |
| 7860 | tpPESession psessionEntry, |
| 7861 | tANI_U8 beaconSecChanWidth, |
| 7862 | tANI_U8 currentSecChanWidth, |
| 7863 | tANI_U8 staId) |
| 7864 | { |
| 7865 | tUpdateVHTOpMode tempParam; |
| 7866 | tANI_BOOLEAN fCbMode24G = FALSE; |
| 7867 | tANI_BOOLEAN status = eANI_BOOLEAN_FALSE; |
| 7868 | |
| 7869 | /* Moving from HT40 to HT20 operation*/ |
| 7870 | if (((PHY_DOUBLE_CHANNEL_LOW_PRIMARY == currentSecChanWidth) || |
| 7871 | (PHY_DOUBLE_CHANNEL_HIGH_PRIMARY == currentSecChanWidth)) |
| 7872 | && (PHY_SINGLE_CHANNEL_CENTERED == beaconSecChanWidth)) |
| 7873 | { |
| 7874 | tempParam.opMode = eHT_CHANNEL_WIDTH_20MHZ; |
| 7875 | tempParam.staId = staId; |
| 7876 | fCbMode24G = TRUE; |
| 7877 | } |
| 7878 | |
| 7879 | /* Moving from HT20 to HT40 operation*/ |
| 7880 | if ((( PHY_DOUBLE_CHANNEL_LOW_PRIMARY == beaconSecChanWidth) || |
| 7881 | ( PHY_DOUBLE_CHANNEL_HIGH_PRIMARY == beaconSecChanWidth )) |
| 7882 | && (PHY_SINGLE_CHANNEL_CENTERED == currentSecChanWidth)) |
| 7883 | { |
| 7884 | tempParam.opMode = eHT_CHANNEL_WIDTH_40MHZ; |
| 7885 | tempParam.staId = staId; |
| 7886 | fCbMode24G = TRUE; |
| 7887 | } |
| 7888 | |
| 7889 | if (TRUE == fCbMode24G) |
| 7890 | { |
| 7891 | VOS_TRACE( VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 7892 | "Changing CBMODE to = %d staId = %d", |
| 7893 | tempParam.opMode, tempParam.staId ); |
| 7894 | if( eSIR_SUCCESS == limSendModeUpdate(pMac, &tempParam, psessionEntry)) |
| 7895 | status = eANI_BOOLEAN_TRUE; |
| 7896 | } |
| 7897 | return status; |
| 7898 | } |
| 7899 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 7900 | #ifdef WLAN_FEATURE_11AC |
| 7901 | tANI_BOOLEAN limCheckVHTOpModeChange( tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U8 chanWidth, tANI_U8 staId) |
| 7902 | { |
| 7903 | tUpdateVHTOpMode tempParam; |
| 7904 | |
| 7905 | tempParam.opMode = chanWidth; |
| 7906 | tempParam.staId = staId; |
| 7907 | |
| 7908 | limSendModeUpdate( pMac, &tempParam, psessionEntry ); |
| 7909 | |
| 7910 | return eANI_BOOLEAN_TRUE; |
| 7911 | } |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7912 | #endif |
| 7913 | |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7914 | void limGetShortSlotFromPhyMode(tpAniSirGlobal pMac, tpPESession psessionEntry, |
| 7915 | tANI_U32 phyMode, tANI_U8 *pShortSlotEnabled) |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7916 | { |
| 7917 | tANI_U8 val=0; |
| 7918 | |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7919 | //only 2.4G band should have short slot enable, rest it should be default |
| 7920 | if (phyMode == WNI_CFG_PHY_MODE_11G) |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7921 | { |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7922 | /* short slot is default in all other modes */ |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7923 | if ((psessionEntry->pePersona == VOS_STA_SAP_MODE) || |
Ravi Joshi | 27216f1 | 2013-10-19 17:04:39 -0700 | [diff] [blame] | 7924 | (psessionEntry->pePersona == VOS_IBSS_MODE) || |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7925 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 7926 | { |
| 7927 | val = true; |
| 7928 | } |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7929 | // Program Polaris based on AP capability |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7930 | if (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7931 | { |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7932 | // Joining BSS. |
| 7933 | val = SIR_MAC_GET_SHORT_SLOT_TIME( psessionEntry->limCurrentBssCaps); |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7934 | } |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7935 | else if (psessionEntry->limMlmState == eLIM_MLM_WT_REASSOC_RSP_STATE) |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7936 | { |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7937 | // Reassociating with AP. |
| 7938 | val = SIR_MAC_GET_SHORT_SLOT_TIME( psessionEntry->limReassocBssCaps); |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7939 | } |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7940 | } |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7941 | else |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7942 | { |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7943 | /* |
| 7944 | * 11B does not short slot and short slot is default |
| 7945 | * for 11A mode. Hence, not need to set this bit |
| 7946 | */ |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7947 | val = false; |
| 7948 | } |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7949 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7950 | limLog(pMac, LOG1, FL("phyMode = %u shortslotsupported = %u"), phyMode, val); |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 7951 | *pShortSlotEnabled = val; |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7952 | } |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 7953 | |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 7954 | void limUtilsframeshtons(tpAniSirGlobal pCtx, |
| 7955 | tANI_U8 *pOut, |
| 7956 | tANI_U16 pIn, |
| 7957 | tANI_U8 fMsb) |
| 7958 | { |
| 7959 | (void)pCtx; |
| 7960 | #if defined ( DOT11F_LITTLE_ENDIAN_HOST ) |
| 7961 | if ( !fMsb ) |
| 7962 | { |
| 7963 | DOT11F_MEMCPY(pCtx, pOut, &pIn, 2); |
| 7964 | } |
| 7965 | else |
| 7966 | { |
| 7967 | *pOut = ( pIn & 0xff00 ) >> 8; |
| 7968 | *( pOut + 1 ) = pIn & 0xff; |
| 7969 | } |
| 7970 | #else |
| 7971 | if ( !fMsb ) |
| 7972 | { |
| 7973 | *pOut = pIn & 0xff; |
| 7974 | *( pOut + 1 ) = ( pIn & 0xff00 ) >> 8; |
| 7975 | } |
| 7976 | else |
| 7977 | { |
| 7978 | DOT11F_MEMCPY(pCtx, pOut, &pIn, 2); |
| 7979 | } |
| 7980 | #endif |
| 7981 | } |
| 7982 | |
| 7983 | void limUtilsframeshtonl(tpAniSirGlobal pCtx, |
| 7984 | tANI_U8 *pOut, |
| 7985 | tANI_U32 pIn, |
| 7986 | tANI_U8 fMsb) |
| 7987 | { |
| 7988 | (void)pCtx; |
| 7989 | #if defined ( DOT11F_LITTLE_ENDIAN_HOST ) |
| 7990 | if ( !fMsb ) |
| 7991 | { |
| 7992 | DOT11F_MEMCPY(pCtx, pOut, &pIn, 4); |
| 7993 | } |
| 7994 | else |
| 7995 | { |
| 7996 | *pOut = ( pIn & 0xff000000 ) >> 24; |
| 7997 | *( pOut + 1 ) = ( pIn & 0x00ff0000 ) >> 16; |
| 7998 | *( pOut + 2 ) = ( pIn & 0x0000ff00 ) >> 8; |
| 7999 | *( pOut + 3 ) = ( pIn & 0x000000ff ); |
| 8000 | } |
| 8001 | #else |
| 8002 | if ( !fMsb ) |
| 8003 | { |
| 8004 | *( pOut ) = ( pIn & 0x000000ff ); |
| 8005 | *( pOut + 1 ) = ( pIn & 0x0000ff00 ) >> 8; |
| 8006 | *( pOut + 2 ) = ( pIn & 0x00ff0000 ) >> 16; |
| 8007 | *( pOut + 3 ) = ( pIn & 0xff000000 ) >> 24; |
| 8008 | } |
| 8009 | else |
| 8010 | { |
| 8011 | DOT11F_MEMCPY(pCtx, pOut, &pIn, 4); |
| 8012 | } |
| 8013 | #endif |
| 8014 | } |
| 8015 | |
| 8016 | |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 8017 | /**-------------------------------------------- |
| 8018 | \fn limUpdateOBSSScanParams |
| 8019 | \brief Updates OBSS SCAN IE parameters to session |
| 8020 | |
| 8021 | \param psessionEntry - Session Entry |
| 8022 | \return NONE |
| 8023 | ---------------------------------------------*/ |
| 8024 | void limUpdateOBSSScanParams(tpPESession psessionEntry , |
| 8025 | tDot11fIEOBSSScanParameters *pOBSSScanParameters) |
| 8026 | { |
| 8027 | /*If the recieved value is not in the range specified by the Specification |
| 8028 | then it will be the default value configured through cfg */ |
| 8029 | if (( pOBSSScanParameters->obssScanActiveDwell > |
| 8030 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMIN ) && |
| 8031 | ( pOBSSScanParameters->obssScanActiveDwell < |
| 8032 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_STAMAX)) |
| 8033 | { |
| 8034 | psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime= |
| 8035 | pOBSSScanParameters->obssScanActiveDwell; |
| 8036 | } |
| 8037 | if((pOBSSScanParameters->obssScanPassiveDwell > |
| 8038 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMIN ) && |
| 8039 | (pOBSSScanParameters->obssScanPassiveDwell < |
| 8040 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_STAMAX)) |
| 8041 | { |
| 8042 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime = |
| 8043 | pOBSSScanParameters->obssScanPassiveDwell; |
| 8044 | } |
| 8045 | if((pOBSSScanParameters->bssWidthChannelTransitionDelayFactor > |
| 8046 | WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMIN) && |
| 8047 | (pOBSSScanParameters->bssWidthChannelTransitionDelayFactor < |
| 8048 | WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR_STAMAX)) |
| 8049 | { |
| 8050 | psessionEntry->obssHT40ScanParam.BSSWidthChannelTransitionDelayFactor = |
| 8051 | pOBSSScanParameters->bssWidthChannelTransitionDelayFactor; |
| 8052 | } |
| 8053 | if((pOBSSScanParameters->obssScanActiveTotalPerChannel > |
| 8054 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMIN) && |
| 8055 | (pOBSSScanParameters->obssScanActiveTotalPerChannel < |
| 8056 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL_STAMAX)) |
| 8057 | { |
| 8058 | psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel = |
| 8059 | pOBSSScanParameters->obssScanActiveTotalPerChannel; |
| 8060 | } |
| 8061 | if((pOBSSScanParameters->obssScanPassiveTotalPerChannel > |
| 8062 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMIN) && |
| 8063 | (pOBSSScanParameters->obssScanPassiveTotalPerChannel < |
| 8064 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL_STAMAX)) |
| 8065 | { |
| 8066 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel = |
| 8067 | pOBSSScanParameters->obssScanPassiveTotalPerChannel; |
| 8068 | } |
| 8069 | if((pOBSSScanParameters->bssChannelWidthTriggerScanInterval > |
| 8070 | WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMIN) && |
| 8071 | (pOBSSScanParameters->bssChannelWidthTriggerScanInterval < |
| 8072 | WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_STAMAX)) |
| 8073 | { |
| 8074 | psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval = |
| 8075 | pOBSSScanParameters->bssChannelWidthTriggerScanInterval; |
| 8076 | } |
| 8077 | if((pOBSSScanParameters->obssScanActivityThreshold > |
| 8078 | WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMIN )&& |
| 8079 | (pOBSSScanParameters->obssScanActivityThreshold < |
| 8080 | WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD_STAMAX)) |
| 8081 | { |
| 8082 | psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold = |
| 8083 | pOBSSScanParameters->obssScanActivityThreshold; |
| 8084 | } |
| 8085 | } |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 8086 | |
| 8087 | #ifdef WLAN_FEATURE_11W |
| 8088 | void limPmfSaQueryTimerHandler(void *pMacGlobal, tANI_U32 param) |
| 8089 | { |
| 8090 | tpAniSirGlobal pMac = (tpAniSirGlobal)pMacGlobal; |
| 8091 | tPmfSaQueryTimerId timerId; |
| 8092 | tpPESession psessionEntry; |
| 8093 | tpDphHashNode pSta; |
| 8094 | tANI_U32 maxRetries; |
| 8095 | |
| 8096 | limLog(pMac, LOG1, FL("SA Query timer fires")); |
| 8097 | timerId.value = param; |
| 8098 | |
| 8099 | // Check that SA Query is in progress |
| 8100 | if ((psessionEntry = peFindSessionBySessionId( |
| 8101 | pMac, timerId.fields.sessionId)) == NULL) |
| 8102 | { |
| 8103 | limLog(pMac, LOGE, FL("Session does not exist for given session ID %d"), |
| 8104 | timerId.fields.sessionId); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 8105 | return; |
| 8106 | } |
| 8107 | if ((pSta = dphGetHashEntry(pMac, timerId.fields.peerIdx, |
| 8108 | &psessionEntry->dph.dphHashTable)) == NULL) |
| 8109 | { |
| 8110 | limLog(pMac, LOGE, FL("Entry does not exist for given peer index %d"), |
| 8111 | timerId.fields.peerIdx); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 8112 | return; |
| 8113 | } |
| 8114 | if (DPH_SA_QUERY_IN_PROGRESS != pSta->pmfSaQueryState) |
| 8115 | return; |
| 8116 | |
| 8117 | // Increment the retry count, check if reached maximum |
| 8118 | if (wlan_cfgGetInt(pMac, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, |
| 8119 | &maxRetries) != eSIR_SUCCESS) |
| 8120 | { |
| 8121 | limLog(pMac, LOGE, FL("Could not retrieve PMF SA Query maximum retries value")); |
| 8122 | pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS; |
| 8123 | return; |
| 8124 | } |
| 8125 | pSta->pmfSaQueryRetryCount++; |
| 8126 | if (pSta->pmfSaQueryRetryCount >= maxRetries) |
| 8127 | { |
Abhishek Singh | 5696b73 | 2015-01-16 10:51:45 +0530 | [diff] [blame] | 8128 | limLog(pMac, LOGE, |
| 8129 | FL("SA Query timed out,Deleting STA: " MAC_ADDRESS_STR), |
| 8130 | MAC_ADDR_ARRAY(pSta->staAddr)); |
| 8131 | limSendDisassocMgmtFrame(pMac, |
| 8132 | eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON, |
| 8133 | pSta->staAddr, psessionEntry, FALSE); |
| 8134 | limTriggerSTAdeletion(pMac, pSta, psessionEntry); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 8135 | pSta->pmfSaQueryState = DPH_SA_QUERY_TIMED_OUT; |
| 8136 | return; |
| 8137 | } |
| 8138 | |
| 8139 | // Retry SA Query |
| 8140 | limSendSaQueryRequestFrame(pMac, (tANI_U8 *)&(pSta->pmfSaQueryCurrentTransId), |
| 8141 | pSta->staAddr, psessionEntry); |
| 8142 | pSta->pmfSaQueryCurrentTransId++; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 8143 | if (tx_timer_activate(&pSta->pmfSaQueryTimer) != TX_SUCCESS) |
| 8144 | { |
| 8145 | limLog(pMac, LOGE, FL("PMF SA Query timer activation failed!")); |
| 8146 | pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS; |
| 8147 | } |
| 8148 | } |
| 8149 | #endif |
| 8150 | |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 8151 | /** --------------------------------------------------------- |
| 8152 | \fn limProcessChannelSwitchSuspendLink |
| 8153 | \brief This function call channel switch functions based on |
| 8154 | the gLimChannelSwitch.state. After function return it |
| 8155 | reset the state to eLIM_CHANNEL_SWITCH_IDLE. |
| 8156 | If gLimChannelSwitch.state is non-identified then |
| 8157 | print error log as well as restore back the |
| 8158 | pre-channelSwitch. |
| 8159 | \param tpAniSirGlobal pMac |
| 8160 | \param eHalStatus status |
| 8161 | \param tANI_U32 *ctx |
| 8162 | \return None |
| 8163 | ------------------------------------------------------------*/ |
| 8164 | static void |
| 8165 | limProcessChannelSwitchSuspendLink(tpAniSirGlobal pMac, |
| 8166 | eHalStatus status, |
| 8167 | tANI_U32 *ctx) |
| 8168 | { |
| 8169 | tpPESession pSessionEntry = (tpPESession)ctx; |
| 8170 | |
| 8171 | if ( eHAL_STATUS_SUCCESS != status ) |
| 8172 | { |
| 8173 | limLog(pMac, LOGE, |
| 8174 | FL("Suspend link failed. still proceeding ")); |
| 8175 | } |
| 8176 | if (NULL == pSessionEntry ) |
| 8177 | { |
| 8178 | limLog(pMac, LOGE, FL("pSessionEntry is null pointer ")); |
| 8179 | return; |
| 8180 | } |
| 8181 | |
| 8182 | switch(pSessionEntry->gLimChannelSwitch.state) |
| 8183 | { |
| 8184 | case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY: |
| 8185 | PELOGW(limLog(pMac, LOGW, |
| 8186 | FL("CHANNEL_SWITCH_PRIMARY_ONLY "));) |
| 8187 | limSwitchPrimaryChannel(pMac, |
| 8188 | pSessionEntry->gLimChannelSwitch.primaryChannel, |
| 8189 | pSessionEntry); |
| 8190 | pSessionEntry->gLimChannelSwitch.state = |
| 8191 | eLIM_CHANNEL_SWITCH_IDLE; |
| 8192 | break; |
| 8193 | |
| 8194 | case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY: |
| 8195 | PELOGW(limLog(pMac, LOGW, |
| 8196 | FL("CHANNEL_SWITCH_PRIMARY_AND_SECONDARY"));) |
| 8197 | limSwitchPrimarySecondaryChannel(pMac, pSessionEntry, |
| 8198 | pSessionEntry->gLimChannelSwitch.primaryChannel, |
| 8199 | pSessionEntry->gLimChannelSwitch.secondarySubBand); |
| 8200 | pSessionEntry->gLimChannelSwitch.state = |
| 8201 | eLIM_CHANNEL_SWITCH_IDLE; |
| 8202 | break; |
| 8203 | |
| 8204 | default: |
| 8205 | PELOGE(limLog(pMac, LOGW, FL("incorrect state %d"), |
| 8206 | pSessionEntry->gLimChannelSwitch.state);) |
| 8207 | if (limRestorePreChannelSwitchState(pMac, |
| 8208 | pSessionEntry) != eSIR_SUCCESS) |
| 8209 | { |
| 8210 | limLog(pMac, LOGE, |
| 8211 | FL("Could not restore pre-channelSwitch " |
| 8212 | "(11h) state, resetting the system")); |
| 8213 | } |
| 8214 | } |
| 8215 | } |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 8216 | |
| 8217 | /** --------------------------------------------------------- |
| 8218 | \fn limInitOBSSScanParams |
| 8219 | \brief This function Initializes the OBSS Scan Parameters |
| 8220 | \param tpAniSirGlobal pMac |
| 8221 | \param tpPESession pSessionEntry |
| 8222 | \return None |
| 8223 | ------------------------------------------------------------*/ |
| 8224 | |
| 8225 | void limInitOBSSScanParams(tpAniSirGlobal pMac, |
| 8226 | tpPESession psessionEntry) |
| 8227 | { |
| 8228 | tANI_U32 cfgValue; |
| 8229 | |
| 8230 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME, |
| 8231 | &cfgValue) != eSIR_SUCCESS) |
| 8232 | { |
| 8233 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 8234 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME value")); |
| 8235 | return ; |
| 8236 | } |
| 8237 | psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime = cfgValue; |
| 8238 | |
| 8239 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME, |
| 8240 | &cfgValue) != eSIR_SUCCESS) |
| 8241 | { |
| 8242 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 8243 | "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME value")); |
| 8244 | return ; |
| 8245 | } |
| 8246 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime = cfgValue; |
| 8247 | |
| 8248 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, |
| 8249 | &cfgValue) != eSIR_SUCCESS) |
| 8250 | { |
| 8251 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 8252 | "WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL value")); |
| 8253 | return ; |
| 8254 | } |
| 8255 | psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval |
| 8256 | = cfgValue; |
| 8257 | if (wlan_cfgGetInt(pMac, |
| 8258 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL, |
| 8259 | &cfgValue) != eSIR_SUCCESS) |
| 8260 | { |
| 8261 | limLog(pMac, LOGE, FL("Fail to retrieve" |
| 8262 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL value")); |
| 8263 | return ; |
| 8264 | } |
| 8265 | psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel = |
| 8266 | cfgValue; |
| 8267 | if (wlan_cfgGetInt(pMac, |
| 8268 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL, &cfgValue) |
| 8269 | != eSIR_SUCCESS) |
| 8270 | { |
| 8271 | limLog(pMac, LOGE, FL("Fail to retrieve" |
| 8272 | "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL value")); |
| 8273 | return ; |
| 8274 | } |
| 8275 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel = |
| 8276 | cfgValue; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 8277 | |
| 8278 | if (wlan_cfgGetInt(pMac, |
| 8279 | WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR, &cfgValue) |
| 8280 | != eSIR_SUCCESS) |
| 8281 | { |
| 8282 | limLog(pMac, LOGE, FL("Fail to retrieve" |
| 8283 | "WNI_CFG_OBSS_HT40_WIDTH_CHANNEL_TRANSITION_DELAY_FACTOR value")); |
| 8284 | return ; |
| 8285 | } |
| 8286 | psessionEntry->obssHT40ScanParam.BSSWidthChannelTransitionDelayFactor = |
| 8287 | cfgValue; |
| 8288 | |
| 8289 | |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 8290 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD , |
| 8291 | &cfgValue) != eSIR_SUCCESS) |
| 8292 | { |
| 8293 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 8294 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD value")); |
| 8295 | return ; |
| 8296 | } |
| 8297 | psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold = cfgValue; |
Sushant Kaushik | e0d2cce | 2014-04-10 14:36:07 +0530 | [diff] [blame] | 8298 | } |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 8299 | |
Sushant Kaushik | e0d2cce | 2014-04-10 14:36:07 +0530 | [diff] [blame] | 8300 | const char * lim_ScanTypetoString(const v_U8_t scanType) |
| 8301 | { |
| 8302 | switch (scanType) |
| 8303 | { |
| 8304 | CASE_RETURN_STRING( eSIR_PASSIVE_SCAN ); |
| 8305 | CASE_RETURN_STRING( eSIR_ACTIVE_SCAN ); |
| 8306 | CASE_RETURN_STRING( eSIR_BEACON_TABLE ); |
| 8307 | default: |
| 8308 | return "Unknown ScanType"; |
| 8309 | } |
| 8310 | } |
| 8311 | |
| 8312 | const char * lim_BssTypetoString(const v_U8_t bssType) |
| 8313 | { |
| 8314 | switch (bssType) |
| 8315 | { |
| 8316 | CASE_RETURN_STRING( eSIR_INFRASTRUCTURE_MODE ); |
| 8317 | CASE_RETURN_STRING( eSIR_INFRA_AP_MODE ); |
| 8318 | CASE_RETURN_STRING( eSIR_IBSS_MODE ); |
| 8319 | CASE_RETURN_STRING( eSIR_BTAMP_STA_MODE ); |
| 8320 | CASE_RETURN_STRING( eSIR_BTAMP_AP_MODE ); |
| 8321 | CASE_RETURN_STRING( eSIR_AUTO_MODE ); |
| 8322 | default: |
| 8323 | return "Unknown BssType"; |
| 8324 | } |
| 8325 | } |
| 8326 | |
| 8327 | const char *lim_BackgroundScanModetoString(const v_U8_t mode) |
| 8328 | { |
| 8329 | switch (mode) |
| 8330 | { |
| 8331 | CASE_RETURN_STRING( eSIR_AGGRESSIVE_BACKGROUND_SCAN ); |
| 8332 | CASE_RETURN_STRING( eSIR_NORMAL_BACKGROUND_SCAN ); |
| 8333 | CASE_RETURN_STRING( eSIR_ROAMING_SCAN ); |
| 8334 | default: |
| 8335 | return "Unknown BgScanMode"; |
| 8336 | } |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 8337 | } |
Abhishek Singh | 0ebac9c | 2014-06-25 13:34:12 +0530 | [diff] [blame] | 8338 | |
| 8339 | #ifdef WLAN_FEATURE_11W |
| 8340 | /** |
| 8341 | * |
| 8342 | * \brief This function is called by various LIM modules to correctly set |
| 8343 | * the Protected bit in the Frame Control Field of the 802.11 frame MAC header |
| 8344 | * |
| 8345 | * |
| 8346 | * \param pMac Pointer to Global MAC structure |
| 8347 | * |
| 8348 | * \param psessionEntry Pointer to session corresponding to the connection |
| 8349 | * |
| 8350 | * \param peer Peer address of the STA to which the frame is to be sent |
| 8351 | * |
| 8352 | * \param pMacHdr Pointer to the frame MAC header |
| 8353 | * |
| 8354 | * \return nothing |
| 8355 | * |
| 8356 | * |
| 8357 | */ |
| 8358 | void |
| 8359 | limSetProtectedBit(tpAniSirGlobal pMac, |
| 8360 | tpPESession psessionEntry, |
| 8361 | tSirMacAddr peer, |
| 8362 | tpSirMacMgmtHdr pMacHdr) |
| 8363 | { |
| 8364 | tANI_U16 aid; |
| 8365 | tpDphHashNode pStaDs; |
| 8366 | |
| 8367 | if( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 8368 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 8369 | { |
| 8370 | |
| 8371 | pStaDs = dphLookupHashEntry( pMac, peer, &aid, |
| 8372 | &psessionEntry->dph.dphHashTable ); |
| 8373 | if( pStaDs != NULL ) |
Abhishek Singh | 28266f0 | 2014-11-05 17:22:19 +0530 | [diff] [blame] | 8374 | /* rmfenabled will be set at the time of addbss. |
| 8375 | * but sometimes EAP auth fails and keys are not |
| 8376 | * installed then if we send any management frame |
| 8377 | * like deauth/disassoc with this bit set then |
| 8378 | * firmware crashes. so check for keys are |
| 8379 | * installed or not also before setting the bit |
| 8380 | */ |
Abhishek Singh | 683d786 | 2014-11-05 17:34:31 +0530 | [diff] [blame] | 8381 | if (pStaDs->rmfEnabled && pStaDs->isKeyInstalled) |
Abhishek Singh | 0ebac9c | 2014-06-25 13:34:12 +0530 | [diff] [blame] | 8382 | pMacHdr->fc.wep = 1; |
| 8383 | } |
Abhishek Singh | 28266f0 | 2014-11-05 17:22:19 +0530 | [diff] [blame] | 8384 | else if ( psessionEntry->limRmfEnabled && psessionEntry->isKeyInstalled) |
Abhishek Singh | 0ebac9c | 2014-06-25 13:34:12 +0530 | [diff] [blame] | 8385 | pMacHdr->fc.wep = 1; |
| 8386 | } /*** end limSetProtectedBit() ***/ |
| 8387 | #endif |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame] | 8388 | |
| 8389 | tANI_U8* limGetIePtr(v_U8_t *pIes, int length, v_U8_t eid) |
| 8390 | { |
| 8391 | int left = length; |
| 8392 | tANI_U8 *ptr = pIes; |
| 8393 | tANI_U8 elem_id,elem_len; |
| 8394 | |
| 8395 | while (left >= 2) |
| 8396 | { |
| 8397 | elem_id = ptr[0]; |
| 8398 | elem_len = ptr[1]; |
| 8399 | left -= 2; |
| 8400 | |
| 8401 | if (elem_len > left) |
| 8402 | { |
| 8403 | VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
| 8404 | FL("****Invalid IEs eid = %d elem_len=%d left=%d\n*****"), |
| 8405 | eid,elem_len,left); |
| 8406 | return NULL; |
| 8407 | } |
| 8408 | if (elem_id == eid) |
| 8409 | { |
| 8410 | return ptr; |
| 8411 | } |
| 8412 | |
| 8413 | left -= elem_len; |
| 8414 | ptr += (elem_len + 2); |
| 8415 | } |
| 8416 | return NULL; |
| 8417 | } |
| 8418 | |
| 8419 | |
| 8420 | void limParseBeaconForTim(tpAniSirGlobal pMac,tANI_U8* pRxPacketInfo, tpPESession psessionEntry) |
| 8421 | { |
| 8422 | |
| 8423 | tANI_U32 nPayload; |
| 8424 | tANI_U8 *pPayload; |
| 8425 | tANI_U8 *ieptr; |
| 8426 | tSirMacTim *tim; |
| 8427 | |
| 8428 | pPayload = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 8429 | nPayload = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 8430 | |
| 8431 | if (nPayload < (SIR_MAC_B_PR_SSID_OFFSET + SIR_MAC_MIN_IE_LEN)) |
| 8432 | { |
| 8433 | limLog(pMac, LOGE, FL("Beacon length too short to parse")); |
| 8434 | return; |
| 8435 | } |
| 8436 | |
| 8437 | if (NULL != |
| 8438 | (ieptr = limGetIePtr((pPayload + SIR_MAC_B_PR_SSID_OFFSET), |
| 8439 | nPayload, SIR_MAC_TIM_EID))) |
| 8440 | { |
| 8441 | /* Ignore EID and Length field*/ |
| 8442 | tim = (tSirMacTim *)(ieptr + 2); |
| 8443 | |
| 8444 | vos_mem_copy(( tANI_U8* )&psessionEntry->lastBeaconTimeStamp, |
| 8445 | ( tANI_U8* )pPayload, sizeof(tANI_U64)); |
| 8446 | if (tim->dtimCount >= MAX_DTIM_COUNT) |
| 8447 | tim->dtimCount = DTIM_COUNT_DEFAULT; |
| 8448 | if (tim->dtimPeriod >= MAX_DTIM_PERIOD) |
| 8449 | tim->dtimPeriod = DTIM_PERIOD_DEFAULT; |
| 8450 | psessionEntry->lastBeaconDtimCount = tim->dtimCount; |
| 8451 | psessionEntry->lastBeaconDtimPeriod = tim->dtimPeriod; |
| 8452 | psessionEntry->currentBssBeaconCnt++; |
| 8453 | |
| 8454 | limLog(pMac, LOG1, |
| 8455 | FL("currentBssBeaconCnt %d lastBeaconDtimCount %d lastBeaconDtimPeriod %d"), |
| 8456 | psessionEntry->currentBssBeaconCnt, psessionEntry->lastBeaconDtimCount, |
| 8457 | psessionEntry->lastBeaconDtimPeriod); |
| 8458 | |
| 8459 | } |
| 8460 | return; |
| 8461 | } |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 8462 | |
| 8463 | void limUpdateMaxRateFlag(tpAniSirGlobal pMac, |
| 8464 | tANI_U8 smeSessionId, |
| 8465 | tANI_U32 maxRateFlag) |
| 8466 | { |
| 8467 | tpSirSmeUpdateMaxRateParams pRsp; |
| 8468 | tSirMsgQ msg; |
| 8469 | |
| 8470 | pRsp = vos_mem_malloc(sizeof(tSirSmeUpdateMaxRateParams)); |
| 8471 | if (NULL == pRsp) |
| 8472 | { |
| 8473 | limLog(pMac, LOGP, FL("Memory allocation failed")); |
| 8474 | return; |
| 8475 | } |
| 8476 | vos_mem_set((tANI_U8*)pRsp, sizeof(tSirSmeUpdateMaxRateParams), 0); |
| 8477 | pRsp->maxRateFlag = maxRateFlag; |
| 8478 | pRsp->smeSessionId = smeSessionId; |
| 8479 | msg.type = eWNI_SME_UPDATE_MAX_RATE_IND; |
| 8480 | msg.bodyptr = pRsp; |
| 8481 | msg.bodyval = 0; |
| 8482 | limSysProcessMmhMsgApi(pMac, &msg, ePROT); |
| 8483 | return; |
| 8484 | } |
Abhishek Singh | 5d76571 | 2015-03-12 14:04:16 +0530 | [diff] [blame] | 8485 | |
| 8486 | void limDecrementPendingMgmtCount (tpAniSirGlobal pMac) |
| 8487 | { |
| 8488 | if( pMac->sys.gSysBbtPendingMgmtCount ) |
| 8489 | { |
| 8490 | vos_spin_lock_acquire( &pMac->sys.lock ); |
| 8491 | pMac->sys.gSysBbtPendingMgmtCount--; |
| 8492 | vos_spin_lock_release( &pMac->sys.lock ); |
| 8493 | } |
| 8494 | else |
| 8495 | limLog(pMac, LOGW, FL("Pending Management count going negative")); |
| 8496 | } |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 8497 | |
| 8498 | eHalStatus limTxBdComplete(tpAniSirGlobal pMac, void *pData) |
| 8499 | { |
| 8500 | tpSirTxBdStatus pTxBdStatus; |
| 8501 | |
| 8502 | if (!pData) |
| 8503 | { |
| 8504 | limLog(pMac, LOGE, FL("pData is NULL")); |
| 8505 | return eHAL_STATUS_FAILURE; |
| 8506 | } |
| 8507 | |
| 8508 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 8509 | |
| 8510 | limLog(pMac, LOG1, FL("txBdToken %u, txBdStatus %u"), |
| 8511 | pTxBdStatus->txBdToken, pTxBdStatus->txCompleteStatus); |
| 8512 | return eHAL_STATUS_SUCCESS; |
| 8513 | } |
Abhishek Singh | 09d4e4a | 2016-01-12 11:20:22 +0530 | [diff] [blame] | 8514 | |
| 8515 | /** |
| 8516 | * lim_is_robust_mgmt_action_frame() - Check if action catagory is |
| 8517 | * robust action frame |
| 8518 | * @action_catagory: Action frame catagory. |
| 8519 | * |
| 8520 | * This function is used to check if given action catagory is robust |
| 8521 | * action frame. |
| 8522 | * |
| 8523 | * Return: bool |
| 8524 | */ |
| 8525 | bool lim_is_robust_mgmt_action_frame(uint8 action_catagory) |
| 8526 | { |
| 8527 | switch (action_catagory) { |
| 8528 | /* |
| 8529 | * NOTE: This function doesn't take care of the DMG |
| 8530 | * (Directional Multi-Gigatbit) BSS case as 8011ad |
| 8531 | * support is not yet added. In future, if the support |
| 8532 | * is required then this function need few more arguments |
| 8533 | * and little change in logic. |
| 8534 | */ |
| 8535 | case SIR_MAC_ACTION_SPECTRUM_MGMT: |
| 8536 | case SIR_MAC_ACTION_QOS_MGMT: |
| 8537 | case SIR_MAC_ACTION_DLP: |
| 8538 | case SIR_MAC_ACTION_BLKACK: |
| 8539 | case SIR_MAC_ACTION_RRM: |
| 8540 | case SIR_MAC_ACTION_FAST_BSS_TRNST: |
| 8541 | case SIR_MAC_ACTION_SA_QUERY: |
| 8542 | case SIR_MAC_ACTION_PROT_DUAL_PUB: |
| 8543 | case SIR_MAC_ACTION_WNM: |
| 8544 | case SIR_MAC_ACITON_MESH: |
| 8545 | case SIR_MAC_ACTION_MHF: |
| 8546 | case SIR_MAC_ACTION_FST: |
| 8547 | return true; |
| 8548 | default: |
| 8549 | VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 8550 | FL("non-PMF action category[%d] "), |
| 8551 | action_catagory); |
| 8552 | break; |
| 8553 | } |
| 8554 | return false; |
| 8555 | } |
Gupta, Kapil | 6f49bd7 | 2016-03-22 16:41:14 +0530 | [diff] [blame] | 8556 | |
| 8557 | /** |
| 8558 | * lim_is_ext_cap_ie_present - checks if ext ie is present |
| 8559 | * @ext_cap: extended IEs structure |
| 8560 | * |
| 8561 | * Return: true if ext IEs are present else false |
| 8562 | */ |
| 8563 | bool lim_is_ext_cap_ie_present (tDot11fIEExtCap *ext_cap) |
| 8564 | { |
| 8565 | int i, size; |
| 8566 | uint8_t *tmp_buf; |
| 8567 | |
| 8568 | tmp_buf = (uint8_t *) ext_cap; |
| 8569 | size = sizeof(*ext_cap); |
| 8570 | |
| 8571 | for (i = 0; i < size; i++) |
| 8572 | if (tmp_buf[i]) |
| 8573 | return true; |
| 8574 | |
| 8575 | return false; |
| 8576 | } |
Selvaraj, Sridhar | 5f14919 | 2016-04-15 12:53:28 +0530 | [diff] [blame^] | 8577 | |
| 8578 | /** |
| 8579 | * lim_update_caps_info_for_bss - Update capability info for this BSS |
| 8580 | * |
| 8581 | * @mac_ctx: mac context |
| 8582 | * @caps: Pointer to capability info to be updated |
| 8583 | * @bss_caps: Capability info of the BSS |
| 8584 | * |
| 8585 | * Update the capability info in Assoc/Reassoc request frames and reset |
| 8586 | * the spectrum management, short preamble, immediate block ack bits |
| 8587 | * if the BSS doesnot support it |
| 8588 | * |
| 8589 | * Return: None |
| 8590 | */ |
| 8591 | void lim_update_caps_info_for_bss(tpAniSirGlobal mac_ctx, |
| 8592 | uint16_t *caps, uint16_t bss_caps) |
| 8593 | { |
| 8594 | if (!(bss_caps & LIM_SPECTRUM_MANAGEMENT_BIT_MASK)) { |
| 8595 | *caps &= (~LIM_SPECTRUM_MANAGEMENT_BIT_MASK); |
| 8596 | limLog(mac_ctx, LOG1, FL("Clearing spectrum management:no AP support")); |
| 8597 | } |
| 8598 | |
| 8599 | if (!(bss_caps & LIM_SHORT_PREAMBLE_BIT_MASK)) { |
| 8600 | *caps &= (~LIM_SHORT_PREAMBLE_BIT_MASK); |
| 8601 | limLog(mac_ctx, LOG1, FL("Clearing short preamble:no AP support")); |
| 8602 | } |
| 8603 | |
| 8604 | if (!(bss_caps & LIM_IMMEDIATE_BLOCK_ACK_MASK)) { |
| 8605 | *caps &= (~LIM_IMMEDIATE_BLOCK_ACK_MASK); |
| 8606 | limLog(mac_ctx, LOG1, FL("Clearing Immed Blk Ack:no AP support")); |
| 8607 | } |
| 8608 | } |