1 /*
2 * CmdBldCfg.c
3 *
4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name Texas Instruments nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34
35 /** \file CmdBldCfg.c
36 * \brief Command builder. Configuration commands
37 *
38 * \see CmdBld.h
39 */
40 #define __FILE_ID__ FILE_ID_91
41 #include "osApi.h"
42 #include "tidef.h"
43 #include "report.h"
44 #include "CmdBld.h"
45 #include "CmdBldCfgIE.h"
46 #include "TWDriverInternal.h"
47
48
49 /****************************************************************************
50 * cmdBld_CfgRx()
51 ****************************************************************************
52 * DESCRIPTION: Sets the filters according to the given configuration.
53 *
54 * INPUTS: RxConfigOption - The given Rx filters configuration
55 * RxFilterOption - The given Rx filters options
56 *
57 * OUTPUT: None
58 *
59 * RETURNS: TI_OK or TI_NOK
60 ****************************************************************************/
cmdBld_CfgRx(TI_HANDLE hCmdBld,TI_UINT32 uRxConfigOption,TI_UINT32 uRxFilterOption,void * fCb,TI_HANDLE hCb)61 TI_STATUS cmdBld_CfgRx (TI_HANDLE hCmdBld, TI_UINT32 uRxConfigOption, TI_UINT32 uRxFilterOption, void *fCb, TI_HANDLE hCb)
62 {
63 DB_WLAN(hCmdBld).RxConfigOption = uRxConfigOption;
64 DB_WLAN(hCmdBld).RxFilterOption = uRxFilterOption;
65 DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_ENABLE_PHY_HEADER_PLCP;
66 #if defined (TNETW_MASTER_MODE) || defined (TNETW_USB_MODE)
67 DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_COPY_RX_STATUS;
68 #endif
69
70 if (DB_WLAN(hCmdBld).RxDisableBroadcast)
71 {
72 DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_DISABLE_BCAST;
73 }
74
75 return cmdBld_CfgIeRx (hCmdBld,
76 DB_WLAN(hCmdBld).RxConfigOption,
77 DB_WLAN(hCmdBld).RxFilterOption,
78 fCb,
79 hCb);
80 }
81
82
83 /****************************************************************************
84 * cmdBld_CfgArpIpAddrTable()
85 ****************************************************************************
86 * DESCRIPTION: Sets the ARP IP table according to the given configuration.
87 *
88 * OUTPUT: None
89 *
90 * RETURNS: TI_OK or TI_NOK
91 ****************************************************************************/
cmdBld_CfgArpIpAddrTable(TI_HANDLE hCmdBld,TIpAddr tIpAddr,TI_UINT8 bEnabled,EIpVer eIpVer,void * fCb,TI_HANDLE hCb)92 TI_STATUS cmdBld_CfgArpIpAddrTable (TI_HANDLE hCmdBld, TIpAddr tIpAddr, TI_UINT8 bEnabled, EIpVer eIpVer, void *fCb, TI_HANDLE hCb)
93 {
94 DB_WLAN(hCmdBld).arp_IP_ver = eIpVer;
95
96 /* no support for IPV6 */
97 if (eIpVer == IP_VER_4)
98 {
99 IP_COPY (DB_WLAN(hCmdBld).arp_IP_addr, tIpAddr);
100 }
101
102 DB_WLAN(hCmdBld).arpFilterType = (EArpFilterType)bEnabled;
103
104 /* Set the new ip with the current state (e/d) */
105 return cmdBld_CfgIeArpIpFilter (hCmdBld, tIpAddr, (EArpFilterType)bEnabled, fCb, hCb);
106 }
107
108 /****************************************************************************
109 * cmdBld_CfgArpIpFilter()
110 ****************************************************************************
111 * DESCRIPTION: Enable\Disable the ARP filter
112 *
113 * OUTPUT: None
114 *
115 * RETURNS: TI_OK or TI_NOK
116 ****************************************************************************/
cmdBld_CfgArpIpFilter(TI_HANDLE hCmdBld,TIpAddr tIpAddr,void * fCb,TI_HANDLE hCb)117 TI_STATUS cmdBld_CfgArpIpFilter (TI_HANDLE hCmdBld, TIpAddr tIpAddr, void *fCb, TI_HANDLE hCb)
118 {
119 /* no support for IPV6 */
120 IP_COPY (DB_WLAN(hCmdBld).arp_IP_addr, tIpAddr);
121
122 return cmdBld_CfgIeArpIpFilter (hCmdBld,
123 tIpAddr,
124 DB_WLAN(hCmdBld).arpFilterType,
125 fCb,
126 hCb);
127 }
128 /****************************************************************************
129 * cmdBld_CfgGroupAddressTable()
130 ****************************************************************************
131 * DESCRIPTION: Sets the Group table according to the given configuration.
132 *
133 * OUTPUT: None
134 *
135 * RETURNS: TI_OK or TI_NOK
136 ****************************************************************************/
cmdBld_CfgGroupAddressTable(TI_HANDLE hCmdBld,TI_UINT8 uNumGroupAddr,TMacAddr * pGroupAddr,TI_BOOL bEnabled,void * fCb,TI_HANDLE hCb)137 TI_STATUS cmdBld_CfgGroupAddressTable (TI_HANDLE hCmdBld,
138 TI_UINT8 uNumGroupAddr,
139 TMacAddr *pGroupAddr,
140 TI_BOOL bEnabled,
141 void *fCb,
142 TI_HANDLE hCb)
143 {
144 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
145 TI_UINT32 i;
146
147 if (uNumGroupAddr > MAX_MULTICAST_GROUP_ADDRS)
148 {
149 TRACE1(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgGroupAddressTable: numGroupAddrs=%d\n", uNumGroupAddr);
150 return PARAM_VALUE_NOT_VALID;
151 }
152
153 if (NULL == pGroupAddr)
154 {
155 TRACE2(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgGroupAddressTable: numGroupAddrs=%d Group_addr=0x%x !!!\n", uNumGroupAddr, pGroupAddr);
156 return PARAM_VALUE_NOT_VALID;
157 }
158
159 /* Keeps the parameters in the db */
160 DB_WLAN(hCmdBld).numGroupAddrs = uNumGroupAddr;
161 DB_WLAN(hCmdBld).isMacAddrFilteringnabled = bEnabled;
162
163 for (i = 0; i < uNumGroupAddr; i++)
164 {
165 MAC_COPY (DB_WLAN(hCmdBld).aGroupAddr[i], *(pGroupAddr + i));
166 }
167
168 return cmdBld_CfgIeGroupAdressTable (hCmdBld, uNumGroupAddr, pGroupAddr, bEnabled, fCb, hCb);
169 }
170
171
172 /****************************************************************************
173 * cmdBld_CfgRtsThreshold()
174 ****************************************************************************
175 * DESCRIPTION: Sets the Rts Threshold.
176 *
177 * OUTPUT: None
178 *
179 * RETURNS: TI_OK or TI_NOK pWlanParams->RtsThreshold
180 ****************************************************************************/
cmdBld_CfgRtsThreshold(TI_HANDLE hCmdBld,TI_UINT16 threshold,void * fCb,TI_HANDLE hCb)181 TI_STATUS cmdBld_CfgRtsThreshold (TI_HANDLE hCmdBld, TI_UINT16 threshold, void *fCb, TI_HANDLE hCb)
182 {
183 return cmdBld_CfgIeRtsThreshold (hCmdBld, threshold, fCb, hCb);
184 }
185
186 /****************************************************************************
187 * cmdBld_CfgDcoItrimParams()
188 ****************************************************************************
189 * DESCRIPTION: Sets the DCO Itrim parameters.
190 *
191 * OUTPUT: None
192 *
193 * RETURNS: TI_OK or TI_NOK
194 ****************************************************************************/
cmdBld_CfgDcoItrimParams(TI_HANDLE hCmdBld,TI_BOOL enable,TI_UINT32 moderationTimeoutUsec,void * fCb,TI_HANDLE hCb)195 TI_STATUS cmdBld_CfgDcoItrimParams (TI_HANDLE hCmdBld, TI_BOOL enable, TI_UINT32 moderationTimeoutUsec, void *fCb, TI_HANDLE hCb)
196 {
197 /* Keeps the parameters in the db */
198 DB_WLAN(hCmdBld).dcoItrimEnabled = enable;
199 DB_WLAN(hCmdBld).dcoItrimModerationTimeoutUsec = moderationTimeoutUsec;
200
201 return cmdBld_CfgIeDcoItrimParams (hCmdBld, enable, moderationTimeoutUsec, fCb, hCb);
202 }
203
204 /****************************************************************************
205 * cmdBld_CfgFragmentThreshold()
206 ****************************************************************************
207 * DESCRIPTION: Sets the tx fragmentation Threshold.
208 *
209 * OUTPUT: None
210 *
211 * RETURNS: TI_OK or TI_NOK
212 ****************************************************************************/
cmdBld_CfgFragmentThreshold(TI_HANDLE hCmdBld,TI_UINT16 uFragmentThreshold,void * fCb,TI_HANDLE hCb)213 TI_STATUS cmdBld_CfgFragmentThreshold (TI_HANDLE hCmdBld, TI_UINT16 uFragmentThreshold, void *fCb, TI_HANDLE hCb)
214 {
215 DB_WLAN(hCmdBld).FragmentThreshold = uFragmentThreshold;
216
217 return cmdBld_CfgIeFragmentThreshold (hCmdBld, uFragmentThreshold, fCb, hCb);
218 }
219
220
221 /****************************************************************************
222 * cmdBld_CfgPreamble()
223 ****************************************************************************
224 * DESCRIPTION: Set the preamble in ?????? hardware register
225 *
226 * INPUTS:
227 * preambleVal
228 *
229 * OUTPUT: None
230 *
231 * RETURNS: None
232 ****************************************************************************/
cmdBld_CfgPreamble(TI_HANDLE hCmdBld,Preamble_e ePreamble,void * fCb,TI_HANDLE hCb)233 TI_STATUS cmdBld_CfgPreamble (TI_HANDLE hCmdBld, Preamble_e ePreamble, void *fCb, TI_HANDLE hCb)
234 {
235 DB_WLAN(hCmdBld).preamble = ePreamble;
236
237 return cmdBld_CfgIePreamble (hCmdBld, (TI_UINT8)ePreamble, fCb, hCb);
238 }
239
240
241 /****************************************************************************
242 * cmdBld_CfgBcnBrcOptions()
243 ****************************************************************************
244 * DESCRIPTION: Configure the wlan hardware
245 *
246 * INPUTS: None
247 *
248 * OUTPUT: None
249 *
250 * RETURNS: TI_OK or TI_NOK
251 ****************************************************************************/
cmdBld_CfgBcnBrcOptions(TI_HANDLE hCmdBld,TPowerMgmtConfig * pPMConfig,void * fCb,TI_HANDLE hCb)252 TI_STATUS cmdBld_CfgBcnBrcOptions (TI_HANDLE hCmdBld, TPowerMgmtConfig *pPMConfig, void *fCb, TI_HANDLE hCb)
253 {
254 return cmdBld_CfgIeBcnBrcOptions (hCmdBld, pPMConfig, fCb, hCb);
255 }
256
257
258 /****************************************************************************
259 * cmdBld_CfgWakeUpCondition()
260 ****************************************************************************
261 * DESCRIPTION: Configure the wlan hardware
262 *
263 * INPUTS: None
264 *
265 * OUTPUT: None
266 *
267 * RETURNS: TI_OK or TI_NOK
268 ****************************************************************************/
cmdBld_CfgWakeUpCondition(TI_HANDLE hCmdBld,TPowerMgmtConfig * pPMConfig,void * fCb,TI_HANDLE hCb)269 TI_STATUS cmdBld_CfgWakeUpCondition (TI_HANDLE hCmdBld, TPowerMgmtConfig *pPMConfig, void *fCb, TI_HANDLE hCb)
270 {
271 return cmdBld_CfgIeWakeUpCondition (hCmdBld, pPMConfig, fCb, hCb);
272 }
273
274
275 /****************************************************************************
276 * cmdBld_CfgSleepAuth ()
277 ****************************************************************************
278 * DESCRIPTION: Set the min power level
279 *
280 * INPUTS:
281 *
282 * OUTPUT:
283 *
284 * RETURNS: TI_OK or TI_NOK
285 ****************************************************************************/
cmdBld_CfgSleepAuth(TI_HANDLE hCmdBld,EPowerPolicy eMinPowerLevel,void * fCb,TI_HANDLE hCb)286 TI_STATUS cmdBld_CfgSleepAuth (TI_HANDLE hCmdBld, EPowerPolicy eMinPowerLevel, void *fCb, TI_HANDLE hCb)
287 {
288 /* Save th parameter in database */
289 DB_WLAN(hCmdBld).minPowerLevel = eMinPowerLevel;
290
291 return cmdBld_CfgIeSleepAuth (hCmdBld, eMinPowerLevel, fCb, hCb);
292 }
293
294
295 typedef enum { HW_CLOCK_40_MHZ = 40, HW_CLOCK_80_MHZ = 80 } EHwClock;
296
297
298 /****************************************************************************
299 * cmdBld_CfgArmClock()
300 ****************************************************************************
301 * DESCRIPTION: Configure the arm clock
302 * !!! Note that the firmware will set the slot time according to the new clock
303 *
304 * INPUTS: None
305 *
306 * OUTPUT: None
307 *
308 * RETURNS: TI_OK or TI_NOK
309 ****************************************************************************/
cmdBld_CfgArmClock(TI_HANDLE hCmdBld,TI_UINT32 uArmClock,void * fCb,TI_HANDLE hCb)310 TI_STATUS cmdBld_CfgArmClock (TI_HANDLE hCmdBld, TI_UINT32 uArmClock, void *fCb, TI_HANDLE hCb)
311 {
312 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
313 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
314
315 pWlanParams->ArmClock = uArmClock;
316
317 /* Illegal combination Mac=80, Arm=40 ==> force setting 40/40*/
318 if (pWlanParams->MacClock == HW_CLOCK_80_MHZ && pWlanParams->ArmClock == HW_CLOCK_40_MHZ)
319 {
320 TRACE0(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_ArmClockSet: Illegal combination Mac=80, Arm=40 ==> force setting 40/40\n");
321 pWlanParams->MacClock = HW_CLOCK_40_MHZ;
322 }
323
324 return cmdBld_CfgIeFeatureConfig (hCmdBld,
325 pWlanParams->FeatureOptions,
326 pWlanParams->FeatureDataFlowOptions,
327 fCb,
328 hCb);
329 }
330
331
332 /****************************************************************************
333 * cmdBld_CfgMacClock()
334 ****************************************************************************
335 * DESCRIPTION: Configure the mac clock
336 * !!! Note that the firmware will set the slot time according to the new clock
337 *
338 * INPUTS: None
339 *
340 * OUTPUT: None
341 *
342 * RETURNS: TI_OK or TI_NOK
343 ****************************************************************************/
cmdBld_CfgMacClock(TI_HANDLE hCmdBld,TI_UINT32 uMacClock,void * fCb,TI_HANDLE hCb)344 TI_STATUS cmdBld_CfgMacClock (TI_HANDLE hCmdBld, TI_UINT32 uMacClock, void *fCb, TI_HANDLE hCb)
345 {
346 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
347 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
348
349 pWlanParams->MacClock = uMacClock;
350
351 /* Force same clock - for printing */
352 pWlanParams->ArmClock = uMacClock;
353
354 /* Illegal combination Mac=80, Arm=40 ==> force setting 40/40*/
355 if (pWlanParams->MacClock == HW_CLOCK_80_MHZ && pWlanParams->ArmClock == HW_CLOCK_40_MHZ)
356 {
357 TRACE0(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_MacClockSet: Illegal combination Mac=80, Arm=40 ==> force setting 40/40\n");
358 pWlanParams->MacClock = HW_CLOCK_40_MHZ;
359 }
360
361 return cmdBld_CfgIeFeatureConfig (hCmdBld,
362 pWlanParams->FeatureOptions,
363 pWlanParams->FeatureDataFlowOptions,
364 fCb,
365 hCb);
366 }
367
368
369 /****************************************************************************
370 * cmdBld_CfgAid()
371 ****************************************************************************
372 * DESCRIPTION: Set the AID
373 *
374 * INPUTS:
375 *
376 * OUTPUT:
377 *
378 * RETURNS: TI_OK or TI_NOK
379 ****************************************************************************/
cmdBld_CfgAid(TI_HANDLE hCmdBld,TI_UINT16 uAidVal,void * fCb,TI_HANDLE hCb)380 TI_STATUS cmdBld_CfgAid (TI_HANDLE hCmdBld, TI_UINT16 uAidVal, void *fCb, TI_HANDLE hCb)
381 {
382 return cmdBld_CfgIeAid (hCmdBld, uAidVal, fCb, hCb);
383 }
384
cmdBld_CfgClkRun(TI_HANDLE hCmdBld,TI_BOOL aClkRunEnable,void * fCb,TI_HANDLE hCb)385 TI_STATUS cmdBld_CfgClkRun (TI_HANDLE hCmdBld, TI_BOOL aClkRunEnable, void *fCb, TI_HANDLE hCb)
386 {
387 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
388
389 if (aClkRunEnable)
390 {
391 pWlanParams->FeatureDataFlowOptions |= FEAT_PCI_CLK_RUN_ENABLE;
392 }
393 else
394 {
395 pWlanParams->FeatureDataFlowOptions &= ~FEAT_PCI_CLK_RUN_ENABLE;
396 }
397
398 return cmdBld_CfgIeFeatureConfig (hCmdBld,
399 pWlanParams->FeatureOptions,
400 pWlanParams->FeatureDataFlowOptions,
401 fCb,
402 hCb);
403 }
404
405
cmdBld_CfgRxMsduFormat(TI_HANDLE hCmdBld,TI_BOOL bRxMsduForamtEnable,void * fCb,TI_HANDLE hCb)406 TI_STATUS cmdBld_CfgRxMsduFormat (TI_HANDLE hCmdBld, TI_BOOL bRxMsduForamtEnable, void *fCb, TI_HANDLE hCb)
407 {
408 #if 1
409 /* WARNING: Have to check how to control the Rx Frame format select (which bit)
410 and then access the HW*/
411 return TI_OK;
412 #else
413 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
414 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
415
416 if (aRxMsduForamtEnable)
417 {
418 pWlanParams->FeatureDataFlowOptions |= DATA_FLOW_RX_MSDU_FRAME;
419 }
420 else
421 {
422 pWlanParams->FeatureDataFlowOptions &= ~DATA_FLOW_RX_MSDU_FRAME;
423 }
424
425 return cmdBld_CfgIeFeatureConfig (hCmdBld,
426 pWlanParams->FeatureOptions,
427 pWlanParams->FeatureDataFlowOptions,
428 fCb,
429 hCb);
430 #endif
431 }
432
433
434 /****************************************************************************
435 * cmdBld_CfgTid()
436 ****************************************************************************
437 * DESCRIPTION: configure Queue traffic params
438 *
439 * INPUTS: None
440 *
441 * OUTPUT: None
442 *
443 * RETURNS: TI_OK or TI_NOK
444 ****************************************************************************/
cmdBld_CfgTid(TI_HANDLE hCmdBld,TQueueTrafficParams * pQtrafficParams,void * fCb,TI_HANDLE hCb)445 TI_STATUS cmdBld_CfgTid (TI_HANDLE hCmdBld, TQueueTrafficParams *pQtrafficParams, void *fCb, TI_HANDLE hCb)
446 {
447 DB_QUEUES(hCmdBld).isQueueConfigured[pQtrafficParams->queueID] = TI_TRUE;
448 DB_QUEUES(hCmdBld).queues[pQtrafficParams->queueID] = *pQtrafficParams;
449
450 return cmdBld_CfgIeTid (hCmdBld, pQtrafficParams, fCb, hCb);
451 }
452
453
454 /****************************************************************************
455 * cmdBld_CfgAcParams()
456 ****************************************************************************
457 * DESCRIPTION: configure AC params
458 *
459 * INPUTS: None
460 *
461 * OUTPUT: None
462 *
463 * RETURNS: TI_OK or TI_NOK
464 ****************************************************************************/
cmdBld_CfgAcParams(TI_HANDLE hCmdBld,TAcQosParams * pAcQosParams,void * fCb,TI_HANDLE hCb)465 TI_STATUS cmdBld_CfgAcParams (TI_HANDLE hCmdBld, TAcQosParams *pAcQosParams, void *fCb, TI_HANDLE hCb)
466 {
467 DB_AC(hCmdBld).isAcConfigured[pAcQosParams->ac] = TI_TRUE;
468 DB_AC(hCmdBld).ac[pAcQosParams->ac] = *pAcQosParams;
469
470 return cmdBld_CfgIeAcParams (hCmdBld, pAcQosParams, fCb, hCb);
471 }
472
473
474 /****************************************************************************
475 * cmdBld_CfgPsRxStreaming()
476 ****************************************************************************
477 * DESCRIPTION: configure PS-Rx-Streaming params
478 *
479 * INPUTS: None
480 *
481 * OUTPUT: None
482 *
483 * RETURNS: TI_OK or TI_NOK
484 ****************************************************************************/
cmdBld_CfgPsRxStreaming(TI_HANDLE hCmdBld,TPsRxStreaming * pPsRxStreaming,void * fCb,TI_HANDLE hCb)485 TI_STATUS cmdBld_CfgPsRxStreaming (TI_HANDLE hCmdBld, TPsRxStreaming *pPsRxStreaming, void *fCb, TI_HANDLE hCb)
486 {
487 DB_PS_STREAM(hCmdBld).tid[pPsRxStreaming->uTid] = *pPsRxStreaming;
488
489 return cmdBld_CfgIePsRxStreaming (hCmdBld, pPsRxStreaming, fCb, hCb);
490 }
491
492
493 /****************************************************************************
494 * cmdBld_CfgPacketDetectionThreshold
495 ****************************************************************************
496 * DESCRIPTION: Sets Packet Detection Threshold
497 *
498 * INPUTS: None
499 *
500 * OUTPUT: None
501 *
502 * RETURNS: TI_OK or TI_NOK
503 ****************************************************************************/
cmdBld_CfgPacketDetectionThreshold(TI_HANDLE hCmdBld,TI_UINT32 threshold,void * fCb,TI_HANDLE hCb)504 TI_STATUS cmdBld_CfgPacketDetectionThreshold (TI_HANDLE hCmdBld, TI_UINT32 threshold, void *fCb, TI_HANDLE hCb)
505 {
506 DB_WLAN(hCmdBld).PacketDetectionThreshold = threshold;
507
508 return cmdBld_CfgIePacketDetectionThreshold (hCmdBld, threshold, fCb, hCb);
509 }
510
511
512 /****************************************************************************
513 * cmdBld_CfgBeaconFilterOpt
514 ****************************************************************************
515 * DESCRIPTION: Sets Beacon filtering state
516 *
517 * INPUTS: None
518 *
519 * OUTPUT: None
520 *
521 * RETURNS: TI_OK or TI_NOK
522 ****************************************************************************/
cmdBld_CfgBeaconFilterOpt(TI_HANDLE hCmdBld,TI_UINT8 uBeaconFilteringStatus,TI_UINT8 uNumOfBeaconsToBuffer,void * fCb,TI_HANDLE hCb)523 TI_STATUS cmdBld_CfgBeaconFilterOpt (TI_HANDLE hCmdBld,
524 TI_UINT8 uBeaconFilteringStatus,
525 TI_UINT8 uNumOfBeaconsToBuffer,
526 void *fCb,
527 TI_HANDLE hCb)
528 {
529 DB_WLAN(hCmdBld).beaconFilterParams.desiredState = uBeaconFilteringStatus;
530 DB_WLAN(hCmdBld).beaconFilterParams.numOfElements = uNumOfBeaconsToBuffer;
531
532 return cmdBld_CfgIeBeaconFilterOpt (hCmdBld,
533 uBeaconFilteringStatus,
534 uNumOfBeaconsToBuffer,
535 fCb,
536 hCb);
537 }
538
539 /****************************************************************************
540 * cmdBld_CfgRateMngDbg
541 ****************************************************************************
542 * DESCRIPTION: Sets rate managment params
543 *
544 * INPUTS: None
545 *
546 * OUTPUT: None
547 *
548 * RETURNS: TI_OK or TI_NOK
549 ****************************************************************************/
550
cmdBld_CfgRateMngDbg(TI_HANDLE hCmdBld,RateMangeParams_t * pRateMngParams,void * fCb,TI_HANDLE hCb)551 TI_STATUS cmdBld_CfgRateMngDbg (TI_HANDLE hCmdBld,
552 RateMangeParams_t *pRateMngParams ,
553 void *fCb,
554 TI_HANDLE hCb)
555 {
556
557 TRateMngParams *pRateMngParamsDB = &DB_RM(hCmdBld);
558 int uIndex;
559
560 pRateMngParamsDB->rateMngParams.paramIndex = pRateMngParams->paramIndex;
561
562 switch (pRateMngParams->paramIndex)
563 {
564 case RATE_MGMT_RETRY_SCORE_PARAM:
565 pRateMngParamsDB->rateMngParams.RateRetryScore = pRateMngParams->RateRetryScore;
566 break;
567 case RATE_MGMT_PER_ADD_PARAM:
568 pRateMngParamsDB->rateMngParams.PerAdd = pRateMngParams->PerAdd;
569 break;
570 case RATE_MGMT_PER_TH1_PARAM:
571 pRateMngParamsDB->rateMngParams.PerTh1 = pRateMngParams->PerTh1;
572 break;
573 case RATE_MGMT_PER_TH2_PARAM:
574 pRateMngParamsDB->rateMngParams.PerTh2 = pRateMngParams->PerTh2;
575 break;
576 case RATE_MGMT_MAX_PER_PARAM:
577 pRateMngParamsDB->rateMngParams.MaxPer = pRateMngParams->MaxPer;
578 break;
579 case RATE_MGMT_INVERSE_CURIOSITY_FACTOR_PARAM:
580 pRateMngParamsDB->rateMngParams.InverseCuriosityFactor = pRateMngParams->InverseCuriosityFactor;
581 break;
582 case RATE_MGMT_TX_FAIL_LOW_TH_PARAM:
583 pRateMngParamsDB->rateMngParams.TxFailLowTh = pRateMngParams->TxFailLowTh;
584 break;
585 case RATE_MGMT_TX_FAIL_HIGH_TH_PARAM:
586 pRateMngParamsDB->rateMngParams.TxFailHighTh = pRateMngParams->TxFailHighTh;
587 break;
588 case RATE_MGMT_PER_ALPHA_SHIFT_PARAM:
589 pRateMngParamsDB->rateMngParams.PerAlphaShift = pRateMngParams->PerAlphaShift;
590 break;
591 case RATE_MGMT_PER_ADD_SHIFT_PARAM:
592 pRateMngParamsDB->rateMngParams.PerAddShift = pRateMngParams->PerAddShift;
593 break;
594 case RATE_MGMT_PER_BETA1_SHIFT_PARAM:
595 pRateMngParamsDB->rateMngParams.PerBeta1Shift = pRateMngParams->PerBeta1Shift;
596 break;
597 case RATE_MGMT_PER_BETA2_SHIFT_PARAM:
598 pRateMngParamsDB->rateMngParams.PerBeta2Shift = pRateMngParams->PerBeta2Shift;
599 break;
600 case RATE_MGMT_RATE_CHECK_UP_PARAM:
601 pRateMngParamsDB->rateMngParams.RateCheckUp = pRateMngParams->RateCheckUp;
602 break;
603 case RATE_MGMT_RATE_CHECK_DOWN_PARAM:
604 pRateMngParamsDB->rateMngParams.RateCheckDown = pRateMngParams->RateCheckDown;
605 break;
606 case RATE_MGMT_RATE_RETRY_POLICY_PARAM:
607 for (uIndex = 0; uIndex < 13; uIndex++)
608 {
609 pRateMngParamsDB->rateMngParams.RateRetryPolicy[uIndex] = pRateMngParams->RateRetryPolicy[uIndex];
610 }
611 break;
612 }
613
614
615 return cmdBld_CfgIeRateMngDbg (hCmdBld,
616 pRateMngParams,
617 fCb,
618 hCb);
619
620 }
621
622
623 /****************************************************************************
624 * cmdBld_CfgBeaconFilterTable
625 ****************************************************************************
626 * DESCRIPTION: Sets Beacon filtering state
627 *
628 * INPUTS: None
629 *
630 * OUTPUT: None
631 *
632 * RETURNS: TI_OK or TI_NOK
633 ****************************************************************************/
cmdBld_CfgBeaconFilterTable(TI_HANDLE hCmdBld,TI_UINT8 uNumberOfIEs,TI_UINT8 * pIETable,TI_UINT8 uIETableSize,void * fCb,TI_HANDLE hCb)634 TI_STATUS cmdBld_CfgBeaconFilterTable (TI_HANDLE hCmdBld,
635 TI_UINT8 uNumberOfIEs,
636 TI_UINT8 *pIETable,
637 TI_UINT8 uIETableSize,
638 void *fCb,
639 TI_HANDLE hCb)
640 {
641 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
642
643 if (uIETableSize > BEACON_FILTER_TABLE_MAX_SIZE)
644 {
645 TRACE2(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgBeaconFilterTable: Table size is too big %d (>%d)\n", uIETableSize, BEACON_FILTER_TABLE_MAX_SIZE);
646
647 return PARAM_VALUE_NOT_VALID;
648 }
649
650 os_memoryZero (pCmdBld->hOs,
651 (void *)DB_WLAN(hCmdBld).beaconFilterIETable.IETable,
652 BEACON_FILTER_TABLE_MAX_SIZE);
653 os_memoryCopy (pCmdBld->hOs,
654 (void *)DB_WLAN(hCmdBld).beaconFilterIETable.IETable,
655 (void *)pIETable,
656 uIETableSize);
657 DB_WLAN(hCmdBld).beaconFilterIETable.numberOfIEs = uNumberOfIEs;
658 DB_WLAN(hCmdBld).beaconFilterIETable.IETableSize = uIETableSize;
659
660 return cmdBld_CfgIeBeaconFilterTable (hCmdBld, uNumberOfIEs, pIETable, uIETableSize, fCb, hCb);
661 }
662
663
664 /*----------------------------------------*/
665 /* Roaming Trigger Configuration Commands */
666 /*----------------------------------------*/
667
668 /****************************************************************************
669 * cmdBld_CfgRssiSnrTrigger()
670 ****************************************************************************
671 * DESCRIPTION: Set the RSSI/SNR Trigger parameters.
672 *
673 * INPUTS:
674 *
675 * OUTPUT: None
676 *
677 * RETURNS: None
678 ****************************************************************************/
cmdBld_CfgRssiSnrTrigger(TI_HANDLE hCmdBld,RssiSnrTriggerCfg_t * pTriggerParam,void * fCb,TI_HANDLE hCb)679 TI_STATUS cmdBld_CfgRssiSnrTrigger (TI_HANDLE hCmdBld, RssiSnrTriggerCfg_t *pTriggerParam, void *fCb, TI_HANDLE hCb)
680 {
681 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].index = pTriggerParam->index;
682 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].threshold = pTriggerParam->threshold;
683 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].pacing = pTriggerParam->pacing;
684 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].metric = pTriggerParam->metric;
685 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].type = pTriggerParam->type;
686 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].direction = pTriggerParam->direction;
687 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].hystersis = pTriggerParam->hystersis;
688 DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].enable = pTriggerParam->enable;
689
690 return cmdBld_CfgIeRssiSnrTrigger (hCmdBld, pTriggerParam, fCb, hCb);
691 }
692
693
694 /****************************************************************************
695 * cmdBld_CfgRssiSnrWeights()
696 ****************************************************************************
697 * DESCRIPTION: Set RSSI/SNR Weights for Average calculations.
698 *
699 * INPUTS:
700 *
701 * OUTPUT: None
702 *
703 * RETURNS: None
704 ****************************************************************************/
cmdBld_CfgRssiSnrWeights(TI_HANDLE hCmdBld,RssiSnrAverageWeights_t * pWeightsParam,void * fCb,TI_HANDLE hCb)705 TI_STATUS cmdBld_CfgRssiSnrWeights (TI_HANDLE hCmdBld, RssiSnrAverageWeights_t *pWeightsParam, void *fCb, TI_HANDLE hCb)
706 {
707 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
708
709 TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "\n cmdBld_CfgRssiSnrWeights :\n uRssiBeaconAverageWeight = %d\n uRssiPacketAverageWeight = %d\n uSnrBeaconAverageWeight = %d\n uSnrPacketAverageWeight = %d \n ", pWeightsParam->rssiBeaconAverageWeight, pWeightsParam->rssiPacketAverageWeight, pWeightsParam->snrBeaconAverageWeight , pWeightsParam->snrPacketAverageWeight );
710
711 DB_WLAN(hCmdBld).tRssiSnrWeights.rssiBeaconAverageWeight = pWeightsParam->rssiBeaconAverageWeight;
712 DB_WLAN(hCmdBld).tRssiSnrWeights.rssiPacketAverageWeight = pWeightsParam->rssiPacketAverageWeight;
713 DB_WLAN(hCmdBld).tRssiSnrWeights.snrBeaconAverageWeight = pWeightsParam->snrBeaconAverageWeight ;
714 DB_WLAN(hCmdBld).tRssiSnrWeights.snrPacketAverageWeight = pWeightsParam->snrPacketAverageWeight ;
715
716 return cmdBld_CfgIeRssiSnrWeights (hCmdBld, pWeightsParam, fCb, hCb);
717 }
718
719
720 /****************************************************************************
721 * cmdBld_CfgMaxTxRetry()
722 ****************************************************************************
723 * DESCRIPTION: Set Max Tx retry parmaters.
724 *
725 * INPUTS:
726 * maxTxRetry max Tx Retry
727 *
728 * OUTPUT: None
729 *
730 * RETURNS: None
731 ****************************************************************************/
cmdBld_CfgMaxTxRetry(TI_HANDLE hCmdBld,TRroamingTriggerParams * pRoamingTriggerCmd,void * fCb,TI_HANDLE hCb)732 TI_STATUS cmdBld_CfgMaxTxRetry (TI_HANDLE hCmdBld, TRroamingTriggerParams *pRoamingTriggerCmd, void *fCb, TI_HANDLE hCb)
733 {
734 DB_WLAN(hCmdBld).roamTriggers.maxTxRetry = pRoamingTriggerCmd->maxTxRetry;
735
736 return cmdBld_CfgIeMaxTxRetry (hCmdBld, pRoamingTriggerCmd, fCb, hCb);
737 }
738
739
740 /****************************************************************************
741 * cmdBld_CfgSgEnable()
742 ****************************************************************************
743 * DESCRIPTION: Save Soft Gemini enable parameter
744 *
745 * INPUTS:
746 *
747 * OUTPUT:
748 *
749 * RETURNS: TI_OK or TI_NOK
750 ****************************************************************************/
cmdBld_CfgSgEnable(TI_HANDLE hCmdBld,ESoftGeminiEnableModes eSgEnable,void * fCb,TI_HANDLE hCb)751 TI_STATUS cmdBld_CfgSgEnable (TI_HANDLE hCmdBld, ESoftGeminiEnableModes eSgEnable, void *fCb, TI_HANDLE hCb)
752 {
753 DB_WLAN(hCmdBld).SoftGeminiEnable = eSgEnable;
754
755 return cmdBld_CfgIeSgEnable (hCmdBld, eSgEnable, fCb, hCb);
756 }
757
758
759 /****************************************************************************
760 * cmdBld_CfgSg()
761 ****************************************************************************
762 * DESCRIPTION: Save Soft Gemini config parameter
763 *
764 * INPUTS:
765 *
766 * OUTPUT:
767 *
768 * RETURNS: TI_OK or TI_NOK
769 ****************************************************************************/
cmdBld_CfgSg(TI_HANDLE hCmdBld,TSoftGeminiParams * pSgParam,void * fCb,TI_HANDLE hCb)770 TI_STATUS cmdBld_CfgSg (TI_HANDLE hCmdBld, TSoftGeminiParams *pSgParam, void *fCb, TI_HANDLE hCb)
771 {
772 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
773
774 /* Copy params for recovery */
775 os_memoryCopy (pCmdBld->hOs,
776 (void*)&DB_WLAN(hCmdBld).SoftGeminiParams,
777 (void*)pSgParam,
778 sizeof(TSoftGeminiParams));
779
780 return cmdBld_CfgIeSg (hCmdBld, pSgParam, fCb, hCb);
781 }
782
783 /****************************************************************************
784 * cmdBld_CfgCoexActivity()
785 ****************************************************************************
786 * DESCRIPTION: Sets the CoexActivity table.
787 *
788 * OUTPUT: None
789 *
790 * RETURNS: TI_OK or TI_NOK pWlanParams->RtsThreshold
791 ****************************************************************************/
cmdBld_CfgCoexActivity(TI_HANDLE hCmdBld,TCoexActivity * pCoexActivity,void * fCb,TI_HANDLE hCb)792 TI_STATUS cmdBld_CfgCoexActivity (TI_HANDLE hCmdBld, TCoexActivity *pCoexActivity, void *fCb, TI_HANDLE hCb)
793 {
794 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
795 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
796 TCoexActivity *pSaveCoex = &pWlanParams->tWlanParamsCoexActivityTable.entry[0];
797 int numOfElements = pWlanParams->tWlanParamsCoexActivityTable.numOfElements;
798 int i;
799
800 /* Check if to overwrite existing entry or put on last index */
801 for (i=0; i<numOfElements; i++)
802 {
803 if ((pSaveCoex[i].activityId == pCoexActivity->activityId) && (pSaveCoex->coexIp == pCoexActivity->coexIp))
804 {
805 break;
806 }
807 }
808
809 TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "cmdBld_CfgCoexActivity: save Param %d in index %d, %d %d\n", 0, i, pCoexActivity->coexIp, pCoexActivity->activityId);
810 /* save in WlanParams for recovery */
811 pSaveCoex[i].coexIp = pCoexActivity->coexIp;
812 pSaveCoex[i].activityId = pCoexActivity->activityId;
813 pSaveCoex[i].defaultPriority = pCoexActivity->defaultPriority;
814 pSaveCoex[i].raisedPriority = pCoexActivity->raisedPriority;
815 pSaveCoex[i].minService = pCoexActivity->minService;
816 pSaveCoex[i].maxService = pCoexActivity->maxService;
817
818 if (i == numOfElements)
819 {
820 /* no existing entry overwrite, increment number of elements */
821 pWlanParams->tWlanParamsCoexActivityTable.numOfElements++;
822 }
823
824 return cmdBld_CfgIeCoexActivity (hCmdBld, pCoexActivity, fCb, hCb);
825 }
826
827 /****************************************************************************
828 * cmdBld_CfgFmCoex()
829 ****************************************************************************
830 * DESCRIPTION: Save and configure FM coexistence parameters
831 *
832 * INPUTS:
833 *
834 * OUTPUT:
835 *
836 * RETURNS: TI_OK or TI_NOK
837 ****************************************************************************/
cmdBld_CfgFmCoex(TI_HANDLE hCmdBld,TFmCoexParams * pFmCoexParams,void * fCb,TI_HANDLE hCb)838 TI_STATUS cmdBld_CfgFmCoex (TI_HANDLE hCmdBld, TFmCoexParams *pFmCoexParams, void *fCb, TI_HANDLE hCb)
839 {
840 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
841
842 /* Copy params for recovery */
843 os_memoryCopy (pCmdBld->hOs,
844 (void*)&(DB_WLAN(hCmdBld).tFmCoexParams),
845 (void*)pFmCoexParams,
846 sizeof(TFmCoexParams));
847
848 return cmdBld_CfgIeFmCoex (hCmdBld, pFmCoexParams, fCb, hCb);
849 }
850
851 /****************************************************************************
852 * cmdBld_CfgTxRatePolicy()
853 ****************************************************************************
854 * DESCRIPTION: configure TxRatePolicy params
855 *
856 * INPUTS: None
857 *
858 * OUTPUT: None
859 *
860 * RETURNS: TI_OK or TI_NOK
861 ****************************************************************************/
cmdBld_CfgTxRatePolicy(TI_HANDLE hCmdBld,TTxRatePolicy * pTxRatePolicy,void * fCb,TI_HANDLE hCb)862 TI_STATUS cmdBld_CfgTxRatePolicy (TI_HANDLE hCmdBld, TTxRatePolicy *pTxRatePolicy, void *fCb, TI_HANDLE hCb)
863 {
864 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
865 TTxRateClass *pTxRateClass = pTxRatePolicy->rateClass;
866 TI_UINT8 index;
867
868 TRACE1(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "_1, Num of classes = 0x%x\n", pTxRatePolicy->numOfRateClasses);
869
870 DB_BSS(hCmdBld).TxRateClassParams.numOfRateClasses = pTxRatePolicy->numOfRateClasses;
871
872 for (index = 0; index < pTxRatePolicy->numOfRateClasses; index++, pTxRateClass++)
873 {
874 TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "_2loop, Index = %d, Short R = 0x%x, Long R = 0x%x, Rates = 0x%x\n", index, pTxRateClass->shortRetryLimit, pTxRateClass->longRetryLimit, pTxRateClass->txEnabledRates);
875
876 DB_BSS(hCmdBld).TxRateClassParams.rateClass[index] = *pTxRateClass;
877 }
878
879 return cmdBld_CfgIeTxRatePolicy (hCmdBld, pTxRatePolicy, fCb, hCb);
880 }
881
882
cmdBld_CfgSlotTime(TI_HANDLE hCmdBld,ESlotTime eSlotTime,void * fCb,TI_HANDLE hCb)883 TI_STATUS cmdBld_CfgSlotTime (TI_HANDLE hCmdBld, ESlotTime eSlotTime, void *fCb, TI_HANDLE hCb)
884 {
885 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
886
887 DB_WLAN(hCmdBld).SlotTime = eSlotTime;
888
889 TRACE1(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "cmdBld_CfgSlotTime: Slot time = %d\n", eSlotTime);
890
891 /* Configure the new Slot-Time value to the FW. */
892 return cmdBld_CfgIeSlotTime (hCmdBld, (TI_UINT8)eSlotTime, fCb, hCb);
893 }
894
895
cmdBld_CfgEventMask(TI_HANDLE hCmdBld,TI_UINT32 uEventMask,void * fCb,TI_HANDLE hCb)896 TI_STATUS cmdBld_CfgEventMask (TI_HANDLE hCmdBld, TI_UINT32 uEventMask, void *fCb, TI_HANDLE hCb)
897 {
898 return cmdBld_CfgIeEventMask (hCmdBld, uEventMask, fCb, hCb);
899 }
900
901
902 /*
903 * ----------------------------------------------------------------------------
904 * Function : cmdBld_CfgHwEncEnable
905 *
906 * Input :
907 * Output :
908 * Process :
909 * Note(s) :
910 * -----------------------------------------------------------------------------
911 */
cmdBld_CfgHwEncEnable(TI_HANDLE hCmdBld,TI_BOOL bHwEncEnable,TI_BOOL bHwDecEnable,void * fCb,TI_HANDLE hCb)912 TI_STATUS cmdBld_CfgHwEncEnable (TI_HANDLE hCmdBld, TI_BOOL bHwEncEnable, TI_BOOL bHwDecEnable, void *fCb, TI_HANDLE hCb)
913 {
914 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
915 TWlanParams *pWlanParams = &DB_WLAN(hCmdBld);
916
917 /* Store the HW encryption Enable flag for reconfigure time (FW reload)*/
918 DB_KEYS(pCmdBld).bReconfHwEncEnable = bHwEncEnable;
919 DB_KEYS(pCmdBld).bHwEncDecrEnableValid = TI_TRUE;
920
921 if (bHwEncEnable)
922 {
923 pWlanParams->FeatureDataFlowOptions &= ~DF_ENCRYPTION_DISABLE;
924 }
925 else
926 {
927 pWlanParams->FeatureDataFlowOptions |= DF_ENCRYPTION_DISABLE;
928 }
929
930 /* Set bit DF_SNIFF_MODE_ENABLE to enable or prevent decryption in fw */
931 /* WARNING: Have to check how to control the decryption (which bit) and then set/reset
932 the appropriate bit*/
933 if (bHwDecEnable)
934 {
935 pWlanParams->FeatureDataFlowOptions &= ~DF_SNIFF_MODE_ENABLE;
936 }
937 else
938 {
939 pWlanParams->FeatureDataFlowOptions |= DF_SNIFF_MODE_ENABLE;
940 }
941
942 return cmdBld_CfgIeFeatureConfig (hCmdBld,
943 pWlanParams->FeatureOptions,
944 pWlanParams->FeatureDataFlowOptions,
945 fCb,
946 hCb);
947 }
948
949
cmdBld_CfgHwEncDecEnable(TI_HANDLE hCmdBld,TI_BOOL bHwEncEnable,void * fCb,TI_HANDLE hCb)950 TI_STATUS cmdBld_CfgHwEncDecEnable (TI_HANDLE hCmdBld, TI_BOOL bHwEncEnable, void *fCb, TI_HANDLE hCb)
951 {
952 return cmdBld_CfgHwEncEnable (hCmdBld, bHwEncEnable, bHwEncEnable, fCb, hCb);
953 }
954
955
956 /*
957 * ----------------------------------------------------------------------------
958 * Function : cmdBld_CfgSecureMode
959 *
960 * Input :
961 * Output :
962 * Process :
963 * Note(s) :
964 * -----------------------------------------------------------------------------
965 */
cmdBld_CfgSecureMode(TI_HANDLE hCmdBld,ECipherSuite eSecurMode,void * fCb,TI_HANDLE hCb)966 TI_STATUS cmdBld_CfgSecureMode (TI_HANDLE hCmdBld, ECipherSuite eSecurMode, void *fCb, TI_HANDLE hCb)
967 {
968 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
969 TI_UINT32 index;
970
971 if (eSecurMode < TWD_CIPHER_MAX)
972 {
973 TRACE2(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "cmdBld_CfgSecureMode: change tSecurity mode from %d --> %d\n", pCmdBld->tSecurity.eSecurityMode, eSecurMode);
974 /* check if tSecurity mode is equal to previous one*/
975 if (pCmdBld->tSecurity.eSecurityMode == eSecurMode)
976 {
977 return TI_OK;
978 }
979
980 /* Reset all reconfig valid fields*/
981 DB_KEYS(pCmdBld).bHwEncDecrEnableValid = TI_FALSE;
982 DB_KEYS(pCmdBld).bDefaultKeyIdValid = TI_FALSE;
983 for (index = 0;
984 index < pCmdBld->tSecurity.uNumOfStations * NO_OF_RECONF_SECUR_KEYS_PER_STATION + NO_OF_EXTRA_RECONF_SECUR_KEYS;
985 index++)
986 {
987 (DB_KEYS(pCmdBld).pReconfKeys + index)->keyType = KEY_NULL;
988 }
989
990 /* set the new tSecurity mode*/
991 pCmdBld->tSecurity.eSecurityMode = eSecurMode;
992
993 /* disable defrag, duplicate detection on TNETW+XCC on chip level*/
994 /* YV- to add fragmentation control (if there is- artur ?)*/
995 return cmdBld_CfgRxMsduFormat (hCmdBld,
996 pCmdBld->tSecurity.eSecurityMode != TWD_CIPHER_CKIP,
997 fCb,
998 hCb);
999 }
1000 else
1001 {
1002 return TI_NOK;
1003 }
1004 }
1005
1006
cmdBld_CfgConnMonitParams(TI_HANDLE hCmdBld,TRroamingTriggerParams * pRoamingTriggerCmd,void * fCb,TI_HANDLE hCb)1007 TI_STATUS cmdBld_CfgConnMonitParams (TI_HANDLE hCmdBld,
1008 TRroamingTriggerParams *pRoamingTriggerCmd,
1009 void *fCb,
1010 TI_HANDLE hCb)
1011 {
1012 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
1013
1014 TRACE2(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "SetBssLossTsfThresholdParamsCmd :\n BssLossTimeout = %d\n TsfMissThreshold = %d \n ", pRoamingTriggerCmd->BssLossTimeout, pRoamingTriggerCmd->TsfMissThreshold);
1015
1016 DB_WLAN(hCmdBld).roamTriggers.BssLossTimeout = pRoamingTriggerCmd->BssLossTimeout;
1017 DB_WLAN(hCmdBld).roamTriggers.TsfMissThreshold = pRoamingTriggerCmd->TsfMissThreshold;
1018
1019 return cmdBld_CfgIeConnMonitParams (hCmdBld, pRoamingTriggerCmd, fCb, hCb);
1020 }
1021
1022
1023 /****************************************************************************
1024 * cmdBld_CfgEnableRxDataFilter()
1025 ****************************************************************************
1026 * DESCRIPTION: Enables or disables Rx data filtering.
1027 *
1028 * INPUTS: enabled - 0 to disable data filtering, any other value to enable.
1029 * defaultAction - The default action to take on non-matching packets.
1030 *
1031 * OUTPUT: None
1032 *
1033 * RETURNS: TI_OK or TI_NOK
1034 ****************************************************************************/
cmdBld_CfgEnableRxDataFilter(TI_HANDLE hCmdBld,TI_BOOL bEnabled,filter_e eDefaultAction,void * fCb,TI_HANDLE hCb)1035 TI_STATUS cmdBld_CfgEnableRxDataFilter (TI_HANDLE hCmdBld,
1036 TI_BOOL bEnabled,
1037 filter_e eDefaultAction,
1038 void *fCb,
1039 TI_HANDLE hCb)
1040 {
1041 /* Save parameters for reconfig phase */
1042 DB_RX_DATA_FLTR(hCmdBld).bEnabled = bEnabled;
1043 DB_RX_DATA_FLTR(hCmdBld).eDefaultAction = eDefaultAction;
1044
1045 return cmdBld_CfgIeEnableRxDataFilter (hCmdBld, bEnabled, eDefaultAction, fCb, hCb);
1046 }
1047
1048
1049 /****************************************************************************
1050 * cmdBld_CfgRxDataFilter()
1051 *****************************************************************************
1052 * DESCRIPTION: Add/remove Rx Data filter information element.
1053 *
1054 * INPUTS: index - Index of the Rx Data filter
1055 * command - Add or remove the filter
1056 * action - Action to take on packets matching the pattern
1057 * numFieldPatterns - Number of field patterns in the filter
1058 * lenFieldPatterns - Length of the field pattern series
1059 * fieldPatterns - Series of field patterns
1060 *
1061 * OUTPUT: None
1062 *
1063 * RETURNS: TI_OK or TI_NOK
1064 ****************************************************************************/
cmdBld_CfgRxDataFilter(TI_HANDLE hCmdBld,TI_UINT8 index,TI_UINT8 command,filter_e eAction,TI_UINT8 uNumFieldPatterns,TI_UINT8 uLenFieldPatterns,TI_UINT8 * pFieldPatterns,void * fCb,TI_HANDLE hCb)1065 TI_STATUS cmdBld_CfgRxDataFilter (TI_HANDLE hCmdBld,
1066 TI_UINT8 index,
1067 TI_UINT8 command,
1068 filter_e eAction,
1069 TI_UINT8 uNumFieldPatterns,
1070 TI_UINT8 uLenFieldPatterns,
1071 TI_UINT8 *pFieldPatterns,
1072 void *fCb,
1073 TI_HANDLE hCb)
1074 {
1075 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
1076 TRxDataFilter *pFilters = &(DB_RX_DATA_FLTR(hCmdBld).aRxDataFilter[index]);
1077
1078 /* Save parameters for reconfig phase */
1079 pFilters->uIndex = index;
1080 pFilters->uCommand = command;
1081 pFilters->eAction = eAction;
1082 pFilters->uNumFieldPatterns = uNumFieldPatterns;
1083 pFilters->uLenFieldPatterns = uLenFieldPatterns;
1084 os_memoryCopy(pCmdBld->hOs, pFilters->aFieldPattern, pFieldPatterns, uLenFieldPatterns);
1085
1086 return cmdBld_CfgIeRxDataFilter (hCmdBld,
1087 index,
1088 command,
1089 eAction,
1090 uNumFieldPatterns,
1091 uLenFieldPatterns,
1092 pFieldPatterns,
1093 fCb,
1094 hCb);
1095 }
1096
1097
cmdBld_CfgCtsProtection(TI_HANDLE hCmdBld,TI_UINT8 uCtsProtection,void * fCb,TI_HANDLE hCb)1098 TI_STATUS cmdBld_CfgCtsProtection (TI_HANDLE hCmdBld, TI_UINT8 uCtsProtection, void *fCb, TI_HANDLE hCb)
1099 {
1100 DB_WLAN(hCmdBld).CtsToSelf = uCtsProtection;
1101
1102 return cmdBld_CfgIeCtsProtection (hCmdBld, uCtsProtection, fCb, hCb);
1103 }
1104
1105
cmdBld_CfgServicePeriodTimeout(TI_HANDLE hCmdBld,TRxTimeOut * pRxTimeOut,void * fCb,TI_HANDLE hCb)1106 TI_STATUS cmdBld_CfgServicePeriodTimeout (TI_HANDLE hCmdBld, TRxTimeOut *pRxTimeOut, void *fCb, TI_HANDLE hCb)
1107 {
1108 return cmdBld_CfgIeServicePeriodTimeout (hCmdBld, pRxTimeOut, fCb, hCb);
1109 }
1110
1111
cmdBld_CfgRxMsduLifeTime(TI_HANDLE hCmdBld,TI_UINT32 uRxMsduLifeTime,void * fCb,TI_HANDLE hCb)1112 TI_STATUS cmdBld_CfgRxMsduLifeTime (TI_HANDLE hCmdBld, TI_UINT32 uRxMsduLifeTime, void *fCb, TI_HANDLE hCb)
1113 {
1114 DB_WLAN(hCmdBld).MaxRxMsduLifetime = uRxMsduLifeTime;
1115
1116 return cmdBld_CfgIeRxMsduLifeTime (hCmdBld, uRxMsduLifeTime, fCb, hCb);
1117 }
1118
1119
cmdBld_CfgStatisitics(TI_HANDLE hCmdBld,void * fCb,TI_HANDLE hCb)1120 TI_STATUS cmdBld_CfgStatisitics (TI_HANDLE hCmdBld, void *fCb, TI_HANDLE hCb)
1121 {
1122 return cmdBld_CfgIeStatisitics (hCmdBld, fCb, hCb);
1123 }
1124
1125
cmdBld_CfgTxPowerDbm(TI_HANDLE hCmdBld,TI_UINT8 uTxPowerDbm,void * fCb,TI_HANDLE hCb)1126 TI_STATUS cmdBld_CfgTxPowerDbm (TI_HANDLE hCmdBld, TI_UINT8 uTxPowerDbm, void *fCb, TI_HANDLE hCb)
1127 {
1128 return cmdBld_CfgIeTxPowerDbm (hCmdBld, uTxPowerDbm, fCb, hCb);
1129 }
1130
1131 /*
1132 * ----------------------------------------------------------------------------
1133 * Function : cmdBld_CfgBet
1134 *
1135 * Input : enabled - 0 to disable BET, 0 to disable BET
1136 * MaximumConsecutiveET - Max number of consecutive beacons
1137 * that may be early terminated.
1138 * Output : TI_STATUS
1139 * Process : Configures Beacon Early Termination information element.
1140 * Note(s) : None
1141 * -----------------------------------------------------------------------------
1142 */
cmdBld_CfgBet(TI_HANDLE hCmdBld,TI_UINT8 Enable,TI_UINT8 MaximumConsecutiveET,void * fCb,TI_HANDLE hCb)1143 TI_STATUS cmdBld_CfgBet (TI_HANDLE hCmdBld, TI_UINT8 Enable, TI_UINT8 MaximumConsecutiveET, void *fCb, TI_HANDLE hCb)
1144 {
1145 DB_WLAN(hCmdBld).BetEnable = Enable;
1146 DB_WLAN(hCmdBld).MaximumConsecutiveET = MaximumConsecutiveET;
1147
1148 return cmdBld_CfgIeBet (hCmdBld, Enable, MaximumConsecutiveET, fCb, hCb);
1149 }
1150
1151 /****************************************************************************
1152 * cmdBld_CfgKeepAlive()
1153 ****************************************************************************
1154 * DESCRIPTION: Set keep-alive paramters for a single index
1155 *
1156 * INPUTS: Paramters and CB
1157 *
1158 * OUTPUT: None
1159 *
1160 * RETURNS: TI_OK or TI_NOK
1161 ****************************************************************************/
cmdBld_CfgKeepAlive(TI_HANDLE hCmdBld,TKeepAliveParams * pKeepAliveParams,void * fCb,TI_HANDLE hCb)1162 TI_STATUS cmdBld_CfgKeepAlive (TI_HANDLE hCmdBld, TKeepAliveParams *pKeepAliveParams, void *fCb, TI_HANDLE hCb)
1163 {
1164 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
1165
1166 TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "CmdBld: Seeting keep-alive params, index=%d, interval=%d msec, trigType=%d, enaFlag=%d\n", pKeepAliveParams->index, pKeepAliveParams->interval, pKeepAliveParams->trigType, pKeepAliveParams->enaDisFlag);
1167
1168 os_memoryCopy (pCmdBld->hOs,
1169 (void *)&DB_KLV(hCmdBld).keepAliveParams[ pKeepAliveParams->index ],
1170 (void *)pKeepAliveParams,
1171 sizeof (TKeepAliveParams));
1172
1173 return cmdBld_CmdIeConfigureKeepAliveParams (hCmdBld,
1174 pKeepAliveParams->index,
1175 pKeepAliveParams->enaDisFlag,
1176 (TI_UINT8)pKeepAliveParams->trigType,
1177 pKeepAliveParams->interval,
1178 fCb,
1179 hCb);
1180 }
1181
1182 /****************************************************************************
1183 * cmdBld_CfgKeepAliveEnaDis()
1184 ****************************************************************************
1185 * DESCRIPTION: Set global keep-alive enable / disable flag
1186 *
1187 * INPUTS: Paramters and CB
1188 *
1189 * OUTPUT: None
1190 *
1191 * RETURNS: TI_OK or TI_NOK
1192 ****************************************************************************/
cmdBld_CfgKeepAliveEnaDis(TI_HANDLE hCmdBld,TI_UINT8 enaDisFlag,void * fCb,TI_HANDLE hCb)1193 TI_STATUS cmdBld_CfgKeepAliveEnaDis(TI_HANDLE hCmdBld, TI_UINT8 enaDisFlag, void *fCb, TI_HANDLE hCb)
1194 {
1195 TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
1196
1197 TRACE1(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "CmdBld: Seeting keep-alive Global ena / dis flag to %d\n", (TI_UINT32)enaDisFlag);
1198
1199 DB_KLV(hCmdBld).enaDisFlag = enaDisFlag;
1200
1201 return cmdBld_CmdIeConfigureKeepAliveEnaDis (hCmdBld, enaDisFlag, fCb, hCb);
1202 }
1203
1204 /**
1205 * \fn cmdBld_CfgSetFwHtCapabilities
1206 * \brief set the current AP HT Capabilities to the FW.
1207 *
1208 * \note
1209 * \return TI_OK on success or TI_NOK on failure
1210 * \sa
1211 */
cmdBld_CfgSetFwHtCapabilities(TI_HANDLE hCmdBld,TI_UINT32 uHtCapabilites,TMacAddr tMacAddress,TI_UINT8 uAmpduMaxLeng,TI_UINT8 uAmpduMinSpac,void * fCb,TI_HANDLE hCb)1212 TI_STATUS cmdBld_CfgSetFwHtCapabilities (TI_HANDLE hCmdBld,
1213 TI_UINT32 uHtCapabilites,
1214 TMacAddr tMacAddress,
1215 TI_UINT8 uAmpduMaxLeng,
1216 TI_UINT8 uAmpduMinSpac,
1217 void *fCb,
1218 TI_HANDLE hCb)
1219 {
1220
1221 DB_BSS(hCmdBld).bHtCap = TI_TRUE;
1222 DB_BSS(hCmdBld).uHtCapabilites = uHtCapabilites;
1223 MAC_COPY ((DB_BSS(hCmdBld).tMacAddress), tMacAddress);
1224 DB_BSS(hCmdBld).uAmpduMaxLeng = uAmpduMaxLeng;
1225 DB_BSS(hCmdBld).uAmpduMinSpac = uAmpduMinSpac;
1226
1227 return cmdBld_CfgIeSetFwHtCapabilities (hCmdBld,
1228 uHtCapabilites,
1229 tMacAddress,
1230 uAmpduMaxLeng,
1231 uAmpduMinSpac,
1232 fCb,
1233 hCb);
1234 }
1235
1236 /**
1237 * \fn cmdBld_CfgSetFwHtInformation
1238 * \brief set the current AP HT Information to the FW.
1239 *
1240 * \note
1241 * \return TI_OK on success or TI_NOK on failure
1242 * \sa
1243 */
cmdBld_CfgSetFwHtInformation(TI_HANDLE hCmdBld,TI_UINT8 uRifsMode,TI_UINT8 uHtProtection,TI_UINT8 uGfProtection,TI_UINT8 uHtTxBurstLimit,TI_UINT8 uDualCtsProtection,void * fCb,TI_HANDLE hCb)1244 TI_STATUS cmdBld_CfgSetFwHtInformation (TI_HANDLE hCmdBld,
1245 TI_UINT8 uRifsMode,
1246 TI_UINT8 uHtProtection,
1247 TI_UINT8 uGfProtection,
1248 TI_UINT8 uHtTxBurstLimit,
1249 TI_UINT8 uDualCtsProtection,
1250 void *fCb,
1251 TI_HANDLE hCb)
1252 {
1253
1254 DB_BSS(hCmdBld).bHtInf = TI_TRUE;
1255 DB_BSS(hCmdBld).uRifsMode = uRifsMode;
1256 DB_BSS(hCmdBld).uHtProtection = uHtProtection;
1257 DB_BSS(hCmdBld).uGfProtection = uGfProtection;
1258 DB_BSS(hCmdBld).uHtTxBurstLimit = uHtTxBurstLimit;
1259 DB_BSS(hCmdBld).uDualCtsProtection = uDualCtsProtection;
1260
1261 return cmdBld_CfgIeSetFwHtInformation (hCmdBld,
1262 uRifsMode,
1263 uHtProtection,
1264 uGfProtection,
1265 uHtTxBurstLimit,
1266 uDualCtsProtection,
1267 fCb,
1268 hCb);
1269 }
1270
1271 /**
1272 * \fn cmdBld_CfgSetBaInitiator
1273 * \brief configure BA session initiator\receiver parameters setting in the FW.
1274 *
1275 * \note
1276 * \return TI_OK on success or TI_NOK on failure
1277 * \sa
1278 */
cmdBld_CfgSetBaSession(TI_HANDLE hCmdBld,InfoElement_e eBaType,TI_UINT8 uTid,TI_UINT8 uState,TMacAddr tRa,TI_UINT16 uWinSize,TI_UINT16 uInactivityTimeout,void * fCb,TI_HANDLE hCb)1279 TI_STATUS cmdBld_CfgSetBaSession (TI_HANDLE hCmdBld,
1280 InfoElement_e eBaType,
1281 TI_UINT8 uTid,
1282 TI_UINT8 uState,
1283 TMacAddr tRa,
1284 TI_UINT16 uWinSize,
1285 TI_UINT16 uInactivityTimeout,
1286 void *fCb,
1287 TI_HANDLE hCb)
1288 {
1289 if (ACX_BA_SESSION_INITIATOR_POLICY == eBaType)
1290 {
1291 DB_BSS(hCmdBld).bBaInitiator[uTid] = TI_TRUE;
1292 DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uTid = uTid;
1293 DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uPolicy = uState;
1294 MAC_COPY ((DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].aMacAddress),tRa);
1295 DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uWinSize = uWinSize;
1296 DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uInactivityTimeout = uInactivityTimeout;
1297 }
1298 else
1299 {
1300 DB_BSS(hCmdBld).bBaResponder[uTid] = TI_TRUE;
1301 DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uTid = uTid;
1302 DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uPolicy = uState;
1303 MAC_COPY ((DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].aMacAddress),tRa);
1304 DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uWinSize = uWinSize;
1305 DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uInactivityTimeout = uInactivityTimeout;
1306 }
1307
1308 return cmdBld_CfgIeSetBaSession (hCmdBld,
1309 eBaType,
1310 uTid,
1311 uState,
1312 tRa,
1313 uWinSize,
1314 uInactivityTimeout,
1315 fCb,
1316 hCb);
1317 }
1318
1319
cmdBld_CfgBurstMode(TI_HANDLE hCmdBld,TI_BOOL bEnabled,void * fCb,TI_HANDLE hCb)1320 TI_STATUS cmdBld_CfgBurstMode (TI_HANDLE hCmdBld, TI_BOOL bEnabled, void *fCb, TI_HANDLE hCb)
1321 {
1322 DB_AC(hCmdBld).isBurstModeEnabled = bEnabled;
1323 return cmdBld_CfgIeBurstMode (hCmdBld, bEnabled, fCb, hCb);
1324 }
1325
1326