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