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