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