Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /* |
| 43 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 44 | * This file limUtils.cc contains the utility functions |
| 45 | * LIM uses. |
| 46 | * Author: Chandra Modumudi |
| 47 | * Date: 02/13/02 |
| 48 | * History:- |
| 49 | * Date Modified by Modification Information |
| 50 | * -------------------------------------------------------------------- |
| 51 | */ |
| 52 | |
| 53 | #include "schApi.h" |
| 54 | #include "limUtils.h" |
| 55 | #include "limTypes.h" |
| 56 | #include "limSecurityUtils.h" |
| 57 | #include "limPropExtsUtils.h" |
| 58 | #include "limSendMessages.h" |
| 59 | #include "limSerDesUtils.h" |
| 60 | #include "limAdmitControl.h" |
| 61 | #include "limStaHashApi.h" |
| 62 | #include "dot11f.h" |
| 63 | #include "wmmApsd.h" |
| 64 | #include "limTrace.h" |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 65 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 66 | #include "vos_diag_core_event.h" |
| 67 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 68 | #include "limIbssPeerMgmt.h" |
| 69 | #include "limSessionUtils.h" |
| 70 | #include "limSession.h" |
| 71 | #include "vos_nvitem.h" |
| 72 | |
| 73 | /* Static global used to mark situations where pMac->lim.gLimTriggerBackgroundScanDuringQuietBss is SET |
| 74 | * and limTriggerBackgroundScanDuringQuietBss() returned failure. In this case, we will stop data |
| 75 | * traffic instead of going into scan. The recover function limProcessQuietBssTimeout() needs to have |
| 76 | * this information. */ |
| 77 | static tAniBool glimTriggerBackgroundScanDuringQuietBss_Status = eSIR_TRUE; |
| 78 | |
| 79 | /* 11A Channel list to decode RX BD channel information */ |
| 80 | static const tANI_U8 abChannel[]= {36,40,44,48,52,56,60,64,100,104,108,112,116, |
| 81 | 120,124,128,132,136,140,149,153,157,161,165}; |
| 82 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 83 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 84 | static const tANI_U8 aUnsortedChannelList[]= {52,56,60,64,100,104,108,112,116, |
| 85 | 120,124,128,132,136,140,36,40,44,48,149,153,157,161,165}; |
| 86 | #endif |
| 87 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | //#define LIM_MAX_ACTIVE_SESSIONS 3 //defined temporarily for BT-AMP SUPPORT |
| 89 | #define SUCCESS 1 //defined temporarily for BT-AMP |
| 90 | |
| 91 | /** ------------------------------------------------------------- |
| 92 | \fn limAssignDialogueToken |
| 93 | \brief Assigns dialogue token. |
| 94 | \param tpAniSirGlobal pMac |
| 95 | \return tpDialogueToken - dialogueToken data structure. |
| 96 | -------------------------------------------------------------*/ |
| 97 | |
| 98 | tpDialogueToken |
| 99 | limAssignDialogueToken(tpAniSirGlobal pMac) |
| 100 | { |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 101 | static tANI_U8 token; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | tpDialogueToken pCurrNode; |
| 103 | if(eHAL_STATUS_SUCCESS != |
| 104 | palAllocateMemory(pMac->hHdd, (void **) &pCurrNode, sizeof(tDialogueToken))) |
| 105 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 106 | PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | return NULL; |
| 108 | } |
| 109 | |
| 110 | palZeroMemory(pMac->hHdd, (void *) pCurrNode, sizeof(tDialogueToken)); |
| 111 | //first node in the list is being added. |
| 112 | if(NULL == pMac->lim.pDialogueTokenHead) |
| 113 | { |
| 114 | pMac->lim.pDialogueTokenHead = pMac->lim.pDialogueTokenTail = pCurrNode; |
| 115 | } |
| 116 | else |
| 117 | { |
| 118 | pMac->lim.pDialogueTokenTail->next = pCurrNode; |
| 119 | pMac->lim.pDialogueTokenTail = pCurrNode; |
| 120 | } |
| 121 | //assocId and tid of the node will be filled in by caller. |
| 122 | pCurrNode->next = NULL; |
| 123 | pCurrNode->token = token++; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 124 | PELOG4(limLog(pMac, LOG4, FL("token assigned = %d"), token);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 125 | return pCurrNode; |
| 126 | } |
| 127 | |
| 128 | /** ------------------------------------------------------------- |
| 129 | \fn limSearchAndDeleteDialogueToken |
| 130 | \brief search dialogue token in the list and deletes it if found. returns failure if not found. |
| 131 | \param tpAniSirGlobal pMac |
| 132 | \param tANI_U8 token |
| 133 | \param tANI_U16 assocId |
| 134 | \param tANI_U16 tid |
| 135 | \return eSirRetStatus - status of the search |
| 136 | -------------------------------------------------------------*/ |
| 137 | |
| 138 | |
| 139 | tSirRetStatus |
| 140 | limSearchAndDeleteDialogueToken(tpAniSirGlobal pMac, tANI_U8 token, tANI_U16 assocId, tANI_U16 tid) |
| 141 | { |
| 142 | tpDialogueToken pCurrNode = pMac->lim.pDialogueTokenHead; |
| 143 | tpDialogueToken pPrevNode = pMac->lim.pDialogueTokenHead; |
| 144 | |
| 145 | //if the list is empty |
| 146 | if(NULL == pCurrNode) |
| 147 | return eSIR_FAILURE; |
| 148 | |
| 149 | // if the matching node is the first node. |
| 150 | if(pCurrNode && |
| 151 | (assocId == pCurrNode->assocId) && |
| 152 | (tid == pCurrNode->tid)) |
| 153 | { |
| 154 | pMac->lim.pDialogueTokenHead = pCurrNode->next; |
| 155 | //there was only one node in the list. So tail pointer also needs to be adjusted. |
| 156 | if(NULL == pMac->lim.pDialogueTokenHead) |
| 157 | pMac->lim.pDialogueTokenTail = NULL; |
| 158 | palFreeMemory(pMac->hHdd, (void *) pCurrNode); |
| 159 | return eSIR_SUCCESS; |
| 160 | } |
| 161 | |
| 162 | //first node did not match. so move to the next one. |
| 163 | pCurrNode = pCurrNode->next; |
| 164 | while(NULL != pCurrNode ) |
| 165 | { |
| 166 | if(token == pCurrNode->token) |
| 167 | { |
| 168 | break; |
| 169 | } |
| 170 | |
| 171 | pPrevNode = pCurrNode; |
| 172 | pCurrNode = pCurrNode->next; |
| 173 | } |
| 174 | |
| 175 | if(pCurrNode && |
| 176 | (assocId == pCurrNode->assocId) && |
| 177 | (tid == pCurrNode->tid)) |
| 178 | { |
| 179 | pPrevNode->next = pCurrNode->next; |
| 180 | //if the node being deleted is the last one then we also need to move the tail pointer to the prevNode. |
| 181 | if(NULL == pCurrNode->next) |
| 182 | pMac->lim.pDialogueTokenTail = pPrevNode; |
| 183 | return eSIR_SUCCESS; |
| 184 | } |
| 185 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 186 | PELOGW(limLog(pMac, LOGW, FL("LIM does not have matching dialogue token node"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | return eSIR_FAILURE; |
| 188 | |
| 189 | } |
| 190 | |
| 191 | |
| 192 | /** ------------------------------------------------------------- |
| 193 | \fn limDeleteDialogueTokenList |
| 194 | \brief deletes the complete lim dialogue token linked list. |
| 195 | \param tpAniSirGlobal pMac |
| 196 | \return None |
| 197 | -------------------------------------------------------------*/ |
| 198 | void |
| 199 | limDeleteDialogueTokenList(tpAniSirGlobal pMac) |
| 200 | { |
| 201 | tpDialogueToken pCurrNode = pMac->lim.pDialogueTokenHead; |
| 202 | |
| 203 | while(NULL != pMac->lim.pDialogueTokenHead) |
| 204 | { |
| 205 | pCurrNode = pMac->lim.pDialogueTokenHead; |
| 206 | pMac->lim.pDialogueTokenHead = pMac->lim.pDialogueTokenHead->next; |
| 207 | palFreeMemory(pMac->hHdd, (void *) pCurrNode); |
| 208 | pCurrNode = NULL; |
| 209 | } |
| 210 | pMac->lim.pDialogueTokenTail = NULL; |
| 211 | } |
| 212 | |
| 213 | void |
| 214 | limGetBssidFromBD(tpAniSirGlobal pMac, tANI_U8 * pRxPacketInfo, tANI_U8 *bssId, tANI_U32 *pIgnore) |
| 215 | { |
| 216 | tpSirMacDataHdr3a pMh = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo); |
| 217 | *pIgnore = 0; |
| 218 | |
| 219 | if (pMh->fc.toDS == 1 && pMh->fc.fromDS == 0) |
| 220 | { |
| 221 | palCopyMemory( pMac->hHdd, bssId, pMh->addr1, 6); |
| 222 | *pIgnore = 1; |
| 223 | } |
| 224 | else if (pMh->fc.toDS == 0 && pMh->fc.fromDS == 1) |
| 225 | { |
| 226 | palCopyMemory( pMac->hHdd, bssId, pMh->addr2, 6); |
| 227 | *pIgnore = 1; |
| 228 | } |
| 229 | else if (pMh->fc.toDS == 0 && pMh->fc.fromDS == 0) |
| 230 | { |
| 231 | palCopyMemory( pMac->hHdd, bssId, pMh->addr3, 6); |
| 232 | *pIgnore = 0; |
| 233 | } |
| 234 | else |
| 235 | { |
| 236 | palCopyMemory( pMac->hHdd, bssId, pMh->addr1, 6); |
| 237 | *pIgnore = 1; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | char * |
| 242 | limMlmStateStr(tLimMlmStates state) |
| 243 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 244 | switch (state) |
| 245 | { |
| 246 | case eLIM_MLM_OFFLINE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 247 | return "eLIM_MLM_OFFLINE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 248 | case eLIM_MLM_IDLE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 249 | return "eLIM_MLM_IDLE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 250 | case eLIM_MLM_WT_PROBE_RESP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 251 | return "eLIM_MLM_WT_PROBE_RESP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 252 | case eLIM_MLM_PASSIVE_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 253 | return "eLIM_MLM_PASSIVE_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 254 | case eLIM_MLM_WT_JOIN_BEACON_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 255 | return "eLIM_MLM_WT_JOIN_BEACON_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | case eLIM_MLM_JOINED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 257 | return "eLIM_MLM_JOINED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 258 | case eLIM_MLM_BSS_STARTED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 259 | return "eLIM_MLM_BSS_STARTED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 260 | case eLIM_MLM_WT_AUTH_FRAME2_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 261 | return "eLIM_MLM_WT_AUTH_FRAME2_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 262 | case eLIM_MLM_WT_AUTH_FRAME3_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 263 | return "eLIM_MLM_WT_AUTH_FRAME3_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 264 | case eLIM_MLM_WT_AUTH_FRAME4_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 265 | return "eLIM_MLM_WT_AUTH_FRAME4_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | case eLIM_MLM_AUTH_RSP_TIMEOUT_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 267 | return "eLIM_MLM_AUTH_RSP_TIMEOUT_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 268 | case eLIM_MLM_AUTHENTICATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 269 | return "eLIM_MLM_AUTHENTICATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | case eLIM_MLM_WT_ASSOC_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 271 | return "eLIM_MLM_WT_ASSOC_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | case eLIM_MLM_WT_REASSOC_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 273 | return "eLIM_MLM_WT_REASSOC_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 274 | case eLIM_MLM_WT_FT_REASSOC_RSP_STATE: |
| 275 | return "eLIM_MLM_WT_FT_REASSOC_RSP_STATE"; |
| 276 | case eLIM_MLM_WT_DEL_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 277 | return "eLIM_MLM_WT_DEL_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | case eLIM_MLM_WT_DEL_BSS_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 279 | return "eLIM_MLM_WT_DEL_BSS_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | case eLIM_MLM_WT_ADD_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 281 | return "eLIM_MLM_WT_ADD_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | case eLIM_MLM_WT_ADD_BSS_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 283 | return "eLIM_MLM_WT_ADD_BSS_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | case eLIM_MLM_REASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 285 | return "eLIM_MLM_REASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 286 | case eLIM_MLM_LINK_ESTABLISHED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 287 | return "eLIM_MLM_LINK_ESTABLISHED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 288 | case eLIM_MLM_WT_ASSOC_CNF_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 289 | return "eLIM_MLM_WT_ASSOC_CNF_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | case eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 291 | return "eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | case eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 293 | return "eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | case eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE: |
| 295 | return "eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE"; |
| 296 | case eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 297 | return "eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 298 | case eLIM_MLM_WT_SET_BSS_KEY_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 299 | return "eLIM_MLM_WT_SET_BSS_KEY_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | case eLIM_MLM_WT_SET_STA_KEY_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 301 | return "eLIM_MLM_WT_SET_STA_KEY_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 302 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 303 | return "INVALID MLM state"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 304 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | void |
| 308 | limPrintMlmState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimMlmStates state) |
| 309 | { |
| 310 | limLog(pMac, logLevel, limMlmStateStr(state)); |
| 311 | } |
| 312 | |
| 313 | char * |
| 314 | limSmeStateStr(tLimSmeStates state) |
| 315 | { |
| 316 | #ifdef FIXME_GEN6 |
| 317 | switch (state) |
| 318 | { |
| 319 | case eLIM_SME_OFFLINE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 320 | return "eLIM_SME_OFFLINE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 321 | case eLIM_SME_IDLE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 322 | return "eLIM_SME_IDLE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | case eLIM_SME_SUSPEND_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 324 | return "eLIM_SME_SUSPEND_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 325 | case eLIM_SME_WT_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 326 | return "eLIM_SME_WT_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 327 | case eLIM_SME_WT_JOIN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 328 | return "eLIM_SME_WT_JOIN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | case eLIM_SME_WT_AUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 330 | return "eLIM_SME_WT_AUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 331 | case eLIM_SME_WT_ASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 332 | return "eLIM_SME_WT_ASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 333 | case eLIM_SME_WT_REASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 334 | return "eLIM_SME_WT_REASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 335 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 336 | return "eLIM_SME_WT_REASSOC_LINK_FAIL_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 337 | case eLIM_SME_JOIN_FAILURE_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 338 | return "eLIM_SME_JOIN_FAILURE_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 339 | case eLIM_SME_ASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 340 | return "eLIM_SME_ASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 341 | case eLIM_SME_REASSOCIATED_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 342 | return "eLIM_SME_REASSOCIATED_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 343 | case eLIM_SME_LINK_EST_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 344 | return "eLIM_SME_LINK_EST_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | case eLIM_SME_LINK_EST_WT_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 346 | return "eLIM_SME_LINK_EST_WT_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 347 | case eLIM_SME_WT_PRE_AUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 348 | return "eLIM_SME_WT_PRE_AUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | case eLIM_SME_WT_DISASSOC_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 350 | return "eLIM_SME_WT_DISASSOC_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 351 | case eLIM_SME_WT_DEAUTH_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 352 | return "eLIM_SME_WT_DEAUTH_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | case eLIM_SME_WT_START_BSS_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 354 | return "eLIM_SME_WT_START_BSS_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | case eLIM_SME_WT_STOP_BSS_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 356 | return "eLIM_SME_WT_STOP_BSS_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | case eLIM_SME_NORMAL_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 358 | return "eLIM_SME_NORMAL_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | case eLIM_SME_CHANNEL_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 360 | return "eLIM_SME_CHANNEL_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 361 | case eLIM_SME_NORMAL_CHANNEL_SCAN_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 362 | return "eLIM_SME_NORMAL_CHANNEL_SCAN_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 363 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 364 | return "INVALID SME state"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | } |
| 366 | #endif |
| 367 | return ""; |
| 368 | } |
| 369 | |
| 370 | |
| 371 | char* limDot11ModeStr(tpAniSirGlobal pMac, tANI_U8 dot11Mode) |
| 372 | { |
| 373 | #ifdef FIXME_GEN6 |
| 374 | |
| 375 | switch(dot11Mode) |
| 376 | { |
| 377 | case WNI_CFG_DOT11_MODE_ALL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 378 | return "ALL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | case WNI_CFG_DOT11_MODE_11A: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 380 | return "11A"; |
| 381 | case WNI_CFG_DOT11_MODE_11B: |
| 382 | return "11B"; |
| 383 | case WNI_CFG_DOT11_MODE_11G: |
| 384 | return "11G"; |
| 385 | case WNI_CFG_DOT11_MODE_11N: |
| 386 | return "11N"; |
| 387 | case WNI_CFG_DOT11_MODE_POLARIS: |
| 388 | return "Polaris"; |
| 389 | case WNI_CFG_DOT11_MODE_TITAN: |
| 390 | return "Titan"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | case WNI_CFG_DOT11_MODE_TAURUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 392 | return "Taurus"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 393 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 394 | return "Invalid Dot11 Mode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 395 | } |
| 396 | #endif |
| 397 | return ""; |
| 398 | } |
| 399 | |
| 400 | |
| 401 | char* limStaOpRateModeStr(tStaRateMode opRateMode) |
| 402 | { |
| 403 | #ifdef FIXME_GEN6 |
| 404 | |
| 405 | switch(opRateMode) |
| 406 | { |
| 407 | case eSTA_TAURUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 408 | return "Taurus"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | case eSTA_11a: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 410 | return "11A"; |
| 411 | case eSTA_11b: |
| 412 | return "11B"; |
| 413 | case eSTA_11bg: |
| 414 | return "11G"; |
| 415 | case eSTA_11n: |
| 416 | return "11N"; |
| 417 | case eSTA_POLARIS: |
| 418 | return "Polaris"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 419 | case eSTA_TITAN: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 420 | return "Titan"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 421 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 422 | return "Invalid Dot11 Mode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 423 | } |
| 424 | #endif |
| 425 | return ""; |
| 426 | } |
| 427 | |
| 428 | char* limBssTypeStr(tSirBssType bssType) |
| 429 | { |
| 430 | switch(bssType) |
| 431 | { |
| 432 | case eSIR_INFRASTRUCTURE_MODE: |
| 433 | return "eSIR_INFRASTRUCTURE_MODE"; |
| 434 | case eSIR_IBSS_MODE: |
| 435 | return "eSIR_IBSS_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 436 | case eSIR_BTAMP_STA_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 437 | return "eSIR_BTAMP_STA_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 438 | case eSIR_BTAMP_AP_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | return "eSIR_BTAMP_AP_MODE"; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 440 | case eSIR_AUTO_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 441 | return "eSIR_AUTO_MODE"; |
| 442 | default: |
| 443 | return "Invalid BSS Type"; |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | void |
| 448 | limPrintSmeState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimSmeStates state) |
| 449 | { |
| 450 | limLog(pMac, logLevel, limSmeStateStr(state)); |
| 451 | } |
| 452 | |
| 453 | char *limMsgStr(tANI_U32 msgType) |
| 454 | { |
| 455 | #ifdef FIXME_GEN6 |
| 456 | switch (msgType) |
| 457 | { |
| 458 | case eWNI_SME_START_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 459 | return "eWNI_SME_START_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 460 | case eWNI_SME_START_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 461 | return "eWNI_SME_START_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 462 | case eWNI_SME_SYS_READY_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 463 | return "eWNI_SME_SYS_READY_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 464 | case eWNI_SME_SCAN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 465 | return "eWNI_SME_SCAN_REQ"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 466 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 467 | case eWNI_SME_OEM_DATA_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 468 | return "eWNI_SME_OEM_DATA_REQ"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 469 | case eWNI_SME_OEM_DATA_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 470 | return "eWNI_SME_OEM_DATA_RSP"; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 471 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 472 | case eWNI_SME_SCAN_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 473 | return "eWNI_SME_SCAN_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 474 | case eWNI_SME_JOIN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 475 | return "eWNI_SME_JOIN_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 476 | case eWNI_SME_JOIN_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 477 | return "eWNI_SME_JOIN_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 478 | case eWNI_SME_SETCONTEXT_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 479 | return "eWNI_SME_SETCONTEXT_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 480 | case eWNI_SME_SETCONTEXT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 481 | return "eWNI_SME_SETCONTEXT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | case eWNI_SME_REASSOC_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 483 | return "eWNI_SME_REASSOC_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | case eWNI_SME_REASSOC_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 485 | return "eWNI_SME_REASSOC_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | case eWNI_SME_AUTH_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 487 | return "eWNI_SME_AUTH_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 488 | case eWNI_SME_AUTH_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 489 | return "eWNI_SME_AUTH_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 490 | case eWNI_SME_DISASSOC_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 491 | return "eWNI_SME_DISASSOC_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 492 | case eWNI_SME_DISASSOC_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 493 | return "eWNI_SME_DISASSOC_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 494 | case eWNI_SME_DISASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 495 | return "eWNI_SME_DISASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 496 | case eWNI_SME_DISASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 497 | return "eWNI_SME_DISASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 498 | case eWNI_SME_DEAUTH_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 499 | return "eWNI_SME_DEAUTH_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 500 | case eWNI_SME_DEAUTH_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 501 | return "eWNI_SME_DEAUTH_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | case eWNI_SME_DEAUTH_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 503 | return "eWNI_SME_DEAUTH_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | case eWNI_SME_WM_STATUS_CHANGE_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 505 | return "eWNI_SME_WM_STATUS_CHANGE_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | case eWNI_SME_START_BSS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 507 | return "eWNI_SME_START_BSS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 508 | case eWNI_SME_START_BSS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 509 | return "eWNI_SME_START_BSS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | case eWNI_SME_AUTH_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 511 | return "eWNI_SME_AUTH_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 512 | case eWNI_SME_ASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 513 | return "eWNI_SME_ASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 514 | case eWNI_SME_ASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 515 | return "eWNI_SME_ASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 516 | case eWNI_SME_REASSOC_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 517 | return "eWNI_SME_REASSOC_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 518 | case eWNI_SME_REASSOC_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 519 | return "eWNI_SME_REASSOC_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 520 | case eWNI_SME_SWITCH_CHL_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 521 | return "eWNI_SME_SWITCH_CHL_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | case eWNI_SME_SWITCH_CHL_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 523 | return "eWNI_SME_SWITCH_CHL_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 525 | return "eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 527 | return "eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 528 | case eWNI_SME_STOP_BSS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 529 | return "eWNI_SME_STOP_BSS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | case eWNI_SME_STOP_BSS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 531 | return "eWNI_SME_STOP_BSS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 532 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 533 | return "eWNI_SME_PROMISCUOUS_MODE_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 534 | case eWNI_SME_PROMISCUOUS_MODE_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 535 | return "eWNI_SME_PROMISCUOUS_MODE_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | case eWNI_SME_NEIGHBOR_BSS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 537 | return "eWNI_SME_NEIGHBOR_BSS_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 538 | case eWNI_SME_MEASUREMENT_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 539 | return "eWNI_SME_MEASUREMENT_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 540 | case eWNI_SME_MEASUREMENT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 541 | return "eWNI_SME_MEASUREMENT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 542 | case eWNI_SME_MEASUREMENT_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 543 | return "eWNI_SME_MEASUREMENT_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 544 | case eWNI_SME_SET_WDS_INFO_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 545 | return "eWNI_SME_SET_WDS_INFO_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | case eWNI_SME_SET_WDS_INFO_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 547 | return "eWNI_SME_SET_WDS_INFO_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | case eWNI_SME_WDS_INFO_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 549 | return "eWNI_SME_WDS_INFO_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 550 | case eWNI_SME_DEAUTH_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 551 | return "eWNI_SME_DEAUTH_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 552 | case eWNI_SME_MIC_FAILURE_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 553 | return "eWNI_SME_MIC_FAILURE_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 554 | case eWNI_SME_ADDTS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 555 | return "eWNI_SME_ADDTS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 556 | case eWNI_SME_ADDTS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 557 | return "eWNI_SME_ADDTS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 558 | case eWNI_SME_ADDTS_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 559 | return "eWNI_SME_ADDTS_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | case eWNI_SME_ADDTS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 561 | return "eWNI_SME_ADDTS_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 562 | case eWNI_SME_DELTS_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 563 | return "eWNI_SME_DELTS_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 564 | case eWNI_SME_DELTS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 565 | return "eWNI_SME_DELTS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 566 | case eWNI_SME_DELTS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 567 | return "eWNI_SME_DELTS_IND"; |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 568 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 569 | case eWNI_SME_GET_ROAM_RSSI_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 570 | return "eWNI_SME_GET_ROAM_RSSI_REQ"; |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 571 | case eWNI_SME_GET_ROAM_RSSI_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 572 | return "eWNI_SME_GET_ROAM_RSSI_RSP"; |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 573 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 575 | case WDA_SUSPEND_ACTIVITY_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 576 | return "WDA_SUSPEND_ACTIVITY_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 577 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 578 | return "SIR_LIM_RETRY_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 579 | case SIR_BB_XPORT_MGMT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 580 | return "SIR_BB_XPORT_MGMT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 581 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 582 | return "SIR_LIM_INV_KEY_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 583 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 584 | return "SIR_LIM_KEY_ID_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 585 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 586 | return "SIR_LIM_REPLAY_THRES_INTERRUPT_MSG"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | case SIR_LIM_MIN_CHANNEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 588 | return "SIR_LIM_MIN_CHANNEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 589 | case SIR_LIM_MAX_CHANNEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 590 | return "SIR_LIM_MAX_CHANNEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 591 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 592 | return "SIR_LIM_JOIN_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 593 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 594 | return "SIR_LIM_AUTH_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 595 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 596 | return "SIR_LIM_AUTH_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 597 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 598 | return "SIR_LIM_ASSOC_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 599 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 600 | return "SIR_LIM_REASSOC_FAIL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 601 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 602 | return "SIR_LIM_HEART_BEAT_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 604 | return "SIR_LIM_ADDTS_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 605 | case SIR_LIM_CHANNEL_SCAN_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 606 | return "SIR_LIM_CHANNEL_SCAN_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 607 | case SIR_LIM_LINK_TEST_DURATION_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 608 | return "SIR_LIM_LINK_TEST_DURATION_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | case SIR_LIM_HASH_MISS_THRES_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 610 | return "SIR_LIM_HASH_MISS_THRES_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | case SIR_LIM_KEEPALIVE_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 612 | return "SIR_LIM_KEEPALIVE_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 613 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 614 | return "SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 615 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 616 | return "SIR_LIM_CNF_WAIT_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 617 | case SIR_LIM_RADAR_DETECT_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 618 | return "SIR_LIM_RADAR_DETECT_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 619 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 620 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 621 | return "SIR_LIM_FT_PREAUTH_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 622 | #endif |
| 623 | |
| 624 | case SIR_HAL_APP_SETUP_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 625 | return "SIR_HAL_APP_SETUP_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | case SIR_HAL_INITIAL_CAL_FAILED_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 627 | return "SIR_HAL_INITIAL_CAL_FAILED_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 628 | case SIR_HAL_NIC_OPER_NTF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 629 | return "SIR_HAL_NIC_OPER_NTF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 630 | case SIR_HAL_INIT_START_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 631 | return "SIR_HAL_INIT_START_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | case SIR_HAL_SHUTDOWN_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 633 | return "SIR_HAL_SHUTDOWN_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | case SIR_HAL_SHUTDOWN_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 635 | return "SIR_HAL_SHUTDOWN_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 636 | case SIR_HAL_RESET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 637 | return "SIR_HAL_RESET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 638 | case SIR_HAL_RESET_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 639 | return "SIR_HAL_RESET_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 640 | case SIR_WRITE_TO_TD: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 641 | return "SIR_WRITE_TO_TD"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 642 | |
| 643 | case WNI_CFG_PARAM_UPDATE_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 644 | return "WNI_CFG_PARAM_UPDATE_IND"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 645 | case WNI_CFG_DNLD_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 646 | return "WNI_CFG_DNLD_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 647 | case WNI_CFG_DNLD_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 648 | return "WNI_CFG_DNLD_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 649 | case WNI_CFG_GET_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 650 | return "WNI_CFG_GET_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 651 | case WNI_CFG_SET_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 652 | return "WNI_CFG_SET_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 653 | case WNI_CFG_GET_ATTRIB_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 654 | return "WNI_CFG_GET_ATTRIB_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 655 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 656 | return "WNI_CFG_ADD_GRP_ADDR_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 657 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 658 | return "WNI_CFG_DEL_GRP_ADDR_CNF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | case ANI_CFG_GET_RADIO_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 660 | return "ANI_CFG_GET_RADIO_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 661 | case ANI_CFG_GET_PER_STA_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 662 | return "ANI_CFG_GET_PER_STA_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | case ANI_CFG_GET_AGG_STA_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 664 | return "ANI_CFG_GET_AGG_STA_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 665 | case ANI_CFG_CLEAR_STAT_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 666 | return "ANI_CFG_CLEAR_STAT_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 667 | case WNI_CFG_DNLD_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 668 | return "WNI_CFG_DNLD_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | case WNI_CFG_GET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 670 | return "WNI_CFG_GET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 671 | case WNI_CFG_SET_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 672 | return "WNI_CFG_SET_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | case WNI_CFG_SET_REQ_NO_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 674 | return "WNI_CFG_SET_REQ_NO_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 675 | case eWNI_PMC_ENTER_IMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 676 | return "eWNI_PMC_ENTER_IMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | case eWNI_PMC_EXIT_IMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 678 | return "eWNI_PMC_EXIT_IMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 679 | case eWNI_PMC_ENTER_BMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 680 | return "eWNI_PMC_ENTER_BMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 681 | case eWNI_PMC_EXIT_BMPS_RSP: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 682 | return "eWNI_PMC_EXIT_BMPS_RSP"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 683 | case eWNI_PMC_EXIT_BMPS_IND: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 684 | return "eWNI_PMC_EXIT_BMPS_IND"; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 685 | case eWNI_SME_SET_BCN_FILTER_REQ: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 686 | return "eWNI_SME_SET_BCN_FILTER_REQ"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 688 | return "INVALID SME message"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 689 | } |
| 690 | #endif |
| 691 | return ""; |
| 692 | } |
| 693 | |
| 694 | |
| 695 | |
| 696 | char *limResultCodeStr(tSirResultCodes resultCode) |
| 697 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 698 | switch (resultCode) |
| 699 | { |
| 700 | case eSIR_SME_SUCCESS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 701 | return "eSIR_SME_SUCCESS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | case eSIR_EOF_SOF_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 703 | return "eSIR_EOF_SOF_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 704 | case eSIR_BMU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 705 | return "eSIR_BMU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 706 | case eSIR_LOW_PDU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 707 | return "eSIR_LOW_PDU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 708 | case eSIR_USER_TRIG_RESET: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 709 | return"eSIR_USER_TRIG_RESET"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | case eSIR_LOGP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 711 | return "eSIR_LOGP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 712 | case eSIR_CP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 713 | return "eSIR_CP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | case eSIR_STOP_BSS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 715 | return "eSIR_STOP_BSS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 716 | case eSIR_AHB_HANG_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 717 | return "eSIR_AHB_HANG_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 718 | case eSIR_DPU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 719 | return "eSIR_DPU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | case eSIR_RXP_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 721 | return "eSIR_RXP_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 722 | case eSIR_MCPU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 723 | return "eSIR_MCPU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 724 | case eSIR_MCU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 725 | return "eSIR_MCU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 726 | case eSIR_MTU_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 727 | return "eSIR_MTU_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | case eSIR_MIF_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 729 | return "eSIR_MIF_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | case eSIR_FW_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 731 | return "eSIR_FW_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | case eSIR_MAILBOX_SANITY_CHK_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 733 | return "eSIR_MAILBOX_SANITY_CHK_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | case eSIR_RADIO_HW_SWITCH_STATUS_IS_OFF: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 735 | return "eSIR_RADIO_HW_SWITCH_STATUS_IS_OFF"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | case eSIR_CFB_FLAG_STUCK_EXCEPTION: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 737 | return "eSIR_CFB_FLAG_STUCK_EXCEPTION"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | case eSIR_SME_BASIC_RATES_NOT_SUPPORTED_STATUS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 739 | return "eSIR_SME_BASIC_RATES_NOT_SUPPORTED_STATUS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | case eSIR_SME_INVALID_PARAMETERS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 741 | return "eSIR_SME_INVALID_PARAMETERS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | case eSIR_SME_UNEXPECTED_REQ_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 743 | return "eSIR_SME_UNEXPECTED_REQ_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 744 | case eSIR_SME_RESOURCES_UNAVAILABLE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 745 | return "eSIR_SME_RESOURCES_UNAVAILABLE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 746 | case eSIR_SME_SCAN_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 747 | return "eSIR_SME_SCAN_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 748 | case eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 749 | return "eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 750 | case eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 751 | return "eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 752 | case eSIR_SME_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 753 | return "eSIR_SME_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | case eSIR_SME_JOIN_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 755 | return "eSIR_SME_JOIN_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 756 | case eSIR_SME_AUTH_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 757 | return "eSIR_SME_AUTH_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 758 | case eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 759 | return "eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 760 | case eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 761 | return "eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 762 | case eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 763 | return "eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | case eSIR_SME_AUTH_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 765 | return "eSIR_SME_AUTH_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | case eSIR_SME_INVALID_WEP_DEFAULT_KEY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 767 | return "eSIR_SME_INVALID_WEP_DEFAULT_KEY"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | case eSIR_SME_ASSOC_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 769 | return "eSIR_SME_ASSOC_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | case eSIR_SME_REASSOC_REFUSED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 771 | return "eSIR_SME_REASSOC_REFUSED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 772 | case eSIR_SME_STA_NOT_AUTHENTICATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 773 | return "eSIR_SME_STA_NOT_AUTHENTICATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | case eSIR_SME_STA_NOT_ASSOCIATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 775 | return "eSIR_SME_STA_NOT_ASSOCIATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | case eSIR_SME_STA_DISASSOCIATED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 777 | return "eSIR_SME_STA_DISASSOCIATED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 778 | case eSIR_SME_ALREADY_JOINED_A_BSS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 779 | return "eSIR_SME_ALREADY_JOINED_A_BSS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 780 | case eSIR_ULA_COMPLETED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 781 | return "eSIR_ULA_COMPLETED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 782 | case eSIR_ULA_FAILURE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 783 | return "eSIR_ULA_FAILURE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 784 | case eSIR_SME_LINK_ESTABLISHED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 785 | return "eSIR_SME_LINK_ESTABLISHED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | case eSIR_SME_UNABLE_TO_PERFORM_MEASUREMENTS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 787 | return "eSIR_SME_UNABLE_TO_PERFORM_MEASUREMENTS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 788 | case eSIR_SME_UNABLE_TO_PERFORM_DFS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 789 | return "eSIR_SME_UNABLE_TO_PERFORM_DFS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 790 | case eSIR_SME_DFS_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 791 | return "eSIR_SME_DFS_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 792 | case eSIR_SME_TRANSFER_STA: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 793 | return "eSIR_SME_TRANSFER_STA"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 794 | case eSIR_SME_INVALID_LINK_TEST_PARAMETERS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 795 | return "eSIR_SME_INVALID_LINK_TEST_PARAMETERS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 796 | case eSIR_SME_LINK_TEST_MAX_EXCEEDED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 797 | return "eSIR_SME_LINK_TEST_MAX_EXCEEDED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 798 | case eSIR_SME_UNSUPPORTED_RATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 799 | return "eSIR_SME_UNSUPPORTED_RATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 800 | case eSIR_SME_LINK_TEST_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 801 | return "eSIR_SME_LINK_TEST_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 802 | case eSIR_SME_LINK_TEST_COMPLETE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 803 | return "eSIR_SME_LINK_TEST_COMPLETE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 804 | case eSIR_SME_LINK_TEST_INVALID_STATE: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 805 | return "eSIR_SME_LINK_TEST_INVALID_STATE"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 806 | case eSIR_SME_LINK_TEST_INVALID_ADDRESS: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 807 | return "eSIR_SME_LINK_TEST_INVALID_ADDRESS"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 808 | case eSIR_SME_POLARIS_RESET: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 809 | return "eSIR_SME_POLARIS_RESET"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 810 | case eSIR_SME_SETCONTEXT_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 811 | return "eSIR_SME_SETCONTEXT_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 812 | case eSIR_SME_BSS_RESTART: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 813 | return "eSIR_SME_BSS_RESTART"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 814 | case eSIR_SME_MORE_SCAN_RESULTS_FOLLOW: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 815 | return "eSIR_SME_MORE_SCAN_RESULTS_FOLLOW"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 816 | case eSIR_SME_INVALID_ASSOC_RSP_RXED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 817 | return "eSIR_SME_INVALID_ASSOC_RSP_RXED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 818 | case eSIR_SME_MIC_COUNTER_MEASURES: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 819 | return "eSIR_SME_MIC_COUNTER_MEASURES"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 820 | case eSIR_SME_ADDTS_RSP_TIMEOUT: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 821 | return "eSIR_SME_ADDTS_RSP_TIMEOUT"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 822 | case eSIR_SME_RECEIVED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 823 | return "eSIR_SME_RECEIVED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 824 | case eSIR_SME_CHANNEL_SWITCH_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 825 | return "eSIR_SME_CHANNEL_SWITCH_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | #ifdef GEN4_SCAN |
| 827 | case eSIR_SME_CHANNEL_SWITCH_DISABLED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 828 | return "eSIR_SME_CHANNEL_SWITCH_DISABLED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 829 | case eSIR_SME_HAL_SCAN_INIT_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 830 | return "eSIR_SME_HAL_SCAN_INIT_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 831 | case eSIR_SME_HAL_SCAN_START_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 832 | return "eSIR_SME_HAL_SCAN_START_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 833 | case eSIR_SME_HAL_SCAN_END_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 834 | return "eSIR_SME_HAL_SCAN_END_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 835 | case eSIR_SME_HAL_SCAN_FINISH_FAILED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 836 | return "eSIR_SME_HAL_SCAN_FINISH_FAILED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 837 | case eSIR_SME_HAL_SEND_MESSAGE_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 838 | return "eSIR_SME_HAL_SEND_MESSAGE_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 839 | #else // GEN4_SCAN |
| 840 | case eSIR_SME_CHANNEL_SWITCH_DISABLED: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 841 | return "eSIR_SME_CHANNEL_SWITCH_DISABLED"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 842 | case eSIR_SME_HAL_SEND_MESSAGE_FAIL: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 843 | return "eSIR_SME_HAL_SEND_MESSAGE_FAIL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | #endif // GEN4_SCAN |
| 845 | |
| 846 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 847 | return "INVALID resultCode"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 848 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 849 | } |
| 850 | |
| 851 | void |
| 852 | limPrintMsgName(tpAniSirGlobal pMac, tANI_U16 logLevel, tANI_U32 msgType) |
| 853 | { |
| 854 | limLog(pMac, logLevel, limMsgStr(msgType)); |
| 855 | } |
| 856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 857 | void |
| 858 | limPrintMsgInfo(tpAniSirGlobal pMac, tANI_U16 logLevel, tSirMsgQ *msg) |
| 859 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 860 | if (logLevel <= pMac->utils.gLogDbgLevel[SIR_LIM_MODULE_ID - LOG_FIRST_MODULE_ID]) |
| 861 | { |
| 862 | switch (msg->type) |
| 863 | { |
| 864 | case SIR_BB_XPORT_MGMT_MSG: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 865 | limPrintMsgName(pMac, logLevel,msg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 866 | break; |
| 867 | default: |
| 868 | limPrintMsgName(pMac, logLevel,msg->type); |
| 869 | break; |
| 870 | } |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | /** |
| 875 | * limInitMlm() |
| 876 | * |
| 877 | *FUNCTION: |
| 878 | * This function is called by limProcessSmeMessages() to |
| 879 | * initialize MLM state machine on STA |
| 880 | * |
| 881 | *PARAMS: |
| 882 | * |
| 883 | *LOGIC: |
| 884 | * |
| 885 | *ASSUMPTIONS: |
| 886 | * NA |
| 887 | * |
| 888 | *NOTE: |
| 889 | * NA |
| 890 | * |
| 891 | * @param pMac Pointer to Global MAC structure |
| 892 | * @return None |
| 893 | */ |
| 894 | void |
| 895 | limInitMlm(tpAniSirGlobal pMac) |
| 896 | { |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 897 | tANI_U32 retVal; |
| 898 | |
| 899 | pMac->lim.gLimTimersCreated = 0; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 900 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 901 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 902 | |
| 903 | /// Initialize scan result hash table |
| 904 | limReInitScanResults(pMac); //sep26th review |
| 905 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 906 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 907 | /// Initialize lfr scan result hash table |
| 908 | // Could there be a problem in multisession with SAP/P2P GO, when in the |
| 909 | // middle of FW bg scan, SAP started; Again that could be a problem even on |
| 910 | // infra + SAP/P2P GO too - TBD |
| 911 | limReInitLfrScanResults(pMac); |
| 912 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 913 | |
| 914 | /// Initialize number of pre-auth contexts |
| 915 | pMac->lim.gLimNumPreAuthContexts = 0; |
| 916 | |
| 917 | /// Initialize MAC based Authentication STA list |
| 918 | limInitPreAuthList(pMac); |
| 919 | |
| 920 | //pMac->lim.gpLimMlmJoinReq = NULL; |
| 921 | |
| 922 | if (pMac->lim.gLimTimersCreated) |
| 923 | return; |
| 924 | |
| 925 | // Create timers used by LIM |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 926 | retVal = limCreateTimers(pMac); |
| 927 | if(retVal == TX_SUCCESS) |
| 928 | { |
| 929 | pMac->lim.gLimTimersCreated = 1; |
| 930 | } |
| 931 | else |
| 932 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 933 | limLog(pMac, LOGP, FL(" limCreateTimers Failed to create lim timers ")); |
Madan Mohan Koyyalamudi | 694f8d7 | 2012-10-11 16:32:55 -0700 | [diff] [blame] | 934 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 935 | } /*** end limInitMlm() ***/ |
| 936 | |
| 937 | |
| 938 | |
| 939 | /** |
| 940 | * limCleanupMlm() |
| 941 | * |
| 942 | *FUNCTION: |
| 943 | * This function is called to cleanup any resources |
| 944 | * allocated by the MLM state machine. |
| 945 | * |
| 946 | *PARAMS: |
| 947 | * |
| 948 | *LOGIC: |
| 949 | * |
| 950 | *ASSUMPTIONS: |
| 951 | * NA |
| 952 | * |
| 953 | *NOTE: |
| 954 | * It is assumed that BSS is already informed that we're leaving it |
| 955 | * before this function is called. |
| 956 | * |
| 957 | * @param pMac Pointer to Global MAC structure |
| 958 | * @param None |
| 959 | * @return None |
| 960 | */ |
| 961 | void |
| 962 | limCleanupMlm(tpAniSirGlobal pMac) |
| 963 | { |
| 964 | tANI_U32 n; |
| 965 | tLimPreAuthNode *pAuthNode; |
| 966 | |
| 967 | if (pMac->lim.gLimTimersCreated == 1) |
| 968 | { |
| 969 | // Deactivate and delete MIN/MAX channel timers. |
| 970 | tx_timer_deactivate(&pMac->lim.limTimers.gLimMinChannelTimer); |
| 971 | tx_timer_delete(&pMac->lim.limTimers.gLimMinChannelTimer); |
| 972 | tx_timer_deactivate(&pMac->lim.limTimers.gLimMaxChannelTimer); |
| 973 | tx_timer_delete(&pMac->lim.limTimers.gLimMaxChannelTimer); |
| 974 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 975 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer); |
| 976 | |
| 977 | |
| 978 | // Deactivate and delete channel switch timer. |
| 979 | tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 980 | tx_timer_delete(&pMac->lim.limTimers.gLimChannelSwitchTimer); |
| 981 | |
| 982 | |
| 983 | // Deactivate and delete addts response timer. |
| 984 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 985 | tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 986 | |
| 987 | // Deactivate and delete Join failure timer. |
| 988 | tx_timer_deactivate(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 989 | tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); |
| 990 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 991 | // Deactivate and delete Periodic Join Probe Request timer. |
| 992 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
| 993 | tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer); |
| 994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 995 | // Deactivate and delete Association failure timer. |
| 996 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 997 | tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer); |
| 998 | |
| 999 | // Deactivate and delete Reassociation failure timer. |
| 1000 | tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer); |
| 1001 | tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer); |
| 1002 | |
| 1003 | // Deactivate and delete Authentication failure timer. |
| 1004 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 1005 | tx_timer_delete(&pMac->lim.limTimers.gLimAuthFailureTimer); |
| 1006 | |
| 1007 | // Deactivate and delete Heartbeat timer. |
| 1008 | tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1009 | tx_timer_delete(&pMac->lim.limTimers.gLimHeartBeatTimer); |
| 1010 | |
| 1011 | // Deactivate and delete wait-for-probe-after-Heartbeat timer. |
| 1012 | tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 1013 | tx_timer_delete(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 1014 | |
| 1015 | // Deactivate and delete Quiet timer. |
| 1016 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer); |
| 1017 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer); |
| 1018 | |
| 1019 | // Deactivate and delete Quiet BSS timer. |
| 1020 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 1021 | tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer); |
| 1022 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1023 | // Deactivate and delete LIM background scan timer. |
| 1024 | tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer); |
| 1025 | tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1026 | |
| 1027 | |
| 1028 | // Deactivate and delete cnf wait timer |
| 1029 | for (n = 0; n < pMac->lim.maxStation; n++) |
| 1030 | { |
| 1031 | tx_timer_deactivate(&pMac->lim.limTimers.gpLimCnfWaitTimer[n]); |
| 1032 | tx_timer_delete(&pMac->lim.limTimers.gpLimCnfWaitTimer[n]); |
| 1033 | } |
| 1034 | |
| 1035 | // Deactivate and delete keepalive timer |
| 1036 | tx_timer_deactivate(&pMac->lim.limTimers.gLimKeepaliveTimer); |
| 1037 | tx_timer_delete(&pMac->lim.limTimers.gLimKeepaliveTimer); |
| 1038 | |
| 1039 | pAuthNode = pMac->lim.gLimPreAuthTimerTable.pTable; |
| 1040 | |
| 1041 | //Deactivate any Authentication response timers |
| 1042 | limDeletePreAuthList(pMac); |
| 1043 | |
| 1044 | for (n = 0; n < pMac->lim.gLimPreAuthTimerTable.numEntry; n++,pAuthNode++) |
| 1045 | { |
| 1046 | // Delete any Authentication response |
| 1047 | // timers, which might have been started. |
| 1048 | tx_timer_delete(&pAuthNode->timer); |
| 1049 | } |
| 1050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1051 | |
| 1052 | |
| 1053 | // Deactivate and delete Hash Miss throttle timer |
| 1054 | tx_timer_deactivate(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer); |
| 1055 | tx_timer_delete(&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer); |
| 1056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1057 | tx_timer_deactivate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 1058 | tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer); |
| 1059 | tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer); |
| 1060 | tx_timer_delete(&pMac->lim.limTimers.gLimPreAuthClnupTimer); |
| 1061 | |
| 1062 | #if 0 // The WPS PBC clean up timer is disabled |
| 1063 | if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) |
| 1064 | { |
| 1065 | if(pMac->lim.limTimers.gLimWPSOverlapTimerObj.isTimerCreated == eANI_BOOLEAN_TRUE) |
| 1066 | { |
| 1067 | tx_timer_deactivate(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer); |
| 1068 | tx_timer_delete(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer); |
| 1069 | pMac->lim.limTimers.gLimWPSOverlapTimerObj.isTimerCreated = eANI_BOOLEAN_FALSE; |
| 1070 | } |
| 1071 | } |
| 1072 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1074 | // Deactivate and delete FT Preauth response timer |
| 1075 | tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer); |
| 1076 | tx_timer_delete(&pMac->lim.limTimers.gLimFTPreAuthRspTimer); |
| 1077 | #endif |
| 1078 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1079 | // Deactivate and delete remain on channel timer |
| 1080 | tx_timer_deactivate(&pMac->lim.limTimers.gLimRemainOnChannelTimer); |
| 1081 | tx_timer_delete(&pMac->lim.limTimers.gLimRemainOnChannelTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1082 | |
| 1083 | #ifdef FEATURE_WLAN_CCX |
| 1084 | // Deactivate and delete TSM |
| 1085 | tx_timer_deactivate(&pMac->lim.limTimers.gLimCcxTsmTimer); |
| 1086 | tx_timer_delete(&pMac->lim.limTimers.gLimCcxTsmTimer); |
| 1087 | #endif |
| 1088 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1089 | tx_timer_deactivate(&pMac->lim.limTimers.gLimDisassocAckTimer); |
| 1090 | tx_timer_delete(&pMac->lim.limTimers.gLimDisassocAckTimer); |
| 1091 | |
| 1092 | tx_timer_deactivate(&pMac->lim.limTimers.gLimDeauthAckTimer); |
| 1093 | tx_timer_delete(&pMac->lim.limTimers.gLimDeauthAckTimer); |
| 1094 | |
Hoonki Lee | f63df0d | 2013-01-16 19:29:14 -0800 | [diff] [blame] | 1095 | tx_timer_deactivate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer); |
| 1096 | tx_timer_delete(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer); |
Hoonki Lee | f63df0d | 2013-01-16 19:29:14 -0800 | [diff] [blame] | 1097 | |
Gopichand Nakkala | 0d6e4ad | 2013-05-17 02:30:25 +0530 | [diff] [blame] | 1098 | tx_timer_deactivate(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
| 1099 | tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer); |
| 1100 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1101 | pMac->lim.gLimTimersCreated = 0; |
| 1102 | } |
| 1103 | |
| 1104 | /// Cleanup cached scan list |
| 1105 | limReInitScanResults(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1106 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1107 | /// Cleanup cached scan list |
| 1108 | limReInitLfrScanResults(pMac); |
| 1109 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1110 | |
| 1111 | } /*** end limCleanupMlm() ***/ |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | /** |
| 1116 | * limCleanupLmm() |
| 1117 | * |
| 1118 | *FUNCTION: |
| 1119 | * This function is called to cleanup any resources |
| 1120 | * allocated by LMM sub-module. |
| 1121 | * |
| 1122 | *PARAMS: |
| 1123 | * |
| 1124 | *LOGIC: |
| 1125 | * |
| 1126 | *ASSUMPTIONS: |
| 1127 | * NA |
| 1128 | * |
| 1129 | *NOTE: |
| 1130 | * NA |
| 1131 | * |
| 1132 | * @param pMac Pointer to Global MAC structure |
| 1133 | * @return None |
| 1134 | */ |
| 1135 | |
| 1136 | void |
| 1137 | limCleanupLmm(tpAniSirGlobal pMac) |
| 1138 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1139 | } /*** end limCleanupLmm() ***/ |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | /** |
| 1144 | * limIsAddrBC() |
| 1145 | * |
| 1146 | *FUNCTION: |
| 1147 | * This function is called in various places within LIM code |
| 1148 | * to determine whether passed MAC address is a broadcast or not |
| 1149 | * |
| 1150 | *LOGIC: |
| 1151 | * |
| 1152 | *ASSUMPTIONS: |
| 1153 | * NA |
| 1154 | * |
| 1155 | *NOTE: |
| 1156 | * NA |
| 1157 | * |
| 1158 | * @param macAddr Indicates MAC address that need to be determined |
| 1159 | * whether it is Broadcast address or not |
| 1160 | * |
| 1161 | * @return true if passed address is Broadcast address else false |
| 1162 | */ |
| 1163 | |
| 1164 | tANI_U8 |
| 1165 | limIsAddrBC(tSirMacAddr macAddr) |
| 1166 | { |
| 1167 | int i; |
| 1168 | for (i = 0; i < 6; i++) |
| 1169 | { |
| 1170 | if ((macAddr[i] & 0xFF) != 0xFF) |
| 1171 | return false; |
| 1172 | } |
| 1173 | |
| 1174 | return true; |
| 1175 | } /****** end limIsAddrBC() ******/ |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | /** |
| 1180 | * limIsGroupAddr() |
| 1181 | * |
| 1182 | *FUNCTION: |
| 1183 | * This function is called in various places within LIM code |
| 1184 | * to determine whether passed MAC address is a group address or not |
| 1185 | * |
| 1186 | *LOGIC: |
| 1187 | * If least significant bit of first octet of the MAC address is |
| 1188 | * set to 1, it is a Group address. |
| 1189 | * |
| 1190 | *ASSUMPTIONS: |
| 1191 | * NA |
| 1192 | * |
| 1193 | *NOTE: |
| 1194 | * NA |
| 1195 | * |
| 1196 | * @param macAddr Indicates MAC address that need to be determined |
| 1197 | * whether it is Group address or not |
| 1198 | * |
| 1199 | * @return true if passed address is Group address else false |
| 1200 | */ |
| 1201 | |
| 1202 | tANI_U8 |
| 1203 | limIsGroupAddr(tSirMacAddr macAddr) |
| 1204 | { |
| 1205 | if ((macAddr[0] & 0x01) == 0x01) |
| 1206 | return true; |
| 1207 | else |
| 1208 | return false; |
| 1209 | } /****** end limIsGroupAddr() ******/ |
| 1210 | |
| 1211 | /** |
| 1212 | * limPostMsgApiNoWait() |
| 1213 | * |
| 1214 | *FUNCTION: |
| 1215 | * This function is called from other thread while posting a |
| 1216 | * message to LIM message Queue gSirLimMsgQ with NO_WAIT option |
| 1217 | * |
| 1218 | *LOGIC: |
| 1219 | * NA |
| 1220 | * |
| 1221 | *ASSUMPTIONS: |
| 1222 | * NA |
| 1223 | * |
| 1224 | *NOTE: |
| 1225 | * NA |
| 1226 | * |
| 1227 | * @param pMsg - Pointer to the Global MAC structure |
| 1228 | * @param pMsg - Pointer to the message structure |
| 1229 | * @return None |
| 1230 | */ |
| 1231 | |
| 1232 | tANI_U32 |
| 1233 | limPostMsgApiNoWait(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 1234 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | limProcessMessages(pMac, pMsg); |
| 1236 | return TX_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1237 | } /*** end limPostMsgApiNoWait() ***/ |
| 1238 | |
| 1239 | |
| 1240 | |
| 1241 | /** |
| 1242 | * limPrintMacAddr() |
| 1243 | * |
| 1244 | *FUNCTION: |
| 1245 | * This function is called to print passed MAC address |
| 1246 | * in : format. |
| 1247 | * |
| 1248 | *LOGIC: |
| 1249 | * |
| 1250 | *ASSUMPTIONS: |
| 1251 | * NA |
| 1252 | * |
| 1253 | *NOTE: |
| 1254 | * @param macAddr - MacAddr to be printed |
| 1255 | * @param logLevel - Loglevel to be used |
| 1256 | * |
| 1257 | * @return None. |
| 1258 | */ |
| 1259 | |
| 1260 | void |
| 1261 | limPrintMacAddr(tpAniSirGlobal pMac, tSirMacAddr macAddr, tANI_U8 logLevel) |
| 1262 | { |
| 1263 | limLog(pMac, logLevel, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1264 | FL("%X:%X:%X:%X:%X:%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1265 | macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], |
| 1266 | macAddr[5]); |
| 1267 | } /****** end limPrintMacAddr() ******/ |
| 1268 | |
| 1269 | |
| 1270 | |
| 1271 | |
| 1272 | |
| 1273 | |
| 1274 | /* |
| 1275 | * limResetDeferredMsgQ() |
| 1276 | * |
| 1277 | *FUNCTION: |
| 1278 | * This function resets the deferred message queue parameters. |
| 1279 | * |
| 1280 | *PARAMS: |
| 1281 | * @param pMac - Pointer to Global MAC structure |
| 1282 | * |
| 1283 | *LOGIC: |
| 1284 | * |
| 1285 | *ASSUMPTIONS: |
| 1286 | * NA |
| 1287 | * |
| 1288 | *NOTE: |
| 1289 | * NA |
| 1290 | * |
| 1291 | *RETURNS: |
| 1292 | * None |
| 1293 | */ |
| 1294 | |
| 1295 | void limResetDeferredMsgQ(tpAniSirGlobal pMac) |
| 1296 | { |
| 1297 | pMac->lim.gLimDeferredMsgQ.size = |
| 1298 | pMac->lim.gLimDeferredMsgQ.write = |
| 1299 | pMac->lim.gLimDeferredMsgQ.read = 0; |
| 1300 | |
| 1301 | } |
| 1302 | |
| 1303 | |
| 1304 | #define LIM_DEFERRED_Q_CHECK_THRESHOLD (MAX_DEFERRED_QUEUE_LEN/2) |
| 1305 | #define LIM_MAX_NUM_MGMT_FRAME_DEFERRED (MAX_DEFERRED_QUEUE_LEN/2) |
| 1306 | |
| 1307 | /* |
| 1308 | * limWriteDeferredMsgQ() |
| 1309 | * |
| 1310 | *FUNCTION: |
| 1311 | * This function queues up a deferred message for later processing on the |
| 1312 | * STA side. |
| 1313 | * |
| 1314 | *PARAMS: |
| 1315 | * @param pMac - Pointer to Global MAC structure |
| 1316 | * @param limMsg - a LIM message |
| 1317 | * |
| 1318 | *LOGIC: |
| 1319 | * |
| 1320 | *ASSUMPTIONS: |
| 1321 | * NA |
| 1322 | * |
| 1323 | *NOTE: |
| 1324 | * NA |
| 1325 | * |
| 1326 | *RETURNS: |
| 1327 | * None |
| 1328 | */ |
| 1329 | |
| 1330 | tANI_U8 limWriteDeferredMsgQ(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1331 | { |
| 1332 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1333 | FL("** Queue a deferred message (size %d, write %d) - type 0x%x **"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1334 | pMac->lim.gLimDeferredMsgQ.size, pMac->lim.gLimDeferredMsgQ.write, |
| 1335 | limMsg->type);) |
| 1336 | |
| 1337 | /* |
| 1338 | ** check if the deferred message queue is full |
| 1339 | **/ |
| 1340 | if (pMac->lim.gLimDeferredMsgQ.size >= MAX_DEFERRED_QUEUE_LEN) |
| 1341 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1342 | if(!(pMac->lim.deferredMsgCnt & 0xF)) |
| 1343 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1344 | PELOGE(limLog(pMac, LOGE, FL("Deferred Message Queue is full. Msg:%d Messages Failed:%d"), limMsg->type, ++pMac->lim.deferredMsgCnt);) |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1345 | } |
| 1346 | else |
| 1347 | { |
| 1348 | pMac->lim.deferredMsgCnt++; |
| 1349 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1350 | return TX_QUEUE_FULL; |
| 1351 | } |
| 1352 | |
| 1353 | /* |
| 1354 | ** In the application, there should not be more than 1 message get |
| 1355 | ** queued up. If happens, flags a warning. In the future, this can |
| 1356 | ** happen. |
| 1357 | **/ |
| 1358 | if (pMac->lim.gLimDeferredMsgQ.size > 0) |
| 1359 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1360 | 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] | 1361 | pMac->lim.gLimDeferredMsgQ.size, limMsg->type, |
| 1362 | limIsSystemInScanState(pMac), |
| 1363 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1364 | pMac->lim.gLimAddtsSent);) |
| 1365 | } |
| 1366 | |
| 1367 | /* |
| 1368 | ** To prevent the deferred Q is full of management frames, only give them certain space |
| 1369 | **/ |
| 1370 | if( SIR_BB_XPORT_MGMT_MSG == limMsg->type ) |
| 1371 | { |
| 1372 | if( LIM_DEFERRED_Q_CHECK_THRESHOLD < pMac->lim.gLimDeferredMsgQ.size ) |
| 1373 | { |
| 1374 | tANI_U16 idx, count = 0; |
| 1375 | for(idx = 0; idx < pMac->lim.gLimDeferredMsgQ.size; idx++) |
| 1376 | { |
| 1377 | if( SIR_BB_XPORT_MGMT_MSG == pMac->lim.gLimDeferredMsgQ.deferredQueue[idx].type ) |
| 1378 | { |
| 1379 | count++; |
| 1380 | } |
| 1381 | } |
| 1382 | if( LIM_MAX_NUM_MGMT_FRAME_DEFERRED < count ) |
| 1383 | { |
| 1384 | //We reach the quota for management frames, drop this one |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 1385 | 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] | 1386 | //Return error, caller knows what to do |
| 1387 | return TX_QUEUE_FULL; |
| 1388 | } |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | ++pMac->lim.gLimDeferredMsgQ.size; |
| 1393 | |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1394 | /* reset the count here since we are able to defer the message */ |
| 1395 | if(pMac->lim.deferredMsgCnt != 0) |
| 1396 | { |
| 1397 | pMac->lim.deferredMsgCnt = 0; |
| 1398 | } |
| 1399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1400 | /* |
| 1401 | ** if the write pointer hits the end of the queue, rewind it |
| 1402 | **/ |
| 1403 | if (pMac->lim.gLimDeferredMsgQ.write >= MAX_DEFERRED_QUEUE_LEN) |
| 1404 | pMac->lim.gLimDeferredMsgQ.write = 0; |
| 1405 | |
| 1406 | /* |
| 1407 | ** save the message to the queue and advanced the write pointer |
| 1408 | **/ |
| 1409 | palCopyMemory(pMac->hHdd, |
| 1410 | (tANI_U8 *)&pMac->lim.gLimDeferredMsgQ.deferredQueue[pMac->lim.gLimDeferredMsgQ.write++], |
| 1411 | (tANI_U8 *)limMsg, |
| 1412 | sizeof(tSirMsgQ)); |
| 1413 | return TX_SUCCESS; |
| 1414 | |
| 1415 | } |
| 1416 | |
| 1417 | /* |
| 1418 | * limReadDeferredMsgQ() |
| 1419 | * |
| 1420 | *FUNCTION: |
| 1421 | * This function dequeues a deferred message for processing on the |
| 1422 | * STA side. |
| 1423 | * |
| 1424 | *PARAMS: |
| 1425 | * @param pMac - Pointer to Global MAC structure |
| 1426 | * |
| 1427 | *LOGIC: |
| 1428 | * |
| 1429 | *ASSUMPTIONS: |
| 1430 | * NA |
| 1431 | * |
| 1432 | *NOTE: |
| 1433 | * |
| 1434 | * |
| 1435 | *RETURNS: |
| 1436 | * Returns the message at the head of the deferred message queue |
| 1437 | */ |
| 1438 | |
| 1439 | tSirMsgQ* limReadDeferredMsgQ(tpAniSirGlobal pMac) |
| 1440 | { |
| 1441 | tSirMsgQ *msg; |
| 1442 | |
| 1443 | /* |
| 1444 | ** check any messages left. If no, return |
| 1445 | **/ |
| 1446 | if (pMac->lim.gLimDeferredMsgQ.size <= 0) |
| 1447 | return NULL; |
| 1448 | |
| 1449 | /* |
| 1450 | ** decrement the queue size |
| 1451 | **/ |
| 1452 | pMac->lim.gLimDeferredMsgQ.size--; |
| 1453 | |
| 1454 | /* |
| 1455 | ** retrieve the message from the head of the queue |
| 1456 | **/ |
| 1457 | msg = &pMac->lim.gLimDeferredMsgQ.deferredQueue[pMac->lim.gLimDeferredMsgQ.read]; |
| 1458 | |
| 1459 | /* |
| 1460 | ** advance the read pointer |
| 1461 | **/ |
| 1462 | pMac->lim.gLimDeferredMsgQ.read++; |
| 1463 | |
| 1464 | /* |
| 1465 | ** if the read pointer hits the end of the queue, rewind it |
| 1466 | **/ |
| 1467 | if (pMac->lim.gLimDeferredMsgQ.read >= MAX_DEFERRED_QUEUE_LEN) |
| 1468 | pMac->lim.gLimDeferredMsgQ.read = 0; |
| 1469 | |
| 1470 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1471 | FL("** DeQueue a deferred message (size %d read %d) - type 0x%x **"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1472 | pMac->lim.gLimDeferredMsgQ.size, pMac->lim.gLimDeferredMsgQ.read, |
| 1473 | msg->type);) |
| 1474 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1475 | 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] | 1476 | limIsSystemInScanState(pMac), |
| 1477 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1478 | pMac->lim.gLimAddtsSent);) |
| 1479 | |
| 1480 | return(msg); |
| 1481 | } |
| 1482 | |
| 1483 | tSirRetStatus |
| 1484 | limSysProcessMmhMsgApi(tpAniSirGlobal pMac, |
| 1485 | tSirMsgQ *pMsg, |
| 1486 | tANI_U8 qType) |
| 1487 | { |
| 1488 | // FIXME |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1489 | SysProcessMmhMsg(pMac, pMsg); |
| 1490 | return eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1491 | } |
| 1492 | |
| 1493 | char *limFrameStr(tANI_U32 type, tANI_U32 subType) |
| 1494 | { |
| 1495 | #ifdef FIXME_GEN6 |
| 1496 | |
| 1497 | if (type == SIR_MAC_MGMT_FRAME) |
| 1498 | { |
| 1499 | switch (subType) |
| 1500 | { |
| 1501 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 1502 | return "MAC_MGMT_ASSOC_REQ"; |
| 1503 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 1504 | return "MAC_MGMT_ASSOC_RSP"; |
| 1505 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 1506 | return "MAC_MGMT_REASSOC_REQ"; |
| 1507 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 1508 | return "MAC_MGMT_REASSOC_RSP"; |
| 1509 | case SIR_MAC_MGMT_PROBE_REQ: |
| 1510 | return "MAC_MGMT_PROBE_REQ"; |
| 1511 | case SIR_MAC_MGMT_PROBE_RSP: |
| 1512 | return "MAC_MGMT_PROBE_RSP"; |
| 1513 | case SIR_MAC_MGMT_BEACON: |
| 1514 | return "MAC_MGMT_BEACON"; |
| 1515 | case SIR_MAC_MGMT_ATIM: |
| 1516 | return "MAC_MGMT_ATIM"; |
| 1517 | case SIR_MAC_MGMT_DISASSOC: |
| 1518 | return "MAC_MGMT_DISASSOC"; |
| 1519 | case SIR_MAC_MGMT_AUTH: |
| 1520 | return "MAC_MGMT_AUTH"; |
| 1521 | case SIR_MAC_MGMT_DEAUTH: |
| 1522 | return "MAC_MGMT_DEAUTH"; |
| 1523 | case SIR_MAC_MGMT_ACTION: |
| 1524 | return "MAC_MGMT_ACTION"; |
| 1525 | case SIR_MAC_MGMT_RESERVED15: |
| 1526 | return "MAC_MGMT_RESERVED15"; |
| 1527 | default: |
| 1528 | return "Unknown MGMT Frame"; |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | else if (type == SIR_MAC_CTRL_FRAME) |
| 1533 | { |
| 1534 | switch (subType) |
| 1535 | { |
| 1536 | case SIR_MAC_CTRL_RR: |
| 1537 | return "MAC_CTRL_RR"; |
| 1538 | case SIR_MAC_CTRL_BAR: |
| 1539 | return "MAC_CTRL_BAR"; |
| 1540 | case SIR_MAC_CTRL_BA: |
| 1541 | return "MAC_CTRL_BA"; |
| 1542 | case SIR_MAC_CTRL_PS_POLL: |
| 1543 | return "MAC_CTRL_PS_POLL"; |
| 1544 | case SIR_MAC_CTRL_RTS: |
| 1545 | return "MAC_CTRL_RTS"; |
| 1546 | case SIR_MAC_CTRL_CTS: |
| 1547 | return "MAC_CTRL_CTS"; |
| 1548 | case SIR_MAC_CTRL_ACK: |
| 1549 | return "MAC_CTRL_ACK"; |
| 1550 | case SIR_MAC_CTRL_CF_END: |
| 1551 | return "MAC_CTRL_CF_END"; |
| 1552 | case SIR_MAC_CTRL_CF_END_ACK: |
| 1553 | return "MAC_CTRL_CF_END_ACK"; |
| 1554 | default: |
| 1555 | return "Unknown CTRL Frame"; |
| 1556 | } |
| 1557 | } |
| 1558 | |
| 1559 | else if (type == SIR_MAC_DATA_FRAME) |
| 1560 | { |
| 1561 | switch (subType) |
| 1562 | { |
| 1563 | case SIR_MAC_DATA_DATA: |
| 1564 | return "MAC_DATA_DATA"; |
| 1565 | case SIR_MAC_DATA_DATA_ACK: |
| 1566 | return "MAC_DATA_DATA_ACK"; |
| 1567 | case SIR_MAC_DATA_DATA_POLL: |
| 1568 | return "MAC_DATA_DATA_POLL"; |
| 1569 | case SIR_MAC_DATA_DATA_ACK_POLL: |
| 1570 | return "MAC_DATA_DATA_ACK_POLL"; |
| 1571 | case SIR_MAC_DATA_NULL: |
| 1572 | return "MAC_DATA_NULL"; |
| 1573 | case SIR_MAC_DATA_NULL_ACK: |
| 1574 | return "MAC_DATA_NULL_ACK"; |
| 1575 | case SIR_MAC_DATA_NULL_POLL: |
| 1576 | return "MAC_DATA_NULL_POLL"; |
| 1577 | case SIR_MAC_DATA_NULL_ACK_POLL: |
| 1578 | return "MAC_DATA_NULL_ACK_POLL"; |
| 1579 | case SIR_MAC_DATA_QOS_DATA: |
| 1580 | return "MAC_DATA_QOS_DATA"; |
| 1581 | case SIR_MAC_DATA_QOS_DATA_ACK: |
| 1582 | return "MAC_DATA_QOS_DATA_ACK"; |
| 1583 | case SIR_MAC_DATA_QOS_DATA_POLL: |
| 1584 | return "MAC_DATA_QOS_DATA_POLL"; |
| 1585 | case SIR_MAC_DATA_QOS_DATA_ACK_POLL: |
| 1586 | return "MAC_DATA_QOS_DATA_ACK_POLL"; |
| 1587 | case SIR_MAC_DATA_QOS_NULL: |
| 1588 | return "MAC_DATA_QOS_NULL"; |
| 1589 | case SIR_MAC_DATA_QOS_NULL_ACK: |
| 1590 | return "MAC_DATA_QOS_NULL_ACK"; |
| 1591 | case SIR_MAC_DATA_QOS_NULL_POLL: |
| 1592 | return "MAC_DATA_QOS_NULL_POLL"; |
| 1593 | case SIR_MAC_DATA_QOS_NULL_ACK_POLL: |
| 1594 | return "MAC_DATA_QOS_NULL_ACK_POLL"; |
| 1595 | default: |
| 1596 | return "Unknown Data Frame"; |
| 1597 | } |
| 1598 | } |
| 1599 | else |
| 1600 | return "Unknown"; |
| 1601 | #endif |
| 1602 | return ""; |
| 1603 | } |
| 1604 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1605 | void limHandleUpdateOlbcCache(tpAniSirGlobal pMac) |
| 1606 | { |
| 1607 | int i; |
| 1608 | static int enable; |
| 1609 | tUpdateBeaconParams beaconParams; |
| 1610 | |
| 1611 | tpPESession psessionEntry = limIsApSessionActive(pMac); |
| 1612 | |
| 1613 | if (psessionEntry == NULL) |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1614 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1615 | PELOGE(limLog(pMac, LOGE, FL(" Session not found"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1616 | return; |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1617 | } |
Pratik Bhalgat | b44ea3f | 2012-11-22 16:41:39 +0530 | [diff] [blame] | 1618 | |
Madan Mohan Koyyalamudi | b273314 | 2012-10-31 13:59:17 -0700 | [diff] [blame] | 1619 | palZeroMemory( pMac->hHdd, ( tANI_U8* )&beaconParams, sizeof( tUpdateBeaconParams) ); |
| 1620 | beaconParams.bssIdx = psessionEntry->bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | |
| 1622 | beaconParams.paramChangeBitmap = 0; |
| 1623 | /* |
| 1624 | ** This is doing a 2 pass check. The first pass is to invalidate |
| 1625 | ** all the cache entries. The second pass is to decide whether to |
| 1626 | ** disable protection. |
| 1627 | **/ |
| 1628 | if (!enable) |
| 1629 | { |
| 1630 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1631 | PELOG2(limLog(pMac, LOG2, FL("Resetting OLBC cache"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1632 | psessionEntry->gLimOlbcParams.numSta = 0; |
| 1633 | psessionEntry->gLimOverlap11gParams.numSta = 0; |
| 1634 | psessionEntry->gLimOverlapHt20Params.numSta = 0; |
| 1635 | psessionEntry->gLimNonGfParams.numSta = 0; |
| 1636 | psessionEntry->gLimLsigTxopParams.numSta = 0; |
| 1637 | |
| 1638 | for (i=0; i < LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++) |
| 1639 | pMac->lim.protStaOverlapCache[i].active = false; |
| 1640 | |
| 1641 | enable = 1; |
| 1642 | } |
| 1643 | else |
| 1644 | { |
| 1645 | |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 1646 | if (!psessionEntry->gLimOlbcParams.numSta) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | { |
| 1648 | if (psessionEntry->gLimOlbcParams.protectionEnabled) |
| 1649 | { |
| 1650 | if (!psessionEntry->gLim11bParams.protectionEnabled) |
| 1651 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1652 | 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] | 1653 | limEnable11gProtection(pMac, false, true, &beaconParams, psessionEntry); |
| 1654 | } |
| 1655 | } |
| 1656 | } |
| 1657 | |
| 1658 | if (!psessionEntry->gLimOverlap11gParams.numSta) |
| 1659 | { |
| 1660 | if (psessionEntry->gLimOverlap11gParams.protectionEnabled) |
| 1661 | { |
| 1662 | if (!psessionEntry->gLim11gParams.protectionEnabled) |
| 1663 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1664 | 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] | 1665 | limEnableHtProtectionFrom11g(pMac, false, true, &beaconParams,psessionEntry); |
| 1666 | } |
| 1667 | } |
| 1668 | } |
| 1669 | |
| 1670 | if (!psessionEntry->gLimOverlapHt20Params.numSta) |
| 1671 | { |
| 1672 | if (psessionEntry->gLimOverlapHt20Params.protectionEnabled) |
| 1673 | { |
| 1674 | if (!psessionEntry->gLimHt20Params.protectionEnabled) |
| 1675 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1676 | 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] | 1677 | limEnable11gProtection(pMac, false, true, &beaconParams,psessionEntry); |
| 1678 | } |
| 1679 | } |
| 1680 | } |
| 1681 | |
| 1682 | enable = 0; |
| 1683 | } |
| 1684 | |
| 1685 | if(beaconParams.paramChangeBitmap) |
| 1686 | { |
| 1687 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 1688 | limSendBeaconParams(pMac, &beaconParams, psessionEntry); |
| 1689 | } |
| 1690 | |
| 1691 | // Start OLBC timer |
| 1692 | if (tx_timer_activate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer) != TX_SUCCESS) |
| 1693 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1694 | limLog(pMac, LOGE, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1695 | } |
| 1696 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | |
| 1698 | /** |
| 1699 | * limIsNullSsid() |
| 1700 | * |
| 1701 | *FUNCTION: |
| 1702 | * This function checks if Ssid supplied is Null SSID |
| 1703 | * |
| 1704 | * |
| 1705 | *LOGIC: |
| 1706 | * |
| 1707 | *ASSUMPTIONS: |
| 1708 | * NA |
| 1709 | * |
| 1710 | *NOTE: |
| 1711 | * NA |
| 1712 | * |
| 1713 | * @param tSirMacSSid * |
| 1714 | * |
| 1715 | * |
| 1716 | * @return true if SSID is Null SSID else false |
| 1717 | */ |
| 1718 | |
| 1719 | tANI_U8 |
| 1720 | limIsNullSsid( tSirMacSSid *pSsid ) |
| 1721 | { |
| 1722 | tANI_U8 fNullSsid = false; |
| 1723 | tANI_U32 SsidLength; |
| 1724 | tANI_U8 *pSsidStr; |
| 1725 | |
| 1726 | do |
| 1727 | { |
| 1728 | if ( 0 == pSsid->length ) |
| 1729 | { |
| 1730 | fNullSsid = true; |
| 1731 | break; |
| 1732 | } |
| 1733 | |
| 1734 | #define ASCII_SPACE_CHARACTER 0x20 |
| 1735 | /* If the first charactes is space, then check if all characters in |
| 1736 | * SSID are spaces to consider it as NULL SSID*/ |
| 1737 | if( ASCII_SPACE_CHARACTER == pSsid->ssId[0]) |
| 1738 | { |
| 1739 | SsidLength = pSsid->length; |
| 1740 | pSsidStr = pSsid->ssId; |
| 1741 | /* check if all the charactes in SSID are spaces*/ |
| 1742 | while ( SsidLength ) |
| 1743 | { |
| 1744 | if( ASCII_SPACE_CHARACTER != *pSsidStr ) |
| 1745 | break; |
| 1746 | |
| 1747 | pSsidStr++; |
| 1748 | SsidLength--; |
| 1749 | } |
| 1750 | |
| 1751 | if( 0 == SsidLength ) |
| 1752 | { |
| 1753 | fNullSsid = true; |
| 1754 | break; |
| 1755 | } |
| 1756 | } |
| 1757 | else |
| 1758 | { |
| 1759 | /* check if all the charactes in SSID are NULL*/ |
| 1760 | SsidLength = pSsid->length; |
| 1761 | pSsidStr = pSsid->ssId; |
| 1762 | |
| 1763 | while ( SsidLength ) |
| 1764 | { |
| 1765 | if( *pSsidStr ) |
| 1766 | break; |
| 1767 | |
| 1768 | pSsidStr++; |
| 1769 | SsidLength--; |
| 1770 | } |
| 1771 | |
| 1772 | if( 0 == SsidLength ) |
| 1773 | { |
| 1774 | fNullSsid = true; |
| 1775 | break; |
| 1776 | } |
| 1777 | } |
| 1778 | } |
| 1779 | while( 0 ); |
| 1780 | |
| 1781 | return fNullSsid; |
| 1782 | } /****** end limIsNullSsid() ******/ |
| 1783 | |
| 1784 | |
| 1785 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1786 | |
| 1787 | /** ------------------------------------------------------------- |
| 1788 | \fn limUpdateProtStaParams |
| 1789 | \brief updates protection related counters. |
| 1790 | \param tpAniSirGlobal pMac |
| 1791 | \param tSirMacAddr peerMacAddr |
| 1792 | \param tLimProtStaCacheType protStaCacheType |
| 1793 | \param tHalBitVal gfSupported |
| 1794 | \param tHalBitVal lsigTxopSupported |
| 1795 | \return None |
| 1796 | -------------------------------------------------------------*/ |
| 1797 | void |
| 1798 | limUpdateProtStaParams(tpAniSirGlobal pMac, |
| 1799 | tSirMacAddr peerMacAddr, tLimProtStaCacheType protStaCacheType, |
| 1800 | tHalBitVal gfSupported, tHalBitVal lsigTxopSupported, |
| 1801 | tpPESession psessionEntry) |
| 1802 | { |
| 1803 | tANI_U32 i; |
| 1804 | |
| 1805 | PELOG1(limLog(pMac,LOG1, FL("A STA is associated:")); |
| 1806 | limLog(pMac,LOG1, FL("Addr : ")); |
| 1807 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 1808 | |
| 1809 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1810 | { |
| 1811 | if (psessionEntry->protStaCache[i].active) |
| 1812 | { |
| 1813 | PELOG1(limLog(pMac, LOG1, FL("Addr: "));) |
| 1814 | PELOG1(limPrintMacAddr(pMac, psessionEntry->protStaCache[i].addr, LOG1);) |
| 1815 | |
| 1816 | if (palEqualMemory( pMac->hHdd, |
| 1817 | psessionEntry->protStaCache[i].addr, |
| 1818 | peerMacAddr, sizeof(tSirMacAddr))) |
| 1819 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1820 | 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] | 1821 | return; |
| 1822 | } |
| 1823 | } |
| 1824 | } |
| 1825 | |
| 1826 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1827 | { |
| 1828 | if (!psessionEntry->protStaCache[i].active) |
| 1829 | break; |
| 1830 | } |
| 1831 | |
| 1832 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 1833 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1834 | PELOGE(limLog(pMac, LOGE, FL("No space in ProtStaCache"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1835 | return; |
| 1836 | } |
| 1837 | |
| 1838 | palCopyMemory( pMac->hHdd, psessionEntry->protStaCache[i].addr, |
| 1839 | peerMacAddr, |
| 1840 | sizeof(tSirMacAddr)); |
| 1841 | |
| 1842 | psessionEntry->protStaCache[i].protStaCacheType = protStaCacheType; |
| 1843 | psessionEntry->protStaCache[i].active = true; |
| 1844 | if(eLIM_PROT_STA_CACHE_TYPE_llB == protStaCacheType) |
| 1845 | { |
| 1846 | psessionEntry->gLim11bParams.numSta++; |
| 1847 | limLog(pMac,LOG1, FL("11B, ")); |
| 1848 | } |
| 1849 | else if(eLIM_PROT_STA_CACHE_TYPE_llG == protStaCacheType) |
| 1850 | { |
| 1851 | psessionEntry->gLim11gParams.numSta++; |
| 1852 | limLog(pMac,LOG1, FL("11G, ")); |
| 1853 | } |
| 1854 | else if(eLIM_PROT_STA_CACHE_TYPE_HT20 == protStaCacheType) |
| 1855 | { |
| 1856 | psessionEntry->gLimHt20Params.numSta++; |
| 1857 | limLog(pMac,LOG1, FL("HT20, ")); |
| 1858 | } |
| 1859 | |
| 1860 | if(!gfSupported) |
| 1861 | { |
| 1862 | psessionEntry->gLimNonGfParams.numSta++; |
| 1863 | limLog(pMac,LOG1, FL("NonGf, ")); |
| 1864 | } |
| 1865 | if(!lsigTxopSupported) |
| 1866 | { |
| 1867 | psessionEntry->gLimLsigTxopParams.numSta++; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1868 | limLog(pMac,LOG1, FL("!lsigTxopSupported")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1869 | } |
| 1870 | }// --------------------------------------------------------------------- |
| 1871 | |
| 1872 | /** ------------------------------------------------------------- |
| 1873 | \fn limDecideApProtection |
| 1874 | \brief Decides all the protection related staiton coexistence and also sets |
| 1875 | \ short preamble and short slot appropriately. This function will be called |
| 1876 | \ when AP is ready to send assocRsp tp the station joining right now. |
| 1877 | \param tpAniSirGlobal pMac |
| 1878 | \param tSirMacAddr peerMacAddr |
| 1879 | \return None |
| 1880 | -------------------------------------------------------------*/ |
| 1881 | void |
| 1882 | limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 1883 | { |
| 1884 | tANI_U16 tmpAid; |
| 1885 | tpDphHashNode pStaDs; |
| 1886 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 1887 | tANI_U32 phyMode; |
| 1888 | tLimProtStaCacheType protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_INVALID; |
| 1889 | tHalBitVal gfSupported = eHAL_SET, lsigTxopSupported = eHAL_SET; |
| 1890 | |
| 1891 | pBeaconParams->paramChangeBitmap = 0; |
| 1892 | // check whether to enable protection or not |
| 1893 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 1894 | if(NULL == pStaDs) |
| 1895 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1896 | PELOG1(limLog(pMac, LOG1, FL("pStaDs is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1897 | return; |
| 1898 | } |
| 1899 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 1900 | //if we are in 5 GHZ band |
| 1901 | if(SIR_BAND_5_GHZ == rfBand) |
| 1902 | { |
| 1903 | //We are 11N. we need to protect from 11A and Ht20. we don't need any other protection in 5 GHZ. |
| 1904 | //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] | 1905 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1906 | { |
| 1907 | //we are 11N and 11A station is joining. |
| 1908 | //protection from 11A required. |
| 1909 | if(false == pStaDs->mlmStaContext.htCapability) |
| 1910 | { |
| 1911 | limEnable11aProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 1912 | return; |
| 1913 | } |
| 1914 | } |
| 1915 | } |
| 1916 | else if(SIR_BAND_2_4_GHZ== rfBand) |
| 1917 | { |
| 1918 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1919 | |
| 1920 | //We are 11G. Check if we need protection from 11b Stations. |
| 1921 | if ((phyMode == WNI_CFG_PHY_MODE_11G) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1922 | (false == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | { |
| 1924 | |
| 1925 | if (pStaDs->erpEnabled== eHAL_CLEAR) |
| 1926 | { |
| 1927 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llB; |
| 1928 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1929 | PELOG3(limLog(pMac, LOG3, FL("Enabling protection from 11B"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1930 | limEnable11gProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 1931 | } |
| 1932 | } |
| 1933 | |
| 1934 | //HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1935 | if (true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1936 | { |
| 1937 | //check if we need protection from 11b station |
| 1938 | if ((pStaDs->erpEnabled == eHAL_CLEAR) && |
| 1939 | (!pStaDs->mlmStaContext.htCapability)) |
| 1940 | { |
| 1941 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llB; |
| 1942 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1943 | PELOG3(limLog(pMac, LOG3, FL("Enabling protection from 11B"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1944 | limEnable11gProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 1945 | } |
| 1946 | //station being joined is non-11b and non-ht ==> 11g device |
| 1947 | else if(!pStaDs->mlmStaContext.htCapability) |
| 1948 | { |
| 1949 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_llG; |
| 1950 | //enable protection |
| 1951 | limEnableHtProtectionFrom11g(pMac, true, false, pBeaconParams, psessionEntry); |
| 1952 | } |
| 1953 | //ERP mode is enabled for the latest station joined |
| 1954 | //latest station joined is HT capable |
| 1955 | //This case is being handled in common code (commn between both the bands) below. |
| 1956 | } |
| 1957 | } |
| 1958 | |
| 1959 | //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] | 1960 | if((true == psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1961 | (true == pStaDs->mlmStaContext.htCapability)) |
| 1962 | { |
| 1963 | if(!pStaDs->htGreenfield) |
| 1964 | { |
| 1965 | limEnableHTNonGfProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 1966 | gfSupported = eHAL_CLEAR; |
| 1967 | } |
| 1968 | //Station joining is HT 20Mhz |
| 1969 | if(eHT_CHANNEL_WIDTH_20MHZ == pStaDs->htSupportedChannelWidthSet) |
| 1970 | { |
| 1971 | protStaCacheType = eLIM_PROT_STA_CACHE_TYPE_HT20; |
| 1972 | limEnableHT20Protection(pMac, true, false, pBeaconParams, psessionEntry); |
| 1973 | } |
| 1974 | //Station joining does not support LSIG TXOP Protection |
| 1975 | if(!pStaDs->htLsigTXOPProtection) |
| 1976 | { |
| 1977 | limEnableHTLsigTxopProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 1978 | lsigTxopSupported = eHAL_CLEAR; |
| 1979 | } |
| 1980 | } |
| 1981 | |
| 1982 | limUpdateProtStaParams(pMac, peerMacAddr, protStaCacheType, |
| 1983 | gfSupported, lsigTxopSupported, psessionEntry); |
| 1984 | |
| 1985 | return; |
| 1986 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1987 | |
| 1988 | |
| 1989 | /** ------------------------------------------------------------- |
| 1990 | \fn limEnableOverlap11gProtection |
| 1991 | \brief wrapper function for setting overlap 11g protection. |
| 1992 | \param tpAniSirGlobal pMac |
| 1993 | \param tpUpdateBeaconParams pBeaconParams |
| 1994 | \param tpSirMacMgmtHdr pMh |
| 1995 | \return None |
| 1996 | -------------------------------------------------------------*/ |
| 1997 | void |
| 1998 | limEnableOverlap11gProtection(tpAniSirGlobal pMac, |
| 1999 | tpUpdateBeaconParams pBeaconParams, tpSirMacMgmtHdr pMh,tpPESession psessionEntry) |
| 2000 | { |
| 2001 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOlbcParams)); |
| 2002 | |
| 2003 | if (psessionEntry->gLimOlbcParams.numSta && |
| 2004 | !psessionEntry->gLimOlbcParams.protectionEnabled) |
| 2005 | { |
| 2006 | // enable protection |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2007 | PELOG1(limLog(pMac, LOG1, FL("OLBC happens!!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2008 | limEnable11gProtection(pMac, true, true, pBeaconParams,psessionEntry); |
| 2009 | } |
| 2010 | } |
| 2011 | |
| 2012 | |
| 2013 | /** ------------------------------------------------------------- |
| 2014 | \fn limUpdateShortPreamble |
| 2015 | \brief Updates short preamble if needed when a new station joins. |
| 2016 | \param tpAniSirGlobal pMac |
| 2017 | \param tSirMacAddr peerMacAddr |
| 2018 | \param tpUpdateBeaconParams pBeaconParams |
| 2019 | \return None |
| 2020 | -------------------------------------------------------------*/ |
| 2021 | void |
| 2022 | limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2023 | tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2024 | { |
| 2025 | tANI_U16 tmpAid; |
| 2026 | tpDphHashNode pStaDs; |
| 2027 | tANI_U32 phyMode; |
| 2028 | tANI_U16 i; |
| 2029 | |
| 2030 | // check whether to enable protection or not |
| 2031 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 2032 | |
| 2033 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2034 | |
| 2035 | if (pStaDs != NULL && phyMode == WNI_CFG_PHY_MODE_11G) |
| 2036 | |
| 2037 | { |
| 2038 | if (pStaDs->shortPreambleEnabled == eHAL_CLEAR) |
| 2039 | { |
| 2040 | PELOG1(limLog(pMac,LOG1,FL("Short Preamble is not enabled in Assoc Req from ")); |
| 2041 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 2042 | |
| 2043 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2044 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2045 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2046 | psessionEntry->gLimNoShortParams.staNoShortCache[i].active) |
| 2047 | { |
| 2048 | if (palEqualMemory( pMac->hHdd, |
| 2049 | psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, |
| 2050 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2051 | return; |
| 2052 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2053 | { |
| 2054 | if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active) |
| 2055 | { |
| 2056 | if (palEqualMemory( pMac->hHdd, |
| 2057 | pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, |
| 2058 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2059 | return; |
| 2060 | } |
| 2061 | } |
| 2062 | } |
| 2063 | |
| 2064 | |
| 2065 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2066 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2067 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2068 | !psessionEntry->gLimNoShortParams.staNoShortCache[i].active) |
| 2069 | break; |
| 2070 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2071 | { |
| 2072 | if (!pMac->lim.gLimNoShortParams.staNoShortCache[i].active) |
| 2073 | break; |
| 2074 | } |
| 2075 | } |
| 2076 | |
| 2077 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 2078 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2079 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2080 | limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), |
| 2081 | i, psessionEntry->gLimNoShortParams.numNonShortPreambleSta); |
| 2082 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2083 | return; |
| 2084 | } |
| 2085 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | { |
| 2087 | limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), |
| 2088 | i, pMac->lim.gLimNoShortParams.numNonShortPreambleSta); |
| 2089 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2090 | return; |
| 2091 | } |
| 2092 | |
| 2093 | } |
| 2094 | |
| 2095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2097 | palCopyMemory( pMac->hHdd, psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, |
| 2098 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2099 | psessionEntry->gLimNoShortParams.staNoShortCache[i].active = true; |
| 2100 | psessionEntry->gLimNoShortParams.numNonShortPreambleSta++; |
| 2101 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2102 | { |
| 2103 | palCopyMemory( pMac->hHdd, pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, |
| 2104 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2105 | pMac->lim.gLimNoShortParams.staNoShortCache[i].active = true; |
| 2106 | pMac->lim.gLimNoShortParams.numNonShortPreambleSta++; |
| 2107 | } |
| 2108 | |
| 2109 | |
| 2110 | // enable long preamble |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2111 | PELOG1(limLog(pMac, LOG1, FL("Disabling short preamble"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2112 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2113 | if (limEnableShortPreamble(pMac, false, pBeaconParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2114 | PELOGE(limLog(pMac, LOGE, FL("Cannot enable long preamble"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2115 | } |
| 2116 | } |
| 2117 | } |
| 2118 | |
| 2119 | /** ------------------------------------------------------------- |
| 2120 | \fn limUpdateShortSlotTime |
| 2121 | \brief Updates short slot time if needed when a new station joins. |
| 2122 | \param tpAniSirGlobal pMac |
| 2123 | \param tSirMacAddr peerMacAddr |
| 2124 | \param tpUpdateBeaconParams pBeaconParams |
| 2125 | \return None |
| 2126 | -------------------------------------------------------------*/ |
| 2127 | |
| 2128 | void |
| 2129 | limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2130 | tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2131 | { |
| 2132 | tANI_U16 tmpAid; |
| 2133 | tpDphHashNode pStaDs; |
| 2134 | tANI_U32 phyMode; |
| 2135 | tANI_U32 val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2136 | tANI_U16 i; |
| 2137 | |
| 2138 | // check whether to enable protection or not |
| 2139 | pStaDs = dphLookupHashEntry(pMac, peerMacAddr, &tmpAid, &psessionEntry->dph.dphHashTable); |
| 2140 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2141 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2142 | /* Only in case of softap in 11g mode, slot time might change depending on the STA being added. In 11a case, it should |
| 2143 | * be always 1 and in 11b case, it should be always 0 |
| 2144 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2145 | if (pStaDs != NULL && phyMode == WNI_CFG_PHY_MODE_11G) |
| 2146 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2147 | /* Only when the new STA has short slot time disabled, we need to change softap's overall slot time settings |
| 2148 | * else the default for softap is always short slot enabled. When the last long slot STA leaves softAP, we take care of |
| 2149 | * it in limDecideShortSlot |
| 2150 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2151 | if (pStaDs->shortSlotTimeEnabled == eHAL_CLEAR) |
| 2152 | { |
| 2153 | PELOG1(limLog(pMac, LOG1, FL("Short Slot Time is not enabled in Assoc Req from ")); |
| 2154 | limPrintMacAddr(pMac, peerMacAddr, LOG1);) |
| 2155 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2156 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2157 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2158 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2159 | { |
| 2160 | if (palEqualMemory( pMac->hHdd, |
| 2161 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2162 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2163 | return; |
| 2164 | } |
| 2165 | else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2166 | { |
| 2167 | if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2168 | { |
| 2169 | if (palEqualMemory( pMac->hHdd, |
| 2170 | pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2171 | peerMacAddr, sizeof(tSirMacAddr))) |
| 2172 | return; |
| 2173 | } |
| 2174 | } |
| 2175 | } |
| 2176 | |
| 2177 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 2178 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2179 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 2180 | !psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2181 | break; |
| 2182 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2183 | { |
| 2184 | if (!pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 2185 | break; |
| 2186 | } |
| 2187 | } |
| 2188 | |
| 2189 | if (i >= LIM_PROT_STA_CACHE_SIZE) |
| 2190 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2191 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2192 | limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), |
| 2193 | i, psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta); |
| 2194 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2195 | return; |
| 2196 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2197 | { |
| 2198 | limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), |
| 2199 | i, pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta); |
| 2200 | limPrintMacAddr(pMac, peerMacAddr, LOGE); |
| 2201 | return; |
| 2202 | } |
| 2203 | } |
| 2204 | |
| 2205 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2206 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 2207 | palCopyMemory( pMac->hHdd, psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2208 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2209 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; |
| 2210 | psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta++; |
| 2211 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | { |
| 2213 | palCopyMemory( pMac->hHdd, pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
| 2214 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2215 | pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; |
| 2216 | pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta++; |
| 2217 | } |
| 2218 | wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val); |
| 2219 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2220 | /* 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 |
| 2221 | * only long slot enabled, we need to change our beacon/pb rsp to broadcast short slot disabled |
| 2222 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2224 | (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2225 | { |
| 2226 | // enable long slot time |
| 2227 | pBeaconParams->fShortSlotTime = false; |
| 2228 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2229 | 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] | 2230 | psessionEntry->shortSlotTimeSupported = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2231 | } |
| 2232 | else if ( psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2233 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2234 | if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2235 | { |
| 2236 | // enable long slot time |
| 2237 | pBeaconParams->fShortSlotTime = false; |
| 2238 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2239 | 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] | 2240 | psessionEntry->shortSlotTimeSupported = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2241 | } |
| 2242 | } |
| 2243 | } |
| 2244 | } |
| 2245 | } |
| 2246 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2247 | |
| 2248 | /** ------------------------------------------------------------- |
| 2249 | \fn limDecideStaProtectionOnAssoc |
| 2250 | \brief Decide protection related settings on Sta while association. |
| 2251 | \param tpAniSirGlobal pMac |
| 2252 | \param tpSchBeaconStruct pBeaconStruct |
| 2253 | \return None |
| 2254 | -------------------------------------------------------------*/ |
| 2255 | void |
| 2256 | limDecideStaProtectionOnAssoc(tpAniSirGlobal pMac, |
| 2257 | tpSchBeaconStruct pBeaconStruct, tpPESession psessionEntry) |
| 2258 | { |
| 2259 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 2260 | tANI_U32 phyMode = WNI_CFG_PHY_MODE_NONE; |
| 2261 | |
| 2262 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 2263 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2264 | |
| 2265 | if(SIR_BAND_5_GHZ == rfBand) |
| 2266 | { |
| 2267 | if((eSIR_HT_OP_MODE_MIXED == pBeaconStruct->HTInfo.opMode) || |
| 2268 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBeaconStruct->HTInfo.opMode)) |
| 2269 | { |
| 2270 | if(pMac->lim.cfgProtection.fromlla) |
| 2271 | psessionEntry->beaconParams.llaCoexist = true; |
| 2272 | } |
| 2273 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBeaconStruct->HTInfo.opMode) |
| 2274 | { |
| 2275 | if(pMac->lim.cfgProtection.ht20) |
| 2276 | psessionEntry->beaconParams.ht20Coexist = true; |
| 2277 | } |
| 2278 | |
| 2279 | } |
| 2280 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 2281 | { |
| 2282 | //spec 7.3.2.13 |
| 2283 | //UseProtection will be set when nonERP STA is associated. |
| 2284 | //NonERPPresent bit will be set when: |
| 2285 | //--nonERP Sta is associated OR |
| 2286 | //--nonERP Sta exists in overlapping BSS |
| 2287 | //when useProtection is not set then protection from nonERP stations is optional. |
| 2288 | |
| 2289 | //CFG protection from 11b is enabled and |
| 2290 | //11B device in the BSS |
| 2291 | /* TODO, This is not sessionized */ |
| 2292 | if (phyMode != WNI_CFG_PHY_MODE_11B) |
| 2293 | { |
| 2294 | if (pMac->lim.cfgProtection.fromllb && |
| 2295 | pBeaconStruct->erpPresent && |
| 2296 | (pBeaconStruct->erpIEInfo.useProtection || |
| 2297 | pBeaconStruct->erpIEInfo.nonErpPresent)) |
| 2298 | { |
| 2299 | psessionEntry->beaconParams.llbCoexist = true; |
| 2300 | } |
| 2301 | //AP has no 11b station associated. |
| 2302 | else |
| 2303 | { |
| 2304 | psessionEntry->beaconParams.llbCoexist = false; |
| 2305 | } |
| 2306 | } |
| 2307 | //following code block is only for HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2308 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | (pBeaconStruct->HTInfo.present)) |
| 2310 | { |
| 2311 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2312 | |
| 2313 | //Obss Non HT STA present mode |
| 2314 | psessionEntry->beaconParams.gHTObssMode = (tANI_U8)htInfo.obssNonHTStaPresent; |
| 2315 | |
| 2316 | |
| 2317 | //CFG protection from 11G is enabled and |
| 2318 | //our AP has at least one 11G station associated. |
| 2319 | if(pMac->lim.cfgProtection.fromllg && |
| 2320 | ((eSIR_HT_OP_MODE_MIXED == htInfo.opMode) || |
| 2321 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == htInfo.opMode))&& |
| 2322 | (!psessionEntry->beaconParams.llbCoexist)) |
| 2323 | { |
| 2324 | if(pMac->lim.cfgProtection.fromllg) |
| 2325 | psessionEntry->beaconParams.llgCoexist = true; |
| 2326 | } |
| 2327 | |
| 2328 | //AP has only HT stations associated and at least one station is HT 20 |
| 2329 | //disable protection from any non-HT devices. |
| 2330 | //decision for disabling protection from 11b has already been taken above. |
| 2331 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == htInfo.opMode) |
| 2332 | { |
| 2333 | //Disable protection from 11G station. |
| 2334 | psessionEntry->beaconParams.llgCoexist = false; |
| 2335 | //CFG protection from HT 20 is enabled. |
| 2336 | if(pMac->lim.cfgProtection.ht20) |
| 2337 | psessionEntry->beaconParams.ht20Coexist = true; |
| 2338 | } |
| 2339 | //Disable protection from non-HT and HT20 devices. |
| 2340 | //decision for disabling protection from 11b has already been taken above. |
| 2341 | if(eSIR_HT_OP_MODE_PURE == htInfo.opMode) |
| 2342 | { |
| 2343 | psessionEntry->beaconParams.llgCoexist = false; |
| 2344 | psessionEntry->beaconParams.ht20Coexist = false; |
| 2345 | } |
| 2346 | |
| 2347 | } |
| 2348 | } |
| 2349 | |
| 2350 | //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] | 2351 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2352 | (pBeaconStruct->HTInfo.present)) |
| 2353 | { |
| 2354 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2355 | psessionEntry->beaconParams.fRIFSMode = |
| 2356 | ( tANI_U8 ) htInfo.rifsMode; |
| 2357 | psessionEntry->beaconParams.llnNonGFCoexist = |
| 2358 | ( tANI_U8 )htInfo.nonGFDevicesPresent; |
| 2359 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2360 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport; |
| 2361 | } |
| 2362 | } |
| 2363 | |
| 2364 | |
| 2365 | /** ------------------------------------------------------------- |
| 2366 | \fn limDecideStaProtection |
| 2367 | \brief Decides protection related settings on Sta while processing beacon. |
| 2368 | \param tpAniSirGlobal pMac |
| 2369 | \param tpUpdateBeaconParams pBeaconParams |
| 2370 | \return None |
| 2371 | -------------------------------------------------------------*/ |
| 2372 | void |
| 2373 | limDecideStaProtection(tpAniSirGlobal pMac, |
| 2374 | tpSchBeaconStruct pBeaconStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 2375 | { |
| 2376 | |
| 2377 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 2378 | tANI_U32 phyMode = WNI_CFG_PHY_MODE_NONE; |
| 2379 | |
| 2380 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 2381 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2382 | |
| 2383 | if(SIR_BAND_5_GHZ == rfBand) |
| 2384 | { |
| 2385 | //we are HT capable. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2386 | if((true == psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2387 | (pBeaconStruct->HTInfo.present)) |
| 2388 | { |
| 2389 | //we are HT capable, AP's HT OPMode is mixed / overlap legacy ==> need protection from 11A. |
| 2390 | if((eSIR_HT_OP_MODE_MIXED == pBeaconStruct->HTInfo.opMode) || |
| 2391 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBeaconStruct->HTInfo.opMode)) |
| 2392 | { |
| 2393 | limEnable11aProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2394 | } |
| 2395 | //we are HT capable, AP's HT OPMode is HT20 ==> disable protection from 11A if enabled. enabled |
| 2396 | //protection from HT20 if needed. |
| 2397 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT== pBeaconStruct->HTInfo.opMode) |
| 2398 | { |
| 2399 | limEnable11aProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2400 | limEnableHT20Protection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2401 | } |
| 2402 | else if(eSIR_HT_OP_MODE_PURE == pBeaconStruct->HTInfo.opMode) |
| 2403 | { |
| 2404 | limEnable11aProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2405 | limEnableHT20Protection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2406 | } |
| 2407 | } |
| 2408 | } |
| 2409 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 2410 | { |
| 2411 | /* spec 7.3.2.13 |
| 2412 | * UseProtection will be set when nonERP STA is associated. |
| 2413 | * NonERPPresent bit will be set when: |
| 2414 | * --nonERP Sta is associated OR |
| 2415 | * --nonERP Sta exists in overlapping BSS |
| 2416 | * when useProtection is not set then protection from nonERP stations is optional. |
| 2417 | */ |
| 2418 | |
| 2419 | if (phyMode != WNI_CFG_PHY_MODE_11B) |
| 2420 | { |
| 2421 | if (pBeaconStruct->erpPresent && |
| 2422 | (pBeaconStruct->erpIEInfo.useProtection || |
| 2423 | pBeaconStruct->erpIEInfo.nonErpPresent)) |
| 2424 | { |
| 2425 | limEnable11gProtection(pMac, true, false, pBeaconParams, psessionEntry); |
| 2426 | } |
| 2427 | //AP has no 11b station associated. |
| 2428 | else |
| 2429 | { |
| 2430 | //disable protection from 11b station |
| 2431 | limEnable11gProtection(pMac, false, false, pBeaconParams, psessionEntry); |
| 2432 | } |
| 2433 | } |
| 2434 | |
| 2435 | //following code block is only for HT station. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2436 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2437 | (pBeaconStruct->HTInfo.present)) |
| 2438 | { |
| 2439 | |
| 2440 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2441 | //AP has at least one 11G station associated. |
| 2442 | if(((eSIR_HT_OP_MODE_MIXED == htInfo.opMode) || |
| 2443 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == htInfo.opMode))&& |
| 2444 | (!psessionEntry->beaconParams.llbCoexist)) |
| 2445 | { |
| 2446 | limEnableHtProtectionFrom11g(pMac, true, false, pBeaconParams,psessionEntry); |
| 2447 | |
| 2448 | } |
| 2449 | |
| 2450 | //no HT operating mode change ==> no change in protection settings except for MIXED_MODE/Legacy Mode. |
| 2451 | //in Mixed mode/legacy Mode even if there is no change in HT operating mode, there might be change in 11bCoexist |
| 2452 | //or 11gCoexist. that is why this check is being done after mixed/legacy mode check. |
| 2453 | if ( pMac->lim.gHTOperMode != ( tSirMacHTOperatingMode )htInfo.opMode ) |
| 2454 | { |
| 2455 | pMac->lim.gHTOperMode = ( tSirMacHTOperatingMode )htInfo.opMode; |
| 2456 | |
| 2457 | //AP has only HT stations associated and at least one station is HT 20 |
| 2458 | //disable protection from any non-HT devices. |
| 2459 | //decision for disabling protection from 11b has already been taken above. |
| 2460 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == htInfo.opMode) |
| 2461 | { |
| 2462 | //Disable protection from 11G station. |
| 2463 | limEnableHtProtectionFrom11g(pMac, false, false, pBeaconParams,psessionEntry); |
| 2464 | |
| 2465 | limEnableHT20Protection(pMac, true, false, pBeaconParams,psessionEntry); |
| 2466 | } |
| 2467 | //Disable protection from non-HT and HT20 devices. |
| 2468 | //decision for disabling protection from 11b has already been taken above. |
| 2469 | else if(eSIR_HT_OP_MODE_PURE == htInfo.opMode) |
| 2470 | { |
| 2471 | limEnableHtProtectionFrom11g(pMac, false, false, pBeaconParams,psessionEntry); |
| 2472 | limEnableHT20Protection(pMac, false, false, pBeaconParams,psessionEntry); |
| 2473 | |
| 2474 | } |
| 2475 | } |
| 2476 | } |
| 2477 | } |
| 2478 | |
| 2479 | //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] | 2480 | if((psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2481 | (pBeaconStruct->HTInfo.present)) |
| 2482 | { |
| 2483 | tDot11fIEHTInfo htInfo = pBeaconStruct->HTInfo; |
| 2484 | //Check for changes in protection related factors other than HT operating mode. |
| 2485 | //Check for changes in RIFS mode, nonGFDevicesPresent, lsigTXOPProtectionFullSupport. |
| 2486 | if ( psessionEntry->beaconParams.fRIFSMode != |
| 2487 | ( tANI_U8 ) htInfo.rifsMode ) |
| 2488 | { |
| 2489 | pBeaconParams->fRIFSMode = |
| 2490 | psessionEntry->beaconParams.fRIFSMode = |
| 2491 | ( tANI_U8 ) htInfo.rifsMode; |
| 2492 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 2493 | } |
| 2494 | |
| 2495 | if ( psessionEntry->beaconParams.llnNonGFCoexist != |
| 2496 | htInfo.nonGFDevicesPresent ) |
| 2497 | { |
| 2498 | pBeaconParams->llnNonGFCoexist = |
| 2499 | psessionEntry->beaconParams.llnNonGFCoexist = |
| 2500 | ( tANI_U8 )htInfo.nonGFDevicesPresent; |
| 2501 | pBeaconParams->paramChangeBitmap |= |
| 2502 | PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 2503 | } |
| 2504 | |
| 2505 | if ( psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport != |
| 2506 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport ) |
| 2507 | { |
| 2508 | pBeaconParams->fLsigTXOPProtectionFullSupport = |
| 2509 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2510 | ( tANI_U8 )htInfo.lsigTXOPProtectionFullSupport; |
| 2511 | pBeaconParams->paramChangeBitmap |= |
| 2512 | PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 2513 | } |
| 2514 | |
| 2515 | // For Station just update the global lim variable, no need to send message to HAL |
| 2516 | // Station already taking care of HT OPR Mode=01, meaning AP is seeing legacy |
| 2517 | //stations in overlapping BSS. |
| 2518 | if ( psessionEntry->beaconParams.gHTObssMode != ( tANI_U8 )htInfo.obssNonHTStaPresent ) |
| 2519 | psessionEntry->beaconParams.gHTObssMode = ( tANI_U8 )htInfo.obssNonHTStaPresent ; |
| 2520 | |
| 2521 | } |
| 2522 | } |
| 2523 | |
| 2524 | |
| 2525 | /** |
| 2526 | * limProcessChannelSwitchTimeout() |
| 2527 | * |
| 2528 | *FUNCTION: |
| 2529 | * This function is invoked when Channel Switch Timer expires at |
| 2530 | * the STA. Now, STA must stop traffic, and then change/disable |
| 2531 | * primary or secondary channel. |
| 2532 | * |
| 2533 | * |
| 2534 | *NOTE: |
| 2535 | * @param pMac - Pointer to Global MAC structure |
| 2536 | * @return None |
| 2537 | */ |
| 2538 | void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac) |
| 2539 | { |
| 2540 | tpPESession psessionEntry = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2541 | tANI_U8 channel; // This is received and stored from channelSwitch Action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | |
| 2543 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId))== NULL) |
| 2544 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2545 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | return; |
| 2547 | } |
| 2548 | |
| 2549 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2550 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2551 | 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] | 2552 | return; |
| 2553 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2554 | channel = psessionEntry->gLimChannelSwitch.primaryChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2555 | /* |
| 2556 | * This potentially can create issues if the function tries to set |
| 2557 | * channel while device is in power-save, hence putting an extra check |
| 2558 | * to verify if the device is in power-save or not |
| 2559 | */ |
| 2560 | if(!limIsSystemInActiveState(pMac)) |
| 2561 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2562 | 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] | 2563 | return; |
| 2564 | } |
| 2565 | |
| 2566 | // Restore Channel Switch parameters to default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2567 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2568 | |
| 2569 | /* Channel-switch timeout has occurred. reset the state */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2570 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_END; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2571 | |
| 2572 | /* Check if the AP is switching to a channel that we support. |
| 2573 | * Else, just don't bother to switch. Indicate HDD to look for a |
| 2574 | * better AP to associate |
| 2575 | */ |
| 2576 | if(!limIsChannelValidForChannelSwitch(pMac, channel)) |
| 2577 | { |
| 2578 | /* We need to restore pre-channelSwitch state on the STA */ |
| 2579 | if(limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2580 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2581 | 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] | 2582 | return; |
| 2583 | } |
| 2584 | |
| 2585 | /* If the channel-list that AP is asking us to switch is invalid, |
| 2586 | * then we cannot switch the channel. Just disassociate from AP. |
| 2587 | * We will find a better AP !!! |
| 2588 | */ |
| 2589 | limTearDownLinkWithAp(pMac, |
| 2590 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId, |
| 2591 | eSIR_MAC_UNSPEC_FAILURE_REASON); |
| 2592 | return; |
| 2593 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2594 | switch(psessionEntry->gLimChannelSwitch.state) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | { |
| 2596 | case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2597 | PELOGW(limLog(pMac, LOGW, FL("CHANNEL_SWITCH_PRIMARY_ONLY "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2598 | limSwitchPrimaryChannel(pMac, psessionEntry->gLimChannelSwitch.primaryChannel,psessionEntry); |
| 2599 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2600 | break; |
| 2601 | |
| 2602 | case eLIM_CHANNEL_SWITCH_SECONDARY_ONLY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2603 | PELOGW(limLog(pMac, LOGW, FL("CHANNEL_SWITCH_SECONDARY_ONLY "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2604 | limSwitchPrimarySecondaryChannel(pMac, psessionEntry, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2605 | psessionEntry->currentOperChannel, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2606 | psessionEntry->gLimChannelSwitch.secondarySubBand); |
| 2607 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2608 | break; |
| 2609 | |
| 2610 | case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2611 | PELOGW(limLog(pMac, LOGW, FL("CHANNEL_SWITCH_PRIMARY_AND_SECONDARY"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2612 | limSwitchPrimarySecondaryChannel(pMac, psessionEntry, |
| 2613 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 2614 | psessionEntry->gLimChannelSwitch.secondarySubBand); |
| 2615 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2616 | break; |
| 2617 | |
| 2618 | case eLIM_CHANNEL_SWITCH_IDLE: |
| 2619 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2620 | PELOGE(limLog(pMac, LOGE, FL("incorrect state "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2621 | if(limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2622 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2623 | 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] | 2624 | } |
| 2625 | return; /* Please note, this is 'return' and not 'break' */ |
| 2626 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2627 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2628 | |
| 2629 | /** |
| 2630 | * limUpdateChannelSwitch() |
| 2631 | * |
| 2632 | *FUNCTION: |
| 2633 | * This function is invoked whenever Station receives |
| 2634 | * either 802.11h channel switch IE or airgo proprietary |
| 2635 | * channel switch IE. |
| 2636 | * |
| 2637 | *NOTE: |
| 2638 | * @param pMac - Pointer to Global MAC structure |
| 2639 | * @return tpSirProbeRespBeacon - Pointer to Beacon/Probe Rsp |
| 2640 | * @param psessionentry |
| 2641 | */ |
| 2642 | void |
| 2643 | limUpdateChannelSwitch(struct sAniSirGlobal *pMac, tpSirProbeRespBeacon pBeacon, tpPESession psessionEntry) |
| 2644 | { |
| 2645 | |
| 2646 | tANI_U16 beaconPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2647 | tChannelSwitchPropIEStruct *pPropChnlSwitch; |
| 2648 | tDot11fIEChanSwitchAnn *pChnlSwitch; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2649 | #ifdef WLAN_FEATURE_11AC |
| 2650 | tDot11fIEWiderBWChanSwitchAnn *pWiderChnlSwitch; |
| 2651 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2653 | beaconPeriod = psessionEntry->beaconParams.beaconInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2654 | |
| 2655 | /* STA either received proprietary channel switch IE or 802.11h |
| 2656 | * standard channel switch IE. |
| 2657 | */ |
| 2658 | if (pBeacon->propIEinfo.propChannelSwitchPresent) |
| 2659 | { |
| 2660 | pPropChnlSwitch = &(pBeacon->propIEinfo.channelSwitch); |
| 2661 | |
| 2662 | /* Add logic to determine which change this is: */ |
| 2663 | /* primary, secondary, both. For now assume both. */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2664 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2665 | psessionEntry->gLimChannelSwitch.primaryChannel = pPropChnlSwitch->primaryChannel; |
| 2666 | psessionEntry->gLimChannelSwitch.secondarySubBand = (ePhyChanBondState)pPropChnlSwitch->subBand; |
| 2667 | psessionEntry->gLimChannelSwitch.switchCount = pPropChnlSwitch->channelSwitchCount; |
| 2668 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2669 | SYS_MS_TO_TICKS(beaconPeriod)* (pPropChnlSwitch->channelSwitchCount); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2670 | psessionEntry->gLimChannelSwitch.switchMode = pPropChnlSwitch->mode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2671 | } |
| 2672 | else |
| 2673 | { |
| 2674 | pChnlSwitch = &(pBeacon->channelSwitchIE); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2675 | psessionEntry->gLimChannelSwitch.primaryChannel = pChnlSwitch->newChannel; |
| 2676 | psessionEntry->gLimChannelSwitch.switchCount = pChnlSwitch->switchCount; |
| 2677 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2678 | SYS_MS_TO_TICKS(beaconPeriod)* (pChnlSwitch->switchCount); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2679 | psessionEntry->gLimChannelSwitch.switchMode = pChnlSwitch->switchMode; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2680 | #ifdef WLAN_FEATURE_11AC |
| 2681 | pWiderChnlSwitch = &(pBeacon->WiderBWChanSwitchAnn); |
| 2682 | if(pBeacon->WiderBWChanSwitchAnnPresent) |
| 2683 | { |
| 2684 | psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pWiderChnlSwitch->newChanWidth; |
| 2685 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pWiderChnlSwitch->newCenterChanFreq0; |
| 2686 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pWiderChnlSwitch->newCenterChanFreq1; |
| 2687 | } |
| 2688 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2689 | |
| 2690 | /* Only primary channel switch element is present */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2691 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 2692 | psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2693 | |
| 2694 | /* Do not bother to look and operate on extended channel switch element |
| 2695 | * if our own channel-bonding state is not enabled |
| 2696 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2697 | if (psessionEntry->htSupportedChannelWidthSet) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2698 | { |
| 2699 | if (pBeacon->extChannelSwitchPresent) |
| 2700 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2701 | if ((pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 2702 | (pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2703 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2704 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2705 | psessionEntry->gLimChannelSwitch.secondarySubBand = pBeacon->extChannelSwitchIE.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2706 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2707 | #ifdef WLAN_FEATURE_11AC |
| 2708 | if(psessionEntry->vhtCapability && pBeacon->WiderBWChanSwitchAnnPresent) |
| 2709 | { |
| 2710 | if (pWiderChnlSwitch->newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 2711 | { |
| 2712 | if(pBeacon->extChannelSwitchPresent) |
| 2713 | { |
| 2714 | if ((pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 2715 | (pBeacon->extChannelSwitchIE.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
| 2716 | { |
| 2717 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 2718 | psessionEntry->gLimChannelSwitch.secondarySubBand = limGet11ACPhyCBState(pMac, |
| 2719 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 2720 | pBeacon->extChannelSwitchIE.secondaryChannelOffset, |
| 2721 | pWiderChnlSwitch->newCenterChanFreq0, |
| 2722 | psessionEntry); |
| 2723 | } |
| 2724 | } |
| 2725 | } |
| 2726 | } |
| 2727 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2728 | } |
| 2729 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2730 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2731 | if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry)) |
| 2732 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2733 | PELOGW(limLog(pMac, LOGW, FL("Could not start Channel Switch"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2734 | } |
| 2735 | |
| 2736 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2737 | FL("session %d primary chl %d, subband %d, count %d (%d ticks) "), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2738 | psessionEntry->peSessionId, |
| 2739 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 2740 | psessionEntry->gLimChannelSwitch.secondarySubBand, |
| 2741 | psessionEntry->gLimChannelSwitch.switchCount, |
| 2742 | psessionEntry->gLimChannelSwitch.switchTimeoutValue); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2743 | return; |
| 2744 | } |
| 2745 | |
| 2746 | /** |
| 2747 | * limCancelDot11hChannelSwitch |
| 2748 | * |
| 2749 | *FUNCTION: |
| 2750 | * This function is called when STA does not send updated channel-swith IE |
| 2751 | * after indicating channel-switch start. This will cancel the channel-swith |
| 2752 | * timer which is already running. |
| 2753 | * |
| 2754 | *LOGIC: |
| 2755 | * |
| 2756 | *ASSUMPTIONS: |
| 2757 | * |
| 2758 | *NOTE: |
| 2759 | * |
| 2760 | * @param pMac - Pointer to Global MAC structure |
| 2761 | * |
| 2762 | * @return None |
| 2763 | */ |
| 2764 | void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 2765 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2766 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2767 | return; |
| 2768 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2769 | PELOGW(limLog(pMac, LOGW, FL("Received a beacon without channel switch IE"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2770 | 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] | 2771 | |
| 2772 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 2773 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2774 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2775 | } |
| 2776 | |
| 2777 | /* We need to restore pre-channelSwitch state on the STA */ |
| 2778 | if (limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2779 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2780 | 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] | 2781 | |
| 2782 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2783 | } |
| 2784 | |
| 2785 | /**---------------------------------------------- |
| 2786 | \fn limCancelDot11hQuiet |
| 2787 | \brief Cancel the quieting on Station if latest |
| 2788 | beacon doesn't contain quiet IE in it. |
| 2789 | |
| 2790 | \param pMac |
| 2791 | \return NONE |
| 2792 | -----------------------------------------------*/ |
| 2793 | void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 2794 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2795 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 2796 | return; |
| 2797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2798 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2799 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2800 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2801 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS) |
| 2802 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2803 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2804 | } |
| 2805 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2806 | else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2807 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2808 | 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] | 2809 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS) |
| 2810 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2811 | PELOGE(limLog(pMac, LOGE, FL("tx_timer_deactivate failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2812 | } |
| 2813 | /** |
| 2814 | * If the channel switch is already running in silent mode, dont resume the |
| 2815 | * transmission. Channel switch timer when timeout, transmission will be resumed. |
| 2816 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2817 | if(!((psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) && |
| 2818 | (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2819 | { |
| 2820 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2821 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2822 | } |
| 2823 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2824 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2825 | } |
| 2826 | |
| 2827 | /** |
| 2828 | * limProcessQuietTimeout |
| 2829 | * |
| 2830 | * FUNCTION: |
| 2831 | * This function is active only on the STA. |
| 2832 | * Handles SIR_LIM_QUIET_TIMEOUT |
| 2833 | * |
| 2834 | * LOGIC: |
| 2835 | * This timeout can occur under only one circumstance: |
| 2836 | * |
| 2837 | * 1) When gLimQuietState = eLIM_QUIET_BEGIN |
| 2838 | * This indicates that the timeout "interval" has |
| 2839 | * expired. This is a trigger for the STA to now |
| 2840 | * shut-off Tx/Rx for the specified gLimQuietDuration |
| 2841 | * -> The TIMER object gLimQuietBssTimer is |
| 2842 | * activated |
| 2843 | * -> With timeout = gLimQuietDuration |
| 2844 | * -> gLimQuietState is set to eLIM_QUIET_RUNNING |
| 2845 | * |
| 2846 | * ASSUMPTIONS: |
| 2847 | * Using two TIMER objects - |
| 2848 | * gLimQuietTimer & gLimQuietBssTimer |
| 2849 | * |
| 2850 | * NOTE: |
| 2851 | * |
| 2852 | * @param pMac - Pointer to Global MAC structure |
| 2853 | * |
| 2854 | * @return None |
| 2855 | */ |
| 2856 | void limProcessQuietTimeout(tpAniSirGlobal pMac) |
| 2857 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | //fetch the sessionEntry based on the sessionId |
| 2859 | //priority - MEDIUM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2860 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2861 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2862 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimQuietTimer.sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2863 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2864 | limLog(pMac, LOGE,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2865 | return; |
| 2866 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2867 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2868 | PELOG1(limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState);) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2869 | switch( psessionEntry->gLimSpecMgmt.quietState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2870 | { |
| 2871 | case eLIM_QUIET_BEGIN: |
| 2872 | // Time to Stop data traffic for quietDuration |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2873 | //limDeactivateAndChangeTimer(pMac, eLIM_QUIET_BSS_TIMER); |
| 2874 | if (TX_SUCCESS != |
| 2875 | tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer)) |
| 2876 | { |
| 2877 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2878 | FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2879 | } |
| 2880 | |
| 2881 | // gLimQuietDuration appears to be in units of ticks |
| 2882 | // Use it as is |
| 2883 | if (TX_SUCCESS != |
| 2884 | tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer, |
| 2885 | psessionEntry->gLimSpecMgmt.quietDuration, |
| 2886 | 0)) |
| 2887 | { |
| 2888 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2889 | FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2890 | } |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 2891 | 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] | 2892 | #ifdef GEN6_TODO |
| 2893 | /* revisit this piece of code to assign the appropriate sessionId below |
| 2894 | * priority - HIGH |
| 2895 | */ |
| 2896 | pMac->lim.limTimers.gLimQuietBssTimer.sessionId = sessionId; |
| 2897 | #endif |
| 2898 | if( TX_SUCCESS != |
| 2899 | tx_timer_activate( &pMac->lim.limTimers.gLimQuietBssTimer )) |
| 2900 | { |
| 2901 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2902 | 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] | 2903 | } |
| 2904 | else |
| 2905 | { |
| 2906 | // Transition to eLIM_QUIET_RUNNING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2907 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_RUNNING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2908 | |
| 2909 | /* If we have sta bk scan triggered and trigger bk scan actually started successfully, */ |
| 2910 | /* print message, otherwise, stop data traffic and stay quiet */ |
| 2911 | if( pMac->lim.gLimTriggerBackgroundScanDuringQuietBss && |
| 2912 | (eSIR_TRUE == (glimTriggerBackgroundScanDuringQuietBss_Status = limTriggerBackgroundScanDuringQuietBss( pMac ))) ) |
| 2913 | { |
| 2914 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2915 | FL("Attempting to trigger a background scan...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2916 | } |
| 2917 | else |
| 2918 | { |
| 2919 | // Shut-off Tx/Rx for gLimSpecMgmt.quietDuration |
| 2920 | /* freeze the transmission */ |
| 2921 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX); |
| 2922 | |
| 2923 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2924 | FL("Quiet BSS: STA shutting down for %d ticks"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2925 | psessionEntry->gLimSpecMgmt.quietDuration ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2926 | } |
| 2927 | } |
| 2928 | break; |
| 2929 | |
| 2930 | case eLIM_QUIET_RUNNING: |
| 2931 | case eLIM_QUIET_INIT: |
| 2932 | case eLIM_QUIET_END: |
| 2933 | default: |
| 2934 | // |
| 2935 | // As of now, nothing to be done |
| 2936 | // |
| 2937 | break; |
| 2938 | } |
| 2939 | } |
| 2940 | |
| 2941 | /** |
| 2942 | * limProcessQuietBssTimeout |
| 2943 | * |
| 2944 | * FUNCTION: |
| 2945 | * This function is active on the AP and STA. |
| 2946 | * Handles SIR_LIM_QUIET_BSS_TIMEOUT |
| 2947 | * |
| 2948 | * LOGIC: |
| 2949 | * On the AP - |
| 2950 | * When the SIR_LIM_QUIET_BSS_TIMEOUT is triggered, it is |
| 2951 | * an indication for the AP to START sending out the |
| 2952 | * Quiet BSS IE. |
| 2953 | * If 802.11H is enabled, the Quiet BSS IE is sent as per |
| 2954 | * the 11H spec |
| 2955 | * If 802.11H is not enabled, the Quiet BSS IE is sent as |
| 2956 | * a Proprietary IE. This will be understood by all the |
| 2957 | * TITAN STA's |
| 2958 | * Transitioning gLimQuietState to eLIM_QUIET_BEGIN will |
| 2959 | * initiate the SCH to include the Quiet BSS IE in all |
| 2960 | * its subsequent Beacons/PR's. |
| 2961 | * The Quiet BSS IE will be included in all the Beacons |
| 2962 | * & PR's until the next DTIM period |
| 2963 | * |
| 2964 | * On the STA - |
| 2965 | * When gLimQuietState = eLIM_QUIET_RUNNING |
| 2966 | * This indicates that the STA was successfully shut-off |
| 2967 | * for the specified gLimQuietDuration. This is a trigger |
| 2968 | * for the STA to now resume data traffic. |
| 2969 | * -> gLimQuietState is set to eLIM_QUIET_INIT |
| 2970 | * |
| 2971 | * ASSUMPTIONS: |
| 2972 | * |
| 2973 | * NOTE: |
| 2974 | * |
| 2975 | * @param pMac - Pointer to Global MAC structure |
| 2976 | * |
| 2977 | * @return None |
| 2978 | */ |
| 2979 | void limProcessQuietBssTimeout( tpAniSirGlobal pMac ) |
| 2980 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2981 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2983 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimQuietBssTimer.sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2984 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2985 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2986 | return; |
| 2987 | } |
| 2988 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2989 | PELOG1(limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState);) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2990 | if (eLIM_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2991 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2992 | } |
| 2993 | else |
| 2994 | { |
| 2995 | // eLIM_STA_ROLE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2996 | switch( psessionEntry->gLimSpecMgmt.quietState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2997 | { |
| 2998 | case eLIM_QUIET_RUNNING: |
| 2999 | // Transition to eLIM_QUIET_INIT |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3000 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3001 | |
| 3002 | if( !pMac->lim.gLimTriggerBackgroundScanDuringQuietBss || (glimTriggerBackgroundScanDuringQuietBss_Status == eSIR_FALSE) ) |
| 3003 | { |
| 3004 | // 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] | 3005 | if (!((psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) && |
| 3006 | (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3007 | { |
| 3008 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3009 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3010 | } |
| 3011 | |
| 3012 | /* Reset status flag */ |
| 3013 | if(glimTriggerBackgroundScanDuringQuietBss_Status == eSIR_FALSE) |
| 3014 | glimTriggerBackgroundScanDuringQuietBss_Status = eSIR_TRUE; |
| 3015 | |
| 3016 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3017 | FL("Quiet BSS: Resuming traffic...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3018 | } |
| 3019 | else |
| 3020 | { |
| 3021 | // |
| 3022 | // Nothing specific to be done in this case |
| 3023 | // A background scan that was triggered during |
| 3024 | // SIR_LIM_QUIET_TIMEOUT will complete on its own |
| 3025 | // |
| 3026 | limLog( pMac, LOG2, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3027 | FL("Background scan should be complete now...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3028 | } |
| 3029 | break; |
| 3030 | |
| 3031 | case eLIM_QUIET_INIT: |
| 3032 | case eLIM_QUIET_BEGIN: |
| 3033 | case eLIM_QUIET_END: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3034 | PELOG2(limLog(pMac, LOG2, FL("Quiet state not in RUNNING"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3035 | /* If the quiet period has ended, then resume the frame transmission */ |
| 3036 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3037 | limRestorePreQuietState(pMac, psessionEntry); |
| 3038 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3039 | break; |
| 3040 | |
| 3041 | default: |
| 3042 | // |
| 3043 | // As of now, nothing to be done |
| 3044 | // |
| 3045 | break; |
| 3046 | } |
| 3047 | } |
| 3048 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3049 | /** |
| 3050 | * limProcessWPSOverlapTimeout |
| 3051 | * |
| 3052 | * FUNCTION: This function call limWPSPBCTimeout() to clean WPS PBC probe request entries |
| 3053 | * |
| 3054 | * LOGIC: |
| 3055 | * |
| 3056 | * ASSUMPTIONS: |
| 3057 | * |
| 3058 | * NOTE: |
| 3059 | * |
| 3060 | * @param pMac - Pointer to Global MAC structure |
| 3061 | * |
| 3062 | * @return None |
| 3063 | */ |
| 3064 | #if 0 |
| 3065 | void limProcessWPSOverlapTimeout(tpAniSirGlobal pMac) |
| 3066 | { |
| 3067 | |
| 3068 | tpPESession psessionEntry; |
| 3069 | tANI_U32 sessionId; |
| 3070 | |
| 3071 | if (tx_timer_activate(&pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS) |
| 3072 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3073 | limLog(pMac, LOGP, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3074 | } |
| 3075 | |
| 3076 | sessionId = pMac->lim.limTimers.gLimWPSOverlapTimerObj.sessionId; |
| 3077 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3078 | PELOGE(limLog(pMac, LOGE, FL("WPS overlap timeout, sessionId=%d"), sessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3079 | |
| 3080 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId)) == NULL) |
| 3081 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3082 | PELOGE(limLog(pMac, LOGP,FL("Session Does not exist for given sessionID"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3083 | return; |
| 3084 | } |
| 3085 | |
| 3086 | limWPSPBCTimeout(pMac, psessionEntry); |
| 3087 | } |
| 3088 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | /**---------------------------------------------- |
| 3091 | \fn limStartQuietTimer |
| 3092 | \brief Starts the quiet timer. |
| 3093 | |
| 3094 | \param pMac |
| 3095 | \return NONE |
| 3096 | -----------------------------------------------*/ |
| 3097 | void limStartQuietTimer(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 3098 | { |
| 3099 | tpPESession psessionEntry; |
| 3100 | psessionEntry = peFindSessionBySessionId(pMac , sessionId); |
| 3101 | |
| 3102 | if(psessionEntry == NULL) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3103 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3104 | return; |
| 3105 | } |
| 3106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3107 | |
| 3108 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 3109 | return; |
| 3110 | // First, de-activate Timer, if its already active |
| 3111 | limCancelDot11hQuiet(pMac, psessionEntry); |
| 3112 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3113 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_QUIET_TIMER)); |
| 3114 | if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 3115 | { |
| 3116 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3117 | FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3118 | } |
| 3119 | |
| 3120 | // Set the NEW timeout value, in ticks |
| 3121 | if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer, |
| 3122 | SYS_MS_TO_TICKS(psessionEntry->gLimSpecMgmt.quietTimeoutValue), 0)) |
| 3123 | { |
| 3124 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3125 | FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3126 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3127 | |
| 3128 | pMac->lim.limTimers.gLimQuietTimer.sessionId = sessionId; |
| 3129 | if( TX_SUCCESS != tx_timer_activate(&pMac->lim.limTimers.gLimQuietTimer)) |
| 3130 | { |
| 3131 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3132 | FL("Unable to activate gLimQuietTimer! STA cannot honor Quiet BSS!")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3133 | limRestorePreQuietState(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3134 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3135 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3136 | return; |
| 3137 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | } |
| 3139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3140 | |
| 3141 | /** ------------------------------------------------------------------------ **/ |
| 3142 | /** |
| 3143 | * keep track of the number of ANI peers associated in the BSS |
| 3144 | * For the first and last ANI peer, we have to update EDCA params as needed |
| 3145 | * |
| 3146 | * When the first ANI peer joins the BSS, we notify SCH |
| 3147 | * When the last ANI peer leaves the BSS, we notfiy SCH |
| 3148 | */ |
| 3149 | void |
| 3150 | limUtilCountStaAdd( |
| 3151 | tpAniSirGlobal pMac, |
| 3152 | tpDphHashNode pSta, |
| 3153 | tpPESession psessionEntry) |
| 3154 | { |
| 3155 | |
| 3156 | if ((! pSta) || (! pSta->valid) || (! pSta->aniPeer) || (pSta->fAniCount)) |
| 3157 | return; |
| 3158 | |
| 3159 | pSta->fAniCount = 1; |
| 3160 | |
| 3161 | if (pMac->lim.gLimNumOfAniSTAs++ != 0) |
| 3162 | return; |
| 3163 | |
| 3164 | // get here only if this is the first ANI peer in the BSS |
| 3165 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 3166 | } |
| 3167 | |
| 3168 | void |
| 3169 | limUtilCountStaDel( |
| 3170 | tpAniSirGlobal pMac, |
| 3171 | tpDphHashNode pSta, |
| 3172 | tpPESession psessionEntry) |
| 3173 | { |
| 3174 | |
| 3175 | if ((pSta == NULL) || (pSta->aniPeer == eHAL_CLEAR) || (! pSta->fAniCount)) |
| 3176 | return; |
| 3177 | |
| 3178 | /* Only if sta is invalid and the validInDummyState bit is set to 1, |
| 3179 | * then go ahead and update the count and profiles. This ensures |
| 3180 | * that the "number of ani station" count is properly incremented/decremented. |
| 3181 | */ |
| 3182 | if (pSta->valid == 1) |
| 3183 | return; |
| 3184 | |
| 3185 | pSta->fAniCount = 0; |
| 3186 | |
| 3187 | if (pMac->lim.gLimNumOfAniSTAs <= 0) |
| 3188 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3189 | 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] | 3190 | pMac->lim.gLimNumOfAniSTAs); |
| 3191 | return; |
| 3192 | } |
| 3193 | |
| 3194 | pMac->lim.gLimNumOfAniSTAs--; |
| 3195 | |
| 3196 | if (pMac->lim.gLimNumOfAniSTAs != 0) |
| 3197 | return; |
| 3198 | |
| 3199 | // get here only if this is the last ANI peer in the BSS |
| 3200 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 3201 | } |
| 3202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3203 | /** |
| 3204 | * limSwitchChannelCback() |
| 3205 | * |
| 3206 | *FUNCTION: |
| 3207 | * This is the callback function registered while requesting to switch channel |
| 3208 | * after AP indicates a channel switch for spectrum management (11h). |
| 3209 | * |
| 3210 | *NOTE: |
| 3211 | * @param pMac Pointer to Global MAC structure |
| 3212 | * @param status Status of channel switch request |
| 3213 | * @param data User data |
| 3214 | * @param psessionEntry Session information |
| 3215 | * @return NONE |
| 3216 | */ |
| 3217 | void limSwitchChannelCback(tpAniSirGlobal pMac, eHalStatus status, |
| 3218 | tANI_U32 *data, tpPESession psessionEntry) |
| 3219 | { |
| 3220 | tSirMsgQ mmhMsg = {0}; |
| 3221 | tSirSmeSwitchChannelInd *pSirSmeSwitchChInd; |
| 3222 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3223 | psessionEntry->currentOperChannel = psessionEntry->currentReqChannel; |
| 3224 | |
| 3225 | /* We need to restore pre-channelSwitch state on the STA */ |
| 3226 | if (limRestorePreChannelSwitchState(pMac, psessionEntry) != eSIR_SUCCESS) |
| 3227 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3228 | 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] | 3229 | return; |
| 3230 | } |
| 3231 | |
| 3232 | mmhMsg.type = eWNI_SME_SWITCH_CHL_REQ; |
| 3233 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeSwitchChInd, sizeof(tSirSmeSwitchChannelInd))) |
| 3234 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3235 | limLog(pMac, LOGP, FL("Failed to allocate buffer for buffer descriptor")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3236 | return; |
| 3237 | } |
| 3238 | |
| 3239 | pSirSmeSwitchChInd->messageType = eWNI_SME_SWITCH_CHL_REQ; |
| 3240 | pSirSmeSwitchChInd->length = sizeof(tSirSmeSwitchChannelInd); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3241 | pSirSmeSwitchChInd->newChannelId = psessionEntry->gLimChannelSwitch.primaryChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3242 | pSirSmeSwitchChInd->sessionId = psessionEntry->smeSessionId; |
| 3243 | //BSS ID |
| 3244 | palCopyMemory( pMac->hHdd, pSirSmeSwitchChInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
| 3245 | mmhMsg.bodyptr = pSirSmeSwitchChInd; |
| 3246 | mmhMsg.bodyval = 0; |
| 3247 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3248 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3250 | SysProcessMmhMsg(pMac, &mmhMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3251 | } |
| 3252 | |
| 3253 | /** |
| 3254 | * limSwitchPrimaryChannel() |
| 3255 | * |
| 3256 | *FUNCTION: |
| 3257 | * This function changes the current operating channel |
| 3258 | * and sets the new new channel ID in WNI_CFG_CURRENT_CHANNEL. |
| 3259 | * |
| 3260 | *NOTE: |
| 3261 | * @param pMac Pointer to Global MAC structure |
| 3262 | * @param newChannel new chnannel ID |
| 3263 | * @return NONE |
| 3264 | */ |
| 3265 | void limSwitchPrimaryChannel(tpAniSirGlobal pMac, tANI_U8 newChannel,tpPESession psessionEntry) |
| 3266 | { |
| 3267 | #if !defined WLAN_FEATURE_VOWIFI |
| 3268 | tANI_U32 localPwrConstraint; |
| 3269 | #endif |
| 3270 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3271 | PELOG3(limLog(pMac, LOG3, FL("limSwitchPrimaryChannel: old chnl %d --> new chnl %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3272 | psessionEntry->currentOperChannel, newChannel);) |
| 3273 | psessionEntry->currentReqChannel = newChannel; |
| 3274 | psessionEntry->limRFBand = limGetRFBand(newChannel); |
| 3275 | |
| 3276 | psessionEntry->channelChangeReasonCode=LIM_SWITCH_CHANNEL_OPERATION; |
| 3277 | |
| 3278 | pMac->lim.gpchangeChannelCallback = limSwitchChannelCback; |
| 3279 | pMac->lim.gpchangeChannelData = NULL; |
| 3280 | |
| 3281 | #if defined WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3282 | limSendSwitchChnlParams(pMac, newChannel, PHY_SINGLE_CHANNEL_CENTERED, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3283 | psessionEntry->maxTxPower, psessionEntry->peSessionId); |
| 3284 | #else |
| 3285 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) |
| 3286 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3287 | limLog( pMac, LOGP, FL( "Unable to read Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3288 | return; |
| 3289 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3290 | limSendSwitchChnlParams(pMac, newChannel, PHY_SINGLE_CHANNEL_CENTERED, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3291 | (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
| 3292 | #endif |
| 3293 | return; |
| 3294 | } |
| 3295 | |
| 3296 | /** |
| 3297 | * limSwitchPrimarySecondaryChannel() |
| 3298 | * |
| 3299 | *FUNCTION: |
| 3300 | * This function changes the primary and secondary channel. |
| 3301 | * If 11h is enabled and user provides a "new channel ID" |
| 3302 | * that is different from the current operating channel, |
| 3303 | * then we must set this new channel in WNI_CFG_CURRENT_CHANNEL, |
| 3304 | * assign notify LIM of such change. |
| 3305 | * |
| 3306 | *NOTE: |
| 3307 | * @param pMac Pointer to Global MAC structure |
| 3308 | * @param newChannel New chnannel ID (or current channel ID) |
| 3309 | * @param subband CB secondary info: |
| 3310 | * - eANI_CB_SECONDARY_NONE |
| 3311 | * - eANI_CB_SECONDARY_UP |
| 3312 | * - eANI_CB_SECONDARY_DOWN |
| 3313 | * @return NONE |
| 3314 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3315 | void limSwitchPrimarySecondaryChannel(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U8 newChannel, ePhyChanBondState subband) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3316 | { |
| 3317 | #if !defined WLAN_FEATURE_VOWIFI |
| 3318 | tANI_U32 localPwrConstraint; |
| 3319 | #endif |
| 3320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3321 | #if !defined WLAN_FEATURE_VOWIFI |
| 3322 | 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] | 3323 | limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3324 | return; |
| 3325 | } |
| 3326 | #endif |
| 3327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3328 | #if defined WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3329 | limSendSwitchChnlParams(pMac, newChannel, subband, psessionEntry->maxTxPower, psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3330 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3331 | limSendSwitchChnlParams(pMac, newChannel, subband, (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3332 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3333 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3334 | // Store the new primary and secondary channel in session entries if different |
| 3335 | if (psessionEntry->currentOperChannel != newChannel) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3336 | { |
| 3337 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3338 | FL("switch old chnl %d --> new chnl %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3339 | psessionEntry->currentOperChannel, newChannel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3340 | psessionEntry->currentOperChannel = newChannel; |
| 3341 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3342 | if (psessionEntry->htSecondaryChannelOffset != subband) |
| 3343 | { |
| 3344 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3345 | FL("switch old sec chnl %d --> new sec chnl %d "), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3346 | psessionEntry->htSecondaryChannelOffset, subband); |
| 3347 | psessionEntry->htSecondaryChannelOffset = subband; |
| 3348 | if (psessionEntry->htSecondaryChannelOffset == PHY_SINGLE_CHANNEL_CENTERED) |
| 3349 | { |
| 3350 | psessionEntry->htSupportedChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3351 | } |
| 3352 | else |
| 3353 | { |
| 3354 | psessionEntry->htSupportedChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3355 | } |
| 3356 | psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; |
| 3357 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3358 | |
| 3359 | return; |
| 3360 | } |
| 3361 | |
| 3362 | |
| 3363 | /** |
| 3364 | * limActiveScanAllowed() |
| 3365 | * |
| 3366 | *FUNCTION: |
| 3367 | * Checks if active scans are permitted on the given channel |
| 3368 | * |
| 3369 | *LOGIC: |
| 3370 | * The config variable SCAN_CONTROL_LIST contains pairs of (channelNum, activeScanAllowed) |
| 3371 | * Need to check if the channelNum matches, then depending on the corresponding |
| 3372 | * scan flag, return true (for activeScanAllowed==1) or false (otherwise). |
| 3373 | * |
| 3374 | *ASSUMPTIONS: |
| 3375 | * |
| 3376 | *NOTE: |
| 3377 | * |
| 3378 | * @param pMac Pointer to Global MAC structure |
| 3379 | * @param channelNum channel number |
| 3380 | * @return None |
| 3381 | */ |
| 3382 | |
| 3383 | tANI_U8 limActiveScanAllowed( |
| 3384 | tpAniSirGlobal pMac, |
| 3385 | tANI_U8 channelNum) |
| 3386 | { |
| 3387 | tANI_U32 i; |
| 3388 | tANI_U8 channelPair[WNI_CFG_SCAN_CONTROL_LIST_LEN]; |
| 3389 | tANI_U32 len = WNI_CFG_SCAN_CONTROL_LIST_LEN; |
| 3390 | if (wlan_cfgGetStr(pMac, WNI_CFG_SCAN_CONTROL_LIST, channelPair, &len) |
| 3391 | != eSIR_SUCCESS) |
| 3392 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3393 | PELOGE(limLog(pMac, LOGE, FL("Unable to get scan control list"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3394 | return false; |
| 3395 | } |
| 3396 | |
| 3397 | if (len > WNI_CFG_SCAN_CONTROL_LIST_LEN) |
| 3398 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3399 | limLog(pMac, LOGE, FL("Invalid scan control list length:%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3400 | len); |
| 3401 | return false; |
| 3402 | } |
| 3403 | |
| 3404 | for (i=0; (i+1) < len; i+=2) |
| 3405 | { |
| 3406 | if (channelPair[i] == channelNum) |
| 3407 | return ((channelPair[i+1] == eSIR_ACTIVE_SCAN) ? true : false); |
| 3408 | } |
| 3409 | return false; |
| 3410 | } |
| 3411 | |
| 3412 | /** |
| 3413 | * limTriggerBackgroundScanDuringQuietBss() |
| 3414 | * |
| 3415 | *FUNCTION: |
| 3416 | * This function is applicable to the STA only. |
| 3417 | * This function is called by limProcessQuietTimeout(), |
| 3418 | * when it is time to honor the Quiet BSS IE from the AP. |
| 3419 | * |
| 3420 | *LOGIC: |
| 3421 | * If 11H is enabled: |
| 3422 | * We cannot trigger a background scan. The STA needs to |
| 3423 | * shut-off Tx/Rx. |
| 3424 | * If 11 is not enabled: |
| 3425 | * Determine if the next channel that we are going to |
| 3426 | * scan is NOT the same channel (or not) on which the |
| 3427 | * Quiet BSS was requested. |
| 3428 | * If yes, then we cannot trigger a background scan on |
| 3429 | * this channel. Return with a false. |
| 3430 | * If no, then trigger a background scan. Return with |
| 3431 | * a true. |
| 3432 | * |
| 3433 | *ASSUMPTIONS: |
| 3434 | * |
| 3435 | *NOTE: |
| 3436 | * This API is redundant if the existing API, |
| 3437 | * limTriggerBackgroundScan(), were to return a valid |
| 3438 | * response instead of returning void. |
| 3439 | * If possible, try to revisit this API |
| 3440 | * |
| 3441 | * @param pMac Pointer to Global MAC structure |
| 3442 | * @return eSIR_TRUE, if a background scan was attempted |
| 3443 | * eSIR_FALSE, if not |
| 3444 | */ |
| 3445 | tAniBool limTriggerBackgroundScanDuringQuietBss( tpAniSirGlobal pMac ) |
| 3446 | { |
| 3447 | tAniBool bScanTriggered = eSIR_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3448 | |
| 3449 | |
| 3450 | |
| 3451 | //TBD-RAJESH HOW TO GET sessionEntry????? |
| 3452 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 3453 | |
| 3454 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 3455 | return bScanTriggered; |
| 3456 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3457 | if( !psessionEntry->lim11hEnable ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3458 | { |
| 3459 | tSirMacChanNum bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN]; |
| 3460 | tANI_U32 len = WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN; |
| 3461 | |
| 3462 | // Determine the next scan channel |
| 3463 | |
| 3464 | // Get background scan channel list from CFG |
| 3465 | if( eSIR_SUCCESS == wlan_cfgGetStr( pMac, |
| 3466 | WNI_CFG_BG_SCAN_CHANNEL_LIST, |
| 3467 | (tANI_U8 *) bgScanChannelList, |
| 3468 | (tANI_U32 *) &len )) |
| 3469 | { |
| 3470 | // Ensure that we do not go off scanning on the same |
| 3471 | // channel on which the Quiet BSS was requested |
| 3472 | if( psessionEntry->currentOperChannel!= |
| 3473 | bgScanChannelList[pMac->lim.gLimBackgroundScanChannelId] ) |
| 3474 | { |
| 3475 | // For now, try and attempt a background scan. It will |
| 3476 | // be ideal if this API actually returns a success or |
| 3477 | // failure instead of having a void return type |
| 3478 | limTriggerBackgroundScan( pMac ); |
| 3479 | |
| 3480 | bScanTriggered = eSIR_TRUE; |
| 3481 | } |
| 3482 | else |
| 3483 | { |
| 3484 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3485 | 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] | 3486 | } |
| 3487 | } |
| 3488 | else |
| 3489 | { |
| 3490 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3491 | 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] | 3492 | } |
| 3493 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3494 | return bScanTriggered; |
| 3495 | } |
| 3496 | |
| 3497 | |
| 3498 | /** |
| 3499 | * limGetHTCapability() |
| 3500 | * |
| 3501 | *FUNCTION: |
| 3502 | * A utility function that returns the "current HT capability state" for the HT |
| 3503 | * capability of interest (as requested in the API) |
| 3504 | * |
| 3505 | *LOGIC: |
| 3506 | * This routine will return with the "current" setting of a requested HT |
| 3507 | * capability. This state info could be retrieved from - |
| 3508 | * a) CFG (for static entries) |
| 3509 | * b) Run time info |
| 3510 | * - Dynamic state maintained by LIM |
| 3511 | * - Configured at radio init time by SME |
| 3512 | * |
| 3513 | * |
| 3514 | *ASSUMPTIONS: |
| 3515 | * NA |
| 3516 | * |
| 3517 | *NOTE: |
| 3518 | * |
| 3519 | * @param pMac Pointer to Global MAC structure |
| 3520 | * @param htCap The HT capability being queried |
| 3521 | * @return tANI_U8 The current state of the requested HT capability is returned in a |
| 3522 | * tANI_U8 variable |
| 3523 | */ |
| 3524 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3525 | tANI_U8 limGetHTCapability( tpAniSirGlobal pMac, |
| 3526 | tANI_U32 htCap, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | { |
| 3528 | tANI_U8 retVal = 0; |
| 3529 | tANI_U8 *ptr; |
| 3530 | tANI_U32 cfgValue; |
| 3531 | tSirMacHTCapabilityInfo macHTCapabilityInfo = {0}; |
| 3532 | tSirMacExtendedHTCapabilityInfo macExtHTCapabilityInfo = {0}; |
| 3533 | tSirMacTxBFCapabilityInfo macTxBFCapabilityInfo = {0}; |
| 3534 | tSirMacASCapabilityInfo macASCapabilityInfo = {0}; |
| 3535 | |
| 3536 | // |
| 3537 | // Determine which CFG to read from. Not ALL of the HT |
| 3538 | // related CFG's need to be read each time this API is |
| 3539 | // accessed |
| 3540 | // |
| 3541 | if( htCap >= eHT_ANTENNA_SELECTION && |
| 3542 | htCap < eHT_SI_GRANULARITY ) |
| 3543 | { |
| 3544 | // Get Antenna Seletion HT Capabilities |
| 3545 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_AS_CAP, &cfgValue )) |
| 3546 | cfgValue = 0; |
| 3547 | ptr = (tANI_U8 *) &macASCapabilityInfo; |
| 3548 | *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff); |
| 3549 | } |
| 3550 | else |
| 3551 | { |
| 3552 | if( htCap >= eHT_TX_BEAMFORMING && |
| 3553 | htCap < eHT_ANTENNA_SELECTION ) |
| 3554 | { |
| 3555 | // Get Transmit Beam Forming HT Capabilities |
| 3556 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_TX_BF_CAP, &cfgValue )) |
| 3557 | cfgValue = 0; |
| 3558 | ptr = (tANI_U8 *) &macTxBFCapabilityInfo; |
| 3559 | *((tANI_U32 *)ptr) = (tANI_U32) (cfgValue); |
| 3560 | } |
| 3561 | else |
| 3562 | { |
| 3563 | if( htCap >= eHT_PCO && |
| 3564 | htCap < eHT_TX_BEAMFORMING ) |
| 3565 | { |
| 3566 | // Get Extended HT Capabilities |
| 3567 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_EXT_HT_CAP_INFO, &cfgValue )) |
| 3568 | cfgValue = 0; |
| 3569 | ptr = (tANI_U8 *) &macExtHTCapabilityInfo; |
| 3570 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 3571 | } |
| 3572 | else |
| 3573 | { |
| 3574 | if( htCap < eHT_MAX_RX_AMPDU_FACTOR ) |
| 3575 | { |
| 3576 | // Get HT Capabilities |
| 3577 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_HT_CAP_INFO, &cfgValue )) |
| 3578 | cfgValue = 0; |
| 3579 | ptr = (tANI_U8 *) &macHTCapabilityInfo; |
| 3580 | // 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 |
| 3581 | *ptr++ = cfgValue & 0xff; |
| 3582 | *ptr = (cfgValue >> 8) & 0xff; |
| 3583 | } |
| 3584 | } |
| 3585 | } |
| 3586 | } |
| 3587 | |
| 3588 | switch( htCap ) |
| 3589 | { |
| 3590 | case eHT_LSIG_TXOP_PROTECTION: |
| 3591 | retVal = pMac->lim.gHTLsigTXOPProtection; |
| 3592 | break; |
| 3593 | |
| 3594 | case eHT_STBC_CONTROL_FRAME: |
| 3595 | retVal = (tANI_U8) macHTCapabilityInfo.stbcControlFrame; |
| 3596 | break; |
| 3597 | |
| 3598 | case eHT_PSMP: |
| 3599 | retVal = pMac->lim.gHTPSMPSupport; |
| 3600 | break; |
| 3601 | |
| 3602 | case eHT_DSSS_CCK_MODE_40MHZ: |
| 3603 | retVal = pMac->lim.gHTDsssCckRate40MHzSupport; |
| 3604 | break; |
| 3605 | |
| 3606 | case eHT_MAX_AMSDU_LENGTH: |
| 3607 | retVal = (tANI_U8) macHTCapabilityInfo.maximalAMSDUsize; |
| 3608 | break; |
| 3609 | |
| 3610 | case eHT_DELAYED_BA: |
| 3611 | retVal = (tANI_U8) macHTCapabilityInfo.delayedBA; |
| 3612 | break; |
| 3613 | |
| 3614 | case eHT_RX_STBC: |
| 3615 | retVal = (tANI_U8) macHTCapabilityInfo.rxSTBC; |
| 3616 | break; |
| 3617 | |
| 3618 | case eHT_TX_STBC: |
| 3619 | retVal = (tANI_U8) macHTCapabilityInfo.txSTBC; |
| 3620 | break; |
| 3621 | |
| 3622 | case eHT_SHORT_GI_40MHZ: |
| 3623 | retVal = (tANI_U8) macHTCapabilityInfo.shortGI40MHz; |
| 3624 | break; |
| 3625 | |
| 3626 | case eHT_SHORT_GI_20MHZ: |
| 3627 | retVal = (tANI_U8) macHTCapabilityInfo.shortGI20MHz; |
| 3628 | break; |
| 3629 | |
| 3630 | case eHT_GREENFIELD: |
| 3631 | retVal = (tANI_U8) macHTCapabilityInfo.greenField; |
| 3632 | break; |
| 3633 | |
| 3634 | case eHT_MIMO_POWER_SAVE: |
| 3635 | retVal = (tANI_U8) pMac->lim.gHTMIMOPSState; |
| 3636 | break; |
| 3637 | |
| 3638 | case eHT_SUPPORTED_CHANNEL_WIDTH_SET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3639 | retVal = (tANI_U8) psessionEntry->htSupportedChannelWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3640 | break; |
| 3641 | |
| 3642 | case eHT_ADVANCED_CODING: |
| 3643 | retVal = (tANI_U8) macHTCapabilityInfo.advCodingCap; |
| 3644 | break; |
| 3645 | |
| 3646 | case eHT_MAX_RX_AMPDU_FACTOR: |
| 3647 | retVal = pMac->lim.gHTMaxRxAMpduFactor; |
| 3648 | break; |
| 3649 | |
| 3650 | case eHT_MPDU_DENSITY: |
| 3651 | retVal = pMac->lim.gHTAMpduDensity; |
| 3652 | break; |
| 3653 | |
| 3654 | case eHT_PCO: |
| 3655 | retVal = (tANI_U8) macExtHTCapabilityInfo.pco; |
| 3656 | break; |
| 3657 | |
| 3658 | case eHT_TRANSITION_TIME: |
| 3659 | retVal = (tANI_U8) macExtHTCapabilityInfo.transitionTime; |
| 3660 | break; |
| 3661 | |
| 3662 | case eHT_MCS_FEEDBACK: |
| 3663 | retVal = (tANI_U8) macExtHTCapabilityInfo.mcsFeedback; |
| 3664 | break; |
| 3665 | |
| 3666 | case eHT_TX_BEAMFORMING: |
| 3667 | retVal = (tANI_U8) macTxBFCapabilityInfo.txBF; |
| 3668 | break; |
| 3669 | |
| 3670 | case eHT_ANTENNA_SELECTION: |
| 3671 | retVal = (tANI_U8) macASCapabilityInfo.antennaSelection; |
| 3672 | break; |
| 3673 | |
| 3674 | case eHT_SI_GRANULARITY: |
| 3675 | retVal = pMac->lim.gHTServiceIntervalGranularity; |
| 3676 | break; |
| 3677 | |
| 3678 | case eHT_CONTROLLED_ACCESS: |
| 3679 | retVal = pMac->lim.gHTControlledAccessOnly; |
| 3680 | break; |
| 3681 | |
| 3682 | case eHT_RIFS_MODE: |
| 3683 | retVal = psessionEntry->beaconParams.fRIFSMode; |
| 3684 | break; |
| 3685 | |
| 3686 | case eHT_RECOMMENDED_TX_WIDTH_SET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3687 | retVal = psessionEntry->htRecommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3688 | break; |
| 3689 | |
| 3690 | case eHT_EXTENSION_CHANNEL_OFFSET: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3691 | retVal = psessionEntry->htSecondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3692 | break; |
| 3693 | |
| 3694 | case eHT_OP_MODE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3695 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 3696 | retVal = psessionEntry->htOperMode; |
| 3697 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3698 | retVal = pMac->lim.gHTOperMode; |
| 3699 | break; |
| 3700 | |
| 3701 | case eHT_BASIC_STBC_MCS: |
| 3702 | retVal = pMac->lim.gHTSTBCBasicMCS; |
| 3703 | break; |
| 3704 | |
| 3705 | case eHT_DUAL_CTS_PROTECTION: |
| 3706 | retVal = pMac->lim.gHTDualCTSProtection; |
| 3707 | break; |
| 3708 | |
| 3709 | case eHT_LSIG_TXOP_PROTECTION_FULL_SUPPORT: |
| 3710 | retVal = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport; |
| 3711 | break; |
| 3712 | |
| 3713 | case eHT_PCO_ACTIVE: |
| 3714 | retVal = pMac->lim.gHTPCOActive; |
| 3715 | break; |
| 3716 | |
| 3717 | case eHT_PCO_PHASE: |
| 3718 | retVal = pMac->lim.gHTPCOPhase; |
| 3719 | break; |
| 3720 | |
| 3721 | default: |
| 3722 | break; |
| 3723 | } |
| 3724 | |
| 3725 | return retVal; |
| 3726 | } |
| 3727 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3728 | void limGetMyMacAddr(tpAniSirGlobal pMac, tANI_U8 *mac) |
| 3729 | { |
| 3730 | palCopyMemory( pMac->hHdd, mac, pMac->lim.gLimMyMacAddr, sizeof(tSirMacAddr)); |
| 3731 | return; |
| 3732 | } |
| 3733 | |
| 3734 | |
| 3735 | |
| 3736 | |
| 3737 | /** ------------------------------------------------------------- |
| 3738 | \fn limEnable11aProtection |
| 3739 | \brief based on config setting enables\disables 11a protection. |
| 3740 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 3741 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 3742 | \param tpUpdateBeaconParams pBeaconParams |
| 3743 | \return None |
| 3744 | -------------------------------------------------------------*/ |
| 3745 | tSirRetStatus |
| 3746 | limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 3747 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 3748 | { |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3749 | if(NULL == psessionEntry) |
| 3750 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3751 | PELOG3(limLog(pMac, LOG3, FL("psessionEntry is NULL"));) |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3752 | return eSIR_FAILURE; |
| 3753 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3754 | //overlapping protection configuration check. |
| 3755 | if(overlap) |
| 3756 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3757 | } |
| 3758 | else |
| 3759 | { |
| 3760 | //normal protection config check |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 3761 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3762 | (!psessionEntry->cfgProtection.fromlla)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3763 | { |
| 3764 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3765 | PELOG3(limLog(pMac, LOG3, FL("protection from 11a is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3766 | return eSIR_SUCCESS; |
| 3767 | } |
| 3768 | } |
| 3769 | |
| 3770 | if (enable) |
| 3771 | { |
| 3772 | //If we are AP and HT capable, we need to set the HT OP mode |
| 3773 | //appropriately. |
| 3774 | 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] | 3775 | (true == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3776 | { |
| 3777 | if(overlap) |
| 3778 | { |
| 3779 | pMac->lim.gLimOverlap11aParams.protectionEnabled = true; |
| 3780 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 3781 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 3782 | { |
| 3783 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3784 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3785 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3786 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3787 | } |
| 3788 | } |
| 3789 | else |
| 3790 | { |
| 3791 | psessionEntry->gLim11aParams.protectionEnabled = true; |
| 3792 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 3793 | { |
| 3794 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3795 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3796 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3797 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3798 | |
| 3799 | } |
| 3800 | } |
| 3801 | } |
| 3802 | |
| 3803 | //This part is common for staiton as well. |
| 3804 | if(false == psessionEntry->beaconParams.llaCoexist) |
| 3805 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3806 | PELOG1(limLog(pMac, LOG1, FL(" => protection from 11A Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3807 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = true; |
| 3808 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3809 | } |
| 3810 | } |
| 3811 | else if (true == psessionEntry->beaconParams.llaCoexist) |
| 3812 | { |
| 3813 | //for AP role. |
| 3814 | //we need to take care of HT OP mode change if needed. |
| 3815 | //We need to take care of Overlap cases. |
| 3816 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 3817 | { |
| 3818 | if(overlap) |
| 3819 | { |
| 3820 | //Overlap Legacy protection disabled. |
| 3821 | pMac->lim.gLimOverlap11aParams.protectionEnabled = false; |
| 3822 | |
| 3823 | //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] | 3824 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3825 | { |
| 3826 | // no HT op mode change if any of the overlap protection enabled. |
| 3827 | if(!(pMac->lim.gLimOverlap11aParams.protectionEnabled || |
| 3828 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 3829 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 3830 | |
| 3831 | { |
| 3832 | //Check if there is a need to change HT OP mode. |
| 3833 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 3834 | { |
| 3835 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3836 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3837 | |
| 3838 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 3839 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 3840 | else |
| 3841 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 3842 | } |
| 3843 | } |
| 3844 | } |
| 3845 | } |
| 3846 | else |
| 3847 | { |
| 3848 | //Disable protection from 11A stations. |
| 3849 | psessionEntry->gLim11aParams.protectionEnabled = false; |
| 3850 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3851 | |
| 3852 | //Check if any other non-HT protection enabled. |
| 3853 | //Right now we are in HT OP Mixed mode. |
| 3854 | //Change HT op mode appropriately. |
| 3855 | |
| 3856 | //Change HT OP mode to 01 if any overlap protection enabled |
| 3857 | if(pMac->lim.gLimOverlap11aParams.protectionEnabled || |
| 3858 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 3859 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 3860 | |
| 3861 | { |
| 3862 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3863 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3864 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3865 | } |
| 3866 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 3867 | { |
| 3868 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3869 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3870 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3871 | } |
| 3872 | else |
| 3873 | { |
| 3874 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3875 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3876 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 3877 | } |
| 3878 | } |
| 3879 | if(!pMac->lim.gLimOverlap11aParams.protectionEnabled && |
| 3880 | !psessionEntry->gLim11aParams.protectionEnabled) |
| 3881 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3882 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11A Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3883 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = false; |
| 3884 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3885 | } |
| 3886 | } |
| 3887 | //for station role |
| 3888 | else |
| 3889 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3890 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11A Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3891 | pBeaconParams->llaCoexist = psessionEntry->beaconParams.llaCoexist = false; |
| 3892 | pBeaconParams->paramChangeBitmap |= PARAM_llACOEXIST_CHANGED; |
| 3893 | } |
| 3894 | } |
| 3895 | |
| 3896 | return eSIR_SUCCESS; |
| 3897 | } |
| 3898 | |
| 3899 | /** ------------------------------------------------------------- |
| 3900 | \fn limEnable11gProtection |
| 3901 | \brief based on config setting enables\disables 11g protection. |
| 3902 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 3903 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 3904 | \param tpUpdateBeaconParams pBeaconParams |
| 3905 | \return None |
| 3906 | -------------------------------------------------------------*/ |
| 3907 | |
| 3908 | tSirRetStatus |
| 3909 | limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 3910 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 3911 | { |
| 3912 | |
| 3913 | //overlapping protection configuration check. |
| 3914 | if(overlap) |
| 3915 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3916 | } |
| 3917 | else |
| 3918 | { |
| 3919 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3920 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 3921 | !psessionEntry->cfgProtection.fromllb) |
| 3922 | { |
| 3923 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3924 | PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3925 | return eSIR_SUCCESS; |
| 3926 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3927 | { |
| 3928 | if(!pMac->lim.cfgProtection.fromllb) |
| 3929 | { |
| 3930 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3931 | PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3932 | return eSIR_SUCCESS; |
| 3933 | } |
| 3934 | } |
| 3935 | } |
| 3936 | |
| 3937 | if (enable) |
| 3938 | { |
| 3939 | //If we are AP and HT capable, we need to set the HT OP mode |
| 3940 | //appropriately. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3941 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 3942 | { |
| 3943 | if(overlap) |
| 3944 | { |
| 3945 | psessionEntry->gLimOlbcParams.protectionEnabled = true; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3946 | PELOGE(limLog(pMac, LOGE, FL("protection from olbc is enabled"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3947 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | { |
| 3949 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 3950 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 3951 | { |
| 3952 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3953 | } |
| 3954 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 3955 | // This fixes issue of OBSS bit not set after 11b, 11g station leaves |
| 3956 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3957 | //Not processing OBSS bit from other APs, as we are already taking care |
| 3958 | //of Protection from overlapping BSS based on erp IE or useProtection bit |
| 3959 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams, psessionEntry); |
| 3960 | } |
| 3961 | } |
| 3962 | else |
| 3963 | { |
| 3964 | psessionEntry->gLim11bParams.protectionEnabled = true; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3965 | PELOGE(limLog(pMac, LOGE, FL("protection from 11b is enabled"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3966 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3967 | { |
| 3968 | if(eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode) |
| 3969 | { |
| 3970 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
| 3971 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3972 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3973 | } |
| 3974 | } |
| 3975 | } |
| 3976 | }else if ((eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3977 | (true == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3978 | { |
| 3979 | if(overlap) |
| 3980 | { |
| 3981 | psessionEntry->gLimOlbcParams.protectionEnabled = true; |
| 3982 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 3983 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 3984 | { |
| 3985 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 3986 | } |
| 3987 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 3988 | // This fixes issue of OBSS bit not set after 11b, 11g station leaves |
| 3989 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 3990 | //Not processing OBSS bit from other APs, as we are already taking care |
| 3991 | //of Protection from overlapping BSS based on erp IE or useProtection bit |
| 3992 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams, psessionEntry); |
| 3993 | } |
| 3994 | else |
| 3995 | { |
| 3996 | psessionEntry->gLim11bParams.protectionEnabled = true; |
| 3997 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 3998 | { |
| 3999 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4000 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4001 | limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4002 | } |
| 4003 | } |
| 4004 | } |
| 4005 | |
| 4006 | //This part is common for staiton as well. |
| 4007 | if(false == psessionEntry->beaconParams.llbCoexist) |
| 4008 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4009 | PELOG1(limLog(pMac, LOG1, FL("=> 11G Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4010 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = true; |
| 4011 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4012 | } |
| 4013 | } |
| 4014 | else if (true == psessionEntry->beaconParams.llbCoexist) |
| 4015 | { |
| 4016 | //for AP role. |
| 4017 | //we need to take care of HT OP mode change if needed. |
| 4018 | //We need to take care of Overlap cases. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4019 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4020 | { |
| 4021 | if(overlap) |
| 4022 | { |
| 4023 | //Overlap Legacy protection disabled. |
| 4024 | psessionEntry->gLimOlbcParams.protectionEnabled = false; |
| 4025 | |
| 4026 | //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] | 4027 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4028 | { |
| 4029 | // no HT op mode change if any of the overlap protection enabled. |
| 4030 | if(!(psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4031 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4032 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4033 | { |
| 4034 | //Check if there is a need to change HT OP mode. |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 4035 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4036 | { |
| 4037 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4038 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4039 | if(psessionEntry->gLimHt20Params.protectionEnabled){ |
| 4040 | //Commenting out beacuse of CR 258588 WFA cert |
| 4041 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4042 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4043 | } |
| 4044 | else |
| 4045 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4046 | } |
| 4047 | } |
| 4048 | } |
| 4049 | } |
| 4050 | else |
| 4051 | { |
| 4052 | //Disable protection from 11B stations. |
| 4053 | psessionEntry->gLim11bParams.protectionEnabled = false; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4054 | PELOGE(limLog(pMac, LOGE, FL("===> 11B Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4055 | //Check if any other non-HT protection enabled. |
| 4056 | if(!psessionEntry->gLim11gParams.protectionEnabled) |
| 4057 | { |
| 4058 | //Right now we are in HT OP Mixed mode. |
| 4059 | //Change HT op mode appropriately. |
| 4060 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4061 | |
| 4062 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4063 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4064 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4065 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4066 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled) |
| 4067 | { |
| 4068 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4069 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4070 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4071 | } |
| 4072 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4073 | { |
| 4074 | //Commenting because of CR 258588 WFA cert |
| 4075 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4076 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4077 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4078 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4079 | } |
| 4080 | else |
| 4081 | { |
| 4082 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4083 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4084 | } |
| 4085 | } |
| 4086 | } |
| 4087 | if(!psessionEntry->gLimOlbcParams.protectionEnabled && |
| 4088 | !psessionEntry->gLim11bParams.protectionEnabled) |
| 4089 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4090 | PELOGE(limLog(pMac, LOGE, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4091 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4092 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4093 | } |
| 4094 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4095 | { |
| 4096 | if(overlap) |
| 4097 | { |
| 4098 | //Overlap Legacy protection disabled. |
| 4099 | psessionEntry->gLimOlbcParams.protectionEnabled = false; |
| 4100 | |
| 4101 | //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] | 4102 | if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4103 | { |
| 4104 | // no HT op mode change if any of the overlap protection enabled. |
| 4105 | if(!(pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4106 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4107 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 4108 | |
| 4109 | { |
| 4110 | //Check if there is a need to change HT OP mode. |
| 4111 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4112 | { |
| 4113 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4114 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4115 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4116 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4117 | else |
| 4118 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4119 | } |
| 4120 | } |
| 4121 | } |
| 4122 | } |
| 4123 | else |
| 4124 | { |
| 4125 | //Disable protection from 11B stations. |
| 4126 | psessionEntry->gLim11bParams.protectionEnabled = false; |
| 4127 | //Check if any other non-HT protection enabled. |
| 4128 | if(!psessionEntry->gLim11gParams.protectionEnabled) |
| 4129 | { |
| 4130 | //Right now we are in HT OP Mixed mode. |
| 4131 | //Change HT op mode appropriately. |
| 4132 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4133 | |
| 4134 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4135 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4136 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4137 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4138 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 4139 | |
| 4140 | { |
| 4141 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4142 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4143 | } |
| 4144 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4145 | { |
| 4146 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4147 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4148 | } |
| 4149 | else |
| 4150 | { |
| 4151 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4152 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4153 | } |
| 4154 | } |
| 4155 | } |
| 4156 | if(!psessionEntry->gLimOlbcParams.protectionEnabled && |
| 4157 | !psessionEntry->gLim11bParams.protectionEnabled) |
| 4158 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4159 | PELOG1(limLog(pMac, LOG1, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4160 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4161 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4162 | } |
| 4163 | } |
| 4164 | //for station role |
| 4165 | else |
| 4166 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4167 | PELOG1(limLog(pMac, LOG1, FL("===> 11G Protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4168 | pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; |
| 4169 | pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; |
| 4170 | } |
| 4171 | } |
| 4172 | return eSIR_SUCCESS; |
| 4173 | } |
| 4174 | |
| 4175 | /** ------------------------------------------------------------- |
| 4176 | \fn limEnableHtProtectionFrom11g |
| 4177 | \brief based on cofig enables\disables protection from 11g. |
| 4178 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4179 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4180 | \param tpUpdateBeaconParams pBeaconParams |
| 4181 | \return None |
| 4182 | -------------------------------------------------------------*/ |
| 4183 | tSirRetStatus |
| 4184 | limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4185 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4186 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4187 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4188 | return eSIR_SUCCESS; // protection from 11g is only for HT stations. |
| 4189 | |
| 4190 | //overlapping protection configuration check. |
| 4191 | if(overlap) |
| 4192 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4193 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && (!psessionEntry->cfgProtection.overlapFromllg)) |
| 4194 | { |
| 4195 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4196 | PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4197 | return eSIR_SUCCESS; |
| 4198 | }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] | 4199 | { |
| 4200 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4201 | PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4202 | return eSIR_SUCCESS; |
| 4203 | } |
| 4204 | } |
| 4205 | else |
| 4206 | { |
| 4207 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4208 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4209 | !psessionEntry->cfgProtection.fromllg){ |
| 4210 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4211 | PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4212 | return eSIR_SUCCESS; |
| 4213 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4214 | { |
| 4215 | if(!pMac->lim.cfgProtection.fromllg) |
| 4216 | { |
| 4217 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4218 | PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4219 | return eSIR_SUCCESS; |
| 4220 | } |
| 4221 | } |
| 4222 | } |
| 4223 | if (enable) |
| 4224 | { |
| 4225 | //If we are AP and HT capable, we need to set the HT OP mode |
| 4226 | //appropriately. |
| 4227 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4228 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4229 | { |
| 4230 | if(overlap) |
| 4231 | { |
| 4232 | psessionEntry->gLimOverlap11gParams.protectionEnabled = true; |
| 4233 | //11g exists in overlap BSS. |
| 4234 | //need not to change the operating mode to overlap_legacy |
| 4235 | //if higher or same protection operating mode is enabled right now. |
| 4236 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 4237 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 4238 | { |
| 4239 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4240 | } |
| 4241 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4242 | limEnableHtOBSSProtection(pMac, true , overlap, pBeaconParams, psessionEntry); |
| 4243 | } |
| 4244 | else |
| 4245 | { |
| 4246 | //11g is associated to an AP operating in 11n mode. |
| 4247 | //Change the HT operating mode to 'mixed mode'. |
| 4248 | psessionEntry->gLim11gParams.protectionEnabled = true; |
| 4249 | if(eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode) |
| 4250 | { |
| 4251 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4252 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4253 | limEnableHtOBSSProtection(pMac, true , overlap, pBeaconParams,psessionEntry); |
| 4254 | } |
| 4255 | } |
| 4256 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4257 | { |
| 4258 | if(overlap) |
| 4259 | { |
| 4260 | pMac->lim.gLimOverlap11gParams.protectionEnabled = true; |
| 4261 | //11g exists in overlap BSS. |
| 4262 | //need not to change the operating mode to overlap_legacy |
| 4263 | //if higher or same protection operating mode is enabled right now. |
| 4264 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 4265 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 4266 | { |
| 4267 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4268 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4269 | } |
| 4270 | } |
| 4271 | else |
| 4272 | { |
| 4273 | //11g is associated to an AP operating in 11n mode. |
| 4274 | //Change the HT operating mode to 'mixed mode'. |
| 4275 | psessionEntry->gLim11gParams.protectionEnabled = true; |
| 4276 | if(eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) |
| 4277 | { |
| 4278 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_MIXED; |
| 4279 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4280 | limEnableHtOBSSProtection(pMac, true , overlap, pBeaconParams,psessionEntry); |
| 4281 | } |
| 4282 | } |
| 4283 | } |
| 4284 | |
| 4285 | //This part is common for staiton as well. |
| 4286 | if(false == psessionEntry->beaconParams.llgCoexist) |
| 4287 | { |
| 4288 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = true; |
| 4289 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4290 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4291 | else if (true == psessionEntry->gLimOverlap11gParams.protectionEnabled) |
| 4292 | { |
| 4293 | // As operating mode changed after G station assoc some way to update beacon |
| 4294 | // This addresses the issue of mode not changing to - 11 in beacon when OBSS overlap is enabled |
| 4295 | //pMac->sch.schObject.fBeaconChanged = 1; |
| 4296 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4297 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4298 | } |
| 4299 | else if (true == psessionEntry->beaconParams.llgCoexist) |
| 4300 | { |
| 4301 | //for AP role. |
| 4302 | //we need to take care of HT OP mode change if needed. |
| 4303 | //We need to take care of Overlap cases. |
| 4304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole) |
| 4306 | { |
| 4307 | if(overlap) |
| 4308 | { |
| 4309 | //Overlap Legacy protection disabled. |
| 4310 | if (psessionEntry->gLim11gParams.numSta == 0) |
| 4311 | psessionEntry->gLimOverlap11gParams.protectionEnabled = false; |
| 4312 | |
| 4313 | // no HT op mode change if any of the overlap protection enabled. |
| 4314 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4315 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4316 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4317 | { |
| 4318 | //Check if there is a need to change HT OP mode. |
| 4319 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
| 4320 | { |
| 4321 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4322 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4323 | |
| 4324 | if(psessionEntry->gLimHt20Params.protectionEnabled){ |
| 4325 | //Commenting because of CR 258588 WFA cert |
| 4326 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4327 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4328 | } |
| 4329 | else |
| 4330 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4331 | } |
| 4332 | } |
| 4333 | } |
| 4334 | else |
| 4335 | { |
| 4336 | //Disable protection from 11G stations. |
| 4337 | psessionEntry->gLim11gParams.protectionEnabled = false; |
| 4338 | //Check if any other non-HT protection enabled. |
| 4339 | if(!psessionEntry->gLim11bParams.protectionEnabled) |
| 4340 | { |
| 4341 | |
| 4342 | //Right now we are in HT OP Mixed mode. |
| 4343 | //Change HT op mode appropriately. |
| 4344 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4345 | |
| 4346 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4347 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4348 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4349 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4350 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled) |
| 4351 | |
| 4352 | { |
| 4353 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4354 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4355 | } |
| 4356 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4357 | { |
| 4358 | //Commenting because of CR 258588 WFA cert |
| 4359 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4360 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4361 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4362 | } |
| 4363 | else |
| 4364 | { |
| 4365 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4366 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4367 | } |
| 4368 | } |
| 4369 | } |
| 4370 | if(!psessionEntry->gLimOverlap11gParams.protectionEnabled && |
| 4371 | !psessionEntry->gLim11gParams.protectionEnabled) |
| 4372 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4373 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4374 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4375 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4376 | } |
| 4377 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4378 | { |
| 4379 | if(overlap) |
| 4380 | { |
| 4381 | //Overlap Legacy protection disabled. |
| 4382 | pMac->lim.gLimOverlap11gParams.protectionEnabled = false; |
| 4383 | |
| 4384 | // no HT op mode change if any of the overlap protection enabled. |
| 4385 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4386 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4387 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4388 | { |
| 4389 | //Check if there is a need to change HT OP mode. |
| 4390 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4391 | { |
| 4392 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4393 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4394 | |
| 4395 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4396 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4397 | else |
| 4398 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4399 | } |
| 4400 | } |
| 4401 | } |
| 4402 | else |
| 4403 | { |
| 4404 | //Disable protection from 11G stations. |
| 4405 | psessionEntry->gLim11gParams.protectionEnabled = false; |
| 4406 | //Check if any other non-HT protection enabled. |
| 4407 | if(!psessionEntry->gLim11bParams.protectionEnabled) |
| 4408 | { |
| 4409 | |
| 4410 | //Right now we are in HT OP Mixed mode. |
| 4411 | //Change HT op mode appropriately. |
| 4412 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4413 | |
| 4414 | //Change HT OP mode to 01 if any overlap protection enabled |
| 4415 | if(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4416 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4417 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4418 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled) |
| 4419 | |
| 4420 | { |
| 4421 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4422 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4423 | } |
| 4424 | else if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4425 | { |
| 4426 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4427 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4428 | } |
| 4429 | else |
| 4430 | { |
| 4431 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4432 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4433 | } |
| 4434 | } |
| 4435 | } |
| 4436 | if(!pMac->lim.gLimOverlap11gParams.protectionEnabled && |
| 4437 | !psessionEntry->gLim11gParams.protectionEnabled) |
| 4438 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4439 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4440 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4441 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4442 | } |
| 4443 | } |
| 4444 | //for station role |
| 4445 | else |
| 4446 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4447 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from 11G Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4448 | pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; |
| 4449 | pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; |
| 4450 | } |
| 4451 | } |
| 4452 | return eSIR_SUCCESS; |
| 4453 | } |
| 4454 | //FIXME_PROTECTION : need to check for no APSD whenever we want to enable this protection. |
| 4455 | //This check will be done at the caller. |
| 4456 | |
| 4457 | /** ------------------------------------------------------------- |
| 4458 | \fn limEnableHtObssProtection |
| 4459 | \brief based on cofig enables\disables obss protection. |
| 4460 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4461 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4462 | \param tpUpdateBeaconParams pBeaconParams |
| 4463 | \return None |
| 4464 | -------------------------------------------------------------*/ |
| 4465 | tSirRetStatus |
| 4466 | limEnableHtOBSSProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4467 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4468 | { |
| 4469 | |
| 4470 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4471 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4472 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4473 | |
| 4474 | //overlapping protection configuration check. |
| 4475 | if(overlap) |
| 4476 | { |
| 4477 | //overlapping protection configuration check. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4478 | } |
| 4479 | else |
| 4480 | { |
| 4481 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4482 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && !psessionEntry->cfgProtection.obss) |
| 4483 | { //ToDo Update this field |
| 4484 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4485 | PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4486 | return eSIR_SUCCESS; |
| 4487 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4488 | { |
| 4489 | if(!pMac->lim.cfgProtection.obss) |
| 4490 | { //ToDo Update this field |
| 4491 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4492 | PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4493 | return eSIR_SUCCESS; |
| 4494 | } |
| 4495 | } |
| 4496 | } |
| 4497 | |
| 4498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4499 | if (eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4500 | if ((enable) && (false == psessionEntry->beaconParams.gHTObssMode) ) |
| 4501 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4502 | PELOG1(limLog(pMac, LOG1, FL("=>obss protection enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4503 | psessionEntry->beaconParams.gHTObssMode = true; |
| 4504 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; // UPDATE AN ENUM FOR OBSS MODE <todo> |
| 4505 | |
| 4506 | } |
| 4507 | else if (!enable && (true == psessionEntry->beaconParams.gHTObssMode)) |
| 4508 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4509 | PELOG1(limLog(pMac, LOG1, FL("===> obss Protection disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4510 | psessionEntry->beaconParams.gHTObssMode = false; |
| 4511 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; |
| 4512 | |
| 4513 | } |
| 4514 | //CR-263021: OBSS bit is not switching back to 0 after disabling the overlapping legacy BSS |
| 4515 | if (!enable && !overlap) |
| 4516 | { |
| 4517 | psessionEntry->gLimOverlap11gParams.protectionEnabled = false; |
| 4518 | } |
| 4519 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4520 | { |
| 4521 | if ((enable) && (false == psessionEntry->beaconParams.gHTObssMode) ) |
| 4522 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4523 | PELOG1(limLog(pMac, LOG1, FL("=>obss protection enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4524 | psessionEntry->beaconParams.gHTObssMode = true; |
| 4525 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; // UPDATE AN ENUM FOR OBSS MODE <todo> |
| 4526 | |
| 4527 | } |
| 4528 | else if (!enable && (true == psessionEntry->beaconParams.gHTObssMode)) |
| 4529 | { |
| 4530 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4531 | PELOG1(limLog(pMac, LOG1, FL("===> obss Protection disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4532 | psessionEntry->beaconParams.gHTObssMode = false; |
| 4533 | pBeaconParams->paramChangeBitmap |= PARAM_OBSS_MODE_CHANGED; |
| 4534 | |
| 4535 | } |
| 4536 | } |
| 4537 | return eSIR_SUCCESS; |
| 4538 | } |
| 4539 | /** ------------------------------------------------------------- |
| 4540 | \fn limEnableHT20Protection |
| 4541 | \brief based on cofig enables\disables protection from Ht20. |
| 4542 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4543 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4544 | \param tpUpdateBeaconParams pBeaconParams |
| 4545 | \return None |
| 4546 | -------------------------------------------------------------*/ |
| 4547 | tSirRetStatus |
| 4548 | limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4549 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4550 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4551 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4553 | |
| 4554 | //overlapping protection configuration check. |
| 4555 | if(overlap) |
| 4556 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4557 | } |
| 4558 | else |
| 4559 | { |
| 4560 | //normal protection config check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4561 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4562 | !psessionEntry->cfgProtection.ht20) |
| 4563 | { |
| 4564 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4565 | PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4566 | return eSIR_SUCCESS; |
| 4567 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4568 | { |
| 4569 | if(!pMac->lim.cfgProtection.ht20) |
| 4570 | { |
| 4571 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4572 | PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4573 | return eSIR_SUCCESS; |
| 4574 | } |
| 4575 | } |
| 4576 | } |
| 4577 | |
| 4578 | if (enable) |
| 4579 | { |
| 4580 | //If we are AP and HT capable, we need to set the HT OP mode |
| 4581 | //appropriately. |
| 4582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4583 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4584 | if(overlap) |
| 4585 | { |
| 4586 | psessionEntry->gLimOverlapHt20Params.protectionEnabled = true; |
| 4587 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != psessionEntry->htOperMode) && |
| 4588 | (eSIR_HT_OP_MODE_MIXED != psessionEntry->htOperMode)) |
| 4589 | { |
| 4590 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4591 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4592 | } |
| 4593 | } |
| 4594 | else |
| 4595 | { |
| 4596 | psessionEntry->gLimHt20Params.protectionEnabled = true; |
| 4597 | if(eSIR_HT_OP_MODE_PURE == psessionEntry->htOperMode) |
| 4598 | { |
| 4599 | //Commenting because of CR 258588 WFA cert |
| 4600 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4601 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4602 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4603 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4604 | } |
| 4605 | } |
| 4606 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4607 | { |
| 4608 | if(overlap) |
| 4609 | { |
| 4610 | pMac->lim.gLimOverlapHt20Params.protectionEnabled = true; |
| 4611 | if((eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode) && |
| 4612 | (eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode)) |
| 4613 | { |
| 4614 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 4615 | limEnableHtRifsProtection(pMac, true, overlap, pBeaconParams,psessionEntry); |
| 4616 | } |
| 4617 | } |
| 4618 | else |
| 4619 | { |
| 4620 | psessionEntry->gLimHt20Params.protectionEnabled = true; |
| 4621 | if(eSIR_HT_OP_MODE_PURE == pMac->lim.gHTOperMode) |
| 4622 | { |
| 4623 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4624 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4625 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4626 | } |
| 4627 | } |
| 4628 | } |
| 4629 | |
| 4630 | //This part is common for staiton as well. |
| 4631 | if(false == psessionEntry->beaconParams.ht20Coexist) |
| 4632 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4633 | PELOG1(limLog(pMac, LOG1, FL("=> Prtection from HT20 Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4634 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = true; |
| 4635 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4636 | } |
| 4637 | } |
| 4638 | else if (true == psessionEntry->beaconParams.ht20Coexist) |
| 4639 | { |
| 4640 | //for AP role. |
| 4641 | //we need to take care of HT OP mode change if needed. |
| 4642 | //We need to take care of Overlap cases. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4643 | if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ |
| 4644 | if(overlap) |
| 4645 | { |
| 4646 | //Overlap Legacy protection disabled. |
| 4647 | psessionEntry->gLimOverlapHt20Params.protectionEnabled = false; |
| 4648 | |
| 4649 | // no HT op mode change if any of the overlap protection enabled. |
| 4650 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4651 | psessionEntry->gLimOverlap11gParams.protectionEnabled || |
| 4652 | psessionEntry->gLimOverlapHt20Params.protectionEnabled || |
| 4653 | psessionEntry->gLimOverlapNonGfParams.protectionEnabled)) |
| 4654 | { |
| 4655 | |
| 4656 | //Check if there is a need to change HT OP mode. |
| 4657 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode) |
| 4658 | { |
| 4659 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4660 | { |
| 4661 | //Commented beacuse of CR 258588 for WFA Cert |
| 4662 | //psessionEntry->htOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4663 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4664 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4665 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4666 | } |
| 4667 | else |
| 4668 | { |
| 4669 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4670 | } |
| 4671 | } |
| 4672 | } |
| 4673 | } |
| 4674 | else |
| 4675 | { |
| 4676 | //Disable protection from 11G stations. |
| 4677 | psessionEntry->gLimHt20Params.protectionEnabled = false; |
| 4678 | |
| 4679 | //Change HT op mode appropriately. |
| 4680 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == psessionEntry->htOperMode) |
| 4681 | { |
| 4682 | psessionEntry->htOperMode = eSIR_HT_OP_MODE_PURE; |
| 4683 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4684 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4685 | } |
| 4686 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4687 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT 20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4688 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4689 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4690 | }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4691 | { |
| 4692 | if(overlap) |
| 4693 | { |
| 4694 | //Overlap Legacy protection disabled. |
| 4695 | pMac->lim.gLimOverlapHt20Params.protectionEnabled = false; |
| 4696 | |
| 4697 | // no HT op mode change if any of the overlap protection enabled. |
| 4698 | if(!(psessionEntry->gLimOlbcParams.protectionEnabled || |
| 4699 | pMac->lim.gLimOverlap11gParams.protectionEnabled || |
| 4700 | pMac->lim.gLimOverlapHt20Params.protectionEnabled || |
| 4701 | pMac->lim.gLimOverlapNonGfParams.protectionEnabled)) |
| 4702 | { |
| 4703 | |
| 4704 | //Check if there is a need to change HT OP mode. |
| 4705 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode) |
| 4706 | { |
| 4707 | if(psessionEntry->gLimHt20Params.protectionEnabled) |
| 4708 | { |
| 4709 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 4710 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4711 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4712 | } |
| 4713 | else |
| 4714 | { |
| 4715 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4716 | } |
| 4717 | } |
| 4718 | } |
| 4719 | } |
| 4720 | else |
| 4721 | { |
| 4722 | //Disable protection from 11G stations. |
| 4723 | psessionEntry->gLimHt20Params.protectionEnabled = false; |
| 4724 | |
| 4725 | //Change HT op mode appropriately. |
| 4726 | if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pMac->lim.gHTOperMode) |
| 4727 | { |
| 4728 | pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE; |
| 4729 | limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4730 | limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); |
| 4731 | } |
| 4732 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4733 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT 20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4734 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4735 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4736 | } |
| 4737 | //for station role |
| 4738 | else |
| 4739 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4740 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT20 Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4741 | pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; |
| 4742 | pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; |
| 4743 | } |
| 4744 | } |
| 4745 | |
| 4746 | return eSIR_SUCCESS; |
| 4747 | } |
| 4748 | |
| 4749 | /** ------------------------------------------------------------- |
| 4750 | \fn limEnableHTNonGfProtection |
| 4751 | \brief based on cofig enables\disables protection from NonGf. |
| 4752 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4753 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4754 | \param tpUpdateBeaconParams pBeaconParams |
| 4755 | \return None |
| 4756 | -------------------------------------------------------------*/ |
| 4757 | tSirRetStatus |
| 4758 | limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4759 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4760 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4761 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4762 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4763 | |
| 4764 | //overlapping protection configuration check. |
| 4765 | if(overlap) |
| 4766 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4767 | } |
| 4768 | else |
| 4769 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4770 | //normal protection config check |
| 4771 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4772 | !psessionEntry->cfgProtection.nonGf) |
| 4773 | { |
| 4774 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4775 | PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4776 | return eSIR_SUCCESS; |
| 4777 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4778 | { |
| 4779 | //normal protection config check |
| 4780 | if(!pMac->lim.cfgProtection.nonGf) |
| 4781 | { |
| 4782 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4783 | PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4784 | return eSIR_SUCCESS; |
| 4785 | } |
| 4786 | } |
| 4787 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4788 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 4789 | if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4790 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4791 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from non GF Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4792 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = true; |
| 4793 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4794 | } |
| 4795 | else if (!enable && (true == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4796 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4797 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from Non GF Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4798 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = false; |
| 4799 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4800 | } |
| 4801 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4802 | { |
| 4803 | if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4804 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4805 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from non GF Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4806 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = true; |
| 4807 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4808 | } |
| 4809 | else if (!enable && (true == psessionEntry->beaconParams.llnNonGFCoexist)) |
| 4810 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4811 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from Non GF Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4812 | pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = false; |
| 4813 | pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; |
| 4814 | } |
| 4815 | } |
| 4816 | |
| 4817 | return eSIR_SUCCESS; |
| 4818 | } |
| 4819 | |
| 4820 | /** ------------------------------------------------------------- |
| 4821 | \fn limEnableHTLsigTxopProtection |
| 4822 | \brief based on cofig enables\disables LsigTxop protection. |
| 4823 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4824 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4825 | \param tpUpdateBeaconParams pBeaconParams |
| 4826 | \return None |
| 4827 | -------------------------------------------------------------*/ |
| 4828 | tSirRetStatus |
| 4829 | limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4830 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4831 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4832 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4833 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4834 | |
| 4835 | //overlapping protection configuration check. |
| 4836 | if(overlap) |
| 4837 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4838 | } |
| 4839 | else |
| 4840 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | //normal protection config check |
| 4842 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 4843 | !psessionEntry->cfgProtection.lsigTxop) |
| 4844 | { |
| 4845 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4846 | PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4847 | return eSIR_SUCCESS; |
| 4848 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4849 | { |
| 4850 | //normal protection config check |
| 4851 | if(!pMac->lim.cfgProtection.lsigTxop) |
| 4852 | { |
| 4853 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4854 | PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4855 | return eSIR_SUCCESS; |
| 4856 | } |
| 4857 | } |
| 4858 | } |
| 4859 | |
| 4860 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4861 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 4862 | if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4863 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4864 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from LsigTxop Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4865 | pBeaconParams->fLsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = true; |
| 4866 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4867 | } |
| 4868 | else if (!enable && (true == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4869 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4870 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from LsigTxop Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4871 | pBeaconParams->fLsigTXOPProtectionFullSupport= psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = false; |
| 4872 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4873 | } |
| 4874 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4875 | { |
| 4876 | if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4877 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4878 | PELOG1(limLog(pMac, LOG1, FL(" => Prtection from LsigTxop Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4879 | pBeaconParams->fLsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = true; |
| 4880 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4881 | } |
| 4882 | else if (!enable && (true == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) |
| 4883 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4884 | PELOG1(limLog(pMac, LOG1, FL("===> Protection from LsigTxop Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4885 | pBeaconParams->fLsigTXOPProtectionFullSupport= psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = false; |
| 4886 | pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; |
| 4887 | } |
| 4888 | } |
| 4889 | return eSIR_SUCCESS; |
| 4890 | } |
| 4891 | //FIXME_PROTECTION : need to check for no APSD whenever we want to enable this protection. |
| 4892 | //This check will be done at the caller. |
| 4893 | /** ------------------------------------------------------------- |
| 4894 | \fn limEnableHtRifsProtection |
| 4895 | \brief based on cofig enables\disables Rifs protection. |
| 4896 | \param tANI_U8 enable : 1=> enable protection, 0=> disable protection. |
| 4897 | \param tANI_U8 overlap: 1=> called from overlap context, 0 => called from assoc context. |
| 4898 | \param tpUpdateBeaconParams pBeaconParams |
| 4899 | \return None |
| 4900 | -------------------------------------------------------------*/ |
| 4901 | tSirRetStatus |
| 4902 | limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, |
| 4903 | tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 4904 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4905 | if(!psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4906 | return eSIR_SUCCESS; // this protection is only for HT stations. |
| 4907 | |
| 4908 | |
| 4909 | //overlapping protection configuration check. |
| 4910 | if(overlap) |
| 4911 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4912 | } |
| 4913 | else |
| 4914 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4915 | //normal protection config check |
| 4916 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
| 4917 | !psessionEntry->cfgProtection.rifs) |
| 4918 | { |
| 4919 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4920 | PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4921 | return eSIR_SUCCESS; |
| 4922 | }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4923 | { |
| 4924 | //normal protection config check |
| 4925 | if(!pMac->lim.cfgProtection.rifs) |
| 4926 | { |
| 4927 | // protection disabled. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4928 | PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4929 | return eSIR_SUCCESS; |
| 4930 | } |
| 4931 | } |
| 4932 | } |
| 4933 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4934 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 4935 | // Disabling the RIFS Protection means Enable the RIFS mode of operation in the BSS |
| 4936 | if ((!enable) && (false == psessionEntry->beaconParams.fRIFSMode)) |
| 4937 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4938 | PELOG1(limLog(pMac, LOG1, FL(" => Rifs protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4939 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = true; |
| 4940 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 4941 | } |
| 4942 | // Enabling the RIFS Protection means Disable the RIFS mode of operation in the BSS |
| 4943 | else if (enable && (true == psessionEntry->beaconParams.fRIFSMode)) |
| 4944 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4945 | PELOG1(limLog(pMac, LOG1, FL("===> Rifs Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4946 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = false; |
| 4947 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 4948 | } |
| 4949 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4950 | { |
| 4951 | // Disabling the RIFS Protection means Enable the RIFS mode of operation in the BSS |
| 4952 | if ((!enable) && (false == psessionEntry->beaconParams.fRIFSMode)) |
| 4953 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4954 | PELOG1(limLog(pMac, LOG1, FL(" => Rifs protection Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4955 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = true; |
| 4956 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 4957 | } |
| 4958 | // Enabling the RIFS Protection means Disable the RIFS mode of operation in the BSS |
| 4959 | else if (enable && (true == psessionEntry->beaconParams.fRIFSMode)) |
| 4960 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4961 | PELOG1(limLog(pMac, LOG1, FL("===> Rifs Protection Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4962 | pBeaconParams->fRIFSMode = psessionEntry->beaconParams.fRIFSMode = false; |
| 4963 | pBeaconParams->paramChangeBitmap |= PARAM_RIFS_MODE_CHANGED; |
| 4964 | } |
| 4965 | } |
| 4966 | return eSIR_SUCCESS; |
| 4967 | } |
| 4968 | |
| 4969 | // --------------------------------------------------------------------- |
| 4970 | /** |
| 4971 | * limEnableShortPreamble |
| 4972 | * |
| 4973 | * FUNCTION: |
| 4974 | * Enable/Disable short preamble |
| 4975 | * |
| 4976 | * LOGIC: |
| 4977 | * |
| 4978 | * ASSUMPTIONS: |
| 4979 | * |
| 4980 | * NOTE: |
| 4981 | * |
| 4982 | * @param enable Flag to enable/disable short preamble |
| 4983 | * @return None |
| 4984 | */ |
| 4985 | |
| 4986 | tSirRetStatus |
| 4987 | limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 4988 | { |
| 4989 | tANI_U32 val; |
| 4990 | |
| 4991 | if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != eSIR_SUCCESS) |
| 4992 | { |
| 4993 | /* Could not get short preamble enabled flag from CFG. Log error. */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4994 | limLog(pMac, LOGP, FL("could not retrieve short preamble flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4995 | return eSIR_FAILURE; |
| 4996 | } |
| 4997 | |
| 4998 | if (!val) |
| 4999 | return eSIR_SUCCESS; |
| 5000 | |
| 5001 | if (wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_PREAMBLE_ENABLED, &val) != eSIR_SUCCESS) |
| 5002 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5003 | 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] | 5004 | return eSIR_FAILURE; |
| 5005 | } |
| 5006 | |
| 5007 | if (!val) // 11G short preamble switching is disabled. |
| 5008 | return eSIR_SUCCESS; |
| 5009 | |
| 5010 | if ( psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 5011 | { |
| 5012 | if (enable && (psessionEntry->beaconParams.fShortPreamble == 0)) |
| 5013 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5014 | PELOG1(limLog(pMac, LOG1, FL("===> Short Preamble Enabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5015 | psessionEntry->beaconParams.fShortPreamble = true; |
| 5016 | pBeaconParams->fShortPreamble = (tANI_U8) psessionEntry->beaconParams.fShortPreamble; |
| 5017 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_PREAMBLE_CHANGED; |
| 5018 | } |
| 5019 | else if (!enable && (psessionEntry->beaconParams.fShortPreamble == 1)) |
| 5020 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5021 | PELOG1(limLog(pMac, LOG1, FL("===> Short Preamble Disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | psessionEntry->beaconParams.fShortPreamble = false; |
| 5023 | pBeaconParams->fShortPreamble = (tANI_U8) psessionEntry->beaconParams.fShortPreamble; |
| 5024 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_PREAMBLE_CHANGED; |
| 5025 | } |
| 5026 | } |
| 5027 | |
| 5028 | return eSIR_SUCCESS; |
| 5029 | } |
| 5030 | |
| 5031 | /** |
| 5032 | * limTxComplete |
| 5033 | * |
| 5034 | * Function: |
| 5035 | * This is LIM's very own "TX MGMT frame complete" completion routine. |
| 5036 | * |
| 5037 | * Logic: |
| 5038 | * LIM wants to send a MGMT frame (broadcast or unicast) |
| 5039 | * LIM allocates memory using palPktAlloc( ..., **pData, **pPacket ) |
| 5040 | * LIM transmits the MGMT frame using the API: |
| 5041 | * halTxFrame( ... pPacket, ..., (void *) limTxComplete, pData ) |
| 5042 | * HDD, via halTxFrame/DXE, "transfers" the packet over to BMU |
| 5043 | * HDD, if it determines that a TX completion routine (in this case |
| 5044 | * limTxComplete) has been provided, will invoke this callback |
| 5045 | * LIM will try to free the TX MGMT packet that was earlier allocated, in order |
| 5046 | * to send this MGMT frame, using the PAL API palPktFree( ... pData, pPacket ) |
| 5047 | * |
| 5048 | * Assumptions: |
| 5049 | * Presently, this is ONLY being used for MGMT frames/packets |
| 5050 | * TODO: |
| 5051 | * Would it do good for LIM to have some sort of "signature" validation to |
| 5052 | * ensure that the pData argument passed in was a buffer that was actually |
| 5053 | * allocated by LIM and/or is not corrupted? |
| 5054 | * |
| 5055 | * Note: FIXME and TODO |
| 5056 | * Looks like palPktFree() is interested in pPacket. But, when this completion |
| 5057 | * routine is called, only pData is made available to LIM!! |
| 5058 | * |
| 5059 | * @param void A pointer to pData. Shouldn't it be pPacket?! |
| 5060 | * |
| 5061 | * @return none |
| 5062 | */ |
| 5063 | void limTxComplete( tHalHandle hHal, void *pData ) |
| 5064 | { |
| 5065 | tpAniSirGlobal pMac; |
| 5066 | pMac = (tpAniSirGlobal)hHal; |
| 5067 | |
| 5068 | #ifdef FIXME_PRIMA |
| 5069 | /* the trace logic needs to be fixed for Prima. Refer to CR 306075 */ |
| 5070 | #ifdef TRACE_RECORD |
| 5071 | { |
| 5072 | tpSirMacMgmtHdr mHdr; |
| 5073 | v_U8_t *pRxBd; |
| 5074 | vos_pkt_t *pVosPkt; |
| 5075 | VOS_STATUS vosStatus; |
| 5076 | |
| 5077 | |
| 5078 | |
| 5079 | pVosPkt = (vos_pkt_t *)pData; |
| 5080 | vosStatus = vos_pkt_peek_data( pVosPkt, 0, (v_PVOID_t *)&pRxBd, WLANHAL_RX_BD_HEADER_SIZE); |
| 5081 | |
| 5082 | if(VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 5083 | { |
| 5084 | mHdr = WDA_GET_RX_MAC_HEADER(pRxBd); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5085 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, NO_SESSION, mHdr->fc.subType);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5086 | |
| 5087 | } |
| 5088 | } |
| 5089 | #endif |
| 5090 | #endif |
| 5091 | |
| 5092 | palPktFree( pMac->hHdd, |
| 5093 | HAL_TXRX_FRM_802_11_MGMT, |
| 5094 | (void *) NULL, // this is ignored and will likely be removed from this API |
| 5095 | (void *) pData ); // lim passed in pPacket in the pData pointer that is given in this completion routine |
| 5096 | } |
| 5097 | |
| 5098 | /** |
| 5099 | * \brief This function updates lim global structure, if CB parameters in the BSS |
| 5100 | * have changed, and sends an indication to HAL also with the |
| 5101 | * updated HT Parameters. |
| 5102 | * This function does not detect the change in the primary channel, that is done as part |
| 5103 | * of channel Swtich IE processing. |
| 5104 | * If STA is configured with '20Mhz only' mode, then this function does not do anything |
| 5105 | * This function changes the CB mode, only if the self capability is set to '20 as well as 40Mhz' |
| 5106 | * |
| 5107 | * |
| 5108 | * \param pMac Pointer to global MAC structure |
| 5109 | * |
| 5110 | * \param pRcvdHTInfo Pointer to HT Info IE obtained from a Beacon or |
| 5111 | * Probe Response |
| 5112 | * |
| 5113 | * \param bssIdx BSS Index of the Bss to which Station is associated. |
| 5114 | * |
| 5115 | * |
| 5116 | */ |
| 5117 | |
| 5118 | void limUpdateStaRunTimeHTSwitchChnlParams( tpAniSirGlobal pMac, |
| 5119 | tDot11fIEHTInfo *pHTInfo, |
| 5120 | tANI_U8 bssIdx, |
| 5121 | tpPESession psessionEntry) |
| 5122 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5123 | ePhyChanBondState secondaryChnlOffset = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5124 | #if !defined WLAN_FEATURE_VOWIFI |
| 5125 | tANI_U32 localPwrConstraint; |
| 5126 | #endif |
| 5127 | |
| 5128 | //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] | 5129 | if( !limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5130 | return; |
| 5131 | |
| 5132 | #if !defined WLAN_FEATURE_VOWIFI |
| 5133 | 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] | 5134 | limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5135 | return; |
| 5136 | } |
| 5137 | #endif |
| 5138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5139 | if ( psessionEntry->htSecondaryChannelOffset != ( tANI_U8 ) pHTInfo->secondaryChannelOffset || |
| 5140 | psessionEntry->htRecommendedTxWidthSet != ( tANI_U8 ) pHTInfo->recommendedTxWidthSet ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5141 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5142 | psessionEntry->htSecondaryChannelOffset = ( ePhyChanBondState ) pHTInfo->secondaryChannelOffset; |
| 5143 | psessionEntry->htRecommendedTxWidthSet = ( tANI_U8 ) pHTInfo->recommendedTxWidthSet; |
| 5144 | if ( eHT_CHANNEL_WIDTH_40MHZ == psessionEntry->htRecommendedTxWidthSet ) |
| 5145 | secondaryChnlOffset = (ePhyChanBondState)pHTInfo->secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5146 | |
| 5147 | // Notify HAL |
| 5148 | limLog( pMac, LOGW, FL( "Channel Information in HT IE change" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5149 | "d; sending notification to HAL." ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5150 | limLog( pMac, LOGW, FL( "Primary Channel: %d, Secondary Chan" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5151 | "nel Offset: %d, Channel Width: %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5152 | pHTInfo->primaryChannel, secondaryChnlOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5153 | psessionEntry->htRecommendedTxWidthSet ); |
Madan Mohan Koyyalamudi | fd322a0 | 2012-10-05 12:01:26 -0700 | [diff] [blame] | 5154 | psessionEntry->channelChangeReasonCode=LIM_SWITCH_CHANNEL_OPERATION; |
| 5155 | pMac->lim.gpchangeChannelCallback = NULL; |
| 5156 | pMac->lim.gpchangeChannelData = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5157 | |
| 5158 | #if defined WLAN_FEATURE_VOWIFI |
| 5159 | limSendSwitchChnlParams( pMac, ( tANI_U8 ) pHTInfo->primaryChannel, |
| 5160 | secondaryChnlOffset, psessionEntry->maxTxPower, psessionEntry->peSessionId); |
| 5161 | #else |
| 5162 | limSendSwitchChnlParams( pMac, ( tANI_U8 ) pHTInfo->primaryChannel, |
| 5163 | secondaryChnlOffset, (tPowerdBm)localPwrConstraint, psessionEntry->peSessionId); |
| 5164 | #endif |
| 5165 | |
| 5166 | //In case of IBSS, if STA should update HT Info IE in its beacons. |
| 5167 | if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) |
| 5168 | { |
| 5169 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 5170 | } |
| 5171 | |
| 5172 | } |
| 5173 | } // End limUpdateStaRunTimeHTParams. |
| 5174 | |
| 5175 | /** |
| 5176 | * \brief This function updates the lim global structure, if any of the |
| 5177 | * HT Capabilities have changed. |
| 5178 | * |
| 5179 | * |
| 5180 | * \param pMac Pointer to Global MAC structure |
| 5181 | * |
| 5182 | * \param pHTCapability Pointer to HT Capability Information Element |
| 5183 | * obtained from a Beacon or Probe Response |
| 5184 | * |
| 5185 | * |
| 5186 | * |
| 5187 | */ |
| 5188 | |
| 5189 | void limUpdateStaRunTimeHTCapability( tpAniSirGlobal pMac, |
| 5190 | tDot11fIEHTCaps *pHTCaps ) |
| 5191 | { |
| 5192 | |
| 5193 | if ( pMac->lim.gHTLsigTXOPProtection != ( tANI_U8 ) pHTCaps->lsigTXOPProtection ) |
| 5194 | { |
| 5195 | pMac->lim.gHTLsigTXOPProtection = ( tANI_U8 ) pHTCaps->lsigTXOPProtection; |
| 5196 | // Send change notification to HAL |
| 5197 | } |
| 5198 | |
| 5199 | if ( pMac->lim.gHTAMpduDensity != ( tANI_U8 ) pHTCaps->mpduDensity ) |
| 5200 | { |
| 5201 | pMac->lim.gHTAMpduDensity = ( tANI_U8 ) pHTCaps->mpduDensity; |
| 5202 | // Send change notification to HAL |
| 5203 | } |
| 5204 | |
| 5205 | if ( pMac->lim.gHTMaxRxAMpduFactor != ( tANI_U8 ) pHTCaps->maxRxAMPDUFactor ) |
| 5206 | { |
| 5207 | pMac->lim.gHTMaxRxAMpduFactor = ( tANI_U8 ) pHTCaps->maxRxAMPDUFactor; |
| 5208 | // Send change notification to HAL |
| 5209 | } |
| 5210 | |
| 5211 | |
| 5212 | } // End limUpdateStaRunTimeHTCapability. |
| 5213 | |
| 5214 | /** |
| 5215 | * \brief This function updates lim global structure, if any of the HT |
| 5216 | * Info Parameters have changed. |
| 5217 | * |
| 5218 | * |
| 5219 | * \param pMac Pointer to the global MAC structure |
| 5220 | * |
| 5221 | * \param pHTInfo Pointer to the HT Info IE obtained from a Beacon or |
| 5222 | * Probe Response |
| 5223 | * |
| 5224 | * |
| 5225 | */ |
| 5226 | |
| 5227 | void limUpdateStaRunTimeHTInfo( tpAniSirGlobal pMac, |
| 5228 | tDot11fIEHTInfo *pHTInfo , tpPESession psessionEntry) |
| 5229 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5230 | if ( psessionEntry->htRecommendedTxWidthSet != ( tANI_U8 )pHTInfo->recommendedTxWidthSet ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5231 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5232 | psessionEntry->htRecommendedTxWidthSet = ( tANI_U8 )pHTInfo->recommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5233 | // Send change notification to HAL |
| 5234 | } |
| 5235 | |
| 5236 | if ( psessionEntry->beaconParams.fRIFSMode != ( tANI_U8 )pHTInfo->rifsMode ) |
| 5237 | { |
| 5238 | psessionEntry->beaconParams.fRIFSMode = ( tANI_U8 )pHTInfo->rifsMode; |
| 5239 | // Send change notification to HAL |
| 5240 | } |
| 5241 | |
| 5242 | if ( pMac->lim.gHTServiceIntervalGranularity != ( tANI_U8 )pHTInfo->serviceIntervalGranularity ) |
| 5243 | { |
| 5244 | pMac->lim.gHTServiceIntervalGranularity = ( tANI_U8 )pHTInfo->serviceIntervalGranularity; |
| 5245 | // Send change notification to HAL |
| 5246 | } |
| 5247 | |
| 5248 | if ( pMac->lim.gHTOperMode != ( tSirMacHTOperatingMode )pHTInfo->opMode ) |
| 5249 | { |
| 5250 | pMac->lim.gHTOperMode = ( tSirMacHTOperatingMode )pHTInfo->opMode; |
| 5251 | // Send change notification to HAL |
| 5252 | } |
| 5253 | |
| 5254 | if ( psessionEntry->beaconParams.llnNonGFCoexist != pHTInfo->nonGFDevicesPresent ) |
| 5255 | { |
| 5256 | psessionEntry->beaconParams.llnNonGFCoexist = ( tANI_U8 )pHTInfo->nonGFDevicesPresent; |
| 5257 | } |
| 5258 | |
| 5259 | if ( pMac->lim.gHTSTBCBasicMCS != ( tANI_U8 )pHTInfo->basicSTBCMCS ) |
| 5260 | { |
| 5261 | pMac->lim.gHTSTBCBasicMCS = ( tANI_U8 )pHTInfo->basicSTBCMCS; |
| 5262 | // Send change notification to HAL |
| 5263 | } |
| 5264 | |
| 5265 | if ( pMac->lim.gHTDualCTSProtection != ( tANI_U8 )pHTInfo->dualCTSProtection ) |
| 5266 | { |
| 5267 | pMac->lim.gHTDualCTSProtection = ( tANI_U8 )pHTInfo->dualCTSProtection; |
| 5268 | // Send change notification to HAL |
| 5269 | } |
| 5270 | |
| 5271 | if ( pMac->lim.gHTSecondaryBeacon != ( tANI_U8 )pHTInfo->secondaryBeacon ) |
| 5272 | { |
| 5273 | pMac->lim.gHTSecondaryBeacon = ( tANI_U8 )pHTInfo->secondaryBeacon; |
| 5274 | // Send change notification to HAL |
| 5275 | } |
| 5276 | |
| 5277 | if ( psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport != ( tANI_U8 )pHTInfo->lsigTXOPProtectionFullSupport ) |
| 5278 | { |
| 5279 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = ( tANI_U8 )pHTInfo->lsigTXOPProtectionFullSupport; |
| 5280 | // Send change notification to HAL |
| 5281 | } |
| 5282 | |
| 5283 | if ( pMac->lim.gHTPCOActive != ( tANI_U8 )pHTInfo->pcoActive ) |
| 5284 | { |
| 5285 | pMac->lim.gHTPCOActive = ( tANI_U8 )pHTInfo->pcoActive; |
| 5286 | // Send change notification to HAL |
| 5287 | } |
| 5288 | |
| 5289 | if ( pMac->lim.gHTPCOPhase != ( tANI_U8 )pHTInfo->pcoPhase ) |
| 5290 | { |
| 5291 | pMac->lim.gHTPCOPhase = ( tANI_U8 )pHTInfo->pcoPhase; |
| 5292 | // Send change notification to HAL |
| 5293 | } |
| 5294 | |
| 5295 | } // End limUpdateStaRunTimeHTInfo. |
| 5296 | |
| 5297 | |
| 5298 | /** ------------------------------------------------------------- |
| 5299 | \fn limProcessHalIndMessages |
| 5300 | \brief callback function for HAL indication |
| 5301 | \param tpAniSirGlobal pMac |
| 5302 | \param tANI_U32 mesgId |
| 5303 | \param void *mesgParam |
| 5304 | \return tSirRetStatu - status |
| 5305 | -------------------------------------------------------------*/ |
| 5306 | |
| 5307 | tSirRetStatus limProcessHalIndMessages(tpAniSirGlobal pMac, tANI_U32 msgId, void *msgParam ) |
| 5308 | { |
| 5309 | //its PE's responsibility to free msgparam when its done extracting the message parameters. |
| 5310 | tSirMsgQ msg; |
| 5311 | |
| 5312 | switch(msgId) |
| 5313 | { |
| 5314 | case SIR_LIM_DEL_TS_IND: |
| 5315 | case SIR_LIM_ADD_BA_IND: |
| 5316 | case SIR_LIM_DEL_BA_ALL_IND: |
| 5317 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 5318 | case SIR_LIM_BEACON_GEN_IND: |
| 5319 | msg.type = (tANI_U16) msgId; |
| 5320 | msg.bodyptr = msgParam; |
| 5321 | msg.bodyval = 0; |
| 5322 | break; |
| 5323 | |
| 5324 | default: |
| 5325 | palFreeMemory(pMac->hHdd, msgParam); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5326 | limLog(pMac, LOGP, FL("invalid message id = %d received"), msgId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5327 | return eSIR_FAILURE; |
| 5328 | } |
| 5329 | |
| 5330 | if (limPostMsgApi(pMac, &msg) != eSIR_SUCCESS) |
| 5331 | { |
| 5332 | palFreeMemory(pMac->hHdd, msgParam); |
| 5333 | limLog(pMac, LOGP, FL("limPostMsgApi failed for msgid = %d"), msg.type); |
| 5334 | return eSIR_FAILURE; |
| 5335 | } |
| 5336 | return eSIR_SUCCESS; |
| 5337 | } |
| 5338 | |
| 5339 | /** ------------------------------------------------------------- |
| 5340 | \fn limValidateDeltsReq |
| 5341 | \brief Validates DelTs req originated by SME or by HAL and also sends halMsg_DelTs to HAL |
| 5342 | \param tpAniSirGlobal pMac |
| 5343 | \param tpSirDeltsReq pDeltsReq |
| 5344 | \param tSirMacAddr peerMacAddr |
| 5345 | \return eSirRetStatus - status |
| 5346 | -------------------------------------------------------------*/ |
| 5347 | |
| 5348 | tSirRetStatus |
| 5349 | limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr peerMacAddr,tpPESession psessionEntry) |
| 5350 | { |
| 5351 | tpDphHashNode pSta; |
| 5352 | tANI_U8 tsStatus; |
| 5353 | tSirMacTSInfo *tsinfo; |
| 5354 | tANI_U32 i; |
| 5355 | tANI_U8 tspecIdx; |
| 5356 | /* if sta |
| 5357 | * - verify assoc state |
| 5358 | * - del tspec locally |
| 5359 | * if ap, |
| 5360 | * - verify sta is in assoc state |
| 5361 | * - del sta tspec locally |
| 5362 | */ |
| 5363 | if(pDeltsReq == NULL) |
| 5364 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5365 | PELOGE(limLog(pMac, LOGE, FL("Delete TS request pointer is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5366 | return eSIR_FAILURE; |
| 5367 | } |
| 5368 | |
| 5369 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 5370 | { |
| 5371 | tANI_U32 val; |
| 5372 | |
| 5373 | // station always talks to the AP |
| 5374 | pSta = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 5375 | |
| 5376 | val = sizeof(tSirMacAddr); |
| 5377 | #if 0 |
| 5378 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, peerMacAddr, &val) != eSIR_SUCCESS) |
| 5379 | { |
| 5380 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5381 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5382 | return eSIR_FAILURE; |
| 5383 | } |
| 5384 | #endif// TO SUPPORT BT-AMP |
| 5385 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 5386 | |
| 5387 | } |
| 5388 | else |
| 5389 | { |
| 5390 | tANI_U16 assocId; |
| 5391 | tANI_U8 *macaddr = (tANI_U8 *) peerMacAddr; |
| 5392 | |
| 5393 | assocId = pDeltsReq->aid; |
| 5394 | if (assocId != 0) |
| 5395 | pSta = dphGetHashEntry(pMac, assocId, &psessionEntry->dph.dphHashTable); |
| 5396 | else |
| 5397 | pSta = dphLookupHashEntry(pMac, pDeltsReq->macAddr, &assocId, &psessionEntry->dph.dphHashTable); |
| 5398 | |
| 5399 | if (pSta != NULL) |
| 5400 | // TBD: check sta assoc state as well |
| 5401 | for (i =0; i < sizeof(tSirMacAddr); i++) |
| 5402 | macaddr[i] = pSta->staAddr[i]; |
| 5403 | } |
| 5404 | |
| 5405 | if (pSta == NULL) |
| 5406 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5407 | PELOGE(limLog(pMac, LOGE, "Cannot find station context for delts req");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5408 | return eSIR_FAILURE; |
| 5409 | } |
| 5410 | |
| 5411 | if ((! pSta->valid) || |
| 5412 | (pSta->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)) |
| 5413 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5414 | PELOGE(limLog(pMac, LOGE, "Invalid Sta (or state) for DelTsReq");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5415 | return eSIR_FAILURE; |
| 5416 | } |
| 5417 | |
| 5418 | pDeltsReq->req.wsmTspecPresent = 0; |
| 5419 | pDeltsReq->req.wmeTspecPresent = 0; |
| 5420 | pDeltsReq->req.lleTspecPresent = 0; |
| 5421 | |
| 5422 | if ((pSta->wsmEnabled) && |
| 5423 | (pDeltsReq->req.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA)) |
| 5424 | pDeltsReq->req.wsmTspecPresent = 1; |
| 5425 | else if (pSta->wmeEnabled) |
| 5426 | pDeltsReq->req.wmeTspecPresent = 1; |
| 5427 | else if (pSta->lleEnabled) |
| 5428 | pDeltsReq->req.lleTspecPresent = 1; |
| 5429 | else |
| 5430 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5431 | PELOGW(limLog(pMac, LOGW, FL("DELTS_REQ ignore - qos is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5432 | return eSIR_FAILURE; |
| 5433 | } |
| 5434 | |
| 5435 | tsinfo = pDeltsReq->req.wmeTspecPresent ? &pDeltsReq->req.tspec.tsinfo |
| 5436 | : &pDeltsReq->req.tsinfo; |
| 5437 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5438 | 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] | 5439 | pDeltsReq->req.wmeTspecPresent, pDeltsReq->req.lleTspecPresent, pDeltsReq->req.wsmTspecPresent, |
| 5440 | tsinfo->traffic.tsid, tsinfo->traffic.userPrio, tsinfo->traffic.direction);) |
| 5441 | |
| 5442 | // if no Access Control, ignore the request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5443 | |
| 5444 | if (limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx) |
| 5445 | != eSIR_SUCCESS) |
| 5446 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5447 | 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] | 5448 | pSta->assocId, tsinfo->traffic.tsid, tsinfo->traffic.userPrio);) |
| 5449 | return eSIR_FAILURE; |
| 5450 | } |
| 5451 | else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 5452 | (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) |
| 5453 | { |
| 5454 | //edca only now. |
| 5455 | } |
| 5456 | else |
| 5457 | { |
| 5458 | if((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) && |
| 5459 | psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm) |
| 5460 | { |
| 5461 | //send message to HAL to delete TS |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5462 | if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, pSta->staIndex, tspecIdx, pDeltsReq->req, psessionEntry->peSessionId)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5463 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5464 | 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] | 5465 | tsinfo->traffic.userPrio); |
| 5466 | return eSIR_FAILURE; |
| 5467 | } |
| 5468 | } |
| 5469 | } |
| 5470 | return eSIR_SUCCESS; |
| 5471 | } |
| 5472 | |
| 5473 | /** ------------------------------------------------------------- |
| 5474 | \fn limRegisterHalIndCallBack |
| 5475 | \brief registers callback function to HAL for any indication. |
| 5476 | \param tpAniSirGlobal pMac |
| 5477 | \return none. |
| 5478 | -------------------------------------------------------------*/ |
| 5479 | void |
| 5480 | limRegisterHalIndCallBack(tpAniSirGlobal pMac) |
| 5481 | { |
| 5482 | tSirMsgQ msg; |
| 5483 | tpHalIndCB pHalCB; |
| 5484 | |
| 5485 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pHalCB, sizeof(tHalIndCB))) |
| 5486 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5487 | limLog(pMac, LOGP, FL("palAllocateMemory() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5488 | return; |
| 5489 | } |
| 5490 | |
| 5491 | pHalCB->pHalIndCB = limProcessHalIndMessages; |
| 5492 | |
| 5493 | msg.type = WDA_REGISTER_PE_CALLBACK; |
| 5494 | msg.bodyptr = pHalCB; |
| 5495 | msg.bodyval = 0; |
| 5496 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5497 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5498 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5499 | { |
| 5500 | palFreeMemory(pMac->hHdd, pHalCB); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5501 | limLog(pMac, LOGP, FL("wdaPostCtrlMsg() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5502 | } |
| 5503 | |
| 5504 | return; |
| 5505 | } |
| 5506 | |
| 5507 | |
| 5508 | /** ------------------------------------------------------------- |
| 5509 | \fn limProcessAddBaInd |
| 5510 | |
| 5511 | \brief handles the BA activity check timeout indication coming from HAL. |
| 5512 | Validates the request, posts request for sending addBaReq message for every candidate in the list. |
| 5513 | \param tpAniSirGlobal pMac |
| 5514 | \param tSirMsgQ limMsg |
| 5515 | \return None |
| 5516 | -------------------------------------------------------------*/ |
| 5517 | void |
| 5518 | limProcessAddBaInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 5519 | { |
| 5520 | tANI_U8 i; |
| 5521 | tANI_U8 tid; |
| 5522 | tANI_U16 assocId; |
| 5523 | tpDphHashNode pSta; |
| 5524 | tpAddBaCandidate pBaCandidate; |
| 5525 | tANI_U32 baCandidateCnt; |
| 5526 | tpBaActivityInd pBaActivityInd; |
| 5527 | tpPESession psessionEntry; |
| 5528 | tANI_U8 sessionId; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5529 | #ifdef FEATURE_WLAN_TDLS |
| 5530 | boolean htCapable = FALSE; |
| 5531 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5532 | |
| 5533 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5534 | if (limMsg->bodyptr == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5535 | return; |
| 5536 | |
| 5537 | pBaActivityInd = (tpBaActivityInd)limMsg->bodyptr; |
| 5538 | baCandidateCnt = pBaActivityInd->baCandidateCnt; |
| 5539 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5540 | if ((psessionEntry = peFindSessionByBssid(pMac,pBaActivityInd->bssId,&sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5541 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5542 | limLog(pMac, LOGE,FL("session does not exist for given BSSId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5543 | palFreeMemory(pMac->hHdd, limMsg->bodyptr); |
| 5544 | return; |
| 5545 | } |
| 5546 | |
| 5547 | //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] | 5548 | #ifdef FEATURE_WLAN_TDLS |
| 5549 | if ((baCandidateCnt > pMac->lim.maxStation)) |
| 5550 | #else |
| 5551 | if ((baCandidateCnt > pMac->lim.maxStation) || !psessionEntry->htCapability ) |
| 5552 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5553 | { |
| 5554 | palFreeMemory(pMac->hHdd, limMsg->bodyptr); |
| 5555 | return; |
| 5556 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5557 | |
| 5558 | #ifdef FEATURE_WLAN_TDLS |
| 5559 | //if we have TDLS peers, we should look at peers HT capability, which can be different than |
| 5560 | //AP capability |
| 5561 | pBaCandidate = (tpAddBaCandidate) (((tANI_U8*)pBaActivityInd) + sizeof(tBaActivityInd)); |
| 5562 | |
| 5563 | for (i=0; i<baCandidateCnt; i++, pBaCandidate++) |
| 5564 | { |
| 5565 | pSta = dphLookupHashEntry(pMac, pBaCandidate->staAddr, &assocId, &psessionEntry->dph.dphHashTable); |
| 5566 | if ((NULL == pSta) || (!pSta->valid)) |
| 5567 | continue; |
| 5568 | |
| 5569 | if (STA_ENTRY_TDLS_PEER == pSta->staType) |
| 5570 | htCapable = pSta->mlmStaContext.htCapability; |
| 5571 | else |
| 5572 | htCapable = psessionEntry->htCapability; |
| 5573 | |
| 5574 | if (htCapable) |
| 5575 | break; |
| 5576 | } |
| 5577 | if (!htCapable) |
| 5578 | { |
| 5579 | palFreeMemory(pMac->hHdd, limMsg->bodyptr); |
| 5580 | return; |
| 5581 | } |
| 5582 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5583 | |
| 5584 | //delete the complete dialoguetoken linked list |
| 5585 | limDeleteDialogueTokenList(pMac); |
| 5586 | pBaCandidate = (tpAddBaCandidate) (((tANI_U8*)pBaActivityInd) + sizeof(tBaActivityInd)); |
| 5587 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5588 | for (i=0; i<baCandidateCnt; i++, pBaCandidate++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5589 | { |
| 5590 | pSta = dphLookupHashEntry(pMac, pBaCandidate->staAddr, &assocId, &psessionEntry->dph.dphHashTable); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5591 | if ((NULL == pSta) || (!pSta->valid)) |
| 5592 | continue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5593 | |
| 5594 | for (tid=0; tid<STACFG_MAX_TC; tid++) |
| 5595 | { |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 5596 | if((eBA_DISABLE == pSta->tcCfg[tid].fUseBATx) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5597 | (pBaCandidate->baInfo[tid].fBaEnable)) |
| 5598 | { |
Hoonki Lee | 9af07cf | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 5599 | limLog(pMac, LOGE, FL("BA setup for staId = %d, TID: %d, SSN: %d"), |
| 5600 | pSta->staIndex, tid, pBaCandidate->baInfo[tid].startingSeqNum); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5601 | limPostMlmAddBAReq(pMac, pSta, tid, pBaCandidate->baInfo[tid].startingSeqNum,psessionEntry); |
| 5602 | } |
| 5603 | } |
| 5604 | } |
| 5605 | palFreeMemory(pMac->hHdd, limMsg->bodyptr); |
| 5606 | return; |
| 5607 | } |
| 5608 | |
| 5609 | |
| 5610 | /** ------------------------------------------------------------- |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5611 | \fn limDelAllBASessions |
| 5612 | \brief Deletes all the exisitng BA sessions. |
| 5613 | \ Note : This API is provided for Mac OSx only. The reason for this is that Mac OSx may not |
| 5614 | \ restart after CFG update. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5615 | \param tpAniSirGlobal pMac |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5616 | \return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5617 | -------------------------------------------------------------*/ |
| 5618 | |
| 5619 | void |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5620 | limDelAllBASessions(tpAniSirGlobal pMac) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5621 | { |
| 5622 | tANI_U32 i; |
| 5623 | tANI_U8 tid; |
| 5624 | tpDphHashNode pSta; |
| 5625 | |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5626 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry????? |
| 5627 | for(tid = 0; tid < STACFG_MAX_TC; tid++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5628 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5629 | if((eLIM_AP_ROLE == psessionEntry->limSystemRole) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)|| |
| 5630 | (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5631 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5632 | for(i = 0; i < pMac->lim.maxStation; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5633 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5634 | pSta = psessionEntry->dph.dphHashTable.pDphNodeArray + i; |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5635 | if (pSta && pSta->added) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5636 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5637 | if(eBA_ENABLE == pSta->tcCfg[tid].fUseBATx) |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5638 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5639 | limPostMlmDelBAReq(pMac, pSta, eBA_INITIATOR, tid, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5640 | } |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5641 | else if(eBA_ENABLE == pSta->tcCfg[tid].fUseBARx) |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5642 | { |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5643 | limPostMlmDelBAReq(pMac, pSta, eBA_RECIPIENT, tid, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); |
Kiran Kumar Lokere | c1641f5 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 5644 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5645 | } |
| 5646 | } |
| 5647 | } |
Gopichand Nakkala | 6a36e14 | 2013-06-07 21:23:15 -0700 | [diff] [blame] | 5648 | else if((eLIM_STA_ROLE == psessionEntry->limSystemRole)||(eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole)) |
| 5649 | { |
| 5650 | pSta = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 5651 | if (pSta && pSta->added) |
| 5652 | { |
| 5653 | if(eBA_ENABLE == pSta->tcCfg[tid].fUseBATx) |
| 5654 | { |
| 5655 | limPostMlmDelBAReq(pMac, pSta, eBA_INITIATOR, tid, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); |
| 5656 | } |
| 5657 | if(eBA_ENABLE == pSta->tcCfg[tid].fUseBARx) |
| 5658 | { |
| 5659 | limPostMlmDelBAReq(pMac, pSta, eBA_RECIPIENT, tid, eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry); |
| 5660 | } |
| 5661 | } |
| 5662 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5663 | } |
| 5664 | } |
| 5665 | /** ------------------------------------------------------------- |
| 5666 | \fn limProcessDelTsInd |
| 5667 | \brief handles the DeleteTS indication coming from HAL or generated by PE itself in some error cases. |
| 5668 | Validates the request, sends the DelTs action frame to the Peer and sends DelTs indicatoin to HDD. |
| 5669 | \param tpAniSirGlobal pMac |
| 5670 | \param tSirMsgQ limMsg |
| 5671 | \return None |
| 5672 | -------------------------------------------------------------*/ |
| 5673 | void |
| 5674 | limProcessDelTsInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 5675 | { |
| 5676 | tpDphHashNode pSta; |
| 5677 | tpDelTsParams pDelTsParam = (tpDelTsParams) (limMsg->bodyptr); |
| 5678 | tpSirDeltsReq pDelTsReq = NULL; |
| 5679 | tSirMacAddr peerMacAddr; |
| 5680 | tpSirDeltsReqInfo pDelTsReqInfo; |
| 5681 | tpLimTspecInfo pTspecInfo; |
| 5682 | tpPESession psessionEntry; |
| 5683 | tANI_U8 sessionId; |
| 5684 | |
| 5685 | if((psessionEntry = peFindSessionByBssid(pMac,pDelTsParam->bssId,&sessionId))== NULL) |
| 5686 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5687 | limLog(pMac, LOGE,FL("session does not exist for given BssId")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5688 | palFreeMemory(pMac->hHdd, (void *)(limMsg->bodyptr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5689 | return; |
| 5690 | } |
| 5691 | |
| 5692 | pTspecInfo = &(pMac->lim.tspecInfo[pDelTsParam->tspecIdx]); |
| 5693 | if(pTspecInfo->inuse == false) |
| 5694 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5695 | 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] | 5696 | goto error1; |
| 5697 | } |
| 5698 | |
| 5699 | pSta = dphGetHashEntry(pMac, pTspecInfo->assocId, &psessionEntry->dph.dphHashTable); |
| 5700 | if(pSta == NULL) |
| 5701 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5702 | 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] | 5703 | pTspecInfo->assocId); |
| 5704 | goto error1; |
| 5705 | } |
| 5706 | |
| 5707 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pDelTsReq, sizeof(tSirDeltsReq))) |
| 5708 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5709 | PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5710 | goto error1; |
| 5711 | } |
| 5712 | |
| 5713 | palZeroMemory( pMac->hHdd, (tANI_U8 *)pDelTsReq, sizeof(tSirDeltsReq)); |
| 5714 | |
| 5715 | if(pSta->wmeEnabled) |
| 5716 | palCopyMemory(pMac->hHdd, &(pDelTsReq->req.tspec), &(pTspecInfo->tspec), sizeof(tSirMacTspecIE)); |
| 5717 | else |
| 5718 | palCopyMemory(pMac->hHdd, &(pDelTsReq->req.tsinfo), &(pTspecInfo->tspec.tsinfo), sizeof(tSirMacTSInfo)); |
| 5719 | |
| 5720 | |
| 5721 | //validate the req |
| 5722 | if (eSIR_SUCCESS != limValidateDeltsReq(pMac, pDelTsReq, peerMacAddr,psessionEntry)) |
| 5723 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5724 | PELOGE(limLog(pMac, LOGE, FL("limValidateDeltsReq failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5725 | goto error2; |
| 5726 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5727 | PELOG1(limLog(pMac, LOG1, "Sent DELTS request to station with assocId = %d MacAddr = %x:%x:%x:%x:%x:%x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5728 | pDelTsReq->aid, peerMacAddr[0], peerMacAddr[1], peerMacAddr[2], |
| 5729 | peerMacAddr[3], peerMacAddr[4], peerMacAddr[5]);) |
| 5730 | |
| 5731 | limSendDeltsReqActionFrame(pMac, peerMacAddr, pDelTsReq->req.wmeTspecPresent, &pDelTsReq->req.tsinfo, &pDelTsReq->req.tspec, |
| 5732 | psessionEntry); |
| 5733 | |
| 5734 | // prepare and send an sme indication to HDD |
| 5735 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pDelTsReqInfo, sizeof(tSirDeltsReqInfo))) |
| 5736 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5737 | PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5738 | goto error3; |
| 5739 | } |
| 5740 | palZeroMemory( pMac->hHdd, (tANI_U8 *)pDelTsReqInfo, sizeof(tSirDeltsReqInfo)); |
| 5741 | |
| 5742 | if(pSta->wmeEnabled) |
| 5743 | palCopyMemory(pMac->hHdd, &(pDelTsReqInfo->tspec), &(pTspecInfo->tspec), sizeof(tSirMacTspecIE)); |
| 5744 | else |
| 5745 | palCopyMemory(pMac->hHdd, &(pDelTsReqInfo->tsinfo), &(pTspecInfo->tspec.tsinfo), sizeof(tSirMacTSInfo)); |
| 5746 | |
| 5747 | limSendSmeDeltsInd(pMac, pDelTsReqInfo, pDelTsReq->aid,psessionEntry); |
| 5748 | |
| 5749 | error3: |
| 5750 | palFreeMemory(pMac->hHdd, (void *) pDelTsReqInfo); |
| 5751 | error2: |
| 5752 | palFreeMemory(pMac->hHdd, (void *) pDelTsReq); |
| 5753 | error1: |
| 5754 | palFreeMemory(pMac->hHdd, (void *)(limMsg->bodyptr)); |
| 5755 | return; |
| 5756 | } |
| 5757 | |
| 5758 | /** |
| 5759 | * \brief Setup an A-MPDU/BA session |
| 5760 | * |
| 5761 | * \sa limPostMlmAddBAReq |
| 5762 | * |
| 5763 | * \param pMac The global tpAniSirGlobal object |
| 5764 | * |
| 5765 | * \param pStaDs DPH Hash Node object of peer STA |
| 5766 | * |
| 5767 | * \param tid TID for which a BA is being setup. |
| 5768 | * If this is set to 0xFFFF, then we retrieve |
| 5769 | * the default TID from the CFG |
| 5770 | * |
| 5771 | * \return eSIR_SUCCESS if setup completes successfully |
| 5772 | * eSIR_FAILURE is some problem is encountered |
| 5773 | */ |
| 5774 | tSirRetStatus limPostMlmAddBAReq( tpAniSirGlobal pMac, |
| 5775 | tpDphHashNode pStaDs, |
| 5776 | tANI_U8 tid, tANI_U16 startingSeqNum,tpPESession psessionEntry) |
| 5777 | { |
| 5778 | tSirRetStatus status = eSIR_SUCCESS; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5779 | tpLimMlmAddBAReq pMlmAddBAReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5780 | tpDialogueToken dialogueTokenNode; |
| 5781 | tANI_U32 val = 0; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5783 | // Check if the peer is a 11n capable STA |
| 5784 | // FIXME - Need a 11n peer indication in DPH. |
| 5785 | // For now, using the taurusPeer attribute |
| 5786 | //if( 0 == pStaDs->taurusPeer == ) |
| 5787 | //return eSIR_SUCCESS; |
| 5788 | |
| 5789 | // Allocate for LIM_MLM_ADDBA_REQ |
| 5790 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, |
| 5791 | (void **) &pMlmAddBAReq, |
| 5792 | sizeof( tLimMlmAddBAReq ))) |
| 5793 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5794 | limLog( pMac, LOGP, FL("palAllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5795 | status = eSIR_MEM_ALLOC_FAILED; |
| 5796 | goto returnFailure; |
| 5797 | } |
| 5798 | |
| 5799 | palZeroMemory( pMac->hHdd, (void *) pMlmAddBAReq, sizeof( tLimMlmAddBAReq )); |
| 5800 | |
| 5801 | // Copy the peer MAC |
| 5802 | palCopyMemory( pMac->hHdd, |
| 5803 | pMlmAddBAReq->peerMacAddr, |
| 5804 | pStaDs->staAddr, |
| 5805 | sizeof( tSirMacAddr )); |
| 5806 | |
| 5807 | // Update the TID |
| 5808 | pMlmAddBAReq->baTID = tid; |
| 5809 | |
| 5810 | // Determine the supported BA policy of local STA |
| 5811 | // for the TID of interest |
| 5812 | pMlmAddBAReq->baPolicy = (pStaDs->baPolicyFlag >> tid) & 0x1; |
| 5813 | |
| 5814 | // BA Buffer Size |
| 5815 | // Requesting the ADDBA recipient to populate the size. |
| 5816 | // If ADDBA is accepted, a non-zero buffer size should |
| 5817 | // be returned in the ADDBA Rsp |
| 5818 | pMlmAddBAReq->baBufferSize = 0; |
| 5819 | |
| 5820 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5821 | FL( "Requesting an ADDBA to setup a %s BA session with STA %d for TID %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | (pMlmAddBAReq->baPolicy ? "Immediate": "Delayed"), |
| 5823 | pStaDs->staIndex, |
| 5824 | tid ); |
| 5825 | |
| 5826 | // BA Timeout |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5827 | if (wlan_cfgGetInt(pMac, WNI_CFG_BA_TIMEOUT, &val) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5828 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5829 | limLog(pMac, LOGE, FL("could not retrieve BA TIME OUT Param CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5830 | status = eSIR_FAILURE; |
| 5831 | goto returnFailure; |
| 5832 | } |
| 5833 | pMlmAddBAReq->baTimeout = val; // In TU's |
| 5834 | |
| 5835 | // ADDBA Failure Timeout |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5836 | // FIXME_AMPDU - Need to retrieve this from CFG. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5837 | //right now we are not checking for response timeout. so this field is dummy just to be compliant with the spec. |
| 5838 | pMlmAddBAReq->addBAFailureTimeout = 2000; // In TU's |
| 5839 | |
| 5840 | // BA Starting Sequence Number |
| 5841 | pMlmAddBAReq->baSSN = startingSeqNum; |
| 5842 | |
| 5843 | /* Update PE session Id*/ |
| 5844 | pMlmAddBAReq->sessionId = psessionEntry->peSessionId; |
| 5845 | |
| 5846 | LIM_SET_STA_BA_STATE(pStaDs, tid, eLIM_BA_STATE_WT_ADD_RSP); |
| 5847 | |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5848 | dialogueTokenNode = limAssignDialogueToken(pMac); |
| 5849 | if (NULL == dialogueTokenNode) |
| 5850 | { |
| 5851 | limLog(pMac, LOGE, FL("could not assign dialogue token")); |
| 5852 | status = eSIR_FAILURE; |
| 5853 | goto returnFailure; |
| 5854 | } |
| 5855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5856 | pMlmAddBAReq->baDialogToken = dialogueTokenNode->token; |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5857 | //set assocId and tid information in the lim linked list |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5858 | dialogueTokenNode->assocId = pStaDs->assocId; |
| 5859 | dialogueTokenNode->tid = tid; |
| 5860 | // Send ADDBA Req to MLME |
| 5861 | limPostMlmMessage( pMac, |
| 5862 | LIM_MLM_ADDBA_REQ, |
| 5863 | (tANI_U32 *) pMlmAddBAReq ); |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5864 | return eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5865 | |
| 5866 | returnFailure: |
Jeff Johnson | 09fb4cd | 2013-04-03 15:27:59 -0700 | [diff] [blame] | 5867 | palFreeMemory(pMac->hHdd, pMlmAddBAReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5868 | return status; |
| 5869 | } |
| 5870 | |
| 5871 | /** |
| 5872 | * \brief Post LIM_MLM_ADDBA_RSP to MLME. MLME |
| 5873 | * will then send an ADDBA Rsp to peer MAC entity |
| 5874 | * with the appropriate ADDBA status code |
| 5875 | * |
| 5876 | * \sa limPostMlmAddBARsp |
| 5877 | * |
| 5878 | * \param pMac The global tpAniSirGlobal object |
| 5879 | * |
| 5880 | * \param peerMacAddr MAC address of peer entity that will |
| 5881 | * be the recipient of this ADDBA Rsp |
| 5882 | * |
| 5883 | * \param baStatusCode ADDBA Rsp status code |
| 5884 | * |
| 5885 | * \param baDialogToken ADDBA Rsp dialog token |
| 5886 | * |
| 5887 | * \param baTID TID of interest |
| 5888 | * |
| 5889 | * \param baPolicy The BA policy |
| 5890 | * |
| 5891 | * \param baBufferSize The BA buffer size |
| 5892 | * |
| 5893 | * \param baTimeout BA timeout in TU's |
| 5894 | * |
| 5895 | * \return eSIR_SUCCESS if setup completes successfully |
| 5896 | * eSIR_FAILURE is some problem is encountered |
| 5897 | */ |
| 5898 | tSirRetStatus limPostMlmAddBARsp( tpAniSirGlobal pMac, |
| 5899 | tSirMacAddr peerMacAddr, |
| 5900 | tSirMacStatusCodes baStatusCode, |
| 5901 | tANI_U8 baDialogToken, |
| 5902 | tANI_U8 baTID, |
| 5903 | tANI_U8 baPolicy, |
| 5904 | tANI_U16 baBufferSize, |
| 5905 | tANI_U16 baTimeout, |
| 5906 | tpPESession psessionEntry) |
| 5907 | { |
| 5908 | tSirRetStatus status = eSIR_SUCCESS; |
| 5909 | tpLimMlmAddBARsp pMlmAddBARsp; |
| 5910 | |
| 5911 | // Allocate for LIM_MLM_ADDBA_RSP |
| 5912 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, |
| 5913 | (void **) &pMlmAddBARsp, |
| 5914 | sizeof( tLimMlmAddBARsp ))) |
| 5915 | { |
| 5916 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5917 | FL("palAllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5918 | status ); |
| 5919 | |
| 5920 | status = eSIR_MEM_ALLOC_FAILED; |
| 5921 | goto returnFailure; |
| 5922 | } |
| 5923 | |
| 5924 | palZeroMemory( pMac->hHdd, (void *) pMlmAddBARsp, sizeof( tLimMlmAddBARsp )); |
| 5925 | |
| 5926 | // Copy the peer MAC |
| 5927 | palCopyMemory( pMac->hHdd, |
| 5928 | pMlmAddBARsp->peerMacAddr, |
| 5929 | peerMacAddr, |
| 5930 | sizeof( tSirMacAddr )); |
| 5931 | |
| 5932 | pMlmAddBARsp->baDialogToken = baDialogToken; |
| 5933 | pMlmAddBARsp->addBAResultCode = baStatusCode; |
| 5934 | pMlmAddBARsp->baTID = baTID; |
| 5935 | pMlmAddBARsp->baPolicy = baPolicy; |
| 5936 | pMlmAddBARsp->baBufferSize = baBufferSize; |
| 5937 | pMlmAddBARsp->baTimeout = baTimeout; |
| 5938 | |
| 5939 | /* UPdate PE session ID*/ |
| 5940 | pMlmAddBARsp->sessionId = psessionEntry->peSessionId; |
| 5941 | |
| 5942 | // Send ADDBA Rsp to MLME |
| 5943 | limPostMlmMessage( pMac, |
| 5944 | LIM_MLM_ADDBA_RSP, |
| 5945 | (tANI_U32 *) pMlmAddBARsp ); |
| 5946 | |
| 5947 | returnFailure: |
| 5948 | |
| 5949 | return status; |
| 5950 | } |
| 5951 | |
| 5952 | /** |
| 5953 | * \brief Post LIM_MLM_DELBA_REQ to MLME. MLME |
| 5954 | * will then send an DELBA Ind to peer MAC entity |
| 5955 | * with the appropriate DELBA status code |
| 5956 | * |
| 5957 | * \sa limPostMlmDelBAReq |
| 5958 | * |
| 5959 | * \param pMac The global tpAniSirGlobal object |
| 5960 | * |
| 5961 | * \param pSta DPH Hash Node object of peer MAC entity |
| 5962 | * for which the BA session is being deleted |
| 5963 | * |
| 5964 | * \param baDirection DELBA direction |
| 5965 | * |
| 5966 | * \param baTID TID for which the BA session is being deleted |
| 5967 | * |
| 5968 | * \param baReasonCode DELBA Req reason code |
| 5969 | * |
| 5970 | * \return eSIR_SUCCESS if setup completes successfully |
| 5971 | * eSIR_FAILURE is some problem is encountered |
| 5972 | */ |
| 5973 | tSirRetStatus limPostMlmDelBAReq( tpAniSirGlobal pMac, |
| 5974 | tpDphHashNode pSta, |
| 5975 | tANI_U8 baDirection, |
| 5976 | tANI_U8 baTID, |
| 5977 | tSirMacReasonCodes baReasonCode, |
| 5978 | tpPESession psessionEntry) |
| 5979 | { |
| 5980 | tSirRetStatus status = eSIR_SUCCESS; |
| 5981 | tpLimMlmDelBAReq pMlmDelBAReq; |
| 5982 | tLimBAState curBaState; |
| 5983 | |
| 5984 | if(NULL == pSta) |
| 5985 | return eSIR_FAILURE; |
| 5986 | |
| 5987 | LIM_GET_STA_BA_STATE(pSta, baTID, &curBaState); |
| 5988 | |
| 5989 | // Need to validate the current BA State. |
| 5990 | if( eLIM_BA_STATE_IDLE != curBaState) |
| 5991 | { |
| 5992 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5993 | 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] | 5994 | baTID, |
| 5995 | curBaState); |
| 5996 | |
| 5997 | status = eSIR_FAILURE; |
| 5998 | goto returnFailure; |
| 5999 | } |
| 6000 | |
| 6001 | // Allocate for LIM_MLM_DELBA_REQ |
| 6002 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, |
| 6003 | (void **) &pMlmDelBAReq, |
| 6004 | sizeof( tLimMlmDelBAReq ))) |
| 6005 | { |
| 6006 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6007 | FL("palAllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6008 | status ); |
| 6009 | |
| 6010 | status = eSIR_MEM_ALLOC_FAILED; |
| 6011 | goto returnFailure; |
| 6012 | } |
| 6013 | |
| 6014 | palZeroMemory( pMac->hHdd, (void *) pMlmDelBAReq, sizeof( tLimMlmDelBAReq )); |
| 6015 | |
| 6016 | // Copy the peer MAC |
| 6017 | palCopyMemory( pMac->hHdd, |
| 6018 | pMlmDelBAReq->peerMacAddr, |
| 6019 | pSta->staAddr, |
| 6020 | sizeof( tSirMacAddr )); |
| 6021 | |
| 6022 | pMlmDelBAReq->baDirection = baDirection; |
| 6023 | pMlmDelBAReq->baTID = baTID; |
| 6024 | pMlmDelBAReq->delBAReasonCode = baReasonCode; |
| 6025 | |
| 6026 | /* Update PE session ID*/ |
| 6027 | pMlmDelBAReq->sessionId = psessionEntry->peSessionId; |
| 6028 | |
| 6029 | //we don't have valid BA session for the given direction. |
| 6030 | // HDD wants to get the BA session deleted on PEER in this case. |
| 6031 | // in this case we just need to send DelBA to the peer. |
| 6032 | if(((eBA_RECIPIENT == baDirection) && (eBA_DISABLE == pSta->tcCfg[baTID].fUseBARx)) || |
| 6033 | ((eBA_INITIATOR == baDirection) && (eBA_DISABLE == pSta->tcCfg[baTID].fUseBATx))) |
| 6034 | { |
| 6035 | // Send DELBA Ind over the air |
| 6036 | if( eSIR_SUCCESS != |
| 6037 | (status = limSendDelBAInd( pMac, pMlmDelBAReq,psessionEntry))) |
| 6038 | status = eSIR_FAILURE; |
| 6039 | |
| 6040 | palFreeMemory(pMac->hHdd, (void*) pMlmDelBAReq); |
| 6041 | return status; |
| 6042 | } |
| 6043 | |
| 6044 | |
| 6045 | // Update the BA state in STA |
| 6046 | LIM_SET_STA_BA_STATE(pSta, pMlmDelBAReq->baTID, eLIM_BA_STATE_WT_DEL_RSP); |
| 6047 | |
| 6048 | // Send DELBA Req to MLME |
| 6049 | limPostMlmMessage( pMac, |
| 6050 | LIM_MLM_DELBA_REQ, |
| 6051 | (tANI_U32 *) pMlmDelBAReq ); |
| 6052 | |
| 6053 | returnFailure: |
| 6054 | |
| 6055 | return status; |
| 6056 | } |
| 6057 | |
| 6058 | /** |
| 6059 | * \brief Send WDA_ADDBA_REQ to HAL, in order |
| 6060 | * to setup a new BA session with a peer |
| 6061 | * |
| 6062 | * \sa limPostMsgAddBAReq |
| 6063 | * |
| 6064 | * \param pMac The global tpAniSirGlobal object |
| 6065 | * |
| 6066 | * \param pSta Runtime, STA-related configuration cached |
| 6067 | * in the HashNode object |
| 6068 | * |
| 6069 | * \param baDialogToken The Action Frame dialog token |
| 6070 | * |
| 6071 | * \param baTID TID for which the BA session is being setup |
| 6072 | * |
| 6073 | * \param baPolicy BA Policy |
| 6074 | * |
| 6075 | * \param baBufferSize The requested BA buffer size |
| 6076 | * |
| 6077 | * \param baTimeout BA Timeout. 0 indicates no BA timeout enforced |
| 6078 | * |
| 6079 | * \param baSSN Starting Sequence Number for this BA session |
| 6080 | * |
| 6081 | * \param baDirection BA Direction: 1 - Initiator, 0 - Recipient |
| 6082 | * |
| 6083 | * \return none |
| 6084 | * |
| 6085 | */ |
| 6086 | tSirRetStatus limPostMsgAddBAReq( tpAniSirGlobal pMac, |
| 6087 | tpDphHashNode pSta, |
| 6088 | tANI_U8 baDialogToken, |
| 6089 | tANI_U8 baTID, |
| 6090 | tANI_U8 baPolicy, |
| 6091 | tANI_U16 baBufferSize, |
| 6092 | tANI_U16 baTimeout, |
| 6093 | tANI_U16 baSSN, |
| 6094 | tANI_U8 baDirection, |
| 6095 | tpPESession psessionEntry) |
| 6096 | { |
| 6097 | tpAddBAParams pAddBAParams = NULL; |
| 6098 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 6099 | eHalStatus status; |
| 6100 | tSirMsgQ msgQ; |
| 6101 | |
| 6102 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 6103 | // we can only do BA on "hard" STAs |
| 6104 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 6105 | { |
| 6106 | retCode = eHAL_STATUS_FAILURE; |
| 6107 | goto returnFailure; |
| 6108 | } |
| 6109 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 6110 | |
| 6111 | // Allocate for WDA_ADDBA_REQ |
| 6112 | if( eHAL_STATUS_SUCCESS != |
| 6113 | (status = palAllocateMemory( pMac->hHdd, |
| 6114 | (void **) &pAddBAParams, |
| 6115 | sizeof( tAddBAParams )))) |
| 6116 | { |
| 6117 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6118 | FL("palAllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6119 | status ); |
| 6120 | |
| 6121 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 6122 | goto returnFailure; |
| 6123 | } |
| 6124 | |
| 6125 | palZeroMemory( pMac->hHdd, (void *) pAddBAParams, sizeof( tAddBAParams )); |
| 6126 | |
| 6127 | // Copy the peer MAC address |
| 6128 | palCopyMemory( pMac->hHdd, |
| 6129 | (void *) pAddBAParams->peerMacAddr, |
| 6130 | (void *) pSta->staAddr, |
| 6131 | sizeof( tSirMacAddr )); |
| 6132 | |
| 6133 | // Populate the REQ parameters |
| 6134 | pAddBAParams->staIdx = pSta->staIndex; |
| 6135 | pAddBAParams->baDialogToken = baDialogToken; |
| 6136 | pAddBAParams->baTID = baTID; |
| 6137 | pAddBAParams->baPolicy = baPolicy; |
| 6138 | pAddBAParams->baBufferSize = baBufferSize; |
| 6139 | pAddBAParams->baTimeout = baTimeout; |
| 6140 | pAddBAParams->baSSN = baSSN; |
| 6141 | pAddBAParams->baDirection = baDirection; |
| 6142 | pAddBAParams->respReqd = 1; |
| 6143 | |
| 6144 | /* UPdate PE session ID */ |
| 6145 | pAddBAParams->sessionId = psessionEntry->peSessionId; |
| 6146 | |
| 6147 | // Post WDA_ADDBA_REQ to HAL. |
| 6148 | msgQ.type = WDA_ADDBA_REQ; |
| 6149 | // |
| 6150 | // FIXME_AMPDU |
| 6151 | // A global counter (dialog token) is required to keep track of |
| 6152 | // all PE <-> HAL communication(s) |
| 6153 | // |
| 6154 | msgQ.reserved = 0; |
| 6155 | msgQ.bodyptr = pAddBAParams; |
| 6156 | msgQ.bodyval = 0; |
| 6157 | |
| 6158 | limLog( pMac, LOGW, |
| 6159 | FL( "Sending WDA_ADDBA_REQ..." )); |
| 6160 | |
| 6161 | //defer any other message until we get response back. |
| 6162 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 6163 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6164 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6165 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 6166 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT, psessionEntry, 0, 0); |
| 6167 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 6168 | |
| 6169 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 6170 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6171 | FL("Posting WDA_ADDBA_REQ to HAL failed! Reason = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6172 | retCode ); |
| 6173 | else |
| 6174 | return retCode; |
| 6175 | |
| 6176 | returnFailure: |
| 6177 | |
| 6178 | // Clean-up... |
| 6179 | if( NULL != pAddBAParams ) |
| 6180 | palFreeMemory( pMac->hHdd, (void *) pAddBAParams ); |
| 6181 | |
| 6182 | return retCode; |
| 6183 | |
| 6184 | } |
| 6185 | |
| 6186 | /** |
| 6187 | * \brief Send WDA_DELBA_IND to HAL, in order |
| 6188 | * to delete an existing BA session with peer |
| 6189 | * |
| 6190 | * \sa limPostMsgDelBAInd |
| 6191 | * |
| 6192 | * \param pMac The global tpAniSirGlobal object |
| 6193 | * |
| 6194 | * \param pSta Runtime, STA-related configuration cached |
| 6195 | * in the HashNode object |
| 6196 | * |
| 6197 | * \param baTID TID for which the BA session is being setup |
| 6198 | * |
| 6199 | * \param baDirection Identifies whether the DELBA Ind was |
| 6200 | * sent by the BA initiator or recipient |
| 6201 | * |
| 6202 | * \return none |
| 6203 | * |
| 6204 | */ |
| 6205 | tSirRetStatus limPostMsgDelBAInd( tpAniSirGlobal pMac, |
| 6206 | tpDphHashNode pSta, |
| 6207 | tANI_U8 baTID, |
| 6208 | tANI_U8 baDirection, |
| 6209 | tpPESession psessionEntry) |
| 6210 | { |
| 6211 | tpDelBAParams pDelBAParams = NULL; |
| 6212 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 6213 | eHalStatus status; |
| 6214 | tSirMsgQ msgQ; |
| 6215 | |
| 6216 | // Allocate for SIR_HAL_DELBA_IND |
| 6217 | if( eHAL_STATUS_SUCCESS != |
| 6218 | (status = palAllocateMemory( pMac->hHdd, |
| 6219 | (void **) &pDelBAParams, |
| 6220 | sizeof( tDelBAParams )))) |
| 6221 | { |
| 6222 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6223 | FL("palAllocateMemory failed with error code %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6224 | status ); |
| 6225 | |
| 6226 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 6227 | goto returnFailure; |
| 6228 | } |
| 6229 | |
| 6230 | palZeroMemory( pMac->hHdd, (void *) pDelBAParams, sizeof( tDelBAParams )); |
| 6231 | |
| 6232 | // Populate the REQ parameters |
| 6233 | pDelBAParams->staIdx = pSta->staIndex; |
| 6234 | pDelBAParams->baTID = baTID; |
| 6235 | pDelBAParams->baDirection = baDirection; |
| 6236 | |
| 6237 | /* Update PE session ID */ |
| 6238 | |
| 6239 | |
| 6240 | //TBD-RAJESH Updating of the session ID is requird for SIR_HAL_DELBA_IND????? |
| 6241 | //pDelBAParams->sessionId = psessionEntry->peSessionId; |
| 6242 | |
| 6243 | // Post WDA_DELBA_IND to HAL. |
| 6244 | msgQ.type = WDA_DELBA_IND; |
| 6245 | // |
| 6246 | // FIXME: |
| 6247 | // A global counter (dialog token) is required to keep track of |
| 6248 | // all PE <-> HAL communication(s) |
| 6249 | // |
| 6250 | msgQ.reserved = 0; |
| 6251 | msgQ.bodyptr = pDelBAParams; |
| 6252 | msgQ.bodyval = 0; |
| 6253 | |
| 6254 | limLog( pMac, LOGW, |
| 6255 | FL( "Sending SIR_HAL_DELBA_IND..." )); |
| 6256 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6257 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6258 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 6259 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_DELBA_IND_EVENT, psessionEntry, 0, 0); |
| 6260 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 6261 | |
| 6262 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 6263 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6264 | FL("Posting WDA_DELBA_IND to HAL failed! Reason = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6265 | retCode ); |
| 6266 | else |
| 6267 | { |
| 6268 | // Update LIM's internal cache... |
| 6269 | if( eBA_INITIATOR == baDirection) |
| 6270 | { |
| 6271 | pSta->tcCfg[baTID].fUseBATx = 0; |
| 6272 | pSta->tcCfg[baTID].txBufSize = 0; |
| 6273 | } |
| 6274 | else |
| 6275 | { |
| 6276 | pSta->tcCfg[baTID].fUseBARx = 0; |
| 6277 | pSta->tcCfg[baTID].rxBufSize = 0; |
| 6278 | } |
| 6279 | |
| 6280 | return retCode; |
| 6281 | } |
| 6282 | |
| 6283 | returnFailure: |
| 6284 | |
| 6285 | // Clean-up... |
| 6286 | if( NULL != pDelBAParams ) |
| 6287 | palFreeMemory( pMac->hHdd, (void *) pDelBAParams ); |
| 6288 | |
| 6289 | return retCode; |
| 6290 | |
| 6291 | } |
| 6292 | |
| 6293 | /** |
| 6294 | * @function : limPostSMStateUpdate() |
| 6295 | * |
| 6296 | * @brief : This function Updates the HAL and Softmac about the change in the STA's SMPS state. |
| 6297 | * |
| 6298 | * LOGIC: |
| 6299 | * |
| 6300 | * ASSUMPTIONS: |
| 6301 | * NA |
| 6302 | * |
| 6303 | * NOTE: |
| 6304 | * NA |
| 6305 | * |
| 6306 | * @param pMac - Pointer to Global MAC structure |
| 6307 | * @param limMsg - Lim Message structure object with the MimoPSparam in body |
| 6308 | * @return None |
| 6309 | */ |
| 6310 | tSirRetStatus |
| 6311 | limPostSMStateUpdate(tpAniSirGlobal pMac, |
| 6312 | tANI_U16 staIdx, tSirMacHTMIMOPowerSaveState state) |
| 6313 | { |
| 6314 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 6315 | tSirMsgQ msgQ; |
| 6316 | eHalStatus status; |
| 6317 | tpSetMIMOPS pMIMO_PSParams; |
| 6318 | |
| 6319 | msgQ.reserved = 0; |
| 6320 | msgQ.type = WDA_SET_MIMOPS_REQ; |
| 6321 | |
| 6322 | // Allocate for WDA_SET_MIMOPS_REQ |
| 6323 | status = palAllocateMemory( pMac->hHdd, (void **) &pMIMO_PSParams, sizeof( tSetMIMOPS)); |
| 6324 | if( eHAL_STATUS_SUCCESS != status) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6325 | limLog( pMac, LOGP,FL(" palAllocateMemory failed with error code %d"), status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6326 | return eSIR_MEM_ALLOC_FAILED; |
| 6327 | } |
| 6328 | |
| 6329 | pMIMO_PSParams->htMIMOPSState = state; |
| 6330 | pMIMO_PSParams->staIdx = staIdx; |
| 6331 | pMIMO_PSParams->fsendRsp = true; |
| 6332 | msgQ.bodyptr = pMIMO_PSParams; |
| 6333 | msgQ.bodyval = 0; |
| 6334 | |
| 6335 | limLog( pMac, LOG2, FL( "Sending WDA_SET_MIMOPS_REQ..." )); |
| 6336 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6337 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6338 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 6339 | if (eSIR_SUCCESS != retCode) |
| 6340 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6341 | limLog( pMac, LOGP, FL("Posting WDA_SET_MIMOPS_REQ to HAL failed! Reason = %d"), retCode ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6342 | palFreeMemory(pMac->hHdd, (void *) pMIMO_PSParams); |
| 6343 | return retCode; |
| 6344 | } |
| 6345 | |
| 6346 | return retCode; |
| 6347 | } |
| 6348 | |
| 6349 | void limPktFree ( |
| 6350 | tpAniSirGlobal pMac, |
| 6351 | eFrameType frmType, |
| 6352 | tANI_U8 *pRxPacketInfo, |
| 6353 | void *pBody) |
| 6354 | { |
| 6355 | (void) pMac; (void) frmType; (void) pRxPacketInfo; (void) pBody; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6356 | } |
| 6357 | |
| 6358 | /** |
| 6359 | * limGetBDfromRxPacket() |
| 6360 | * |
| 6361 | *FUNCTION: |
| 6362 | * This function is called to get pointer to Polaris |
| 6363 | * Buffer Descriptor containing MAC header & other control |
| 6364 | * info from the body of the message posted to LIM. |
| 6365 | * |
| 6366 | *LOGIC: |
| 6367 | * NA |
| 6368 | * |
| 6369 | *ASSUMPTIONS: |
| 6370 | * NA |
| 6371 | * |
| 6372 | *NOTE: |
| 6373 | * NA |
| 6374 | * |
| 6375 | * @param body - Received message body |
| 6376 | * @param pRxPacketInfo - Pointer to received BD |
| 6377 | * @return None |
| 6378 | */ |
| 6379 | |
| 6380 | void |
| 6381 | limGetBDfromRxPacket(tpAniSirGlobal pMac, void *body, tANI_U32 **pRxPacketInfo) |
| 6382 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6383 | *pRxPacketInfo = (tANI_U32 *) body; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6384 | } /*** end limGetBDfromRxPacket() ***/ |
| 6385 | |
| 6386 | |
| 6387 | |
| 6388 | |
| 6389 | |
| 6390 | void limRessetScanChannelInfo(tpAniSirGlobal pMac) |
| 6391 | { |
| 6392 | palZeroMemory(pMac->hHdd, &pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo)); |
| 6393 | } |
| 6394 | |
| 6395 | |
| 6396 | void limAddScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 channelId) |
| 6397 | { |
| 6398 | tANI_U8 i; |
| 6399 | tANI_BOOLEAN fFound = eANI_BOOLEAN_FALSE; |
| 6400 | |
| 6401 | for(i = 0; i < pMac->lim.scanChnInfo.numChnInfo; i++) |
| 6402 | { |
| 6403 | if(pMac->lim.scanChnInfo.scanChn[i].channelId == channelId) |
| 6404 | { |
| 6405 | pMac->lim.scanChnInfo.scanChn[i].numTimeScan++; |
| 6406 | fFound = eANI_BOOLEAN_TRUE; |
| 6407 | break; |
| 6408 | } |
| 6409 | } |
| 6410 | if(eANI_BOOLEAN_FALSE == fFound) |
| 6411 | { |
| 6412 | if(pMac->lim.scanChnInfo.numChnInfo < SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 6413 | { |
| 6414 | pMac->lim.scanChnInfo.scanChn[pMac->lim.scanChnInfo.numChnInfo].channelId = channelId; |
| 6415 | pMac->lim.scanChnInfo.scanChn[pMac->lim.scanChnInfo.numChnInfo++].numTimeScan = 1; |
| 6416 | } |
| 6417 | else |
| 6418 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6419 | PELOGW(limLog(pMac, LOGW, FL(" -- number of channels exceed mac"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6420 | } |
| 6421 | } |
| 6422 | } |
| 6423 | |
| 6424 | |
| 6425 | /** |
| 6426 | * @function : limIsChannelValidForChannelSwitch() |
| 6427 | * |
| 6428 | * @brief : This function checks if the channel to which AP |
| 6429 | * is expecting us to switch, is a valid channel for us. |
| 6430 | * LOGIC: |
| 6431 | * |
| 6432 | * ASSUMPTIONS: |
| 6433 | * NA |
| 6434 | * |
| 6435 | * NOTE: |
| 6436 | * NA |
| 6437 | * |
| 6438 | * @param pMac - Pointer to Global MAC structure |
| 6439 | * @param channel - New channel to which we are expected to move |
| 6440 | * @return None |
| 6441 | */ |
| 6442 | tAniBool |
| 6443 | limIsChannelValidForChannelSwitch(tpAniSirGlobal pMac, tANI_U8 channel) |
| 6444 | { |
| 6445 | tANI_U8 index; |
| 6446 | tANI_U32 validChannelListLen = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 6447 | tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 6448 | |
| 6449 | if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, |
| 6450 | (tANI_U8 *)validChannelList, |
| 6451 | (tANI_U32 *)&validChannelListLen) != eSIR_SUCCESS) |
| 6452 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6453 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve valid channel list"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6454 | return (eSIR_FALSE); |
| 6455 | } |
| 6456 | |
| 6457 | for(index = 0; index < validChannelListLen; index++) |
| 6458 | { |
| 6459 | if(validChannelList[index] == channel) |
| 6460 | return (eSIR_TRUE); |
| 6461 | } |
| 6462 | |
| 6463 | /* channel does not belong to list of valid channels */ |
| 6464 | return (eSIR_FALSE); |
| 6465 | } |
| 6466 | |
| 6467 | /**------------------------------------------------------ |
| 6468 | \fn __limFillTxControlParams |
| 6469 | \brief Fill the message for stopping/resuming tx. |
| 6470 | |
| 6471 | \param pMac |
| 6472 | \param pTxCtrlMsg - Pointer to tx control message. |
| 6473 | \param type - Which way we want to stop/ resume tx. |
| 6474 | \param mode - To stop/resume. |
| 6475 | -------------------------------------------------------*/ |
| 6476 | static eHalStatus |
| 6477 | __limFillTxControlParams(tpAniSirGlobal pMac, tpTxControlParams pTxCtrlMsg, |
| 6478 | tLimQuietTxMode type, tLimControlTx mode) |
| 6479 | { |
| 6480 | |
| 6481 | //TBD-RAJESH HOW TO GET sessionEntry????? |
| 6482 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 6483 | |
| 6484 | if (mode == eLIM_STOP_TX) |
| 6485 | pTxCtrlMsg->stopTx = eANI_BOOLEAN_TRUE; |
| 6486 | else |
| 6487 | pTxCtrlMsg->stopTx = eANI_BOOLEAN_FALSE; |
| 6488 | |
| 6489 | switch (type) |
| 6490 | { |
| 6491 | case eLIM_TX_ALL: |
| 6492 | /** Stops/resumes transmission completely */ |
| 6493 | pTxCtrlMsg->fCtrlGlobal = 1; |
| 6494 | break; |
| 6495 | |
| 6496 | case eLIM_TX_BSS_BUT_BEACON: |
| 6497 | /** Stops/resumes transmission on a particular BSS. Stopping BSS, doesnt |
| 6498 | * stop beacon transmission. |
| 6499 | */ |
| 6500 | pTxCtrlMsg->ctrlBss = 1; |
| 6501 | pTxCtrlMsg->bssBitmap |= (1 << psessionEntry->bssIdx); |
| 6502 | break; |
| 6503 | |
| 6504 | case eLIM_TX_STA: |
| 6505 | /** Memory for station bitmap is allocated dynamically in caller of this |
| 6506 | * so decode properly here and fill the bitmap. Now not implemented, |
| 6507 | * fall through. |
| 6508 | */ |
| 6509 | case eLIM_TX_BSS: |
| 6510 | //Fall thru... |
| 6511 | default: |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6512 | PELOGW(limLog(pMac, LOGW, FL("Invalid case: Not Handled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6513 | return eHAL_STATUS_FAILURE; |
| 6514 | } |
| 6515 | |
| 6516 | return eHAL_STATUS_SUCCESS; |
| 6517 | } |
| 6518 | |
| 6519 | /** |
| 6520 | * @function : limFrameTransmissionControl() |
| 6521 | * |
| 6522 | * @brief : This API is called by the user to halt/resume any frame |
| 6523 | * transmission from the device. If stopped, all frames will be |
| 6524 | * queued starting from hardware. Then back-pressure |
| 6525 | * is built till the driver. |
| 6526 | * LOGIC: |
| 6527 | * |
| 6528 | * ASSUMPTIONS: |
| 6529 | * NA |
| 6530 | * |
| 6531 | * NOTE: |
| 6532 | * NA |
| 6533 | * |
| 6534 | * @param pMac - Pointer to Global MAC structure |
| 6535 | * @return None |
| 6536 | */ |
| 6537 | void limFrameTransmissionControl(tpAniSirGlobal pMac, tLimQuietTxMode type, tLimControlTx mode) |
| 6538 | { |
| 6539 | |
| 6540 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6541 | tpTxControlParams pTxCtrlMsg; |
| 6542 | tSirMsgQ msgQ; |
| 6543 | tANI_U8 nBytes = 0; // No of bytes required for station bitmap. |
| 6544 | |
| 6545 | /** Allocate only required number of bytes for station bitmap |
| 6546 | * Make it to align to 4 byte boundary */ |
| 6547 | nBytes = (tANI_U8)HALMSG_NUMBYTES_STATION_BITMAP(pMac->lim.maxStation); |
| 6548 | |
| 6549 | status = palAllocateMemory(pMac->hHdd, (void **) &pTxCtrlMsg, |
| 6550 | (sizeof(*pTxCtrlMsg) + nBytes)); |
| 6551 | if (status != eHAL_STATUS_SUCCESS) |
| 6552 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6553 | limLog(pMac, LOGP, FL("palAllocateMemory() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6554 | return; |
| 6555 | } |
| 6556 | |
| 6557 | status = palZeroMemory(pMac->hHdd, (void *) pTxCtrlMsg, |
| 6558 | (sizeof(*pTxCtrlMsg) + nBytes)); |
| 6559 | if (status != eHAL_STATUS_SUCCESS) |
| 6560 | { |
| 6561 | palFreeMemory(pMac->hHdd, (void *) pTxCtrlMsg); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6562 | limLog(pMac, LOGP, FL("palZeroMemory() failed, status = %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6563 | return; |
| 6564 | } |
| 6565 | |
| 6566 | status = __limFillTxControlParams(pMac, pTxCtrlMsg, type, mode); |
| 6567 | if (status != eHAL_STATUS_SUCCESS) |
| 6568 | { |
| 6569 | palFreeMemory(pMac->hHdd, (void *) pTxCtrlMsg); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6570 | limLog(pMac, LOGP, FL("__limFillTxControlParams failed, status = %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6571 | return; |
| 6572 | } |
| 6573 | |
| 6574 | msgQ.bodyptr = (void *) pTxCtrlMsg; |
| 6575 | msgQ.bodyval = 0; |
| 6576 | msgQ.reserved = 0; |
| 6577 | msgQ.type = WDA_TRANSMISSION_CONTROL_IND; |
| 6578 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6579 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6580 | if(wdaPostCtrlMsg( pMac, &msgQ) != eSIR_SUCCESS) |
| 6581 | { |
| 6582 | palFreeMemory(pMac->hHdd, (void *) pTxCtrlMsg); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6583 | limLog( pMac, LOGP, FL("Posting Message to HAL failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6584 | return; |
| 6585 | } |
| 6586 | |
| 6587 | if (mode == eLIM_STOP_TX) |
| 6588 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6589 | PELOG1(limLog(pMac, LOG1, FL("Stopping the transmission of all packets, indicated softmac"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6590 | } |
| 6591 | else |
| 6592 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6593 | PELOG1(limLog(pMac, LOG1, FL("Resuming the transmission of all packets, indicated softmac"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6594 | } |
| 6595 | return; |
| 6596 | } |
| 6597 | |
| 6598 | |
| 6599 | /** |
| 6600 | * @function : limRestorePreChannelSwitchState() |
| 6601 | * |
| 6602 | * @brief : This API is called by the user to undo any |
| 6603 | * specific changes done on the device during |
| 6604 | * channel switch. |
| 6605 | * LOGIC: |
| 6606 | * |
| 6607 | * ASSUMPTIONS: |
| 6608 | * NA |
| 6609 | * |
| 6610 | * NOTE: |
| 6611 | * NA |
| 6612 | * |
| 6613 | * @param pMac - Pointer to Global MAC structure |
| 6614 | * @return None |
| 6615 | */ |
| 6616 | |
| 6617 | tSirRetStatus |
| 6618 | limRestorePreChannelSwitchState(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 6619 | { |
| 6620 | |
| 6621 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6622 | tANI_U32 val = 0; |
| 6623 | |
| 6624 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 6625 | return retCode; |
| 6626 | |
| 6627 | /* Channel switch should be ready for the next time */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6628 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6629 | |
| 6630 | /* Restore the frame transmission, all the time. */ |
| 6631 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 6632 | |
| 6633 | /* Free to enter BMPS */ |
| 6634 | limSendSmePostChannelSwitchInd(pMac); |
| 6635 | |
| 6636 | //Background scan is now enabled by SME |
| 6637 | if(pMac->lim.gLimBackgroundScanTerminate == FALSE) |
| 6638 | { |
| 6639 | /* Enable background scan if already enabled, else don't bother */ |
| 6640 | if ((retCode = wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 6641 | &val)) != eSIR_SUCCESS) |
| 6642 | |
| 6643 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6644 | limLog(pMac, LOGP, FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6645 | return (retCode); |
| 6646 | } |
| 6647 | |
| 6648 | if (val > 0 && TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer)) |
| 6649 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6650 | 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] | 6651 | if(tx_timer_activate(&pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 6652 | { |
| 6653 | limLog(pMac, LOGP, FL("Could not restart background scan timer, doing LOGP")); |
| 6654 | return (eSIR_FAILURE); |
| 6655 | } |
| 6656 | |
| 6657 | } |
| 6658 | } |
| 6659 | |
| 6660 | /* Enable heartbeat timer */ |
| 6661 | if (TX_TIMER_VALID(pMac->lim.limTimers.gLimHeartBeatTimer)) |
| 6662 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6663 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 6664 | if((limActivateHearBeatTimer(pMac) != TX_SUCCESS) && (!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6665 | { |
| 6666 | limLog(pMac, LOGP, FL("Could not restart heartbeat timer, doing LOGP")); |
| 6667 | return (eSIR_FAILURE); |
| 6668 | } |
| 6669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6670 | return (retCode); |
| 6671 | } |
| 6672 | |
| 6673 | |
| 6674 | /**-------------------------------------------- |
| 6675 | \fn limRestorePreQuietState |
| 6676 | \brief Restore the pre quiet state |
| 6677 | |
| 6678 | \param pMac |
| 6679 | \return NONE |
| 6680 | ---------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6681 | tSirRetStatus limRestorePreQuietState(tpAniSirGlobal pMac, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6682 | { |
| 6683 | |
| 6684 | tSirRetStatus retCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6685 | tANI_U32 val = 0; |
| 6686 | |
| 6687 | if (pMac->lim.gLimSystemRole != eLIM_STA_ROLE) |
| 6688 | return retCode; |
| 6689 | |
| 6690 | /* Quiet should be ready for the next time */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6691 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6692 | |
| 6693 | /* Restore the frame transmission, all the time. */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6694 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6695 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 6696 | |
| 6697 | |
| 6698 | //Background scan is now enabled by SME |
| 6699 | if(pMac->lim.gLimBackgroundScanTerminate == FALSE) |
| 6700 | { |
| 6701 | /* Enable background scan if already enabled, else don't bother */ |
| 6702 | if ((retCode = wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD, |
| 6703 | &val)) != eSIR_SUCCESS) |
| 6704 | |
| 6705 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6706 | limLog(pMac, LOGP, FL("could not retrieve Background scan period value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6707 | return (retCode); |
| 6708 | } |
| 6709 | |
| 6710 | if (val > 0 && TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer)) |
| 6711 | { |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 6712 | 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] | 6713 | if(tx_timer_activate(&pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 6714 | { |
| 6715 | limLog(pMac, LOGP, FL("Could not restart background scan timer, doing LOGP")); |
| 6716 | return (eSIR_FAILURE); |
| 6717 | } |
| 6718 | |
| 6719 | } |
| 6720 | } |
| 6721 | |
| 6722 | /* Enable heartbeat timer */ |
| 6723 | if (TX_TIMER_VALID(pMac->lim.limTimers.gLimHeartBeatTimer)) |
| 6724 | { |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 6725 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6726 | if(limActivateHearBeatTimer(pMac) != TX_SUCCESS) |
| 6727 | { |
| 6728 | limLog(pMac, LOGP, FL("Could not restart heartbeat timer, doing LOGP")); |
| 6729 | return (eSIR_FAILURE); |
| 6730 | } |
| 6731 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6732 | return (retCode); |
| 6733 | } |
| 6734 | |
| 6735 | |
| 6736 | /** |
| 6737 | * @function: limPrepareFor11hChannelSwitch() |
| 6738 | * |
| 6739 | * @brief : This API is called by the user to prepare for |
| 6740 | * 11h channel switch. As of now, the API does |
| 6741 | * very minimal work. User can add more into the |
| 6742 | * same API if needed. |
| 6743 | * LOGIC: |
| 6744 | * |
| 6745 | * ASSUMPTIONS: |
| 6746 | * NA |
| 6747 | * |
| 6748 | * NOTE: |
| 6749 | * NA |
| 6750 | * |
| 6751 | * @param pMac - Pointer to Global MAC structure |
| 6752 | * @param psessionEntry |
| 6753 | * @return None |
| 6754 | */ |
| 6755 | void |
| 6756 | limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 6757 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | if (psessionEntry->limSystemRole != eLIM_STA_ROLE) |
| 6759 | return; |
| 6760 | |
| 6761 | /* Flag to indicate 11h channel switch in progress */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6762 | psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6763 | |
| 6764 | /* Disable, Stop background scan if enabled and running */ |
| 6765 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 6766 | |
| 6767 | /* Stop heart-beat timer to stop heartbeat disassociation */ |
| 6768 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
| 6769 | |
| 6770 | if(pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE || |
| 6771 | pMac->lim.gLimSmeState == eLIM_SME_CHANNEL_SCAN_STATE) |
| 6772 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6773 | 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] | 6774 | /* Stop ongoing scanning if any */ |
| 6775 | if (GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 6776 | { |
| 6777 | //Set the resume channel to Any valid channel (invalid). |
| 6778 | //This will instruct HAL to set it to any previous valid channel. |
| 6779 | peSetResumeChannel(pMac, 0, 0); |
| 6780 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 6781 | } |
| 6782 | else |
| 6783 | { |
| 6784 | limRestorePreChannelSwitchState(pMac, psessionEntry); |
| 6785 | } |
| 6786 | return; |
| 6787 | } |
| 6788 | else |
| 6789 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6790 | 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] | 6791 | /** We are safe to switch channel at this point */ |
| 6792 | limStopTxAndSwitchChannel(pMac, psessionEntry->peSessionId); |
| 6793 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6794 | } |
| 6795 | |
| 6796 | |
| 6797 | |
| 6798 | /**---------------------------------------------------- |
| 6799 | \fn limGetNwType |
| 6800 | |
| 6801 | \brief Get type of the network from data packet or beacon |
| 6802 | \param pMac |
| 6803 | \param channelNum - Channel number |
| 6804 | \param type - Type of packet. |
| 6805 | \param pBeacon - Pointer to beacon or probe response |
| 6806 | |
| 6807 | \return Network type a/b/g. |
| 6808 | -----------------------------------------------------*/ |
| 6809 | tSirNwType limGetNwType(tpAniSirGlobal pMac, tANI_U8 channelNum, tANI_U32 type, tpSchBeaconStruct pBeacon) |
| 6810 | { |
| 6811 | tSirNwType nwType = eSIR_11B_NW_TYPE; |
| 6812 | |
| 6813 | if (type == SIR_MAC_DATA_FRAME) |
| 6814 | { |
| 6815 | if ((channelNum > 0) && (channelNum < 15)) |
| 6816 | { |
| 6817 | nwType = eSIR_11G_NW_TYPE; |
| 6818 | } |
| 6819 | else |
| 6820 | { |
| 6821 | nwType = eSIR_11A_NW_TYPE; |
| 6822 | } |
| 6823 | } |
| 6824 | else |
| 6825 | { |
| 6826 | if ((channelNum > 0) && (channelNum < 15)) |
| 6827 | { |
| 6828 | int i; |
| 6829 | // 11b or 11g packet |
| 6830 | // 11g iff extended Rate IE is present or |
| 6831 | // if there is an A rate in suppRate IE |
| 6832 | for (i = 0; i < pBeacon->supportedRates.numRates; i++) |
| 6833 | { |
| 6834 | if (sirIsArate(pBeacon->supportedRates.rate[i] & 0x7f)) |
| 6835 | { |
| 6836 | nwType = eSIR_11G_NW_TYPE; |
| 6837 | break; |
| 6838 | } |
| 6839 | } |
| 6840 | if (pBeacon->extendedRatesPresent) |
| 6841 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6842 | PELOG3(limLog(pMac, LOG3, FL("Beacon, nwtype=G"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6843 | nwType = eSIR_11G_NW_TYPE; |
| 6844 | } |
| 6845 | } |
| 6846 | else |
| 6847 | { |
| 6848 | // 11a packet |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6849 | PELOG3(limLog(pMac, LOG3,FL("Beacon, nwtype=A"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6850 | nwType = eSIR_11A_NW_TYPE; |
| 6851 | } |
| 6852 | } |
| 6853 | return nwType; |
| 6854 | } |
| 6855 | |
| 6856 | |
| 6857 | /**--------------------------------------------------------- |
| 6858 | \fn limGetChannelFromBeacon |
| 6859 | \brief To extract channel number from beacon |
| 6860 | |
| 6861 | \param pMac |
| 6862 | \param pBeacon - Pointer to beacon or probe rsp |
| 6863 | \return channel number |
| 6864 | -----------------------------------------------------------*/ |
| 6865 | tANI_U8 limGetChannelFromBeacon(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon) |
| 6866 | { |
| 6867 | tANI_U8 channelNum = 0; |
| 6868 | |
| 6869 | if (pBeacon->dsParamsPresent) |
| 6870 | channelNum = pBeacon->channelNumber; |
| 6871 | else if(pBeacon->HTInfo.present) |
| 6872 | channelNum = pBeacon->HTInfo.primaryChannel; |
| 6873 | else |
| 6874 | channelNum = pBeacon->channelNumber; |
| 6875 | |
| 6876 | return channelNum; |
| 6877 | } |
| 6878 | |
| 6879 | |
| 6880 | /** --------------------------------------------------------- |
| 6881 | \fn limSetTspecUapsdMask |
| 6882 | \brief This function sets the PE global variable: |
| 6883 | \ 1) gUapsdPerAcTriggerEnableMask and |
| 6884 | \ 2) gUapsdPerAcDeliveryEnableMask |
| 6885 | \ based on the user priority field and direction field |
| 6886 | \ in the TS Info Fields. |
| 6887 | \ |
| 6888 | \ An AC is a trigger-enabled AC if the PSB subfield |
| 6889 | \ is set to 1 in the uplink direction. |
| 6890 | \ An AC is a delivery-enabled AC if the PSB subfield |
| 6891 | \ is set to 1 in the down-link direction. |
| 6892 | \ |
| 6893 | \param tpAniSirGlobal pMac |
| 6894 | \param tSirMacTSInfo pTsInfo |
| 6895 | \param tANI_U32 action |
| 6896 | \return None |
| 6897 | ------------------------------------------------------------*/ |
| 6898 | void limSetTspecUapsdMask(tpAniSirGlobal pMac, tSirMacTSInfo *pTsInfo, tANI_U32 action) |
| 6899 | { |
| 6900 | tANI_U8 userPrio = (tANI_U8)pTsInfo->traffic.userPrio; |
| 6901 | tANI_U16 direction = pTsInfo->traffic.direction; |
| 6902 | tANI_U8 ac = upToAc(userPrio); |
| 6903 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6904 | PELOG1(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] | 6905 | |
| 6906 | /* Converting AC to appropriate Uapsd Bit Mask |
| 6907 | * AC_BE(0) --> UAPSD_BITOFFSET_ACVO(3) |
| 6908 | * AC_BK(1) --> UAPSD_BITOFFSET_ACVO(2) |
| 6909 | * AC_VI(2) --> UAPSD_BITOFFSET_ACVO(1) |
| 6910 | * AC_VO(3) --> UAPSD_BITOFFSET_ACVO(0) |
| 6911 | */ |
| 6912 | ac = ((~ac) & 0x3); |
| 6913 | |
| 6914 | if (action == CLEAR_UAPSD_MASK) |
| 6915 | { |
| 6916 | if (direction == SIR_MAC_DIRECTION_UPLINK) |
| 6917 | pMac->lim.gUapsdPerAcTriggerEnableMask &= ~(1 << ac); |
| 6918 | else if (direction == SIR_MAC_DIRECTION_DNLINK) |
| 6919 | pMac->lim.gUapsdPerAcDeliveryEnableMask &= ~(1 << ac); |
| 6920 | else if (direction == SIR_MAC_DIRECTION_BIDIR) |
| 6921 | { |
| 6922 | pMac->lim.gUapsdPerAcTriggerEnableMask &= ~(1 << ac); |
| 6923 | pMac->lim.gUapsdPerAcDeliveryEnableMask &= ~(1 << ac); |
| 6924 | } |
| 6925 | } |
| 6926 | else if (action == SET_UAPSD_MASK) |
| 6927 | { |
| 6928 | if (direction == SIR_MAC_DIRECTION_UPLINK) |
| 6929 | pMac->lim.gUapsdPerAcTriggerEnableMask |= (1 << ac); |
| 6930 | else if (direction == SIR_MAC_DIRECTION_DNLINK) |
| 6931 | pMac->lim.gUapsdPerAcDeliveryEnableMask |= (1 << ac); |
| 6932 | else if (direction == SIR_MAC_DIRECTION_BIDIR) |
| 6933 | { |
| 6934 | pMac->lim.gUapsdPerAcTriggerEnableMask |= (1 << ac); |
| 6935 | pMac->lim.gUapsdPerAcDeliveryEnableMask |= (1 << ac); |
| 6936 | } |
| 6937 | } |
| 6938 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6939 | limLog(pMac, LOGE, FL("New pMac->lim.gUapsdPerAcTriggerEnableMask = 0x%x "), pMac->lim.gUapsdPerAcTriggerEnableMask ); |
| 6940 | 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] | 6941 | |
| 6942 | return; |
| 6943 | } |
| 6944 | |
| 6945 | |
| 6946 | |
| 6947 | void limHandleHeartBeatTimeout(tpAniSirGlobal pMac ) |
| 6948 | { |
| 6949 | |
| 6950 | tANI_U8 i; |
| 6951 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 6952 | { |
| 6953 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 6954 | { |
| 6955 | if(pMac->lim.gpSession[i].bssType == eSIR_IBSS_MODE) |
| 6956 | { |
| 6957 | limIbssHeartBeatHandle(pMac,&pMac->lim.gpSession[i]); |
| 6958 | break; |
| 6959 | } |
| 6960 | |
| 6961 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 6962 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 6963 | { |
| 6964 | limHandleHeartBeatFailure(pMac,&pMac->lim.gpSession[i]); |
| 6965 | } |
| 6966 | } |
| 6967 | } |
| 6968 | for(i=0; i< pMac->lim.maxBssId; i++) |
| 6969 | { |
| 6970 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 6971 | { |
| 6972 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 6973 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 6974 | { |
| 6975 | if(pMac->lim.gpSession[i].LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 6976 | { |
| 6977 | /* Activate Probe After HeartBeat Timer incase HB Failure detected */ |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6978 | PELOGW(limLog(pMac, LOGW,FL("Sending Probe for Session: %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6979 | i);) |
| 6980 | limDeactivateAndChangeTimer(pMac, eLIM_PROBE_AFTER_HB_TIMER); |
| 6981 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_PROBE_AFTER_HB_TIMER)); |
| 6982 | if (tx_timer_activate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != TX_SUCCESS) |
| 6983 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6984 | limLog(pMac, LOGP, FL("Fail to re-activate Probe-after-heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6985 | limReactivateHeartBeatTimer(pMac, &pMac->lim.gpSession[i]); |
| 6986 | } |
| 6987 | break; |
| 6988 | } |
| 6989 | } |
| 6990 | } |
| 6991 | } |
| 6992 | } |
| 6993 | |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 6994 | void limHandleHeartBeatTimeoutForSession(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 6995 | { |
| 6996 | if(psessionEntry->valid == TRUE ) |
| 6997 | { |
| 6998 | if(psessionEntry->bssType == eSIR_IBSS_MODE) |
| 6999 | { |
| 7000 | limIbssHeartBeatHandle(pMac,psessionEntry); |
| 7001 | } |
| 7002 | if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7003 | (psessionEntry->limSystemRole == eLIM_STA_ROLE)) |
| 7004 | { |
| 7005 | limHandleHeartBeatFailure(pMac,psessionEntry); |
| 7006 | } |
| 7007 | } |
| 7008 | /* In the function limHandleHeartBeatFailure things can change so check for the session entry valid |
| 7009 | and the other things again */ |
| 7010 | if(psessionEntry->valid == TRUE ) |
| 7011 | { |
| 7012 | if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7013 | (psessionEntry->limSystemRole == eLIM_STA_ROLE)) |
| 7014 | { |
| 7015 | if(psessionEntry->LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 7016 | { |
| 7017 | /* Activate Probe After HeartBeat Timer incase HB Failure detected */ |
| 7018 | PELOGW(limLog(pMac, LOGW,FL("Sending Probe for Session: %d"), |
| 7019 | psessionEntry->bssIdx);) |
| 7020 | limDeactivateAndChangeTimer(pMac, eLIM_PROBE_AFTER_HB_TIMER); |
| 7021 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, 0, eLIM_PROBE_AFTER_HB_TIMER)); |
| 7022 | if (tx_timer_activate(&pMac->lim.limTimers.gLimProbeAfterHBTimer) != TX_SUCCESS) |
| 7023 | { |
| 7024 | limLog(pMac, LOGP, FL("Fail to re-activate Probe-after-heartbeat timer")); |
| 7025 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7026 | } |
| 7027 | } |
| 7028 | } |
| 7029 | } |
| 7030 | } |
| 7031 | |
| 7032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7033 | tANI_U8 limGetCurrentOperatingChannel(tpAniSirGlobal pMac) |
| 7034 | { |
| 7035 | tANI_U8 i; |
| 7036 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7037 | { |
| 7038 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7039 | { |
| 7040 | if((pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) && |
| 7041 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_ROLE)) |
| 7042 | { |
| 7043 | return pMac->lim.gpSession[i].currentOperChannel; |
| 7044 | } |
| 7045 | } |
| 7046 | } |
| 7047 | return 0; |
| 7048 | } |
| 7049 | |
| 7050 | void limProcessAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7051 | { |
| 7052 | |
| 7053 | tpPESession psessionEntry; |
| 7054 | // tANI_U8 sessionId; |
| 7055 | tpAddStaParams pAddStaParams; |
| 7056 | |
| 7057 | pAddStaParams = (tpAddStaParams)limMsgQ->bodyptr; |
| 7058 | |
| 7059 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddStaParams->sessionId))==NULL) |
| 7060 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7061 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7062 | palFreeMemory(pMac, pAddStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7063 | return; |
| 7064 | } |
| 7065 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 7066 | (void) limIbssAddStaRsp(pMac, limMsgQ->bodyptr,psessionEntry); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 7067 | #ifdef FEATURE_WLAN_TDLS |
| 7068 | else if(pMac->lim.gLimAddStaTdls) |
| 7069 | { |
| 7070 | limProcessTdlsAddStaRsp(pMac, limMsgQ->bodyptr, psessionEntry) ; |
| 7071 | pMac->lim.gLimAddStaTdls = FALSE ; |
| 7072 | } |
| 7073 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7074 | else |
| 7075 | limProcessMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
| 7076 | |
| 7077 | } |
| 7078 | |
| 7079 | |
| 7080 | void limUpdateBeacon(tpAniSirGlobal pMac) |
| 7081 | { |
| 7082 | tANI_U8 i; |
| 7083 | |
| 7084 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7085 | { |
| 7086 | if(pMac->lim.gpSession[i].valid == TRUE ) |
| 7087 | { |
| 7088 | if( ( (pMac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) || |
| 7089 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_IN_IBSS_ROLE) ) |
| 7090 | && (eLIM_SME_NORMAL_STATE == pMac->lim.gpSession[i].limSmeState) |
| 7091 | ) |
| 7092 | { |
| 7093 | schSetFixedBeaconFields(pMac,&pMac->lim.gpSession[i]); |
| 7094 | limSendBeaconInd(pMac, &pMac->lim.gpSession[i]); |
| 7095 | } |
| 7096 | else |
| 7097 | { |
| 7098 | if( (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_AP_ROLE)|| |
| 7099 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 7100 | { |
| 7101 | |
| 7102 | if(pMac->lim.gpSession[i].statypeForBss == STA_ENTRY_SELF) |
| 7103 | { |
| 7104 | schSetFixedBeaconFields(pMac,&pMac->lim.gpSession[i]); |
| 7105 | } |
| 7106 | } |
| 7107 | } |
| 7108 | } |
| 7109 | } |
| 7110 | } |
| 7111 | |
| 7112 | void limHandleHeartBeatFailureTimeout(tpAniSirGlobal pMac) |
| 7113 | { |
| 7114 | tANI_U8 i; |
| 7115 | tpPESession psessionEntry; |
| 7116 | /* Probe response is not received after HB failure. This is handled by LMM sub module. */ |
| 7117 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 7118 | { |
| 7119 | if(pMac->lim.gpSession[i].valid == TRUE) |
| 7120 | { |
| 7121 | psessionEntry = &pMac->lim.gpSession[i]; |
| 7122 | if(psessionEntry->LimHBFailureStatus == eANI_BOOLEAN_TRUE) |
| 7123 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7124 | limLog(pMac, LOGE, FL("Probe_hb_failure: SME %d, MLME %d, HB-Count %d"),psessionEntry->limSmeState, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7125 | psessionEntry->limMlmState, psessionEntry->LimRxedBeaconCntDuringHB); |
| 7126 | if (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 7127 | { |
| 7128 | if (!LIM_IS_CONNECTION_ACTIVE(psessionEntry)) |
| 7129 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7130 | limLog(pMac, LOGE, FL("Probe_hb_failure: for session:%d " ),psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7131 | /* AP did not respond to Probe Request. Tear down link with it.*/ |
| 7132 | limTearDownLinkWithAp(pMac, |
| 7133 | psessionEntry->peSessionId, |
| 7134 | eSIR_BEACON_MISSED); |
| 7135 | pMac->lim.gLimProbeFailureAfterHBfailedCnt++ ; |
| 7136 | } |
| 7137 | else // restart heartbeat timer |
| 7138 | { |
| 7139 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7140 | } |
| 7141 | } |
| 7142 | else |
| 7143 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7144 | limLog(pMac, LOGE, FL("Unexpected wt-probe-timeout in state ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7145 | limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); |
| 7146 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 7147 | } |
| 7148 | |
| 7149 | } |
| 7150 | } |
| 7151 | } |
| 7152 | /* Deactivate Timer ProbeAfterHB Timer -> As its a oneshot timer, need not deactivate the timer */ |
| 7153 | // tx_timer_deactivate(&pMac->lim.limTimers.gLimProbeAfterHBTimer); |
| 7154 | } |
| 7155 | |
| 7156 | |
| 7157 | /* |
| 7158 | * This function assumes there will not be more than one IBSS session active at any time. |
| 7159 | */ |
| 7160 | tpPESession limIsIBSSSessionActive(tpAniSirGlobal pMac) |
| 7161 | { |
| 7162 | tANI_U8 i; |
| 7163 | |
| 7164 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7165 | { |
| 7166 | if( (pMac->lim.gpSession[i].valid) && |
| 7167 | (pMac->lim.gpSession[i].limSystemRole == eLIM_STA_IN_IBSS_ROLE)) |
| 7168 | return (&pMac->lim.gpSession[i]); |
| 7169 | } |
| 7170 | |
| 7171 | return NULL; |
| 7172 | } |
| 7173 | |
| 7174 | tpPESession limIsApSessionActive(tpAniSirGlobal pMac) |
| 7175 | { |
| 7176 | tANI_U8 i; |
| 7177 | |
| 7178 | for(i =0;i < pMac->lim.maxBssId;i++) |
| 7179 | { |
| 7180 | if( (pMac->lim.gpSession[i].valid) && |
| 7181 | ( (pMac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) || |
| 7182 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_AP_ROLE))) |
| 7183 | return (&pMac->lim.gpSession[i]); |
| 7184 | } |
| 7185 | |
| 7186 | return NULL; |
| 7187 | } |
| 7188 | |
| 7189 | /**--------------------------------------------------------- |
| 7190 | \fn limHandleDeferMsgError |
| 7191 | \brief handles error scenario, when the msg can not be deferred. |
| 7192 | \param pMac |
| 7193 | \param pLimMsg LIM msg, which could not be deferred. |
| 7194 | \return void |
| 7195 | -----------------------------------------------------------*/ |
| 7196 | |
| 7197 | void limHandleDeferMsgError(tpAniSirGlobal pMac, tpSirMsgQ pLimMsg) |
| 7198 | { |
| 7199 | if(SIR_BB_XPORT_MGMT_MSG == pLimMsg->type) |
| 7200 | { |
| 7201 | vos_pkt_return_packet((vos_pkt_t*)pLimMsg->bodyptr); |
| 7202 | } |
| 7203 | else if(pLimMsg->bodyptr != NULL) |
| 7204 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr); |
| 7205 | |
| 7206 | } |
| 7207 | |
| 7208 | |
| 7209 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 7210 | /**--------------------------------------------------------- |
| 7211 | \fn limDiagEventReport |
| 7212 | \brief This function reports Diag event |
| 7213 | \param pMac |
| 7214 | \param eventType |
| 7215 | \param bssid |
| 7216 | \param status |
| 7217 | \param reasonCode |
| 7218 | \return void |
| 7219 | -----------------------------------------------------------*/ |
| 7220 | void limDiagEventReport(tpAniSirGlobal pMac, tANI_U16 eventType, tpPESession pSessionEntry, tANI_U16 status, tANI_U16 reasonCode) |
| 7221 | { |
| 7222 | tSirMacAddr nullBssid = { 0, 0, 0, 0, 0, 0 }; |
| 7223 | WLAN_VOS_DIAG_EVENT_DEF(peEvent, vos_event_wlan_pe_payload_type); |
| 7224 | |
| 7225 | palZeroMemory(pMac->hHdd, &peEvent, sizeof(vos_event_wlan_pe_payload_type)); |
| 7226 | |
| 7227 | if (NULL == pSessionEntry) |
| 7228 | { |
| 7229 | palCopyMemory(pMac->hHdd, peEvent.bssid, nullBssid, sizeof(tSirMacAddr)); |
| 7230 | peEvent.sme_state = (tANI_U16)pMac->lim.gLimSmeState; |
| 7231 | peEvent.mlm_state = (tANI_U16)pMac->lim.gLimMlmState; |
| 7232 | |
| 7233 | } |
| 7234 | else |
| 7235 | { |
| 7236 | palCopyMemory(pMac->hHdd, peEvent.bssid, pSessionEntry->bssId, sizeof(tSirMacAddr)); |
| 7237 | peEvent.sme_state = (tANI_U16)pSessionEntry->limSmeState; |
| 7238 | peEvent.mlm_state = (tANI_U16)pSessionEntry->limMlmState; |
| 7239 | } |
| 7240 | peEvent.event_type = eventType; |
| 7241 | peEvent.status = status; |
| 7242 | peEvent.reason_code = reasonCode; |
| 7243 | |
| 7244 | WLAN_VOS_DIAG_EVENT_REPORT(&peEvent, EVENT_WLAN_PE); |
| 7245 | return; |
| 7246 | } |
| 7247 | |
| 7248 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 7249 | |
| 7250 | void limProcessAddStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7251 | { |
| 7252 | |
| 7253 | tpAddStaSelfParams pAddStaSelfParams; |
| 7254 | tSirMsgQ mmhMsg; |
| 7255 | tpSirSmeAddStaSelfRsp pRsp; |
| 7256 | |
| 7257 | |
| 7258 | pAddStaSelfParams = (tpAddStaSelfParams)limMsgQ->bodyptr; |
| 7259 | |
| 7260 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pRsp, sizeof(tSirSmeAddStaSelfRsp))) |
| 7261 | { |
| 7262 | /// Buffer not available. Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7263 | limLog(pMac, LOGP, FL("call to palAllocateMemory failed for Add Sta self RSP")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7264 | palFreeMemory( pMac->hHdd, (tANI_U8 *)pAddStaSelfParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7265 | return; |
| 7266 | } |
| 7267 | |
| 7268 | palZeroMemory(pMac, (tANI_U8*)pRsp, sizeof(tSirSmeAddStaSelfRsp)); |
| 7269 | |
| 7270 | pRsp->mesgType = eWNI_SME_ADD_STA_SELF_RSP; |
| 7271 | pRsp->mesgLen = (tANI_U16) sizeof(tSirSmeAddStaSelfRsp); |
| 7272 | pRsp->status = pAddStaSelfParams->status; |
| 7273 | |
| 7274 | palCopyMemory( pMac->hHdd, pRsp->selfMacAddr, pAddStaSelfParams->selfMacAddr, sizeof(tSirMacAddr) ); |
| 7275 | |
| 7276 | palFreeMemory( pMac->hHdd, (tANI_U8 *)pAddStaSelfParams); |
| 7277 | |
| 7278 | mmhMsg.type = eWNI_SME_ADD_STA_SELF_RSP; |
| 7279 | mmhMsg.bodyptr = pRsp; |
| 7280 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7281 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7282 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 7283 | |
| 7284 | } |
| 7285 | |
| 7286 | void limProcessDelStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) |
| 7287 | { |
| 7288 | |
| 7289 | tpDelStaSelfParams pDelStaSelfParams; |
| 7290 | tSirMsgQ mmhMsg; |
| 7291 | tpSirSmeDelStaSelfRsp pRsp; |
| 7292 | |
| 7293 | |
| 7294 | pDelStaSelfParams = (tpDelStaSelfParams)limMsgQ->bodyptr; |
| 7295 | |
| 7296 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pRsp, sizeof(tSirSmeDelStaSelfRsp))) |
| 7297 | { |
| 7298 | /// Buffer not available. Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7299 | limLog(pMac, LOGP, FL("call to palAllocateMemory failed for Add Sta self RSP")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7300 | palFreeMemory( pMac->hHdd, (tANI_U8 *)pDelStaSelfParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7301 | return; |
| 7302 | } |
| 7303 | |
| 7304 | palZeroMemory(pMac, (tANI_U8*)pRsp, sizeof(tSirSmeDelStaSelfRsp)); |
| 7305 | |
| 7306 | pRsp->mesgType = eWNI_SME_DEL_STA_SELF_RSP; |
| 7307 | pRsp->mesgLen = (tANI_U16) sizeof(tSirSmeDelStaSelfRsp); |
| 7308 | pRsp->status = pDelStaSelfParams->status; |
| 7309 | |
| 7310 | palCopyMemory( pMac->hHdd, pRsp->selfMacAddr, pDelStaSelfParams->selfMacAddr, sizeof(tSirMacAddr) ); |
| 7311 | |
| 7312 | palFreeMemory( pMac->hHdd, (tANI_U8 *)pDelStaSelfParams); |
| 7313 | |
| 7314 | mmhMsg.type = eWNI_SME_DEL_STA_SELF_RSP; |
| 7315 | mmhMsg.bodyptr = pRsp; |
| 7316 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7317 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7318 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 7319 | |
| 7320 | } |
| 7321 | |
| 7322 | /*************************************************************** |
| 7323 | * tANI_U8 limUnmapChannel(tANI_U8 mapChannel) |
| 7324 | * To unmap the channel to reverse the effect of mapping |
| 7325 | * a band channel in hal .Mapping was done hal to overcome the |
| 7326 | * limitation of the rxbd which use only 4 bit for channel number. |
| 7327 | *****************************************************************/ |
| 7328 | tANI_U8 limUnmapChannel(tANI_U8 mapChannel) |
| 7329 | { |
| 7330 | if( mapChannel > 0 && mapChannel < 25 ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 7331 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 7332 | if (IS_ROAM_SCAN_OFFLOAD_FEATURE_ENABLE) |
| 7333 | return aUnsortedChannelList[mapChannel -1]; |
| 7334 | else |
| 7335 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7336 | return abChannel[mapChannel -1]; |
| 7337 | else |
| 7338 | return 0; |
| 7339 | } |
| 7340 | |
| 7341 | |
| 7342 | v_U8_t* limGetIEPtr(tpAniSirGlobal pMac, v_U8_t *pIes, int length, v_U8_t eid,eSizeOfLenField size_of_len_field) |
| 7343 | { |
| 7344 | int left = length; |
| 7345 | v_U8_t *ptr = pIes; |
| 7346 | v_U8_t elem_id; |
| 7347 | v_U16_t elem_len; |
| 7348 | |
| 7349 | while(left >= (size_of_len_field+1)) |
| 7350 | { |
| 7351 | elem_id = ptr[0]; |
| 7352 | if (size_of_len_field == TWO_BYTE) |
| 7353 | { |
| 7354 | elem_len = ((v_U16_t) ptr[1]) | (ptr[2]<<8); |
| 7355 | } |
| 7356 | else |
| 7357 | { |
| 7358 | elem_len = ptr[1]; |
| 7359 | } |
| 7360 | |
| 7361 | |
| 7362 | left -= (size_of_len_field+1); |
| 7363 | if(elem_len > left) |
| 7364 | { |
| 7365 | limLog(pMac, LOGE, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 7366 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7367 | eid,elem_len,left); |
| 7368 | return NULL; |
| 7369 | } |
| 7370 | if (elem_id == eid) |
| 7371 | { |
| 7372 | return ptr; |
| 7373 | } |
| 7374 | |
| 7375 | left -= elem_len; |
| 7376 | ptr += (elem_len + (size_of_len_field+1)); |
| 7377 | } |
| 7378 | return NULL; |
| 7379 | } |
| 7380 | |
| 7381 | /* return NULL if oui is not found in ie |
| 7382 | return !NULL pointer to vendor IE (starting from 0xDD) if oui is found |
| 7383 | */ |
| 7384 | v_U8_t* limGetVendorIEOuiPtr(tpAniSirGlobal pMac, tANI_U8 *oui, tANI_U8 oui_size, tANI_U8 *ie, tANI_U16 ie_len) |
| 7385 | { |
| 7386 | int left = ie_len; |
| 7387 | v_U8_t *ptr = ie; |
| 7388 | v_U8_t elem_id, elem_len; |
| 7389 | |
| 7390 | while(left >= 2) |
| 7391 | { |
| 7392 | elem_id = ptr[0]; |
| 7393 | elem_len = ptr[1]; |
| 7394 | left -= 2; |
| 7395 | if(elem_len > left) |
| 7396 | { |
| 7397 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7398 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7399 | elem_id,elem_len,left); |
| 7400 | return NULL; |
| 7401 | } |
| 7402 | if (SIR_MAC_EID_VENDOR == elem_id) |
| 7403 | { |
| 7404 | if(memcmp(&ptr[2], oui, oui_size)==0) |
| 7405 | return ptr; |
| 7406 | } |
| 7407 | |
| 7408 | left -= elem_len; |
| 7409 | ptr += (elem_len + 2); |
| 7410 | } |
| 7411 | return NULL; |
| 7412 | } |
| 7413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7414 | //Returns length of P2P stream and Pointer ie passed to this function is filled with noa stream |
| 7415 | |
| 7416 | v_U8_t limBuildP2pIe(tpAniSirGlobal pMac, tANI_U8 *ie, tANI_U8 *data, tANI_U8 ie_len) |
| 7417 | { |
| 7418 | int length = 0; |
| 7419 | tANI_U8 *ptr = ie; |
| 7420 | |
| 7421 | ptr[length++] = SIR_MAC_EID_VENDOR; |
| 7422 | ptr[length++] = ie_len + SIR_MAC_P2P_OUI_SIZE; |
| 7423 | palCopyMemory( pMac->hHdd, &ptr[length], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE); |
| 7424 | palCopyMemory( pMac->hHdd, &ptr[length + SIR_MAC_P2P_OUI_SIZE], data, ie_len); |
| 7425 | return (ie_len + SIR_P2P_IE_HEADER_LEN); |
| 7426 | } |
| 7427 | |
| 7428 | //Returns length of NoA stream and Pointer pNoaStream passed to this function is filled with noa stream |
| 7429 | |
| 7430 | v_U8_t limGetNoaAttrStreamInMultP2pIes(tpAniSirGlobal pMac,v_U8_t* noaStream,v_U8_t noaLen,v_U8_t overFlowLen) |
| 7431 | { |
| 7432 | v_U8_t overFlowP2pStream[SIR_MAX_NOA_ATTR_LEN]; |
Krunal Soni | c768a93 | 2013-05-15 19:26:30 -0700 | [diff] [blame] | 7433 | |
| 7434 | if ((noaLen <= (SIR_MAX_NOA_ATTR_LEN+SIR_P2P_IE_HEADER_LEN)) && |
| 7435 | (noaLen >= overFlowLen) && (overFlowLen <= SIR_MAX_NOA_ATTR_LEN)) |
| 7436 | { |
| 7437 | palCopyMemory( pMac->hHdd, overFlowP2pStream, |
| 7438 | noaStream + noaLen - overFlowLen, overFlowLen); |
| 7439 | noaStream[noaLen - overFlowLen] = SIR_MAC_EID_VENDOR; |
| 7440 | noaStream[noaLen - overFlowLen + 1] = overFlowLen + SIR_MAC_P2P_OUI_SIZE; |
| 7441 | palCopyMemory( pMac->hHdd, noaStream+noaLen-overFlowLen + 2, |
| 7442 | SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE); |
| 7443 | palCopyMemory( pMac->hHdd, |
| 7444 | noaStream+noaLen + 2 + SIR_MAC_P2P_OUI_SIZE - overFlowLen, |
| 7445 | overFlowP2pStream, overFlowLen); |
| 7446 | } |
| 7447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7448 | return (noaLen + SIR_P2P_IE_HEADER_LEN); |
| 7449 | |
| 7450 | } |
| 7451 | |
| 7452 | //Returns length of NoA stream and Pointer pNoaStream passed to this function is filled with noa stream |
| 7453 | v_U8_t limGetNoaAttrStream(tpAniSirGlobal pMac, v_U8_t*pNoaStream,tpPESession psessionEntry) |
| 7454 | { |
| 7455 | v_U8_t len=0; |
| 7456 | |
| 7457 | v_U8_t *pBody = pNoaStream; |
| 7458 | |
| 7459 | |
| 7460 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
| 7461 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 7462 | { |
| 7463 | if ((!(psessionEntry->p2pGoPsUpdate.uNoa1Duration)) && (!(psessionEntry->p2pGoPsUpdate.uNoa2Duration)) |
| 7464 | && (!psessionEntry->p2pGoPsUpdate.oppPsFlag) |
| 7465 | ) |
| 7466 | return 0; //No NoA Descriptor then return 0 |
| 7467 | |
| 7468 | |
| 7469 | pBody[0] = SIR_P2P_NOA_ATTR; |
| 7470 | |
| 7471 | pBody[3] = psessionEntry->p2pGoPsUpdate.index; |
| 7472 | pBody[4] = psessionEntry->p2pGoPsUpdate.ctWin | (psessionEntry->p2pGoPsUpdate.oppPsFlag<<7); |
| 7473 | len = 5; |
| 7474 | pBody += len; |
| 7475 | |
| 7476 | |
| 7477 | if (psessionEntry->p2pGoPsUpdate.uNoa1Duration) |
| 7478 | { |
| 7479 | *pBody = psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt; |
| 7480 | pBody += 1; |
| 7481 | len +=1; |
| 7482 | |
| 7483 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1Duration); |
| 7484 | pBody += sizeof(tANI_U32); |
| 7485 | len +=4; |
| 7486 | |
| 7487 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1Interval); |
| 7488 | pBody += sizeof(tANI_U32); |
| 7489 | len +=4; |
| 7490 | |
| 7491 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa1StartTime); |
| 7492 | pBody += sizeof(tANI_U32); |
| 7493 | len +=4; |
| 7494 | |
| 7495 | } |
| 7496 | |
| 7497 | if (psessionEntry->p2pGoPsUpdate.uNoa2Duration) |
| 7498 | { |
| 7499 | *pBody = psessionEntry->p2pGoPsUpdate.uNoa2IntervalCnt; |
| 7500 | pBody += 1; |
| 7501 | len +=1; |
| 7502 | |
| 7503 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2Duration); |
| 7504 | pBody += sizeof(tANI_U32); |
| 7505 | len +=4; |
| 7506 | |
| 7507 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2Interval); |
| 7508 | pBody += sizeof(tANI_U32); |
| 7509 | len +=4; |
| 7510 | |
| 7511 | *((tANI_U32 *)(pBody)) = sirSwapU32ifNeeded(psessionEntry->p2pGoPsUpdate.uNoa2StartTime); |
| 7512 | pBody += sizeof(tANI_U32); |
| 7513 | len +=4; |
| 7514 | |
| 7515 | } |
| 7516 | |
| 7517 | |
| 7518 | pBody = pNoaStream + 1; |
| 7519 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(len-3);/*one byte for Attr and 2 bytes for length*/ |
| 7520 | |
| 7521 | return (len); |
| 7522 | |
| 7523 | } |
| 7524 | return 0; |
| 7525 | |
| 7526 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7527 | |
| 7528 | void peSetResumeChannel(tpAniSirGlobal pMac, tANI_U16 channel, ePhyChanBondState phyCbState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7529 | { |
| 7530 | |
| 7531 | pMac->lim.gResumeChannel = channel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7532 | pMac->lim.gResumePhyCbState = phyCbState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7533 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7535 | /*-------------------------------------------------------------------------- |
| 7536 | |
| 7537 | \brief peGetResumeChannel() - Returns the channel number for scanning, from a valid session. |
| 7538 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7539 | This function returns the channel to resume to during link resume. channel id of 0 means HAL will |
| 7540 | resume to previous channel before link suspend |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7541 | |
| 7542 | \param pMac - pointer to global adapter context |
| 7543 | \return - channel to scan from valid session else zero. |
| 7544 | |
| 7545 | \sa |
| 7546 | |
| 7547 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7548 | void peGetResumeChannel(tpAniSirGlobal pMac, tANI_U8* resumeChannel, ePhyChanBondState* resumePhyCbState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7549 | { |
| 7550 | |
| 7551 | //Rationale - this could be the suspend/resume for assoc and it is essential that |
| 7552 | //the new BSS is active for some time. Other BSS was anyway suspended. |
| 7553 | //TODO: Comeup with a better alternative. Sending NULL with PM=0 on other BSS means |
| 7554 | //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] | 7555 | //and hence should be ok. Need to discuss this further |
| 7556 | if( !limIsInMCC(pMac) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7557 | { |
| 7558 | //Get current active session channel |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7559 | peGetActiveSessionChannel(pMac, resumeChannel, resumePhyCbState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7560 | } |
| 7561 | else |
| 7562 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7563 | *resumeChannel = pMac->lim.gResumeChannel; |
| 7564 | *resumePhyCbState = pMac->lim.gResumePhyCbState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7565 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7566 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7567 | } |
| 7568 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 7569 | tANI_BOOLEAN limIsNOAInsertReqd(tpAniSirGlobal pMac) |
| 7570 | { |
| 7571 | tANI_U8 i; |
| 7572 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 7573 | { |
| 7574 | if(pMac->lim.gpSession[i].valid == TRUE) |
| 7575 | { |
| 7576 | if( (eLIM_AP_ROLE == pMac->lim.gpSession[i].limSystemRole ) |
| 7577 | && ( VOS_P2P_GO_MODE == pMac->lim.gpSession[i].pePersona ) |
| 7578 | ) |
| 7579 | { |
| 7580 | return TRUE; |
| 7581 | } |
| 7582 | } |
| 7583 | } |
| 7584 | return FALSE; |
| 7585 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7587 | |
| 7588 | tANI_BOOLEAN limIsconnectedOnDFSChannel(tANI_U8 currentChannel) |
| 7589 | { |
| 7590 | if(NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(currentChannel)) |
| 7591 | { |
| 7592 | return eANI_BOOLEAN_TRUE; |
| 7593 | } |
| 7594 | else |
| 7595 | { |
| 7596 | return eANI_BOOLEAN_FALSE; |
| 7597 | } |
| 7598 | } |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7599 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 7600 | #ifdef WLAN_FEATURE_11AC |
| 7601 | tANI_BOOLEAN limCheckVHTOpModeChange( tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U8 chanWidth, tANI_U8 staId) |
| 7602 | { |
| 7603 | tUpdateVHTOpMode tempParam; |
| 7604 | |
| 7605 | tempParam.opMode = chanWidth; |
| 7606 | tempParam.staId = staId; |
| 7607 | |
| 7608 | limSendModeUpdate( pMac, &tempParam, psessionEntry ); |
| 7609 | |
| 7610 | return eANI_BOOLEAN_TRUE; |
| 7611 | } |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7612 | #endif |
| 7613 | |
| 7614 | tANI_U8 limGetShortSlotFromPhyMode(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U32 phyMode) |
| 7615 | { |
| 7616 | tANI_U8 val=0; |
| 7617 | |
| 7618 | if (phyMode == WNI_CFG_PHY_MODE_11A) |
| 7619 | { |
| 7620 | // 11a mode always uses short slot |
| 7621 | // Check this since some APs in 11a mode broadcast long slot in their beacons. As per standard, always use what PHY mandates. |
| 7622 | val = true; |
| 7623 | } |
| 7624 | else if (phyMode == WNI_CFG_PHY_MODE_11G) |
| 7625 | { |
| 7626 | if ((psessionEntry->pePersona == VOS_STA_SAP_MODE) || |
| 7627 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 7628 | { |
| 7629 | val = true; |
| 7630 | } |
| 7631 | |
| 7632 | // Program Polaris based on AP capability |
| 7633 | |
| 7634 | if (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) |
| 7635 | // Joining BSS. |
| 7636 | val = SIR_MAC_GET_SHORT_SLOT_TIME( psessionEntry->limCurrentBssCaps); |
| 7637 | else if (psessionEntry->limMlmState == eLIM_MLM_WT_REASSOC_RSP_STATE) |
| 7638 | // Reassociating with AP. |
| 7639 | val = SIR_MAC_GET_SHORT_SLOT_TIME( psessionEntry->limReassocBssCaps); |
| 7640 | } |
| 7641 | else // if (phyMode == WNI_CFG_PHY_MODE_11B) - use this if another phymode is added later ON |
| 7642 | { |
| 7643 | // Will reach here in 11b case |
| 7644 | val = false; |
| 7645 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 7646 | limLog(pMac, LOG1, FL("phyMode = %u shortslotsupported = %u"), phyMode, val); |
Madan Mohan Koyyalamudi | 6db7ad1 | 2012-10-29 16:14:41 -0700 | [diff] [blame] | 7647 | return val; |
| 7648 | } |