blob: 600edb1b84f85724e2320d832e86ab952da5d149 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/*
43 * Airgo Networks, Inc proprietary. All rights reserved.
44 * This file limSendSmeRspMessages.cc contains the functions
45 * for sending SME response/notification messages to applications
46 * above MAC software.
47 * Author: Chandra Modumudi
48 * Date: 02/13/02
49 * History:-
50 * Date Modified by Modification Information
51 * --------------------------------------------------------------------
52 */
53
54#include "vos_types.h"
55#include "wniApi.h"
56#include "sirCommon.h"
57#include "aniGlobal.h"
58
59#if (WNI_POLARIS_FW_PRODUCT == AP)
60#include "wniCfgAp.h"
61#else
62#include "wniCfgSta.h"
63#endif
64#include "sysDef.h"
65#include "cfgApi.h"
66
67#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
68#include "halDataStruct.h"
69#include "halCommonApi.h"
70#endif
71
72#include "schApi.h"
73#include "utilsApi.h"
74#include "limUtils.h"
75#include "limSecurityUtils.h"
76#include "limSerDesUtils.h"
77#include "limSendSmeRspMessages.h"
78#include "limIbssPeerMgmt.h"
79#include "limSessionUtils.h"
80
81
82/**
83 * limSendSmeRsp()
84 *
85 *FUNCTION:
86 * This function is called by limProcessSmeReqMessages() to send
87 * eWNI_SME_START_RSP, eWNI_SME_MEASUREMENT_RSP, eWNI_SME_STOP_BSS_RSP
88 * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC
89 * Software.
90 *
91 *PARAMS:
92 *
93 *LOGIC:
94 *
95 *ASSUMPTIONS:
96 * NA
97 *
98 *NOTE:
99 * NA
100 *
101 * @param pMac Pointer to Global MAC structure
102 * @param msgType Indicates message type
103 * @param resultCode Indicates the result of previously issued
104 * eWNI_SME_msgType_REQ message
105 *
106 * @return None
107 */
108
109void
110limSendSmeRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
111 tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId)
112{
113 tSirMsgQ mmhMsg;
114 tSirSmeRsp *pSirSmeRsp;
115
116 PELOG1(limLog(pMac, LOG1,
117 FL("Sending message %s with reasonCode %s\n"),
118 limMsgStr(msgType), limResultCodeStr(resultCode));)
119
120 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeRsp, sizeof(tSirSmeRsp)))
121 {
122 /// Buffer not available. Log error
123 limLog(pMac, LOGP,
124 FL("call to palAllocateMemory failed for eWNI_SME_*_RSP\n"));
125
126 return;
127 }
128
129#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
130 sirStoreU16N((tANI_U8*)&pSirSmeRsp->messageType, msgType);
131 sirStoreU16N((tANI_U8*)&pSirSmeRsp->length, sizeof(tSirSmeRsp));
132#else
133 pSirSmeRsp->messageType = msgType;
134 pSirSmeRsp->length = sizeof(tSirSmeRsp);
135#endif
136 pSirSmeRsp->statusCode = resultCode;
137
138 /* Update SME session Id and Transaction Id */
139 pSirSmeRsp->sessionId = smesessionId;
140 pSirSmeRsp->transactionId = smetransactionId;
141
142
143 mmhMsg.type = msgType;
144 mmhMsg.bodyptr = pSirSmeRsp;
145 mmhMsg.bodyval = 0;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800146 MTRACE(macTraceMsgTx(pMac, smesessionId , mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700147
148#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
149 {
150 tpPESession psessionEntry = peGetValidPowerSaveSession(pMac);
151 switch(msgType)
152 {
153 case eWNI_PMC_ENTER_BMPS_RSP:
154 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
155 break;
156 case eWNI_PMC_EXIT_BMPS_RSP:
157 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
158 break;
159 case eWNI_PMC_ENTER_IMPS_RSP:
160 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
161 break;
162 case eWNI_PMC_EXIT_IMPS_RSP:
163 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
164 break;
165 case eWNI_PMC_ENTER_UAPSD_RSP:
166 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
167 break;
168 case eWNI_PMC_EXIT_UAPSD_RSP:
169 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
170 break;
171 case eWNI_SME_SWITCH_CHL_RSP:
172 limDiagEventReport(pMac, WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
173 break;
174 case eWNI_SME_STOP_BSS_RSP:
175 limDiagEventReport(pMac, WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
176 break;
177 case eWNI_PMC_ENTER_WOWL_RSP:
178 limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
179 break;
180 case eWNI_PMC_EXIT_WOWL_RSP:
181 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
182 break;
183 }
184 }
185#endif //FEATURE_WLAN_DIAG_SUPPORT
186
187 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
188} /*** end limSendSmeRsp() ***/
189
190
191/**
192 * limSendSmeJoinReassocRspAfterResume()
193 *
194 *FUNCTION:
195 * This function is called to send Join/Reassoc rsp
196 * message to SME after the resume link.
197 *
198 *PARAMS:
199 *
200 *LOGIC:
201 *
202 *ASSUMPTIONS:
203 * NA
204 *
205 *NOTE:
206 * NA
207 *
208 * @param pMac Pointer to Global MAC structure
209 * @param status Resume link status
210 * @param ctx context passed while calling resmune link.
211 * (join response to be sent)
212 *
213 * @return None
214 */
215static void limSendSmeJoinReassocRspAfterResume( tpAniSirGlobal pMac,
216 eHalStatus status, tANI_U32 *ctx)
217{
218 tSirMsgQ mmhMsg;
219 tpSirSmeJoinRsp pSirSmeJoinRsp = (tpSirSmeJoinRsp) ctx;
220
221 mmhMsg.type = pSirSmeJoinRsp->messageType;
222 mmhMsg.bodyptr = pSirSmeJoinRsp;
223 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700224 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
226}
227
228
229/**
230 * limSendSmeJoinReassocRsp()
231 *
232 *FUNCTION:
233 * This function is called by limProcessSmeReqMessages() to send
234 * eWNI_SME_JOIN_RSP or eWNI_SME_REASSOC_RSP messages to applications
235 * above MAC Software.
236 *
237 *PARAMS:
238 *
239 *LOGIC:
240 *
241 *ASSUMPTIONS:
242 * NA
243 *
244 *NOTE:
245 * NA
246 *
247 * @param pMac Pointer to Global MAC structure
248 * @param msgType Indicates message type
249 * @param resultCode Indicates the result of previously issued
250 * eWNI_SME_msgType_REQ message
251 *
252 * @return None
253 */
254
255void
256limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
257 tSirResultCodes resultCode, tANI_U16 protStatusCode,
258 tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
259{
260 tpSirSmeJoinRsp pSirSmeJoinRsp;
261 tANI_U32 rspLen;
262 tpDphHashNode pStaDs = NULL;
263
264#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
265 if (msgType == eWNI_SME_REASSOC_RSP)
266 limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
267 else
268 limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
269#endif //FEATURE_WLAN_DIAG_SUPPORT
270
271 PELOG1(limLog(pMac, LOG1,
272 FL("Sending message %s with reasonCode %s\n"),
273 limMsgStr(msgType), limResultCodeStr(resultCode));)
274
275 if(psessionEntry == NULL)
276 {
277
278 rspLen = sizeof(tSirSmeJoinRsp);
279
280 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeJoinRsp, rspLen))
281 {
282 /// Buffer not available. Log error
283 limLog(pMac, LOGP, FL("call to palAllocateMemory failed for JOIN/REASSOC_RSP\n"));
284 return;
285 }
286
287 palZeroMemory(pMac, (tANI_U8*)pSirSmeJoinRsp, rspLen);
288
289
290 pSirSmeJoinRsp->beaconLength = 0;
291 pSirSmeJoinRsp->assocReqLength = 0;
292 pSirSmeJoinRsp->assocRspLength = 0;
293 }
294
295 else
296 {
297 rspLen = psessionEntry->assocReqLen + psessionEntry->assocRspLen +
298 psessionEntry->bcnLen +
299#ifdef WLAN_FEATURE_VOWIFI_11R
300 psessionEntry->RICDataLen +
301#endif
302#ifdef FEATURE_WLAN_CCX
303 psessionEntry->tspecLen +
304#endif
305 sizeof(tSirSmeJoinRsp) - sizeof(tANI_U8) ;
306
307 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeJoinRsp, rspLen))
308 {
309 /// Buffer not available. Log error
310 limLog(pMac, LOGP,
311 FL("call to palAllocateMemory failed for JOIN/REASSOC_RSP\n"));
312
313 return;
314 }
315
316 palZeroMemory(pMac, (tANI_U8*)pSirSmeJoinRsp, rspLen);
317
318#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
319 sirStoreU16N((tANI_U8*)&pSirSmeJoinRsp->messageType, msgType);
320 sirStoreU16N((tANI_U8*)&pSirSmeJoinRsp->length, rspLen);
321#endif
322
323#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
324 if (resultCode == eSIR_SME_SUCCESS)
325 {
326 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
327 if (pStaDs == NULL)
328 {
329 PELOGE(limLog(pMac, LOGE, FL("could not Get Self Entry for the station\n"));)
330 }
331 else
332 {
333 //Pass the peer's staId
334 pSirSmeJoinRsp->staId = pStaDs->staIndex;
335 pSirSmeJoinRsp->ucastSig = pStaDs->ucUcastSig;
336 pSirSmeJoinRsp->bcastSig = pStaDs->ucBcastSig;
337 }
338 }
339#endif
340
341#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
342 if (resultCode == eSIR_SME_TRANSFER_STA)
343 {
344 palCopyMemory( pMac->hHdd, pSirSmeJoinRsp->alternateBssId,
345 pMac->lim.gLimAlternateRadio.bssId,
346 sizeof(tSirMacAddr));
347 pSirSmeJoinRsp->alternateChannelId =
348 pMac->lim.gLimAlternateRadio.channelId;
349 }
350#endif
351
352 pSirSmeJoinRsp->beaconLength = 0;
353 pSirSmeJoinRsp->assocReqLength = 0;
354 pSirSmeJoinRsp->assocRspLength = 0;
355#ifdef WLAN_FEATURE_VOWIFI_11R
356 pSirSmeJoinRsp->parsedRicRspLen = 0;
357#endif
358#ifdef FEATURE_WLAN_CCX
359 pSirSmeJoinRsp->tspecIeLen = 0;
360#endif
361
362 if(resultCode == eSIR_SME_SUCCESS)
363 {
364
365 if(psessionEntry->beacon != NULL)
366 {
367 pSirSmeJoinRsp->beaconLength = psessionEntry->bcnLen;
368 palCopyMemory(pMac->hHdd, pSirSmeJoinRsp->frames, psessionEntry->beacon, pSirSmeJoinRsp->beaconLength);
369 palFreeMemory(pMac->hHdd, psessionEntry->beacon);
370 psessionEntry->beacon = NULL;
371#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
372 PELOG1(limLog(pMac, LOG1, FL("Beacon=%d\n"), psessionEntry->bcnLen);)
373#endif
374 }
375
376 if(psessionEntry->assocReq != NULL)
377 {
378 pSirSmeJoinRsp->assocReqLength = psessionEntry->assocReqLen;
379 palCopyMemory(pMac->hHdd, pSirSmeJoinRsp->frames + psessionEntry->bcnLen, psessionEntry->assocReq, pSirSmeJoinRsp->assocReqLength);
380 palFreeMemory(pMac->hHdd, psessionEntry->assocReq);
381 psessionEntry->assocReq = NULL;
382#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
383 PELOG1(limLog(pMac, LOG1, FL("AssocReq=%d\n"), psessionEntry->assocReqLen);)
384#endif
385 }
386 if(psessionEntry->assocRsp != NULL)
387 {
388 pSirSmeJoinRsp->assocRspLength = psessionEntry->assocRspLen;
389 palCopyMemory(pMac->hHdd, pSirSmeJoinRsp->frames + psessionEntry->bcnLen + psessionEntry->assocReqLen, psessionEntry->assocRsp, pSirSmeJoinRsp->assocRspLength);
390 palFreeMemory(pMac->hHdd, psessionEntry->assocRsp);
391 psessionEntry->assocRsp = NULL;
392 }
393#ifdef WLAN_FEATURE_VOWIFI_11R
394 if(psessionEntry->ricData != NULL)
395 {
396 pSirSmeJoinRsp->parsedRicRspLen = psessionEntry->RICDataLen;
397 palCopyMemory(pMac->hHdd, pSirSmeJoinRsp->frames + psessionEntry->bcnLen + psessionEntry->assocReqLen + psessionEntry->assocRspLen, psessionEntry->ricData, pSirSmeJoinRsp->parsedRicRspLen);
398 palFreeMemory(pMac->hHdd, psessionEntry->ricData);
399 psessionEntry->ricData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -0700400 PELOG1(limLog(pMac, LOG1, FL("RicLength=%d\n"), pSirSmeJoinRsp->parsedRicRspLen);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700401 }
402#endif
403#ifdef FEATURE_WLAN_CCX
404 if(psessionEntry->tspecIes != NULL)
405 {
406 pSirSmeJoinRsp->tspecIeLen = psessionEntry->tspecLen;
407 palCopyMemory(pMac->hHdd, pSirSmeJoinRsp->frames + psessionEntry->bcnLen + psessionEntry->assocReqLen + psessionEntry->assocRspLen + psessionEntry->RICDataLen, psessionEntry->tspecIes, pSirSmeJoinRsp->tspecIeLen);
408 palFreeMemory(pMac->hHdd, psessionEntry->tspecIes);
409 psessionEntry->tspecIes = NULL;
410 PELOG1(limLog(pMac, LOG1, FL("CCX-TspecLen=%d\n"), psessionEntry->tspecLen);)
411 }
412#endif
413 pSirSmeJoinRsp->aid = psessionEntry->limAID;
414#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
415 PELOG1(limLog(pMac, LOG1, FL("AssocRsp=%d\n"), psessionEntry->assocRspLen);)
416#endif
417 }
Madan Mohan Koyyalamudib666eb12012-09-18 17:29:47 -0700418 else
419 {
420
421 if(psessionEntry->beacon != NULL)
422 {
423 palFreeMemory(pMac->hHdd, psessionEntry->beacon);
424 psessionEntry->beacon = NULL;
425 }
426
427 if(psessionEntry->assocReq != NULL)
428 {
429 palFreeMemory(pMac->hHdd, psessionEntry->assocReq);
430 psessionEntry->assocReq = NULL;
431 }
432
433 if(psessionEntry->assocRsp != NULL)
434 {
435 palFreeMemory(pMac->hHdd, psessionEntry->assocRsp);
436 psessionEntry->assocRsp = NULL;
437 }
438
439 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700440 }
441
442
443 pSirSmeJoinRsp->messageType = msgType;
444 pSirSmeJoinRsp->length = (tANI_U16) rspLen;
445 pSirSmeJoinRsp->statusCode = resultCode;
446 pSirSmeJoinRsp->protStatusCode = protStatusCode;
447
448 /* Update SME session ID and transaction Id */
449 pSirSmeJoinRsp->sessionId = smesessionId;
450 pSirSmeJoinRsp->transactionId = smetransactionId;
451
452 if(IS_MCC_SUPPORTED && limIsLinkSuspended( pMac ) )
453 {
454 if( psessionEntry && psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE )
455 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700456
457#ifdef WLAN_FEATURE_11AC
458 if (psessionEntry->vhtCapability)
459 {
Jeff Johnson32d95a32012-09-10 13:15:23 -0700460 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -0700461 /*Get 11ac cbState from 11n cbState*/
462 htSecondaryChannelOffset = limGet11ACPhyCBState(pMac,
463 psessionEntry->currentOperChannel,
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700464 psessionEntry->htSecondaryChannelOffset,
465 psessionEntry->apCenterChan,
466 psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -0700467 peSetResumeChannel( pMac, psessionEntry->currentOperChannel, htSecondaryChannelOffset);
468 }
Jeff Johnson32d95a32012-09-10 13:15:23 -0700469 else
Jeff Johnsone7245742012-09-05 17:12:55 -0700470#endif
Jeff Johnson32d95a32012-09-10 13:15:23 -0700471 peSetResumeChannel( pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset);
Jeff Johnson295189b2012-06-20 16:38:30 -0700472 }
473 else
474 {
475 peSetResumeChannel( pMac, 0, 0);
476 }
477 limResumeLink( pMac, limSendSmeJoinReassocRspAfterResume,
478 (tANI_U32*) pSirSmeJoinRsp );
479 }
480 else
481 {
482 limSendSmeJoinReassocRspAfterResume( pMac, eHAL_STATUS_SUCCESS,
483 (tANI_U32*) pSirSmeJoinRsp );
484 }
485} /*** end limSendSmeJoinReassocRsp() ***/
486
487
488
489/**
490 * limSendSmeStartBssRsp()
491 *
492 *FUNCTION:
493 * This function is called to send eWNI_SME_START_BSS_RSP
494 * message to applications above MAC Software.
495 *
496 *PARAMS:
497 *
498 *LOGIC:
499 *
500 *ASSUMPTIONS:
501 * NA
502 *
503 *NOTE:
504 * NA
505 *
506 * @param pMac Pointer to Global MAC structure
507 * @param msgType Indicates message type
508 * @param resultCode Indicates the result of previously issued
509 * eWNI_SME_msgType_REQ message
510 *
511 * @return None
512 */
513
514void
515limSendSmeStartBssRsp(tpAniSirGlobal pMac,
516 tANI_U16 msgType, tSirResultCodes resultCode,tpPESession psessionEntry,
517 tANI_U8 smesessionId,tANI_U16 smetransactionId)
518{
519
520
521 tANI_U16 size = 0;
522 tSirMsgQ mmhMsg;
523 tSirSmeStartBssRsp *pSirSmeRsp;
524 tANI_U16 ieLen;
525 tANI_U16 ieOffset, curLen;
526
527 PELOG1(limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s\n"),
528 limMsgStr(msgType), limResultCodeStr(resultCode));)
529
530 size = sizeof(tSirSmeStartBssRsp);
531
532 if(psessionEntry == NULL)
533 {
534
535 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeRsp, size))
536 {
537 /// Buffer not available. Log error
538 limLog(pMac, LOGP,FL("call to palAllocateMemory failed for eWNI_SME_START_BSS_RSP\n"));
539 return;
540 }
541 palZeroMemory(pMac, (tANI_U8*)pSirSmeRsp, size);
542
543 }
544 else
545 {
546 //subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID
547 ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET;
548 ieLen = pMac->sch.schObject.gSchBeaconOffsetBegin + pMac->sch.schObject.gSchBeaconOffsetEnd - ieOffset;
549 //calculate the memory size to allocate
550 size += ieLen;
551
552 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeRsp, size))
553 {
554 /// Buffer not available. Log error
555 limLog(pMac, LOGP,
556 FL("call to palAllocateMemory failed for eWNI_SME_START_BSS_RSP\n"));
557
558 return;
559 }
560 palZeroMemory(pMac, (tANI_U8*)pSirSmeRsp, size);
561 size = sizeof(tSirSmeStartBssRsp);
562 if (resultCode == eSIR_SME_SUCCESS)
563 {
564
565 sirCopyMacAddr(pSirSmeRsp->bssDescription.bssId, psessionEntry->bssId);
566
567 /* Read beacon interval from session */
568 pSirSmeRsp->bssDescription.beaconInterval = (tANI_U16) psessionEntry->beaconParams.beaconInterval;
569 pSirSmeRsp->bssType = psessionEntry->bssType;
570
571 if (cfgGetCapabilityInfo( pMac, &pSirSmeRsp->bssDescription.capabilityInfo,psessionEntry)
572 != eSIR_SUCCESS)
573 limLog(pMac, LOGP, FL("could not retrieve Capabilities value\n"));
574
575 limGetPhyMode(pMac, (tANI_U32 *)&pSirSmeRsp->bssDescription.nwType, psessionEntry);
576
577#if 0
578 if (wlan_cfgGetInt(pMac, WNI_CFG_CURRENT_CHANNEL, &len) != eSIR_SUCCESS)
579 limLog(pMac, LOGP, FL("could not retrieve CURRENT_CHANNEL from CFG\n"));
580
581#endif// TO SUPPORT BT-AMP
582
583 pSirSmeRsp->bssDescription.channelId = psessionEntry->currentOperChannel;
584
585 pSirSmeRsp->bssDescription.aniIndicator = 1;
586
587 curLen = pMac->sch.schObject.gSchBeaconOffsetBegin - ieOffset;
588 palCopyMemory( pMac->hHdd, (tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields,
589 pMac->sch.schObject.gSchBeaconFrameBegin + ieOffset,
590 (tANI_U32)curLen);
591
592 palCopyMemory( pMac->hHdd, ((tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields) + curLen,
593 pMac->sch.schObject.gSchBeaconFrameEnd,
594 (tANI_U32)pMac->sch.schObject.gSchBeaconOffsetEnd);
595
596
597 //subtracting size of length indicator itself and size of pointer to ieFields
598 pSirSmeRsp->bssDescription.length = sizeof(tSirBssDescription) -
599 sizeof(tANI_U16) - sizeof(tANI_U32) +
600 ieLen;
601 //This is the size of the message, subtracting the size of the pointer to ieFields
602 size += ieLen - sizeof(tANI_U32);
603 }
604
605
606
607#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
608 sirStoreU16N((tANI_U8*)&pSirSmeRsp->messageType, msgType);
609 sirStoreU16N((tANI_U8*)&pSirSmeRsp->length, size);
610
611#endif
612
613 }
614
615 pSirSmeRsp->messageType = msgType;
616 pSirSmeRsp->length = size;
617
618 /* Update SME session Id and transaction Id */
619 pSirSmeRsp->sessionId = smesessionId;
620 pSirSmeRsp->transactionId = smetransactionId;
621 pSirSmeRsp->statusCode = resultCode;
622#ifdef WLAN_SOFTAP_FEATURE
623 if(psessionEntry != NULL )
624 pSirSmeRsp->staId = psessionEntry->staId; //else it will be always zero smeRsp StaID = 0
625
626#endif
627
628 mmhMsg.type = msgType;
629 mmhMsg.bodyptr = pSirSmeRsp;
630 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700631 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700632
633#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
634 limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
635#endif //FEATURE_WLAN_DIAG_SUPPORT
636
637 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
638} /*** end limSendSmeStartBssRsp() ***/
639
640
641
642
643
644#define LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED 20
645#define LIM_SIZE_OF_EACH_BSS 400 // this is a rough estimate
646
647
648/**
649 * limSendSmeScanRsp()
650 *
651 *FUNCTION:
652 * This function is called by limProcessSmeReqMessages() to send
653 * eWNI_SME_SCAN_RSP message to applications above MAC
654 * Software.
655 *
656 *PARAMS:
657 *
658 *LOGIC:
659 *
660 *ASSUMPTIONS:
661 * NA
662 *
663 *NOTE:
664 * NA
665 *
666 * @param pMac Pointer to Global MAC structure
667 * @param length Indicates length of message
668 * @param resultCode Indicates the result of previously issued
669 * eWNI_SME_SCAN_REQ message
670 *
671 * @return None
672 */
673
674void
675limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length,
676 tSirResultCodes resultCode,tANI_U8 smesessionId,tANI_U16 smetranscationId)
677{
678 tSirMsgQ mmhMsg;
679 tpSirSmeScanRsp pSirSmeScanRsp=NULL;
680 tLimScanResultNode *ptemp = NULL;
681 tANI_U16 msgLen, allocLength, curMsgLen = 0;
682 tANI_U16 i, bssCount;
683 tANI_U8 *pbBuf;
684 tSirBssDescription *pDesc;
685
686 PELOG1(limLog(pMac, LOG1,
687 FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s\n"),
688 length, limResultCodeStr(resultCode));)
689
690 if (resultCode != eSIR_SME_SUCCESS)
691 {
692 limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId);
693 return;
694 }
695
696 mmhMsg.type = eWNI_SME_SCAN_RSP;
697 i = 0;
698 bssCount = 0;
699 msgLen = 0;
700 allocLength = LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED * LIM_SIZE_OF_EACH_BSS;
701 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeScanRsp, allocLength))
702 {
703 // Log error
704 limLog(pMac, LOGP,
705 FL("call to palAllocateMemory failed for eWNI_SME_SCAN_RSP\n"));
706
707 return;
708 }
709 for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
710 {
711 //when ptemp is not NULL it is a left over
712 ptemp = pMac->lim.gLimCachedScanHashTable[i];
713 while(ptemp)
714 {
715 pbBuf = ((tANI_U8 *)pSirSmeScanRsp) + msgLen;
716 if(0 == bssCount)
717 {
718 msgLen = sizeof(tSirSmeScanRsp) -
719 sizeof(tSirBssDescription) +
720 ptemp->bssDescription.length +
721 sizeof(ptemp->bssDescription.length);
722 pDesc = pSirSmeScanRsp->bssDescription;
723 }
724 else
725 {
726 msgLen += ptemp->bssDescription.length +
727 sizeof(ptemp->bssDescription.length);
728 pDesc = (tSirBssDescription *)pbBuf;
729 }
730 if( (allocLength < msgLen) ||
731 (LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED <= bssCount++) )
732 {
733 pSirSmeScanRsp->statusCode =
734 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW;
735#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
736 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType,
737 eWNI_SME_SCAN_RSP);
738 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, curMsgLen);
739#else
740 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
741 pSirSmeScanRsp->length = curMsgLen;
742#endif
743 mmhMsg.bodyptr = pSirSmeScanRsp;
744 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700745 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700746 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
747 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeScanRsp, allocLength))
748 {
749 // Log error
750 limLog(pMac, LOGP,
751 FL("call to palAllocateMemory failed for eWNI_SME_SCAN_RSP\n"));
752 return;
753 }
754 msgLen = sizeof(tSirSmeScanRsp) -
755 sizeof(tSirBssDescription) +
756 ptemp->bssDescription.length +
757 sizeof(ptemp->bssDescription.length);
758 pDesc = pSirSmeScanRsp->bssDescription;
759 bssCount = 1;
760 }
761 curMsgLen = msgLen;
762
763 PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d\n"),
764 msgLen, ptemp->bssDescription.length);)
765#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
766 sirStoreU16N((tANI_U8*)&pDesc->length,
767 ptemp->bssDescription.length);
768#else
769 pDesc->length
770 = ptemp->bssDescription.length;
771#endif
772 palCopyMemory( pMac->hHdd, (tANI_U8 *) &pDesc->bssId,
773 (tANI_U8 *) &ptemp->bssDescription.bssId,
774 ptemp->bssDescription.length);
775
776 PELOG2(limLog(pMac, LOG2, FL("BssId "));
777 limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);)
778
779 pSirSmeScanRsp->sessionId = smesessionId;
780 pSirSmeScanRsp->transcationId = smetranscationId;
781
782 ptemp = ptemp->next;
783 } //while(ptemp)
784 } //for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++)
785
786 if(0 == bssCount)
787 {
788 limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700789 if (NULL != pSirSmeScanRsp)
790 {
791 palFreeMemory( pMac->hHdd, pSirSmeScanRsp);
792 pSirSmeScanRsp = NULL;
793 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 }
795 else
796 {
797 // send last message
798 pSirSmeScanRsp->statusCode = eSIR_SME_SUCCESS;
799#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
800 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType,
801 eWNI_SME_SCAN_RSP);
802 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, curMsgLen);
803#else
804 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
805 pSirSmeScanRsp->length = curMsgLen;
806#endif
807
808 /* Update SME session Id and SME transcation Id */
809 pSirSmeScanRsp->sessionId = smesessionId;
810 pSirSmeScanRsp->transcationId = smetranscationId;
811
812 mmhMsg.type = eWNI_SME_SCAN_RSP;
813 mmhMsg.bodyptr = pSirSmeScanRsp;
814 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700815 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700816 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
817 PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS\n"));)
818 }
819
820 return;
821
822} /*** end limSendSmeScanRsp() ***/
823
824
825/**
826 * limPostSmeScanRspMessage()
827 *
828 *FUNCTION:
829 * This function is called by limSendSmeScanRsp() to send
830 * eWNI_SME_SCAN_RSP message with failed result code
831 *
832 *NOTE:
833 * NA
834 *
835 * @param pMac Pointer to Global MAC structure
836 * @param length Indicates length of message
837 * @param resultCode failed result code
838 *
839 * @return None
840 */
841
842void
843limPostSmeScanRspMessage(tpAniSirGlobal pMac,
844 tANI_U16 length,
845 tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId)
846{
847 tpSirSmeScanRsp pSirSmeScanRsp;
848 tSirMsgQ mmhMsg;
849
850 PELOG1(limLog(pMac, LOG1,
851 FL("limPostSmeScanRspMessage: send SME_SCAN_RSP (len %d, reasonCode %s). \n"),
852 length, limResultCodeStr(resultCode));)
853
854 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeScanRsp, length))
855 {
856 limLog(pMac, LOGP, FL("palAllocateMemory failed for eWNI_SME_SCAN_RSP\n"));
857 return;
858 }
859 palZeroMemory(pMac->hHdd, (void*)pSirSmeScanRsp, length);
860
861#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
862 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType, eWNI_SME_SCAN_RSP);
863 sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, length);
864#else
865 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
866 pSirSmeScanRsp->length = length;
867#endif
868
869 if(sizeof(tSirSmeScanRsp) <= length)
870 {
871 pSirSmeScanRsp->bssDescription->length = sizeof(tSirBssDescription);
872 }
873
874 pSirSmeScanRsp->statusCode = resultCode;
875
876 /*Update SME session Id and transaction Id */
877 pSirSmeScanRsp->sessionId = smesessionId;
878 pSirSmeScanRsp->transcationId = smetransactionId;
879
880 mmhMsg.type = eWNI_SME_SCAN_RSP;
881 mmhMsg.bodyptr = pSirSmeScanRsp;
882 mmhMsg.bodyval = 0;
883
Jeff Johnsone7245742012-09-05 17:12:55 -0700884 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700885#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
886 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
887#endif //FEATURE_WLAN_DIAG_SUPPORT
888
889 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
890 return;
891
892} /*** limPostSmeScanRspMessage ***/
893
Jeff Johnsone7245742012-09-05 17:12:55 -0700894#ifdef FEATURE_OEM_DATA_SUPPORT
895
896/**
897 * limSendSmeOemDataRsp()
898 *
899 *FUNCTION:
900 * This function is called by limProcessSmeReqMessages() to send
901 * eWNI_SME_OEM_DATA_RSP message to applications above MAC
902 * Software.
903 *
904 *PARAMS:
905 *
906 *LOGIC:
907 *
908 *ASSUMPTIONS:
909 * NA
910 *
911 *NOTE:
912 * NA
913 *
914 * @param pMac Pointer to Global MAC structure
915 * @param pMsgBuf Indicates the mlm message
916 * @param resultCode Indicates the result of previously issued
917 * eWNI_SME_OEM_DATA_RSP message
918 *
919 * @return None
920 */
921
922void limSendSmeOemDataRsp(tpAniSirGlobal pMac, tANI_U32* pMsgBuf, tSirResultCodes resultCode)
923{
924 tSirMsgQ mmhMsg;
925 tSirOemDataRsp* pSirSmeOemDataRsp=NULL;
926 tLimMlmOemDataRsp* pMlmOemDataRsp=NULL;
927 tANI_U16 msgLength;
928
929
930 //get the pointer to the mlm message
931 pMlmOemDataRsp = (tLimMlmOemDataRsp*)(pMsgBuf);
932
933 msgLength = sizeof(tSirOemDataRsp);
934
935 //now allocate memory for the char buffer
936 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, (void**)&pSirSmeOemDataRsp, msgLength))
937 {
938 limLog(pMac, LOGP, FL("call to palAllocateMemory failed for pSirSmeOemDataRsp\n"));
939 return;
940 }
941
942#if defined (ANI_LITTLE_BYTE_ENDIAN)
943 sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->length, msgLength);
944 sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->messageType, eWNI_SME_OEM_DATA_RSP);
945#else
946 pSirSmeOemDataRsp->length = msgLength;
947 pSirSmeOemDataRsp->messageType = eWNI_SME_OEM_DATA_RSP;
948#endif
949
950 palCopyMemory(pMac->hHdd, pSirSmeOemDataRsp->oemDataRsp, pMlmOemDataRsp->oemDataRsp, OEM_DATA_RSP_SIZE);
951
952 //Now free the memory from MLM Rsp Message
953 palFreeMemory(pMac->hHdd, pMlmOemDataRsp);
954
955 mmhMsg.type = eWNI_SME_OEM_DATA_RSP;
956 mmhMsg.bodyptr = pSirSmeOemDataRsp;
957 mmhMsg.bodyval = 0;
958
959 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
960
961 return;
962} /*** limSendSmeOemDataRsp ***/
963
964#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700965
966
967/**
968 * limSendSmeAuthRsp()
969 *
970 *FUNCTION:
971 * This function is called by limProcessSmeMessages() to send
972 * eWNI_SME_AUTH_RSP message to host
973 *
974 *PARAMS:
975 *
976 *LOGIC:
977 *
978 *ASSUMPTIONS:
979 * NA
980 *
981 *NOTE:
982 * NA
983 *
984 * @param pMac Pointer to Global MAC structure
985 * @param statusCode Indicates the result of previously issued
986 * eWNI_SME_AUTH_REQ message
987 *
988 * @return None
989 */
990void
991limSendSmeAuthRsp(tpAniSirGlobal pMac,
992 tSirResultCodes statusCode,
993 tSirMacAddr peerMacAddr,
994 tAniAuthType authType,
995 tANI_U16 protStatusCode,
996 tpPESession psessionEntry,tANI_U8 smesessionId,
997 tANI_U16 smetransactionId)
998{
999#if 0
1000 tSirMsgQ mmhMsg;
1001 tSirSmeAuthRsp *pSirSmeAuthRsp;
1002
1003
1004 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeAuthRsp, sizeof(tSirSmeAuthRsp)))
1005 {
1006 // Log error
1007 limLog(pMac, LOGP,
1008 FL("call to palAllocateMemory failed for eWNI_SME_AUTH_RSP\n"));
1009
1010 return;
1011 }
1012
1013#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1014 sirStoreU16N((tANI_U8*)&pSirSmeAuthRsp->messageType, eWNI_SME_AUTH_RSP);
1015 sirStoreU16N((tANI_U8*)&pSirSmeAuthRsp->length, sizeof(tSirSmeAuthRsp));
1016
1017#endif
1018
1019
1020 if(psessionEntry != NULL)
1021 {
1022 palCopyMemory( pMac->hHdd, (tANI_U8 *) pSirSmeAuthRsp->peerMacAddr,
1023 (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1024 pSirSmeAuthRsp->authType = authType;
1025
1026 }
1027
1028 pSirSmeAuthRsp->messageType = eWNI_SME_AUTH_RSP;
1029 pSirSmeAuthRsp->length = sizeof(tSirSmeAuthRsp);
1030 pSirSmeAuthRsp->statusCode = statusCode;
1031 pSirSmeAuthRsp->protStatusCode = protStatusCode;
1032
1033 /* Update SME session and transaction Id*/
1034 pSirSmeAuthRsp->sessionId = smesessionId;
1035 pSirSmeAuthRsp->transactionId = smetransactionId;
1036
1037 mmhMsg.type = eWNI_SME_AUTH_RSP;
1038 mmhMsg.bodyptr = pSirSmeAuthRsp;
1039 mmhMsg.bodyval = 0;
1040 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
1041 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1042#endif
1043} /*** end limSendSmeAuthRsp() ***/
1044
1045
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001046void limSendSmeDisassocDeauthNtf( tpAniSirGlobal pMac,
Jeff Johnson295189b2012-06-20 16:38:30 -07001047 eHalStatus status, tANI_U32 *pCtx )
1048{
1049 tSirMsgQ mmhMsg;
1050 tSirMsgQ *pMsg = (tSirMsgQ*) pCtx;
1051
1052 mmhMsg.type = pMsg->type;
1053 mmhMsg.bodyptr = pMsg;
1054 mmhMsg.bodyval = 0;
1055
Jeff Johnsone7245742012-09-05 17:12:55 -07001056 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001057
1058 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1059}
1060/**
1061 * limSendSmeDisassocNtf()
1062 *
1063 *FUNCTION:
1064 * This function is called by limProcessSmeMessages() to send
1065 * eWNI_SME_DISASSOC_RSP/IND message to host
1066 *
1067 *PARAMS:
1068 *
1069 *LOGIC:
1070 *
1071 *ASSUMPTIONS:
1072 * NA
1073 *
1074 *NOTE:
1075 * This function is used for sending eWNI_SME_DISASSOC_CNF,
1076 * or eWNI_SME_DISASSOC_IND to host depending on
1077 * disassociation trigger.
1078 *
1079 * @param peerMacAddr Indicates the peer MAC addr to which
1080 * disassociate was initiated
1081 * @param reasonCode Indicates the reason for Disassociation
1082 * @param disassocTrigger Indicates the trigger for Disassociation
1083 * @param aid Indicates the STAID. This parameter is
1084 * present only on AP.
1085 *
1086 * @return None
1087 */
1088void
1089limSendSmeDisassocNtf(tpAniSirGlobal pMac,
1090 tSirMacAddr peerMacAddr,
1091 tSirResultCodes reasonCode,
1092 tANI_U16 disassocTrigger,
1093 tANI_U16 aid,
1094 tANI_U8 smesessionId,
1095 tANI_U16 smetransactionId,
1096 tpPESession psessionEntry)
1097{
1098
1099 tANI_U8 *pBuf;
1100 tSirSmeDisassocRsp *pSirSmeDisassocRsp;
1101 tSirSmeDisassocInd *pSirSmeDisassocInd;
1102 tANI_U32 *pMsg;
1103
1104 switch (disassocTrigger)
1105 {
1106 case eLIM_PEER_ENTITY_DISASSOC:
1107 return;
1108
1109 case eLIM_HOST_DISASSOC:
1110 /**
1111 * Disassociation response due to
1112 * host triggered disassociation
1113 */
1114
1115 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDisassocRsp, sizeof(tSirSmeDisassocRsp)))
1116 {
1117 // Log error
1118 limLog(pMac, LOGP,
1119 FL("call to palAllocateMemory failed for eWNI_SME_DISASSOC_RSP\n"));
1120
1121 return;
1122 }
1123
1124#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1125 sirStoreU16N((tANI_U8*)&pSirSmeDisassocRsp->messageType,
1126 eWNI_SME_DISASSOC_RSP);
1127 sirStoreU16N((tANI_U8*)&pSirSmeDisassocRsp->length,
1128 sizeof(tSirSmeDisassocRsp));
1129#else
1130 pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP;
1131 pSirSmeDisassocRsp->length = sizeof(tSirSmeDisassocRsp);
1132#endif
1133 //sessionId
1134 pBuf = (tANI_U8 *) &pSirSmeDisassocRsp->sessionId;
1135 *pBuf = smesessionId;
1136 pBuf++;
1137
1138 //transactionId
1139 limCopyU16(pBuf, smetransactionId);
1140 pBuf += sizeof(tANI_U16);
1141
1142 //statusCode
1143 limCopyU32(pBuf, reasonCode);
1144 pBuf += sizeof(tSirResultCodes);
1145
1146 //peerMacAddr
1147 palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
1148 pBuf += sizeof(tSirMacAddr);
1149
1150#if (WNI_POLARIS_FW_PRODUCT == AP)
1151 limCopyU16(pBuf, aid);
1152 pBuf += sizeof(tANI_U16);
1153
1154 // perStaStats
1155 limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[aid].staStat, pBuf);
1156#else
1157 // Clear Station Stats
1158 //for sta, it is always 1, IBSS is handled at halInitSta
1159
1160#endif//#if (WNI_POLARIS_FW_PRODUCT == AP)
1161
1162
1163#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1164 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_RSP_EVENT,
1165 psessionEntry, (tANI_U16)reasonCode, 0);
1166#endif
1167 pMsg = (tANI_U32*) pSirSmeDisassocRsp;
1168 break;
1169
1170 default:
1171 /**
1172 * Disassociation indication due to Disassociation
1173 * frame reception from peer entity or due to
1174 * loss of link with peer entity.
1175 */
1176 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDisassocInd, sizeof(tSirSmeDisassocInd)))
1177 {
1178 // Log error
1179 limLog(pMac, LOGP,
1180 FL("call to palAllocateMemory failed for eWNI_SME_DISASSOC_IND\n"));
1181
1182 return;
1183 }
1184
1185#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1186 sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->messageType,
1187 eWNI_SME_DISASSOC_IND);
1188 sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->length,
1189 sizeof(tSirSmeDisassocInd));
1190#else
1191 pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
1192 pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
1193
1194 /* Update SME session Id and Transaction Id */
1195 pSirSmeDisassocInd->sessionId = smesessionId;
1196 pSirSmeDisassocInd->transactionId = smetransactionId;
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001197 pSirSmeDisassocInd->reasonCode = reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -07001198#endif
1199 pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode;
1200
1201 limCopyU32(pBuf, reasonCode);
1202 pBuf += sizeof(tSirResultCodes);
1203
1204 palCopyMemory( pMac->hHdd, pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
1205 pBuf += sizeof(tSirMacAddr);
1206
1207 palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
1208#if (WNI_POLARIS_FW_PRODUCT == AP)
1209 pBuf += sizeof(tSirMacAddr);
1210 limCopyU16(pBuf, aid);
1211 pBuf += sizeof(tANI_U16);
1212
1213 limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[aid].staStat, pBuf);
1214
1215#endif//#if (WNI_POLARIS_FW_PRODUCT == AP)
1216
1217
1218#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1219 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT,
1220 psessionEntry, (tANI_U16)reasonCode, 0);
1221#endif
1222 pMsg = (tANI_U32*) pSirSmeDisassocInd;
1223#if (WNI_POLARIS_FW_PRODUCT == AP)
1224 PELOG1(limLog(pMac, LOG1,
1225 FL("*** Sending DisAssocInd staId=%d, reasonCode=%d ***\n"),
1226 aid, reasonCode);)
1227#endif
1228
1229 break;
1230 }
1231
1232 /* Delete the PE session Created */
1233 if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) ||
1234 (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) )
1235 {
1236 peDeleteSession(pMac,psessionEntry);
1237 }
1238
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001239 limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS,
Jeff Johnson295189b2012-06-20 16:38:30 -07001240 (tANI_U32*) pMsg );
Jeff Johnson295189b2012-06-20 16:38:30 -07001241} /*** end limSendSmeDisassocNtf() ***/
1242
1243
1244/** -----------------------------------------------------------------
1245 \brief limSendSmeDisassocInd() - sends SME_DISASSOC_IND
1246
1247 After receiving disassociation frame from peer entity, this
1248 function sends a eWNI_SME_DISASSOC_IND to SME with a specific
1249 reason code.
1250
1251 \param pMac - global mac structure
1252 \param pStaDs - station dph hash node
1253 \return none
1254 \sa
1255 ----------------------------------------------------------------- */
1256void
1257limSendSmeDisassocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry)
1258{
1259 tSirMsgQ mmhMsg;
1260 tSirSmeDisassocInd *pSirSmeDisassocInd;
1261
1262 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDisassocInd, sizeof(tSirSmeDisassocInd)))
1263 {
1264 limLog(pMac, LOGP, FL("palAllocateMemory failed for eWNI_SME_DISASSOC_IND\n"));
1265 return;
1266 }
1267
1268 //psessionEntry = peFindSessionByBssid(pMac,pStaDs->staAddr,&sessionId);
1269#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1270 sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->messageType, eWNI_SME_DISASSOC_IND);
1271 sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->length, sizeof(tSirSmeDisassocInd));
1272#else
1273 pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
1274 pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
1275#endif
1276
1277#if 0 //Commenting out all the serialization
1278 //statusCode
1279 pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode;
1280 limCopyU32(pBuf, pStaDs->mlmStaContext.disassocReason);
1281 pBuf += sizeof(tSirResultCodes);
1282
1283 //peerMacAddr
1284 palCopyMemory( pMac->hHdd, pBuf, pStaDs->staAddr, sizeof(tSirMacAddr));
1285
1286#ifdef ANI_PRODUCT_TYPE_AP
1287 pBuf += sizeof(tSirMacAddr);
1288 //aid
1289 limCopyU16(pBuf, pStaDs->assocId);
1290 pBuf += sizeof(tANI_U16);
1291
1292 //perStaStats
1293 limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[pStaDs->assocId].staStat, pBuf);
1294#endif
1295#endif
1296 pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId;
1297 pSirSmeDisassocInd->transactionId = psessionEntry->transactionId;
1298 pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason;
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001299 pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
Jeff Johnson295189b2012-06-20 16:38:30 -07001300
1301 palCopyMemory( pMac->hHdd, pSirSmeDisassocInd->bssId , psessionEntry->bssId , sizeof(tSirMacAddr));
1302
1303 palCopyMemory( pMac->hHdd, pSirSmeDisassocInd->peerMacAddr , pStaDs->staAddr, sizeof(tSirMacAddr));
1304
1305#ifdef ANI_PRODUCT_TYPE_AP
1306 pSirSmeDisassocInd->aid = pStaDs->assocId;
1307 limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[pStaDs->assocId].staStat,(tANI_U8*)&pSirSmeDisassocInd-> perStaStats );
1308#endif
1309#ifdef WLAN_SOFTAP_FEATURE
1310 pSirSmeDisassocInd->staId = pStaDs->staIndex;
1311#endif
1312
1313 mmhMsg.type = eWNI_SME_DISASSOC_IND;
1314 mmhMsg.bodyptr = pSirSmeDisassocInd;
1315 mmhMsg.bodyval = 0;
1316
Jeff Johnsone7245742012-09-05 17:12:55 -07001317 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001318#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1319 limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason);
1320#endif //FEATURE_WLAN_DIAG_SUPPORT
1321
1322 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1323
1324} /*** end limSendSmeDisassocInd() ***/
1325
1326
1327/** -----------------------------------------------------------------
1328 \brief limSendSmeDeauthInd() - sends SME_DEAUTH_IND
1329
1330 After receiving deauthentication frame from peer entity, this
1331 function sends a eWNI_SME_DEAUTH_IND to SME with a specific
1332 reason code.
1333
1334 \param pMac - global mac structure
1335 \param pStaDs - station dph hash node
1336 \return none
1337 \sa
1338 ----------------------------------------------------------------- */
1339void
1340limSendSmeDeauthInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry)
1341{
1342#ifndef WLAN_SOFTAP_FEATURE
1343 tANI_U8 *pBuf;
1344#endif
1345 tSirMsgQ mmhMsg;
1346 tSirSmeDeauthInd *pSirSmeDeauthInd;
1347
1348 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDeauthInd, sizeof(tSirSmeDeauthInd)))
1349 {
1350 limLog(pMac, LOGP, FL("palAllocateMemory failed for eWNI_SME_DEAUTH_IND \n"));
1351 return;
1352 }
1353
1354#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1355 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->messageType, eWNI_SME_DEAUTH_IND);
1356 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->length, sizeof(tSirSmeDeauthInd));
1357#else
1358 pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
1359 pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
1360#endif
1361
1362#ifdef WLAN_SOFTAP_FEATURE
1363 pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId;
1364 pSirSmeDeauthInd->transactionId = psessionEntry->transactionId;
1365 if(eSIR_INFRA_AP_MODE == psessionEntry->bssType)
1366 {
1367 pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.cleanupTrigger;
1368 }
1369 else
1370 {
1371 //Need to indicatet he reascon code over the air
1372 pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.disassocReason;
1373 }
1374 //BSSID
1375 palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
1376 //peerMacAddr
1377 palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr));
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001378 pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
Jeff Johnson295189b2012-06-20 16:38:30 -07001379#else
1380
1381 //sessionId
1382 pBuf = (tANI_U8 *) &pSirSmeDeauthInd->sessionId;
1383 *pBuf++ = psessionEntry->smeSessionId;
1384
1385 //transactionId
1386 limCopyU16(pBuf, 0);
1387 pBuf += sizeof(tANI_U16);
1388
1389 // status code
1390 limCopyU32(pBuf, pStaDs->mlmStaContext.cleanupTrigger);
1391 pBuf += sizeof(tSirResultCodes);
1392
1393 //bssid
1394 palCopyMemory( pMac->hHdd, pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
1395 pBuf += sizeof(tSirMacAddr);
1396
1397 //peerMacAddr
1398 palCopyMemory( pMac->hHdd, pBuf, pStaDs->staAddr, sizeof(tSirMacAddr));
1399#endif
1400
1401#if (WNI_POLARIS_FW_PRODUCT == AP)
1402 pBuf += sizeof(tSirMacAddr);
1403 limCopyU16(pBuf, pStaDs->staAddr);
1404#endif
1405
1406#ifdef WLAN_SOFTAP_FEATURE
1407 pSirSmeDeauthInd->staId = pStaDs->staIndex;
1408#endif
1409
1410 mmhMsg.type = eWNI_SME_DEAUTH_IND;
1411 mmhMsg.bodyptr = pSirSmeDeauthInd;
1412 mmhMsg.bodyval = 0;
1413
Jeff Johnsone7245742012-09-05 17:12:55 -07001414 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001415#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1416 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, psessionEntry, 0, pStaDs->mlmStaContext.cleanupTrigger);
1417#endif //FEATURE_WLAN_DIAG_SUPPORT
1418
1419 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1420 return;
1421} /*** end limSendSmeDeauthInd() ***/
1422
1423
1424/**
1425 * limSendSmeDeauthNtf()
1426 *
1427 *FUNCTION:
1428 * This function is called by limProcessSmeMessages() to send
1429 * eWNI_SME_DISASSOC_RSP/IND message to host
1430 *
1431 *PARAMS:
1432 *
1433 *LOGIC:
1434 *
1435 *ASSUMPTIONS:
1436 * NA
1437 *
1438 *NOTE:
1439 * This function is used for sending eWNI_SME_DEAUTH_CNF or
1440 * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger.
1441 *
1442 * @param peerMacAddr Indicates the peer MAC addr to which
1443 * deauthentication was initiated
1444 * @param reasonCode Indicates the reason for Deauthetication
1445 * @param deauthTrigger Indicates the trigger for Deauthetication
1446 * @param aid Indicates the STAID. This parameter is present
1447 * only on AP.
1448 *
1449 * @return None
1450 */
1451void
1452limSendSmeDeauthNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirResultCodes reasonCode,
1453 tANI_U16 deauthTrigger, tANI_U16 aid,tANI_U8 smesessionId, tANI_U16 smetransactionId)
1454{
1455 tANI_U8 *pBuf;
1456 tSirSmeDeauthRsp *pSirSmeDeauthRsp;
1457 tSirSmeDeauthInd *pSirSmeDeauthInd;
1458 tpPESession psessionEntry;
1459 tANI_U8 sessionId;
1460 tANI_U32 *pMsg;
1461
1462 psessionEntry = peFindSessionByBssid(pMac,peerMacAddr,&sessionId);
1463 switch (deauthTrigger)
1464 {
1465 case eLIM_PEER_ENTITY_DEAUTH:
1466 return;
1467
1468 case eLIM_HOST_DEAUTH:
1469 /**
1470 * Deauthentication response to host triggered
1471 * deauthentication.
1472 */
1473 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDeauthRsp, sizeof(tSirSmeDeauthRsp)))
1474 {
1475 // Log error
1476 limLog(pMac, LOGP,
1477 FL("call to palAllocateMemory failed for eWNI_SME_DEAUTH_RSP\n"));
1478
1479 return;
1480 }
1481
1482#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1483 sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->messageType),
1484 eWNI_SME_DEAUTH_RSP);
1485 sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->length),
1486 sizeof(tSirSmeDeauthRsp));
1487#else
1488 pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP;
1489 pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp);
1490#endif
1491 pSirSmeDeauthRsp->statusCode = reasonCode;
1492 pSirSmeDeauthRsp->sessionId = smesessionId;
1493 pSirSmeDeauthRsp->transactionId = smetransactionId;
1494
1495 pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr;
1496 palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
1497
1498#if (WNI_POLARIS_FW_PRODUCT == AP)
1499 pBuf += sizeof(tSirMacAddr);
1500 limCopyU16(pBuf, aid);
1501#endif
1502#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1503 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
1504 psessionEntry, 0, (tANI_U16)reasonCode);
1505#endif
1506 pMsg = (tANI_U32*)pSirSmeDeauthRsp;
1507
1508 break;
1509
1510 default:
1511 /**
1512 * Deauthentication indication due to Deauthentication
1513 * frame reception from peer entity or due to
1514 * loss of link with peer entity.
1515 */
1516 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDeauthInd, sizeof(tSirSmeDeauthInd)))
1517 {
1518 // Log error
1519 limLog(pMac, LOGP,
1520 FL("call to palAllocateMemory failed for eWNI_SME_DEAUTH_Ind\n"));
1521
1522 return;
1523 }
1524
1525#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1526 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->messageType,
1527 eWNI_SME_DEAUTH_IND);
1528 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->length,
1529 sizeof(tSirSmeDeauthInd));
1530#else
1531 pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
1532 pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001533 pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
Jeff Johnson295189b2012-06-20 16:38:30 -07001534#endif
1535
1536 // sessionId
1537 pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId;
1538 *pBuf++ = smesessionId;
1539
1540 //transaction ID
1541 limCopyU16(pBuf, smetransactionId);
1542 pBuf += sizeof(tANI_U16);
1543
1544 // status code
1545 limCopyU32(pBuf, reasonCode);
1546 pBuf += sizeof(tSirResultCodes);
1547
1548 //bssId
1549 palCopyMemory( pMac->hHdd, pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
1550 pBuf += sizeof(tSirMacAddr);
1551
1552 //peerMacAddr
1553 palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr));
1554
1555#if (WNI_POLARIS_FW_PRODUCT == AP)
1556 pBuf += sizeof(tSirMacAddr);
1557 limCopyU16(pBuf, aid);
1558#endif
1559#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1560 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT,
1561 psessionEntry, 0, (tANI_U16)reasonCode);
1562#endif //FEATURE_WLAN_DIAG_SUPPORT
1563 pMsg = (tANI_U32*)pSirSmeDeauthInd;
1564
1565 break;
1566 }
1567
1568 /*Delete the PE session created */
1569 if(psessionEntry != NULL)
1570 {
1571 peDeleteSession(pMac,psessionEntry);
1572 }
1573
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001574 limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS,
1575 (tANI_U32*) pMsg );
Jeff Johnson295189b2012-06-20 16:38:30 -07001576
Jeff Johnson295189b2012-06-20 16:38:30 -07001577} /*** end limSendSmeDeauthNtf() ***/
1578
1579
1580/**
1581 * limSendSmeWmStatusChangeNtf()
1582 *
1583 *FUNCTION:
1584 * This function is called by limProcessSmeMessages() to send
1585 * eWNI_SME_WM_STATUS_CHANGE_NTF message to host.
1586 *
1587 *PARAMS:
1588 *
1589 *LOGIC:
1590 *
1591 *ASSUMPTIONS:
1592 * NA
1593 *
1594 *NOTE:
1595 *
1596 * @param statusChangeCode Indicates the change in the wireless medium.
1597 * @param statusChangeInfo Indicates the information associated with
1598 * change in the wireless medium.
1599 * @param infoLen Indicates the length of status change information
1600 * being sent.
1601 *
1602 * @return None
1603 */
1604void
1605limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusChangeCode,
1606 tANI_U32 *pStatusChangeInfo, tANI_U16 infoLen, tANI_U8 sessionId)
1607{
1608 tSirMsgQ mmhMsg;
1609 tSirSmeWmStatusChangeNtf *pSirSmeWmStatusChangeNtf;
1610 eHalStatus status;
1611#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1612 tANI_U32 bufLen;
1613 tANI_U16 length=0;
1614 tANI_U8 *pBuf;
1615#endif
1616
1617
1618
1619 status = palAllocateMemory( pMac->hHdd, (void **)&pSirSmeWmStatusChangeNtf,
1620 sizeof(tSirSmeWmStatusChangeNtf));
1621 if (status != eHAL_STATUS_SUCCESS)
1622 {
1623 limLog(pMac, LOGE,
1624 FL("call to palAllocateMemory failed for eWNI_SME_WM_STATUS_CHANGE_NTF, status = %d\n"),
1625 status);
1626 return;
1627 }
1628
1629#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1630 pBuf = (tANI_U8 *)pSirSmeWmStatusChangeNtf;
1631#endif
1632
1633 mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF;
1634 mmhMsg.bodyval = 0;
1635 mmhMsg.bodyptr = pSirSmeWmStatusChangeNtf;
1636
1637 switch(statusChangeCode)
1638 {
1639 case eSIR_SME_RADAR_DETECTED:
1640
1641#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1642 bufLen = sizeof(tSirSmeWmStatusChangeNtf);
1643 if ((limSmeWmStatusChangeHeaderSerDes(pMac,
1644 statusChangeCode,
1645 pBuf,
1646 &length,
1647 bufLen,
1648 sessionId) != eSIR_SUCCESS))
1649 {
1650 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1651 limLog(pMac, LOGP, FL("Header SerDes failed \n"));
1652 return;
1653 }
1654 pBuf += length;
1655 bufLen -= length;
1656 if ((limRadioInfoSerDes(pMac,
1657 (tpSirRadarInfo)pStatusChangeInfo,
1658 pBuf,
1659 &length,
1660 bufLen) != eSIR_SUCCESS))
1661 {
1662 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1663 limLog(pMac, LOGP, FL("Radio Info SerDes failed \n"));
1664 return;
1665 }
1666
1667 pBuf = (tANI_U8 *) pSirSmeWmStatusChangeNtf;
1668 pBuf += sizeof(tANI_U16);
1669 limCopyU16(pBuf, length);
1670#endif
1671 break;
1672
1673 case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP:
1674#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1675
1676 if( eSIR_SUCCESS != nonTitanBssFoundSerDes( pMac,
1677 (tpSirNeighborBssWdsInfo) pStatusChangeInfo,
1678 pBuf,
1679 &length,
1680 sessionId))
1681 {
1682 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1683 limLog( pMac, LOGP,
1684 FL("Unable to serialize nonTitanBssFoundSerDes!\n"));
1685 return;
1686 }
1687#endif
1688 break;
1689
1690 case eSIR_SME_BACKGROUND_SCAN_FAIL:
1691 limPackBkgndScanFailNotify(pMac,
1692 statusChangeCode,
1693 (tpSirBackgroundScanInfo)pStatusChangeInfo,
1694 pSirSmeWmStatusChangeNtf, sessionId);
1695 break;
1696
1697 default:
1698#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1699 sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->messageType,
1700 eWNI_SME_WM_STATUS_CHANGE_NTF );
1701 sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->length,
1702 (sizeof(tSirSmeWmStatusChangeNtf)));
1703 pSirSmeWmStatusChangeNtf->sessionId = sessionId;
1704 sirStoreU32N((tANI_U8*)&pSirSmeWmStatusChangeNtf->statusChangeCode,
1705 statusChangeCode);
1706#else
1707 pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF;
1708 pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode;
1709 pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf);
1710 pSirSmeWmStatusChangeNtf->sessionId = sessionId;
1711#endif
1712 if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen)
1713 {
1714 palCopyMemory( pMac->hHdd, (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo, (tANI_U8 *)pStatusChangeInfo, infoLen);
1715 }
1716 limLog(pMac, LOGE, FL("***---*** StatusChg: code 0x%x, length %d ***---***\n"),
1717 statusChangeCode, infoLen);
1718 break;
1719 }
1720
1721
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08001722 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001723 if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT))
1724 {
1725 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1726 limLog( pMac, LOGP, FL("limSysProcessMmhMsgApi failed\n"));
1727 }
1728
1729} /*** end limSendSmeWmStatusChangeNtf() ***/
1730
1731
1732/**
1733 * limSendSmeSetContextRsp()
1734 *
1735 *FUNCTION:
1736 * This function is called by limProcessSmeMessages() to send
1737 * eWNI_SME_SETCONTEXT_RSP message to host
1738 *
1739 *PARAMS:
1740 *
1741 *LOGIC:
1742 *
1743 *ASSUMPTIONS:
1744 * NA
1745 *
1746 *NOTE:
1747 *
1748 * @param pMac Pointer to Global MAC structure
1749 * @param peerMacAddr Indicates the peer MAC addr to which
1750 * setContext was performed
1751 * @param aid Indicates the aid corresponding to the peer MAC
1752 * address
1753 * @param resultCode Indicates the result of previously issued
1754 * eWNI_SME_SETCONTEXT_RSP message
1755 *
1756 * @return None
1757 */
1758void
1759limSendSmeSetContextRsp(tpAniSirGlobal pMac,
1760 tSirMacAddr peerMacAddr, tANI_U16 aid,
1761 tSirResultCodes resultCode,
1762 tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
1763{
1764
1765 tANI_U8 *pBuf;
1766 tSirMsgQ mmhMsg;
1767 tSirSmeSetContextRsp *pSirSmeSetContextRsp;
1768
1769 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeSetContextRsp, sizeof(tSirSmeSetContextRsp)))
1770 {
1771 // Log error
1772 limLog(pMac, LOGP,
1773 FL("call to palAllocateMemory failed for SmeSetContextRsp\n"));
1774
1775 return;
1776 }
1777
1778#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1779 sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->messageType,
1780 eWNI_SME_SETCONTEXT_RSP);
1781 sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->length,
1782 sizeof(tSirSmeSetContextRsp));
1783#else
1784 pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP;
1785 pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp);
1786#endif
1787 pSirSmeSetContextRsp->statusCode = resultCode;
1788
1789 pBuf = pSirSmeSetContextRsp->peerMacAddr;
1790
1791 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1792 pBuf += sizeof(tSirMacAddr);
1793
1794#if (WNI_POLARIS_FW_PRODUCT == AP)
1795 limCopyU16(pBuf, aid);
1796 pBuf += sizeof(tANI_U16);
1797#endif
1798
1799 /* Update SME session and transaction Id*/
1800 pSirSmeSetContextRsp->sessionId = smesessionId;
1801 pSirSmeSetContextRsp->transactionId = smetransactionId;
1802
1803 mmhMsg.type = eWNI_SME_SETCONTEXT_RSP;
1804 mmhMsg.bodyptr = pSirSmeSetContextRsp;
1805 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07001806 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001807
1808#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1809 limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
1810#endif //FEATURE_WLAN_DIAG_SUPPORT
1811
1812 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1813} /*** end limSendSmeSetContextRsp() ***/
1814
1815/**
1816 * limSendSmeRemoveKeyRsp()
1817 *
1818 *FUNCTION:
1819 * This function is called by limProcessSmeMessages() to send
1820 * eWNI_SME_REMOVEKEY_RSP message to host
1821 *
1822 *PARAMS:
1823 *
1824 *LOGIC:
1825 *
1826 *ASSUMPTIONS:
1827 * NA
1828 *
1829 *NOTE:
1830 *
1831 * @param pMac Pointer to Global MAC structure
1832 * @param peerMacAddr Indicates the peer MAC addr to which
1833 * Removekey was performed
1834 * @param aid Indicates the aid corresponding to the peer MAC
1835 * address
1836 * @param resultCode Indicates the result of previously issued
1837 * eWNI_SME_REMOVEKEY_RSP message
1838 *
1839 * @return None
1840 */
1841void
1842limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac,
1843 tSirMacAddr peerMacAddr,
1844 tSirResultCodes resultCode,
1845 tpPESession psessionEntry,tANI_U8 smesessionId,
1846 tANI_U16 smetransactionId)
1847{
1848 tANI_U8 *pBuf;
1849 tSirMsgQ mmhMsg;
1850 tSirSmeRemoveKeyRsp *pSirSmeRemoveKeyRsp;
1851
1852 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeRemoveKeyRsp, sizeof(tSirSmeRemoveKeyRsp)))
1853 {
1854 // Log error
1855 limLog(pMac, LOGP,
1856 FL("call to palAllocateMemory failed for SmeRemoveKeyRsp\n"));
1857
1858 return;
1859 }
1860
1861#if defined (ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
1862 sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->messageType,
1863 eWNI_SME_REMOVEKEY_RSP);
1864 sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->length,
1865 sizeof(tSirSmeRemoveKeyRsp));
1866
1867#endif
1868
1869
1870 if(psessionEntry != NULL)
1871 {
1872 pBuf = pSirSmeRemoveKeyRsp->peerMacAddr;
1873 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1874 pBuf += sizeof(tSirMacAddr);
1875 limCopyU32(pBuf, resultCode);
1876 }
1877
1878 pSirSmeRemoveKeyRsp->messageType = eWNI_SME_REMOVEKEY_RSP;
1879 pSirSmeRemoveKeyRsp->length = sizeof(tSirSmeRemoveKeyRsp);
1880 pSirSmeRemoveKeyRsp->statusCode = resultCode;
1881
1882 /* Update SME session and transaction Id*/
1883 pSirSmeRemoveKeyRsp->sessionId = smesessionId;
1884 pSirSmeRemoveKeyRsp->transactionId = smetransactionId;
1885
1886 mmhMsg.type = eWNI_SME_REMOVEKEY_RSP;
1887 mmhMsg.bodyptr = pSirSmeRemoveKeyRsp;
1888 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07001889 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1891} /*** end limSendSmeSetContextRsp() ***/
1892
1893
1894/**
1895 * limSendSmePromiscuousModeRsp()
1896 *
1897 *FUNCTION:
1898 * This function is called by limProcessSmeMessages() to send
1899 * eWNI_PROMISCUOUS_MODE_RSP message to host
1900 *
1901 *PARAMS:
1902 *
1903 *LOGIC:
1904 *
1905 *ASSUMPTIONS:
1906 * NA
1907 *
1908 *NOTE:
1909 * This function is used for sending eWNI_SME_PROMISCUOUS_MODE_RSP to
1910 * host as a reply to eWNI_SME_PROMISCUOUS_MODE_REQ directive from it.
1911 *
1912 * @param None
1913 * @return None
1914 */
1915void
1916limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac)
1917{
1918#if 0
1919 tSirMsgQ mmhMsg;
1920 tSirMbMsg *pMbMsg;
1921
1922 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMbMsg, sizeof(tSirMbMsg)))
1923 {
1924 // Log error
1925 limLog(pMac, LOGP, FL("call to palAllocateMemory failed\n"));
1926
1927 return;
1928 }
1929
1930 pMbMsg->type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1931 pMbMsg->msgLen = 4;
1932
1933 mmhMsg.type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1934 mmhMsg.bodyptr = pMbMsg;
1935 mmhMsg.bodyval = 0;
1936 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
1937 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1938#endif
1939} /*** end limSendSmePromiscuousModeRsp() ***/
1940
1941
1942
1943/**
1944 * limSendSmeNeighborBssInd()
1945 *
1946 *FUNCTION:
1947 * This function is called by limLookupNaddHashEntry() to send
1948 * eWNI_SME_NEIGHBOR_BSS_IND message to host
1949 *
1950 *PARAMS:
1951 *
1952 *LOGIC:
1953 *
1954 *ASSUMPTIONS:
1955 * NA
1956 *
1957 *NOTE:
1958 * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to
1959 * host upon detecting new BSS during background scanning if CFG
1960 * option is enabled for sending such indication
1961 *
1962 * @param pMac - Pointer to Global MAC structure
1963 * @return None
1964 */
1965
1966void
1967limSendSmeNeighborBssInd(tpAniSirGlobal pMac,
1968 tLimScanResultNode *pBssDescr)
1969{
1970 tSirMsgQ msgQ;
1971 tANI_U32 val;
1972 tSirSmeNeighborBssInd *pNewBssInd;
1973
1974 if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) ||
1975 ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) &&
1976 pMac->lim.gLimRspReqd))
1977 {
1978 // LIM is not in background scan state OR
1979 // current scan is initiated by HDD.
1980 // No need to send new BSS indication to HDD
1981 return;
1982 }
1983
1984 if (wlan_cfgGetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != eSIR_SUCCESS)
1985 {
1986 limLog(pMac, LOGP, FL("could not get NEIGHBOR_BSS_IND from CFG\n"));
1987
1988 return;
1989 }
1990
1991 if (val == 0)
1992 return;
1993
1994 /**
1995 * Need to indicate new BSSs found during
1996 * background scanning to host.
1997 * Allocate buffer for sending indication.
1998 * Length of buffer is length of BSS description
1999 * and length of header itself
2000 */
2001 val = pBssDescr->bssDescription.length + sizeof(tANI_U16) + sizeof(tANI_U32) + sizeof(tANI_U8);
2002 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pNewBssInd, val))
2003 {
2004 // Log error
2005 limLog(pMac, LOGP,
2006 FL("call to palAllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND\n"));
2007
2008 return;
2009 }
2010
2011#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
2012 sirStoreU16N((tANI_U8*) &pNewBssInd->messageType,
2013 eWNI_SME_NEIGHBOR_BSS_IND);
2014 sirStoreU16N((tANI_U8*)&pNewBssInd->length, (tANI_U16)val );
2015#else
2016 pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND;
2017 pNewBssInd->length = (tANI_U16) val;
2018#endif
2019 pNewBssInd->sessionId = 0;
2020
2021#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
2022 palCopyMemory( pMac->hHdd, (tANI_U8 *) pNewBssInd->bssDescription,
2023 (tANI_U8 *) &pBssDescr->bssDescription,
2024 pBssDescr->bssDescription.length + sizeof(tANI_U16));
2025#endif
2026
2027 msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND;
2028 msgQ.bodyptr = pNewBssInd;
2029 msgQ.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002030 MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002031 limSysProcessMmhMsgApi(pMac, &msgQ, ePROT);
2032} /*** end limSendSmeNeighborBssInd() ***/
2033
2034/** -----------------------------------------------------------------
2035 \brief limSendSmeAddtsRsp() - sends SME ADDTS RSP
2036 \ This function sends a eWNI_SME_ADDTS_RSP to SME.
2037 \ SME only looks at rc and tspec field.
2038 \param pMac - global mac structure
2039 \param rspReqd - is SmeAddTsRsp required
2040 \param status - status code of SME_ADD_TS_RSP
2041 \return tspec
2042 \sa
2043 ----------------------------------------------------------------- */
2044void
2045limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESession psessionEntry,
2046 tSirMacTspecIE tspec, tANI_U8 smesessionId, tANI_U16 smetransactionId)
2047{
2048 tpSirAddtsRsp rsp;
2049 tSirMsgQ mmhMsg;
2050
2051 if (! rspReqd)
2052 return;
2053
2054 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirAddtsRsp)))
2055 {
2056 limLog(pMac, LOGP, FL("palAllocateMemory failed for ADDTS_RSP"));
2057 return;
2058 }
2059
2060 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2061 rsp->messageType = eWNI_SME_ADDTS_RSP;
2062 rsp->rc = status;
2063 rsp->rsp.status = (enum eSirMacStatusCodes) status;
2064 //palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp.tspec, (tANI_U8 *) &addts->tspec, sizeof(addts->tspec));
2065 rsp->rsp.tspec = tspec;
2066
2067 /* Update SME session Id and transcation Id */
2068 rsp->sessionId = smesessionId;
2069 rsp->transactionId = smetransactionId;
2070
2071 mmhMsg.type = eWNI_SME_ADDTS_RSP;
2072 mmhMsg.bodyptr = rsp;
2073 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002074 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002075#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2076 limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0);
2077#endif //FEATURE_WLAN_DIAG_SUPPORT
2078
2079 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2080 return;
2081}
2082
2083void
2084limSendSmeAddtsInd(tpAniSirGlobal pMac, tpSirAddtsReqInfo addts)
2085{
2086 tpSirAddtsRsp rsp;
2087 tSirMsgQ mmhMsg;
2088
2089 limLog(pMac, LOGW, "SendSmeAddtsInd (token %d, tsid %d, up %d)\n",
2090 addts->dialogToken,
2091 addts->tspec.tsinfo.traffic.tsid,
2092 addts->tspec.tsinfo.traffic.userPrio);
2093
2094 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirAddtsRsp)))
2095 {
2096 // Log error
2097 limLog(pMac, LOGP, FL("palAllocateMemory failed for ADDTS_IND\n"));
2098 return;
2099 }
2100 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2101
2102 rsp->messageType = eWNI_SME_ADDTS_IND;
2103
2104 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) addts, sizeof(*addts));
2105
2106 mmhMsg.type = eWNI_SME_ADDTS_IND;
2107 mmhMsg.bodyptr = rsp;
2108 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002109 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002110 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2111}
2112
2113void
2114limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
2115{
2116 tpSirDeltsRsp rsp;
2117 tSirMsgQ mmhMsg;
2118
2119 limLog(pMac, LOGW, "SendSmeDeltsRsp (aid %d, tsid %d, up %d) status %d\n",
2120 delts->aid,
2121 delts->req.tsinfo.traffic.tsid,
2122 delts->req.tsinfo.traffic.userPrio,
2123 status);
2124 if (! delts->rspReqd)
2125 return;
2126
2127 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirDeltsRsp)))
2128 {
2129 // Log error
2130 limLog(pMac, LOGP, FL("palAllocateMemory failed for DELTS_RSP\n"));
2131 return;
2132 }
2133 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2134
2135 if(psessionEntry != NULL)
2136 {
2137
2138 rsp->aid = delts->aid;
2139 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->macAddr[0], (tANI_U8 *) &delts->macAddr[0], 6);
2140 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) &delts->req, sizeof(tSirDeltsReqInfo));
2141 }
2142
2143
2144 rsp->messageType = eWNI_SME_DELTS_RSP;
2145 rsp->rc = status;
2146
2147 /* Update SME session Id and transcation Id */
2148 rsp->sessionId = smesessionId;
2149 rsp->transactionId = smetransactionId;
2150
2151 mmhMsg.type = eWNI_SME_DELTS_RSP;
2152 mmhMsg.bodyptr = rsp;
2153 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002154 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002155#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2156 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0);
2157#endif //FEATURE_WLAN_DIAG_SUPPORT
2158
2159 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2160}
2161
2162void
2163limSendSmeDeltsInd(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, tANI_U16 aid,tpPESession psessionEntry)
2164{
2165 tpSirDeltsRsp rsp;
2166 tSirMsgQ mmhMsg;
2167
2168 limLog(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)\n",
2169 aid,
2170 delts->tsinfo.traffic.tsid,
2171 delts->tsinfo.traffic.userPrio);
2172
2173 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirDeltsRsp)))
2174 {
2175 // Log error
2176 limLog(pMac, LOGP, FL("palAllocateMemory failed for DELTS_IND\n"));
2177 return;
2178 }
2179 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2180
2181 rsp->messageType = eWNI_SME_DELTS_IND;
2182 rsp->rc = eSIR_SUCCESS;
2183 rsp->aid = aid;
2184 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) delts, sizeof(*delts));
2185
2186 /* Update SME session Id and SME transaction Id */
2187
2188 rsp->sessionId = psessionEntry->smeSessionId;
2189 rsp->transactionId = psessionEntry->transactionId;
2190
2191 mmhMsg.type = eWNI_SME_DELTS_IND;
2192 mmhMsg.bodyptr = rsp;
2193 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002194 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002195#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2196 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, 0);
2197#endif //FEATURE_WLAN_DIAG_SUPPORT
2198
2199 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2200}
2201
2202/**
2203 * limSendSmeStatsRsp()
2204 *
2205 *FUNCTION:
2206 * This function is called to send 802.11 statistics response to HDD.
2207 * This function posts the result back to HDD. This is a response to
2208 * HDD's request for statistics.
2209 *
2210 *PARAMS:
2211 *
2212 *LOGIC:
2213 *
2214 *ASSUMPTIONS:
2215 * NA
2216 *
2217 *NOTE:
2218 * NA
2219 *
2220 * @param pMac Pointer to Global MAC structure
2221 * @param p80211Stats Statistics sent in response
2222 * @param resultCode TODO:
2223 *
2224 *
2225 * @return none
2226 */
2227
2228void
2229limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2230{
2231 tSirMsgQ mmhMsg;
2232 tSirSmeRsp *pMsgHdr = (tSirSmeRsp*) stats;
2233
2234 switch(msgType)
2235 {
2236 case WDA_STA_STAT_RSP:
2237 mmhMsg.type = eWNI_SME_STA_STAT_RSP;
2238 break;
2239 case WDA_AGGR_STAT_RSP:
2240 mmhMsg.type = eWNI_SME_AGGR_STAT_RSP;
2241 break;
2242 case WDA_GLOBAL_STAT_RSP:
2243 mmhMsg.type = eWNI_SME_GLOBAL_STAT_RSP;
2244 break;
2245 case WDA_STAT_SUMM_RSP:
2246 mmhMsg.type = eWNI_SME_STAT_SUMM_RSP;
2247 break;
2248 default:
2249 mmhMsg.type = msgType; //Response from within PE
2250 break;
2251 }
2252
2253 pMsgHdr->messageType = mmhMsg.type;
2254
2255 mmhMsg.bodyptr = stats;
2256 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002257 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002258 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2259
2260 return;
2261
2262} /*** end limSendSmeStatsRsp() ***/
2263
2264/**
2265 * limSendSmePEStatisticsRsp()
2266 *
2267 *FUNCTION:
2268 * This function is called to send 802.11 statistics response to HDD.
2269 * This function posts the result back to HDD. This is a response to
2270 * HDD's request for statistics.
2271 *
2272 *PARAMS:
2273 *
2274 *LOGIC:
2275 *
2276 *ASSUMPTIONS:
2277 * NA
2278 *
2279 *NOTE:
2280 * NA
2281 *
2282 * @param pMac Pointer to Global MAC structure
2283 * @param p80211Stats Statistics sent in response
2284 * @param resultCode TODO:
2285 *
2286 *
2287 * @return none
2288 */
2289
2290void
2291limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2292{
2293 tSirMsgQ mmhMsg;
2294 tANI_U8 sessionId;
2295 tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats;
2296 tpPESession pPeSessionEntry;
2297
2298 //Get the Session Id based on Sta Id
2299 pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId);
2300
2301 //Fill the Session Id
2302 if(NULL != pPeSessionEntry)
2303 {
2304 //Fill the Session Id
2305 pPeStats->sessionId = pPeSessionEntry->smeSessionId;
2306 }
2307
2308 pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP;
2309
2310
2311 //msgType should be WDA_GET_STATISTICS_RSP
2312 mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP;
2313
2314 mmhMsg.bodyptr = stats;
2315 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002316 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002317 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2318
2319 return;
2320
2321} /*** end limSendSmePEStatisticsRsp() ***/
2322
2323
2324void
2325limSendSmeIBSSPeerInd(
2326 tpAniSirGlobal pMac,
2327 tSirMacAddr peerMacAddr,
2328 tANI_U16 staIndex,
2329 tANI_U8 ucastIdx,
2330 tANI_U8 bcastIdx,
2331 tANI_U8 *beacon,
2332 tANI_U16 beaconLen,
2333 tANI_U16 msgType,
2334 tANI_U8 sessionId)
2335{
2336 tSirMsgQ mmhMsg;
2337 tSmeIbssPeerInd *pNewPeerInd;
2338
Jeff Johnson43971f52012-07-17 12:26:56 -07002339 if(eHAL_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07002340 palAllocateMemory(pMac->hHdd,(void * *) &pNewPeerInd,(sizeof(tSmeIbssPeerInd) + beaconLen)))
2341 {
2342 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2343 return;
2344 }
2345
2346 palZeroMemory(pMac->hHdd, (void *) pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen));
2347
2348 palCopyMemory( pMac->hHdd, (tANI_U8 *) pNewPeerInd->peerAddr,
2349 peerMacAddr, sizeof(tSirMacAddr));
2350 pNewPeerInd->staId= staIndex;
2351 pNewPeerInd->ucastSig = ucastIdx;
2352 pNewPeerInd->bcastSig = bcastIdx;
2353 pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen;
2354 pNewPeerInd->mesgType = msgType;
2355 pNewPeerInd->sessionId = sessionId;
2356
2357 if ( beacon != NULL )
2358 {
2359 palCopyMemory(pMac->hHdd, (void*) ((tANI_U8*)pNewPeerInd+sizeof(tSmeIbssPeerInd)), (void*)beacon, beaconLen);
2360 }
2361
2362 mmhMsg.type = msgType;
2363// mmhMsg.bodyval = (tANI_U32) pNewPeerInd;
2364 mmhMsg.bodyptr = pNewPeerInd;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002365 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002366 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2367
2368}
2369
2370
2371/** -----------------------------------------------------------------
2372 \brief limSendExitBmpsInd() - sends exit bmps indication
2373
2374 This function sends a eWNI_PMC_EXIT_BMPS_IND with a specific reason
2375 code to SME. This will trigger SME to get out of BMPS mode.
2376
2377 \param pMac - global mac structure
2378 \param reasonCode - reason for which PE wish to exit BMPS
2379 \return none
2380 \sa
2381 ----------------------------------------------------------------- */
2382void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode)
2383{
2384 tSirMsgQ mmhMsg;
2385 tANI_U16 msgLen = 0;
2386 tpSirSmeExitBmpsInd pExitBmpsInd;
2387
2388 msgLen = sizeof(tSirSmeExitBmpsInd);
2389 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pExitBmpsInd, msgLen ))
2390 {
2391 limLog(pMac, LOGP, FL("palAllocateMemory failed for PMC_EXIT_BMPS_IND \n"));
2392 return;
2393 }
2394 palZeroMemory(pMac->hHdd, pExitBmpsInd, msgLen);
2395
2396#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
2397 sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgType, eWNI_PMC_EXIT_BMPS_IND);
2398 sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgLen, msgLen);
2399#else
2400 pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND;
2401 pExitBmpsInd->mesgLen = msgLen;
2402#endif
2403 pExitBmpsInd->exitBmpsReason = reasonCode;
2404 pExitBmpsInd->statusCode = eSIR_SME_SUCCESS;
2405
2406 mmhMsg.type = eWNI_PMC_EXIT_BMPS_IND;
2407 mmhMsg.bodyptr = pExitBmpsInd;
2408 mmhMsg.bodyval = 0;
2409
2410 PELOG1(limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. \n"));)
Jeff Johnsone7245742012-09-05 17:12:55 -07002411 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002412#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2413 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode);
2414#endif //FEATURE_WLAN_DIAG_SUPPORT
2415
2416 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2417 return;
2418
2419} /*** end limSendExitBmpsInd() ***/
2420
2421
2422
2423
2424/*--------------------------------------------------------------------------
2425 \brief peDeleteSession() - Handle the Delete BSS Response from HAL.
2426
2427
2428 \param pMac - pointer to global adapter context
2429 \param sessionId - Message pointer.
2430
2431 \sa
2432 --------------------------------------------------------------------------*/
2433
2434void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ)
2435{
2436 tpPESession psessionEntry;
2437 tpDeleteBssParams pDelBss = (tpDeleteBssParams)(MsgQ->bodyptr);
2438 if((psessionEntry = peFindSessionBySessionId(pMac,pDelBss->sessionId))==NULL)
2439 {
2440 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
2441 return;
2442 }
2443 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)
2444 {
2445 limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry);
2446 }
2447 else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE)
2448 {
2449 limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry);
2450 }
2451
2452 else
2453 limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry);
2454
2455}
2456
2457#ifdef WLAN_FEATURE_VOWIFI_11R
2458/** -----------------------------------------------------------------
2459 \brief limSendSmeAggrQosRsp() - sends SME FT AGGR QOS RSP
2460 \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME.
2461 \ SME only looks at rc and tspec field.
2462 \param pMac - global mac structure
2463 \param rspReqd - is SmeAddTsRsp required
2464 \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP
2465 \return tspec
2466 \sa
2467 ----------------------------------------------------------------- */
2468void
2469limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp,
2470 tANI_U8 smesessionId)
2471{
2472 tSirMsgQ mmhMsg;
2473
2474 mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP;
2475 mmhMsg.bodyptr = aggrQosRsp;
2476 mmhMsg.bodyval = 0;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002477 MTRACE(macTraceMsgTx(pMac, smesessionId , mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002478 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2479
2480 return;
2481}
2482#endif
2483
2484/** -----------------------------------------------------------------
2485 \brief limSendSmePreChannelSwitchInd() - sends an indication to SME
2486 before switching channels for spectrum manangement.
2487
2488 This function sends a eWNI_SME_PRE_SWITCH_CHL_IND to SME.
2489
2490 \param pMac - global mac structure
2491 \return none
2492 \sa
2493 ----------------------------------------------------------------- */
2494void
2495limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac)
2496{
2497 tSirMsgQ mmhMsg;
2498
2499 mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND;
2500 mmhMsg.bodyptr = NULL;
2501 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002502 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002503 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2504
2505 return;
2506}
2507
2508/** -----------------------------------------------------------------
2509 \brief limSendSmePostChannelSwitchInd() - sends an indication to SME
2510 after channel switch for spectrum manangement is complete.
2511
2512 This function sends a eWNI_SME_POST_SWITCH_CHL_IND to SME.
2513
2514 \param pMac - global mac structure
2515 \return none
2516 \sa
2517 ----------------------------------------------------------------- */
2518void
2519limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac)
2520{
2521 tSirMsgQ mmhMsg;
2522
2523 mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND;
2524 mmhMsg.bodyptr = NULL;
2525 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002526 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002527 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2528
2529 return;
2530}
2531
2532void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
2533 tANI_U8 smesessionId)
2534{
2535 tSirMsgQ mmhMsg;
2536 tSmeMaxAssocInd *pSmeMaxAssocInd;
2537
Jeff Johnson43971f52012-07-17 12:26:56 -07002538 if(eHAL_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07002539 palAllocateMemory(pMac->hHdd,(void **)&pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd)))
2540 {
2541 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2542 return;
2543 }
2544 palZeroMemory(pMac->hHdd, (void *) pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd));
2545 palCopyMemory( pMac->hHdd, (tANI_U8 *)pSmeMaxAssocInd->peerMac,
2546 (tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr));
2547 pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED;
2548 pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd);
2549 pSmeMaxAssocInd->sessionId = smesessionId;
2550 mmhMsg.type = pSmeMaxAssocInd->mesgType;
2551 mmhMsg.bodyptr = pSmeMaxAssocInd;
2552 PELOG1(limLog(pMac, LOG1, FL("msgType %s peerMacAddr %02x-%02x-%02x-%02x-%02x-%02x"
2553 "sme session id %d\n"),"eWNI_SME_MAX_ASSOC_EXCEEDED", peerMacAddr[0], peerMacAddr[1],
2554 peerMacAddr[2], peerMacAddr[3], peerMacAddr[4], peerMacAddr[5], smesessionId);)
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002555 MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002556 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2557
2558 return;
2559}