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