Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /* |
| 43 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 44 | * This file limProcessDeauthFrame.cc contains the code |
| 45 | * for processing Deauthentication Frame. |
| 46 | * Author: Chandra Modumudi |
| 47 | * Date: 03/24/02 |
| 48 | * History:- |
| 49 | * Date Modified by Modification Information |
| 50 | * -------------------------------------------------------------------- |
| 51 | * |
| 52 | */ |
| 53 | #include "palTypes.h" |
| 54 | #include "aniGlobal.h" |
| 55 | |
| 56 | #include "utilsApi.h" |
| 57 | #include "limTypes.h" |
| 58 | #include "limUtils.h" |
| 59 | #include "limAssocUtils.h" |
| 60 | #include "limSecurityUtils.h" |
| 61 | #include "limSerDesUtils.h" |
| 62 | #include "schApi.h" |
| 63 | #include "limSendMessages.h" |
| 64 | |
| 65 | |
| 66 | |
| 67 | /** |
| 68 | * limProcessDeauthFrame |
| 69 | * |
| 70 | *FUNCTION: |
| 71 | * This function is called by limProcessMessageQueue() upon |
| 72 | * Deauthentication frame reception. |
| 73 | * |
| 74 | *LOGIC: |
| 75 | * |
| 76 | *ASSUMPTIONS: |
| 77 | * |
| 78 | *NOTE: |
| 79 | * |
| 80 | * @param pMac - Pointer to Global MAC structure |
| 81 | * @param *pRxPacketInfo - A pointer to Buffer descriptor + associated PDUs |
| 82 | * @return None |
| 83 | */ |
| 84 | |
| 85 | void |
| 86 | limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
| 87 | { |
| 88 | tANI_U8 *pBody; |
| 89 | tANI_U16 aid, reasonCode; |
| 90 | tpSirMacMgmtHdr pHdr; |
| 91 | tLimMlmAssocCnf mlmAssocCnf; |
| 92 | tLimMlmDeauthInd mlmDeauthInd; |
| 93 | tpDphHashNode pStaDs; |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 94 | tpPESession pRoamSessionEntry=NULL; |
| 95 | tANI_U8 roamSessionId; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 96 | #ifdef WLAN_FEATURE_11W |
| 97 | tANI_U32 frameLen; |
| 98 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 99 | |
| 100 | |
| 101 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 102 | |
| 103 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 104 | |
| 105 | |
| 106 | if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState)) |
| 107 | { |
Venkata Prathyusha Kuntupalli | e567529 | 2013-04-11 17:01:17 -0700 | [diff] [blame] | 108 | MTRACE(macTrace(pMac, TRACE_CODE_INFO_LOG, 0, eLOG_PROC_DEAUTH_FRAME_SCENARIO)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | return; |
| 110 | } |
| 111 | |
| 112 | if (limIsGroupAddr(pHdr->sa)) |
| 113 | { |
| 114 | // Received Deauth frame from a BC/MC address |
| 115 | // Log error and ignore it |
| 116 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 117 | FL("received Deauth frame from a BC/MC address"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 118 | |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | if (limIsGroupAddr(pHdr->da) && !limIsAddrBC(pHdr->da)) |
| 123 | { |
| 124 | // Received Deauth frame for a MC address |
| 125 | // Log error and ignore it |
| 126 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 127 | FL("received Deauth frame for a MC address"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | |
| 129 | return; |
| 130 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 131 | |
| 132 | #ifdef WLAN_FEATURE_11W |
| 133 | /* PMF: If this session is a PMF session, then ensure that this frame was protected */ |
| 134 | if(psessionEntry->limRmfEnabled && (WDA_GET_RX_DPU_FEEDBACK(pRxPacketInfo) & DPU_FEEDBACK_UNPROTECTED_ERROR)) |
| 135 | { |
| 136 | PELOGE(limLog(pMac, LOGE, FL("received an unprotected deauth from AP"));) |
| 137 | // If the frame received is unprotected, forward it to the supplicant to initiate |
| 138 | // an SA query |
| 139 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 140 | |
| 141 | //send the unprotected frame indication to SME |
| 142 | limSendSmeUnprotectedMgmtFrameInd( pMac, pHdr->fc.subType, |
| 143 | (tANI_U8*)pHdr, (frameLen + sizeof(tSirMacMgmtHdr)), |
| 144 | psessionEntry->smeSessionId, psessionEntry); |
| 145 | return; |
| 146 | } |
| 147 | #endif |
| 148 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 149 | // Get reasonCode from Deauthentication frame body |
| 150 | reasonCode = sirReadU16(pBody); |
| 151 | |
| 152 | PELOGE(limLog(pMac, LOGE, |
| 153 | FL("received Deauth frame (mlm state = %s) with reason code %d from "), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 154 | limMlmStateStr(psessionEntry->limMlmState), reasonCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | limPrintMacAddr(pMac, pHdr->sa, LOGE);) |
| 156 | |
Madan Mohan Koyyalamudi | cd78499 | 2013-01-11 15:30:36 -0800 | [diff] [blame] | 157 | if (limCheckDisassocDeauthAckPending(pMac, (tANI_U8*)pHdr->sa)) |
| 158 | { |
| 159 | PELOGW(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 160 | FL("Ignore the Deauth received, while waiting for ack of disassoc/deauth"));) |
Madan Mohan Koyyalamudi | cd78499 | 2013-01-11 15:30:36 -0800 | [diff] [blame] | 161 | limCleanUpDisassocDeauthReq(pMac,(tANI_U8*)pHdr->sa, 1); |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE )||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 167 | { |
| 168 | switch (reasonCode) |
| 169 | { |
| 170 | case eSIR_MAC_UNSPEC_FAILURE_REASON: |
| 171 | case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON: |
| 172 | // Valid reasonCode in received Deauthentication frame |
| 173 | break; |
| 174 | |
| 175 | default: |
| 176 | // Invalid reasonCode in received Deauthentication frame |
| 177 | // Log error and ignore the frame |
| 178 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 179 | FL("received Deauth frame with invalid reasonCode %d from "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 180 | reasonCode); |
| 181 | limPrintMacAddr(pMac, pHdr->sa, LOG1);) |
| 182 | |
| 183 | break; |
| 184 | } |
| 185 | } |
| 186 | else if (psessionEntry->limSystemRole == eLIM_STA_ROLE ||psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) |
| 187 | { |
| 188 | switch (reasonCode) |
| 189 | { |
| 190 | case eSIR_MAC_UNSPEC_FAILURE_REASON: |
| 191 | case eSIR_MAC_PREV_AUTH_NOT_VALID_REASON: |
| 192 | case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON: |
| 193 | case eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON: |
| 194 | case eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON: |
| 195 | case eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON: |
| 196 | // Valid reasonCode in received Deauth frame |
| 197 | break; |
| 198 | |
| 199 | default: |
| 200 | // Invalid reasonCode in received Deauth frame |
| 201 | // Log error and ignore the frame |
| 202 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 203 | FL("received Deauth frame with invalid reasonCode %d from "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 204 | reasonCode); |
| 205 | limPrintMacAddr(pMac, pHdr->sa, LOG1);) |
| 206 | |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | else |
| 211 | { |
| 212 | // Received Deauth frame in either IBSS |
| 213 | // or un-known role. Log error and ignore it |
| 214 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 215 | FL("received Deauth frame with reasonCode %d in role %d from "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 216 | reasonCode, psessionEntry->limSystemRole); |
| 217 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
| 218 | |
| 219 | return; |
| 220 | } |
| 221 | |
| 222 | /** If we are in the middle of ReAssoc, a few things could happen: |
| 223 | * - STA is reassociating to current AP, and receives deauth from: |
| 224 | * a) current AP |
| 225 | * b) other AP |
| 226 | * - STA is reassociating to a new AP, and receives deauth from: |
| 227 | * c) current AP |
| 228 | * d) reassoc AP |
| 229 | * e) other AP |
| 230 | * |
| 231 | * The logic is: |
| 232 | * 1) If rcv deauth from an AP other than the one we're trying to |
| 233 | * reassociate with, then drop the deauth frame (case b, c, e) |
| 234 | * 2) If rcv deauth from the "new" reassoc AP (case d), then restore |
| 235 | * context with previous AP and send SME_REASSOC_RSP failure. |
| 236 | * 3) If rcv deauth from the reassoc AP, which is also the same |
| 237 | * AP we're currently associated with (case a), then proceed |
| 238 | * with normal deauth processing. |
| 239 | */ |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 240 | if ( psessionEntry->limReAssocbssId!=NULL ) |
| 241 | { |
| 242 | pRoamSessionEntry = peFindSessionByBssid(pMac, psessionEntry->limReAssocbssId, &roamSessionId); |
| 243 | } |
| 244 | if (limIsReassocInProgress(pMac,psessionEntry) || limIsReassocInProgress(pMac,pRoamSessionEntry)) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 245 | if (!IS_REASSOC_BSSID(pMac,pHdr->sa,psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 246 | PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from unknown/different AP while ReAssoc. Ignore "));) |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 247 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
| 248 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 249 | return; |
| 250 | } |
| 251 | |
| 252 | /** Received deauth from the new AP to which we tried to ReAssociate. |
| 253 | * Drop ReAssoc and Restore the Previous context( current connected AP). |
| 254 | */ |
| 255 | if (!IS_CURRENT_BSSID(pMac, pHdr->sa,psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 256 | PELOGE(limLog(pMac, LOGE, FL("received DeAuth from the New AP to which ReAssoc is sent "));) |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 257 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
| 258 | limPrintMacAddr(pMac, psessionEntry->bssId, LOGE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | limRestorePreReassocState(pMac, |
| 260 | eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry); |
| 261 | return; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | |
| 266 | /* If received DeAuth from AP other than the one we're trying to join with |
| 267 | * nor associated with, then ignore deauth and delete Pre-auth entry. |
| 268 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 269 | if(psessionEntry->limSystemRole != eLIM_AP_ROLE ){ |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 270 | if (!IS_CURRENT_BSSID(pMac, pHdr->bssId, psessionEntry)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 271 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 272 | PELOGE(limLog(pMac, LOGE, FL("received DeAuth from an AP other than we're trying to join. Ignore. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 273 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 274 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 275 | PELOGE(limLog(pMac, LOGE, FL("Preauth entry exist. Deleting... "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 276 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 277 | } |
| 278 | return; |
| 279 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 281 | |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 282 | pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | // Check for pre-assoc states |
| 285 | switch (psessionEntry->limSystemRole) |
| 286 | { |
| 287 | case eLIM_STA_ROLE: |
| 288 | case eLIM_BT_AMP_STA_ROLE: |
| 289 | switch (psessionEntry->limMlmState) |
| 290 | { |
| 291 | case eLIM_MLM_WT_AUTH_FRAME2_STATE: |
| 292 | /** |
| 293 | * AP sent Deauth frame while waiting |
| 294 | * for Auth frame2. Report Auth failure |
| 295 | * to SME. |
| 296 | */ |
| 297 | |
| 298 | // Log error |
| 299 | PELOG1(limLog(pMac, LOG1, |
| 300 | FL("received Deauth frame with failure code %d from "), |
| 301 | reasonCode); |
| 302 | limPrintMacAddr(pMac, pHdr->sa, LOG1);) |
| 303 | |
| 304 | limRestoreFromAuthState(pMac, eSIR_SME_DEAUTH_WHILE_JOIN, |
| 305 | reasonCode,psessionEntry); |
| 306 | |
| 307 | return; |
| 308 | |
| 309 | case eLIM_MLM_AUTHENTICATED_STATE: |
| 310 | /// Issue Deauth Indication to SME. |
| 311 | palCopyMemory( pMac->hHdd, |
| 312 | (tANI_U8 *) &mlmDeauthInd.peerMacAddr, |
| 313 | pHdr->sa, |
| 314 | sizeof(tSirMacAddr)); |
| 315 | mlmDeauthInd.reasonCode = reasonCode; |
| 316 | |
| 317 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 318 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 319 | |
| 320 | |
| 321 | limPostSmeMessage(pMac, |
| 322 | LIM_MLM_DEAUTH_IND, |
| 323 | (tANI_U32 *) &mlmDeauthInd); |
| 324 | return; |
| 325 | |
| 326 | case eLIM_MLM_WT_ASSOC_RSP_STATE: |
| 327 | /** |
| 328 | * AP may have 'aged-out' our Pre-auth |
| 329 | * context. Delete local pre-auth context |
| 330 | * if any and issue ASSOC_CNF to SME. |
| 331 | */ |
| 332 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 333 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 334 | |
| 335 | if (psessionEntry->pLimMlmJoinReq) |
| 336 | { |
| 337 | palFreeMemory( pMac->hHdd, psessionEntry->pLimMlmJoinReq); |
| 338 | psessionEntry->pLimMlmJoinReq = NULL; |
| 339 | } |
| 340 | |
| 341 | mlmAssocCnf.resultCode = eSIR_SME_DEAUTH_WHILE_JOIN; |
| 342 | mlmAssocCnf.protStatusCode = reasonCode; |
| 343 | |
| 344 | /* PE session Id*/ |
| 345 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 346 | |
| 347 | psessionEntry->limMlmState = |
| 348 | psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 349 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 350 | |
| 351 | // Deactive Association response timeout |
| 352 | limDeactivateAndChangeTimer( |
| 353 | pMac, |
| 354 | eLIM_ASSOC_FAIL_TIMER); |
| 355 | |
| 356 | limPostSmeMessage( |
| 357 | pMac, |
| 358 | LIM_MLM_ASSOC_CNF, |
| 359 | (tANI_U32 *) &mlmAssocCnf); |
| 360 | |
| 361 | return; |
| 362 | |
| 363 | case eLIM_MLM_IDLE_STATE: |
| 364 | case eLIM_MLM_LINK_ESTABLISHED_STATE: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 365 | #ifdef FEATURE_WLAN_TDLS |
| 366 | if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 367 | { |
| 368 | PELOGE(limLog(pMac, LOGE, |
| 369 | FL("received Deauth frame with reason code %d from Tdls peer"), |
| 370 | reasonCode); |
| 371 | limPrintMacAddr(pMac, pHdr->sa, LOGE);) |
| 372 | limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry, |
| 373 | reasonCode); |
| 374 | return; |
| 375 | } |
| 376 | else |
| 377 | { |
Gopichand Nakkala | 78a6c81 | 2013-05-13 16:39:49 +0530 | [diff] [blame^] | 378 | #ifdef FEATURE_WLAN_TDLS_OXYGEN_DISAPPEAR_AP |
| 379 | if ((TRUE == pMac->lim.gLimTDLSOxygenSupport) && |
| 380 | (limGetTDLSPeerCount(pMac, psessionEntry) != 0)) { |
| 381 | limTDLSDisappearAPTrickInd(pMac, pStaDs, psessionEntry); |
| 382 | return; |
| 383 | } |
| 384 | #endif |
| 385 | |
| 386 | limDeleteTDLSPeers(pMac, psessionEntry); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 387 | #endif |
| 388 | /** |
| 389 | * This could be Deauthentication frame from |
| 390 | * a BSS with which pre-authentication was |
| 391 | * performed. Delete Pre-auth entry if found. |
| 392 | */ |
| 393 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 394 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 395 | #ifdef FEATURE_WLAN_TDLS |
| 396 | } |
| 397 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | break; |
| 399 | |
| 400 | case eLIM_MLM_WT_REASSOC_RSP_STATE: |
| 401 | break; |
| 402 | |
| 403 | case eLIM_MLM_WT_FT_REASSOC_RSP_STATE: |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 404 | PELOGE(limLog(pMac, LOGE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 405 | FL("received Deauth frame in FT state %X with reasonCode=%d from "), |
| 406 | psessionEntry->limMlmState, reasonCode);) |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 407 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | break; |
| 409 | |
| 410 | default: |
| 411 | PELOG1(limLog(pMac, LOG1, |
| 412 | FL("received Deauth frame in state %X with reasonCode=%d from "), |
| 413 | psessionEntry->limMlmState, reasonCode);) |
| 414 | limPrintMacAddr(pMac, pHdr->sa, LOG1); |
| 415 | return; |
| 416 | } |
| 417 | break; |
| 418 | |
| 419 | case eLIM_STA_IN_IBSS_ROLE: |
| 420 | break; |
| 421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 422 | case eLIM_AP_ROLE: |
| 423 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | |
| 425 | default: // eLIM_AP_ROLE or eLIM_BT_AMP_AP_ROLE |
| 426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 427 | |
| 428 | return; |
| 429 | } // end switch (pMac->lim.gLimSystemRole) |
| 430 | |
| 431 | |
| 432 | |
| 433 | /** |
| 434 | * Extract 'associated' context for STA, if any. |
| 435 | * This is maintained by DPH and created by LIM. |
| 436 | */ |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 437 | if (NULL == pStaDs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 438 | return; |
| 439 | |
| 440 | |
| 441 | if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || |
| 442 | (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)) |
| 443 | { |
| 444 | /** |
| 445 | * Already in the process of deleting context for the peer |
| 446 | * and received Deauthentication frame. Log and Ignore. |
| 447 | */ |
| 448 | PELOG1(limLog(pMac, LOG1, |
| 449 | FL("received Deauth frame from peer that is in state %X, addr "), |
| 450 | pStaDs->mlmStaContext.mlmState); |
| 451 | limPrintMacAddr(pMac, pHdr->sa, LOG1);) |
| 452 | return; |
| 453 | } |
| 454 | pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes)reasonCode; |
| 455 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DEAUTH; |
| 456 | |
| 457 | /// Issue Deauth Indication to SME. |
| 458 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmDeauthInd.peerMacAddr, |
| 459 | pStaDs->staAddr, |
| 460 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 461 | mlmDeauthInd.reasonCode = (tANI_U8) pStaDs->mlmStaContext.disassocReason; |
| 462 | mlmDeauthInd.deauthTrigger = eLIM_PEER_ENTITY_DEAUTH; |
| 463 | |
| 464 | |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 465 | /* |
| 466 | * If we're in the middle of ReAssoc and received deauth from |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 467 | * the ReAssoc AP, then notify SME by sending REASSOC_RSP with |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 468 | * failure result code. SME will post the disconnect to the |
| 469 | * supplicant and the latter would start a fresh assoc. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 470 | */ |
| 471 | if (limIsReassocInProgress(pMac,psessionEntry)) { |
| 472 | /** |
| 473 | * AP may have 'aged-out' our Pre-auth |
| 474 | * context. Delete local pre-auth context |
| 475 | * if any and issue REASSOC_CNF to SME. |
| 476 | */ |
| 477 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 478 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 479 | |
| 480 | if (psessionEntry->limAssocResponseData) { |
| 481 | palFreeMemory(pMac->hHdd, psessionEntry->limAssocResponseData); |
| 482 | psessionEntry->limAssocResponseData = NULL; |
| 483 | } |
| 484 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 485 | PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from ReAssoc AP. Issue REASSOC_CNF. "));) |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 486 | /* |
| 487 | * TODO: Instead of overloading eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE |
| 488 | * it would have been good to define/use a different failure type. |
| 489 | * Using eSIR_SME_FT_REASSOC_FAILURE does not seem to clean-up |
| 490 | * properly and we end up seeing "transmit queue timeout". |
| 491 | */ |
| 492 | limPostReassocFailure(pMac, eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE, |
| 493 | eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 494 | return; |
| 495 | } |
| 496 | |
| 497 | /// Deauthentication from peer MAC entity |
| 498 | limPostSmeMessage(pMac, LIM_MLM_DEAUTH_IND, (tANI_U32 *) &mlmDeauthInd); |
| 499 | |
| 500 | // send eWNI_SME_DEAUTH_IND to SME |
| 501 | limSendSmeDeauthInd(pMac, pStaDs, psessionEntry); |
| 502 | return; |
| 503 | |
| 504 | } /*** end limProcessDeauthFrame() ***/ |
| 505 | |