blob: 7c35c836532e864984de90cf23c3c22487ca9b47 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
6/*
Jeff Johnson295189b2012-06-20 16:38:30 -07007 * Airgo Networks, Inc proprietary. All rights reserved.
8 * This file limSendSmeRspMessages.cc contains the functions
9 * for sending SME response/notification messages to applications
10 * above MAC software.
11 * Author: Chandra Modumudi
12 * Date: 02/13/02
13 * History:-
14 * Date Modified by Modification Information
15 * --------------------------------------------------------------------
16 */
17
18#include "vos_types.h"
19#include "wniApi.h"
20#include "sirCommon.h"
21#include "aniGlobal.h"
22
Jeff Johnson295189b2012-06-20 16:38:30 -070023#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070024#include "sysDef.h"
25#include "cfgApi.h"
26
Jeff Johnson295189b2012-06-20 16:38:30 -070027
28#include "schApi.h"
29#include "utilsApi.h"
30#include "limUtils.h"
31#include "limSecurityUtils.h"
32#include "limSerDesUtils.h"
33#include "limSendSmeRspMessages.h"
34#include "limIbssPeerMgmt.h"
35#include "limSessionUtils.h"
36
37
38/**
39 * limSendSmeRsp()
40 *
41 *FUNCTION:
42 * This function is called by limProcessSmeReqMessages() to send
43 * eWNI_SME_START_RSP, eWNI_SME_MEASUREMENT_RSP, eWNI_SME_STOP_BSS_RSP
44 * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC
45 * Software.
46 *
47 *PARAMS:
48 *
49 *LOGIC:
50 *
51 *ASSUMPTIONS:
52 * NA
53 *
54 *NOTE:
55 * NA
56 *
57 * @param pMac Pointer to Global MAC structure
58 * @param msgType Indicates message type
59 * @param resultCode Indicates the result of previously issued
60 * eWNI_SME_msgType_REQ message
61 *
62 * @return None
63 */
64
65void
66limSendSmeRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
67 tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId)
68{
69 tSirMsgQ mmhMsg;
70 tSirSmeRsp *pSirSmeRsp;
71
72 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070073 FL("Sending message %s with reasonCode %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -070074 limMsgStr(msgType), limResultCodeStr(resultCode));)
75
Bansidhar Gopalachari12731232013-07-11 10:56:36 +053076 pSirSmeRsp = vos_mem_malloc(sizeof(tSirSmeRsp));
77 if ( NULL == pSirSmeRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -070078 {
79 /// Buffer not available. Log error
80 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +053081 FL("call to AllocateMemory failed for eWNI_SME_*_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -070082
83 return;
84 }
85
Jeff Johnson295189b2012-06-20 16:38:30 -070086 pSirSmeRsp->messageType = msgType;
87 pSirSmeRsp->length = sizeof(tSirSmeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -070088 pSirSmeRsp->statusCode = resultCode;
89
90 /* Update SME session Id and Transaction Id */
91 pSirSmeRsp->sessionId = smesessionId;
92 pSirSmeRsp->transactionId = smetransactionId;
93
94
95 mmhMsg.type = msgType;
96 mmhMsg.bodyptr = pSirSmeRsp;
97 mmhMsg.bodyval = 0;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +053098 MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -070099
100#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
101 {
102 tpPESession psessionEntry = peGetValidPowerSaveSession(pMac);
103 switch(msgType)
104 {
105 case eWNI_PMC_ENTER_BMPS_RSP:
106 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
107 break;
108 case eWNI_PMC_EXIT_BMPS_RSP:
109 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
110 break;
111 case eWNI_PMC_ENTER_IMPS_RSP:
112 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
113 break;
114 case eWNI_PMC_EXIT_IMPS_RSP:
115 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
116 break;
117 case eWNI_PMC_ENTER_UAPSD_RSP:
118 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
119 break;
120 case eWNI_PMC_EXIT_UAPSD_RSP:
121 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
122 break;
123 case eWNI_SME_SWITCH_CHL_RSP:
124 limDiagEventReport(pMac, WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
125 break;
126 case eWNI_SME_STOP_BSS_RSP:
127 limDiagEventReport(pMac, WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
128 break;
129 case eWNI_PMC_ENTER_WOWL_RSP:
130 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
131 break;
132 case eWNI_PMC_EXIT_WOWL_RSP:
133 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
134 break;
135 }
136 }
137#endif //FEATURE_WLAN_DIAG_SUPPORT
138
139 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
140} /*** end limSendSmeRsp() ***/
141
142
143/**
144 * limSendSmeJoinReassocRspAfterResume()
145 *
146 *FUNCTION:
147 * This function is called to send Join/Reassoc rsp
148 * message to SME after the resume link.
149 *
150 *PARAMS:
151 *
152 *LOGIC:
153 *
154 *ASSUMPTIONS:
155 * NA
156 *
157 *NOTE:
158 * NA
159 *
160 * @param pMac Pointer to Global MAC structure
161 * @param status Resume link status
162 * @param ctx context passed while calling resmune link.
163 * (join response to be sent)
164 *
165 * @return None
166 */
167static void limSendSmeJoinReassocRspAfterResume( tpAniSirGlobal pMac,
168 eHalStatus status, tANI_U32 *ctx)
169{
170 tSirMsgQ mmhMsg;
171 tpSirSmeJoinRsp pSirSmeJoinRsp = (tpSirSmeJoinRsp) ctx;
172
173 mmhMsg.type = pSirSmeJoinRsp->messageType;
174 mmhMsg.bodyptr = pSirSmeJoinRsp;
175 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700176 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700177 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
178}
179
180
181/**
182 * limSendSmeJoinReassocRsp()
183 *
184 *FUNCTION:
185 * This function is called by limProcessSmeReqMessages() to send
186 * eWNI_SME_JOIN_RSP or eWNI_SME_REASSOC_RSP messages to applications
187 * above MAC Software.
188 *
189 *PARAMS:
190 *
191 *LOGIC:
192 *
193 *ASSUMPTIONS:
194 * NA
195 *
196 *NOTE:
197 * NA
198 *
199 * @param pMac Pointer to Global MAC structure
200 * @param msgType Indicates message type
201 * @param resultCode Indicates the result of previously issued
202 * eWNI_SME_msgType_REQ message
203 *
204 * @return None
205 */
206
207void
208limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
209 tSirResultCodes resultCode, tANI_U16 protStatusCode,
210 tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
211{
212 tpSirSmeJoinRsp pSirSmeJoinRsp;
213 tANI_U32 rspLen;
214 tpDphHashNode pStaDs = NULL;
215
216#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
217 if (msgType == eWNI_SME_REASSOC_RSP)
218 limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
219 else
220 limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
221#endif //FEATURE_WLAN_DIAG_SUPPORT
222
223 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700224 FL("Sending message %s with reasonCode %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 limMsgStr(msgType), limResultCodeStr(resultCode));)
226
227 if(psessionEntry == NULL)
228 {
229
230 rspLen = sizeof(tSirSmeJoinRsp);
231
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530232 pSirSmeJoinRsp = vos_mem_malloc(rspLen);
233 if ( NULL == pSirSmeJoinRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700234 {
235 /// Buffer not available. Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530236 limLog(pMac, LOGP, FL("call to AllocateMemory failed for JOIN/REASSOC_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700237 return;
238 }
239
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530240 vos_mem_set((tANI_U8*)pSirSmeJoinRsp, rspLen, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700241
242
243 pSirSmeJoinRsp->beaconLength = 0;
244 pSirSmeJoinRsp->assocReqLength = 0;
245 pSirSmeJoinRsp->assocRspLength = 0;
246 }
247
248 else
249 {
250 rspLen = psessionEntry->assocReqLen + psessionEntry->assocRspLen +
251 psessionEntry->bcnLen +
252#ifdef WLAN_FEATURE_VOWIFI_11R
253 psessionEntry->RICDataLen +
254#endif
255#ifdef FEATURE_WLAN_CCX
256 psessionEntry->tspecLen +
257#endif
258 sizeof(tSirSmeJoinRsp) - sizeof(tANI_U8) ;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530259
260 pSirSmeJoinRsp = vos_mem_malloc(rspLen);
261 if ( NULL == pSirSmeJoinRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700262 {
263 /// Buffer not available. Log error
264 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530265 FL("call to AllocateMemory failed for JOIN/REASSOC_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700266
267 return;
268 }
269
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530270 vos_mem_set((tANI_U8*)pSirSmeJoinRsp, rspLen, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700271
Jeff Johnson295189b2012-06-20 16:38:30 -0700272 if (resultCode == eSIR_SME_SUCCESS)
273 {
274 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
275 if (pStaDs == NULL)
276 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700277 PELOGE(limLog(pMac, LOGE, FL("could not Get Self Entry for the station"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700278 }
279 else
280 {
Jeff Johnson62c27982013-02-27 17:53:55 -0800281 //Pass the peer's staId
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 pSirSmeJoinRsp->staId = pStaDs->staIndex;
Jeff Johnson62c27982013-02-27 17:53:55 -0800283 pSirSmeJoinRsp->ucastSig = pStaDs->ucUcastSig;
284 pSirSmeJoinRsp->bcastSig = pStaDs->ucBcastSig;
Jeff Johnson295189b2012-06-20 16:38:30 -0700285 }
286 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700287
288 pSirSmeJoinRsp->beaconLength = 0;
289 pSirSmeJoinRsp->assocReqLength = 0;
290 pSirSmeJoinRsp->assocRspLength = 0;
291#ifdef WLAN_FEATURE_VOWIFI_11R
292 pSirSmeJoinRsp->parsedRicRspLen = 0;
293#endif
294#ifdef FEATURE_WLAN_CCX
295 pSirSmeJoinRsp->tspecIeLen = 0;
296#endif
297
298 if(resultCode == eSIR_SME_SUCCESS)
299 {
300
301 if(psessionEntry->beacon != NULL)
302 {
303 pSirSmeJoinRsp->beaconLength = psessionEntry->bcnLen;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530304 vos_mem_copy( pSirSmeJoinRsp->frames, psessionEntry->beacon,
305 pSirSmeJoinRsp->beaconLength);
306 vos_mem_free( psessionEntry->beacon);
Jeff Johnson295189b2012-06-20 16:38:30 -0700307 psessionEntry->beacon = NULL;
308#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700309 PELOG1(limLog(pMac, LOG1, FL("Beacon=%d"), psessionEntry->bcnLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700310#endif
311 }
312
313 if(psessionEntry->assocReq != NULL)
314 {
315 pSirSmeJoinRsp->assocReqLength = psessionEntry->assocReqLen;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530316 vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen,
317 psessionEntry->assocReq, pSirSmeJoinRsp->assocReqLength);
318 vos_mem_free( psessionEntry->assocReq);
Jeff Johnson295189b2012-06-20 16:38:30 -0700319 psessionEntry->assocReq = NULL;
320#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700321 PELOG1(limLog(pMac, LOG1, FL("AssocReq=%d"), psessionEntry->assocReqLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700322#endif
323 }
324 if(psessionEntry->assocRsp != NULL)
325 {
326 pSirSmeJoinRsp->assocRspLength = psessionEntry->assocRspLen;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530327 vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen +
328 psessionEntry->assocReqLen,
329 psessionEntry->assocRsp,
330 pSirSmeJoinRsp->assocRspLength);
331 vos_mem_free( psessionEntry->assocRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700332 psessionEntry->assocRsp = NULL;
333 }
334#ifdef WLAN_FEATURE_VOWIFI_11R
335 if(psessionEntry->ricData != NULL)
336 {
337 pSirSmeJoinRsp->parsedRicRspLen = psessionEntry->RICDataLen;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530338 vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen +
339 psessionEntry->assocReqLen + psessionEntry->assocRspLen,
340 psessionEntry->ricData, pSirSmeJoinRsp->parsedRicRspLen);
341 vos_mem_free(psessionEntry->ricData);
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 psessionEntry->ricData = NULL;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700343 PELOG1(limLog(pMac, LOG1, FL("RicLength=%d"), pSirSmeJoinRsp->parsedRicRspLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700344 }
345#endif
346#ifdef FEATURE_WLAN_CCX
347 if(psessionEntry->tspecIes != NULL)
348 {
349 pSirSmeJoinRsp->tspecIeLen = psessionEntry->tspecLen;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530350 vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen +
351 psessionEntry->assocReqLen + psessionEntry->assocRspLen +
352 psessionEntry->RICDataLen,
353 psessionEntry->tspecIes, pSirSmeJoinRsp->tspecIeLen);
354 vos_mem_free(psessionEntry->tspecIes);
Jeff Johnson295189b2012-06-20 16:38:30 -0700355 psessionEntry->tspecIes = NULL;
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700356 PELOG1(limLog(pMac, LOG1, FL("CCX-TspecLen=%d"), psessionEntry->tspecLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700357 }
358#endif
359 pSirSmeJoinRsp->aid = psessionEntry->limAID;
360#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700361 PELOG1(limLog(pMac, LOG1, FL("AssocRsp=%d"), psessionEntry->assocRspLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700362#endif
363 }
Madan Mohan Koyyalamudib666eb12012-09-18 17:29:47 -0700364 else
365 {
366
367 if(psessionEntry->beacon != NULL)
368 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530369 vos_mem_free(psessionEntry->beacon);
Madan Mohan Koyyalamudib666eb12012-09-18 17:29:47 -0700370 psessionEntry->beacon = NULL;
371 }
372
373 if(psessionEntry->assocReq != NULL)
374 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530375 vos_mem_free( psessionEntry->assocReq);
Madan Mohan Koyyalamudib666eb12012-09-18 17:29:47 -0700376 psessionEntry->assocReq = NULL;
377 }
378
379 if(psessionEntry->assocRsp != NULL)
380 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530381 vos_mem_free( psessionEntry->assocRsp);
Madan Mohan Koyyalamudib666eb12012-09-18 17:29:47 -0700382 psessionEntry->assocRsp = NULL;
383 }
384
385 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700386 }
387
388
389 pSirSmeJoinRsp->messageType = msgType;
390 pSirSmeJoinRsp->length = (tANI_U16) rspLen;
391 pSirSmeJoinRsp->statusCode = resultCode;
392 pSirSmeJoinRsp->protStatusCode = protStatusCode;
393
394 /* Update SME session ID and transaction Id */
395 pSirSmeJoinRsp->sessionId = smesessionId;
396 pSirSmeJoinRsp->transactionId = smetransactionId;
397
398 if(IS_MCC_SUPPORTED && limIsLinkSuspended( pMac ) )
399 {
400 if( psessionEntry && psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE )
401 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700402
403#ifdef WLAN_FEATURE_11AC
404 if (psessionEntry->vhtCapability)
405 {
Jeff Johnson32d95a32012-09-10 13:15:23 -0700406 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -0700407 /*Get 11ac cbState from 11n cbState*/
408 htSecondaryChannelOffset = limGet11ACPhyCBState(pMac,
409 psessionEntry->currentOperChannel,
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700410 psessionEntry->htSecondaryChannelOffset,
411 psessionEntry->apCenterChan,
412 psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -0700413 peSetResumeChannel( pMac, psessionEntry->currentOperChannel, htSecondaryChannelOffset);
414 }
Jeff Johnson32d95a32012-09-10 13:15:23 -0700415 else
Jeff Johnsone7245742012-09-05 17:12:55 -0700416#endif
Jeff Johnson32d95a32012-09-10 13:15:23 -0700417 peSetResumeChannel( pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset);
Jeff Johnson295189b2012-06-20 16:38:30 -0700418 }
419 else
420 {
421 peSetResumeChannel( pMac, 0, 0);
422 }
423 limResumeLink( pMac, limSendSmeJoinReassocRspAfterResume,
424 (tANI_U32*) pSirSmeJoinRsp );
425 }
426 else
427 {
428 limSendSmeJoinReassocRspAfterResume( pMac, eHAL_STATUS_SUCCESS,
429 (tANI_U32*) pSirSmeJoinRsp );
430 }
431} /*** end limSendSmeJoinReassocRsp() ***/
432
433
434
435/**
436 * limSendSmeStartBssRsp()
437 *
438 *FUNCTION:
439 * This function is called to send eWNI_SME_START_BSS_RSP
440 * message to applications above MAC Software.
441 *
442 *PARAMS:
443 *
444 *LOGIC:
445 *
446 *ASSUMPTIONS:
447 * NA
448 *
449 *NOTE:
450 * NA
451 *
452 * @param pMac Pointer to Global MAC structure
453 * @param msgType Indicates message type
454 * @param resultCode Indicates the result of previously issued
455 * eWNI_SME_msgType_REQ message
456 *
457 * @return None
458 */
459
460void
461limSendSmeStartBssRsp(tpAniSirGlobal pMac,
462 tANI_U16 msgType, tSirResultCodes resultCode,tpPESession psessionEntry,
463 tANI_U8 smesessionId,tANI_U16 smetransactionId)
464{
465
466
467 tANI_U16 size = 0;
468 tSirMsgQ mmhMsg;
469 tSirSmeStartBssRsp *pSirSmeRsp;
470 tANI_U16 ieLen;
471 tANI_U16 ieOffset, curLen;
472
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700473 PELOG1(limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700474 limMsgStr(msgType), limResultCodeStr(resultCode));)
475
476 size = sizeof(tSirSmeStartBssRsp);
477
478 if(psessionEntry == NULL)
479 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530480 pSirSmeRsp = vos_mem_malloc(size);
481 if ( NULL == pSirSmeRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700482 {
483 /// Buffer not available. Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530484 limLog(pMac, LOGP,FL("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700485 return;
486 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530487 vos_mem_set((tANI_U8*)pSirSmeRsp, size, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700488
489 }
490 else
491 {
492 //subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID
493 ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET;
494 ieLen = pMac->sch.schObject.gSchBeaconOffsetBegin + pMac->sch.schObject.gSchBeaconOffsetEnd - ieOffset;
495 //calculate the memory size to allocate
496 size += ieLen;
497
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530498 pSirSmeRsp = vos_mem_malloc(size);
499 if ( NULL == pSirSmeRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700500 {
501 /// Buffer not available. Log error
502 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530503 FL("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700504
505 return;
506 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530507 vos_mem_set((tANI_U8*)pSirSmeRsp, size, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700508 size = sizeof(tSirSmeStartBssRsp);
509 if (resultCode == eSIR_SME_SUCCESS)
510 {
511
512 sirCopyMacAddr(pSirSmeRsp->bssDescription.bssId, psessionEntry->bssId);
513
514 /* Read beacon interval from session */
515 pSirSmeRsp->bssDescription.beaconInterval = (tANI_U16) psessionEntry->beaconParams.beaconInterval;
516 pSirSmeRsp->bssType = psessionEntry->bssType;
517
518 if (cfgGetCapabilityInfo( pMac, &pSirSmeRsp->bssDescription.capabilityInfo,psessionEntry)
519 != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700520 limLog(pMac, LOGP, FL("could not retrieve Capabilities value"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700521
522 limGetPhyMode(pMac, (tANI_U32 *)&pSirSmeRsp->bssDescription.nwType, psessionEntry);
523
524#if 0
525 if (wlan_cfgGetInt(pMac, WNI_CFG_CURRENT_CHANNEL, &len) != eSIR_SUCCESS)
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700526 limLog(pMac, LOGP, FL("could not retrieve CURRENT_CHANNEL from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700527
528#endif// TO SUPPORT BT-AMP
529
530 pSirSmeRsp->bssDescription.channelId = psessionEntry->currentOperChannel;
531
532 pSirSmeRsp->bssDescription.aniIndicator = 1;
533
534 curLen = pMac->sch.schObject.gSchBeaconOffsetBegin - ieOffset;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530535 vos_mem_copy( (tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields,
Jeff Johnson295189b2012-06-20 16:38:30 -0700536 pMac->sch.schObject.gSchBeaconFrameBegin + ieOffset,
537 (tANI_U32)curLen);
538
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530539 vos_mem_copy( ((tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields) + curLen,
Jeff Johnson295189b2012-06-20 16:38:30 -0700540 pMac->sch.schObject.gSchBeaconFrameEnd,
541 (tANI_U32)pMac->sch.schObject.gSchBeaconOffsetEnd);
542
543
544 //subtracting size of length indicator itself and size of pointer to ieFields
545 pSirSmeRsp->bssDescription.length = sizeof(tSirBssDescription) -
546 sizeof(tANI_U16) - sizeof(tANI_U32) +
547 ieLen;
548 //This is the size of the message, subtracting the size of the pointer to ieFields
549 size += ieLen - sizeof(tANI_U32);
550 }
551
552
553
Jeff Johnson295189b2012-06-20 16:38:30 -0700554
555 }
556
557 pSirSmeRsp->messageType = msgType;
558 pSirSmeRsp->length = size;
559
560 /* Update SME session Id and transaction Id */
561 pSirSmeRsp->sessionId = smesessionId;
562 pSirSmeRsp->transactionId = smetransactionId;
563 pSirSmeRsp->statusCode = resultCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700564 if(psessionEntry != NULL )
565 pSirSmeRsp->staId = psessionEntry->staId; //else it will be always zero smeRsp StaID = 0
566
Jeff Johnson295189b2012-06-20 16:38:30 -0700567
568 mmhMsg.type = msgType;
569 mmhMsg.bodyptr = pSirSmeRsp;
570 mmhMsg.bodyval = 0;
Leela Venkata Kiran Kumar Reddy Chirala68a6abe2013-02-28 07:43:16 -0800571 if(psessionEntry == NULL)
572 {
573 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
574 }
575 else
576 {
577 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
578 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700579#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
580 limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
581#endif //FEATURE_WLAN_DIAG_SUPPORT
582
583 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
584} /*** end limSendSmeStartBssRsp() ***/
585
586
587
588
589
590#define LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED 20
591#define LIM_SIZE_OF_EACH_BSS 400 // this is a rough estimate
592
593
594/**
595 * limSendSmeScanRsp()
596 *
597 *FUNCTION:
598 * This function is called by limProcessSmeReqMessages() to send
599 * eWNI_SME_SCAN_RSP message to applications above MAC
600 * Software.
601 *
602 *PARAMS:
603 *
604 *LOGIC:
605 *
606 *ASSUMPTIONS:
607 * NA
608 *
609 *NOTE:
610 * NA
611 *
612 * @param pMac Pointer to Global MAC structure
613 * @param length Indicates length of message
614 * @param resultCode Indicates the result of previously issued
615 * eWNI_SME_SCAN_REQ message
616 *
617 * @return None
618 */
619
620void
621limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length,
622 tSirResultCodes resultCode,tANI_U8 smesessionId,tANI_U16 smetranscationId)
623{
624 tSirMsgQ mmhMsg;
625 tpSirSmeScanRsp pSirSmeScanRsp=NULL;
626 tLimScanResultNode *ptemp = NULL;
627 tANI_U16 msgLen, allocLength, curMsgLen = 0;
628 tANI_U16 i, bssCount;
629 tANI_U8 *pbBuf;
630 tSirBssDescription *pDesc;
631
632 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700633 FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700634 length, limResultCodeStr(resultCode));)
635
636 if (resultCode != eSIR_SME_SUCCESS)
637 {
638 limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId);
639 return;
640 }
641
642 mmhMsg.type = eWNI_SME_SCAN_RSP;
643 i = 0;
644 bssCount = 0;
645 msgLen = 0;
646 allocLength = LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED * LIM_SIZE_OF_EACH_BSS;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530647 pSirSmeScanRsp = vos_mem_malloc(allocLength);
648 if ( NULL == pSirSmeScanRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700649 {
650 // Log error
651 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530652 FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700653
654 return;
655 }
656 for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
657 {
658 //when ptemp is not NULL it is a left over
659 ptemp = pMac->lim.gLimCachedScanHashTable[i];
660 while(ptemp)
661 {
662 pbBuf = ((tANI_U8 *)pSirSmeScanRsp) + msgLen;
663 if(0 == bssCount)
664 {
665 msgLen = sizeof(tSirSmeScanRsp) -
666 sizeof(tSirBssDescription) +
667 ptemp->bssDescription.length +
668 sizeof(ptemp->bssDescription.length);
669 pDesc = pSirSmeScanRsp->bssDescription;
670 }
671 else
672 {
673 msgLen += ptemp->bssDescription.length +
674 sizeof(ptemp->bssDescription.length);
675 pDesc = (tSirBssDescription *)pbBuf;
676 }
677 if( (allocLength < msgLen) ||
678 (LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED <= bssCount++) )
679 {
680 pSirSmeScanRsp->statusCode =
681 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW;
Jeff Johnson295189b2012-06-20 16:38:30 -0700682 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
683 pSirSmeScanRsp->length = curMsgLen;
Jeff Johnson295189b2012-06-20 16:38:30 -0700684 mmhMsg.bodyptr = pSirSmeScanRsp;
685 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700686 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700687 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530688 pSirSmeScanRsp = vos_mem_malloc(allocLength);
689 if ( NULL == pSirSmeScanRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 {
691 // Log error
692 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530693 FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700694 return;
695 }
696 msgLen = sizeof(tSirSmeScanRsp) -
697 sizeof(tSirBssDescription) +
698 ptemp->bssDescription.length +
699 sizeof(ptemp->bssDescription.length);
700 pDesc = pSirSmeScanRsp->bssDescription;
701 bssCount = 1;
702 }
703 curMsgLen = msgLen;
704
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700705 PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 msgLen, ptemp->bssDescription.length);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700707 pDesc->length
708 = ptemp->bssDescription.length;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530709 vos_mem_copy( (tANI_U8 *) &pDesc->bssId,
710 (tANI_U8 *) &ptemp->bssDescription.bssId,
711 ptemp->bssDescription.length);
Jeff Johnson295189b2012-06-20 16:38:30 -0700712
713 PELOG2(limLog(pMac, LOG2, FL("BssId "));
714 limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);)
715
716 pSirSmeScanRsp->sessionId = smesessionId;
717 pSirSmeScanRsp->transcationId = smetranscationId;
718
719 ptemp = ptemp->next;
720 } //while(ptemp)
721 } //for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
722
723 if(0 == bssCount)
724 {
725 limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700726 if (NULL != pSirSmeScanRsp)
727 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530728 vos_mem_free( pSirSmeScanRsp);
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700729 pSirSmeScanRsp = NULL;
730 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700731 }
732 else
733 {
734 // send last message
735 pSirSmeScanRsp->statusCode = eSIR_SME_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -0700736 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
737 pSirSmeScanRsp->length = curMsgLen;
Jeff Johnson295189b2012-06-20 16:38:30 -0700738
739 /* Update SME session Id and SME transcation Id */
740 pSirSmeScanRsp->sessionId = smesessionId;
741 pSirSmeScanRsp->transcationId = smetranscationId;
742
743 mmhMsg.type = eWNI_SME_SCAN_RSP;
744 mmhMsg.bodyptr = pSirSmeScanRsp;
745 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700746 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700747 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700748 PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700749 }
750
751 return;
752
753} /*** end limSendSmeScanRsp() ***/
754
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700755#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
756/**
757 * limSendSmeLfrScanRsp()
758 *
759 *FUNCTION:
760 * This function is called by limProcessSmeReqMessages() to send
761 * eWNI_SME_SCAN_RSP message to applications above MAC Software
762 * only for sending up the roam candidates.
763 *
764 *PARAMS:
765 *
766 *LOGIC:
767 *
768 *ASSUMPTIONS:
769 * NA
770 *
771 *NOTE:
772 * NA
773 *
774 * @param pMac Pointer to Global MAC structure
775 * @param length Indicates length of message
776 * @param resultCode Indicates the result of previously issued
777 * eWNI_SME_SCAN_REQ message
778 *
779 * @return None
780 */
781
782void
783limSendSmeLfrScanRsp(tpAniSirGlobal pMac, tANI_U16 length,
784 tSirResultCodes resultCode,tANI_U8 smesessionId,tANI_U16 smetranscationId)
785{
786 tSirMsgQ mmhMsg;
787 tpSirSmeScanRsp pSirSmeScanRsp=NULL;
788 tLimScanResultNode *ptemp = NULL;
789 tANI_U16 msgLen, allocLength, curMsgLen = 0;
790 tANI_U16 i, bssCount;
791 tANI_U8 *pbBuf;
792 tSirBssDescription *pDesc;
793
794 PELOG1(limLog(pMac, LOG1,
795 FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s\n"),
796 length, limResultCodeStr(resultCode));)
797
798 if (resultCode != eSIR_SME_SUCCESS)
799 {
800 limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId);
801 return;
802 }
803
804 mmhMsg.type = eWNI_SME_SCAN_RSP;
805 i = 0;
806 bssCount = 0;
807 msgLen = 0;
808 allocLength = LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED * LIM_SIZE_OF_EACH_BSS;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530809 pSirSmeScanRsp = vos_mem_malloc(allocLength);
810 if ( NULL == pSirSmeScanRsp )
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700811 {
812 // Log error
813 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530814 FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP\n"));
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700815
816 return;
817 }
818 for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
819 {
820 //when ptemp is not NULL it is a left over
821 ptemp = pMac->lim.gLimCachedLfrScanHashTable[i];
822 while(ptemp)
823 {
824 pbBuf = ((tANI_U8 *)pSirSmeScanRsp) + msgLen;
825 if(0 == bssCount)
826 {
827 msgLen = sizeof(tSirSmeScanRsp) -
828 sizeof(tSirBssDescription) +
829 ptemp->bssDescription.length +
830 sizeof(ptemp->bssDescription.length);
831 pDesc = pSirSmeScanRsp->bssDescription;
832 }
833 else
834 {
835 msgLen += ptemp->bssDescription.length +
836 sizeof(ptemp->bssDescription.length);
837 pDesc = (tSirBssDescription *)pbBuf;
838 }
839 if ( (allocLength < msgLen) ||
840 (LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED <= bssCount++) )
841 {
842 pSirSmeScanRsp->statusCode =
843 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW;
844 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
845 pSirSmeScanRsp->length = curMsgLen;
846 mmhMsg.bodyptr = pSirSmeScanRsp;
847 mmhMsg.bodyval = 0;
848 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
849 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530850 pSirSmeScanRsp = vos_mem_malloc(allocLength);
851 if ( NULL == pSirSmeScanRsp )
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700852 {
853 // Log error
854 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530855 FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP\n"));
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700856 return;
857 }
858 msgLen = sizeof(tSirSmeScanRsp) -
859 sizeof(tSirBssDescription) +
860 ptemp->bssDescription.length +
861 sizeof(ptemp->bssDescription.length);
862 pDesc = pSirSmeScanRsp->bssDescription;
863 bssCount = 1;
864 }
865 curMsgLen = msgLen;
866
867 PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d\n"),
868 msgLen, ptemp->bssDescription.length);)
869 pDesc->length
870 = ptemp->bssDescription.length;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530871 vos_mem_copy( (tANI_U8 *) &pDesc->bssId,
872 (tANI_U8 *) &ptemp->bssDescription.bssId,
873 ptemp->bssDescription.length);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700874
875 PELOG2(limLog(pMac, LOG2, FL("BssId "));
876 limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);)
877
878 pSirSmeScanRsp->sessionId = smesessionId;
879 pSirSmeScanRsp->transcationId = smetranscationId;
880
881 ptemp = ptemp->next;
882 } //while(ptemp)
883 } //for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
884
885 if (0 == bssCount)
886 {
887 limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId);
888 if (NULL != pSirSmeScanRsp)
889 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530890 vos_mem_free( pSirSmeScanRsp);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700891 pSirSmeScanRsp = NULL;
892 }
893 }
894 else
895 {
896 // send last message
897 pSirSmeScanRsp->statusCode = eSIR_SME_SUCCESS;
898 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
899 pSirSmeScanRsp->length = curMsgLen;
900
901 /* Update SME session Id and SME transcation Id */
902 pSirSmeScanRsp->sessionId = smesessionId;
903 pSirSmeScanRsp->transcationId = smetranscationId;
904
905 mmhMsg.type = eWNI_SME_SCAN_RSP;
906 mmhMsg.bodyptr = pSirSmeScanRsp;
907 mmhMsg.bodyval = 0;
908 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
909 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
910 PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS\n"));)
911 }
912
913 return;
914
915} /*** end limSendSmeLfrScanRsp() ***/
916#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -0700917
918/**
919 * limPostSmeScanRspMessage()
920 *
921 *FUNCTION:
922 * This function is called by limSendSmeScanRsp() to send
923 * eWNI_SME_SCAN_RSP message with failed result code
924 *
925 *NOTE:
926 * NA
927 *
928 * @param pMac Pointer to Global MAC structure
929 * @param length Indicates length of message
930 * @param resultCode failed result code
931 *
932 * @return None
933 */
934
935void
936limPostSmeScanRspMessage(tpAniSirGlobal pMac,
937 tANI_U16 length,
938 tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId)
939{
940 tpSirSmeScanRsp pSirSmeScanRsp;
941 tSirMsgQ mmhMsg;
942
943 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700944 FL("limPostSmeScanRspMessage: send SME_SCAN_RSP (len %d, reasonCode %s). "),
Jeff Johnson295189b2012-06-20 16:38:30 -0700945 length, limResultCodeStr(resultCode));)
946
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530947 pSirSmeScanRsp = vos_mem_malloc(length);
948 if ( NULL == pSirSmeScanRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -0700949 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530950 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_SCAN_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700951 return;
952 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +0530953 vos_mem_set((void*)pSirSmeScanRsp, length, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700954
Jeff Johnson295189b2012-06-20 16:38:30 -0700955 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
956 pSirSmeScanRsp->length = length;
Jeff Johnson295189b2012-06-20 16:38:30 -0700957
958 if(sizeof(tSirSmeScanRsp) <= length)
959 {
960 pSirSmeScanRsp->bssDescription->length = sizeof(tSirBssDescription);
961 }
962
963 pSirSmeScanRsp->statusCode = resultCode;
964
965 /*Update SME session Id and transaction Id */
966 pSirSmeScanRsp->sessionId = smesessionId;
967 pSirSmeScanRsp->transcationId = smetransactionId;
968
969 mmhMsg.type = eWNI_SME_SCAN_RSP;
970 mmhMsg.bodyptr = pSirSmeScanRsp;
971 mmhMsg.bodyval = 0;
972
Jeff Johnsone7245742012-09-05 17:12:55 -0700973 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700974#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
975 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
976#endif //FEATURE_WLAN_DIAG_SUPPORT
977
978 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
979 return;
980
981} /*** limPostSmeScanRspMessage ***/
982
Jeff Johnsone7245742012-09-05 17:12:55 -0700983#ifdef FEATURE_OEM_DATA_SUPPORT
984
985/**
986 * limSendSmeOemDataRsp()
987 *
988 *FUNCTION:
989 * This function is called by limProcessSmeReqMessages() to send
990 * eWNI_SME_OEM_DATA_RSP message to applications above MAC
991 * Software.
992 *
993 *PARAMS:
994 *
995 *LOGIC:
996 *
997 *ASSUMPTIONS:
998 * NA
999 *
1000 *NOTE:
1001 * NA
1002 *
1003 * @param pMac Pointer to Global MAC structure
1004 * @param pMsgBuf Indicates the mlm message
1005 * @param resultCode Indicates the result of previously issued
1006 * eWNI_SME_OEM_DATA_RSP message
1007 *
1008 * @return None
1009 */
1010
1011void limSendSmeOemDataRsp(tpAniSirGlobal pMac, tANI_U32* pMsgBuf, tSirResultCodes resultCode)
1012{
1013 tSirMsgQ mmhMsg;
1014 tSirOemDataRsp* pSirSmeOemDataRsp=NULL;
1015 tLimMlmOemDataRsp* pMlmOemDataRsp=NULL;
1016 tANI_U16 msgLength;
1017
1018
1019 //get the pointer to the mlm message
1020 pMlmOemDataRsp = (tLimMlmOemDataRsp*)(pMsgBuf);
1021
1022 msgLength = sizeof(tSirOemDataRsp);
1023
1024 //now allocate memory for the char buffer
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301025 pSirSmeOemDataRsp = vos_mem_malloc(msgLength);
1026 if (NULL == pSirSmeOemDataRsp)
Jeff Johnsone7245742012-09-05 17:12:55 -07001027 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301028 limLog(pMac, LOGP, FL("call to AllocateMemory failed for pSirSmeOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001029 return;
1030 }
1031
1032#if defined (ANI_LITTLE_BYTE_ENDIAN)
1033 sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->length, msgLength);
1034 sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->messageType, eWNI_SME_OEM_DATA_RSP);
1035#else
1036 pSirSmeOemDataRsp->length = msgLength;
1037 pSirSmeOemDataRsp->messageType = eWNI_SME_OEM_DATA_RSP;
1038#endif
1039
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301040 vos_mem_copy(pSirSmeOemDataRsp->oemDataRsp, pMlmOemDataRsp->oemDataRsp, OEM_DATA_RSP_SIZE);
Jeff Johnsone7245742012-09-05 17:12:55 -07001041
1042 //Now free the memory from MLM Rsp Message
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301043 vos_mem_free(pMlmOemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001044
1045 mmhMsg.type = eWNI_SME_OEM_DATA_RSP;
1046 mmhMsg.bodyptr = pSirSmeOemDataRsp;
1047 mmhMsg.bodyval = 0;
1048
1049 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1050
1051 return;
1052} /*** limSendSmeOemDataRsp ***/
1053
1054#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001055
1056
1057/**
1058 * limSendSmeAuthRsp()
1059 *
1060 *FUNCTION:
1061 * This function is called by limProcessSmeMessages() to send
1062 * eWNI_SME_AUTH_RSP message to host
1063 *
1064 *PARAMS:
1065 *
1066 *LOGIC:
1067 *
1068 *ASSUMPTIONS:
1069 * NA
1070 *
1071 *NOTE:
1072 * NA
1073 *
1074 * @param pMac Pointer to Global MAC structure
1075 * @param statusCode Indicates the result of previously issued
1076 * eWNI_SME_AUTH_REQ message
1077 *
1078 * @return None
1079 */
1080void
1081limSendSmeAuthRsp(tpAniSirGlobal pMac,
1082 tSirResultCodes statusCode,
1083 tSirMacAddr peerMacAddr,
1084 tAniAuthType authType,
1085 tANI_U16 protStatusCode,
1086 tpPESession psessionEntry,tANI_U8 smesessionId,
1087 tANI_U16 smetransactionId)
1088{
1089#if 0
1090 tSirMsgQ mmhMsg;
1091 tSirSmeAuthRsp *pSirSmeAuthRsp;
1092
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301093 pSirSmeAuthRsp = vos_mem_malloc(sizeof(tSirSmeAuthRsp));
1094 if (NULL == pSirSmeAuthRsp)
Jeff Johnson295189b2012-06-20 16:38:30 -07001095 {
1096 // Log error
1097 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301098 FL("call to AllocateMemory failed for eWNI_SME_AUTH_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001099
1100 return;
1101 }
1102
Jeff Johnson295189b2012-06-20 16:38:30 -07001103
1104
1105 if(psessionEntry != NULL)
1106 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301107 vos_mem_copy( (tANI_U8 *) pSirSmeAuthRsp->peerMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07001108 (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1109 pSirSmeAuthRsp->authType = authType;
1110
1111 }
1112
1113 pSirSmeAuthRsp->messageType = eWNI_SME_AUTH_RSP;
1114 pSirSmeAuthRsp->length = sizeof(tSirSmeAuthRsp);
1115 pSirSmeAuthRsp->statusCode = statusCode;
1116 pSirSmeAuthRsp->protStatusCode = protStatusCode;
1117
1118 /* Update SME session and transaction Id*/
1119 pSirSmeAuthRsp->sessionId = smesessionId;
1120 pSirSmeAuthRsp->transactionId = smetransactionId;
1121
1122 mmhMsg.type = eWNI_SME_AUTH_RSP;
1123 mmhMsg.bodyptr = pSirSmeAuthRsp;
1124 mmhMsg.bodyval = 0;
1125 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
1126 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1127#endif
1128} /*** end limSendSmeAuthRsp() ***/
1129
1130
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001131void limSendSmeDisassocDeauthNtf( tpAniSirGlobal pMac,
Jeff Johnson295189b2012-06-20 16:38:30 -07001132 eHalStatus status, tANI_U32 *pCtx )
1133{
1134 tSirMsgQ mmhMsg;
1135 tSirMsgQ *pMsg = (tSirMsgQ*) pCtx;
1136
1137 mmhMsg.type = pMsg->type;
1138 mmhMsg.bodyptr = pMsg;
1139 mmhMsg.bodyval = 0;
1140
Jeff Johnsone7245742012-09-05 17:12:55 -07001141 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001142
1143 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1144}
1145/**
1146 * limSendSmeDisassocNtf()
1147 *
1148 *FUNCTION:
1149 * This function is called by limProcessSmeMessages() to send
1150 * eWNI_SME_DISASSOC_RSP/IND message to host
1151 *
1152 *PARAMS:
1153 *
1154 *LOGIC:
1155 *
1156 *ASSUMPTIONS:
1157 * NA
1158 *
1159 *NOTE:
1160 * This function is used for sending eWNI_SME_DISASSOC_CNF,
1161 * or eWNI_SME_DISASSOC_IND to host depending on
1162 * disassociation trigger.
1163 *
1164 * @param peerMacAddr Indicates the peer MAC addr to which
1165 * disassociate was initiated
1166 * @param reasonCode Indicates the reason for Disassociation
1167 * @param disassocTrigger Indicates the trigger for Disassociation
1168 * @param aid Indicates the STAID. This parameter is
1169 * present only on AP.
1170 *
1171 * @return None
1172 */
1173void
1174limSendSmeDisassocNtf(tpAniSirGlobal pMac,
1175 tSirMacAddr peerMacAddr,
1176 tSirResultCodes reasonCode,
1177 tANI_U16 disassocTrigger,
1178 tANI_U16 aid,
1179 tANI_U8 smesessionId,
1180 tANI_U16 smetransactionId,
1181 tpPESession psessionEntry)
1182{
1183
1184 tANI_U8 *pBuf;
1185 tSirSmeDisassocRsp *pSirSmeDisassocRsp;
1186 tSirSmeDisassocInd *pSirSmeDisassocInd;
1187 tANI_U32 *pMsg;
1188
1189 switch (disassocTrigger)
1190 {
1191 case eLIM_PEER_ENTITY_DISASSOC:
1192 return;
1193
1194 case eLIM_HOST_DISASSOC:
1195 /**
1196 * Disassociation response due to
1197 * host triggered disassociation
1198 */
1199
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301200 pSirSmeDisassocRsp = vos_mem_malloc(sizeof(tSirSmeDisassocRsp));
1201 if ( NULL == pSirSmeDisassocRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07001202 {
1203 // Log error
1204 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301205 FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001206
1207 return;
1208 }
Abhishek Singhcd09b562013-12-24 16:02:20 +05301209 limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with "
1210 "retCode: %d for "MAC_ADDRESS_STR),reasonCode,
1211 MAC_ADDR_ARRAY(peerMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001212 pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP;
1213 pSirSmeDisassocRsp->length = sizeof(tSirSmeDisassocRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -07001214 //sessionId
1215 pBuf = (tANI_U8 *) &pSirSmeDisassocRsp->sessionId;
1216 *pBuf = smesessionId;
1217 pBuf++;
1218
1219 //transactionId
1220 limCopyU16(pBuf, smetransactionId);
1221 pBuf += sizeof(tANI_U16);
1222
1223 //statusCode
1224 limCopyU32(pBuf, reasonCode);
1225 pBuf += sizeof(tSirResultCodes);
1226
1227 //peerMacAddr
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301228 vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001229 pBuf += sizeof(tSirMacAddr);
1230
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 // Clear Station Stats
1232 //for sta, it is always 1, IBSS is handled at halInitSta
1233
Jeff Johnson295189b2012-06-20 16:38:30 -07001234
1235
1236#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301237
Jeff Johnson295189b2012-06-20 16:38:30 -07001238 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_RSP_EVENT,
1239 psessionEntry, (tANI_U16)reasonCode, 0);
1240#endif
1241 pMsg = (tANI_U32*) pSirSmeDisassocRsp;
1242 break;
1243
1244 default:
1245 /**
1246 * Disassociation indication due to Disassociation
1247 * frame reception from peer entity or due to
1248 * loss of link with peer entity.
1249 */
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301250 pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd));
1251 if ( NULL == pSirSmeDisassocInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07001252 {
1253 // Log error
1254 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301255 FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_IND"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001256
1257 return;
1258 }
Abhishek Singhcd09b562013-12-24 16:02:20 +05301259 limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_IND with "
1260 "retCode: %d for "MAC_ADDRESS_STR),reasonCode,
1261 MAC_ADDR_ARRAY(peerMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001262 pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
1263 pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
1264
1265 /* Update SME session Id and Transaction Id */
1266 pSirSmeDisassocInd->sessionId = smesessionId;
1267 pSirSmeDisassocInd->transactionId = smetransactionId;
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001268 pSirSmeDisassocInd->reasonCode = reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -07001269 pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode;
1270
1271 limCopyU32(pBuf, reasonCode);
1272 pBuf += sizeof(tSirResultCodes);
1273
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301274 vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001275 pBuf += sizeof(tSirMacAddr);
1276
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301277 vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001278
1279
1280#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1281 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT,
1282 psessionEntry, (tANI_U16)reasonCode, 0);
1283#endif
1284 pMsg = (tANI_U32*) pSirSmeDisassocInd;
Jeff Johnson295189b2012-06-20 16:38:30 -07001285
1286 break;
1287 }
1288
1289 /* Delete the PE session Created */
1290 if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) ||
1291 (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) )
1292 {
1293 peDeleteSession(pMac,psessionEntry);
1294 }
1295
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001296 limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS,
Jeff Johnson295189b2012-06-20 16:38:30 -07001297 (tANI_U32*) pMsg );
Jeff Johnson295189b2012-06-20 16:38:30 -07001298} /*** end limSendSmeDisassocNtf() ***/
1299
1300
1301/** -----------------------------------------------------------------
1302 \brief limSendSmeDisassocInd() - sends SME_DISASSOC_IND
1303
1304 After receiving disassociation frame from peer entity, this
1305 function sends a eWNI_SME_DISASSOC_IND to SME with a specific
1306 reason code.
1307
1308 \param pMac - global mac structure
1309 \param pStaDs - station dph hash node
1310 \return none
1311 \sa
1312 ----------------------------------------------------------------- */
1313void
1314limSendSmeDisassocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry)
1315{
1316 tSirMsgQ mmhMsg;
1317 tSirSmeDisassocInd *pSirSmeDisassocInd;
1318
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301319 pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd));
1320 if ( NULL == pSirSmeDisassocInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07001321 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301322 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DISASSOC_IND"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001323 return;
1324 }
1325
Jeff Johnson295189b2012-06-20 16:38:30 -07001326 pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
1327 pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
Jeff Johnson295189b2012-06-20 16:38:30 -07001328
Jeff Johnson295189b2012-06-20 16:38:30 -07001329 pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId;
1330 pSirSmeDisassocInd->transactionId = psessionEntry->transactionId;
1331 pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason;
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001332 pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301333
1334 vos_mem_copy( pSirSmeDisassocInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
1335
1336 vos_mem_copy( pSirSmeDisassocInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001337
Jeff Johnson295189b2012-06-20 16:38:30 -07001338 pSirSmeDisassocInd->staId = pStaDs->staIndex;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301339
Jeff Johnson295189b2012-06-20 16:38:30 -07001340 mmhMsg.type = eWNI_SME_DISASSOC_IND;
1341 mmhMsg.bodyptr = pSirSmeDisassocInd;
1342 mmhMsg.bodyval = 0;
1343
Jeff Johnsone7245742012-09-05 17:12:55 -07001344 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001345#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1346 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason);
1347#endif //FEATURE_WLAN_DIAG_SUPPORT
1348
1349 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1350
1351} /*** end limSendSmeDisassocInd() ***/
1352
1353
1354/** -----------------------------------------------------------------
1355 \brief limSendSmeDeauthInd() - sends SME_DEAUTH_IND
1356
1357 After receiving deauthentication frame from peer entity, this
1358 function sends a eWNI_SME_DEAUTH_IND to SME with a specific
1359 reason code.
1360
1361 \param pMac - global mac structure
1362 \param pStaDs - station dph hash node
1363 \return none
1364 \sa
1365 ----------------------------------------------------------------- */
1366void
1367limSendSmeDeauthInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry)
1368{
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 tSirMsgQ mmhMsg;
1370 tSirSmeDeauthInd *pSirSmeDeauthInd;
1371
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301372 pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd));
1373 if ( NULL == pSirSmeDeauthInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07001374 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301375 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DEAUTH_IND "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 return;
1377 }
1378
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
1380 pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
Jeff Johnson295189b2012-06-20 16:38:30 -07001381
Jeff Johnson295189b2012-06-20 16:38:30 -07001382 pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId;
1383 pSirSmeDeauthInd->transactionId = psessionEntry->transactionId;
1384 if(eSIR_INFRA_AP_MODE == psessionEntry->bssType)
1385 {
1386 pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.cleanupTrigger;
1387 }
1388 else
1389 {
1390 //Need to indicatet he reascon code over the air
1391 pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.disassocReason;
1392 }
1393 //BSSID
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301394 vos_mem_copy( pSirSmeDeauthInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001395 //peerMacAddr
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301396 vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr));
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001397 pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
Jeff Johnson295189b2012-06-20 16:38:30 -07001398
Jeff Johnson295189b2012-06-20 16:38:30 -07001399
Jeff Johnson295189b2012-06-20 16:38:30 -07001400 pSirSmeDeauthInd->staId = pStaDs->staIndex;
Jeff Johnson295189b2012-06-20 16:38:30 -07001401
1402 mmhMsg.type = eWNI_SME_DEAUTH_IND;
1403 mmhMsg.bodyptr = pSirSmeDeauthInd;
1404 mmhMsg.bodyval = 0;
1405
Jeff Johnsone7245742012-09-05 17:12:55 -07001406 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001407#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1408 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, psessionEntry, 0, pStaDs->mlmStaContext.cleanupTrigger);
1409#endif //FEATURE_WLAN_DIAG_SUPPORT
1410
1411 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1412 return;
1413} /*** end limSendSmeDeauthInd() ***/
1414
Hoonki Leee6bfe942013-02-05 15:01:19 -08001415#ifdef FEATURE_WLAN_TDLS
1416/**
1417 * limSendSmeTDLSDelStaInd()
1418 *
1419 *FUNCTION:
1420 * This function is called to send the TDLS STA context deletion to SME.
1421 *
1422 *LOGIC:
1423 *
1424 *ASSUMPTIONS:
1425 *
1426 *NOTE:
1427 * NA
1428 *
1429 * @param pMac - Pointer to global MAC structure
1430 * @param pStaDs - Pointer to internal STA Datastructure
1431 * @param psessionEntry - Pointer to the session entry
1432 * @param reasonCode - Reason for TDLS sta deletion
1433 * @return None
1434 */
1435void
1436limSendSmeTDLSDelStaInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, tANI_U16 reasonCode)
1437{
1438 tSirMsgQ mmhMsg;
1439 tSirTdlsDelStaInd *pSirTdlsDelStaInd;
1440
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301441 pSirTdlsDelStaInd = vos_mem_malloc(sizeof(tSirTdlsDelStaInd));
1442 if ( NULL == pSirTdlsDelStaInd )
Hoonki Leee6bfe942013-02-05 15:01:19 -08001443 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301444 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_TDLS_DEL_STA_IND "));
Hoonki Leee6bfe942013-02-05 15:01:19 -08001445 return;
1446 }
1447
1448 //messageType
1449 pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND;
1450 pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd);
1451
1452 //sessionId
1453 pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId;
1454
1455 //peerMacAddr
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301456 vos_mem_copy( pSirTdlsDelStaInd->peerMac, pStaDs->staAddr, sizeof(tSirMacAddr));
Hoonki Leee6bfe942013-02-05 15:01:19 -08001457
1458 //staId
1459 limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->staId), (tANI_U16)pStaDs->staIndex);
1460
1461 //reasonCode
1462 limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->reasonCode), reasonCode);
1463
1464 mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND;
1465 mmhMsg.bodyptr = pSirTdlsDelStaInd;
1466 mmhMsg.bodyval = 0;
1467
1468
1469 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1470 return;
1471}/*** end limSendSmeTDLSDelStaInd() ***/
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -08001472
1473/**
1474 * limSendSmeTDLSDeleteAllPeerInd()
1475 *
1476 *FUNCTION:
1477 * This function is called to send the eWNI_SME_TDLS_DEL_ALL_PEER_IND
1478 * message to SME.
1479 *
1480 *LOGIC:
1481 *
1482 *ASSUMPTIONS:
1483 *
1484 *NOTE:
1485 * NA
1486 *
1487 * @param pMac - Pointer to global MAC structure
1488 * @param psessionEntry - Pointer to the session entry
1489 * @return None
1490 */
1491void
1492limSendSmeTDLSDeleteAllPeerInd(tpAniSirGlobal pMac, tpPESession psessionEntry)
1493{
1494 tSirMsgQ mmhMsg;
1495 tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd;
1496
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301497 pSirTdlsDelAllPeerInd = vos_mem_malloc(sizeof(tSirTdlsDelAllPeerInd));
1498 if ( NULL == pSirTdlsDelAllPeerInd )
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -08001499 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301500 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_TDLS_DEL_ALL_PEER_IND"));
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -08001501 return;
1502 }
1503
1504 //messageType
1505 pSirTdlsDelAllPeerInd->messageType = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
1506 pSirTdlsDelAllPeerInd->length = sizeof(tSirTdlsDelAllPeerInd);
1507
1508 //sessionId
1509 pSirTdlsDelAllPeerInd->sessionId = psessionEntry->smeSessionId;
1510
1511 mmhMsg.type = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
1512 mmhMsg.bodyptr = pSirTdlsDelAllPeerInd;
1513 mmhMsg.bodyval = 0;
1514
1515
1516 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1517 return;
1518}/*** end limSendSmeTDLSDeleteAllPeerInd() ***/
Gopichand Nakkalab977a972013-02-18 19:15:09 -08001519
1520/**
1521 * limSendSmeMgmtTXCompletion()
1522 *
1523 *FUNCTION:
1524 * This function is called to send the eWNI_SME_MGMT_FRM_TX_COMPLETION_IND
1525 * message to SME.
1526 *
1527 *LOGIC:
1528 *
1529 *ASSUMPTIONS:
1530 *
1531 *NOTE:
1532 * NA
1533 *
1534 * @param pMac - Pointer to global MAC structure
1535 * @param psessionEntry - Pointer to the session entry
1536 * @param txCompleteStatus - TX Complete Status of Mgmt Frames
1537 * @return None
1538 */
1539void
1540limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac,
1541 tpPESession psessionEntry,
1542 tANI_U32 txCompleteStatus)
1543{
1544 tSirMsgQ mmhMsg;
1545 tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd;
1546
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301547 pSirMgmtTxCompletionInd = vos_mem_malloc(sizeof(tSirMgmtTxCompletionInd));
1548 if ( NULL == pSirMgmtTxCompletionInd )
Gopichand Nakkalab977a972013-02-18 19:15:09 -08001549 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301550 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_MGMT_FRM_TX_COMPLETION_IND"));
Gopichand Nakkalab977a972013-02-18 19:15:09 -08001551 return;
1552 }
1553
1554 //messageType
1555 pSirMgmtTxCompletionInd->messageType = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND;
1556 pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd);
1557
1558 //sessionId
1559 pSirMgmtTxCompletionInd->sessionId = psessionEntry->smeSessionId;
1560
1561 pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus;
1562
1563 mmhMsg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND;
1564 mmhMsg.bodyptr = pSirMgmtTxCompletionInd;
1565 mmhMsg.bodyval = 0;
1566
1567
1568 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1569 return;
1570}/*** end limSendSmeTDLSDeleteAllPeerInd() ***/
Hoonki Leee6bfe942013-02-05 15:01:19 -08001571#endif
1572
Jeff Johnson295189b2012-06-20 16:38:30 -07001573
1574/**
1575 * limSendSmeDeauthNtf()
1576 *
1577 *FUNCTION:
1578 * This function is called by limProcessSmeMessages() to send
1579 * eWNI_SME_DISASSOC_RSP/IND message to host
1580 *
1581 *PARAMS:
1582 *
1583 *LOGIC:
1584 *
1585 *ASSUMPTIONS:
1586 * NA
1587 *
1588 *NOTE:
1589 * This function is used for sending eWNI_SME_DEAUTH_CNF or
1590 * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger.
1591 *
1592 * @param peerMacAddr Indicates the peer MAC addr to which
1593 * deauthentication was initiated
1594 * @param reasonCode Indicates the reason for Deauthetication
1595 * @param deauthTrigger Indicates the trigger for Deauthetication
1596 * @param aid Indicates the STAID. This parameter is present
1597 * only on AP.
1598 *
1599 * @return None
1600 */
1601void
1602limSendSmeDeauthNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirResultCodes reasonCode,
1603 tANI_U16 deauthTrigger, tANI_U16 aid,tANI_U8 smesessionId, tANI_U16 smetransactionId)
1604{
1605 tANI_U8 *pBuf;
1606 tSirSmeDeauthRsp *pSirSmeDeauthRsp;
1607 tSirSmeDeauthInd *pSirSmeDeauthInd;
1608 tpPESession psessionEntry;
1609 tANI_U8 sessionId;
1610 tANI_U32 *pMsg;
1611
1612 psessionEntry = peFindSessionByBssid(pMac,peerMacAddr,&sessionId);
1613 switch (deauthTrigger)
1614 {
1615 case eLIM_PEER_ENTITY_DEAUTH:
1616 return;
1617
1618 case eLIM_HOST_DEAUTH:
1619 /**
1620 * Deauthentication response to host triggered
1621 * deauthentication.
1622 */
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301623 pSirSmeDeauthRsp = vos_mem_malloc(sizeof(tSirSmeDeauthRsp));
1624 if ( NULL == pSirSmeDeauthRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07001625 {
1626 // Log error
1627 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301628 FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001629
1630 return;
1631 }
Abhishek Singhcd09b562013-12-24 16:02:20 +05301632 limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with "
1633 "retCode: %d for"MAC_ADDRESS_STR),reasonCode,
1634 MAC_ADDR_ARRAY(peerMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001635 pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP;
1636 pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -07001637 pSirSmeDeauthRsp->statusCode = reasonCode;
1638 pSirSmeDeauthRsp->sessionId = smesessionId;
1639 pSirSmeDeauthRsp->transactionId = smetransactionId;
1640
1641 pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301642 vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001643
Jeff Johnson295189b2012-06-20 16:38:30 -07001644#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1645 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
1646 psessionEntry, 0, (tANI_U16)reasonCode);
1647#endif
1648 pMsg = (tANI_U32*)pSirSmeDeauthRsp;
1649
1650 break;
1651
1652 default:
1653 /**
1654 * Deauthentication indication due to Deauthentication
1655 * frame reception from peer entity or due to
1656 * loss of link with peer entity.
1657 */
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301658 pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd));
1659 if ( NULL == pSirSmeDeauthInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07001660 {
1661 // Log error
1662 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301663 FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_Ind"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001664
1665 return;
1666 }
Abhishek Singhcd09b562013-12-24 16:02:20 +05301667 limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_IND with "
1668 "retCode: %d for "MAC_ADDRESS_STR),reasonCode,
1669 MAC_ADDR_ARRAY(peerMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001670 pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
1671 pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001672 pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
Jeff Johnson295189b2012-06-20 16:38:30 -07001673
1674 // sessionId
1675 pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId;
1676 *pBuf++ = smesessionId;
1677
1678 //transaction ID
1679 limCopyU16(pBuf, smetransactionId);
1680 pBuf += sizeof(tANI_U16);
1681
1682 // status code
1683 limCopyU32(pBuf, reasonCode);
1684 pBuf += sizeof(tSirResultCodes);
1685
1686 //bssId
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301687 vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001688 pBuf += sizeof(tSirMacAddr);
1689
1690 //peerMacAddr
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301691 vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001692
Jeff Johnson295189b2012-06-20 16:38:30 -07001693#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1694 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT,
1695 psessionEntry, 0, (tANI_U16)reasonCode);
1696#endif //FEATURE_WLAN_DIAG_SUPPORT
1697 pMsg = (tANI_U32*)pSirSmeDeauthInd;
1698
1699 break;
1700 }
1701
1702 /*Delete the PE session created */
1703 if(psessionEntry != NULL)
1704 {
1705 peDeleteSession(pMac,psessionEntry);
1706 }
1707
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001708 limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS,
1709 (tANI_U32*) pMsg );
Jeff Johnson295189b2012-06-20 16:38:30 -07001710
Jeff Johnson295189b2012-06-20 16:38:30 -07001711} /*** end limSendSmeDeauthNtf() ***/
1712
1713
1714/**
1715 * limSendSmeWmStatusChangeNtf()
1716 *
1717 *FUNCTION:
1718 * This function is called by limProcessSmeMessages() to send
1719 * eWNI_SME_WM_STATUS_CHANGE_NTF message to host.
1720 *
1721 *PARAMS:
1722 *
1723 *LOGIC:
1724 *
1725 *ASSUMPTIONS:
1726 * NA
1727 *
1728 *NOTE:
1729 *
1730 * @param statusChangeCode Indicates the change in the wireless medium.
1731 * @param statusChangeInfo Indicates the information associated with
1732 * change in the wireless medium.
1733 * @param infoLen Indicates the length of status change information
1734 * being sent.
1735 *
1736 * @return None
1737 */
1738void
1739limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusChangeCode,
1740 tANI_U32 *pStatusChangeInfo, tANI_U16 infoLen, tANI_U8 sessionId)
1741{
1742 tSirMsgQ mmhMsg;
1743 tSirSmeWmStatusChangeNtf *pSirSmeWmStatusChangeNtf;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301744 pSirSmeWmStatusChangeNtf = vos_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf));
1745 if ( NULL == pSirSmeWmStatusChangeNtf )
Jeff Johnson295189b2012-06-20 16:38:30 -07001746 {
1747 limLog(pMac, LOGE,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301748 FL("call to AllocateMemory failed for eWNI_SME_WM_STATUS_CHANGE_NTF"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001749 return;
1750 }
1751
Jeff Johnson295189b2012-06-20 16:38:30 -07001752
1753 mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF;
1754 mmhMsg.bodyval = 0;
1755 mmhMsg.bodyptr = pSirSmeWmStatusChangeNtf;
1756
1757 switch(statusChangeCode)
1758 {
1759 case eSIR_SME_RADAR_DETECTED:
1760
Jeff Johnson295189b2012-06-20 16:38:30 -07001761 break;
1762
1763 case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP:
Jeff Johnson295189b2012-06-20 16:38:30 -07001764 break;
1765
1766 case eSIR_SME_BACKGROUND_SCAN_FAIL:
1767 limPackBkgndScanFailNotify(pMac,
1768 statusChangeCode,
1769 (tpSirBackgroundScanInfo)pStatusChangeInfo,
1770 pSirSmeWmStatusChangeNtf, sessionId);
1771 break;
1772
1773 default:
Jeff Johnson295189b2012-06-20 16:38:30 -07001774 pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF;
1775 pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode;
1776 pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf);
1777 pSirSmeWmStatusChangeNtf->sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -07001778 if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen)
1779 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301780 vos_mem_copy( (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo,
1781 (tANI_U8 *)pStatusChangeInfo, infoLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07001782 }
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001783 limLog(pMac, LOGE, FL("***---*** StatusChg: code 0x%x, length %d ***---***"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001784 statusChangeCode, infoLen);
1785 break;
1786 }
1787
1788
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08001789 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001790 if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT))
1791 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301792 vos_mem_free(pSirSmeWmStatusChangeNtf);
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001793 limLog( pMac, LOGP, FL("limSysProcessMmhMsgApi failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001794 }
1795
1796} /*** end limSendSmeWmStatusChangeNtf() ***/
1797
1798
1799/**
1800 * limSendSmeSetContextRsp()
1801 *
1802 *FUNCTION:
1803 * This function is called by limProcessSmeMessages() to send
1804 * eWNI_SME_SETCONTEXT_RSP message to host
1805 *
1806 *PARAMS:
1807 *
1808 *LOGIC:
1809 *
1810 *ASSUMPTIONS:
1811 * NA
1812 *
1813 *NOTE:
1814 *
1815 * @param pMac Pointer to Global MAC structure
1816 * @param peerMacAddr Indicates the peer MAC addr to which
1817 * setContext was performed
1818 * @param aid Indicates the aid corresponding to the peer MAC
1819 * address
1820 * @param resultCode Indicates the result of previously issued
1821 * eWNI_SME_SETCONTEXT_RSP message
1822 *
1823 * @return None
1824 */
1825void
1826limSendSmeSetContextRsp(tpAniSirGlobal pMac,
1827 tSirMacAddr peerMacAddr, tANI_U16 aid,
1828 tSirResultCodes resultCode,
1829 tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
1830{
1831
1832 tANI_U8 *pBuf;
1833 tSirMsgQ mmhMsg;
1834 tSirSmeSetContextRsp *pSirSmeSetContextRsp;
1835
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301836 pSirSmeSetContextRsp = vos_mem_malloc(sizeof(tSirSmeSetContextRsp));
1837 if ( NULL == pSirSmeSetContextRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07001838 {
1839 // Log error
1840 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301841 FL("call to AllocateMemory failed for SmeSetContextRsp"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001842
1843 return;
1844 }
1845
Jeff Johnson295189b2012-06-20 16:38:30 -07001846 pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP;
1847 pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -07001848 pSirSmeSetContextRsp->statusCode = resultCode;
1849
1850 pBuf = pSirSmeSetContextRsp->peerMacAddr;
1851
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301852 vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001853 pBuf += sizeof(tSirMacAddr);
1854
Jeff Johnson295189b2012-06-20 16:38:30 -07001855
1856 /* Update SME session and transaction Id*/
1857 pSirSmeSetContextRsp->sessionId = smesessionId;
1858 pSirSmeSetContextRsp->transactionId = smetransactionId;
1859
1860 mmhMsg.type = eWNI_SME_SETCONTEXT_RSP;
1861 mmhMsg.bodyptr = pSirSmeSetContextRsp;
1862 mmhMsg.bodyval = 0;
Leela Venkata Kiran Kumar Reddy Chirala68a6abe2013-02-28 07:43:16 -08001863 if(NULL == psessionEntry)
1864 {
1865 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
1866 }
1867 else
1868 {
1869 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
1870 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001871
1872#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1873 limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
1874#endif //FEATURE_WLAN_DIAG_SUPPORT
1875
1876 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1877} /*** end limSendSmeSetContextRsp() ***/
1878
1879/**
1880 * limSendSmeRemoveKeyRsp()
1881 *
1882 *FUNCTION:
1883 * This function is called by limProcessSmeMessages() to send
1884 * eWNI_SME_REMOVEKEY_RSP message to host
1885 *
1886 *PARAMS:
1887 *
1888 *LOGIC:
1889 *
1890 *ASSUMPTIONS:
1891 * NA
1892 *
1893 *NOTE:
1894 *
1895 * @param pMac Pointer to Global MAC structure
1896 * @param peerMacAddr Indicates the peer MAC addr to which
1897 * Removekey was performed
1898 * @param aid Indicates the aid corresponding to the peer MAC
1899 * address
1900 * @param resultCode Indicates the result of previously issued
1901 * eWNI_SME_REMOVEKEY_RSP message
1902 *
1903 * @return None
1904 */
1905void
1906limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac,
1907 tSirMacAddr peerMacAddr,
1908 tSirResultCodes resultCode,
1909 tpPESession psessionEntry,tANI_U8 smesessionId,
1910 tANI_U16 smetransactionId)
1911{
1912 tANI_U8 *pBuf;
1913 tSirMsgQ mmhMsg;
1914 tSirSmeRemoveKeyRsp *pSirSmeRemoveKeyRsp;
1915
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301916 pSirSmeRemoveKeyRsp = vos_mem_malloc(sizeof(tSirSmeRemoveKeyRsp));
1917 if ( NULL == pSirSmeRemoveKeyRsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07001918 {
1919 // Log error
1920 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301921 FL("call to AllocateMemory failed for SmeRemoveKeyRsp"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001922
1923 return;
1924 }
1925
Jeff Johnson295189b2012-06-20 16:38:30 -07001926
1927
1928 if(psessionEntry != NULL)
1929 {
1930 pBuf = pSirSmeRemoveKeyRsp->peerMacAddr;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301931 vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07001932 }
1933
1934 pSirSmeRemoveKeyRsp->messageType = eWNI_SME_REMOVEKEY_RSP;
1935 pSirSmeRemoveKeyRsp->length = sizeof(tSirSmeRemoveKeyRsp);
1936 pSirSmeRemoveKeyRsp->statusCode = resultCode;
1937
1938 /* Update SME session and transaction Id*/
1939 pSirSmeRemoveKeyRsp->sessionId = smesessionId;
1940 pSirSmeRemoveKeyRsp->transactionId = smetransactionId;
1941
1942 mmhMsg.type = eWNI_SME_REMOVEKEY_RSP;
1943 mmhMsg.bodyptr = pSirSmeRemoveKeyRsp;
1944 mmhMsg.bodyval = 0;
Leela Venkata Kiran Kumar Reddy Chirala68a6abe2013-02-28 07:43:16 -08001945 if(NULL == psessionEntry)
1946 {
1947 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
1948 }
1949 else
1950 {
1951 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
1952 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001953 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1954} /*** end limSendSmeSetContextRsp() ***/
1955
1956
1957/**
1958 * limSendSmePromiscuousModeRsp()
1959 *
1960 *FUNCTION:
1961 * This function is called by limProcessSmeMessages() to send
1962 * eWNI_PROMISCUOUS_MODE_RSP message to host
1963 *
1964 *PARAMS:
1965 *
1966 *LOGIC:
1967 *
1968 *ASSUMPTIONS:
1969 * NA
1970 *
1971 *NOTE:
1972 * This function is used for sending eWNI_SME_PROMISCUOUS_MODE_RSP to
1973 * host as a reply to eWNI_SME_PROMISCUOUS_MODE_REQ directive from it.
1974 *
1975 * @param None
1976 * @return None
1977 */
1978void
1979limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac)
1980{
1981#if 0
1982 tSirMsgQ mmhMsg;
1983 tSirMbMsg *pMbMsg;
1984
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301985 pMbMsg = vos_mem_malloc(sizeof(tSirMbMsg));
1986 if ( NULL == pMbMsg )
Jeff Johnson295189b2012-06-20 16:38:30 -07001987 {
1988 // Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05301989 limLog(pMac, LOGP, FL("call to AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001990
1991 return;
1992 }
1993
1994 pMbMsg->type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1995 pMbMsg->msgLen = 4;
1996
1997 mmhMsg.type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1998 mmhMsg.bodyptr = pMbMsg;
1999 mmhMsg.bodyval = 0;
2000 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
2001 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2002#endif
2003} /*** end limSendSmePromiscuousModeRsp() ***/
2004
2005
2006
2007/**
2008 * limSendSmeNeighborBssInd()
2009 *
2010 *FUNCTION:
2011 * This function is called by limLookupNaddHashEntry() to send
2012 * eWNI_SME_NEIGHBOR_BSS_IND message to host
2013 *
2014 *PARAMS:
2015 *
2016 *LOGIC:
2017 *
2018 *ASSUMPTIONS:
2019 * NA
2020 *
2021 *NOTE:
2022 * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to
2023 * host upon detecting new BSS during background scanning if CFG
2024 * option is enabled for sending such indication
2025 *
2026 * @param pMac - Pointer to Global MAC structure
2027 * @return None
2028 */
2029
2030void
2031limSendSmeNeighborBssInd(tpAniSirGlobal pMac,
2032 tLimScanResultNode *pBssDescr)
2033{
2034 tSirMsgQ msgQ;
2035 tANI_U32 val;
2036 tSirSmeNeighborBssInd *pNewBssInd;
2037
2038 if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) ||
2039 ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) &&
2040 pMac->lim.gLimRspReqd))
2041 {
2042 // LIM is not in background scan state OR
2043 // current scan is initiated by HDD.
2044 // No need to send new BSS indication to HDD
2045 return;
2046 }
2047
2048 if (wlan_cfgGetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != eSIR_SUCCESS)
2049 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002050 limLog(pMac, LOGP, FL("could not get NEIGHBOR_BSS_IND from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002051
2052 return;
2053 }
2054
2055 if (val == 0)
2056 return;
2057
2058 /**
2059 * Need to indicate new BSSs found during
2060 * background scanning to host.
2061 * Allocate buffer for sending indication.
2062 * Length of buffer is length of BSS description
2063 * and length of header itself
2064 */
2065 val = pBssDescr->bssDescription.length + sizeof(tANI_U16) + sizeof(tANI_U32) + sizeof(tANI_U8);
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302066 pNewBssInd = vos_mem_malloc(val);
2067 if ( NULL == pNewBssInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07002068 {
2069 // Log error
2070 limLog(pMac, LOGP,
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302071 FL("call to AllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002072
2073 return;
2074 }
2075
Jeff Johnson295189b2012-06-20 16:38:30 -07002076 pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND;
2077 pNewBssInd->length = (tANI_U16) val;
Jeff Johnson295189b2012-06-20 16:38:30 -07002078 pNewBssInd->sessionId = 0;
2079
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302080 vos_mem_copy( (tANI_U8 *) pNewBssInd->bssDescription,
Jeff Johnson295189b2012-06-20 16:38:30 -07002081 (tANI_U8 *) &pBssDescr->bssDescription,
2082 pBssDescr->bssDescription.length + sizeof(tANI_U16));
Jeff Johnson295189b2012-06-20 16:38:30 -07002083
2084 msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND;
2085 msgQ.bodyptr = pNewBssInd;
2086 msgQ.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002087 MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002088 limSysProcessMmhMsgApi(pMac, &msgQ, ePROT);
2089} /*** end limSendSmeNeighborBssInd() ***/
2090
2091/** -----------------------------------------------------------------
2092 \brief limSendSmeAddtsRsp() - sends SME ADDTS RSP
2093 \ This function sends a eWNI_SME_ADDTS_RSP to SME.
2094 \ SME only looks at rc and tspec field.
2095 \param pMac - global mac structure
2096 \param rspReqd - is SmeAddTsRsp required
2097 \param status - status code of SME_ADD_TS_RSP
2098 \return tspec
2099 \sa
2100 ----------------------------------------------------------------- */
2101void
2102limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESession psessionEntry,
2103 tSirMacTspecIE tspec, tANI_U8 smesessionId, tANI_U16 smetransactionId)
2104{
2105 tpSirAddtsRsp rsp;
2106 tSirMsgQ mmhMsg;
2107
2108 if (! rspReqd)
2109 return;
2110
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302111 rsp = vos_mem_malloc(sizeof(tSirAddtsRsp));
2112 if ( NULL == rsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07002113 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302114 limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002115 return;
2116 }
2117
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302118 vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002119 rsp->messageType = eWNI_SME_ADDTS_RSP;
2120 rsp->rc = status;
2121 rsp->rsp.status = (enum eSirMacStatusCodes) status;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302122 //vos_mem_copy( (tANI_U8 *) &rsp->rsp.tspec, (tANI_U8 *) &addts->tspec, sizeof(addts->tspec));
Jeff Johnson295189b2012-06-20 16:38:30 -07002123 rsp->rsp.tspec = tspec;
Jeff Johnson295189b2012-06-20 16:38:30 -07002124 /* Update SME session Id and transcation Id */
2125 rsp->sessionId = smesessionId;
2126 rsp->transactionId = smetransactionId;
2127
2128 mmhMsg.type = eWNI_SME_ADDTS_RSP;
2129 mmhMsg.bodyptr = rsp;
2130 mmhMsg.bodyval = 0;
Leela Venkata Kiran Kumar Reddy Chirala68a6abe2013-02-28 07:43:16 -08002131 if(NULL == psessionEntry)
2132 {
2133 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
2134 }
2135 else
2136 {
2137 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
2138 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002139#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2140 limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0);
2141#endif //FEATURE_WLAN_DIAG_SUPPORT
2142
2143 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2144 return;
2145}
2146
2147void
2148limSendSmeAddtsInd(tpAniSirGlobal pMac, tpSirAddtsReqInfo addts)
2149{
2150 tpSirAddtsRsp rsp;
2151 tSirMsgQ mmhMsg;
2152
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002153 limLog(pMac, LOGW, "SendSmeAddtsInd (token %d, tsid %d, up %d)",
Jeff Johnson295189b2012-06-20 16:38:30 -07002154 addts->dialogToken,
2155 addts->tspec.tsinfo.traffic.tsid,
2156 addts->tspec.tsinfo.traffic.userPrio);
2157
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302158 rsp = vos_mem_malloc(sizeof(tSirAddtsRsp));
2159 if ( NULL == rsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07002160 {
2161 // Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302162 limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_IND"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002163 return;
2164 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302165 vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002166
2167 rsp->messageType = eWNI_SME_ADDTS_IND;
2168
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302169 vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) addts, sizeof(*addts));
Jeff Johnson295189b2012-06-20 16:38:30 -07002170
2171 mmhMsg.type = eWNI_SME_ADDTS_IND;
2172 mmhMsg.bodyptr = rsp;
2173 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002174 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002175 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2176}
2177
2178void
2179limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
2180{
2181 tpSirDeltsRsp rsp;
2182 tSirMsgQ mmhMsg;
2183
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002184 limLog(pMac, LOGW, "SendSmeDeltsRsp (aid %d, tsid %d, up %d) status %d",
Jeff Johnson295189b2012-06-20 16:38:30 -07002185 delts->aid,
2186 delts->req.tsinfo.traffic.tsid,
2187 delts->req.tsinfo.traffic.userPrio,
2188 status);
2189 if (! delts->rspReqd)
2190 return;
2191
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302192 rsp = vos_mem_malloc(sizeof(tSirDeltsRsp));
2193 if ( NULL == rsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07002194 {
2195 // Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302196 limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_RSP"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002197 return;
2198 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302199 vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002200
2201 if(psessionEntry != NULL)
2202 {
2203
2204 rsp->aid = delts->aid;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302205 vos_mem_copy( (tANI_U8 *) &rsp->macAddr[0], (tANI_U8 *) &delts->macAddr[0], 6);
2206 vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) &delts->req, sizeof(tSirDeltsReqInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07002207 }
2208
2209
2210 rsp->messageType = eWNI_SME_DELTS_RSP;
2211 rsp->rc = status;
2212
2213 /* Update SME session Id and transcation Id */
2214 rsp->sessionId = smesessionId;
2215 rsp->transactionId = smetransactionId;
2216
2217 mmhMsg.type = eWNI_SME_DELTS_RSP;
2218 mmhMsg.bodyptr = rsp;
2219 mmhMsg.bodyval = 0;
Leela Venkata Kiran Kumar Reddy Chirala68a6abe2013-02-28 07:43:16 -08002220 if(NULL == psessionEntry)
2221 {
2222 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
2223 }
2224 else
2225 {
2226 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
2227 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002228#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2229 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0);
2230#endif //FEATURE_WLAN_DIAG_SUPPORT
2231
2232 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2233}
2234
2235void
2236limSendSmeDeltsInd(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, tANI_U16 aid,tpPESession psessionEntry)
2237{
2238 tpSirDeltsRsp rsp;
2239 tSirMsgQ mmhMsg;
2240
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002241 limLog(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)",
Jeff Johnson295189b2012-06-20 16:38:30 -07002242 aid,
2243 delts->tsinfo.traffic.tsid,
2244 delts->tsinfo.traffic.userPrio);
2245
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302246 rsp = vos_mem_malloc(sizeof(tSirDeltsRsp));
2247 if ( NULL == rsp )
Jeff Johnson295189b2012-06-20 16:38:30 -07002248 {
2249 // Log error
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302250 limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_IND"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002251 return;
2252 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302253 vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002254
2255 rsp->messageType = eWNI_SME_DELTS_IND;
2256 rsp->rc = eSIR_SUCCESS;
2257 rsp->aid = aid;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302258 vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) delts, sizeof(*delts));
Jeff Johnson295189b2012-06-20 16:38:30 -07002259
2260 /* Update SME session Id and SME transaction Id */
2261
2262 rsp->sessionId = psessionEntry->smeSessionId;
2263 rsp->transactionId = psessionEntry->transactionId;
2264
2265 mmhMsg.type = eWNI_SME_DELTS_IND;
2266 mmhMsg.bodyptr = rsp;
2267 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002268 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002269#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2270 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, 0);
2271#endif //FEATURE_WLAN_DIAG_SUPPORT
2272
2273 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2274}
2275
2276/**
2277 * limSendSmeStatsRsp()
2278 *
2279 *FUNCTION:
2280 * This function is called to send 802.11 statistics response to HDD.
2281 * This function posts the result back to HDD. This is a response to
2282 * HDD's request for statistics.
2283 *
2284 *PARAMS:
2285 *
2286 *LOGIC:
2287 *
2288 *ASSUMPTIONS:
2289 * NA
2290 *
2291 *NOTE:
2292 * NA
2293 *
2294 * @param pMac Pointer to Global MAC structure
2295 * @param p80211Stats Statistics sent in response
2296 * @param resultCode TODO:
2297 *
2298 *
2299 * @return none
2300 */
2301
2302void
2303limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2304{
2305 tSirMsgQ mmhMsg;
2306 tSirSmeRsp *pMsgHdr = (tSirSmeRsp*) stats;
2307
2308 switch(msgType)
2309 {
2310 case WDA_STA_STAT_RSP:
2311 mmhMsg.type = eWNI_SME_STA_STAT_RSP;
2312 break;
2313 case WDA_AGGR_STAT_RSP:
2314 mmhMsg.type = eWNI_SME_AGGR_STAT_RSP;
2315 break;
2316 case WDA_GLOBAL_STAT_RSP:
2317 mmhMsg.type = eWNI_SME_GLOBAL_STAT_RSP;
2318 break;
2319 case WDA_STAT_SUMM_RSP:
2320 mmhMsg.type = eWNI_SME_STAT_SUMM_RSP;
2321 break;
2322 default:
2323 mmhMsg.type = msgType; //Response from within PE
2324 break;
2325 }
2326
2327 pMsgHdr->messageType = mmhMsg.type;
2328
2329 mmhMsg.bodyptr = stats;
2330 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002331 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002332 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2333
2334 return;
2335
2336} /*** end limSendSmeStatsRsp() ***/
2337
2338/**
2339 * limSendSmePEStatisticsRsp()
2340 *
2341 *FUNCTION:
2342 * This function is called to send 802.11 statistics response to HDD.
2343 * This function posts the result back to HDD. This is a response to
2344 * HDD's request for statistics.
2345 *
2346 *PARAMS:
2347 *
2348 *LOGIC:
2349 *
2350 *ASSUMPTIONS:
2351 * NA
2352 *
2353 *NOTE:
2354 * NA
2355 *
2356 * @param pMac Pointer to Global MAC structure
2357 * @param p80211Stats Statistics sent in response
2358 * @param resultCode TODO:
2359 *
2360 *
2361 * @return none
2362 */
2363
2364void
2365limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2366{
2367 tSirMsgQ mmhMsg;
2368 tANI_U8 sessionId;
2369 tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats;
2370 tpPESession pPeSessionEntry;
2371
2372 //Get the Session Id based on Sta Id
2373 pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId);
2374
2375 //Fill the Session Id
2376 if(NULL != pPeSessionEntry)
2377 {
2378 //Fill the Session Id
2379 pPeStats->sessionId = pPeSessionEntry->smeSessionId;
2380 }
2381
2382 pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP;
2383
2384
2385 //msgType should be WDA_GET_STATISTICS_RSP
2386 mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP;
2387
2388 mmhMsg.bodyptr = stats;
2389 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002390 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002391 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2392
2393 return;
2394
2395} /*** end limSendSmePEStatisticsRsp() ***/
2396
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08002397#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
2398/**
2399 * limSendSmePEGetRoamRssiRsp()
2400 *
2401 *FUNCTION:
2402 * This function is called to send roam rssi response to HDD.
2403 * This function posts the result back to HDD. This is a response to
2404 * HDD's request to get roam rssi.
2405 *
2406 *PARAMS:
2407 *
2408 *LOGIC:
2409 *
2410 *ASSUMPTIONS:
2411 * NA
2412 *
2413 *NOTE:
2414 * NA
2415 *
2416 * @param pMac Pointer to Global MAC structure
2417 * @param p80211Stats Statistics sent in response
2418 * @param resultCode TODO:
2419 *
2420 *
2421 * @return none
2422 */
2423
2424void
2425limSendSmePEGetRoamRssiRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2426{
2427 tSirMsgQ mmhMsg;
2428 tANI_U8 sessionId;
2429 tAniGetRoamRssiRsp *pPeStats = (tAniGetRoamRssiRsp *) stats;
2430 tpPESession pPeSessionEntry = NULL;
2431
2432 //Get the Session Id based on Sta Id
2433 pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId);
2434
2435 //Fill the Session Id
2436 if(NULL != pPeSessionEntry)
2437 {
2438 //Fill the Session Id
2439 pPeStats->sessionId = pPeSessionEntry->smeSessionId;
2440 }
2441
2442 pPeStats->msgType = eWNI_SME_GET_ROAM_RSSI_RSP;
2443
2444 //msgType should be WDA_GET_STATISTICS_RSP
2445 mmhMsg.type = eWNI_SME_GET_ROAM_RSSI_RSP;
2446
2447 mmhMsg.bodyptr = stats;
2448 mmhMsg.bodyval = 0;
2449 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
2450 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2451
2452 return;
2453
2454} /*** end limSendSmePEGetRoamRssiRsp() ***/
2455
2456#endif
2457
Jeff Johnson295189b2012-06-20 16:38:30 -07002458
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07002459#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
2460/**
2461 * limSendSmePECcxTsmRsp()
2462 *
2463 *FUNCTION:
2464 * This function is called to send tsm stats response to HDD.
2465 * This function posts the result back to HDD. This is a response to
2466 * HDD's request to get tsm stats.
2467 *
2468 *PARAMS:
2469 * @param pMac - Pointer to global pMac structure
2470 * @param pStats - Pointer to TSM Stats
2471 *
2472 * @return none
2473 */
2474
2475void
2476limSendSmePECcxTsmRsp(tpAniSirGlobal pMac, tAniGetTsmStatsRsp *pStats)
2477{
2478 tSirMsgQ mmhMsg;
2479 tANI_U8 sessionId;
2480 tAniGetTsmStatsRsp *pPeStats = (tAniGetTsmStatsRsp *) pStats;
2481 tpPESession pPeSessionEntry = NULL;
2482
2483 //Get the Session Id based on Sta Id
2484 pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId);
2485
2486 //Fill the Session Id
2487 if(NULL != pPeSessionEntry)
2488 {
2489 //Fill the Session Id
2490 pPeStats->sessionId = pPeSessionEntry->smeSessionId;
2491 }
2492 else
2493 {
2494 PELOGE(limLog(pMac, LOGE, FL("Session not found for the Sta id(%d)"),
2495 pPeStats->staId);)
2496 return;
2497 }
2498
2499 pPeStats->msgType = eWNI_SME_GET_TSM_STATS_RSP;
Srinivas Girigowda026433f2013-10-28 11:51:55 -07002500 pPeStats->tsmMetrics.RoamingCount = pPeSessionEntry->ccxContext.tsm.tsmMetrics.RoamingCount;
2501 pPeStats->tsmMetrics.RoamingDly = pPeSessionEntry->ccxContext.tsm.tsmMetrics.RoamingDly;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07002502
2503 mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP;
2504 mmhMsg.bodyptr = pStats;
2505 mmhMsg.bodyval = 0;
2506 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
2507 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2508
2509 return;
2510} /*** end limSendSmePECcxTsmRsp() ***/
2511
2512#endif /* FEATURE_WLAN_CCX) && FEATURE_WLAN_CCX_UPLOAD */
2513
2514
Jeff Johnson295189b2012-06-20 16:38:30 -07002515void
2516limSendSmeIBSSPeerInd(
2517 tpAniSirGlobal pMac,
2518 tSirMacAddr peerMacAddr,
2519 tANI_U16 staIndex,
2520 tANI_U8 ucastIdx,
2521 tANI_U8 bcastIdx,
2522 tANI_U8 *beacon,
2523 tANI_U16 beaconLen,
2524 tANI_U16 msgType,
2525 tANI_U8 sessionId)
2526{
2527 tSirMsgQ mmhMsg;
2528 tSmeIbssPeerInd *pNewPeerInd;
2529
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302530 pNewPeerInd = vos_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen);
2531 if ( NULL == pNewPeerInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07002532 {
2533 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2534 return;
2535 }
2536
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302537 vos_mem_set((void *) pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002538
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302539 vos_mem_copy( (tANI_U8 *) pNewPeerInd->peerAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07002540 peerMacAddr, sizeof(tSirMacAddr));
2541 pNewPeerInd->staId= staIndex;
2542 pNewPeerInd->ucastSig = ucastIdx;
2543 pNewPeerInd->bcastSig = bcastIdx;
2544 pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen;
2545 pNewPeerInd->mesgType = msgType;
2546 pNewPeerInd->sessionId = sessionId;
2547
2548 if ( beacon != NULL )
2549 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302550 vos_mem_copy((void*) ((tANI_U8*)pNewPeerInd+sizeof(tSmeIbssPeerInd)),
2551 (void*)beacon, beaconLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07002552 }
2553
2554 mmhMsg.type = msgType;
2555// mmhMsg.bodyval = (tANI_U32) pNewPeerInd;
2556 mmhMsg.bodyptr = pNewPeerInd;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002557 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002558 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2559
2560}
2561
2562
2563/** -----------------------------------------------------------------
2564 \brief limSendExitBmpsInd() - sends exit bmps indication
2565
2566 This function sends a eWNI_PMC_EXIT_BMPS_IND with a specific reason
2567 code to SME. This will trigger SME to get out of BMPS mode.
2568
2569 \param pMac - global mac structure
2570 \param reasonCode - reason for which PE wish to exit BMPS
2571 \return none
2572 \sa
2573 ----------------------------------------------------------------- */
2574void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode)
2575{
2576 tSirMsgQ mmhMsg;
2577 tANI_U16 msgLen = 0;
2578 tpSirSmeExitBmpsInd pExitBmpsInd;
2579
2580 msgLen = sizeof(tSirSmeExitBmpsInd);
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302581 pExitBmpsInd = vos_mem_malloc(msgLen);
2582 if ( NULL == pExitBmpsInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07002583 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302584 limLog(pMac, LOGP, FL("AllocateMemory failed for PMC_EXIT_BMPS_IND "));
Jeff Johnson295189b2012-06-20 16:38:30 -07002585 return;
2586 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302587 vos_mem_set(pExitBmpsInd, msgLen, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002588
Jeff Johnson295189b2012-06-20 16:38:30 -07002589 pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND;
2590 pExitBmpsInd->mesgLen = msgLen;
Jeff Johnson295189b2012-06-20 16:38:30 -07002591 pExitBmpsInd->exitBmpsReason = reasonCode;
2592 pExitBmpsInd->statusCode = eSIR_SME_SUCCESS;
2593
2594 mmhMsg.type = eWNI_PMC_EXIT_BMPS_IND;
2595 mmhMsg.bodyptr = pExitBmpsInd;
2596 mmhMsg.bodyval = 0;
2597
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002598 PELOG1(limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. "));)
Jeff Johnsone7245742012-09-05 17:12:55 -07002599 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002600#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2601 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode);
2602#endif //FEATURE_WLAN_DIAG_SUPPORT
2603
2604 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2605 return;
2606
2607} /*** end limSendExitBmpsInd() ***/
2608
2609
2610
2611
2612/*--------------------------------------------------------------------------
2613 \brief peDeleteSession() - Handle the Delete BSS Response from HAL.
2614
2615
2616 \param pMac - pointer to global adapter context
2617 \param sessionId - Message pointer.
2618
2619 \sa
2620 --------------------------------------------------------------------------*/
2621
2622void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ)
2623{
2624 tpPESession psessionEntry;
2625 tpDeleteBssParams pDelBss = (tpDeleteBssParams)(MsgQ->bodyptr);
2626 if((psessionEntry = peFindSessionBySessionId(pMac,pDelBss->sessionId))==NULL)
2627 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07002628 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002629 return;
2630 }
2631 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)
2632 {
2633 limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry);
2634 }
2635 else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE)
2636 {
2637 limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry);
2638 }
2639
2640 else
2641 limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry);
2642
2643}
2644
2645#ifdef WLAN_FEATURE_VOWIFI_11R
2646/** -----------------------------------------------------------------
2647 \brief limSendSmeAggrQosRsp() - sends SME FT AGGR QOS RSP
2648 \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME.
2649 \ SME only looks at rc and tspec field.
2650 \param pMac - global mac structure
2651 \param rspReqd - is SmeAddTsRsp required
2652 \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP
2653 \return tspec
2654 \sa
2655 ----------------------------------------------------------------- */
2656void
2657limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp,
2658 tANI_U8 smesessionId)
2659{
2660 tSirMsgQ mmhMsg;
2661
2662 mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP;
2663 mmhMsg.bodyptr = aggrQosRsp;
2664 mmhMsg.bodyval = 0;
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302665 MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002666 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2667
2668 return;
2669}
2670#endif
2671
2672/** -----------------------------------------------------------------
2673 \brief limSendSmePreChannelSwitchInd() - sends an indication to SME
2674 before switching channels for spectrum manangement.
2675
2676 This function sends a eWNI_SME_PRE_SWITCH_CHL_IND to SME.
2677
2678 \param pMac - global mac structure
2679 \return none
2680 \sa
2681 ----------------------------------------------------------------- */
2682void
2683limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac)
2684{
2685 tSirMsgQ mmhMsg;
2686
2687 mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND;
2688 mmhMsg.bodyptr = NULL;
2689 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002690 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002691 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2692
2693 return;
2694}
2695
2696/** -----------------------------------------------------------------
2697 \brief limSendSmePostChannelSwitchInd() - sends an indication to SME
2698 after channel switch for spectrum manangement is complete.
2699
2700 This function sends a eWNI_SME_POST_SWITCH_CHL_IND to SME.
2701
2702 \param pMac - global mac structure
2703 \return none
2704 \sa
2705 ----------------------------------------------------------------- */
2706void
2707limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac)
2708{
2709 tSirMsgQ mmhMsg;
2710
2711 mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND;
2712 mmhMsg.bodyptr = NULL;
2713 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002714 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002715 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2716
2717 return;
2718}
2719
2720void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
2721 tANI_U8 smesessionId)
2722{
2723 tSirMsgQ mmhMsg;
2724 tSmeMaxAssocInd *pSmeMaxAssocInd;
2725
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302726 pSmeMaxAssocInd = vos_mem_malloc(sizeof(tSmeMaxAssocInd));
2727 if ( NULL == pSmeMaxAssocInd )
Jeff Johnson295189b2012-06-20 16:38:30 -07002728 {
2729 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2730 return;
2731 }
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302732 vos_mem_set((void *) pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd),0);
2733 vos_mem_copy( (tANI_U8 *)pSmeMaxAssocInd->peerMac,
2734 (tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr));
Jeff Johnson295189b2012-06-20 16:38:30 -07002735 pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED;
2736 pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd);
2737 pSmeMaxAssocInd->sessionId = smesessionId;
2738 mmhMsg.type = pSmeMaxAssocInd->mesgType;
2739 mmhMsg.bodyptr = pSmeMaxAssocInd;
Arif Hussain24bafea2013-11-15 15:10:03 -08002740 PELOG1(limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR
2741 " sme session id %d"), "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr));)
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002742 MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002743 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2744
2745 return;
2746}
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07002747#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
2748/** -----------------------------------------------------------------
2749 \brief limSendSmeCandidateFoundInd() - sends
2750 eWNI_SME_CANDIDATE_FOUND_IND
2751
2752 After receiving candidate found indication frame from FW, this
2753 function sends a eWNI_SME_CANDIDATE_FOUND_IND to SME to notify
2754 roam candidate(s) are available.
2755
2756 \param pMac - global mac structure
2757 \param psessionEntry - session info
2758 \return none
2759 \sa
2760 ----------------------------------------------------------------- */
2761void
2762limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId)
2763{
2764 tSirMsgQ mmhMsg;
2765 tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd;
2766
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302767 pSirSmeCandidateFoundInd = vos_mem_malloc(sizeof(tSirSmeCandidateFoundInd));
2768 if ( NULL == pSirSmeCandidateFoundInd )
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07002769 {
Bansidhar Gopalachari12731232013-07-11 10:56:36 +05302770 limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_CANDIDATE_FOUND_IND\n"));
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07002771 return;
2772 }
2773
2774 pSirSmeCandidateFoundInd->messageType = eWNI_SME_CANDIDATE_FOUND_IND;
2775 pSirSmeCandidateFoundInd->length = sizeof(tSirSmeDisassocInd);
2776
2777 pSirSmeCandidateFoundInd->sessionId = sessionId;
2778
2779
2780 limLog( pMac, LOGE, FL("posting candidate ind to SME"));
2781 mmhMsg.type = eWNI_SME_CANDIDATE_FOUND_IND;
2782 mmhMsg.bodyptr = pSirSmeCandidateFoundInd;
2783 mmhMsg.bodyval = 0;
2784
2785 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2786
2787} /*** end limSendSmeCandidateFoundInd() ***/
2788#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD