Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | a481dcb | 2013-06-17 18:28:00 +0530 | [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 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 22 | /**========================================================================= |
| 23 | |
| 24 | \brief implementation for PE 11r VoWiFi FT Protocol |
| 25 | |
Gopichand Nakkala | a481dcb | 2013-06-17 18:28:00 +0530 | [diff] [blame] | 26 | Copyright 2008 (c) Qualcomm Technologies, Inc. All Rights Reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27 | |
Gopichand Nakkala | a481dcb | 2013-06-17 18:28:00 +0530 | [diff] [blame] | 28 | Qualcomm Technologies Confidential and Proprietary. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | |
| 30 | ========================================================================*/ |
| 31 | |
| 32 | /* $Header$ */ |
| 33 | |
| 34 | |
| 35 | /*-------------------------------------------------------------------------- |
| 36 | Include Files |
| 37 | ------------------------------------------------------------------------*/ |
| 38 | #include <limSendMessages.h> |
| 39 | #include <limTypes.h> |
| 40 | #include <limFT.h> |
| 41 | #include <limFTDefs.h> |
| 42 | #include <limUtils.h> |
| 43 | #include <limPropExtsUtils.h> |
| 44 | #include <limAssocUtils.h> |
| 45 | #include <limSession.h> |
| 46 | #include <limAdmitControl.h> |
| 47 | #include "wmmApsd.h" |
| 48 | |
| 49 | #define LIM_FT_RIC_BA_SSN 1 |
| 50 | #define LIM_FT_RIC_BA_DIALOG_TOKEN_TID_0 248 |
| 51 | #define LIM_FT_RIC_DESCRIPTOR_RESOURCE_TYPE_BA 1 |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 52 | #define LIM_FT_RIC_DESCRIPTOR_MAX_VAR_DATA_LEN 255 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | |
| 54 | /*-------------------------------------------------------------------------- |
| 55 | Initialize the FT variables. |
| 56 | ------------------------------------------------------------------------*/ |
| 57 | void limFTOpen(tpAniSirGlobal pMac) |
| 58 | { |
| 59 | pMac->ft.ftPEContext.pFTPreAuthReq = NULL; |
| 60 | pMac->ft.ftPEContext.psavedsessionEntry = NULL; |
| 61 | } |
| 62 | |
| 63 | /*-------------------------------------------------------------------------- |
| 64 | Cleanup FT variables. |
| 65 | ------------------------------------------------------------------------*/ |
| 66 | void limFTCleanup(tpAniSirGlobal pMac) |
| 67 | { |
| 68 | if (pMac->ft.ftPEContext.pFTPreAuthReq) |
| 69 | { |
| 70 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 71 | PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 72 | __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 73 | #endif |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 74 | if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) |
| 75 | { |
| 76 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); |
| 77 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; |
| 78 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 79 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq); |
| 80 | pMac->ft.ftPEContext.pFTPreAuthReq = NULL; |
| 81 | } |
| 82 | |
| 83 | // This is the old session, should be deleted else where. |
| 84 | // We should not be cleaning it here, just set it to NULL. |
| 85 | if (pMac->ft.ftPEContext.psavedsessionEntry) |
| 86 | { |
| 87 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 88 | PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 89 | __func__, pMac->ft.ftPEContext.psavedsessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 90 | #endif |
| 91 | pMac->ft.ftPEContext.psavedsessionEntry = NULL; |
| 92 | } |
| 93 | |
| 94 | // This is the extra session we added as part of Auth resp |
| 95 | // clean it up. |
| 96 | if (pMac->ft.ftPEContext.pftSessionEntry) |
| 97 | { |
| 98 | if ((((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->valid) && |
| 99 | (((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->limSmeState == eLIM_SME_WT_REASSOC_STATE)) |
| 100 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 101 | PELOGE(limLog( pMac, LOGE, "%s: Deleting Preauth Session %d", __func__, ((tpPESession)pMac->ft.ftPEContext.pftSessionEntry)->peSessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | peDeleteSession(pMac, pMac->ft.ftPEContext.pftSessionEntry); |
| 103 | } |
| 104 | pMac->ft.ftPEContext.pftSessionEntry = NULL; |
| 105 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 106 | PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 107 | __func__, pMac->ft.ftPEContext.psavedsessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 108 | #endif |
| 109 | } |
| 110 | |
| 111 | if (pMac->ft.ftPEContext.pAddBssReq) |
| 112 | { |
| 113 | vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); |
| 114 | pMac->ft.ftPEContext.pAddBssReq = NULL; |
| 115 | } |
| 116 | |
| 117 | if (pMac->ft.ftPEContext.pAddStaReq) |
| 118 | { |
| 119 | vos_mem_free(pMac->ft.ftPEContext.pAddStaReq); |
| 120 | pMac->ft.ftPEContext.pAddStaReq = NULL; |
| 121 | } |
| 122 | |
| 123 | pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_SUCCESS; |
| 124 | |
| 125 | } |
| 126 | |
| 127 | /*-------------------------------------------------------------------------- |
| 128 | Init FT variables. |
| 129 | ------------------------------------------------------------------------*/ |
| 130 | void limFTInit(tpAniSirGlobal pMac) |
| 131 | { |
| 132 | if (pMac->ft.ftPEContext.pFTPreAuthReq) |
| 133 | { |
| 134 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 135 | PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 136 | __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 137 | #endif |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 138 | if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) |
| 139 | { |
| 140 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); |
| 141 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; |
| 142 | } |
| 143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 144 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq); |
| 145 | pMac->ft.ftPEContext.pFTPreAuthReq = NULL; |
| 146 | } |
| 147 | |
| 148 | // This is the old session, should be deleted else where. |
| 149 | // We should not be cleaning it here, just set it to NULL. |
| 150 | if (pMac->ft.ftPEContext.psavedsessionEntry) |
| 151 | { |
| 152 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 153 | PELOGE(limLog( pMac, LOGE, "%s: Setting psavedsessionEntry= %p to NULL", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 154 | __func__, pMac->ft.ftPEContext.psavedsessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | #endif |
| 156 | pMac->ft.ftPEContext.psavedsessionEntry = NULL; |
| 157 | } |
| 158 | |
| 159 | // This is the extra session we added as part of Auth resp |
| 160 | // clean it up. |
| 161 | if (pMac->ft.ftPEContext.pftSessionEntry) |
| 162 | { |
| 163 | /* Cannot delete sessions across associations */ |
| 164 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 165 | PELOGE(limLog( pMac, LOGE, "%s: Deleting session = %p ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 166 | __func__, pMac->ft.ftPEContext.pftSessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 167 | #endif |
| 168 | pMac->ft.ftPEContext.pftSessionEntry = NULL; |
| 169 | } |
| 170 | |
| 171 | if (pMac->ft.ftPEContext.pAddBssReq) |
| 172 | { |
| 173 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 174 | PELOGE(limLog( pMac, LOGE, "%s: Freeing AddBssReq = %p ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 175 | __func__, pMac->ft.ftPEContext.pAddBssReq);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 176 | #endif |
| 177 | vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); |
| 178 | pMac->ft.ftPEContext.pAddBssReq = NULL; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | if (pMac->ft.ftPEContext.pAddStaReq) |
| 183 | { |
| 184 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 185 | PELOGE(limLog( pMac, LOGE, "%s: Freeing AddStaReq = %p ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 186 | __func__, pMac->ft.ftPEContext.pAddStaReq);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | #endif |
| 188 | vos_mem_free(pMac->ft.ftPEContext.pAddStaReq); |
| 189 | pMac->ft.ftPEContext.pAddStaReq = NULL; |
| 190 | } |
| 191 | |
| 192 | pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_SUCCESS; |
| 193 | |
| 194 | } |
| 195 | |
| 196 | /*------------------------------------------------------------------ |
| 197 | * |
| 198 | * This is the handler after suspending the link. |
| 199 | * We suspend the link and then now proceed to switch channel. |
| 200 | * |
| 201 | *------------------------------------------------------------------*/ |
| 202 | void FTPreAuthSuspendLinkHandler(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) |
| 203 | { |
| 204 | tpPESession psessionEntry; |
| 205 | |
| 206 | // The link is suspended of not ? |
| 207 | if (status != eHAL_STATUS_SUCCESS) |
| 208 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 209 | PELOGE(limLog( pMac, LOGE, "%s: Returning ", __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 210 | // Post the FT Pre Auth Response to SME |
| 211 | limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, (tpPESession)data); |
| 212 | |
| 213 | return; |
| 214 | } |
| 215 | |
| 216 | psessionEntry = (tpPESession)data; |
| 217 | // Suspended, now move to a different channel. |
| 218 | // Perform some sanity check before proceeding. |
| 219 | if ((pMac->ft.ftPEContext.pFTPreAuthReq) && psessionEntry) |
| 220 | { |
| 221 | limChangeChannelWithCallback(pMac, |
| 222 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum, |
| 223 | limPerformFTPreAuth, NULL, psessionEntry); |
| 224 | return; |
| 225 | } |
| 226 | |
| 227 | // Else return error. |
| 228 | limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); |
| 229 | } |
| 230 | |
| 231 | |
| 232 | /*-------------------------------------------------------------------------- |
| 233 | In this function, we process the FT Pre Auth Req. |
| 234 | We receive Pre-Auth |
| 235 | Suspend link |
| 236 | Register a call back |
| 237 | In the call back, we will need to accept frames from the new bssid |
| 238 | Send out the auth req to new AP. |
| 239 | Start timer and when the timer is done or if we receive the Auth response |
| 240 | We change channel |
| 241 | Resume link |
| 242 | ------------------------------------------------------------------------*/ |
| 243 | int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 244 | { |
| 245 | int bufConsumed = FALSE; |
| 246 | tpPESession psessionEntry; |
| 247 | tANI_U8 sessionId; |
| 248 | |
| 249 | // Now we are starting fresh make sure all's cleanup. |
| 250 | limFTInit(pMac); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 251 | // Can set it only after sending auth |
| 252 | pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_FAILURE; |
| 253 | |
| 254 | if( pMac->ft.ftPEContext.pFTPreAuthReq && |
| 255 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) |
| 256 | { |
| 257 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); |
| 258 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; |
| 259 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 260 | |
| 261 | // We need information from the Pre-Auth Req. Lets save that |
| 262 | pMac->ft.ftPEContext.pFTPreAuthReq = (tpSirFTPreAuthReq)pMsg->bodyptr; |
| 263 | |
| 264 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 265 | PELOGE(limLog( pMac, LOG1, "%s: PE Auth ft_ies_length=%02x%02x%02x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[0], |
| 267 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[1], |
| 268 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[2]);) |
| 269 | #endif |
| 270 | |
| 271 | // Get the current session entry |
| 272 | psessionEntry = peFindSessionByBssid(pMac, |
| 273 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, &sessionId); |
| 274 | if (psessionEntry == NULL) |
| 275 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 276 | PELOGE(limLog( pMac, LOGE, "%s: Unable to find session for the following bssid", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 277 | __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | limPrintMacAddr( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, LOGE ); |
| 279 | // Post the FT Pre Auth Response to SME |
Gopichand Nakkala | 2d335f3 | 2013-01-04 12:24:28 -0800 | [diff] [blame] | 280 | limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, NULL); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 281 | if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) |
| 282 | { |
| 283 | vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); |
| 284 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; |
| 285 | } |
| 286 | pMac->ft.ftPEContext.pFTPreAuthReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 287 | return TRUE; |
| 288 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 289 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 290 | limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, psessionEntry, 0, 0); |
| 291 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | |
| 293 | // Dont need to suspend if APs are in same channel |
| 294 | if (psessionEntry->currentOperChannel != pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) |
| 295 | { |
| 296 | // Need to suspend link only if the channels are different |
Madan Mohan Koyyalamudi | 2300172 | 2012-10-31 16:48:56 -0700 | [diff] [blame] | 297 | PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on different" |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 298 | " channel (session %p)", __func__, psessionEntry);) |
Madan Mohan Koyyalamudi | 9b87678 | 2012-10-11 16:22:51 -0700 | [diff] [blame] | 299 | limSuspendLink(pMac, eSIR_CHECK_ROAMING_SCAN, FTPreAuthSuspendLinkHandler, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | (tANI_U32 *)psessionEntry); |
| 301 | } |
| 302 | else |
| 303 | { |
Madan Mohan Koyyalamudi | 2300172 | 2012-10-31 16:48:56 -0700 | [diff] [blame] | 304 | PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on same" |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 305 | " channel (session %p)", __func__, psessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | // We are in the same channel. Perform pre-auth |
| 307 | limPerformFTPreAuth(pMac, eHAL_STATUS_SUCCESS, NULL, psessionEntry); |
| 308 | } |
| 309 | |
| 310 | return bufConsumed; |
| 311 | } |
| 312 | |
| 313 | /*------------------------------------------------------------------ |
| 314 | * Send the Auth1 |
| 315 | * Receive back Auth2 |
| 316 | *------------------------------------------------------------------*/ |
| 317 | void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, |
| 318 | tpPESession psessionEntry) |
| 319 | { |
| 320 | tSirMacAuthFrameBody authFrame; |
| 321 | |
| 322 | if (psessionEntry->is11Rconnection) |
| 323 | { |
| 324 | // Only 11r assoc has FT IEs. |
| 325 | if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies == NULL) |
| 326 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 327 | PELOGE(limLog( pMac, LOGE, "%s: FTIEs for Auth Req Seq 1 is absent");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | return; |
| 329 | } |
| 330 | } |
| 331 | if (status != eHAL_STATUS_SUCCESS) |
| 332 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 333 | PELOGE(limLog( pMac, LOGE, "%s: Change channel not successful for FT pre-auth");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 334 | return; |
| 335 | } |
| 336 | pMac->ft.ftPEContext.psavedsessionEntry = psessionEntry; |
| 337 | |
| 338 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 2300172 | 2012-10-31 16:48:56 -0700 | [diff] [blame] | 339 | PELOG2(limLog(pMac,LOG2,"Entered wait auth2 state for FT" |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 340 | " (old session %p)", |
Madan Mohan Koyyalamudi | 2300172 | 2012-10-31 16:48:56 -0700 | [diff] [blame] | 341 | pMac->ft.ftPEContext.psavedsessionEntry);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | #endif |
| 343 | |
| 344 | |
| 345 | if (psessionEntry->is11Rconnection) |
| 346 | { |
| 347 | // Now we are on the right channel and need to send out Auth1 and |
| 348 | // receive Auth2. |
| 349 | authFrame.authAlgoNumber = eSIR_FT_AUTH; // Set the auth type to FT |
| 350 | } |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 351 | #if defined FEATURE_WLAN_CCX || defined FEATURE_WLAN_LFR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | else |
| 353 | { |
| 354 | // Will need to make isCCXconnection a enum may be for further |
| 355 | // improvements to this to match this algorithm number |
| 356 | authFrame.authAlgoNumber = eSIR_OPEN_SYSTEM; // For now if its CCX and 11r FT. |
| 357 | } |
| 358 | #endif |
| 359 | authFrame.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; |
| 360 | authFrame.authStatusCode = 0; |
| 361 | |
| 362 | // Start timer here to come back to operating channel. |
| 363 | pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId = psessionEntry->peSessionId; |
| 364 | if(TX_SUCCESS != tx_timer_activate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer)) |
| 365 | { |
| 366 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 367 | PELOGE(limLog( pMac, LOGE, "%s: FT Auth Rsp Timer Start Failed", __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 368 | #endif |
| 369 | } |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 370 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_FT_PREAUTH_RSP_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 371 | |
| 372 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 373 | PELOGE(limLog( pMac, LOG1, "%s: FT Auth Rsp Timer Started", __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | #endif |
| 375 | |
| 376 | limSendAuthMgmtFrame(pMac, &authFrame, |
| 377 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, |
| 378 | LIM_NO_WEP_IN_FC, psessionEntry); |
| 379 | |
| 380 | return; |
| 381 | } |
| 382 | |
| 383 | |
| 384 | /*------------------------------------------------------------------ |
| 385 | * |
| 386 | * Create the new Add Bss Req to the new AP. |
| 387 | * This will be used when we are ready to FT to the new AP. |
| 388 | * The newly created ft Session entry is passed to this function |
| 389 | * |
| 390 | *------------------------------------------------------------------*/ |
| 391 | tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, |
| 392 | tANI_U8 updateEntry, tpPESession pftSessionEntry, |
| 393 | tpSirBssDescription bssDescription ) |
| 394 | { |
| 395 | tpAddBssParams pAddBssParams = NULL; |
| 396 | tANI_U8 i; |
| 397 | tANI_U8 chanWidthSupp = 0; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 398 | tSchBeaconStruct *pBeaconStruct; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 399 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 400 | pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); |
| 401 | if (NULL == pBeaconStruct) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 402 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 403 | limLog(pMac, LOGE, FL("Unable to allocate memory for creating ADD_BSS") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 404 | return eSIR_MEM_ALLOC_FAILED; |
| 405 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | |
| 407 | // Package SIR_HAL_ADD_BSS_REQ message parameters |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 408 | pAddBssParams = vos_mem_malloc(sizeof( tAddBssParams )); |
| 409 | if (NULL == pAddBssParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 410 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 411 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 412 | limLog( pMac, LOGP, |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 413 | FL( "Unable to allocate memory for creating ADD_BSS" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 414 | return (eSIR_MEM_ALLOC_FAILED); |
| 415 | } |
| 416 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 417 | vos_mem_set((tANI_U8 *) pAddBssParams, sizeof( tAddBssParams ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 418 | |
| 419 | |
| 420 | limExtractApCapabilities( pMac, |
| 421 | (tANI_U8 *) bssDescription->ieFields, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 422 | limGetIElenFromBssDescription( bssDescription ), pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 423 | |
| 424 | if (pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 425 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, pftSessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 426 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 427 | vos_mem_copy(pAddBssParams->bssId, bssDescription->bssId, |
| 428 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 429 | |
| 430 | // Fill in tAddBssParams selfMacAddr |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 431 | vos_mem_copy(pAddBssParams->selfMacAddr, pftSessionEntry->selfMacAddr, |
| 432 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 433 | |
| 434 | pAddBssParams->bssType = pftSessionEntry->bssType;//eSIR_INFRASTRUCTURE_MODE; |
| 435 | pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA; |
| 436 | |
| 437 | pAddBssParams->beaconInterval = bssDescription->beaconInterval; |
| 438 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 439 | pAddBssParams->dtimPeriod = pBeaconStruct->tim.dtimPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 440 | pAddBssParams->updateBss = updateEntry; |
| 441 | |
| 442 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 443 | pAddBssParams->cfParamSet.cfpCount = pBeaconStruct->cfParamSet.cfpCount; |
| 444 | pAddBssParams->cfParamSet.cfpPeriod = pBeaconStruct->cfParamSet.cfpPeriod; |
| 445 | pAddBssParams->cfParamSet.cfpMaxDuration = pBeaconStruct->cfParamSet.cfpMaxDuration; |
| 446 | pAddBssParams->cfParamSet.cfpDurRemaining = pBeaconStruct->cfParamSet.cfpDurRemaining; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 447 | |
| 448 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 449 | pAddBssParams->rateSet.numRates = pBeaconStruct->supportedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 450 | vos_mem_copy(pAddBssParams->rateSet.rate, |
| 451 | pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 452 | |
| 453 | pAddBssParams->nwType = bssDescription->nwType; |
| 454 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 455 | pAddBssParams->shortSlotTimeSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortSlotTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 456 | pAddBssParams->llaCoexist = (tANI_U8) pftSessionEntry->beaconParams.llaCoexist; |
| 457 | pAddBssParams->llbCoexist = (tANI_U8) pftSessionEntry->beaconParams.llbCoexist; |
| 458 | pAddBssParams->llgCoexist = (tANI_U8) pftSessionEntry->beaconParams.llgCoexist; |
| 459 | pAddBssParams->ht20Coexist = (tANI_U8) pftSessionEntry->beaconParams.ht20Coexist; |
| 460 | |
| 461 | // Use the advertised capabilities from the received beacon/PR |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 462 | if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 464 | pAddBssParams->htCapable = pBeaconStruct->HTCaps.present; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 465 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 466 | if ( pBeaconStruct->HTInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 467 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 468 | pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pBeaconStruct->HTInfo.opMode; |
| 469 | pAddBssParams->dualCTSProtection = ( tANI_U8 ) pBeaconStruct->HTInfo.dualCTSProtection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 470 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 471 | chanWidthSupp = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, pftSessionEntry); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 472 | if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | (chanWidthSupp) ) |
| 474 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 475 | pAddBssParams->txChannelWidthSet = ( tANI_U8 ) pBeaconStruct->HTInfo.recommendedTxWidthSet; |
| 476 | pAddBssParams->currentExtChannel = pBeaconStruct->HTInfo.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | } |
| 478 | else |
| 479 | { |
| 480 | pAddBssParams->txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 481 | pAddBssParams->currentExtChannel = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 483 | pAddBssParams->llnNonGFCoexist = (tANI_U8)pBeaconStruct->HTInfo.nonGFDevicesPresent; |
| 484 | pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pBeaconStruct->HTInfo.lsigTXOPProtectionFullSupport; |
| 485 | pAddBssParams->fRIFSMode = pBeaconStruct->HTInfo.rifsMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | } |
| 487 | } |
| 488 | |
| 489 | pAddBssParams->currentOperChannel = bssDescription->channelId; |
| 490 | |
| 491 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 492 | limLog( pMac, LOGE, FL( "SIR_HAL_ADD_BSS_REQ with channel = %d..." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 493 | pAddBssParams->currentOperChannel); |
| 494 | #endif |
| 495 | |
| 496 | |
| 497 | // Populate the STA-related parameters here |
| 498 | // Note that the STA here refers to the AP |
| 499 | { |
| 500 | pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA |
| 501 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 502 | vos_mem_copy(pAddBssParams->staContext.bssId, |
| 503 | bssDescription->bssId, |
| 504 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 505 | pAddBssParams->staContext.listenInterval = bssDescription->beaconInterval; |
| 506 | |
| 507 | pAddBssParams->staContext.assocId = 0; // Is SMAC OK with this? |
| 508 | pAddBssParams->staContext.uAPSD = 0; |
| 509 | pAddBssParams->staContext.maxSPLen = 0; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 510 | pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 511 | pAddBssParams->staContext.updateSta = updateEntry; |
| 512 | pAddBssParams->staContext.encryptType = pftSessionEntry->encryptType; |
| 513 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 514 | if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 515 | { |
| 516 | pAddBssParams->staContext.us32MaxAmpduDuration = 0; |
| 517 | pAddBssParams->staContext.htCapable = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 518 | pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; |
| 519 | pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; |
| 520 | if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 521 | (chanWidthSupp) ) |
| 522 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 523 | pAddBssParams->staContext.txChannelWidthSet = ( tANI_U8 )pBeaconStruct->HTInfo.recommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | } |
| 525 | else |
| 526 | { |
| 527 | pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 528 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 529 | pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState)pBeaconStruct->HTCaps.mimoPowerSave; |
| 530 | pAddBssParams->staContext.delBASupport = ( tANI_U8 ) pBeaconStruct->HTCaps.delayedBA; |
| 531 | pAddBssParams->staContext.maxAmsduSize = ( tANI_U8 ) pBeaconStruct->HTCaps.maximalAMSDUsize; |
| 532 | pAddBssParams->staContext.maxAmpduDensity = pBeaconStruct->HTCaps.mpduDensity; |
| 533 | pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pBeaconStruct->HTCaps.dsssCckMode40MHz; |
| 534 | pAddBssParams->staContext.fShortGI20Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI20MHz; |
| 535 | pAddBssParams->staContext.fShortGI40Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI40MHz; |
| 536 | pAddBssParams->staContext.maxAmpduSize= pBeaconStruct->HTCaps.maxRxAMPDUFactor; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 537 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 538 | if( pBeaconStruct->HTInfo.present ) |
| 539 | pAddBssParams->staContext.rifsMode = pBeaconStruct->HTInfo.rifsMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 540 | } |
| 541 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 542 | if ((pftSessionEntry->limWmeEnabled && pBeaconStruct->wmeEdcaPresent) || |
| 543 | (pftSessionEntry->limQosEnabled && pBeaconStruct->edcaPresent)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 544 | pAddBssParams->staContext.wmmEnabled = 1; |
| 545 | else |
| 546 | pAddBssParams->staContext.wmmEnabled = 0; |
| 547 | |
| 548 | //Update the rates |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 549 | #ifdef WLAN_FEATURE_11AC |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame^] | 550 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
| 551 | pBeaconStruct->HTCaps.supportedMCSSet, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 552 | false,pftSessionEntry,&pBeaconStruct->VHTCaps); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 553 | #else |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame^] | 554 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 555 | beaconStruct.HTCaps.supportedMCSSet, false,pftSessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 556 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 557 | limFillSupportedRatesInfo(pMac, NULL, &pAddBssParams->staContext.supportedRates,pftSessionEntry); |
| 558 | |
| 559 | } |
| 560 | |
| 561 | |
| 562 | //Disable BA. It will be set as part of ADDBA negotiation. |
| 563 | for( i = 0; i < STACFG_MAX_TC; i++ ) |
| 564 | { |
| 565 | pAddBssParams->staContext.staTCParams[i].txUseBA = eBA_DISABLE; |
| 566 | pAddBssParams->staContext.staTCParams[i].rxUseBA = eBA_DISABLE; |
| 567 | pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE; |
| 568 | pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE; |
| 569 | } |
| 570 | |
| 571 | #if defined WLAN_FEATURE_VOWIFI |
| 572 | pAddBssParams->maxTxPower = pftSessionEntry->maxTxPower; |
| 573 | #endif |
| 574 | |
| 575 | pAddBssParams->status = eHAL_STATUS_SUCCESS; |
| 576 | pAddBssParams->respReqd = true; |
| 577 | |
| 578 | pAddBssParams->staContext.sessionId = pftSessionEntry->peSessionId; |
| 579 | pAddBssParams->sessionId = pftSessionEntry->peSessionId; |
| 580 | |
| 581 | // Set a new state for MLME |
| 582 | |
| 583 | pftSessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 584 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, pftSessionEntry->peSessionId, eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 585 | pAddBssParams->halPersona=(tANI_U8)pftSessionEntry->pePersona; //pass on the session persona to hal |
| 586 | |
| 587 | pMac->ft.ftPEContext.pAddBssReq = pAddBssParams; |
| 588 | |
| 589 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 590 | limLog( pMac, LOG1, FL( "Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap..." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 591 | #endif |
| 592 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 593 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 594 | return 0; |
| 595 | } |
| 596 | |
| 597 | /*------------------------------------------------------------------ |
| 598 | * |
| 599 | * Setup the new session for the pre-auth AP. |
| 600 | * Return the newly created session entry. |
| 601 | * |
| 602 | *------------------------------------------------------------------*/ |
| 603 | tpPESession limFillFTSession(tpAniSirGlobal pMac, |
| 604 | tpSirBssDescription pbssDescription, tpPESession psessionEntry) |
| 605 | { |
| 606 | tpPESession pftSessionEntry; |
| 607 | tANI_U8 currentBssUapsd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 608 | tPowerdBm localPowerConstraint; |
| 609 | tPowerdBm regMax; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 610 | tSchBeaconStruct *pBeaconStruct; |
| 611 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 612 | pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); |
| 613 | if (NULL == pBeaconStruct) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 614 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 615 | limLog(pMac, LOGE, FL("Unable to allocate memory for creating limFillFTSession") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 616 | return NULL; |
| 617 | } |
| 618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 619 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 620 | |
| 621 | /* Retrieve the session that has already been created and update the entry */ |
| 622 | pftSessionEntry = pMac->ft.ftPEContext.pftSessionEntry; |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 623 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 624 | limPrintMacAddr(pMac, pbssDescription->bssId, LOGE); |
| 625 | #endif |
| 626 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 627 | pftSessionEntry->dot11mode = psessionEntry->dot11mode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 628 | pftSessionEntry->htCapability = psessionEntry->htCapability; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | |
| 630 | pftSessionEntry->limWmeEnabled = psessionEntry->limWmeEnabled; |
| 631 | pftSessionEntry->limQosEnabled = psessionEntry->limQosEnabled; |
| 632 | pftSessionEntry->limWsmEnabled = psessionEntry->limWsmEnabled; |
| 633 | pftSessionEntry->lim11hEnable = psessionEntry->lim11hEnable; |
| 634 | |
| 635 | // Fields to be filled later |
| 636 | pftSessionEntry->pLimJoinReq = NULL; |
| 637 | pftSessionEntry->smeSessionId = 0; |
| 638 | pftSessionEntry->transactionId = 0; |
| 639 | |
| 640 | limExtractApCapabilities( pMac, |
| 641 | (tANI_U8 *) pbssDescription->ieFields, |
| 642 | limGetIElenFromBssDescription( pbssDescription ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 643 | pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 644 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 645 | pftSessionEntry->rateSet.numRates = pBeaconStruct->supportedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 646 | vos_mem_copy(pftSessionEntry->rateSet.rate, |
| 647 | pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 648 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 649 | pftSessionEntry->extRateSet.numRates = pBeaconStruct->extendedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 650 | vos_mem_copy(pftSessionEntry->extRateSet.rate, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 651 | pBeaconStruct->extendedRates.rate, pftSessionEntry->extRateSet.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | |
| 653 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 654 | pftSessionEntry->ssId.length = pBeaconStruct->ssId.length; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 655 | vos_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 656 | pftSessionEntry->ssId.length); |
| 657 | |
| 658 | |
| 659 | // Self Mac |
| 660 | sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); |
| 661 | sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 662 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | limPrintMacAddr(pMac, pftSessionEntry->limReAssocbssId, LOGE); |
| 664 | #endif |
| 665 | |
| 666 | /* Store beaconInterval */ |
| 667 | pftSessionEntry->beaconParams.beaconInterval = pbssDescription->beaconInterval; |
| 668 | pftSessionEntry->bssType = psessionEntry->bssType; |
| 669 | |
| 670 | pftSessionEntry->statypeForBss = STA_ENTRY_PEER; |
| 671 | pftSessionEntry->nwType = pbssDescription->nwType; |
| 672 | |
| 673 | /* Copy The channel Id to the session Table */ |
| 674 | pftSessionEntry->limReassocChannelId = pbssDescription->channelId; |
| 675 | pftSessionEntry->currentOperChannel = pbssDescription->channelId; |
| 676 | |
| 677 | |
| 678 | if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) |
| 679 | { |
| 680 | pftSessionEntry->limSystemRole = eLIM_STA_ROLE; |
| 681 | } |
| 682 | else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 683 | { |
| 684 | pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 685 | } |
| 686 | else |
| 687 | { |
| 688 | /* Throw an error and return and make sure to delete the session.*/ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 689 | limLog(pMac, LOGE, FL("Invalid bss type")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | pftSessionEntry->limCurrentBssCaps = pbssDescription->capabilityInfo; |
| 693 | pftSessionEntry->limReassocBssCaps = pbssDescription->capabilityInfo; |
Srinivas Girigowda | 3353f1e | 2013-02-04 16:22:51 -0800 | [diff] [blame] | 694 | if( pMac->roam.configParam.shortSlotTime && |
| 695 | SIR_MAC_GET_SHORT_SLOT_TIME(pftSessionEntry->limReassocBssCaps)) |
| 696 | { |
| 697 | pftSessionEntry->shortSlotTimeSupported = TRUE; |
| 698 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | |
| 700 | regMax = cfgGetRegulatoryMaxTransmitPower( pMac, pftSessionEntry->currentOperChannel ); |
| 701 | localPowerConstraint = regMax; |
| 702 | limExtractApCapability( pMac, (tANI_U8 *) pbssDescription->ieFields, |
| 703 | limGetIElenFromBssDescription(pbssDescription), |
| 704 | &pftSessionEntry->limCurrentBssQosCaps, |
| 705 | &pftSessionEntry->limCurrentBssPropCap, |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 706 | ¤tBssUapsd , &localPowerConstraint, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 707 | |
| 708 | pftSessionEntry->limReassocBssQosCaps = |
| 709 | pftSessionEntry->limCurrentBssQosCaps; |
| 710 | pftSessionEntry->limReassocBssPropCap = |
| 711 | pftSessionEntry->limCurrentBssPropCap; |
| 712 | |
| 713 | |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 714 | #ifdef FEATURE_WLAN_CCX |
| 715 | pftSessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap); |
| 716 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 717 | pftSessionEntry->maxTxPower = VOS_MIN( regMax , (localPowerConstraint) ); |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 718 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 719 | |
| 720 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 721 | limLog( pMac, LOG1, "%s: Regulatory max = %d, local power constraint = %d, ini tx power = %d, max tx = %d", |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 722 | __func__, regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap, pftSessionEntry->maxTxPower ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 723 | #endif |
| 724 | |
| 725 | pftSessionEntry->limRFBand = limGetRFBand(pftSessionEntry->currentOperChannel); |
| 726 | |
| 727 | pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; |
| 728 | pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 729 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, pftSessionEntry->peSessionId, pftSessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | |
| 731 | pftSessionEntry->encryptType = psessionEntry->encryptType; |
| 732 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 733 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | return pftSessionEntry; |
| 735 | } |
| 736 | |
| 737 | /*------------------------------------------------------------------ |
| 738 | * |
| 739 | * Setup the session and the add bss req for the pre-auth AP. |
| 740 | * |
| 741 | *------------------------------------------------------------------*/ |
| 742 | void limFTSetupAuthSession(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 743 | { |
| 744 | tpPESession pftSessionEntry; |
| 745 | |
| 746 | // Prepare the session right now with as much as possible. |
| 747 | pftSessionEntry = limFillFTSession(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription, psessionEntry); |
| 748 | |
| 749 | if (pftSessionEntry) |
| 750 | { |
| 751 | pftSessionEntry->is11Rconnection = psessionEntry->is11Rconnection; |
| 752 | #ifdef FEATURE_WLAN_CCX |
| 753 | pftSessionEntry->isCCXconnection = psessionEntry->isCCXconnection; |
| 754 | #endif |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 755 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 756 | pftSessionEntry->isFastTransitionEnabled = psessionEntry->isFastTransitionEnabled; |
| 757 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 758 | |
| 759 | #ifdef FEATURE_WLAN_LFR |
| 760 | pftSessionEntry->isFastRoamIniFeatureEnabled = psessionEntry->isFastRoamIniFeatureEnabled; |
| 761 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 762 | limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, |
| 763 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription ); |
| 764 | pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | /*------------------------------------------------------------------ |
| 769 | * Resume Link Call Back |
| 770 | *------------------------------------------------------------------*/ |
| 771 | void limFTProcessPreAuthResult(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) |
| 772 | { |
| 773 | tpPESession psessionEntry; |
| 774 | |
| 775 | psessionEntry = (tpPESession)data; |
| 776 | |
| 777 | if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) |
| 778 | { |
| 779 | limFTSetupAuthSession(pMac, psessionEntry); |
| 780 | } |
| 781 | |
| 782 | // Post the FT Pre Auth Response to SME |
| 783 | limPostFTPreAuthRsp(pMac, pMac->ft.ftPEContext.ftPreAuthStatus, |
| 784 | pMac->ft.ftPEContext.saved_auth_rsp, |
| 785 | pMac->ft.ftPEContext.saved_auth_rsp_length, psessionEntry); |
| 786 | |
| 787 | } |
| 788 | |
| 789 | /*------------------------------------------------------------------ |
| 790 | * Resume Link Call Back |
| 791 | *------------------------------------------------------------------*/ |
| 792 | void limPerformPostFTPreAuthAndChannelChange(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, |
| 793 | tpPESession psessionEntry) |
| 794 | { |
| 795 | //Set the resume channel to Any valid channel (invalid). |
| 796 | //This will instruct HAL to set it to any previous valid channel. |
| 797 | peSetResumeChannel(pMac, 0, 0); |
| 798 | limResumeLink(pMac, limFTProcessPreAuthResult, (tANI_U32 *)psessionEntry); |
| 799 | } |
| 800 | |
| 801 | tSirRetStatus limCreateRICBlockAckIE(tpAniSirGlobal pMac, tANI_U8 tid, tCfgTrafficClass *pTrafficClass, |
| 802 | tANI_U8 *ric_ies, tANI_U32 *ieLength) |
| 803 | { |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 804 | /* BlockACK + RIC is not supported now, TODO later to support this */ |
| 805 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 806 | tDot11fIERICDataDesc ricIe; |
| 807 | tDot11fFfBAStartingSequenceControl baSsnControl; |
| 808 | tDot11fFfAddBAParameterSet baParamSet; |
| 809 | tDot11fFfBATimeout baTimeout; |
| 810 | |
| 811 | vos_mem_zero(&ricIe, sizeof(tDot11fIERICDataDesc)); |
| 812 | vos_mem_zero(&baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); |
| 813 | vos_mem_zero(&baParamSet, sizeof(tDot11fFfAddBAParameterSet)); |
| 814 | vos_mem_zero(&baTimeout, sizeof(tDot11fFfBATimeout)); |
| 815 | |
| 816 | ricIe.present = 1; |
| 817 | ricIe.RICData.present = 1; |
| 818 | ricIe.RICData.resourceDescCount = 1; |
| 819 | ricIe.RICData.Identifier = LIM_FT_RIC_BA_DIALOG_TOKEN_TID_0 + tid; |
| 820 | ricIe.RICDescriptor.present = 1; |
| 821 | ricIe.RICDescriptor.resourceType = LIM_FT_RIC_DESCRIPTOR_RESOURCE_TYPE_BA; |
| 822 | baParamSet.tid = tid; |
| 823 | baParamSet.policy = pTrafficClass->fTxBApolicy; // Immediate Block Ack |
| 824 | baParamSet.bufferSize = pTrafficClass->txBufSize; |
| 825 | vos_mem_copy((v_VOID_t *)&baTimeout, (v_VOID_t *)&pTrafficClass->tuTxBAWaitTimeout, sizeof(baTimeout)); |
| 826 | baSsnControl.fragNumber = 0; |
| 827 | baSsnControl.ssn = LIM_FT_RIC_BA_SSN; |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 828 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 829 | dot11fPackFfAddBAParameterSet(pMac, &baParamSet, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 830 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baParamSet, sizeof(tDot11fFfAddBAParameterSet)); |
| 831 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfAddBAParameterSet); |
| 832 | } |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 833 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 834 | dot11fPackFfBATimeout(pMac, &baTimeout, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 835 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baTimeout, sizeof(tDot11fFfBATimeout)); |
| 836 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBATimeout); |
| 837 | } |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 838 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 839 | dot11fPackFfBAStartingSequenceControl(pMac, &baSsnControl, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 840 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); |
| 841 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBAStartingSequenceControl); |
| 842 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 843 | return (tSirRetStatus) dot11fPackIeRICDataDesc(pMac, &ricIe, ric_ies, sizeof(tDot11fIERICDataDesc), ieLength); |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 844 | #endif |
| 845 | |
| 846 | return eSIR_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | tSirRetStatus limFTFillRICBlockAckInfo(tpAniSirGlobal pMac, tANI_U8 *ric_ies, tANI_U32 *ric_ies_length) |
| 850 | { |
| 851 | tANI_U8 tid = 0; |
| 852 | tpDphHashNode pSta; |
| 853 | tANI_U16 numBA = 0, aid = 0; |
| 854 | tpPESession psessionEntry = pMac->ft.ftPEContext.psavedsessionEntry; |
| 855 | tANI_U32 offset = 0, ieLength = 0; |
| 856 | tSirRetStatus status = eSIR_SUCCESS; |
| 857 | |
| 858 | // First, extract the DPH entry |
| 859 | pSta = dphLookupHashEntry( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, &aid, &psessionEntry->dph.dphHashTable); |
| 860 | if( NULL == pSta ) |
| 861 | { |
| 862 | PELOGE(limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 863 | FL( "STA context not found for saved session's BSSID %02x:%02x:%02x:%02x:%02x:%02x" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 864 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[0], |
| 865 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[1], |
| 866 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[2], |
| 867 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[3], |
| 868 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[4], |
| 869 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId[5] );) |
| 870 | return eSIR_FAILURE; |
| 871 | } |
| 872 | |
| 873 | for (tid = 0; tid < STACFG_MAX_TC; tid++) |
| 874 | { |
| 875 | if (pSta->tcCfg[tid].fUseBATx) |
| 876 | { |
| 877 | status = limCreateRICBlockAckIE(pMac, tid, &pSta->tcCfg[tid], ric_ies + offset, &ieLength); |
| 878 | if (eSIR_SUCCESS == status) |
| 879 | { |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 880 | // TODO RIC |
| 881 | if ( ieLength > MAX_FTIE_SIZE ) |
| 882 | { |
| 883 | ieLength = 0; |
| 884 | return status; |
| 885 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 886 | offset += ieLength; |
| 887 | *ric_ies_length += ieLength; |
| 888 | numBA++; |
| 889 | } |
| 890 | else |
| 891 | { |
| 892 | PELOGE(limLog(pMac, LOGE, FL("BA RIC IE creation for TID %d failed with status %d"), tid, status);) |
| 893 | } |
| 894 | } |
| 895 | } |
| 896 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 897 | PELOGE(limLog(pMac, LOGE, FL("Number of BA RIC IEs created = %d: Total length = %d"), numBA, *ric_ies_length);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 898 | return status; |
| 899 | } |
| 900 | |
| 901 | /*------------------------------------------------------------------ |
| 902 | * |
| 903 | * Will post pre auth response to SME. |
| 904 | * |
| 905 | *------------------------------------------------------------------*/ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 906 | void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 907 | tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, |
| 908 | tpPESession psessionEntry) |
| 909 | { |
| 910 | tpSirFTPreAuthRsp pFTPreAuthRsp; |
| 911 | tSirMsgQ mmhMsg; |
| 912 | tANI_U16 rspLen = sizeof(tSirFTPreAuthRsp); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 913 | // TODO: RIC Support |
| 914 | //tSirRetStatus sirStatus = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 915 | |
| 916 | pFTPreAuthRsp = (tpSirFTPreAuthRsp)vos_mem_malloc(rspLen); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 917 | if (NULL == pFTPreAuthRsp) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 918 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 919 | PELOGE(limLog( pMac, LOGE, "Failed to allocate memory");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 920 | VOS_ASSERT(pFTPreAuthRsp != NULL); |
| 921 | return; |
| 922 | } |
| 923 | vos_mem_zero( pFTPreAuthRsp, rspLen); |
| 924 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 925 | PELOGE(limLog( pMac, LOG1, "%s: Auth Rsp = %p", pFTPreAuthRsp);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 926 | #endif |
| 927 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 928 | vos_mem_set((tANI_U8*)pFTPreAuthRsp, rspLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 929 | pFTPreAuthRsp->messageType = eWNI_SME_FT_PRE_AUTH_RSP; |
| 930 | pFTPreAuthRsp->length = (tANI_U16) rspLen; |
| 931 | pFTPreAuthRsp->status = status; |
| 932 | if (psessionEntry) |
| 933 | pFTPreAuthRsp->smeSessionId = psessionEntry->smeSessionId; |
| 934 | |
| 935 | // The bssid of the AP we are sending Auth1 to. |
| 936 | if (pMac->ft.ftPEContext.pFTPreAuthReq) |
| 937 | sirCopyMacAddr(pFTPreAuthRsp->preAuthbssId, |
| 938 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId); |
| 939 | |
| 940 | // Attach the auth response now back to SME |
| 941 | pFTPreAuthRsp->ft_ies_length = 0; |
| 942 | if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) |
| 943 | { |
| 944 | // Only 11r assoc has FT IEs. |
| 945 | vos_mem_copy(pFTPreAuthRsp->ft_ies, auth_rsp, auth_rsp_length); |
| 946 | pFTPreAuthRsp->ft_ies_length = auth_rsp_length; |
| 947 | } |
| 948 | |
| 949 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 950 | if ((psessionEntry) && (psessionEntry->is11Rconnection)) |
| 951 | { |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 952 | /* TODO: RIC SUPPORT Fill in the Block Ack RIC IEs in the preAuthRsp */ |
| 953 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 954 | sirStatus = limFTFillRICBlockAckInfo(pMac, pFTPreAuthRsp->ric_ies, |
| 955 | (tANI_U32 *)&pFTPreAuthRsp->ric_ies_length); |
| 956 | if (eSIR_SUCCESS != sirStatus) |
| 957 | { |
| 958 | PELOGE(limLog(pMac, LOGE, FL("Fill RIC BA Info failed with status %d"), sirStatus);) |
| 959 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 960 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 961 | } |
| 962 | #endif |
| 963 | |
| 964 | mmhMsg.type = pFTPreAuthRsp->messageType; |
| 965 | mmhMsg.bodyptr = pFTPreAuthRsp; |
| 966 | mmhMsg.bodyval = 0; |
| 967 | |
| 968 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 969 | PELOGE(limLog( pMac, LOGE, "Posted Auth Rsp to SME with status of 0x%x", status);) |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 970 | #endif |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 971 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
Rajesh Chauhan | 913ab4f | 2013-07-17 14:36:31 -0700 | [diff] [blame] | 972 | if (status == eSIR_SUCCESS) |
| 973 | limDiagEventReport(pMac, WLAN_PE_DIAG_PREAUTH_DONE, psessionEntry, |
| 974 | status, 0); |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 975 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 976 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 977 | } |
| 978 | |
| 979 | /*------------------------------------------------------------------ |
| 980 | * |
| 981 | * Send the FT Pre Auth Response to SME when ever we have a status |
| 982 | * ready to be sent to SME |
| 983 | * |
| 984 | * SME will be the one to send it up to the supplicant to receive |
| 985 | * FTIEs which will be required for Reassoc Req. |
| 986 | * |
| 987 | *------------------------------------------------------------------*/ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 988 | void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 989 | tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, |
| 990 | tpPESession psessionEntry) |
| 991 | { |
| 992 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 993 | tpPESession pftSessionEntry; |
| 994 | tANI_U8 sessionId; |
| 995 | tpSirBssDescription pbssDescription; |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 996 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 997 | limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); |
| 998 | #endif |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 999 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1000 | // Save the status of pre-auth |
| 1001 | pMac->ft.ftPEContext.ftPreAuthStatus = status; |
| 1002 | |
| 1003 | // Save the auth rsp, so we can send it to |
| 1004 | // SME once we resume link. |
| 1005 | pMac->ft.ftPEContext.saved_auth_rsp_length = 0; |
| 1006 | if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) |
| 1007 | { |
| 1008 | vos_mem_copy(pMac->ft.ftPEContext.saved_auth_rsp, |
| 1009 | auth_rsp, auth_rsp_length); |
| 1010 | pMac->ft.ftPEContext.saved_auth_rsp_length = auth_rsp_length; |
| 1011 | } |
| 1012 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1013 | /* Create FT session for the re-association at this point */ |
| 1014 | if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) |
| 1015 | { |
| 1016 | pbssDescription = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription; |
| 1017 | if((pftSessionEntry = peCreateSession(pMac, pbssDescription->bssId, |
| 1018 | &sessionId, pMac->lim.maxStation)) == NULL) |
| 1019 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1020 | limLog(pMac, LOGE, FL("Session Can not be created for pre-auth 11R AP")); |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1021 | return; |
| 1022 | } |
| 1023 | pftSessionEntry->peSessionId = sessionId; |
| 1024 | sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); |
| 1025 | sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); |
| 1026 | pftSessionEntry->bssType = psessionEntry->bssType; |
| 1027 | |
| 1028 | if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) |
| 1029 | { |
| 1030 | pftSessionEntry->limSystemRole = eLIM_STA_ROLE; |
| 1031 | } |
| 1032 | else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 1033 | { |
| 1034 | pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 1035 | } |
| 1036 | else |
| 1037 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1038 | limLog(pMac, LOGE, FL("Invalid bss type")); |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1039 | } |
| 1040 | pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; |
| 1041 | pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
| 1042 | pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1043 | PELOGE(limLog(pMac,LOGE,"%s:created session (%p) with id = %d", |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1044 | __func__, pftSessionEntry, pftSessionEntry->peSessionId);) |
| 1045 | |
| 1046 | /* Update the ReAssoc BSSID of the current session */ |
| 1047 | sirCopyMacAddr(psessionEntry->limReAssocbssId, pbssDescription->bssId); |
| 1048 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); |
| 1049 | } |
| 1050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1051 | if (psessionEntry->currentOperChannel != |
| 1052 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) |
| 1053 | { |
| 1054 | // Need to move to the original AP channel |
| 1055 | limChangeChannelWithCallback(pMac, psessionEntry->currentOperChannel, |
| 1056 | limPerformPostFTPreAuthAndChannelChange, NULL, psessionEntry); |
| 1057 | } |
| 1058 | else |
| 1059 | { |
| 1060 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1061 | PELOGE(limLog( pMac, LOGE, "Pre auth on same channel as connected AP channel %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1062 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum);) |
| 1063 | #endif |
| 1064 | limFTProcessPreAuthResult(pMac, status, (tANI_U32 *)psessionEntry); |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | /*------------------------------------------------------------------ |
| 1069 | * |
| 1070 | * This function handles the 11R Reassoc Req from SME |
| 1071 | * |
| 1072 | *------------------------------------------------------------------*/ |
| 1073 | void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, |
| 1074 | tpPESession psessionEntry) |
| 1075 | { |
| 1076 | tANI_U8 smeSessionId = 0; |
| 1077 | tANI_U16 transactionId = 0; |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1078 | tANI_U8 chanNum = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1079 | tLimMlmReassocReq *pMlmReassocReq; |
| 1080 | tANI_U16 caps; |
| 1081 | tANI_U32 val; |
| 1082 | tSirMsgQ msgQ; |
| 1083 | tSirRetStatus retCode; |
| 1084 | tANI_U32 teleBcnEn = 0; |
| 1085 | |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1086 | chanNum = psessionEntry->currentOperChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1087 | limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf, &smeSessionId, &transactionId); |
| 1088 | psessionEntry->smeSessionId = smeSessionId; |
| 1089 | psessionEntry->transactionId = transactionId; |
| 1090 | |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 1091 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1092 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOCIATING, psessionEntry, 0, 0); |
| 1093 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1094 | |
Madan Mohan Koyyalamudi | 67b82f6 | 2013-06-21 18:35:53 +0530 | [diff] [blame] | 1095 | if (NULL == pMac->ft.ftPEContext.pAddBssReq) |
| 1096 | { |
| 1097 | limLog(pMac, LOGE, FL("pAddBssReq is NULL")); |
| 1098 | return; |
| 1099 | } |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1100 | pMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 1101 | if (NULL == pMlmReassocReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1102 | { |
| 1103 | // Log error |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1104 | limLog(pMac, LOGE, FL("call to AllocateMemory failed for mlmReassocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1105 | return; |
| 1106 | } |
| 1107 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1108 | vos_mem_copy(pMlmReassocReq->peerMacAddr, |
| 1109 | psessionEntry->bssId, |
| 1110 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1111 | |
| 1112 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 1113 | (tANI_U32 *) &pMlmReassocReq->reassocFailureTimeout) |
| 1114 | != eSIR_SUCCESS) |
| 1115 | { |
| 1116 | /** |
| 1117 | * Could not get ReassocFailureTimeout value |
| 1118 | * from CFG. Log error. |
| 1119 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1120 | limLog(pMac, LOGE, FL("could not retrieve ReassocFailureTimeout value")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1121 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | return; |
| 1123 | } |
| 1124 | |
| 1125 | if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) |
| 1126 | { |
| 1127 | /** |
| 1128 | * Could not get Capabilities value |
| 1129 | * from CFG. Log error. |
| 1130 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1131 | limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1132 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1133 | return; |
| 1134 | } |
| 1135 | pMlmReassocReq->capabilityInfo = caps; |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1137 | /* Update PE sessionId*/ |
| 1138 | pMlmReassocReq->sessionId = psessionEntry->peSessionId; |
| 1139 | |
| 1140 | /* If telescopic beaconing is enabled, set listen interval to WNI_CFG_TELE_BCN_MAX_LI */ |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1141 | if (wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, &teleBcnEn) != |
| 1142 | eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1143 | { |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1144 | limLog(pMac, LOGP, FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1145 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1146 | return; |
| 1147 | } |
| 1148 | |
| 1149 | if (teleBcnEn) |
| 1150 | { |
| 1151 | if (wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI, &val) != eSIR_SUCCESS) |
Varun Reddy Yeturu | ea6bd08 | 2013-01-28 10:31:22 -0800 | [diff] [blame] | 1152 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | /** |
| 1154 | * Could not get ListenInterval value |
| 1155 | * from CFG. Log error. |
| 1156 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1157 | limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1158 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1159 | return; |
Varun Reddy Yeturu | ea6bd08 | 2013-01-28 10:31:22 -0800 | [diff] [blame] | 1160 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1161 | } |
| 1162 | else |
| 1163 | { |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1164 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | { |
| 1166 | /** |
| 1167 | * Could not get ListenInterval value |
| 1168 | * from CFG. Log error. |
| 1169 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1170 | limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1171 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1172 | return; |
| 1173 | } |
| 1174 | } |
| 1175 | if (limSetLinkState(pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId, |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1176 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1177 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1178 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1179 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | } |
| 1181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1182 | pMlmReassocReq->listenInterval = (tANI_U16) val; |
| 1183 | |
| 1184 | psessionEntry->pLimMlmReassocReq = pMlmReassocReq; |
| 1185 | |
| 1186 | |
| 1187 | //we need to defer the message until we get the response back from HAL. |
| 1188 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | msgQ.type = SIR_HAL_ADD_BSS_REQ; |
| 1191 | msgQ.reserved = 0; |
| 1192 | msgQ.bodyptr = pMac->ft.ftPEContext.pAddBssReq; |
| 1193 | msgQ.bodyval = 0; |
| 1194 | |
| 1195 | |
| 1196 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
| 1197 | limLog( pMac, LOGE, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); |
| 1198 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1199 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | |
| 1201 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1202 | if( eSIR_SUCCESS != retCode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1203 | { |
| 1204 | vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1205 | limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1206 | retCode ); |
| 1207 | } |
| 1208 | // Dont need this anymore |
| 1209 | pMac->ft.ftPEContext.pAddBssReq = NULL; |
| 1210 | return; |
| 1211 | } |
| 1212 | |
| 1213 | /*------------------------------------------------------------------ |
| 1214 | * |
| 1215 | * This function is called if preauth response is not received from the AP |
| 1216 | * within this timeout while FT in progress |
| 1217 | * |
| 1218 | *------------------------------------------------------------------*/ |
| 1219 | void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) |
| 1220 | { |
| 1221 | tpPESession psessionEntry; |
| 1222 | |
| 1223 | // We have failed pre auth. We need to resume link and get back on |
| 1224 | // home channel. |
Madan Mohan Koyyalamudi | 67b82f6 | 2013-06-21 18:35:53 +0530 | [diff] [blame] | 1225 | limLog(pMac, LOG1, FL("FT Pre-Auth Time Out!!!!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1226 | |
| 1227 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId))== NULL) |
| 1228 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1229 | limLog(pMac, LOGE, FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1230 | return; |
| 1231 | } |
| 1232 | |
| 1233 | // Ok, so attempted at Pre-Auth and failed. If we are off channel. We need |
| 1234 | // to get back. |
| 1235 | limHandleFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); |
| 1236 | } |
| 1237 | |
| 1238 | |
| 1239 | /*------------------------------------------------------------------ |
| 1240 | * |
| 1241 | * This function is called to process the update key request from SME |
| 1242 | * |
| 1243 | *------------------------------------------------------------------*/ |
| 1244 | tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) |
| 1245 | { |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1246 | tAddBssParams * pAddBssParams; |
| 1247 | tSirFTUpdateKeyInfo * pKeyInfo; |
| 1248 | tANI_U32 val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1249 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1250 | /* Sanity Check */ |
| 1251 | if( pMac == NULL || pMsgBuf == NULL ) |
| 1252 | { |
| 1253 | return TRUE; |
| 1254 | } |
| 1255 | if(pMac->ft.ftPEContext.pAddBssReq == NULL) |
| 1256 | { |
| 1257 | limLog( pMac, LOGE, |
| 1258 | FL( "pAddBssReq is NULL" )); |
| 1259 | return TRUE; |
| 1260 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1261 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1262 | pAddBssParams = pMac->ft.ftPEContext.pAddBssReq; |
| 1263 | pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1264 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1265 | /* Store the key information in the ADD BSS parameters */ |
| 1266 | pAddBssParams->extSetStaKeyParamValid = 1; |
| 1267 | pAddBssParams->extSetStaKeyParam.encType = pKeyInfo->keyMaterial.edType; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1268 | vos_mem_copy((tANI_U8 *) &pAddBssParams->extSetStaKeyParam.key, |
| 1269 | (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1270 | if(eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_SINGLE_TID_RC, &val)) |
| 1271 | { |
| 1272 | limLog( pMac, LOGP, FL( "Unable to read WNI_CFG_SINGLE_TID_RC" )); |
| 1273 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1274 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1275 | pAddBssParams->extSetStaKeyParam.singleTidRc = val; |
| 1276 | PELOG1(limLog(pMac, LOG1, FL("Key valid %d"), |
| 1277 | pAddBssParams->extSetStaKeyParamValid, |
| 1278 | pAddBssParams->extSetStaKeyParam.key[0].keyLength);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1279 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1280 | pAddBssParams->extSetStaKeyParam.staIdx = 0; |
| 1281 | |
| 1282 | PELOG1(limLog(pMac, LOG1, |
| 1283 | FL("BSSID = %02X-%02X-%02X-%02X-%02X-%02X"), |
| 1284 | pKeyInfo->bssId[0], pKeyInfo->bssId[1], |
| 1285 | pKeyInfo->bssId[2], pKeyInfo->bssId[3], |
| 1286 | pKeyInfo->bssId[4], pKeyInfo->bssId[5]);) |
| 1287 | |
| 1288 | if(pAddBssParams->extSetStaKeyParam.key[0].keyLength == 16) |
| 1289 | { |
| 1290 | PELOG1(limLog(pMac, LOG1, |
| 1291 | FL("BSS key = %02X-%02X-%02X-%02X-%02X-%02X-%02X- " |
| 1292 | "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X"), |
| 1293 | pAddBssParams->extSetStaKeyParam.key[0].key[0], |
| 1294 | pAddBssParams->extSetStaKeyParam.key[0].key[1], |
| 1295 | pAddBssParams->extSetStaKeyParam.key[0].key[2], |
| 1296 | pAddBssParams->extSetStaKeyParam.key[0].key[3], |
| 1297 | pAddBssParams->extSetStaKeyParam.key[0].key[4], |
| 1298 | pAddBssParams->extSetStaKeyParam.key[0].key[5], |
| 1299 | pAddBssParams->extSetStaKeyParam.key[0].key[6], |
| 1300 | pAddBssParams->extSetStaKeyParam.key[0].key[7], |
| 1301 | pAddBssParams->extSetStaKeyParam.key[0].key[8], |
| 1302 | pAddBssParams->extSetStaKeyParam.key[0].key[9], |
| 1303 | pAddBssParams->extSetStaKeyParam.key[0].key[10], |
| 1304 | pAddBssParams->extSetStaKeyParam.key[0].key[11], |
| 1305 | pAddBssParams->extSetStaKeyParam.key[0].key[12], |
| 1306 | pAddBssParams->extSetStaKeyParam.key[0].key[13], |
| 1307 | pAddBssParams->extSetStaKeyParam.key[0].key[14], |
| 1308 | pAddBssParams->extSetStaKeyParam.key[0].key[15]);) |
| 1309 | } |
| 1310 | |
| 1311 | return TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1312 | } |
| 1313 | |
| 1314 | tSirRetStatus |
| 1315 | limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) |
| 1316 | { |
| 1317 | tSirMsgQ msg; |
| 1318 | tSirAggrQosReq * aggrQosReq = (tSirAggrQosReq *)pMsgBuf; |
| 1319 | tpAggrAddTsParams pAggrAddTsParam; |
| 1320 | tpPESession psessionEntry = NULL; |
| 1321 | tpLimTspecInfo tspecInfo; |
| 1322 | tANI_U8 ac; |
| 1323 | tpDphHashNode pSta; |
| 1324 | tANI_U16 aid; |
| 1325 | tANI_U8 sessionId; |
| 1326 | int i; |
| 1327 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1328 | pAggrAddTsParam = vos_mem_malloc(sizeof(tAggrAddTsParams)); |
| 1329 | if (NULL == pAggrAddTsParam) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1331 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1332 | return eSIR_MEM_ALLOC_FAILED; |
| 1333 | } |
| 1334 | |
| 1335 | psessionEntry = peFindSessionByBssid(pMac, aggrQosReq->bssId, &sessionId); |
| 1336 | |
| 1337 | if (psessionEntry == NULL) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1338 | PELOGE(limLog(pMac, LOGE, FL("psession Entry Null for sessionId = %d"), aggrQosReq->sessionId);) |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1339 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1340 | return eSIR_FAILURE; |
| 1341 | } |
| 1342 | |
| 1343 | pSta = dphLookupHashEntry(pMac, aggrQosReq->bssId, &aid, &psessionEntry->dph.dphHashTable); |
| 1344 | if (pSta == NULL) |
| 1345 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1346 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));) |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1347 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | return eSIR_FAILURE; |
| 1349 | } |
| 1350 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1351 | vos_mem_set((tANI_U8 *)pAggrAddTsParam, |
| 1352 | sizeof(tAggrAddTsParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1353 | pAggrAddTsParam->staIdx = psessionEntry->staId; |
| 1354 | // Fill in the sessionId specific to PE |
| 1355 | pAggrAddTsParam->sessionId = sessionId; |
| 1356 | pAggrAddTsParam->tspecIdx = aggrQosReq->aggrInfo.tspecIdx; |
| 1357 | |
| 1358 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 1359 | { |
| 1360 | if (aggrQosReq->aggrInfo.tspecIdx & (1<<i)) |
| 1361 | { |
| 1362 | tSirMacTspecIE *pTspec = &aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 1363 | /* Since AddTS response was successful, check for the PSB flag |
| 1364 | * and directional flag inside the TS Info field. |
| 1365 | * An AC is trigger enabled AC if the PSB subfield is set to 1 |
| 1366 | * in the uplink direction. |
| 1367 | * An AC is delivery enabled AC if the PSB subfield is set to 1 |
| 1368 | * in the downlink direction. |
| 1369 | * An AC is trigger and delivery enabled AC if the PSB subfield |
| 1370 | * is set to 1 in the bi-direction field. |
| 1371 | */ |
| 1372 | if (pTspec->tsinfo.traffic.psb == 1) |
| 1373 | { |
| 1374 | limSetTspecUapsdMask(pMac, &pTspec->tsinfo, SET_UAPSD_MASK); |
| 1375 | } |
| 1376 | else |
| 1377 | { |
| 1378 | limSetTspecUapsdMask(pMac, &pTspec->tsinfo, CLEAR_UAPSD_MASK); |
| 1379 | } |
| 1380 | /* ADDTS success, so AC is now admitted. We shall now use the default |
| 1381 | * EDCA parameters as advertised by AP and send the updated EDCA params |
| 1382 | * to HAL. |
| 1383 | */ |
| 1384 | ac = upToAc(pTspec->tsinfo.traffic.userPrio); |
| 1385 | if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 1386 | { |
| 1387 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 1388 | } |
| 1389 | else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 1390 | { |
| 1391 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 1392 | } |
| 1393 | else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 1394 | { |
| 1395 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 1396 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 1397 | } |
| 1398 | |
| 1399 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 1400 | |
| 1401 | if (pSta->aniPeer == eANI_BOOLEAN_TRUE) |
| 1402 | { |
| 1403 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_TRUE); |
| 1404 | } |
| 1405 | else |
| 1406 | { |
| 1407 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_FALSE); |
| 1408 | } |
| 1409 | |
| 1410 | if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, pTspec, 0, &tspecInfo)) |
| 1411 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1412 | PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1413 | pMac->lim.gLimAddtsSent = false; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1414 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | return eSIR_FAILURE; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status. |
| 1416 | } |
| 1417 | |
| 1418 | // Copy the TSPEC paramters |
| 1419 | pAggrAddTsParam->tspec[i] = aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 1420 | } |
| 1421 | } |
| 1422 | |
| 1423 | msg.type = WDA_AGGR_QOS_REQ; |
| 1424 | msg.bodyptr = pAggrAddTsParam; |
| 1425 | msg.bodyval = 0; |
| 1426 | |
| 1427 | /* We need to defer any incoming messages until we get a |
| 1428 | * WDA_AGGR_QOS_RSP from HAL. |
| 1429 | */ |
| 1430 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1431 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1432 | |
| 1433 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 1434 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1435 | PELOGW(limLog(pMac, LOGW, FL("wdaPostCtrlMsg() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1436 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1437 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1438 | return eSIR_FAILURE; |
| 1439 | } |
| 1440 | |
| 1441 | return eSIR_SUCCESS; |
| 1442 | } |
| 1443 | |
| 1444 | void |
| 1445 | limFTSendAggrQosRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, |
| 1446 | tpAggrAddTsParams aggrQosRsp, tANI_U8 smesessionId) |
| 1447 | { |
| 1448 | tpSirAggrQosRsp rsp; |
| 1449 | int i = 0; |
| 1450 | |
| 1451 | if (! rspReqd) |
| 1452 | { |
| 1453 | return; |
| 1454 | } |
| 1455 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1456 | rsp = vos_mem_malloc(sizeof(tSirAggrQosRsp)); |
| 1457 | if (NULL == rsp) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1458 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1459 | limLog(pMac, LOGP, FL("AllocateMemory failed for tSirAggrQosRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1460 | return; |
| 1461 | } |
| 1462 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1463 | vos_mem_set((tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1464 | rsp->messageType = eWNI_SME_FT_AGGR_QOS_RSP; |
| 1465 | rsp->sessionId = smesessionId; |
| 1466 | rsp->length = sizeof(*rsp); |
| 1467 | rsp->aggrInfo.tspecIdx = aggrQosRsp->tspecIdx; |
| 1468 | |
| 1469 | for( i = 0; i < SIR_QOS_NUM_AC_MAX; i++ ) |
| 1470 | { |
| 1471 | if( (1 << i) & aggrQosRsp->tspecIdx ) |
| 1472 | { |
| 1473 | rsp->aggrInfo.aggrRsp[i].status = aggrQosRsp->status[i]; |
| 1474 | rsp->aggrInfo.aggrRsp[i].tspec = aggrQosRsp->tspec[i]; |
| 1475 | } |
| 1476 | } |
| 1477 | |
| 1478 | limSendSmeAggrQosRsp(pMac, rsp, smesessionId); |
| 1479 | return; |
| 1480 | } |
| 1481 | |
| 1482 | |
| 1483 | void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1484 | { |
| 1485 | tpAggrAddTsParams pAggrQosRspMsg = NULL; |
| 1486 | //tpAggrQosParams pAggrQosRspMsg = NULL; |
| 1487 | tAddTsParams addTsParam = {0}; |
| 1488 | tpDphHashNode pSta = NULL; |
| 1489 | tANI_U16 assocId =0; |
| 1490 | tSirMacAddr peerMacAddr; |
| 1491 | tANI_U8 rspReqd = 1; |
| 1492 | tpPESession psessionEntry = NULL; |
| 1493 | int i = 0; |
| 1494 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1495 | PELOG1(limLog(pMac, LOG1, FL(" Received AGGR_QOS_RSP from HAL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1496 | |
| 1497 | /* Need to process all the deferred messages enqueued since sending the |
| 1498 | SIR_HAL_AGGR_ADD_TS_REQ */ |
| 1499 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 1500 | |
| 1501 | pAggrQosRspMsg = (tpAggrAddTsParams) (limMsg->bodyptr); |
| 1502 | if (NULL == pAggrQosRspMsg) |
| 1503 | { |
| 1504 | PELOGE(limLog(pMac, LOGE, FL("NULL pAggrQosRspMsg"));) |
| 1505 | return; |
| 1506 | } |
| 1507 | |
| 1508 | psessionEntry = peFindSessionBySessionId(pMac, pAggrQosRspMsg->sessionId); |
| 1509 | if (NULL == psessionEntry) |
| 1510 | { |
| 1511 | // Cant find session entry |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1512 | PELOGE(limLog(pMac, LOGE, FL("Cant find session entry for %s"), __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | if( pAggrQosRspMsg != NULL ) |
| 1514 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1515 | vos_mem_free(pAggrQosRspMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1516 | } |
| 1517 | return; |
| 1518 | } |
| 1519 | |
| 1520 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 1521 | { |
| 1522 | if((((1 << i) & pAggrQosRspMsg->tspecIdx)) && |
| 1523 | (pAggrQosRspMsg->status[i] != eHAL_STATUS_SUCCESS)) |
| 1524 | { |
| 1525 | /* send DELTS to the station */ |
| 1526 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 1527 | |
| 1528 | addTsParam.staIdx = pAggrQosRspMsg->staIdx; |
| 1529 | addTsParam.sessionId = pAggrQosRspMsg->sessionId; |
| 1530 | addTsParam.tspec = pAggrQosRspMsg->tspec[i]; |
| 1531 | addTsParam.tspecIdx = pAggrQosRspMsg->tspecIdx; |
| 1532 | |
| 1533 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, |
| 1534 | &addTsParam.tspec.tsinfo, |
| 1535 | &addTsParam.tspec, psessionEntry); |
| 1536 | |
| 1537 | pSta = dphLookupAssocId(pMac, addTsParam.staIdx, &assocId, |
| 1538 | &psessionEntry->dph.dphHashTable); |
| 1539 | if (pSta != NULL) |
| 1540 | { |
| 1541 | limAdmitControlDeleteTS(pMac, assocId, &addTsParam.tspec.tsinfo, |
| 1542 | NULL, (tANI_U8 *)&addTsParam.tspecIdx); |
| 1543 | } |
| 1544 | } |
| 1545 | } |
| 1546 | |
| 1547 | /* Send the Aggr QoS response to SME */ |
| 1548 | |
| 1549 | limFTSendAggrQosRsp(pMac, rspReqd, pAggrQosRspMsg, |
| 1550 | psessionEntry->smeSessionId); |
| 1551 | if( pAggrQosRspMsg != NULL ) |
| 1552 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1553 | vos_mem_free(pAggrQosRspMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1554 | } |
| 1555 | return; |
| 1556 | } |
| 1557 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1558 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |