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