blob: ab9f3f0ce710e235938f54d21881cb1b2bcbcb3f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080028/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 *
Jeff Johnson295189b2012-06-20 16:38:30 -070030 * This file schApi.cc contains functions related to the API exposed
31 * by scheduler module
32 *
33 * Author: Sandesh Goel
34 * Date: 02/25/02
35 * History:-
36 * Date Modified by Modification Information
37 * --------------------------------------------------------------------
38 *
39 */
40#include "palTypes.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070041#include "aniGlobal.h"
Jeff Johnson62c27982013-02-27 17:53:55 -080042#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070043
44#include "sirMacProtDef.h"
45#include "sirMacPropExts.h"
46#include "sirCommon.h"
47
Jeff Johnson295189b2012-06-20 16:38:30 -070048
49#include "cfgApi.h"
50#include "pmmApi.h"
51
52#include "limApi.h"
53
54#include "schApi.h"
55#include "schDebug.h"
56
57#include "schSysParams.h"
58#include "limTrace.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070059#include "limTypes.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070060
61#include "wlan_qct_wda.h"
62
63//--------------------------------------------------------------------
64//
65// Static Variables
66//
67//-------------------------------------------------------------------
68static tANI_U8 gSchProbeRspTemplate[SCH_MAX_PROBE_RESP_SIZE];
69static tANI_U8 gSchBeaconFrameBegin[SCH_MAX_BEACON_SIZE];
70static tANI_U8 gSchBeaconFrameEnd[SCH_MAX_BEACON_SIZE];
71
72// --------------------------------------------------------------------
73/**
74 * schGetCFPCount
75 *
76 * FUNCTION:
77 * Function used by other Sirius modules to read CFPcount
78 *
79 * LOGIC:
80 *
81 * ASSUMPTIONS:
82 *
83 * NOTE:
84 *
85 * @param None
86 * @return None
87 */
88
89tANI_U8
90schGetCFPCount(tpAniSirGlobal pMac)
91{
92 return pMac->sch.schObject.gSchCFPCount;
93}
94
95// --------------------------------------------------------------------
96/**
97 * schGetCFPDurRemaining
98 *
99 * FUNCTION:
100 * Function used by other Sirius modules to read CFPDuration remaining
101 *
102 * LOGIC:
103 *
104 * ASSUMPTIONS:
105 *
106 * NOTE:
107 *
108 * @param None
109 * @return None
110 */
111
112tANI_U16
113schGetCFPDurRemaining(tpAniSirGlobal pMac)
114{
115 return pMac->sch.schObject.gSchCFPDurRemaining;
116}
117
118
119// --------------------------------------------------------------------
120/**
121 * schInitialize
122 *
123 * FUNCTION:
124 * Initialize
125 *
126 * LOGIC:
127 *
128 * ASSUMPTIONS:
129 *
130 * NOTE:
131 *
132 * @param None
133 * @return None
134 */
135
136void
137schInitialize(tpAniSirGlobal pMac)
138{
139 pmmInitialize(pMac);
140}
141
142// --------------------------------------------------------------------
143/**
144 * schInitGlobals
145 *
146 * FUNCTION:
147 * Initialize globals
148 *
149 * LOGIC:
150 *
151 * ASSUMPTIONS:
152 *
153 * NOTE:
154 *
155 * @param None
156 * @return None
157 */
158
159void
160schInitGlobals(tpAniSirGlobal pMac)
161{
162 pMac->sch.gSchHcfEnabled = false;
163
164 pMac->sch.gSchScanRequested = false;
165 pMac->sch.gSchScanReqRcvd = false;
166
167 pMac->sch.gSchGenBeacon = 1;
168 pMac->sch.gSchBeaconsSent = 0;
169 pMac->sch.gSchBeaconsWritten = 0;
170 pMac->sch.gSchBcnParseErrorCnt = 0;
171 pMac->sch.gSchBcnIgnored = 0;
172 pMac->sch.gSchBBXportRcvCnt = 0;
173 pMac->sch.gSchUnknownRcvCnt = 0;
174 pMac->sch.gSchBcnRcvCnt = 0;
175 pMac->sch.gSchRRRcvCnt = 0;
176 pMac->sch.qosNullCnt = 0;
177 pMac->sch.numData = 0;
178 pMac->sch.numPoll = 0;
179 pMac->sch.numCorrupt = 0;
180 pMac->sch.numBogusInt = 0;
181 pMac->sch.numTxAct0 = 0;
182 pMac->sch.rrTimeout = SCH_RR_TIMEOUT;
183 pMac->sch.pollPeriod = SCH_POLL_PERIOD;
184 pMac->sch.keepAlive = 0;
185 pMac->sch.multipleSched = 1;
186 pMac->sch.maxPollTimeouts = 20;
187 pMac->sch.checkCfbFlagStuck = 0;
188
189 pMac->sch.schObject.gSchProbeRspTemplate = gSchProbeRspTemplate;
190 pMac->sch.schObject.gSchBeaconFrameBegin = gSchBeaconFrameBegin;
191 pMac->sch.schObject.gSchBeaconFrameEnd = gSchBeaconFrameEnd;
192
193}
194
195// --------------------------------------------------------------------
196/**
197 * schPostMessage
198 *
199 * FUNCTION:
200 * Post the beacon message to the scheduler message queue
201 *
202 * LOGIC:
203 *
204 * ASSUMPTIONS:
205 *
206 * NOTE:
207 *
208 * @param pMsg pointer to message
209 * @return None
210 */
211
212tSirRetStatus
213schPostMessage(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
214{
Jeff Johnson295189b2012-06-20 16:38:30 -0700215 schProcessMessage(pMac, pMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700216
217 return eSIR_SUCCESS;
218}
219
220
221
222
223
224// ---------------------------------------------------------------------------
225/**
226 * schSendStartScanRsp
227 *
228 * FUNCTION:
229 *
230 * LOGIC:
231 *
232 * ASSUMPTIONS:
233 *
234 * NOTE:
235 *
236 * @param None
237 * @return None
238 */
239
240void
241schSendStartScanRsp(tpAniSirGlobal pMac)
242{
243 tSirMsgQ msgQ;
244 tANI_U32 retCode;
245
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530246 schLog(pMac, LOG1, FL("Sending SIR_SCH_START_SCAN_RSP to LIM"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700247 msgQ.type = SIR_SCH_START_SCAN_RSP;
248 if ((retCode = limPostMsgApi(pMac, &msgQ)) != eSIR_SUCCESS)
249 schLog(pMac, LOGE,
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700250 FL("Posting START_SCAN_RSP to LIM failed, reason=%X"), retCode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700251}
252
253/**
254 * schSendBeaconReq
255 *
256 * FUNCTION:
257 *
258 * LOGIC:
259 * 1) SCH received SIR_SCH_BEACON_GEN_IND
260 * 2) SCH updates TIM IE and other beacon related IE's
261 * 3) SCH sends WDA_SEND_BEACON_REQ to HAL. HAL then copies the beacon
262 * template to memory
263 *
264 * ASSUMPTIONS:
265 * Memory allocation is reqd to send this message and SCH allocates memory.
266 * The assumption is that HAL will "free" this memory.
267 *
268 * NOTE:
269 *
270 * @param pMac global
271 *
272 * @param beaconPayload
273 *
274 * @param size - Length of the beacon
275 *
276 * @return eHalStatus
277 */
278tSirRetStatus schSendBeaconReq( tpAniSirGlobal pMac, tANI_U8 *beaconPayload, tANI_U16 size, tpPESession psessionEntry)
279{
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530280 tSirMsgQ msgQ;
281 tpSendbeaconParams beaconParams = NULL;
282 tSirRetStatus retCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700283
284 schLog( pMac, LOG2,
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530285 FL( "Indicating HAL to copy the beacon template [%d bytes] to memory" ),
286 size );
Jeff Johnson295189b2012-06-20 16:38:30 -0700287
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530288 beaconParams = vos_mem_malloc(sizeof(tSendbeaconParams));
289 if ( NULL == beaconParams )
290 return eSIR_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -0700291
292 msgQ.type = WDA_SEND_BEACON_REQ;
293
294 // No Dialog Token reqd, as a response is not solicited
295 msgQ.reserved = 0;
296
297 // Fill in tSendbeaconParams members
298 /* Knock off all pMac global addresses */
299 // limGetBssid( pMac, beaconParams->bssId);
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530300 vos_mem_copy(beaconParams->bssId, psessionEntry->bssId, sizeof(psessionEntry->bssId));
Jeff Johnson295189b2012-06-20 16:38:30 -0700301
Jeff Johnson295189b2012-06-20 16:38:30 -0700302 beaconParams->timIeOffset = pMac->sch.schObject.gSchBeaconOffsetBegin;
Gopichand Nakkala81aef732013-03-22 11:15:19 +0530303 /* p2pIeOffset should be atleast greater than timIeOffset */
304 if ((pMac->sch.schObject.p2pIeOffset != 0) &&
305 (pMac->sch.schObject.p2pIeOffset <
306 pMac->sch.schObject.gSchBeaconOffsetBegin))
307 {
308 schLog(pMac, LOGE,FL("Invalid p2pIeOffset:[%d]"),
309 pMac->sch.schObject.p2pIeOffset);
310 VOS_ASSERT( 0 );
311 return eSIR_FAILURE;
312 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700313 beaconParams->p2pIeOffset = pMac->sch.schObject.p2pIeOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700314#ifdef WLAN_SOFTAP_FW_BEACON_TX_PRNT_LOG
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700315 schLog(pMac, LOGE,FL("TimIeOffset:[%d]"),beaconParams->TimIeOffset );
Jeff Johnson295189b2012-06-20 16:38:30 -0700316#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700317
318 beaconParams->beacon = beaconPayload;
319 beaconParams->beaconLength = (tANI_U32) size;
320 msgQ.bodyptr = beaconParams;
321 msgQ.bodyval = 0;
322
323 // Keep a copy of recent beacon frame sent
324
325 // free previous copy of the beacon
326 if (psessionEntry->beacon )
327 {
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530328 vos_mem_free(psessionEntry->beacon);
Jeff Johnson295189b2012-06-20 16:38:30 -0700329 }
330
331 psessionEntry->bcnLen = 0;
332 psessionEntry->beacon = NULL;
333
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530334 psessionEntry->beacon = vos_mem_malloc(size);
335 if ( psessionEntry->beacon != NULL )
Jeff Johnson295189b2012-06-20 16:38:30 -0700336 {
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530337 vos_mem_copy(psessionEntry->beacon, beaconPayload, size);
Jeff Johnson295189b2012-06-20 16:38:30 -0700338 psessionEntry->bcnLen = size;
339 }
340
Jeff Johnsone7245742012-09-05 17:12:55 -0700341 MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ )))
343 {
344 schLog( pMac, LOGE,
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700345 FL("Posting SEND_BEACON_REQ to HAL failed, reason=%X"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700346 retCode );
347 } else
348 {
349 schLog( pMac, LOG2,
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700350 FL("Successfully posted WDA_SEND_BEACON_REQ to HAL"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700351
Jeff Johnson295189b2012-06-20 16:38:30 -0700352 if( (psessionEntry->limSystemRole == eLIM_AP_ROLE )
Sachin Ahuja825082e2014-11-25 17:34:36 +0530353 && (pMac->sch.schObject.fBeaconChanged)
354 && ((psessionEntry->proxyProbeRspEn)
355 || (IS_FEATURE_SUPPORTED_BY_FW(WPS_PRBRSP_TMPL)))
356 )
357
Jeff Johnson295189b2012-06-20 16:38:30 -0700358 {
Sachin Ahuja825082e2014-11-25 17:34:36 +0530359 schLog(pMac, LOG1, FL("Sending probeRsp Template to HAL"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700360 if(eSIR_SUCCESS != (retCode = limSendProbeRspTemplateToHal(pMac,psessionEntry,
361 &psessionEntry->DefProbeRspIeBitmap[0])))
362 {
363 /* check whether we have to free any memory */
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700364 schLog(pMac, LOGE, FL("FAILED to send probe response template with retCode %d"), retCode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700365 }
366 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700367 }
368
369 return retCode;
370}
371
Jeff Johnson295189b2012-06-20 16:38:30 -0700372tANI_U32 limSendProbeRspTemplateToHal(tpAniSirGlobal pMac,tpPESession psessionEntry
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530373 ,tANI_U32* IeBitmap)
Jeff Johnson295189b2012-06-20 16:38:30 -0700374{
375 tSirMsgQ msgQ;
376 tANI_U8 *pFrame2Hal = pMac->sch.schObject.gSchProbeRspTemplate;
377 tpSendProbeRespParams pprobeRespParams=NULL;
378 tANI_U32 retCode = eSIR_FAILURE;
379 tANI_U32 nPayload,nBytes,nStatus;
380 tpSirMacMgmtHdr pMacHdr;
381 tANI_U32 addnIEPresent;
382 tANI_U32 addnIELen=0;
383 tSirRetStatus nSirStatus;
Gopichand Nakkala77071442013-03-25 15:04:35 +0530384 tANI_U8 *addIE = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -0700385
386 nStatus = dot11fGetPackedProbeResponseSize( pMac, &psessionEntry->probeRespFrame, &nPayload );
387 if ( DOT11F_FAILED( nStatus ) )
388 {
389 schLog( pMac, LOGE, FL("Failed to calculate the packed size f"
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700390 "or a Probe Response (0x%08x)."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700391 nStatus );
392 // We'll fall back on the worst case scenario:
393 nPayload = sizeof( tDot11fProbeResponse );
394 }
395 else if ( DOT11F_WARNED( nStatus ) )
396 {
397 schLog( pMac, LOGE, FL("There were warnings while calculating"
398 "the packed size for a Probe Response "
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700399 "(0x%08x)."), nStatus );
Jeff Johnson295189b2012-06-20 16:38:30 -0700400 }
401
402 nBytes = nPayload + sizeof( tSirMacMgmtHdr );
Gopichand Nakkala77071442013-03-25 15:04:35 +0530403
404 //Check if probe response IE is present or not
405 if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_ADDNIE_FLAG, &addnIEPresent) != eSIR_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700406 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530407 schLog(pMac, LOGE, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_FLAG"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700408 return retCode;
409 }
410
Gopichand Nakkala77071442013-03-25 15:04:35 +0530411 if (addnIEPresent)
Jeff Johnson295189b2012-06-20 16:38:30 -0700412 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530413 //Probe rsp IE available
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530414 addIE = vos_mem_malloc(WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN);
415 if ( NULL == addIE )
Jeff Johnson295189b2012-06-20 16:38:30 -0700416 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530417 schLog(pMac, LOGE,
418 FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length"));
419 return retCode;
420 }
421
422 if (wlan_cfgGetStrLen(pMac, WNI_CFG_PROBE_RSP_ADDNIE_DATA1,
423 &addnIELen) != eSIR_SUCCESS)
424 {
425 schLog(pMac, LOGE,
426 FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length"));
427
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530428 vos_mem_free(addIE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700429 return retCode;
430 }
Gopichand Nakkala77071442013-03-25 15:04:35 +0530431
432 if (addnIELen <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIELen &&
433 (nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700434 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530435 if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac,
436 WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addIE[0],
437 &addnIELen) )
Jeff Johnson295189b2012-06-20 16:38:30 -0700438 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530439 schLog(pMac, LOGE,
440 FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 String"));
441
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530442 vos_mem_free(addIE);
Gopichand Nakkala77071442013-03-25 15:04:35 +0530443 return retCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700444 }
445 }
446 }
Gopichand Nakkala77071442013-03-25 15:04:35 +0530447
448 if (addnIEPresent)
Jeff Johnson295189b2012-06-20 16:38:30 -0700449 {
Gopichand Nakkala77071442013-03-25 15:04:35 +0530450 if ((nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE )
451 nBytes += addnIELen;
452 else
453 addnIEPresent = false; //Dont include the IE.
Jeff Johnson295189b2012-06-20 16:38:30 -0700454 }
455
Jeff Johnson295189b2012-06-20 16:38:30 -0700456 // Paranoia:
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530457 vos_mem_set(pFrame2Hal, nBytes, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700458
459 // Next, we fill out the buffer descriptor:
460 nSirStatus = limPopulateMacHeader( pMac, pFrame2Hal, SIR_MAC_MGMT_FRAME,
461 SIR_MAC_MGMT_PROBE_RSP, psessionEntry->selfMacAddr,psessionEntry->selfMacAddr);
462
463 if ( eSIR_SUCCESS != nSirStatus )
464 {
465 schLog( pMac, LOGE, FL("Failed to populate the buffer descrip"
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700466 "tor for a Probe Response (%d)."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700467 nSirStatus );
Gopichand Nakkala77071442013-03-25 15:04:35 +0530468
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530469 vos_mem_free(addIE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700470 return retCode;
471 }
472
473 pMacHdr = ( tpSirMacMgmtHdr ) pFrame2Hal;
Gopichand Nakkala77071442013-03-25 15:04:35 +0530474
Jeff Johnson295189b2012-06-20 16:38:30 -0700475 sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId);
Gopichand Nakkala77071442013-03-25 15:04:35 +0530476
Jeff Johnson295189b2012-06-20 16:38:30 -0700477 // That done, pack the Probe Response:
478 nStatus = dot11fPackProbeResponse( pMac, &psessionEntry->probeRespFrame, pFrame2Hal + sizeof(tSirMacMgmtHdr),
479 nPayload, &nPayload );
480
481 if ( DOT11F_FAILED( nStatus ) )
482 {
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700483 schLog( pMac, LOGE, FL("Failed to pack a Probe Response (0x%08x)."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700484 nStatus );
Gopichand Nakkala77071442013-03-25 15:04:35 +0530485
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530486 vos_mem_free(addIE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700487 return retCode; // allocated!
488 }
489 else if ( DOT11F_WARNED( nStatus ) )
490 {
491 schLog( pMac, LOGE, FL("There were warnings while packing a P"
Jeff Johnsonf9416e02013-11-03 11:00:39 -0800492 "robe Response (0x%08x)."), nStatus );
Jeff Johnson295189b2012-06-20 16:38:30 -0700493 }
494
Gopichand Nakkala77071442013-03-25 15:04:35 +0530495 if (addnIEPresent)
496 {
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530497 vos_mem_copy ( &pFrame2Hal[nBytes - addnIELen],
498 &addIE[0], addnIELen);
Gopichand Nakkala77071442013-03-25 15:04:35 +0530499 }
500
501 /* free the allocated Memory */
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530502 vos_mem_free(addIE);
Gopichand Nakkala77071442013-03-25 15:04:35 +0530503
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530504 pprobeRespParams = vos_mem_malloc(sizeof( tSendProbeRespParams ));
505 if ( NULL == pprobeRespParams )
Jeff Johnson295189b2012-06-20 16:38:30 -0700506 {
Kiran Kumar Lokereaf882c82013-03-18 16:07:05 -0700507 schLog( pMac, LOGE, FL("limSendProbeRspTemplateToHal: HAL probe response params malloc failed for bytes %d"), nBytes );
Jeff Johnson295189b2012-06-20 16:38:30 -0700508 }
509 else
510 {
511 /*
512 PELOGE(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOGE,
513 pFrame2Hal,
514 nBytes);)
515 */
516
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530517 sirCopyMacAddr( pprobeRespParams->bssId, psessionEntry->bssId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700518 pprobeRespParams->pProbeRespTemplate = pFrame2Hal;
519 pprobeRespParams->probeRespTemplateLen = nBytes;
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530520 vos_mem_copy(pprobeRespParams->ucProxyProbeReqValidIEBmap,IeBitmap,(sizeof(tANI_U32) * 8));
Gopichand Nakkala77071442013-03-25 15:04:35 +0530521 msgQ.type = WDA_UPDATE_PROBE_RSP_TEMPLATE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -0700522 msgQ.reserved = 0;
523 msgQ.bodyptr = pprobeRespParams;
524 msgQ.bodyval = 0;
525
526 if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ )))
527 {
528 /* free the allocated Memory */
Madan Mohan Koyyalamudifff03f22013-07-11 11:32:07 +0530529 schLog( pMac,LOGE, FL("limSendProbeRspTemplateToHal: FAIL bytes %d retcode[%X]"), nBytes, retCode );
530 vos_mem_free(pprobeRespParams);
Jeff Johnson295189b2012-06-20 16:38:30 -0700531 }
532 else
533 {
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -0700534 schLog( pMac,LOG1, FL("limSendProbeRspTemplateToHal: Probe response template msg posted to HAL of bytes %d"),nBytes );
Jeff Johnson295189b2012-06-20 16:38:30 -0700535 }
536 }
537
538 return retCode;
539}
Jeff Johnson295189b2012-06-20 16:38:30 -0700540