Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
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 | } |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 358 | #if defined FEATURE_WLAN_CCX || defined FEATURE_WLAN_LFR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | else |
| 360 | { |
| 361 | // Will need to make isCCXconnection a enum may be for further |
| 362 | // improvements to this to match this algorithm number |
| 363 | authFrame.authAlgoNumber = eSIR_OPEN_SYSTEM; // For now if its CCX and 11r FT. |
| 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; |
| 497 | |
| 498 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 499 | limLog( pMac, LOG1, FL( "SIR_HAL_ADD_BSS_REQ with channel = %d..." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 500 | pAddBssParams->currentOperChannel); |
| 501 | #endif |
| 502 | |
| 503 | |
| 504 | // Populate the STA-related parameters here |
| 505 | // Note that the STA here refers to the AP |
| 506 | { |
| 507 | pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA |
| 508 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 509 | vos_mem_copy(pAddBssParams->staContext.bssId, |
| 510 | bssDescription->bssId, |
| 511 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 512 | pAddBssParams->staContext.listenInterval = bssDescription->beaconInterval; |
| 513 | |
| 514 | pAddBssParams->staContext.assocId = 0; // Is SMAC OK with this? |
| 515 | pAddBssParams->staContext.uAPSD = 0; |
| 516 | pAddBssParams->staContext.maxSPLen = 0; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 517 | pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 518 | pAddBssParams->staContext.updateSta = updateEntry; |
| 519 | pAddBssParams->staContext.encryptType = pftSessionEntry->encryptType; |
| 520 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 521 | if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | { |
| 523 | pAddBssParams->staContext.us32MaxAmpduDuration = 0; |
| 524 | pAddBssParams->staContext.htCapable = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 525 | pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; |
| 526 | pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; |
| 527 | if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 528 | (chanWidthSupp) ) |
| 529 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 530 | pAddBssParams->staContext.txChannelWidthSet = ( tANI_U8 )pBeaconStruct->HTInfo.recommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 531 | } |
| 532 | else |
| 533 | { |
| 534 | pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 535 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 536 | pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState)pBeaconStruct->HTCaps.mimoPowerSave; |
| 537 | pAddBssParams->staContext.delBASupport = ( tANI_U8 ) pBeaconStruct->HTCaps.delayedBA; |
| 538 | pAddBssParams->staContext.maxAmsduSize = ( tANI_U8 ) pBeaconStruct->HTCaps.maximalAMSDUsize; |
| 539 | pAddBssParams->staContext.maxAmpduDensity = pBeaconStruct->HTCaps.mpduDensity; |
| 540 | pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pBeaconStruct->HTCaps.dsssCckMode40MHz; |
| 541 | pAddBssParams->staContext.fShortGI20Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI20MHz; |
| 542 | pAddBssParams->staContext.fShortGI40Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI40MHz; |
| 543 | pAddBssParams->staContext.maxAmpduSize= pBeaconStruct->HTCaps.maxRxAMPDUFactor; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 544 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 545 | if( pBeaconStruct->HTInfo.present ) |
| 546 | pAddBssParams->staContext.rifsMode = pBeaconStruct->HTInfo.rifsMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 547 | } |
| 548 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 549 | if ((pftSessionEntry->limWmeEnabled && pBeaconStruct->wmeEdcaPresent) || |
| 550 | (pftSessionEntry->limQosEnabled && pBeaconStruct->edcaPresent)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 551 | pAddBssParams->staContext.wmmEnabled = 1; |
| 552 | else |
| 553 | pAddBssParams->staContext.wmmEnabled = 0; |
| 554 | |
| 555 | //Update the rates |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 556 | #ifdef WLAN_FEATURE_11AC |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 557 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
| 558 | pBeaconStruct->HTCaps.supportedMCSSet, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 559 | false,pftSessionEntry,&pBeaconStruct->VHTCaps); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 560 | #else |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 561 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 562 | beaconStruct.HTCaps.supportedMCSSet, false,pftSessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 563 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 564 | limFillSupportedRatesInfo(pMac, NULL, &pAddBssParams->staContext.supportedRates,pftSessionEntry); |
| 565 | |
| 566 | } |
| 567 | |
| 568 | |
| 569 | //Disable BA. It will be set as part of ADDBA negotiation. |
| 570 | for( i = 0; i < STACFG_MAX_TC; i++ ) |
| 571 | { |
| 572 | pAddBssParams->staContext.staTCParams[i].txUseBA = eBA_DISABLE; |
| 573 | pAddBssParams->staContext.staTCParams[i].rxUseBA = eBA_DISABLE; |
| 574 | pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE; |
| 575 | pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE; |
| 576 | } |
| 577 | |
| 578 | #if defined WLAN_FEATURE_VOWIFI |
| 579 | pAddBssParams->maxTxPower = pftSessionEntry->maxTxPower; |
| 580 | #endif |
| 581 | |
Chet Lanctot | a4fd8e6 | 2013-12-10 16:02:32 -0800 | [diff] [blame] | 582 | #ifdef WLAN_FEATURE_11W |
| 583 | if (pftSessionEntry->limRmfEnabled) |
| 584 | { |
| 585 | pAddBssParams->rmfEnabled = 1; |
| 586 | pAddBssParams->staContext.rmfEnabled = 1; |
| 587 | } |
| 588 | #endif |
| 589 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 590 | pAddBssParams->status = eHAL_STATUS_SUCCESS; |
| 591 | pAddBssParams->respReqd = true; |
| 592 | |
| 593 | pAddBssParams->staContext.sessionId = pftSessionEntry->peSessionId; |
| 594 | pAddBssParams->sessionId = pftSessionEntry->peSessionId; |
| 595 | |
| 596 | // Set a new state for MLME |
| 597 | |
| 598 | pftSessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 599 | 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] | 600 | pAddBssParams->halPersona=(tANI_U8)pftSessionEntry->pePersona; //pass on the session persona to hal |
| 601 | |
| 602 | pMac->ft.ftPEContext.pAddBssReq = pAddBssParams; |
| 603 | |
| 604 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 605 | 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] | 606 | #endif |
| 607 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 608 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | return 0; |
| 610 | } |
| 611 | |
| 612 | /*------------------------------------------------------------------ |
| 613 | * |
| 614 | * Setup the new session for the pre-auth AP. |
| 615 | * Return the newly created session entry. |
| 616 | * |
| 617 | *------------------------------------------------------------------*/ |
| 618 | tpPESession limFillFTSession(tpAniSirGlobal pMac, |
| 619 | tpSirBssDescription pbssDescription, tpPESession psessionEntry) |
| 620 | { |
| 621 | tpPESession pftSessionEntry; |
| 622 | tANI_U8 currentBssUapsd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 623 | tPowerdBm localPowerConstraint; |
| 624 | tPowerdBm regMax; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 625 | tSchBeaconStruct *pBeaconStruct; |
| 626 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 627 | pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); |
| 628 | if (NULL == pBeaconStruct) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 629 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 630 | limLog(pMac, LOGE, FL("Unable to allocate memory for creating limFillFTSession") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 631 | return NULL; |
| 632 | } |
| 633 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 635 | |
| 636 | /* Retrieve the session that has already been created and update the entry */ |
| 637 | pftSessionEntry = pMac->ft.ftPEContext.pftSessionEntry; |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 638 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 639 | limPrintMacAddr(pMac, pbssDescription->bssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 640 | #endif |
| 641 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 642 | pftSessionEntry->dot11mode = psessionEntry->dot11mode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 643 | pftSessionEntry->htCapability = psessionEntry->htCapability; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 644 | |
| 645 | pftSessionEntry->limWmeEnabled = psessionEntry->limWmeEnabled; |
| 646 | pftSessionEntry->limQosEnabled = psessionEntry->limQosEnabled; |
| 647 | pftSessionEntry->limWsmEnabled = psessionEntry->limWsmEnabled; |
| 648 | pftSessionEntry->lim11hEnable = psessionEntry->lim11hEnable; |
| 649 | |
| 650 | // Fields to be filled later |
| 651 | pftSessionEntry->pLimJoinReq = NULL; |
| 652 | pftSessionEntry->smeSessionId = 0; |
| 653 | pftSessionEntry->transactionId = 0; |
| 654 | |
| 655 | limExtractApCapabilities( pMac, |
| 656 | (tANI_U8 *) pbssDescription->ieFields, |
| 657 | limGetIElenFromBssDescription( pbssDescription ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 658 | pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 660 | pftSessionEntry->rateSet.numRates = pBeaconStruct->supportedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 661 | vos_mem_copy(pftSessionEntry->rateSet.rate, |
| 662 | pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 664 | pftSessionEntry->extRateSet.numRates = pBeaconStruct->extendedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 665 | vos_mem_copy(pftSessionEntry->extRateSet.rate, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 666 | pBeaconStruct->extendedRates.rate, pftSessionEntry->extRateSet.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 667 | |
| 668 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 669 | pftSessionEntry->ssId.length = pBeaconStruct->ssId.length; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 670 | vos_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 671 | pftSessionEntry->ssId.length); |
| 672 | |
| 673 | |
| 674 | // Self Mac |
| 675 | sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); |
| 676 | sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 677 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 678 | limPrintMacAddr(pMac, pftSessionEntry->limReAssocbssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 679 | #endif |
| 680 | |
| 681 | /* Store beaconInterval */ |
| 682 | pftSessionEntry->beaconParams.beaconInterval = pbssDescription->beaconInterval; |
| 683 | pftSessionEntry->bssType = psessionEntry->bssType; |
| 684 | |
| 685 | pftSessionEntry->statypeForBss = STA_ENTRY_PEER; |
| 686 | pftSessionEntry->nwType = pbssDescription->nwType; |
| 687 | |
| 688 | /* Copy The channel Id to the session Table */ |
| 689 | pftSessionEntry->limReassocChannelId = pbssDescription->channelId; |
| 690 | pftSessionEntry->currentOperChannel = pbssDescription->channelId; |
| 691 | |
| 692 | |
| 693 | if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) |
| 694 | { |
| 695 | pftSessionEntry->limSystemRole = eLIM_STA_ROLE; |
| 696 | } |
| 697 | else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 698 | { |
| 699 | pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 700 | } |
| 701 | else |
| 702 | { |
| 703 | /* 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] | 704 | limLog(pMac, LOGE, FL("Invalid bss type")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | } |
| 706 | |
| 707 | pftSessionEntry->limCurrentBssCaps = pbssDescription->capabilityInfo; |
| 708 | pftSessionEntry->limReassocBssCaps = pbssDescription->capabilityInfo; |
Srinivas Girigowda | 3353f1e | 2013-02-04 16:22:51 -0800 | [diff] [blame] | 709 | if( pMac->roam.configParam.shortSlotTime && |
| 710 | SIR_MAC_GET_SHORT_SLOT_TIME(pftSessionEntry->limReassocBssCaps)) |
| 711 | { |
| 712 | pftSessionEntry->shortSlotTimeSupported = TRUE; |
| 713 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | |
| 715 | regMax = cfgGetRegulatoryMaxTransmitPower( pMac, pftSessionEntry->currentOperChannel ); |
| 716 | localPowerConstraint = regMax; |
| 717 | limExtractApCapability( pMac, (tANI_U8 *) pbssDescription->ieFields, |
| 718 | limGetIElenFromBssDescription(pbssDescription), |
| 719 | &pftSessionEntry->limCurrentBssQosCaps, |
| 720 | &pftSessionEntry->limCurrentBssPropCap, |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 721 | ¤tBssUapsd , &localPowerConstraint, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 722 | |
| 723 | pftSessionEntry->limReassocBssQosCaps = |
| 724 | pftSessionEntry->limCurrentBssQosCaps; |
| 725 | pftSessionEntry->limReassocBssPropCap = |
| 726 | pftSessionEntry->limCurrentBssPropCap; |
| 727 | |
| 728 | |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 729 | #ifdef FEATURE_WLAN_CCX |
| 730 | pftSessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap); |
| 731 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | pftSessionEntry->maxTxPower = VOS_MIN( regMax , (localPowerConstraint) ); |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 733 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | |
| 735 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 736 | 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] | 737 | __func__, regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap, pftSessionEntry->maxTxPower ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | #endif |
| 739 | |
| 740 | pftSessionEntry->limRFBand = limGetRFBand(pftSessionEntry->currentOperChannel); |
| 741 | |
| 742 | pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; |
| 743 | pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 744 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, pftSessionEntry->peSessionId, pftSessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 745 | |
| 746 | pftSessionEntry->encryptType = psessionEntry->encryptType; |
| 747 | |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 748 | #ifdef WLAN_FEATURE_11AC |
| 749 | pftSessionEntry->vhtCapability = psessionEntry->vhtCapability; |
| 750 | pftSessionEntry->vhtCapabilityPresentInBeacon = psessionEntry->vhtCapabilityPresentInBeacon; |
| 751 | #endif |
| 752 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 753 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | return pftSessionEntry; |
| 755 | } |
| 756 | |
| 757 | /*------------------------------------------------------------------ |
| 758 | * |
| 759 | * Setup the session and the add bss req for the pre-auth AP. |
| 760 | * |
| 761 | *------------------------------------------------------------------*/ |
| 762 | void limFTSetupAuthSession(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 763 | { |
| 764 | tpPESession pftSessionEntry; |
| 765 | |
| 766 | // Prepare the session right now with as much as possible. |
| 767 | pftSessionEntry = limFillFTSession(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription, psessionEntry); |
| 768 | |
| 769 | if (pftSessionEntry) |
| 770 | { |
| 771 | pftSessionEntry->is11Rconnection = psessionEntry->is11Rconnection; |
| 772 | #ifdef FEATURE_WLAN_CCX |
| 773 | pftSessionEntry->isCCXconnection = psessionEntry->isCCXconnection; |
| 774 | #endif |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 775 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | pftSessionEntry->isFastTransitionEnabled = psessionEntry->isFastTransitionEnabled; |
| 777 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 778 | |
| 779 | #ifdef FEATURE_WLAN_LFR |
| 780 | pftSessionEntry->isFastRoamIniFeatureEnabled = psessionEntry->isFastRoamIniFeatureEnabled; |
| 781 | #endif |
Chet Lanctot | a4fd8e6 | 2013-12-10 16:02:32 -0800 | [diff] [blame] | 782 | #ifdef WLAN_FEATURE_11W |
| 783 | pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled; |
| 784 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 785 | limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, |
| 786 | pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription ); |
| 787 | pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | /*------------------------------------------------------------------ |
| 792 | * Resume Link Call Back |
| 793 | *------------------------------------------------------------------*/ |
| 794 | void limFTProcessPreAuthResult(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) |
| 795 | { |
| 796 | tpPESession psessionEntry; |
| 797 | |
Srinivas Girigowda | 4585f0d | 2013-10-28 18:07:40 -0700 | [diff] [blame] | 798 | if (!pMac->ft.ftPEContext.pFTPreAuthReq) |
| 799 | return; |
| 800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 801 | psessionEntry = (tpPESession)data; |
| 802 | |
| 803 | if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) |
| 804 | { |
| 805 | limFTSetupAuthSession(pMac, psessionEntry); |
| 806 | } |
| 807 | |
| 808 | // Post the FT Pre Auth Response to SME |
| 809 | limPostFTPreAuthRsp(pMac, pMac->ft.ftPEContext.ftPreAuthStatus, |
| 810 | pMac->ft.ftPEContext.saved_auth_rsp, |
| 811 | pMac->ft.ftPEContext.saved_auth_rsp_length, psessionEntry); |
| 812 | |
| 813 | } |
| 814 | |
| 815 | /*------------------------------------------------------------------ |
| 816 | * Resume Link Call Back |
| 817 | *------------------------------------------------------------------*/ |
| 818 | void limPerformPostFTPreAuthAndChannelChange(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, |
| 819 | tpPESession psessionEntry) |
| 820 | { |
| 821 | //Set the resume channel to Any valid channel (invalid). |
| 822 | //This will instruct HAL to set it to any previous valid channel. |
| 823 | peSetResumeChannel(pMac, 0, 0); |
| 824 | limResumeLink(pMac, limFTProcessPreAuthResult, (tANI_U32 *)psessionEntry); |
| 825 | } |
| 826 | |
| 827 | tSirRetStatus limCreateRICBlockAckIE(tpAniSirGlobal pMac, tANI_U8 tid, tCfgTrafficClass *pTrafficClass, |
| 828 | tANI_U8 *ric_ies, tANI_U32 *ieLength) |
| 829 | { |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 830 | /* BlockACK + RIC is not supported now, TODO later to support this */ |
| 831 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 832 | tDot11fIERICDataDesc ricIe; |
| 833 | tDot11fFfBAStartingSequenceControl baSsnControl; |
| 834 | tDot11fFfAddBAParameterSet baParamSet; |
| 835 | tDot11fFfBATimeout baTimeout; |
| 836 | |
| 837 | vos_mem_zero(&ricIe, sizeof(tDot11fIERICDataDesc)); |
| 838 | vos_mem_zero(&baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); |
| 839 | vos_mem_zero(&baParamSet, sizeof(tDot11fFfAddBAParameterSet)); |
| 840 | vos_mem_zero(&baTimeout, sizeof(tDot11fFfBATimeout)); |
| 841 | |
| 842 | ricIe.present = 1; |
| 843 | ricIe.RICData.present = 1; |
| 844 | ricIe.RICData.resourceDescCount = 1; |
| 845 | ricIe.RICData.Identifier = LIM_FT_RIC_BA_DIALOG_TOKEN_TID_0 + tid; |
| 846 | ricIe.RICDescriptor.present = 1; |
| 847 | ricIe.RICDescriptor.resourceType = LIM_FT_RIC_DESCRIPTOR_RESOURCE_TYPE_BA; |
| 848 | baParamSet.tid = tid; |
| 849 | baParamSet.policy = pTrafficClass->fTxBApolicy; // Immediate Block Ack |
| 850 | baParamSet.bufferSize = pTrafficClass->txBufSize; |
| 851 | vos_mem_copy((v_VOID_t *)&baTimeout, (v_VOID_t *)&pTrafficClass->tuTxBAWaitTimeout, sizeof(baTimeout)); |
| 852 | baSsnControl.fragNumber = 0; |
| 853 | baSsnControl.ssn = LIM_FT_RIC_BA_SSN; |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 854 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 855 | dot11fPackFfAddBAParameterSet(pMac, &baParamSet, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 856 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baParamSet, sizeof(tDot11fFfAddBAParameterSet)); |
| 857 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfAddBAParameterSet); |
| 858 | } |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 859 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 860 | dot11fPackFfBATimeout(pMac, &baTimeout, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 861 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baTimeout, sizeof(tDot11fFfBATimeout)); |
| 862 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBATimeout); |
| 863 | } |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 864 | if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 865 | dot11fPackFfBAStartingSequenceControl(pMac, &baSsnControl, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); |
| 866 | //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); |
| 867 | ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBAStartingSequenceControl); |
| 868 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 869 | return (tSirRetStatus) dot11fPackIeRICDataDesc(pMac, &ricIe, ric_ies, sizeof(tDot11fIERICDataDesc), ieLength); |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 870 | #endif |
| 871 | |
| 872 | return eSIR_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 873 | } |
| 874 | |
| 875 | tSirRetStatus limFTFillRICBlockAckInfo(tpAniSirGlobal pMac, tANI_U8 *ric_ies, tANI_U32 *ric_ies_length) |
| 876 | { |
| 877 | tANI_U8 tid = 0; |
| 878 | tpDphHashNode pSta; |
| 879 | tANI_U16 numBA = 0, aid = 0; |
| 880 | tpPESession psessionEntry = pMac->ft.ftPEContext.psavedsessionEntry; |
| 881 | tANI_U32 offset = 0, ieLength = 0; |
| 882 | tSirRetStatus status = eSIR_SUCCESS; |
| 883 | |
| 884 | // First, extract the DPH entry |
| 885 | pSta = dphLookupHashEntry( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, &aid, &psessionEntry->dph.dphHashTable); |
| 886 | if( NULL == pSta ) |
| 887 | { |
| 888 | PELOGE(limLog( pMac, LOGE, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 889 | FL( "STA context not found for saved session's BSSID " MAC_ADDRESS_STR ), |
| 890 | MAC_ADDR_ARRAY(pMac->ft.ftPEContext.pFTPreAuthReq->currbssId));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 891 | return eSIR_FAILURE; |
| 892 | } |
| 893 | |
| 894 | for (tid = 0; tid < STACFG_MAX_TC; tid++) |
| 895 | { |
| 896 | if (pSta->tcCfg[tid].fUseBATx) |
| 897 | { |
| 898 | status = limCreateRICBlockAckIE(pMac, tid, &pSta->tcCfg[tid], ric_ies + offset, &ieLength); |
| 899 | if (eSIR_SUCCESS == status) |
| 900 | { |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 901 | // TODO RIC |
| 902 | if ( ieLength > MAX_FTIE_SIZE ) |
| 903 | { |
| 904 | ieLength = 0; |
| 905 | return status; |
| 906 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 907 | offset += ieLength; |
| 908 | *ric_ies_length += ieLength; |
| 909 | numBA++; |
| 910 | } |
| 911 | else |
| 912 | { |
| 913 | PELOGE(limLog(pMac, LOGE, FL("BA RIC IE creation for TID %d failed with status %d"), tid, status);) |
| 914 | } |
| 915 | } |
| 916 | } |
| 917 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 918 | 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] | 919 | return status; |
| 920 | } |
| 921 | |
| 922 | /*------------------------------------------------------------------ |
| 923 | * |
| 924 | * Will post pre auth response to SME. |
| 925 | * |
| 926 | *------------------------------------------------------------------*/ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 927 | void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 928 | tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, |
| 929 | tpPESession psessionEntry) |
| 930 | { |
| 931 | tpSirFTPreAuthRsp pFTPreAuthRsp; |
| 932 | tSirMsgQ mmhMsg; |
| 933 | tANI_U16 rspLen = sizeof(tSirFTPreAuthRsp); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 934 | // TODO: RIC Support |
| 935 | //tSirRetStatus sirStatus = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 936 | |
| 937 | pFTPreAuthRsp = (tpSirFTPreAuthRsp)vos_mem_malloc(rspLen); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 938 | if (NULL == pFTPreAuthRsp) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 939 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 940 | PELOGE(limLog( pMac, LOGE, "Failed to allocate memory");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 941 | VOS_ASSERT(pFTPreAuthRsp != NULL); |
| 942 | return; |
| 943 | } |
| 944 | vos_mem_zero( pFTPreAuthRsp, rspLen); |
| 945 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 946 | PELOGE(limLog( pMac, LOG1, FL("Auth Rsp = %p"), pFTPreAuthRsp);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 947 | #endif |
| 948 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 949 | vos_mem_set((tANI_U8*)pFTPreAuthRsp, rspLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 950 | pFTPreAuthRsp->messageType = eWNI_SME_FT_PRE_AUTH_RSP; |
| 951 | pFTPreAuthRsp->length = (tANI_U16) rspLen; |
| 952 | pFTPreAuthRsp->status = status; |
| 953 | if (psessionEntry) |
| 954 | pFTPreAuthRsp->smeSessionId = psessionEntry->smeSessionId; |
| 955 | |
| 956 | // The bssid of the AP we are sending Auth1 to. |
| 957 | if (pMac->ft.ftPEContext.pFTPreAuthReq) |
| 958 | sirCopyMacAddr(pFTPreAuthRsp->preAuthbssId, |
| 959 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId); |
| 960 | |
| 961 | // Attach the auth response now back to SME |
| 962 | pFTPreAuthRsp->ft_ies_length = 0; |
| 963 | if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) |
| 964 | { |
| 965 | // Only 11r assoc has FT IEs. |
| 966 | vos_mem_copy(pFTPreAuthRsp->ft_ies, auth_rsp, auth_rsp_length); |
| 967 | pFTPreAuthRsp->ft_ies_length = auth_rsp_length; |
| 968 | } |
| 969 | |
| 970 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 971 | if ((psessionEntry) && (psessionEntry->is11Rconnection)) |
| 972 | { |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 973 | /* TODO: RIC SUPPORT Fill in the Block Ack RIC IEs in the preAuthRsp */ |
| 974 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 975 | sirStatus = limFTFillRICBlockAckInfo(pMac, pFTPreAuthRsp->ric_ies, |
| 976 | (tANI_U32 *)&pFTPreAuthRsp->ric_ies_length); |
| 977 | if (eSIR_SUCCESS != sirStatus) |
| 978 | { |
| 979 | PELOGE(limLog(pMac, LOGE, FL("Fill RIC BA Info failed with status %d"), sirStatus);) |
| 980 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 981 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 982 | } |
| 983 | #endif |
| 984 | |
| 985 | mmhMsg.type = pFTPreAuthRsp->messageType; |
| 986 | mmhMsg.bodyptr = pFTPreAuthRsp; |
| 987 | mmhMsg.bodyval = 0; |
| 988 | |
| 989 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 990 | 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] | 991 | #endif |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 992 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
Rajesh Chauhan | 913ab4f | 2013-07-17 14:36:31 -0700 | [diff] [blame] | 993 | if (status == eSIR_SUCCESS) |
| 994 | limDiagEventReport(pMac, WLAN_PE_DIAG_PREAUTH_DONE, psessionEntry, |
| 995 | status, 0); |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 996 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 997 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 998 | } |
| 999 | |
| 1000 | /*------------------------------------------------------------------ |
| 1001 | * |
| 1002 | * Send the FT Pre Auth Response to SME when ever we have a status |
| 1003 | * ready to be sent to SME |
| 1004 | * |
| 1005 | * SME will be the one to send it up to the supplicant to receive |
| 1006 | * FTIEs which will be required for Reassoc Req. |
| 1007 | * |
| 1008 | *------------------------------------------------------------------*/ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1009 | void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1010 | tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, |
| 1011 | tpPESession psessionEntry) |
| 1012 | { |
| 1013 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1014 | tpPESession pftSessionEntry; |
| 1015 | tANI_U8 sessionId; |
| 1016 | tpSirBssDescription pbssDescription; |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 1017 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1018 | limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); |
| 1019 | #endif |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1020 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1021 | // Save the status of pre-auth |
| 1022 | pMac->ft.ftPEContext.ftPreAuthStatus = status; |
| 1023 | |
| 1024 | // Save the auth rsp, so we can send it to |
| 1025 | // SME once we resume link. |
| 1026 | pMac->ft.ftPEContext.saved_auth_rsp_length = 0; |
| 1027 | if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) |
| 1028 | { |
| 1029 | vos_mem_copy(pMac->ft.ftPEContext.saved_auth_rsp, |
| 1030 | auth_rsp, auth_rsp_length); |
| 1031 | pMac->ft.ftPEContext.saved_auth_rsp_length = auth_rsp_length; |
| 1032 | } |
| 1033 | |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1034 | /* Create FT session for the re-association at this point */ |
| 1035 | if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) |
| 1036 | { |
| 1037 | pbssDescription = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription; |
| 1038 | if((pftSessionEntry = peCreateSession(pMac, pbssDescription->bssId, |
| 1039 | &sessionId, pMac->lim.maxStation)) == NULL) |
| 1040 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1041 | 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] | 1042 | return; |
| 1043 | } |
| 1044 | pftSessionEntry->peSessionId = sessionId; |
| 1045 | sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); |
| 1046 | sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); |
| 1047 | pftSessionEntry->bssType = psessionEntry->bssType; |
| 1048 | |
| 1049 | if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) |
| 1050 | { |
| 1051 | pftSessionEntry->limSystemRole = eLIM_STA_ROLE; |
| 1052 | } |
| 1053 | else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 1054 | { |
| 1055 | pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 1056 | } |
| 1057 | else |
| 1058 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1059 | limLog(pMac, LOGE, FL("Invalid bss type")); |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1060 | } |
| 1061 | pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; |
| 1062 | pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
| 1063 | pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1064 | PELOGE(limLog(pMac, LOG1,"%s:created session (%p) with id = %d", |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1065 | __func__, pftSessionEntry, pftSessionEntry->peSessionId);) |
| 1066 | |
| 1067 | /* Update the ReAssoc BSSID of the current session */ |
| 1068 | sirCopyMacAddr(psessionEntry->limReAssocbssId, pbssDescription->bssId); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1069 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1070 | } |
| 1071 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1072 | if (psessionEntry->currentOperChannel != |
| 1073 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) |
| 1074 | { |
| 1075 | // Need to move to the original AP channel |
| 1076 | limChangeChannelWithCallback(pMac, psessionEntry->currentOperChannel, |
| 1077 | limPerformPostFTPreAuthAndChannelChange, NULL, psessionEntry); |
| 1078 | } |
| 1079 | else |
| 1080 | { |
| 1081 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1082 | 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] | 1083 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum);) |
| 1084 | #endif |
| 1085 | limFTProcessPreAuthResult(pMac, status, (tANI_U32 *)psessionEntry); |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | /*------------------------------------------------------------------ |
| 1090 | * |
| 1091 | * This function handles the 11R Reassoc Req from SME |
| 1092 | * |
| 1093 | *------------------------------------------------------------------*/ |
| 1094 | void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, |
| 1095 | tpPESession psessionEntry) |
| 1096 | { |
| 1097 | tANI_U8 smeSessionId = 0; |
| 1098 | tANI_U16 transactionId = 0; |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1099 | tANI_U8 chanNum = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1100 | tLimMlmReassocReq *pMlmReassocReq; |
| 1101 | tANI_U16 caps; |
| 1102 | tANI_U32 val; |
| 1103 | tSirMsgQ msgQ; |
| 1104 | tSirRetStatus retCode; |
| 1105 | tANI_U32 teleBcnEn = 0; |
| 1106 | |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1107 | chanNum = psessionEntry->currentOperChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1108 | limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf, &smeSessionId, &transactionId); |
| 1109 | psessionEntry->smeSessionId = smeSessionId; |
| 1110 | psessionEntry->transactionId = transactionId; |
| 1111 | |
Leela Venkata Kiran Kumar Reddy Chirala | 2365ee6 | 2013-05-09 17:30:12 -0700 | [diff] [blame] | 1112 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1113 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOCIATING, psessionEntry, 0, 0); |
| 1114 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | |
Madan Mohan Koyyalamudi | 67b82f6 | 2013-06-21 18:35:53 +0530 | [diff] [blame] | 1116 | if (NULL == pMac->ft.ftPEContext.pAddBssReq) |
| 1117 | { |
| 1118 | limLog(pMac, LOGE, FL("pAddBssReq is NULL")); |
| 1119 | return; |
| 1120 | } |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1121 | pMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 1122 | if (NULL == pMlmReassocReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1123 | { |
| 1124 | // Log error |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1125 | limLog(pMac, LOGE, FL("call to AllocateMemory failed for mlmReassocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1126 | return; |
| 1127 | } |
| 1128 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1129 | vos_mem_copy(pMlmReassocReq->peerMacAddr, |
| 1130 | psessionEntry->bssId, |
| 1131 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1132 | |
| 1133 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 1134 | (tANI_U32 *) &pMlmReassocReq->reassocFailureTimeout) |
| 1135 | != eSIR_SUCCESS) |
| 1136 | { |
| 1137 | /** |
| 1138 | * Could not get ReassocFailureTimeout value |
| 1139 | * from CFG. Log error. |
| 1140 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1141 | limLog(pMac, LOGE, FL("could not retrieve ReassocFailureTimeout value")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1142 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1143 | return; |
| 1144 | } |
| 1145 | |
| 1146 | if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) |
| 1147 | { |
| 1148 | /** |
| 1149 | * Could not get Capabilities value |
| 1150 | * from CFG. Log error. |
| 1151 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1152 | limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1153 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1154 | return; |
| 1155 | } |
| 1156 | pMlmReassocReq->capabilityInfo = caps; |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1157 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1158 | /* Update PE sessionId*/ |
| 1159 | pMlmReassocReq->sessionId = psessionEntry->peSessionId; |
| 1160 | |
| 1161 | /* 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] | 1162 | if (wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, &teleBcnEn) != |
| 1163 | eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1164 | { |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1165 | 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] | 1166 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1167 | return; |
| 1168 | } |
| 1169 | |
| 1170 | if (teleBcnEn) |
| 1171 | { |
| 1172 | 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] | 1173 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | /** |
| 1175 | * Could not get ListenInterval value |
| 1176 | * from CFG. Log error. |
| 1177 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1178 | limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1179 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | return; |
Varun Reddy Yeturu | ea6bd08 | 2013-01-28 10:31:22 -0800 | [diff] [blame] | 1181 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1182 | } |
| 1183 | else |
| 1184 | { |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1185 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1186 | { |
| 1187 | /** |
| 1188 | * Could not get ListenInterval value |
| 1189 | * from CFG. Log error. |
| 1190 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1191 | limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1192 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1193 | return; |
| 1194 | } |
| 1195 | } |
| 1196 | if (limSetLinkState(pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId, |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1197 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1198 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1199 | vos_mem_free(pMlmReassocReq); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1200 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | } |
| 1202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1203 | pMlmReassocReq->listenInterval = (tANI_U16) val; |
| 1204 | |
| 1205 | psessionEntry->pLimMlmReassocReq = pMlmReassocReq; |
| 1206 | |
| 1207 | |
| 1208 | //we need to defer the message until we get the response back from HAL. |
| 1209 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1210 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1211 | msgQ.type = SIR_HAL_ADD_BSS_REQ; |
| 1212 | msgQ.reserved = 0; |
| 1213 | msgQ.bodyptr = pMac->ft.ftPEContext.pAddBssReq; |
| 1214 | msgQ.bodyval = 0; |
| 1215 | |
| 1216 | |
| 1217 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1218 | limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1219 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1220 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1221 | |
| 1222 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
Jeff Johnson | 278b049 | 2013-04-03 14:10:08 -0700 | [diff] [blame] | 1223 | if( eSIR_SUCCESS != retCode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1224 | { |
| 1225 | vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1226 | 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] | 1227 | retCode ); |
| 1228 | } |
| 1229 | // Dont need this anymore |
| 1230 | pMac->ft.ftPEContext.pAddBssReq = NULL; |
| 1231 | return; |
| 1232 | } |
| 1233 | |
| 1234 | /*------------------------------------------------------------------ |
| 1235 | * |
| 1236 | * This function is called if preauth response is not received from the AP |
| 1237 | * within this timeout while FT in progress |
| 1238 | * |
| 1239 | *------------------------------------------------------------------*/ |
| 1240 | void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) |
| 1241 | { |
| 1242 | tpPESession psessionEntry; |
| 1243 | |
| 1244 | // We have failed pre auth. We need to resume link and get back on |
| 1245 | // home channel. |
Madan Mohan Koyyalamudi | 67b82f6 | 2013-06-21 18:35:53 +0530 | [diff] [blame] | 1246 | limLog(pMac, LOG1, FL("FT Pre-Auth Time Out!!!!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1247 | |
| 1248 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId))== NULL) |
| 1249 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1250 | limLog(pMac, LOGE, FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1251 | return; |
| 1252 | } |
| 1253 | |
| 1254 | // Ok, so attempted at Pre-Auth and failed. If we are off channel. We need |
| 1255 | // to get back. |
| 1256 | limHandleFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); |
| 1257 | } |
| 1258 | |
| 1259 | |
| 1260 | /*------------------------------------------------------------------ |
| 1261 | * |
| 1262 | * This function is called to process the update key request from SME |
| 1263 | * |
| 1264 | *------------------------------------------------------------------*/ |
| 1265 | tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) |
| 1266 | { |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1267 | tAddBssParams * pAddBssParams; |
| 1268 | tSirFTUpdateKeyInfo * pKeyInfo; |
| 1269 | tANI_U32 val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1270 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1271 | /* Sanity Check */ |
| 1272 | if( pMac == NULL || pMsgBuf == NULL ) |
| 1273 | { |
| 1274 | return TRUE; |
| 1275 | } |
| 1276 | if(pMac->ft.ftPEContext.pAddBssReq == NULL) |
| 1277 | { |
| 1278 | limLog( pMac, LOGE, |
| 1279 | FL( "pAddBssReq is NULL" )); |
| 1280 | return TRUE; |
| 1281 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1282 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1283 | pAddBssParams = pMac->ft.ftPEContext.pAddBssReq; |
| 1284 | pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1285 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1286 | /* Store the key information in the ADD BSS parameters */ |
| 1287 | pAddBssParams->extSetStaKeyParamValid = 1; |
| 1288 | pAddBssParams->extSetStaKeyParam.encType = pKeyInfo->keyMaterial.edType; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1289 | vos_mem_copy((tANI_U8 *) &pAddBssParams->extSetStaKeyParam.key, |
| 1290 | (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1291 | if(eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_SINGLE_TID_RC, &val)) |
| 1292 | { |
| 1293 | limLog( pMac, LOGP, FL( "Unable to read WNI_CFG_SINGLE_TID_RC" )); |
| 1294 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1296 | pAddBssParams->extSetStaKeyParam.singleTidRc = val; |
| 1297 | PELOG1(limLog(pMac, LOG1, FL("Key valid %d"), |
| 1298 | pAddBssParams->extSetStaKeyParamValid, |
| 1299 | pAddBssParams->extSetStaKeyParam.key[0].keyLength);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1301 | pAddBssParams->extSetStaKeyParam.staIdx = 0; |
| 1302 | |
| 1303 | PELOG1(limLog(pMac, LOG1, |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 1304 | FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId));) |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1305 | |
| 1306 | if(pAddBssParams->extSetStaKeyParam.key[0].keyLength == 16) |
| 1307 | { |
| 1308 | PELOG1(limLog(pMac, LOG1, |
| 1309 | FL("BSS key = %02X-%02X-%02X-%02X-%02X-%02X-%02X- " |
| 1310 | "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X"), |
| 1311 | pAddBssParams->extSetStaKeyParam.key[0].key[0], |
| 1312 | pAddBssParams->extSetStaKeyParam.key[0].key[1], |
| 1313 | pAddBssParams->extSetStaKeyParam.key[0].key[2], |
| 1314 | pAddBssParams->extSetStaKeyParam.key[0].key[3], |
| 1315 | pAddBssParams->extSetStaKeyParam.key[0].key[4], |
| 1316 | pAddBssParams->extSetStaKeyParam.key[0].key[5], |
| 1317 | pAddBssParams->extSetStaKeyParam.key[0].key[6], |
| 1318 | pAddBssParams->extSetStaKeyParam.key[0].key[7], |
| 1319 | pAddBssParams->extSetStaKeyParam.key[0].key[8], |
| 1320 | pAddBssParams->extSetStaKeyParam.key[0].key[9], |
| 1321 | pAddBssParams->extSetStaKeyParam.key[0].key[10], |
| 1322 | pAddBssParams->extSetStaKeyParam.key[0].key[11], |
| 1323 | pAddBssParams->extSetStaKeyParam.key[0].key[12], |
| 1324 | pAddBssParams->extSetStaKeyParam.key[0].key[13], |
| 1325 | pAddBssParams->extSetStaKeyParam.key[0].key[14], |
| 1326 | pAddBssParams->extSetStaKeyParam.key[0].key[15]);) |
| 1327 | } |
| 1328 | |
| 1329 | return TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | } |
| 1331 | |
| 1332 | tSirRetStatus |
| 1333 | limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) |
| 1334 | { |
| 1335 | tSirMsgQ msg; |
| 1336 | tSirAggrQosReq * aggrQosReq = (tSirAggrQosReq *)pMsgBuf; |
| 1337 | tpAggrAddTsParams pAggrAddTsParam; |
| 1338 | tpPESession psessionEntry = NULL; |
| 1339 | tpLimTspecInfo tspecInfo; |
| 1340 | tANI_U8 ac; |
| 1341 | tpDphHashNode pSta; |
| 1342 | tANI_U16 aid; |
| 1343 | tANI_U8 sessionId; |
| 1344 | int i; |
| 1345 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1346 | pAggrAddTsParam = vos_mem_malloc(sizeof(tAggrAddTsParams)); |
| 1347 | if (NULL == pAggrAddTsParam) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1349 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1350 | return eSIR_MEM_ALLOC_FAILED; |
| 1351 | } |
| 1352 | |
| 1353 | psessionEntry = peFindSessionByBssid(pMac, aggrQosReq->bssId, &sessionId); |
| 1354 | |
| 1355 | if (psessionEntry == NULL) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1356 | 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] | 1357 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | return eSIR_FAILURE; |
| 1359 | } |
| 1360 | |
| 1361 | pSta = dphLookupHashEntry(pMac, aggrQosReq->bssId, &aid, &psessionEntry->dph.dphHashTable); |
| 1362 | if (pSta == NULL) |
| 1363 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1364 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));) |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1365 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1366 | return eSIR_FAILURE; |
| 1367 | } |
| 1368 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1369 | vos_mem_set((tANI_U8 *)pAggrAddTsParam, |
| 1370 | sizeof(tAggrAddTsParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1371 | pAggrAddTsParam->staIdx = psessionEntry->staId; |
| 1372 | // Fill in the sessionId specific to PE |
| 1373 | pAggrAddTsParam->sessionId = sessionId; |
| 1374 | pAggrAddTsParam->tspecIdx = aggrQosReq->aggrInfo.tspecIdx; |
| 1375 | |
| 1376 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 1377 | { |
| 1378 | if (aggrQosReq->aggrInfo.tspecIdx & (1<<i)) |
| 1379 | { |
| 1380 | tSirMacTspecIE *pTspec = &aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 1381 | /* Since AddTS response was successful, check for the PSB flag |
| 1382 | * and directional flag inside the TS Info field. |
| 1383 | * An AC is trigger enabled AC if the PSB subfield is set to 1 |
| 1384 | * in the uplink direction. |
| 1385 | * An AC is delivery enabled AC if the PSB subfield is set to 1 |
| 1386 | * in the downlink direction. |
| 1387 | * An AC is trigger and delivery enabled AC if the PSB subfield |
| 1388 | * is set to 1 in the bi-direction field. |
| 1389 | */ |
| 1390 | if (pTspec->tsinfo.traffic.psb == 1) |
| 1391 | { |
| 1392 | limSetTspecUapsdMask(pMac, &pTspec->tsinfo, SET_UAPSD_MASK); |
| 1393 | } |
| 1394 | else |
| 1395 | { |
| 1396 | limSetTspecUapsdMask(pMac, &pTspec->tsinfo, CLEAR_UAPSD_MASK); |
| 1397 | } |
| 1398 | /* ADDTS success, so AC is now admitted. We shall now use the default |
| 1399 | * EDCA parameters as advertised by AP and send the updated EDCA params |
| 1400 | * to HAL. |
| 1401 | */ |
| 1402 | ac = upToAc(pTspec->tsinfo.traffic.userPrio); |
| 1403 | if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 1404 | { |
| 1405 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 1406 | } |
| 1407 | else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 1408 | { |
| 1409 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 1410 | } |
| 1411 | else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 1412 | { |
| 1413 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 1414 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 1415 | } |
| 1416 | |
| 1417 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 1418 | |
| 1419 | if (pSta->aniPeer == eANI_BOOLEAN_TRUE) |
| 1420 | { |
| 1421 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_TRUE); |
| 1422 | } |
| 1423 | else |
| 1424 | { |
| 1425 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_FALSE); |
| 1426 | } |
| 1427 | |
| 1428 | if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, pTspec, 0, &tspecInfo)) |
| 1429 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1430 | PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1431 | pMac->lim.gLimAddtsSent = false; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1432 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1433 | return eSIR_FAILURE; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status. |
| 1434 | } |
| 1435 | |
| 1436 | // Copy the TSPEC paramters |
| 1437 | pAggrAddTsParam->tspec[i] = aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 1438 | } |
| 1439 | } |
| 1440 | |
| 1441 | msg.type = WDA_AGGR_QOS_REQ; |
| 1442 | msg.bodyptr = pAggrAddTsParam; |
| 1443 | msg.bodyval = 0; |
| 1444 | |
| 1445 | /* We need to defer any incoming messages until we get a |
| 1446 | * WDA_AGGR_QOS_RSP from HAL. |
| 1447 | */ |
| 1448 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1449 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1450 | |
| 1451 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 1452 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1453 | PELOGW(limLog(pMac, LOGW, FL("wdaPostCtrlMsg() failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1455 | vos_mem_free(pAggrAddTsParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | return eSIR_FAILURE; |
| 1457 | } |
| 1458 | |
| 1459 | return eSIR_SUCCESS; |
| 1460 | } |
| 1461 | |
| 1462 | void |
| 1463 | limFTSendAggrQosRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, |
| 1464 | tpAggrAddTsParams aggrQosRsp, tANI_U8 smesessionId) |
| 1465 | { |
| 1466 | tpSirAggrQosRsp rsp; |
| 1467 | int i = 0; |
| 1468 | |
| 1469 | if (! rspReqd) |
| 1470 | { |
| 1471 | return; |
| 1472 | } |
| 1473 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1474 | rsp = vos_mem_malloc(sizeof(tSirAggrQosRsp)); |
| 1475 | if (NULL == rsp) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1476 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1477 | limLog(pMac, LOGP, FL("AllocateMemory failed for tSirAggrQosRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1478 | return; |
| 1479 | } |
| 1480 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1481 | vos_mem_set((tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | rsp->messageType = eWNI_SME_FT_AGGR_QOS_RSP; |
| 1483 | rsp->sessionId = smesessionId; |
| 1484 | rsp->length = sizeof(*rsp); |
| 1485 | rsp->aggrInfo.tspecIdx = aggrQosRsp->tspecIdx; |
| 1486 | |
| 1487 | for( i = 0; i < SIR_QOS_NUM_AC_MAX; i++ ) |
| 1488 | { |
| 1489 | if( (1 << i) & aggrQosRsp->tspecIdx ) |
| 1490 | { |
| 1491 | rsp->aggrInfo.aggrRsp[i].status = aggrQosRsp->status[i]; |
| 1492 | rsp->aggrInfo.aggrRsp[i].tspec = aggrQosRsp->tspec[i]; |
| 1493 | } |
| 1494 | } |
| 1495 | |
| 1496 | limSendSmeAggrQosRsp(pMac, rsp, smesessionId); |
| 1497 | return; |
| 1498 | } |
| 1499 | |
| 1500 | |
| 1501 | void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1502 | { |
| 1503 | tpAggrAddTsParams pAggrQosRspMsg = NULL; |
| 1504 | //tpAggrQosParams pAggrQosRspMsg = NULL; |
| 1505 | tAddTsParams addTsParam = {0}; |
| 1506 | tpDphHashNode pSta = NULL; |
| 1507 | tANI_U16 assocId =0; |
| 1508 | tSirMacAddr peerMacAddr; |
| 1509 | tANI_U8 rspReqd = 1; |
| 1510 | tpPESession psessionEntry = NULL; |
| 1511 | int i = 0; |
| 1512 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1513 | PELOG1(limLog(pMac, LOG1, FL(" Received AGGR_QOS_RSP from HAL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | |
| 1515 | /* Need to process all the deferred messages enqueued since sending the |
| 1516 | SIR_HAL_AGGR_ADD_TS_REQ */ |
| 1517 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 1518 | |
| 1519 | pAggrQosRspMsg = (tpAggrAddTsParams) (limMsg->bodyptr); |
| 1520 | if (NULL == pAggrQosRspMsg) |
| 1521 | { |
| 1522 | PELOGE(limLog(pMac, LOGE, FL("NULL pAggrQosRspMsg"));) |
| 1523 | return; |
| 1524 | } |
| 1525 | |
| 1526 | psessionEntry = peFindSessionBySessionId(pMac, pAggrQosRspMsg->sessionId); |
| 1527 | if (NULL == psessionEntry) |
| 1528 | { |
| 1529 | // Cant find session entry |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1530 | PELOGE(limLog(pMac, LOGE, FL("Cant find session entry for %s"), __func__);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1531 | if( pAggrQosRspMsg != NULL ) |
| 1532 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1533 | vos_mem_free(pAggrQosRspMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1534 | } |
| 1535 | return; |
| 1536 | } |
| 1537 | |
| 1538 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 1539 | { |
| 1540 | if((((1 << i) & pAggrQosRspMsg->tspecIdx)) && |
| 1541 | (pAggrQosRspMsg->status[i] != eHAL_STATUS_SUCCESS)) |
| 1542 | { |
| 1543 | /* send DELTS to the station */ |
| 1544 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 1545 | |
| 1546 | addTsParam.staIdx = pAggrQosRspMsg->staIdx; |
| 1547 | addTsParam.sessionId = pAggrQosRspMsg->sessionId; |
| 1548 | addTsParam.tspec = pAggrQosRspMsg->tspec[i]; |
| 1549 | addTsParam.tspecIdx = pAggrQosRspMsg->tspecIdx; |
| 1550 | |
| 1551 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, |
| 1552 | &addTsParam.tspec.tsinfo, |
| 1553 | &addTsParam.tspec, psessionEntry); |
| 1554 | |
| 1555 | pSta = dphLookupAssocId(pMac, addTsParam.staIdx, &assocId, |
| 1556 | &psessionEntry->dph.dphHashTable); |
| 1557 | if (pSta != NULL) |
| 1558 | { |
| 1559 | limAdmitControlDeleteTS(pMac, assocId, &addTsParam.tspec.tsinfo, |
| 1560 | NULL, (tANI_U8 *)&addTsParam.tspecIdx); |
| 1561 | } |
| 1562 | } |
| 1563 | } |
| 1564 | |
| 1565 | /* Send the Aggr QoS response to SME */ |
| 1566 | |
| 1567 | limFTSendAggrQosRsp(pMac, rspReqd, pAggrQosRspMsg, |
| 1568 | psessionEntry->smeSessionId); |
| 1569 | if( pAggrQosRspMsg != NULL ) |
| 1570 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1571 | vos_mem_free(pAggrQosRspMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1572 | } |
| 1573 | return; |
| 1574 | } |
| 1575 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |