Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 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 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limProcessDisassocFrame.cc contains the code |
| 30 | * for processing Disassocation Frame. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 03/24/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * |
| 37 | */ |
| 38 | #include "palTypes.h" |
| 39 | #include "wniApi.h" |
| 40 | #include "sirApi.h" |
| 41 | #include "aniGlobal.h" |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 42 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | |
| 44 | #include "utilsApi.h" |
| 45 | #include "limTypes.h" |
| 46 | #include "limUtils.h" |
| 47 | #include "limAssocUtils.h" |
| 48 | #include "limSecurityUtils.h" |
| 49 | #include "limSerDesUtils.h" |
| 50 | #include "limSendMessages.h" |
| 51 | #include "schApi.h" |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 52 | #ifdef WLAN_FEATURE_LFR_MBB |
| 53 | #include "lim_mbb.h" |
| 54 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | |
| 56 | |
| 57 | /** |
| 58 | * limProcessDisassocFrame |
| 59 | * |
| 60 | *FUNCTION: |
| 61 | * This function is called by limProcessMessageQueue() upon |
| 62 | * Disassociation frame reception. |
| 63 | * |
| 64 | *LOGIC: |
| 65 | * |
| 66 | *ASSUMPTIONS: |
| 67 | * DPH drops packets for STA with 'valid' bit in pStaDs set to '0'. |
| 68 | * |
| 69 | *NOTE: |
| 70 | * |
| 71 | * @param pMac - Pointer to Global MAC structure |
| 72 | * @param *pRxPacketInfo - A pointer to Rx packet info structure |
| 73 | * @return None |
| 74 | */ |
| 75 | void |
| 76 | limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
| 77 | { |
| 78 | tANI_U8 *pBody; |
| 79 | tANI_U16 aid, reasonCode; |
| 80 | tpSirMacMgmtHdr pHdr; |
| 81 | tpDphHashNode pStaDs; |
| 82 | tLimMlmDisassocInd mlmDisassocInd; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 83 | #ifdef WLAN_FEATURE_11W |
| 84 | tANI_U32 frameLen; |
| 85 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 86 | |
| 87 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 88 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 89 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 90 | if (limIsGroupAddr(pHdr->sa)) |
| 91 | { |
| 92 | // Received Disassoc frame from a BC/MC address |
| 93 | // Log error and ignore it |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 94 | PELOGE(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 95 | FL("received Disassoc frame from a BC/MC address"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 96 | |
| 97 | return; |
| 98 | } |
| 99 | |
| 100 | if (limIsGroupAddr(pHdr->da) && !limIsAddrBC(pHdr->da)) |
| 101 | { |
| 102 | // Received Disassoc frame for a MC address |
| 103 | // Log error and ignore it |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 104 | PELOGE(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 105 | FL("received Disassoc frame for a MC address"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 106 | |
| 107 | return; |
| 108 | } |
| 109 | |
Hanumanth Reddy Pothula | f4b4499 | 2017-11-23 15:26:28 +0530 | [diff] [blame] | 110 | if (LIM_IS_STA_ROLE(psessionEntry) && |
| 111 | ((eLIM_SME_WT_DISASSOC_STATE == psessionEntry->limSmeState) || |
| 112 | (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState))) { |
| 113 | PELOGE(limLog(pMac, LOG1, |
| 114 | FL("recevied disaasoc frame in %d limsmestate... droping this"), |
| 115 | psessionEntry->limSmeState);) |
| 116 | return; |
| 117 | } |
| 118 | |
| 119 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 120 | #ifdef WLAN_FEATURE_11W |
| 121 | /* PMF: If this session is a PMF session, then ensure that this frame was protected */ |
| 122 | if(psessionEntry->limRmfEnabled && (WDA_GET_RX_DPU_FEEDBACK(pRxPacketInfo) & DPU_FEEDBACK_UNPROTECTED_ERROR)) |
| 123 | { |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 124 | PELOGE(limLog(pMac, LOG1, FL("received an unprotected disassoc from AP"));) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 125 | // If the frame received is unprotected, forward it to the supplicant to initiate |
| 126 | // an SA query |
| 127 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 128 | //send the unprotected frame indication to SME |
| 129 | limSendSmeUnprotectedMgmtFrameInd( pMac, pHdr->fc.subType, |
| 130 | (tANI_U8*)pHdr, (frameLen + sizeof(tSirMacMgmtHdr)), |
| 131 | psessionEntry->smeSessionId, psessionEntry); |
| 132 | return; |
| 133 | } |
| 134 | #endif |
| 135 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 136 | // Get reasonCode from Disassociation frame body |
| 137 | reasonCode = sirReadU16(pBody); |
| 138 | |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 139 | limLog(pMac, LOGE, |
| 140 | FL("Received Disassoc frame for Addr: "MAC_ADDRESS_STR |
| 141 | "(mlm state=%s, sme state=%d)," |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 142 | "with reason code %d from "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da), |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 143 | limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, |
| 144 | reasonCode, MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 145 | |
| 146 | /** |
| 147 | * Extract 'associated' context for STA, if any. |
| 148 | * This is maintained by DPH and created by LIM. |
| 149 | */ |
| 150 | pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 151 | |
| 152 | if (pStaDs == NULL) |
| 153 | { |
| 154 | /** |
| 155 | * Disassociating STA is not associated. |
| 156 | * Log error. |
| 157 | */ |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 158 | PELOGE(limLog(pMac, LOG1, |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 159 | FL("received Disassoc frame from STA that does not have context " |
| 160 | "reasonCode=%d, addr "MAC_ADDRESS_STR), |
| 161 | reasonCode,MAC_ADDR_ARRAY(pHdr->sa));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 162 | |
| 163 | return; |
| 164 | } |
| 165 | |
Madan Mohan Koyyalamudi | 25b6f8b | 2012-12-04 16:17:31 -0800 | [diff] [blame] | 166 | if (limCheckDisassocDeauthAckPending(pMac, (tANI_U8*)pHdr->sa)) |
| 167 | { |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 168 | PELOGE(limLog(pMac, LOG1, |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 169 | FL("Ignore the DisAssoc received, while waiting " |
| 170 | "for ack of disassoc/deauth"));) |
Madan Mohan Koyyalamudi | 25b6f8b | 2012-12-04 16:17:31 -0800 | [diff] [blame] | 171 | limCleanUpDisassocDeauthReq(pMac,(tANI_U8*)pHdr->sa, 1); |
| 172 | return; |
| 173 | } |
| 174 | |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 175 | #ifdef WLAN_FEATURE_LFR_MBB |
| 176 | if (lim_is_mbb_reassoc_in_progress(pMac, psessionEntry)) { |
| 177 | limLog(pMac, LOGE, FL("Ignore Disassoc frame as LFR MBB in progress")); |
| 178 | return; |
| 179 | } |
| 180 | #endif |
| 181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 182 | /** If we are in the Wait for ReAssoc Rsp state */ |
| 183 | if (limIsReassocInProgress(pMac,psessionEntry)) { |
| 184 | /** If we had received the DisAssoc from, |
| 185 | * a. the Current AP during ReAssociate to different AP in same ESS |
| 186 | * b. Unknown AP |
| 187 | * drop/ignore the DisAssoc received |
| 188 | */ |
| 189 | if (!IS_REASSOC_BSSID(pMac,pHdr->sa,psessionEntry)) { |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 190 | PELOGE(limLog(pMac, LOGE, FL("Ignore the DisAssoc received, while " |
| 191 | "Processing ReAssoc with different/unknown AP"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 192 | return; |
| 193 | } |
| 194 | /** If the Disassoc is received from the new AP to which we tried to ReAssociate |
| 195 | * Drop ReAssoc and Restore the Previous context( current connected AP). |
| 196 | */ |
| 197 | if (!IS_CURRENT_BSSID(pMac, pHdr->sa,psessionEntry)) { |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 198 | PELOGE(limLog(pMac, LOGE, FL("received Disassoc from the New AP to " |
| 199 | "which ReAssoc is sent "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 200 | limRestorePreReassocState(pMac, |
| 201 | eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry); |
| 202 | return; |
| 203 | } |
| 204 | } |
| 205 | |
gaurank kathpalia | 524f273 | 2019-04-04 14:32:19 +0530 | [diff] [blame^] | 206 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) && |
| 207 | psessionEntry->limMlmState == eLIM_MLM_WT_ADD_STA_RSP_STATE) { |
| 208 | PELOGE(limLog(pMac, LOGE, FL("received Disassoc from the AP in" |
| 209 | "add sta response state, disconnecting"));) |
| 210 | psessionEntry->fDeauthReceived = true; |
| 211 | return; |
| 212 | } |
| 213 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 214 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 215 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 216 | { |
| 217 | switch (reasonCode) |
| 218 | { |
| 219 | case eSIR_MAC_UNSPEC_FAILURE_REASON: |
| 220 | case eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON: |
| 221 | case eSIR_MAC_DISASSOC_LEAVING_BSS_REASON: |
| 222 | case eSIR_MAC_MIC_FAILURE_REASON: |
| 223 | case eSIR_MAC_4WAY_HANDSHAKE_TIMEOUT_REASON: |
| 224 | case eSIR_MAC_GR_KEY_UPDATE_TIMEOUT_REASON: |
| 225 | case eSIR_MAC_RSN_IE_MISMATCH_REASON: |
| 226 | case eSIR_MAC_1X_AUTH_FAILURE_REASON: |
| 227 | // Valid reasonCode in received Disassociation frame |
| 228 | break; |
| 229 | |
| 230 | default: |
| 231 | // Invalid reasonCode in received Disassociation frame |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 232 | PELOGE(limLog(pMac, LOGE, |
| 233 | FL("received Disassoc frame with invalid reasonCode " |
| 234 | "%d from "MAC_ADDRESS_STR), |
| 235 | reasonCode, MAC_ADDR_ARRAY(pHdr->sa));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 236 | break; |
| 237 | } |
| 238 | } |
| 239 | else if ( ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || |
| 240 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && |
| 241 | ((psessionEntry->limSmeState != eLIM_SME_WT_JOIN_STATE) && |
| 242 | (psessionEntry->limSmeState != eLIM_SME_WT_AUTH_STATE) && |
| 243 | (psessionEntry->limSmeState != eLIM_SME_WT_ASSOC_STATE) && |
| 244 | (psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE) )) |
| 245 | { |
| 246 | switch (reasonCode) |
| 247 | { |
| 248 | case eSIR_MAC_UNSPEC_FAILURE_REASON: |
| 249 | case eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON: |
| 250 | case eSIR_MAC_DISASSOC_DUE_TO_DISABILITY_REASON: |
| 251 | case eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON: |
| 252 | case eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON: |
| 253 | case eSIR_MAC_MIC_FAILURE_REASON: |
| 254 | case eSIR_MAC_4WAY_HANDSHAKE_TIMEOUT_REASON: |
| 255 | case eSIR_MAC_GR_KEY_UPDATE_TIMEOUT_REASON: |
| 256 | case eSIR_MAC_RSN_IE_MISMATCH_REASON: |
| 257 | case eSIR_MAC_1X_AUTH_FAILURE_REASON: |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 258 | case eSIR_MAC_PREV_AUTH_NOT_VALID_REASON: |
Sreelakshmi Konamki | 3c58950 | 2016-07-21 11:14:53 +0530 | [diff] [blame] | 259 | case eSIR_MAC_PEER_REJECT_MECHANISIM_REASON: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 260 | // Valid reasonCode in received Disassociation frame |
| 261 | break; |
| 262 | |
Srinivas Girigowda | c03c5a8 | 2013-07-01 13:44:54 -0700 | [diff] [blame] | 263 | case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 264 | case eSIR_MAC_DISASSOC_LEAVING_BSS_REASON: |
| 265 | // Valid reasonCode in received Disassociation frame |
| 266 | // as long as we're not about to channel switch |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 267 | if(psessionEntry->gLimChannelSwitch.state != eLIM_CHANNEL_SWITCH_IDLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 268 | { |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 269 | limLog(pMac, LOGE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | FL("Ignoring disassoc frame due to upcoming " |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 271 | "channel switch, from "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | return; |
| 273 | } |
| 274 | break; |
| 275 | |
| 276 | default: |
| 277 | // Invalid reasonCode in received Disassociation frame |
| 278 | // Log error and ignore the frame |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 279 | PELOGE(limLog(pMac, LOGE, |
| 280 | FL("received Disassoc frame with invalid reasonCode " |
| 281 | "%d from "MAC_ADDRESS_STR), reasonCode, |
| 282 | MAC_ADDR_ARRAY(pHdr->sa));) |
Sreelakshmi Konamki | 3c58950 | 2016-07-21 11:14:53 +0530 | [diff] [blame] | 283 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | } |
| 285 | } |
| 286 | else |
| 287 | { |
| 288 | // Received Disassociation frame in either IBSS |
Srinivas Girigowda | c03c5a8 | 2013-07-01 13:44:54 -0700 | [diff] [blame] | 289 | // or un-known role. Log and ignore it |
Kaushik, Sushant | 2c823f9 | 2014-07-18 16:47:48 +0530 | [diff] [blame] | 290 | limLog(pMac, LOG1, |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 291 | FL("received Disassoc frame with invalid reasonCode %d in role " |
| 292 | "%d in sme state %d from "MAC_ADDRESS_STR), reasonCode, |
| 293 | psessionEntry->limSystemRole, psessionEntry->limSmeState, |
| 294 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 295 | |
| 296 | return; |
| 297 | } |
| 298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || |
Sushant Kaushik | efe08fa | 2015-07-06 14:54:09 +0530 | [diff] [blame] | 300 | (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 301 | { |
| 302 | /** |
| 303 | * Already in the process of deleting context for the peer |
| 304 | * and received Disassociation frame. Log and Ignore. |
| 305 | */ |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 306 | PELOGE(limLog(pMac, LOGE, |
Sachin Ahuja | 60a5061 | 2015-04-20 17:55:08 +0530 | [diff] [blame] | 307 | FL("received Disassoc frame in state %d from "MAC_ADDRESS_STR |
| 308 | ",isDisassocDeauthInProgress : %d\n"), |
| 309 | pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa), |
| 310 | pStaDs->isDisassocDeauthInProgress);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 311 | |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 316 | { |
| 317 | /** |
| 318 | * Requesting STA is in some 'transient' state? |
| 319 | * Log error. |
| 320 | */ |
Abhishek Singh | 50f7b42 | 2014-05-05 12:19:03 +0530 | [diff] [blame] | 321 | if (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_ASSOC_CNF_STATE) |
| 322 | pStaDs->mlmStaContext.updateContext = 1; |
| 323 | |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 324 | PELOGE(limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 325 | FL("received Disassoc frame from peer that is in state %d, addr " |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 326 | MAC_ADDRESS_STR), |
| 327 | pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa));) |
Abhishek Singh | 50f7b42 | 2014-05-05 12:19:03 +0530 | [diff] [blame] | 328 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | } // if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 330 | |
| 331 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DISASSOC; |
| 332 | pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes) reasonCode; |
| 333 | |
| 334 | // Issue Disassoc Indication to SME. |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 335 | vos_mem_copy((tANI_U8 *) &mlmDisassocInd.peerMacAddr, |
| 336 | (tANI_U8 *) pStaDs->staAddr, |
| 337 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 338 | mlmDisassocInd.reasonCode = |
| 339 | (tANI_U8) pStaDs->mlmStaContext.disassocReason; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 340 | mlmDisassocInd.disassocTrigger = eLIM_PEER_ENTITY_DISASSOC; |
| 341 | |
| 342 | /* Update PE session Id */ |
| 343 | mlmDisassocInd.sessionId = psessionEntry->peSessionId; |
| 344 | |
| 345 | if (limIsReassocInProgress(pMac,psessionEntry)) { |
| 346 | |
| 347 | /* If we're in the middle of ReAssoc and received disassoc from |
| 348 | * the ReAssoc AP, then notify SME by sending REASSOC_RSP with |
| 349 | * failure result code. By design, SME will then issue "Disassoc" |
| 350 | * and cleanup will happen at that time. |
| 351 | */ |
Abhishek Singh | 6f9d2c8 | 2013-12-24 15:29:53 +0530 | [diff] [blame] | 352 | PELOGE(limLog(pMac, LOGE, FL("received Disassoc from AP while waiting " |
| 353 | "for Reassoc Rsp"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 354 | |
| 355 | if (psessionEntry->limAssocResponseData) { |
Hema Aparna Medicharla | eef78fc | 2013-07-12 11:47:01 +0530 | [diff] [blame] | 356 | vos_mem_free(psessionEntry->limAssocResponseData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | psessionEntry->limAssocResponseData = NULL; |
| 358 | } |
| 359 | |
| 360 | limRestorePreReassocState(pMac,eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry); |
| 361 | return; |
| 362 | } |
Sachin Ahuja | 3d47fcd | 2015-08-28 16:02:06 +0530 | [diff] [blame] | 363 | limUpdateLostLinkParams(pMac, psessionEntry, pRxPacketInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 364 | limPostSmeMessage(pMac, LIM_MLM_DISASSOC_IND, |
| 365 | (tANI_U32 *) &mlmDisassocInd); |
| 366 | |
| 367 | |
| 368 | // send eWNI_SME_DISASSOC_IND to SME |
| 369 | limSendSmeDisassocInd(pMac, pStaDs,psessionEntry); |
| 370 | |
| 371 | return; |
| 372 | } /*** end limProcessDisassocFrame() ***/ |
| 373 | |