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