blob: 3e1d59bfdef163c2cab38a4654d24a9d7a3d9e8c [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
Hoonki Leee6bfe942013-02-05 15:01:19 -08001423#ifdef FEATURE_WLAN_TDLS
1424/**
1425 * limSendSmeTDLSDelStaInd()
1426 *
1427 *FUNCTION:
1428 * This function is called to send the TDLS STA context deletion to SME.
1429 *
1430 *LOGIC:
1431 *
1432 *ASSUMPTIONS:
1433 *
1434 *NOTE:
1435 * NA
1436 *
1437 * @param pMac - Pointer to global MAC structure
1438 * @param pStaDs - Pointer to internal STA Datastructure
1439 * @param psessionEntry - Pointer to the session entry
1440 * @param reasonCode - Reason for TDLS sta deletion
1441 * @return None
1442 */
1443void
1444limSendSmeTDLSDelStaInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, tANI_U16 reasonCode)
1445{
1446 tSirMsgQ mmhMsg;
1447 tSirTdlsDelStaInd *pSirTdlsDelStaInd;
1448
1449 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirTdlsDelStaInd, sizeof(tSirTdlsDelStaInd)))
1450 {
1451 limLog(pMac, LOGP, FL("palAllocateMemory failed for eWNI_SME_TDLS_DEL_STA_IND \n"));
1452 return;
1453 }
1454
1455 //messageType
1456 pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND;
1457 pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd);
1458
1459 //sessionId
1460 pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId;
1461
1462 //peerMacAddr
1463 palCopyMemory( pMac->hHdd, pSirTdlsDelStaInd->peerMac, pStaDs->staAddr, sizeof(tSirMacAddr));
1464
1465 //staId
1466 limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->staId), (tANI_U16)pStaDs->staIndex);
1467
1468 //reasonCode
1469 limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->reasonCode), reasonCode);
1470
1471 mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND;
1472 mmhMsg.bodyptr = pSirTdlsDelStaInd;
1473 mmhMsg.bodyval = 0;
1474
1475
1476 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1477 return;
1478}/*** end limSendSmeTDLSDelStaInd() ***/
1479#endif
1480
Jeff Johnson295189b2012-06-20 16:38:30 -07001481
1482/**
1483 * limSendSmeDeauthNtf()
1484 *
1485 *FUNCTION:
1486 * This function is called by limProcessSmeMessages() to send
1487 * eWNI_SME_DISASSOC_RSP/IND message to host
1488 *
1489 *PARAMS:
1490 *
1491 *LOGIC:
1492 *
1493 *ASSUMPTIONS:
1494 * NA
1495 *
1496 *NOTE:
1497 * This function is used for sending eWNI_SME_DEAUTH_CNF or
1498 * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger.
1499 *
1500 * @param peerMacAddr Indicates the peer MAC addr to which
1501 * deauthentication was initiated
1502 * @param reasonCode Indicates the reason for Deauthetication
1503 * @param deauthTrigger Indicates the trigger for Deauthetication
1504 * @param aid Indicates the STAID. This parameter is present
1505 * only on AP.
1506 *
1507 * @return None
1508 */
1509void
1510limSendSmeDeauthNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirResultCodes reasonCode,
1511 tANI_U16 deauthTrigger, tANI_U16 aid,tANI_U8 smesessionId, tANI_U16 smetransactionId)
1512{
1513 tANI_U8 *pBuf;
1514 tSirSmeDeauthRsp *pSirSmeDeauthRsp;
1515 tSirSmeDeauthInd *pSirSmeDeauthInd;
1516 tpPESession psessionEntry;
1517 tANI_U8 sessionId;
1518 tANI_U32 *pMsg;
1519
1520 psessionEntry = peFindSessionByBssid(pMac,peerMacAddr,&sessionId);
1521 switch (deauthTrigger)
1522 {
1523 case eLIM_PEER_ENTITY_DEAUTH:
1524 return;
1525
1526 case eLIM_HOST_DEAUTH:
1527 /**
1528 * Deauthentication response to host triggered
1529 * deauthentication.
1530 */
1531 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDeauthRsp, sizeof(tSirSmeDeauthRsp)))
1532 {
1533 // Log error
1534 limLog(pMac, LOGP,
1535 FL("call to palAllocateMemory failed for eWNI_SME_DEAUTH_RSP\n"));
1536
1537 return;
1538 }
1539
1540#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1541 sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->messageType),
1542 eWNI_SME_DEAUTH_RSP);
1543 sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->length),
1544 sizeof(tSirSmeDeauthRsp));
1545#else
1546 pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP;
1547 pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp);
1548#endif
1549 pSirSmeDeauthRsp->statusCode = reasonCode;
1550 pSirSmeDeauthRsp->sessionId = smesessionId;
1551 pSirSmeDeauthRsp->transactionId = smetransactionId;
1552
1553 pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr;
1554 palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
1555
1556#if (WNI_POLARIS_FW_PRODUCT == AP)
1557 pBuf += sizeof(tSirMacAddr);
1558 limCopyU16(pBuf, aid);
1559#endif
1560#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1561 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
1562 psessionEntry, 0, (tANI_U16)reasonCode);
1563#endif
1564 pMsg = (tANI_U32*)pSirSmeDeauthRsp;
1565
1566 break;
1567
1568 default:
1569 /**
1570 * Deauthentication indication due to Deauthentication
1571 * frame reception from peer entity or due to
1572 * loss of link with peer entity.
1573 */
1574 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeDeauthInd, sizeof(tSirSmeDeauthInd)))
1575 {
1576 // Log error
1577 limLog(pMac, LOGP,
1578 FL("call to palAllocateMemory failed for eWNI_SME_DEAUTH_Ind\n"));
1579
1580 return;
1581 }
1582
1583#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1584 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->messageType,
1585 eWNI_SME_DEAUTH_IND);
1586 sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->length,
1587 sizeof(tSirSmeDeauthInd));
1588#else
1589 pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
1590 pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
Mohit Khanna99d5fd02012-09-11 14:51:20 -07001591 pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
Jeff Johnson295189b2012-06-20 16:38:30 -07001592#endif
1593
1594 // sessionId
1595 pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId;
1596 *pBuf++ = smesessionId;
1597
1598 //transaction ID
1599 limCopyU16(pBuf, smetransactionId);
1600 pBuf += sizeof(tANI_U16);
1601
1602 // status code
1603 limCopyU32(pBuf, reasonCode);
1604 pBuf += sizeof(tSirResultCodes);
1605
1606 //bssId
1607 palCopyMemory( pMac->hHdd, pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
1608 pBuf += sizeof(tSirMacAddr);
1609
1610 //peerMacAddr
1611 palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr));
1612
1613#if (WNI_POLARIS_FW_PRODUCT == AP)
1614 pBuf += sizeof(tSirMacAddr);
1615 limCopyU16(pBuf, aid);
1616#endif
1617#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1618 limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT,
1619 psessionEntry, 0, (tANI_U16)reasonCode);
1620#endif //FEATURE_WLAN_DIAG_SUPPORT
1621 pMsg = (tANI_U32*)pSirSmeDeauthInd;
1622
1623 break;
1624 }
1625
1626 /*Delete the PE session created */
1627 if(psessionEntry != NULL)
1628 {
1629 peDeleteSession(pMac,psessionEntry);
1630 }
1631
Madan Mohan Koyyalamudi27ecc282012-11-06 15:07:28 -08001632 limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS,
1633 (tANI_U32*) pMsg );
Jeff Johnson295189b2012-06-20 16:38:30 -07001634
Jeff Johnson295189b2012-06-20 16:38:30 -07001635} /*** end limSendSmeDeauthNtf() ***/
1636
1637
1638/**
1639 * limSendSmeWmStatusChangeNtf()
1640 *
1641 *FUNCTION:
1642 * This function is called by limProcessSmeMessages() to send
1643 * eWNI_SME_WM_STATUS_CHANGE_NTF message to host.
1644 *
1645 *PARAMS:
1646 *
1647 *LOGIC:
1648 *
1649 *ASSUMPTIONS:
1650 * NA
1651 *
1652 *NOTE:
1653 *
1654 * @param statusChangeCode Indicates the change in the wireless medium.
1655 * @param statusChangeInfo Indicates the information associated with
1656 * change in the wireless medium.
1657 * @param infoLen Indicates the length of status change information
1658 * being sent.
1659 *
1660 * @return None
1661 */
1662void
1663limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusChangeCode,
1664 tANI_U32 *pStatusChangeInfo, tANI_U16 infoLen, tANI_U8 sessionId)
1665{
1666 tSirMsgQ mmhMsg;
1667 tSirSmeWmStatusChangeNtf *pSirSmeWmStatusChangeNtf;
1668 eHalStatus status;
1669#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1670 tANI_U32 bufLen;
1671 tANI_U16 length=0;
1672 tANI_U8 *pBuf;
1673#endif
1674
1675
1676
1677 status = palAllocateMemory( pMac->hHdd, (void **)&pSirSmeWmStatusChangeNtf,
1678 sizeof(tSirSmeWmStatusChangeNtf));
1679 if (status != eHAL_STATUS_SUCCESS)
1680 {
1681 limLog(pMac, LOGE,
1682 FL("call to palAllocateMemory failed for eWNI_SME_WM_STATUS_CHANGE_NTF, status = %d\n"),
1683 status);
1684 return;
1685 }
1686
1687#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1688 pBuf = (tANI_U8 *)pSirSmeWmStatusChangeNtf;
1689#endif
1690
1691 mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF;
1692 mmhMsg.bodyval = 0;
1693 mmhMsg.bodyptr = pSirSmeWmStatusChangeNtf;
1694
1695 switch(statusChangeCode)
1696 {
1697 case eSIR_SME_RADAR_DETECTED:
1698
1699#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1700 bufLen = sizeof(tSirSmeWmStatusChangeNtf);
1701 if ((limSmeWmStatusChangeHeaderSerDes(pMac,
1702 statusChangeCode,
1703 pBuf,
1704 &length,
1705 bufLen,
1706 sessionId) != eSIR_SUCCESS))
1707 {
1708 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1709 limLog(pMac, LOGP, FL("Header SerDes failed \n"));
1710 return;
1711 }
1712 pBuf += length;
1713 bufLen -= length;
1714 if ((limRadioInfoSerDes(pMac,
1715 (tpSirRadarInfo)pStatusChangeInfo,
1716 pBuf,
1717 &length,
1718 bufLen) != eSIR_SUCCESS))
1719 {
1720 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1721 limLog(pMac, LOGP, FL("Radio Info SerDes failed \n"));
1722 return;
1723 }
1724
1725 pBuf = (tANI_U8 *) pSirSmeWmStatusChangeNtf;
1726 pBuf += sizeof(tANI_U16);
1727 limCopyU16(pBuf, length);
1728#endif
1729 break;
1730
1731 case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP:
1732#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
1733
1734 if( eSIR_SUCCESS != nonTitanBssFoundSerDes( pMac,
1735 (tpSirNeighborBssWdsInfo) pStatusChangeInfo,
1736 pBuf,
1737 &length,
1738 sessionId))
1739 {
1740 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1741 limLog( pMac, LOGP,
1742 FL("Unable to serialize nonTitanBssFoundSerDes!\n"));
1743 return;
1744 }
1745#endif
1746 break;
1747
1748 case eSIR_SME_BACKGROUND_SCAN_FAIL:
1749 limPackBkgndScanFailNotify(pMac,
1750 statusChangeCode,
1751 (tpSirBackgroundScanInfo)pStatusChangeInfo,
1752 pSirSmeWmStatusChangeNtf, sessionId);
1753 break;
1754
1755 default:
1756#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1757 sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->messageType,
1758 eWNI_SME_WM_STATUS_CHANGE_NTF );
1759 sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->length,
1760 (sizeof(tSirSmeWmStatusChangeNtf)));
1761 pSirSmeWmStatusChangeNtf->sessionId = sessionId;
1762 sirStoreU32N((tANI_U8*)&pSirSmeWmStatusChangeNtf->statusChangeCode,
1763 statusChangeCode);
1764#else
1765 pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF;
1766 pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode;
1767 pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf);
1768 pSirSmeWmStatusChangeNtf->sessionId = sessionId;
1769#endif
1770 if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen)
1771 {
1772 palCopyMemory( pMac->hHdd, (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo, (tANI_U8 *)pStatusChangeInfo, infoLen);
1773 }
1774 limLog(pMac, LOGE, FL("***---*** StatusChg: code 0x%x, length %d ***---***\n"),
1775 statusChangeCode, infoLen);
1776 break;
1777 }
1778
1779
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08001780 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001781 if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT))
1782 {
1783 palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
1784 limLog( pMac, LOGP, FL("limSysProcessMmhMsgApi failed\n"));
1785 }
1786
1787} /*** end limSendSmeWmStatusChangeNtf() ***/
1788
1789
1790/**
1791 * limSendSmeSetContextRsp()
1792 *
1793 *FUNCTION:
1794 * This function is called by limProcessSmeMessages() to send
1795 * eWNI_SME_SETCONTEXT_RSP message to host
1796 *
1797 *PARAMS:
1798 *
1799 *LOGIC:
1800 *
1801 *ASSUMPTIONS:
1802 * NA
1803 *
1804 *NOTE:
1805 *
1806 * @param pMac Pointer to Global MAC structure
1807 * @param peerMacAddr Indicates the peer MAC addr to which
1808 * setContext was performed
1809 * @param aid Indicates the aid corresponding to the peer MAC
1810 * address
1811 * @param resultCode Indicates the result of previously issued
1812 * eWNI_SME_SETCONTEXT_RSP message
1813 *
1814 * @return None
1815 */
1816void
1817limSendSmeSetContextRsp(tpAniSirGlobal pMac,
1818 tSirMacAddr peerMacAddr, tANI_U16 aid,
1819 tSirResultCodes resultCode,
1820 tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
1821{
1822
1823 tANI_U8 *pBuf;
1824 tSirMsgQ mmhMsg;
1825 tSirSmeSetContextRsp *pSirSmeSetContextRsp;
1826
1827 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeSetContextRsp, sizeof(tSirSmeSetContextRsp)))
1828 {
1829 // Log error
1830 limLog(pMac, LOGP,
1831 FL("call to palAllocateMemory failed for SmeSetContextRsp\n"));
1832
1833 return;
1834 }
1835
1836#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
1837 sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->messageType,
1838 eWNI_SME_SETCONTEXT_RSP);
1839 sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->length,
1840 sizeof(tSirSmeSetContextRsp));
1841#else
1842 pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP;
1843 pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp);
1844#endif
1845 pSirSmeSetContextRsp->statusCode = resultCode;
1846
1847 pBuf = pSirSmeSetContextRsp->peerMacAddr;
1848
1849 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1850 pBuf += sizeof(tSirMacAddr);
1851
1852#if (WNI_POLARIS_FW_PRODUCT == AP)
1853 limCopyU16(pBuf, aid);
1854 pBuf += sizeof(tANI_U16);
1855#endif
1856
1857 /* Update SME session and transaction Id*/
1858 pSirSmeSetContextRsp->sessionId = smesessionId;
1859 pSirSmeSetContextRsp->transactionId = smetransactionId;
1860
1861 mmhMsg.type = eWNI_SME_SETCONTEXT_RSP;
1862 mmhMsg.bodyptr = pSirSmeSetContextRsp;
1863 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07001864 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001865
1866#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1867 limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
1868#endif //FEATURE_WLAN_DIAG_SUPPORT
1869
1870 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1871} /*** end limSendSmeSetContextRsp() ***/
1872
1873/**
1874 * limSendSmeRemoveKeyRsp()
1875 *
1876 *FUNCTION:
1877 * This function is called by limProcessSmeMessages() to send
1878 * eWNI_SME_REMOVEKEY_RSP message to host
1879 *
1880 *PARAMS:
1881 *
1882 *LOGIC:
1883 *
1884 *ASSUMPTIONS:
1885 * NA
1886 *
1887 *NOTE:
1888 *
1889 * @param pMac Pointer to Global MAC structure
1890 * @param peerMacAddr Indicates the peer MAC addr to which
1891 * Removekey was performed
1892 * @param aid Indicates the aid corresponding to the peer MAC
1893 * address
1894 * @param resultCode Indicates the result of previously issued
1895 * eWNI_SME_REMOVEKEY_RSP message
1896 *
1897 * @return None
1898 */
1899void
1900limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac,
1901 tSirMacAddr peerMacAddr,
1902 tSirResultCodes resultCode,
1903 tpPESession psessionEntry,tANI_U8 smesessionId,
1904 tANI_U16 smetransactionId)
1905{
1906 tANI_U8 *pBuf;
1907 tSirMsgQ mmhMsg;
1908 tSirSmeRemoveKeyRsp *pSirSmeRemoveKeyRsp;
1909
1910 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeRemoveKeyRsp, sizeof(tSirSmeRemoveKeyRsp)))
1911 {
1912 // Log error
1913 limLog(pMac, LOGP,
1914 FL("call to palAllocateMemory failed for SmeRemoveKeyRsp\n"));
1915
1916 return;
1917 }
1918
1919#if defined (ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
1920 sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->messageType,
1921 eWNI_SME_REMOVEKEY_RSP);
1922 sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->length,
1923 sizeof(tSirSmeRemoveKeyRsp));
1924
1925#endif
1926
1927
1928 if(psessionEntry != NULL)
1929 {
1930 pBuf = pSirSmeRemoveKeyRsp->peerMacAddr;
1931 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
1932 pBuf += sizeof(tSirMacAddr);
1933 limCopyU32(pBuf, resultCode);
1934 }
1935
1936 pSirSmeRemoveKeyRsp->messageType = eWNI_SME_REMOVEKEY_RSP;
1937 pSirSmeRemoveKeyRsp->length = sizeof(tSirSmeRemoveKeyRsp);
1938 pSirSmeRemoveKeyRsp->statusCode = resultCode;
1939
1940 /* Update SME session and transaction Id*/
1941 pSirSmeRemoveKeyRsp->sessionId = smesessionId;
1942 pSirSmeRemoveKeyRsp->transactionId = smetransactionId;
1943
1944 mmhMsg.type = eWNI_SME_REMOVEKEY_RSP;
1945 mmhMsg.bodyptr = pSirSmeRemoveKeyRsp;
1946 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07001947 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001948 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1949} /*** end limSendSmeSetContextRsp() ***/
1950
1951
1952/**
1953 * limSendSmePromiscuousModeRsp()
1954 *
1955 *FUNCTION:
1956 * This function is called by limProcessSmeMessages() to send
1957 * eWNI_PROMISCUOUS_MODE_RSP message to host
1958 *
1959 *PARAMS:
1960 *
1961 *LOGIC:
1962 *
1963 *ASSUMPTIONS:
1964 * NA
1965 *
1966 *NOTE:
1967 * This function is used for sending eWNI_SME_PROMISCUOUS_MODE_RSP to
1968 * host as a reply to eWNI_SME_PROMISCUOUS_MODE_REQ directive from it.
1969 *
1970 * @param None
1971 * @return None
1972 */
1973void
1974limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac)
1975{
1976#if 0
1977 tSirMsgQ mmhMsg;
1978 tSirMbMsg *pMbMsg;
1979
1980 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMbMsg, sizeof(tSirMbMsg)))
1981 {
1982 // Log error
1983 limLog(pMac, LOGP, FL("call to palAllocateMemory failed\n"));
1984
1985 return;
1986 }
1987
1988 pMbMsg->type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1989 pMbMsg->msgLen = 4;
1990
1991 mmhMsg.type = eWNI_SME_PROMISCUOUS_MODE_RSP;
1992 mmhMsg.bodyptr = pMbMsg;
1993 mmhMsg.bodyval = 0;
1994 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
1995 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1996#endif
1997} /*** end limSendSmePromiscuousModeRsp() ***/
1998
1999
2000
2001/**
2002 * limSendSmeNeighborBssInd()
2003 *
2004 *FUNCTION:
2005 * This function is called by limLookupNaddHashEntry() to send
2006 * eWNI_SME_NEIGHBOR_BSS_IND message to host
2007 *
2008 *PARAMS:
2009 *
2010 *LOGIC:
2011 *
2012 *ASSUMPTIONS:
2013 * NA
2014 *
2015 *NOTE:
2016 * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to
2017 * host upon detecting new BSS during background scanning if CFG
2018 * option is enabled for sending such indication
2019 *
2020 * @param pMac - Pointer to Global MAC structure
2021 * @return None
2022 */
2023
2024void
2025limSendSmeNeighborBssInd(tpAniSirGlobal pMac,
2026 tLimScanResultNode *pBssDescr)
2027{
2028 tSirMsgQ msgQ;
2029 tANI_U32 val;
2030 tSirSmeNeighborBssInd *pNewBssInd;
2031
2032 if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) ||
2033 ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) &&
2034 pMac->lim.gLimRspReqd))
2035 {
2036 // LIM is not in background scan state OR
2037 // current scan is initiated by HDD.
2038 // No need to send new BSS indication to HDD
2039 return;
2040 }
2041
2042 if (wlan_cfgGetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != eSIR_SUCCESS)
2043 {
2044 limLog(pMac, LOGP, FL("could not get NEIGHBOR_BSS_IND from CFG\n"));
2045
2046 return;
2047 }
2048
2049 if (val == 0)
2050 return;
2051
2052 /**
2053 * Need to indicate new BSSs found during
2054 * background scanning to host.
2055 * Allocate buffer for sending indication.
2056 * Length of buffer is length of BSS description
2057 * and length of header itself
2058 */
2059 val = pBssDescr->bssDescription.length + sizeof(tANI_U16) + sizeof(tANI_U32) + sizeof(tANI_U8);
2060 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pNewBssInd, val))
2061 {
2062 // Log error
2063 limLog(pMac, LOGP,
2064 FL("call to palAllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND\n"));
2065
2066 return;
2067 }
2068
2069#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
2070 sirStoreU16N((tANI_U8*) &pNewBssInd->messageType,
2071 eWNI_SME_NEIGHBOR_BSS_IND);
2072 sirStoreU16N((tANI_U8*)&pNewBssInd->length, (tANI_U16)val );
2073#else
2074 pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND;
2075 pNewBssInd->length = (tANI_U16) val;
2076#endif
2077 pNewBssInd->sessionId = 0;
2078
2079#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
2080 palCopyMemory( pMac->hHdd, (tANI_U8 *) pNewBssInd->bssDescription,
2081 (tANI_U8 *) &pBssDescr->bssDescription,
2082 pBssDescr->bssDescription.length + sizeof(tANI_U16));
2083#endif
2084
2085 msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND;
2086 msgQ.bodyptr = pNewBssInd;
2087 msgQ.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002088 MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002089 limSysProcessMmhMsgApi(pMac, &msgQ, ePROT);
2090} /*** end limSendSmeNeighborBssInd() ***/
2091
2092/** -----------------------------------------------------------------
2093 \brief limSendSmeAddtsRsp() - sends SME ADDTS RSP
2094 \ This function sends a eWNI_SME_ADDTS_RSP to SME.
2095 \ SME only looks at rc and tspec field.
2096 \param pMac - global mac structure
2097 \param rspReqd - is SmeAddTsRsp required
2098 \param status - status code of SME_ADD_TS_RSP
2099 \return tspec
2100 \sa
2101 ----------------------------------------------------------------- */
2102void
2103limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESession psessionEntry,
2104 tSirMacTspecIE tspec, tANI_U8 smesessionId, tANI_U16 smetransactionId)
2105{
2106 tpSirAddtsRsp rsp;
2107 tSirMsgQ mmhMsg;
2108
2109 if (! rspReqd)
2110 return;
2111
2112 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirAddtsRsp)))
2113 {
2114 limLog(pMac, LOGP, FL("palAllocateMemory failed for ADDTS_RSP"));
2115 return;
2116 }
2117
2118 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2119 rsp->messageType = eWNI_SME_ADDTS_RSP;
2120 rsp->rc = status;
2121 rsp->rsp.status = (enum eSirMacStatusCodes) status;
2122 //palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp.tspec, (tANI_U8 *) &addts->tspec, sizeof(addts->tspec));
2123 rsp->rsp.tspec = tspec;
2124
2125 /* Update SME session Id and transcation Id */
2126 rsp->sessionId = smesessionId;
2127 rsp->transactionId = smetransactionId;
2128
2129 mmhMsg.type = eWNI_SME_ADDTS_RSP;
2130 mmhMsg.bodyptr = rsp;
2131 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002132 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002133#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2134 limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0);
2135#endif //FEATURE_WLAN_DIAG_SUPPORT
2136
2137 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2138 return;
2139}
2140
2141void
2142limSendSmeAddtsInd(tpAniSirGlobal pMac, tpSirAddtsReqInfo addts)
2143{
2144 tpSirAddtsRsp rsp;
2145 tSirMsgQ mmhMsg;
2146
2147 limLog(pMac, LOGW, "SendSmeAddtsInd (token %d, tsid %d, up %d)\n",
2148 addts->dialogToken,
2149 addts->tspec.tsinfo.traffic.tsid,
2150 addts->tspec.tsinfo.traffic.userPrio);
2151
2152 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirAddtsRsp)))
2153 {
2154 // Log error
2155 limLog(pMac, LOGP, FL("palAllocateMemory failed for ADDTS_IND\n"));
2156 return;
2157 }
2158 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2159
2160 rsp->messageType = eWNI_SME_ADDTS_IND;
2161
2162 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) addts, sizeof(*addts));
2163
2164 mmhMsg.type = eWNI_SME_ADDTS_IND;
2165 mmhMsg.bodyptr = rsp;
2166 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002167 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002168 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2169}
2170
2171void
2172limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId)
2173{
2174 tpSirDeltsRsp rsp;
2175 tSirMsgQ mmhMsg;
2176
2177 limLog(pMac, LOGW, "SendSmeDeltsRsp (aid %d, tsid %d, up %d) status %d\n",
2178 delts->aid,
2179 delts->req.tsinfo.traffic.tsid,
2180 delts->req.tsinfo.traffic.userPrio,
2181 status);
2182 if (! delts->rspReqd)
2183 return;
2184
2185 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirDeltsRsp)))
2186 {
2187 // Log error
2188 limLog(pMac, LOGP, FL("palAllocateMemory failed for DELTS_RSP\n"));
2189 return;
2190 }
2191 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2192
2193 if(psessionEntry != NULL)
2194 {
2195
2196 rsp->aid = delts->aid;
2197 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->macAddr[0], (tANI_U8 *) &delts->macAddr[0], 6);
2198 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) &delts->req, sizeof(tSirDeltsReqInfo));
2199 }
2200
2201
2202 rsp->messageType = eWNI_SME_DELTS_RSP;
2203 rsp->rc = status;
2204
2205 /* Update SME session Id and transcation Id */
2206 rsp->sessionId = smesessionId;
2207 rsp->transactionId = smetransactionId;
2208
2209 mmhMsg.type = eWNI_SME_DELTS_RSP;
2210 mmhMsg.bodyptr = rsp;
2211 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002212 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002213#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2214 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0);
2215#endif //FEATURE_WLAN_DIAG_SUPPORT
2216
2217 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2218}
2219
2220void
2221limSendSmeDeltsInd(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, tANI_U16 aid,tpPESession psessionEntry)
2222{
2223 tpSirDeltsRsp rsp;
2224 tSirMsgQ mmhMsg;
2225
2226 limLog(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)\n",
2227 aid,
2228 delts->tsinfo.traffic.tsid,
2229 delts->tsinfo.traffic.userPrio);
2230
2231 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&rsp, sizeof(tSirDeltsRsp)))
2232 {
2233 // Log error
2234 limLog(pMac, LOGP, FL("palAllocateMemory failed for DELTS_IND\n"));
2235 return;
2236 }
2237 palZeroMemory( pMac->hHdd, (tANI_U8 *) rsp, sizeof(*rsp));
2238
2239 rsp->messageType = eWNI_SME_DELTS_IND;
2240 rsp->rc = eSIR_SUCCESS;
2241 rsp->aid = aid;
2242 palCopyMemory( pMac->hHdd, (tANI_U8 *) &rsp->rsp, (tANI_U8 *) delts, sizeof(*delts));
2243
2244 /* Update SME session Id and SME transaction Id */
2245
2246 rsp->sessionId = psessionEntry->smeSessionId;
2247 rsp->transactionId = psessionEntry->transactionId;
2248
2249 mmhMsg.type = eWNI_SME_DELTS_IND;
2250 mmhMsg.bodyptr = rsp;
2251 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002252 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002253#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2254 limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, 0);
2255#endif //FEATURE_WLAN_DIAG_SUPPORT
2256
2257 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2258}
2259
2260/**
2261 * limSendSmeStatsRsp()
2262 *
2263 *FUNCTION:
2264 * This function is called to send 802.11 statistics response to HDD.
2265 * This function posts the result back to HDD. This is a response to
2266 * HDD's request for statistics.
2267 *
2268 *PARAMS:
2269 *
2270 *LOGIC:
2271 *
2272 *ASSUMPTIONS:
2273 * NA
2274 *
2275 *NOTE:
2276 * NA
2277 *
2278 * @param pMac Pointer to Global MAC structure
2279 * @param p80211Stats Statistics sent in response
2280 * @param resultCode TODO:
2281 *
2282 *
2283 * @return none
2284 */
2285
2286void
2287limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2288{
2289 tSirMsgQ mmhMsg;
2290 tSirSmeRsp *pMsgHdr = (tSirSmeRsp*) stats;
2291
2292 switch(msgType)
2293 {
2294 case WDA_STA_STAT_RSP:
2295 mmhMsg.type = eWNI_SME_STA_STAT_RSP;
2296 break;
2297 case WDA_AGGR_STAT_RSP:
2298 mmhMsg.type = eWNI_SME_AGGR_STAT_RSP;
2299 break;
2300 case WDA_GLOBAL_STAT_RSP:
2301 mmhMsg.type = eWNI_SME_GLOBAL_STAT_RSP;
2302 break;
2303 case WDA_STAT_SUMM_RSP:
2304 mmhMsg.type = eWNI_SME_STAT_SUMM_RSP;
2305 break;
2306 default:
2307 mmhMsg.type = msgType; //Response from within PE
2308 break;
2309 }
2310
2311 pMsgHdr->messageType = mmhMsg.type;
2312
2313 mmhMsg.bodyptr = stats;
2314 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002315 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002316 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2317
2318 return;
2319
2320} /*** end limSendSmeStatsRsp() ***/
2321
2322/**
2323 * limSendSmePEStatisticsRsp()
2324 *
2325 *FUNCTION:
2326 * This function is called to send 802.11 statistics response to HDD.
2327 * This function posts the result back to HDD. This is a response to
2328 * HDD's request for statistics.
2329 *
2330 *PARAMS:
2331 *
2332 *LOGIC:
2333 *
2334 *ASSUMPTIONS:
2335 * NA
2336 *
2337 *NOTE:
2338 * NA
2339 *
2340 * @param pMac Pointer to Global MAC structure
2341 * @param p80211Stats Statistics sent in response
2342 * @param resultCode TODO:
2343 *
2344 *
2345 * @return none
2346 */
2347
2348void
2349limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats)
2350{
2351 tSirMsgQ mmhMsg;
2352 tANI_U8 sessionId;
2353 tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats;
2354 tpPESession pPeSessionEntry;
2355
2356 //Get the Session Id based on Sta Id
2357 pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId);
2358
2359 //Fill the Session Id
2360 if(NULL != pPeSessionEntry)
2361 {
2362 //Fill the Session Id
2363 pPeStats->sessionId = pPeSessionEntry->smeSessionId;
2364 }
2365
2366 pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP;
2367
2368
2369 //msgType should be WDA_GET_STATISTICS_RSP
2370 mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP;
2371
2372 mmhMsg.bodyptr = stats;
2373 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002374 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002375 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2376
2377 return;
2378
2379} /*** end limSendSmePEStatisticsRsp() ***/
2380
2381
2382void
2383limSendSmeIBSSPeerInd(
2384 tpAniSirGlobal pMac,
2385 tSirMacAddr peerMacAddr,
2386 tANI_U16 staIndex,
2387 tANI_U8 ucastIdx,
2388 tANI_U8 bcastIdx,
2389 tANI_U8 *beacon,
2390 tANI_U16 beaconLen,
2391 tANI_U16 msgType,
2392 tANI_U8 sessionId)
2393{
2394 tSirMsgQ mmhMsg;
2395 tSmeIbssPeerInd *pNewPeerInd;
2396
Jeff Johnson43971f52012-07-17 12:26:56 -07002397 if(eHAL_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07002398 palAllocateMemory(pMac->hHdd,(void * *) &pNewPeerInd,(sizeof(tSmeIbssPeerInd) + beaconLen)))
2399 {
2400 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2401 return;
2402 }
2403
2404 palZeroMemory(pMac->hHdd, (void *) pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen));
2405
2406 palCopyMemory( pMac->hHdd, (tANI_U8 *) pNewPeerInd->peerAddr,
2407 peerMacAddr, sizeof(tSirMacAddr));
2408 pNewPeerInd->staId= staIndex;
2409 pNewPeerInd->ucastSig = ucastIdx;
2410 pNewPeerInd->bcastSig = bcastIdx;
2411 pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen;
2412 pNewPeerInd->mesgType = msgType;
2413 pNewPeerInd->sessionId = sessionId;
2414
2415 if ( beacon != NULL )
2416 {
2417 palCopyMemory(pMac->hHdd, (void*) ((tANI_U8*)pNewPeerInd+sizeof(tSmeIbssPeerInd)), (void*)beacon, beaconLen);
2418 }
2419
2420 mmhMsg.type = msgType;
2421// mmhMsg.bodyval = (tANI_U32) pNewPeerInd;
2422 mmhMsg.bodyptr = pNewPeerInd;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002423 MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002424 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2425
2426}
2427
2428
2429/** -----------------------------------------------------------------
2430 \brief limSendExitBmpsInd() - sends exit bmps indication
2431
2432 This function sends a eWNI_PMC_EXIT_BMPS_IND with a specific reason
2433 code to SME. This will trigger SME to get out of BMPS mode.
2434
2435 \param pMac - global mac structure
2436 \param reasonCode - reason for which PE wish to exit BMPS
2437 \return none
2438 \sa
2439 ----------------------------------------------------------------- */
2440void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode)
2441{
2442 tSirMsgQ mmhMsg;
2443 tANI_U16 msgLen = 0;
2444 tpSirSmeExitBmpsInd pExitBmpsInd;
2445
2446 msgLen = sizeof(tSirSmeExitBmpsInd);
2447 if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pExitBmpsInd, msgLen ))
2448 {
2449 limLog(pMac, LOGP, FL("palAllocateMemory failed for PMC_EXIT_BMPS_IND \n"));
2450 return;
2451 }
2452 palZeroMemory(pMac->hHdd, pExitBmpsInd, msgLen);
2453
2454#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
2455 sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgType, eWNI_PMC_EXIT_BMPS_IND);
2456 sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgLen, msgLen);
2457#else
2458 pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND;
2459 pExitBmpsInd->mesgLen = msgLen;
2460#endif
2461 pExitBmpsInd->exitBmpsReason = reasonCode;
2462 pExitBmpsInd->statusCode = eSIR_SME_SUCCESS;
2463
2464 mmhMsg.type = eWNI_PMC_EXIT_BMPS_IND;
2465 mmhMsg.bodyptr = pExitBmpsInd;
2466 mmhMsg.bodyval = 0;
2467
2468 PELOG1(limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. \n"));)
Jeff Johnsone7245742012-09-05 17:12:55 -07002469 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002470#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
2471 limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode);
2472#endif //FEATURE_WLAN_DIAG_SUPPORT
2473
2474 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2475 return;
2476
2477} /*** end limSendExitBmpsInd() ***/
2478
2479
2480
2481
2482/*--------------------------------------------------------------------------
2483 \brief peDeleteSession() - Handle the Delete BSS Response from HAL.
2484
2485
2486 \param pMac - pointer to global adapter context
2487 \param sessionId - Message pointer.
2488
2489 \sa
2490 --------------------------------------------------------------------------*/
2491
2492void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ)
2493{
2494 tpPESession psessionEntry;
2495 tpDeleteBssParams pDelBss = (tpDeleteBssParams)(MsgQ->bodyptr);
2496 if((psessionEntry = peFindSessionBySessionId(pMac,pDelBss->sessionId))==NULL)
2497 {
2498 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
2499 return;
2500 }
2501 if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)
2502 {
2503 limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry);
2504 }
2505 else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE)
2506 {
2507 limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry);
2508 }
2509
2510 else
2511 limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry);
2512
2513}
2514
2515#ifdef WLAN_FEATURE_VOWIFI_11R
2516/** -----------------------------------------------------------------
2517 \brief limSendSmeAggrQosRsp() - sends SME FT AGGR QOS RSP
2518 \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME.
2519 \ SME only looks at rc and tspec field.
2520 \param pMac - global mac structure
2521 \param rspReqd - is SmeAddTsRsp required
2522 \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP
2523 \return tspec
2524 \sa
2525 ----------------------------------------------------------------- */
2526void
2527limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp,
2528 tANI_U8 smesessionId)
2529{
2530 tSirMsgQ mmhMsg;
2531
2532 mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP;
2533 mmhMsg.bodyptr = aggrQosRsp;
2534 mmhMsg.bodyval = 0;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002535 MTRACE(macTraceMsgTx(pMac, smesessionId , mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002536 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2537
2538 return;
2539}
2540#endif
2541
2542/** -----------------------------------------------------------------
2543 \brief limSendSmePreChannelSwitchInd() - sends an indication to SME
2544 before switching channels for spectrum manangement.
2545
2546 This function sends a eWNI_SME_PRE_SWITCH_CHL_IND to SME.
2547
2548 \param pMac - global mac structure
2549 \return none
2550 \sa
2551 ----------------------------------------------------------------- */
2552void
2553limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac)
2554{
2555 tSirMsgQ mmhMsg;
2556
2557 mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND;
2558 mmhMsg.bodyptr = NULL;
2559 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002560 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002561 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2562
2563 return;
2564}
2565
2566/** -----------------------------------------------------------------
2567 \brief limSendSmePostChannelSwitchInd() - sends an indication to SME
2568 after channel switch for spectrum manangement is complete.
2569
2570 This function sends a eWNI_SME_POST_SWITCH_CHL_IND to SME.
2571
2572 \param pMac - global mac structure
2573 \return none
2574 \sa
2575 ----------------------------------------------------------------- */
2576void
2577limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac)
2578{
2579 tSirMsgQ mmhMsg;
2580
2581 mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND;
2582 mmhMsg.bodyptr = NULL;
2583 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002584 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002585 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2586
2587 return;
2588}
2589
2590void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
2591 tANI_U8 smesessionId)
2592{
2593 tSirMsgQ mmhMsg;
2594 tSmeMaxAssocInd *pSmeMaxAssocInd;
2595
Jeff Johnson43971f52012-07-17 12:26:56 -07002596 if(eHAL_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07002597 palAllocateMemory(pMac->hHdd,(void **)&pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd)))
2598 {
2599 PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
2600 return;
2601 }
2602 palZeroMemory(pMac->hHdd, (void *) pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd));
2603 palCopyMemory( pMac->hHdd, (tANI_U8 *)pSmeMaxAssocInd->peerMac,
2604 (tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr));
2605 pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED;
2606 pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd);
2607 pSmeMaxAssocInd->sessionId = smesessionId;
2608 mmhMsg.type = pSmeMaxAssocInd->mesgType;
2609 mmhMsg.bodyptr = pSmeMaxAssocInd;
2610 PELOG1(limLog(pMac, LOG1, FL("msgType %s peerMacAddr %02x-%02x-%02x-%02x-%02x-%02x"
2611 "sme session id %d\n"),"eWNI_SME_MAX_ASSOC_EXCEEDED", peerMacAddr[0], peerMacAddr[1],
2612 peerMacAddr[2], peerMacAddr[3], peerMacAddr[4], peerMacAddr[5], smesessionId);)
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -08002613 MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002614 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2615
2616 return;
2617}