blob: 73776657a9487e5e9b18219f77539ab845c4c329 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kanchanapally, Vidyullathaf9426e52013-12-24 17:28:54 +05302 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
Srinivas Girigowdac03c5a82013-07-01 13:44:54 -07003 *
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*/
Jeff Johnson295189b2012-06-20 16:38:30 -070021#include "palTypes.h"
22#include "aniGlobal.h"
23
24#include "utilsApi.h"
25#include "limTypes.h"
26#include "limUtils.h"
27#include "limAssocUtils.h"
28#include "limSecurityUtils.h"
29#include "limSerDesUtils.h"
30#include "schApi.h"
31#include "limSendMessages.h"
32
33
34
35/**
36 * limProcessDeauthFrame
37 *
38 *FUNCTION:
39 * This function is called by limProcessMessageQueue() upon
40 * Deauthentication frame reception.
41 *
42 *LOGIC:
43 *
44 *ASSUMPTIONS:
45 *
46 *NOTE:
47 *
48 * @param pMac - Pointer to Global MAC structure
49 * @param *pRxPacketInfo - A pointer to Buffer descriptor + associated PDUs
50 * @return None
51 */
52
53void
54limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
55{
56 tANI_U8 *pBody;
57 tANI_U16 aid, reasonCode;
58 tpSirMacMgmtHdr pHdr;
59 tLimMlmAssocCnf mlmAssocCnf;
60 tLimMlmDeauthInd mlmDeauthInd;
61 tpDphHashNode pStaDs;
Dhanashri Atreaf3e84d2013-01-18 18:03:06 -080062 tpPESession pRoamSessionEntry=NULL;
63 tANI_U8 roamSessionId;
Chet Lanctot186b5732013-03-18 10:26:30 -070064#ifdef WLAN_FEATURE_11W
65 tANI_U32 frameLen;
66#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070067
68
69 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
70
71 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
72
73
74 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState))
75 {
Madan Mohan Koyyalamudi69c94a12013-07-10 16:34:45 +053076 /*Every 15th deauth frame will be logged in kmsg*/
Venkata Prathyusha Kuntupalli22ba5982013-04-24 13:09:20 -070077 if(!(pMac->lim.deauthMsgCnt & 0xF))
78 {
79 PELOGE(limLog(pMac, LOGE,
Madan Mohan Koyyalamudi69c94a12013-07-10 16:34:45 +053080 FL("received Deauth frame in DEAUTH_WT_STATE"
81 "(already processing previously received DEAUTH frame).."
82 "Dropping this.. Deauth Failed %d \n "),++pMac->lim.deauthMsgCnt);)
Venkata Prathyusha Kuntupalli22ba5982013-04-24 13:09:20 -070083 }
84 else
85 {
86 pMac->lim.deauthMsgCnt++;
87 }
Madan Mohan Koyyalamudi69c94a12013-07-10 16:34:45 +053088 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070089 }
90
91 if (limIsGroupAddr(pHdr->sa))
92 {
93 // Received Deauth frame from a BC/MC address
94 // Log error and ignore it
95 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -070096 FL("received Deauth frame from a BC/MC address"));)
Jeff Johnson295189b2012-06-20 16:38:30 -070097
98 return;
99 }
100
101 if (limIsGroupAddr(pHdr->da) && !limIsAddrBC(pHdr->da))
102 {
103 // Received Deauth frame for a MC address
104 // Log error and ignore it
105 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700106 FL("received Deauth frame for a MC address"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700107
108 return;
109 }
Chet Lanctot186b5732013-03-18 10:26:30 -0700110
111#ifdef WLAN_FEATURE_11W
112 /* PMF: If this session is a PMF session, then ensure that this frame was protected */
113 if(psessionEntry->limRmfEnabled && (WDA_GET_RX_DPU_FEEDBACK(pRxPacketInfo) & DPU_FEEDBACK_UNPROTECTED_ERROR))
114 {
115 PELOGE(limLog(pMac, LOGE, FL("received an unprotected deauth from AP"));)
116 // If the frame received is unprotected, forward it to the supplicant to initiate
117 // an SA query
118 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
119
120 //send the unprotected frame indication to SME
121 limSendSmeUnprotectedMgmtFrameInd( pMac, pHdr->fc.subType,
122 (tANI_U8*)pHdr, (frameLen + sizeof(tSirMacMgmtHdr)),
123 psessionEntry->smeSessionId, psessionEntry);
124 return;
125 }
126#endif
127
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 // Get reasonCode from Deauthentication frame body
129 reasonCode = sirReadU16(pBody);
130
131 PELOGE(limLog(pMac, LOGE,
Kanchanapally, Vidyullathaf9426e52013-12-24 17:28:54 +0530132 FL("Received Deauth frame for Addr: "MAC_ADDRESS_STR" (mlm state = %s, sme state = %d)"
133 "with reason code %d from "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
134 limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, reasonCode,
135 MAC_ADDR_ARRAY(pHdr->sa));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700136
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -0800137 if (limCheckDisassocDeauthAckPending(pMac, (tANI_U8*)pHdr->sa))
138 {
Srinivas Girigowdac03c5a82013-07-01 13:44:54 -0700139 PELOGW(limLog(pMac, LOGW,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700140 FL("Ignore the Deauth received, while waiting for ack of disassoc/deauth"));)
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -0800141 limCleanUpDisassocDeauthReq(pMac,(tANI_U8*)pHdr->sa, 1);
142 return;
143 }
144
145
Jeff Johnson295189b2012-06-20 16:38:30 -0700146 if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE )||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) )
147 {
148 switch (reasonCode)
149 {
150 case eSIR_MAC_UNSPEC_FAILURE_REASON:
151 case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON:
152 // Valid reasonCode in received Deauthentication frame
153 break;
154
155 default:
156 // Invalid reasonCode in received Deauthentication frame
157 // Log error and ignore the frame
158 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700159 FL("received Deauth frame with invalid reasonCode %d from "),
Jeff Johnson295189b2012-06-20 16:38:30 -0700160 reasonCode);
161 limPrintMacAddr(pMac, pHdr->sa, LOG1);)
162
163 break;
164 }
165 }
166 else if (psessionEntry->limSystemRole == eLIM_STA_ROLE ||psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)
167 {
168 switch (reasonCode)
169 {
170 case eSIR_MAC_UNSPEC_FAILURE_REASON:
171 case eSIR_MAC_PREV_AUTH_NOT_VALID_REASON:
172 case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON:
173 case eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON:
174 case eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON:
175 case eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON:
176 // Valid reasonCode in received Deauth frame
177 break;
178
179 default:
180 // Invalid reasonCode in received Deauth frame
181 // Log error and ignore the frame
182 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700183 FL("received Deauth frame with invalid reasonCode %d from "),
Jeff Johnson295189b2012-06-20 16:38:30 -0700184 reasonCode);
185 limPrintMacAddr(pMac, pHdr->sa, LOG1);)
186
187 break;
188 }
189 }
190 else
191 {
192 // Received Deauth frame in either IBSS
Srinivas Girigowdac03c5a82013-07-01 13:44:54 -0700193 // or un-known role. Log and ignore it
194 limLog(pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700195 FL("received Deauth frame with reasonCode %d in role %d from "),
Jeff Johnson295189b2012-06-20 16:38:30 -0700196 reasonCode, psessionEntry->limSystemRole);
Srinivas Girigowdac03c5a82013-07-01 13:44:54 -0700197 limPrintMacAddr(pMac, pHdr->sa, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700198
199 return;
200 }
201
202 /** If we are in the middle of ReAssoc, a few things could happen:
203 * - STA is reassociating to current AP, and receives deauth from:
204 * a) current AP
205 * b) other AP
206 * - STA is reassociating to a new AP, and receives deauth from:
207 * c) current AP
208 * d) reassoc AP
209 * e) other AP
210 *
211 * The logic is:
212 * 1) If rcv deauth from an AP other than the one we're trying to
213 * reassociate with, then drop the deauth frame (case b, c, e)
214 * 2) If rcv deauth from the "new" reassoc AP (case d), then restore
215 * context with previous AP and send SME_REASSOC_RSP failure.
216 * 3) If rcv deauth from the reassoc AP, which is also the same
217 * AP we're currently associated with (case a), then proceed
218 * with normal deauth processing.
219 */
Dhanashri Atreaf3e84d2013-01-18 18:03:06 -0800220 if ( psessionEntry->limReAssocbssId!=NULL )
221 {
222 pRoamSessionEntry = peFindSessionByBssid(pMac, psessionEntry->limReAssocbssId, &roamSessionId);
223 }
224 if (limIsReassocInProgress(pMac,psessionEntry) || limIsReassocInProgress(pMac,pRoamSessionEntry)) {
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 if (!IS_REASSOC_BSSID(pMac,pHdr->sa,psessionEntry)) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700226 PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from unknown/different AP while ReAssoc. Ignore "));)
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700227 limPrintMacAddr(pMac, pHdr->sa, LOGE);
228 limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700229 return;
230 }
231
232 /** Received deauth from the new AP to which we tried to ReAssociate.
233 * Drop ReAssoc and Restore the Previous context( current connected AP).
234 */
235 if (!IS_CURRENT_BSSID(pMac, pHdr->sa,psessionEntry)) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700236 PELOGE(limLog(pMac, LOGE, FL("received DeAuth from the New AP to which ReAssoc is sent "));)
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700237 limPrintMacAddr(pMac, pHdr->sa, LOGE);
238 limPrintMacAddr(pMac, psessionEntry->bssId, LOGE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700239 limRestorePreReassocState(pMac,
240 eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry);
241 return;
242 }
243 }
244
245
246 /* If received DeAuth from AP other than the one we're trying to join with
247 * nor associated with, then ignore deauth and delete Pre-auth entry.
248 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700249 if(psessionEntry->limSystemRole != eLIM_AP_ROLE ){
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800250 if (!IS_CURRENT_BSSID(pMac, pHdr->bssId, psessionEntry))
Jeff Johnson295189b2012-06-20 16:38:30 -0700251 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700252 PELOGE(limLog(pMac, LOGE, FL("received DeAuth from an AP other than we're trying to join. Ignore. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700253 if (limSearchPreAuthList(pMac, pHdr->sa))
254 {
Srinivas Girigowdac03c5a82013-07-01 13:44:54 -0700255 PELOG1(limLog(pMac, LOG1, FL("Preauth entry exist. Deleting... "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700256 limDeletePreAuthNode(pMac, pHdr->sa);
257 }
258 return;
259 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700260 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700261
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800262 pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
263
Jeff Johnson295189b2012-06-20 16:38:30 -0700264 // Check for pre-assoc states
265 switch (psessionEntry->limSystemRole)
266 {
267 case eLIM_STA_ROLE:
268 case eLIM_BT_AMP_STA_ROLE:
269 switch (psessionEntry->limMlmState)
270 {
271 case eLIM_MLM_WT_AUTH_FRAME2_STATE:
272 /**
273 * AP sent Deauth frame while waiting
274 * for Auth frame2. Report Auth failure
275 * to SME.
276 */
277
278 // Log error
279 PELOG1(limLog(pMac, LOG1,
280 FL("received Deauth frame with failure code %d from "),
281 reasonCode);
282 limPrintMacAddr(pMac, pHdr->sa, LOG1);)
283
284 limRestoreFromAuthState(pMac, eSIR_SME_DEAUTH_WHILE_JOIN,
285 reasonCode,psessionEntry);
286
287 return;
288
289 case eLIM_MLM_AUTHENTICATED_STATE:
290 /// Issue Deauth Indication to SME.
Hema Aparna Medicharlaeef78fc2013-07-12 11:47:01 +0530291 vos_mem_copy((tANI_U8 *) &mlmDeauthInd.peerMacAddr,
292 pHdr->sa,
293 sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -0700294 mlmDeauthInd.reasonCode = reasonCode;
295
296 psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE;
Jeff Johnsone7245742012-09-05 17:12:55 -0700297 MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState));
Jeff Johnson295189b2012-06-20 16:38:30 -0700298
299
300 limPostSmeMessage(pMac,
301 LIM_MLM_DEAUTH_IND,
302 (tANI_U32 *) &mlmDeauthInd);
303 return;
304
305 case eLIM_MLM_WT_ASSOC_RSP_STATE:
306 /**
307 * AP may have 'aged-out' our Pre-auth
308 * context. Delete local pre-auth context
309 * if any and issue ASSOC_CNF to SME.
310 */
311 if (limSearchPreAuthList(pMac, pHdr->sa))
312 limDeletePreAuthNode(pMac, pHdr->sa);
313
314 if (psessionEntry->pLimMlmJoinReq)
315 {
Hema Aparna Medicharlaeef78fc2013-07-12 11:47:01 +0530316 vos_mem_free(psessionEntry->pLimMlmJoinReq);
Jeff Johnson295189b2012-06-20 16:38:30 -0700317 psessionEntry->pLimMlmJoinReq = NULL;
318 }
319
320 mlmAssocCnf.resultCode = eSIR_SME_DEAUTH_WHILE_JOIN;
321 mlmAssocCnf.protStatusCode = reasonCode;
322
323 /* PE session Id*/
324 mlmAssocCnf.sessionId = psessionEntry->peSessionId;
325
326 psessionEntry->limMlmState =
327 psessionEntry->limPrevMlmState;
Jeff Johnsone7245742012-09-05 17:12:55 -0700328 MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState));
Jeff Johnson295189b2012-06-20 16:38:30 -0700329
330 // Deactive Association response timeout
331 limDeactivateAndChangeTimer(
332 pMac,
333 eLIM_ASSOC_FAIL_TIMER);
334
335 limPostSmeMessage(
336 pMac,
337 LIM_MLM_ASSOC_CNF,
338 (tANI_U32 *) &mlmAssocCnf);
339
340 return;
341
Madan Mohan Koyyalamudi58c87792013-08-30 02:51:14 +0530342 case eLIM_MLM_WT_ADD_STA_RSP_STATE:
343 psessionEntry->fDeauthReceived = true;
344 PELOGW(limLog(pMac, LOGW,
345 FL("Received Deauth frame with Reason Code %d from Peer"),
346 reasonCode);
347 limPrintMacAddr(pMac, pHdr->sa, LOGW);)
348 return ;
349
Jeff Johnson295189b2012-06-20 16:38:30 -0700350 case eLIM_MLM_IDLE_STATE:
351 case eLIM_MLM_LINK_ESTABLISHED_STATE:
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800352#ifdef FEATURE_WLAN_TDLS
353 if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType))
354 {
355 PELOGE(limLog(pMac, LOGE,
356 FL("received Deauth frame with reason code %d from Tdls peer"),
357 reasonCode);
358 limPrintMacAddr(pMac, pHdr->sa, LOGE);)
359 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
360 reasonCode);
361 return;
362 }
363 else
364 {
Gopichand Nakkala78a6c812013-05-13 16:39:49 +0530365
366 limDeleteTDLSPeers(pMac, psessionEntry);
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800367#endif
368 /**
369 * This could be Deauthentication frame from
370 * a BSS with which pre-authentication was
371 * performed. Delete Pre-auth entry if found.
372 */
373 if (limSearchPreAuthList(pMac, pHdr->sa))
374 limDeletePreAuthNode(pMac, pHdr->sa);
375#ifdef FEATURE_WLAN_TDLS
376 }
377#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700378 break;
379
380 case eLIM_MLM_WT_REASSOC_RSP_STATE:
381 break;
382
383 case eLIM_MLM_WT_FT_REASSOC_RSP_STATE:
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700384 PELOGE(limLog(pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -0700385 FL("received Deauth frame in FT state %X with reasonCode=%d from "),
386 psessionEntry->limMlmState, reasonCode);)
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700387 limPrintMacAddr(pMac, pHdr->sa, LOGE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700388 break;
389
390 default:
391 PELOG1(limLog(pMac, LOG1,
392 FL("received Deauth frame in state %X with reasonCode=%d from "),
393 psessionEntry->limMlmState, reasonCode);)
394 limPrintMacAddr(pMac, pHdr->sa, LOG1);
395 return;
396 }
397 break;
398
399 case eLIM_STA_IN_IBSS_ROLE:
400 break;
401
Jeff Johnson295189b2012-06-20 16:38:30 -0700402 case eLIM_AP_ROLE:
403 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700404
405 default: // eLIM_AP_ROLE or eLIM_BT_AMP_AP_ROLE
406
Jeff Johnson295189b2012-06-20 16:38:30 -0700407
408 return;
409 } // end switch (pMac->lim.gLimSystemRole)
410
411
412
413 /**
414 * Extract 'associated' context for STA, if any.
415 * This is maintained by DPH and created by LIM.
416 */
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800417 if (NULL == pStaDs)
Jeff Johnson295189b2012-06-20 16:38:30 -0700418 return;
419
420
421 if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) ||
422 (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE))
423 {
424 /**
425 * Already in the process of deleting context for the peer
426 * and received Deauthentication frame. Log and Ignore.
427 */
428 PELOG1(limLog(pMac, LOG1,
429 FL("received Deauth frame from peer that is in state %X, addr "),
430 pStaDs->mlmStaContext.mlmState);
431 limPrintMacAddr(pMac, pHdr->sa, LOG1);)
432 return;
433 }
434 pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes)reasonCode;
435 pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DEAUTH;
436
437 /// Issue Deauth Indication to SME.
Hema Aparna Medicharlaeef78fc2013-07-12 11:47:01 +0530438 vos_mem_copy((tANI_U8 *) &mlmDeauthInd.peerMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -0700439 pStaDs->staAddr,
440 sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 mlmDeauthInd.reasonCode = (tANI_U8) pStaDs->mlmStaContext.disassocReason;
442 mlmDeauthInd.deauthTrigger = eLIM_PEER_ENTITY_DEAUTH;
443
444
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700445 /*
446 * If we're in the middle of ReAssoc and received deauth from
Jeff Johnson295189b2012-06-20 16:38:30 -0700447 * the ReAssoc AP, then notify SME by sending REASSOC_RSP with
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700448 * failure result code. SME will post the disconnect to the
449 * supplicant and the latter would start a fresh assoc.
Jeff Johnson295189b2012-06-20 16:38:30 -0700450 */
451 if (limIsReassocInProgress(pMac,psessionEntry)) {
452 /**
453 * AP may have 'aged-out' our Pre-auth
454 * context. Delete local pre-auth context
455 * if any and issue REASSOC_CNF to SME.
456 */
457 if (limSearchPreAuthList(pMac, pHdr->sa))
458 limDeletePreAuthNode(pMac, pHdr->sa);
459
460 if (psessionEntry->limAssocResponseData) {
Hema Aparna Medicharlaeef78fc2013-07-12 11:47:01 +0530461 vos_mem_free(psessionEntry->limAssocResponseData);
Jeff Johnson295189b2012-06-20 16:38:30 -0700462 psessionEntry->limAssocResponseData = NULL;
463 }
464
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700465 PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from ReAssoc AP. Issue REASSOC_CNF. "));)
Madan Mohan Koyyalamudi85d140a2012-10-18 20:23:01 -0700466 /*
467 * TODO: Instead of overloading eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE
468 * it would have been good to define/use a different failure type.
469 * Using eSIR_SME_FT_REASSOC_FAILURE does not seem to clean-up
470 * properly and we end up seeing "transmit queue timeout".
471 */
472 limPostReassocFailure(pMac, eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
473 eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700474 return;
475 }
Venkata Prathyusha Kuntupalli22ba5982013-04-24 13:09:20 -0700476 /* reset the deauthMsgCnt here since we are able to Process
477 * the deauth frame and sending up the indication as well */
478 if(pMac->lim.deauthMsgCnt != 0)
479 {
480 pMac->lim.deauthMsgCnt = 0;
481 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700482 /// Deauthentication from peer MAC entity
483 limPostSmeMessage(pMac, LIM_MLM_DEAUTH_IND, (tANI_U32 *) &mlmDeauthInd);
484
485 // send eWNI_SME_DEAUTH_IND to SME
486 limSendSmeDeauthInd(pMac, pStaDs, psessionEntry);
487 return;
488
489} /*** end limProcessDeauthFrame() ***/
490