blob: 919f828ad622a65db31b450ab5a0985a15ab896c [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
2 * Copyright (c) 2012, Code Aurora Forum. 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
22/*===========================================================================
23
24 W L A N _ Q C T _ W D I. C
25
26 OVERVIEW:
27
28 This software unit holds the implementation of the WLAN Device Abstraction
29 Layer Interface.
30
31 The functions externalized by this module are to be called by any upper
32 MAC implementation that wishes to use the WLAN Device.
33
34 DEPENDENCIES:
35
36 Are listed for each API below.
37
38
39 Copyright (c) 2008 QUALCOMM Incorporated.
40 All Rights Reserved.
41 Qualcomm Confidential and Proprietary
42===========================================================================*/
43
44/*===========================================================================
45
46 EDIT HISTORY FOR FILE
47
48
49 This section contains comments describing changes made to the module.
50 Notice that changes are listed in reverse chronological order.
51
52
53 $Header$$DateTime$$Author$
54
55
56 when who what, where, why
57---------- --- --------------------------------------------------------
5810/05/11 hap Adding support for Keep Alive
592010-08-09 lti Created module
60
61===========================================================================*/
62
63/*----------------------------------------------------------------------------
64 * Include Files
65 * -------------------------------------------------------------------------*/
66#include "wlan_qct_wdi.h"
67#include "wlan_qct_wdi_i.h"
68#include "wlan_qct_wdi_sta.h"
69#include "wlan_qct_wdi_dp.h"
70
71#include "wlan_qct_wdi_cts.h"
72
73#include "wlan_qct_pal_api.h"
74#include "wlan_qct_pal_type.h"
75#include "wlan_qct_pal_status.h"
76#include "wlan_qct_pal_sync.h"
77#include "wlan_qct_pal_msg.h"
78#include "wlan_qct_pal_trace.h"
79#include "wlan_qct_pal_packet.h"
80
81#include "wlan_qct_wdi_dts.h"
82
83#include "wlan_hal_msg.h"
84
85#ifdef ANI_MANF_DIAG
86#include "pttMsgApi.h"
87#endif /* ANI_MANF_DIAG */
88
89/*===========================================================================
90 WLAN DAL Control Path Internal Data Definitions and Declarations
91 ===========================================================================*/
92#define WDI_WCTS_ACTION_TIMEOUT 2000 /* in msec a very high upper limit */
93
94
95#ifdef FEATURE_WLAN_SCAN_PNO
96#define WDI_PNO_VERSION_MASK 0x8000
97#endif
98
99/* host capability bitmap global */
100static tWlanFeatCaps *gpHostWlanFeatCaps = NULL;
101/* FW capability bitmap global */
102static tWlanFeatCaps *gpFwWlanFeatCaps = NULL;
103/* array of features supported. Need to add a new feature
104 * and other two places - wlan_hal_msg.h and halMsg.c (FW file)
105 */
106static placeHolderInCapBitmap supportEnabledFeatures[] =
107 {MCC, P2P};
108
109/*--------------------------------------------------------------------------
110 WLAN DAL State Machine
111 --------------------------------------------------------------------------*/
112WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] =
113{
114 /*WDI_INIT_ST*/
115 {{
116 WDI_MainStart, /*WDI_START_EVENT*/
117 NULL, /*WDI_STOP_EVENT*/
118 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
119 WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/
120 WDI_MainClose, /*WDI_CLOSE_EVENT*/
121 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
122 }},
123
124 /*WDI_STARTED_ST*/
125 {{
126 WDI_MainStartStarted, /*WDI_START_EVENT*/
127 WDI_MainStopStarted, /*WDI_STOP_EVENT*/
128 WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/
129 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
130 NULL, /*WDI_CLOSE_EVENT*/
131 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
132 }},
133
134 /*WDI_STOPPED_ST*/
135 {{
136 WDI_MainStart, /*WDI_START_EVENT*/
137 WDI_MainStopStopped, /*WDI_STOP_EVENT*/
138 NULL, /*WDI_REQUEST_EVENT*/
139 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
140 WDI_MainClose, /*WDI_CLOSE_EVENT*/
141 NULL /*WDI_SHUTDOWN_EVENT*/
142 }},
143
144 /*WDI_BUSY_ST*/
145 {{
146 WDI_MainStartBusy, /*WDI_START_EVENT*/
147 WDI_MainStopBusy, /*WDI_STOP_EVENT*/
148 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
149 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
150 WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/
151 WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/
152 }}
153};
154
155/*---------------------------------------------------------------------------
156 DAL Request Processing Array - the functions in this table will only be
157 called when the processing of the specific request is allowed by the
158 Main FSM
159 ---------------------------------------------------------------------------*/
160WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] =
161{
162 /*INIT*/
163 WDI_ProcessStartReq, /* WDI_START_REQ */
164 WDI_ProcessStopReq, /* WDI_STOP_REQ */
165 WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */
166
167 /*SCAN*/
168 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */
169 WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */
170 WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */
171 WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */
172
173 /*ASSOCIATION*/
174 WDI_ProcessJoinReq, /* WDI_JOIN_REQ */
175 WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */
176 WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */
177 WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */
178 WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */
179
180 /* Security */
181 WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */
182 WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */
183 WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */
184 WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */
185
186 /* QoS and BA APIs */
187 WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */
188 WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */
189 WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */
190 WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */
191 WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */
192
193 /* Miscellaneous Control APIs */
194 WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */
195 WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */
196 WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */
197 WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */
198 WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */
199
200 /*BA APIs*/
201 WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */
202 WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */
203
204 /*Beacon processing APIs*/
205 WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */
206 WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */
207
208 WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */
209 WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */
210 WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */
211 WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/
212#ifdef WLAN_FEATURE_P2P
213 WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */
214#else
215 NULL,
216#endif
217 /* PowerSave APIs */
218 WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */
219 WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */
220 WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */
221 WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */
222 WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */
223 WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */
224 WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */
225 WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */
226 WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */
227 WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */
228 WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */
229 WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */
230 WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */
231 WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */
232 WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */
233 WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */
234 WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */
235 WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */
236 /*NV Download APIs*/
237 WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/
238 WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */
239 WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */
240#ifdef WLAN_FEATURE_VOWIFI_11R
241 WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */
242#else
243 NULL,
244#endif /* WLAN_FEATURE_VOWIFI_11R */
245 WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */
246 WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */
247#ifdef ANI_MANF_DIAG
248 WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */
249#else
250 NULL,
251#endif /* ANI_MANF_DIAG */
252
253 NULL,
254 WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/
255
256 WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */
257
258#ifdef FEATURE_WLAN_SCAN_PNO
259 WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */
260 WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */
261 WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */
262#else
263 NULL,
264 NULL,
265 NULL,
266#endif /* FEATURE_WLAN_SCAN_PNO */
267
268 WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */
269
270#ifdef WLAN_FEATURE_PACKET_FILTERING
271 /* WDI_8023_MULTICAST_LIST_REQ */
272 WDI_Process8023MulticastListReq,
273 /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */
274 WDI_ProcessReceiveFilterSetFilterReq,
275 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */
276 WDI_ProcessFilterMatchCountReq,
277 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */
278 WDI_ProcessReceiveFilterClearFilterReq,
279#else
280 NULL,
281 NULL,
282 NULL,
283 NULL,
284#endif // WLAN_FEATURE_PACKET_FILTERING
285 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */
286 WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */
287 WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */
288
289 WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/
290#ifdef FEATURE_WLAN_CCX
291 WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */
292#else
293 NULL,
294#endif
295
296#ifdef WLAN_FEATURE_GTK_OFFLOAD
297 WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */
298 WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */
299#else
300 NULL,
301 NULL,
302#endif // WLAN_FEATURE_GTK_OFFLOAD
303
304 WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/
305 WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */
306 /*-------------------------------------------------------------------------
307 Indications
308 -------------------------------------------------------------------------*/
309 WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/
310};
311
312
313/*---------------------------------------------------------------------------
314 DAL Request Processing Array - the functions in this table will only be
315 called when the processing of the specific request is allowed by the
316 Main FSM
317 ---------------------------------------------------------------------------*/
318WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] =
319{
320 /*INIT*/
321 WDI_ProcessStartRsp, /* WDI_START_RESP */
322 WDI_ProcessStopRsp, /* WDI_STOP_RESP */
323 WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */
324
325 /*SCAN*/
326 WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */
327 WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */
328 WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */
329 WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */
330
331 /* ASSOCIATION*/
332 WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */
333 WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */
334 WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */
335 WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */
336 WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */
337
338 /* Security */
339 WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */
340 WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
341 WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */
342 WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
343
344 /* QoS and BA APIs */
345 WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */
346 WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */
347 WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */
348 WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */
349 WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */
350
351 /* Miscellaneous Control APIs */
352 WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */
353 WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */
354 WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */
355 WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */
356 WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */
357
358 /* BA APIs*/
359 WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */
360 WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */
361
362 /* IBSS APIs*/
363 WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */
364 WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */
365
366 /*Soft AP APIs*/
367 WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */
368 WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */
369 WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */
370 WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */
371
372 /* PowerSave APIs */
373 WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */
374 WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */
375 WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */
376 WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */
377 WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */
378 WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */
379 WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */
380 WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */
381 WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */
382 WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */
383 WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */
384 WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */
385 WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */
386 WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */
387 WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */
388 WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */
389 WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */
390 WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */
391
392
393 WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/
394
395 WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */
396 WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */
397#ifdef WLAN_FEATURE_VOWIFI_11R
398 WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */
399#else
400 NULL,
401#endif /* WLAN_FEATURE_VOWIFI_11R */
402 WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */
403 WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */
404 NULL,
405 WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/
406
407#ifdef WLAN_FEATURE_P2P
408 WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */
409#else
410 NULL,
411#endif
412
413#ifdef ANI_MANF_DIAG
414 WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */
415#else
416 NULL,
417#endif /* ANI_MANF_DIAG */
418
419 WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */
420
421#ifdef FEATURE_WLAN_SCAN_PNO
422 WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */
423 WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */
424 WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */
425#else
426 NULL,
427 NULL,
428 NULL,
429#endif // FEATURE_WLAN_SCAN_PNO
430
431 WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */
432
433 /*---------------------------------------------------------------------
434 Indications
435 ---------------------------------------------------------------------*/
436#ifdef WLAN_FEATURE_PACKET_FILTERING
437 /* WDI_8023_MULTICAST_LIST_RESP */
438 WDI_Process8023MulticastListRsp,
439 /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */
440 WDI_ProcessReceiveFilterSetFilterRsp,
441 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */
442 WDI_ProcessFilterMatchCountRsp,
443 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */
444 WDI_ProcessReceiveFilterClearFilterRsp,
445#else
446 NULL,
447 NULL,
448 NULL,
449 NULL,
450#endif // WLAN_FEATURE_PACKET_FILTERING
451
452 WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */
453 WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */
454
455 WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/
456#ifdef FEATURE_WLAN_CCX
457 WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */
458#else
459 NULL,
460#endif
461
462#ifdef WLAN_FEATURE_GTK_OFFLOAD
463 WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */
464 WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */
465#else
466 NULL,
467 NULL,
468#endif // WLAN_FEATURE_GTK_OFFLOAD
469 WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */
470 WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */
471
472 /*---------------------------------------------------------------------
473 Indications
474 ---------------------------------------------------------------------*/
475 WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */
476 WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */
477 WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */
478 WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */
479 WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */
480 WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */
481
482 WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */
483
484 WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */
485
486#ifdef WLAN_FEATURE_P2P
487 WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/
488#else
489 NULL,
490#endif
491
492#ifdef FEATURE_WLAN_SCAN_PNO
493 WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */
494#else
495 NULL,
496#endif // FEATURE_WLAN_SCAN_PNO
497
498#ifdef WLAN_WAKEUP_EVENTS
499 WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */
500#else // WLAN_WAKEUP_EVENTS
501 NULL,
502#endif // WLAN_WAKEUP_EVENTS
503
504 WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */
505};
506
507
508/*---------------------------------------------------------------------------
509 WLAN DAL Global Control Block
510 ---------------------------------------------------------------------------*/
511WDI_ControlBlockType gWDICb;
512static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE;
513
514const wpt_uint8 szTransportChName[] = "WLAN_CTRL";
515
516/*Helper routine for retrieving the PAL Context from WDI*/
517WPT_INLINE
518void* WDI_GET_PAL_CTX( void )
519{
520 return gWDICb.pPALContext;
521}/*WDI_GET_PAL_CTX*/
522
523/*============================================================================
524 Helper inline converters
525 ============================================================================*/
526/*Convert WDI driver type into HAL driver type*/
527WPT_STATIC WPT_INLINE WDI_Status
528WDI_HAL_2_WDI_STATUS
529(
530 eHalStatus halStatus
531);
532
533/*Convert WDI request type into HAL request type*/
534WPT_STATIC WPT_INLINE tHalHostMsgType
535WDI_2_HAL_REQ_TYPE
536(
537 WDI_RequestEnumType wdiReqType
538);
539
540/*Convert WDI response type into HAL response type*/
541WPT_STATIC WPT_INLINE WDI_ResponseEnumType
542HAL_2_WDI_RSP_TYPE
543(
544 tHalHostMsgType halMsg
545);
546
547/*Convert WDI driver type into HAL driver type*/
548WPT_STATIC WPT_INLINE tDriverType
549WDI_2_HAL_DRV_TYPE
550(
551 WDI_DriverType wdiDriverType
552);
553
554/*Convert WDI stop reason into HAL stop reason*/
555WPT_STATIC WPT_INLINE tHalStopType
556WDI_2_HAL_STOP_REASON
557(
558 WDI_StopType wdiStopType
559);
560
561/*Convert WDI scan mode type into HAL scan mode type*/
562WPT_STATIC WPT_INLINE eHalSysMode
563WDI_2_HAL_SCAN_MODE
564(
565 WDI_ScanMode wdiScanMode
566);
567
568/*Convert WDI sec ch offset into HAL sec ch offset type*/
569WPT_STATIC WPT_INLINE tSirMacHTSecondaryChannelOffset
570WDI_2_HAL_SEC_CH_OFFSET
571(
572 WDI_HTSecondaryChannelOffset wdiSecChOffset
573);
574
575/*Convert WDI BSS type into HAL BSS type*/
576WPT_STATIC WPT_INLINE tSirBssType
577WDI_2_HAL_BSS_TYPE
578(
579 WDI_BssType wdiBSSType
580);
581
582/*Convert WDI NW type into HAL NW type*/
583WPT_STATIC WPT_INLINE tSirNwType
584WDI_2_HAL_NW_TYPE
585(
586 WDI_NwType wdiNWType
587);
588
589/*Convert WDI chanel bonding type into HAL cb type*/
590WPT_STATIC WPT_INLINE ePhyChanBondState
591WDI_2_HAL_CB_STATE
592(
593 WDI_PhyChanBondState wdiCbState
594);
595
596/*Convert WDI chanel bonding type into HAL cb type*/
597WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
598WDI_2_HAL_HT_OPER_MODE
599(
600 WDI_HTOperatingMode wdiHTOperMode
601);
602
603/*Convert WDI mimo PS type into HAL mimo PS type*/
604WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
605WDI_2_HAL_MIMO_PS
606(
607 WDI_HTMIMOPowerSaveState wdiHTOperMode
608);
609
610/*Convert WDI ENC type into HAL ENC type*/
611WPT_STATIC WPT_INLINE tAniEdType
612WDI_2_HAL_ENC_TYPE
613(
614 WDI_EncryptType wdiEncType
615);
616
617/*Convert WDI WEP type into HAL WEP type*/
618WPT_STATIC WPT_INLINE tAniWepType
619WDI_2_HAL_WEP_TYPE
620(
621 WDI_WepType wdiWEPType
622);
623
624/*Convert WDI Link State into HAL Link State*/
625WPT_STATIC WPT_INLINE tSirLinkState
626WDI_2_HAL_LINK_STATE
627(
628 WDI_LinkStateType wdiLinkState
629);
630
631/*Translate a STA Context from WDI into HAL*/
632WPT_STATIC WPT_INLINE
633void
634WDI_CopyWDIStaCtxToHALStaCtx
635(
636 tConfigStaParams* phalConfigSta,
637 WDI_ConfigStaReqInfoType* pwdiConfigSta
638);
639
640/*Translate a Rate set info from WDI into HAL*/
641WPT_STATIC WPT_INLINE void
642WDI_CopyWDIRateSetToHALRateSet
643(
644 tSirMacRateSet* pHalRateSet,
645 WDI_RateSet* pwdiRateSet
646);
647
648/*Translate an EDCA Parameter Record from WDI into HAL*/
649WPT_STATIC WPT_INLINE void
650WDI_CopyWDIEDCAParamsToHALEDCAParams
651(
652 tSirMacEdcaParamRecord* phalEdcaParam,
653 WDI_EdcaParamRecord* pWDIEdcaParam
654);
655
656/*Copy a management frame header from WDI fmt into HAL fmt*/
657WPT_STATIC WPT_INLINE void
658WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
659(
660 tSirMacMgmtHdr* pmacMgmtHdr,
661 WDI_MacMgmtHdr* pwdiMacMgmtHdr
662);
663
664/*Copy config bss parameters from WDI fmt into HAL fmt*/
665WPT_STATIC WPT_INLINE void
666WDI_CopyWDIConfigBSSToHALConfigBSS
667(
668 tConfigBssParams* phalConfigBSS,
669 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
670);
671
672/*Extract the request CB function and user data from a request structure
673 pointed to by user data */
674WPT_STATIC WPT_INLINE void
675WDI_ExtractRequestCBFromEvent
676(
677 WDI_EventInfoType* pEvent,
678 WDI_ReqStatusCb* ppfnReqCB,
679 void** ppUserData
680);
681
682wpt_uint8
683WDI_FindEmptySession
684(
685 WDI_ControlBlockType* pWDICtx,
686 WDI_BSSSessionType** ppSession
687);
688
689void
690WDI_AddBcastSTAtoSTATable
691(
692 WDI_ControlBlockType* pWDICtx,
693 WDI_AddStaParams * staParams,
694 wpt_uint16 usBcastStaIdx
695);
696
697WDI_Status WDI_SendNvBlobReq
698(
699 WDI_ControlBlockType* pWDICtx,
700 WDI_EventInfoType* pEventData
701);
702
703void
704WDI_SetPowerStateCb
705(
706 wpt_status status,
707 unsigned int dxePhyAddr,
708 void *pContext
709);
710
711#define CASE_RETURN_STRING( str ) \
712 case ( ( str ) ): return( #str ); break \
713
714/**
715 @brief WDI_getReqMsgString prints the WDI request message in string.
716
717 @param wdiReqMsgId: WDI Message request Id
718
719 @see
720 @return Result of the function call
721*/
722static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId)
723{
724 switch (wdiReqMsgId)
725 {
726 CASE_RETURN_STRING( WDI_START_REQ );
727 CASE_RETURN_STRING( WDI_STOP_REQ );
728 CASE_RETURN_STRING( WDI_CLOSE_REQ );
729 CASE_RETURN_STRING( WDI_INIT_SCAN_REQ );
730 CASE_RETURN_STRING( WDI_START_SCAN_REQ );
731 CASE_RETURN_STRING( WDI_END_SCAN_REQ );
732 CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ );
733 CASE_RETURN_STRING( WDI_JOIN_REQ );
734 CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ );
735 CASE_RETURN_STRING( WDI_DEL_BSS_REQ );
736 CASE_RETURN_STRING( WDI_POST_ASSOC_REQ );
737 CASE_RETURN_STRING( WDI_DEL_STA_REQ );
738 CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ );
739 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ );
740 CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ );
741 CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ );
742 CASE_RETURN_STRING( WDI_ADD_TS_REQ );
743 CASE_RETURN_STRING( WDI_DEL_TS_REQ );
744 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ );
745 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ );
746 CASE_RETURN_STRING( WDI_DEL_BA_REQ );
747 CASE_RETURN_STRING( WDI_CH_SWITCH_REQ );
748 CASE_RETURN_STRING( WDI_CONFIG_STA_REQ );
749 CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ );
750 CASE_RETURN_STRING( WDI_GET_STATS_REQ );
751 CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ );
752 CASE_RETURN_STRING( WDI_ADD_BA_REQ );
753 CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ );
754 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ );
755 CASE_RETURN_STRING( WDI_SND_BCON_REQ );
756 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ );
757 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ );
758 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ );
759 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ );
760 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ );
761 CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ );
762 CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ );
763 CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ );
764 CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ );
765 CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ );
766 CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ );
767 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ );
768 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ );
769 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ );
770 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ);
771 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ );
772 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ );
773 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ );
774 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ );
775 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ );
776 CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ );
777 CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ );
778 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ );
779 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ );
780 CASE_RETURN_STRING( WDI_FLUSH_AC_REQ );
781 CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ );
782 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ );
783 CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ );
784 CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ );
785 CASE_RETURN_STRING( WDI_FTM_CMD_REQ );
786 CASE_RETURN_STRING( WDI_START_INNAV_MEAS_REQ );
787 CASE_RETURN_STRING( WDI_HOST_RESUME_REQ );
788 CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ);
789 #ifdef FEATURE_WLAN_SCAN_PNO
790 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ );
791 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ );
792 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ );
793 #endif
794 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ );
795 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ );
796 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ );
797 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ );
798 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ );
799 CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ );
800 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ );
801 CASE_RETURN_STRING( WDI_SHUTDOWN_REQ );
802 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ );
803 default:
804 return "Unknown WDI MessageId";
805 }
806}
807
808
809
810/**
811 @brief WDI_getRespMsgString prints the WDI resonse message in string.
812
813 @param wdiRespMsgId: WDI Message response Id
814
815 @see
816 @return Result of the function call
817*/
818static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId)
819{
820 switch (wdiRespMsgId)
821 {
822 CASE_RETURN_STRING( WDI_START_RESP );
823 CASE_RETURN_STRING( WDI_STOP_RESP );
824 CASE_RETURN_STRING( WDI_CLOSE_RESP );
825 CASE_RETURN_STRING( WDI_INIT_SCAN_RESP );
826 CASE_RETURN_STRING( WDI_START_SCAN_RESP );
827 CASE_RETURN_STRING( WDI_END_SCAN_RESP );
828 CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP );
829 CASE_RETURN_STRING( WDI_JOIN_RESP );
830 CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP );
831 CASE_RETURN_STRING( WDI_DEL_BSS_RESP );
832 CASE_RETURN_STRING( WDI_POST_ASSOC_RESP );
833 CASE_RETURN_STRING( WDI_DEL_STA_RESP );
834 CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP );
835 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP );
836 CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP );
837 CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP );
838 CASE_RETURN_STRING( WDI_ADD_TS_RESP );
839 CASE_RETURN_STRING( WDI_DEL_TS_RESP );
840 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP );
841 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP );
842 CASE_RETURN_STRING( WDI_DEL_BA_RESP );
843 CASE_RETURN_STRING( WDI_CH_SWITCH_RESP );
844 CASE_RETURN_STRING( WDI_CONFIG_STA_RESP );
845 CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP );
846 CASE_RETURN_STRING( WDI_GET_STATS_RESP );
847 CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP );
848 CASE_RETURN_STRING( WDI_ADD_BA_RESP );
849 CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP );
850 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP );
851 CASE_RETURN_STRING( WDI_SND_BCON_RESP );
852 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP );
853 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP );
854 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP );
855 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP );
856 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP );
857 CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP );
858 CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP );
859 CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP );
860 CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP );
861 CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP );
862 CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP );
863 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP );
864 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP );
865 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP );
866 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP);
867 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP );
868 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP );
869 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP );
870 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP );
871 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP );
872 CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP );
873 CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP );
874 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP );
875 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP );
876 CASE_RETURN_STRING( WDI_FLUSH_AC_RESP );
877 CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP );
878 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP );
879 CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP );
880 CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP );
881 CASE_RETURN_STRING( WDI_FTM_CMD_RESP );
882 CASE_RETURN_STRING( WDI_START_INNAV_MEAS_RESP );
883 CASE_RETURN_STRING( WDI_HOST_RESUME_RESP );
884 CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP);
885 #ifdef FEATURE_WLAN_SCAN_PNO
886 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP );
887 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP );
888 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP );
889 #endif
890 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP );
891 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP );
892 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP );
893 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP );
894 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP );
895 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP );
896 CASE_RETURN_STRING( WDI_SHUTDOWN_RESP );
897 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP );
898 default:
899 return "Unknown WDI MessageId";
900 }
901}
902
903/**
904 @brief WDI_getHALStatusMsgString prints the HAL status in string.
905
906 @param halStatusId: HAL status Id
907
908 @see
909 @return Result of the function call
910*/
911static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId)
912{
913 switch (halStatusId)
914 {
915 CASE_RETURN_STRING( eHAL_STATUS_SUCCESS );
916 CASE_RETURN_STRING( PAL_STATUS_INVAL );
917 CASE_RETURN_STRING( PAL_STATUS_ALREADY );
918 CASE_RETURN_STRING( PAL_STATUS_EMPTY );
919 CASE_RETURN_STRING( PAL_STATUS_FAILURE );
920 CASE_RETURN_STRING( eHAL_STATUS_FAILURE );
921 CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER );
922 CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX );
923 CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL );
924 CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS );
925 CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT );
926 CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL );
927 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA );
928 CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID );
929 CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID );
930 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID );
931 CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX );
932 CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL );
933 CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE );
934 CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID );
935 CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN );
936 CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL );
937 CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL );
938 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL );
939 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED );
940 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID );
941 CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED );
942 CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED );
943 CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC );
944 CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL );
945 CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
946 CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
947 CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED );
948 default:
949 return "Unknown HAL status";
950 }
951}
952
953/*========================================================================
954
955 INITIALIZATION APIs
956
957==========================================================================*/
958
959/**
960 @brief WDI_Init is used to initialize the DAL.
961
962 DAL will allocate all the resources it needs. It will open PAL, it will also
963 open both the data and the control transport which in their turn will open
964 DXE/SMD or any other drivers that they need.
965
966 @param pOSContext: pointer to the OS context provided by the UMAC
967 will be passed on to PAL on Open
968 ppWDIGlobalCtx: output pointer of Global Context
969 pWdiDevCapability: output pointer of device capability
970
971 @return Result of the function call
972*/
973WDI_Status
974WDI_Init
975(
976 void* pOSContext,
977 void** ppWDIGlobalCtx,
978 WDI_DeviceCapabilityType* pWdiDevCapability,
979 unsigned int driverType
980)
981{
982 wpt_uint8 i;
983 wpt_status wptStatus;
984 WDI_Status wdiStatus;
985 WCTS_TransportCBsType wctsCBs;
986 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
987
988 /*---------------------------------------------------------------------
989 Sanity check
990 ---------------------------------------------------------------------*/
991 if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability ))
992 {
993 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
994 "Invalid input parameters in WDI_Init");
995
996 return WDI_STATUS_E_FAILURE;
997 }
998
999 /*---------------------------------------------------------------------
1000 Check to see if the module has already been initialized or not
1001 ---------------------------------------------------------------------*/
1002 if ( eWLAN_PAL_FALSE != gWDIInitialized )
1003 {
1004 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1005 "WDI module already initialized - return");
1006
1007 return WDI_STATUS_SUCCESS;
1008 }
1009
1010 /*Module is now initialized - this flag is to ensure the fact that multiple
1011 init will not happen on WDI
1012 !! - potential race does exist because read and set are not atomic,
1013 however an atomic operation would be closely here - reanalyze if necessary*/
1014 gWDIInitialized = eWLAN_PAL_TRUE;
1015
1016 /*Setup the control block */
1017 WDI_CleanCB(&gWDICb);
1018 gWDICb.pOSContext = pOSContext;
1019
1020 /*Setup the STA Table*/
1021 wdiStatus = WDI_STATableInit(&gWDICb);
1022 if ( WDI_STATUS_SUCCESS != wdiStatus )
1023 {
1024 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1025 "%s: Failure while initializing STA Table, status %d",
1026 __FUNCTION__, wdiStatus);
1027 goto fail_STATableInit;
1028 }
1029
1030 /*------------------------------------------------------------------------
1031 Open the PAL
1032 ------------------------------------------------------------------------*/
1033 wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext);
1034 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1035 {
1036 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1037 "%s: Failed to open PAL, status %d",
1038 __FUNCTION__, wptStatus);
1039 goto fail_wpalOpen;
1040 }
1041
1042 /*Initialize main synchro mutex - it will be used to ensure integrity of
1043 the main WDI Control Block*/
1044 wptStatus = wpalMutexInit(&gWDICb.wptMutex);
1045 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1046 {
1047 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1048 "%s: Failed to init mutex, status %d",
1049 __FUNCTION__, wptStatus);
1050 goto fail_mutex;
1051 }
1052
1053 /*Initialize the response timer - it will be used to time all messages
1054 expected as response from device*/
1055 wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer,
1056 WDI_ResponseTimerCB,
1057 &gWDICb);
1058 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1059 {
1060 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1061 "%s: Failed to init response timer, status %d",
1062 __FUNCTION__, wptStatus);
1063 goto fail_timer;
1064 }
1065
1066 /* Initialize the WDI Pending Request Queue*/
1067 wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue));
1068 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1069 {
1070 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1071 "%s: Failed to init pending request queue, status %d",
1072 __FUNCTION__, wptStatus);
1073 goto fail_pend_queue;
1074 }
1075
1076 /*Init WDI Pending Assoc Id Queue */
1077 wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue));
1078 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1079 {
1080 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1081 "%s: Failed to init assoc session queue, status %d",
1082 __FUNCTION__, wptStatus);
1083 goto fail_assoc_queue;
1084 }
1085
1086 /*Initialize the BSS sessions pending Queue */
1087 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1088 {
1089 wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1090 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1091 {
1092 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1093 "%s: Failed to init BSS %d pending queue, status %d",
1094 __FUNCTION__, i, wptStatus);
1095 goto fail_bss_queue;
1096 }
1097 }
1098
1099 /*Indicate the control block is sufficiently initialized for callbacks*/
1100 gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC;
1101
1102 /*------------------------------------------------------------------------
1103 Initialize the Data Path Utility Module
1104 ------------------------------------------------------------------------*/
1105 wdiStatus = WDI_DP_UtilsInit(&gWDICb);
1106 if ( WDI_STATUS_SUCCESS != wdiStatus )
1107 {
1108 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1109 "%s: Failed to initialize the DP Util Module, status %d",
1110 __FUNCTION__, wdiStatus);
1111 goto fail_dp_util_init;
1112 }
1113
1114 /* Init Set power state event */
1115 wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent);
1116 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1117 {
1118 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1119 "%s: Failed to initialize power state event, status %d",
1120 __FUNCTION__, wptStatus);
1121 goto fail_power_event;
1122 }
1123
1124 /* Init WCTS action event */
1125 wptStatus = wpalEventInit(&gWDICb.wctsActionEvent);
1126 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1127 {
1128 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1129 "%s: Failed to initialize WCTS action event, status %d",
1130 __FUNCTION__, wptStatus);
1131 goto fail_wcts_event;
1132 }
1133
1134 /*------------------------------------------------------------------------
1135 Open the Transport Services for Control and Data
1136 ------------------------------------------------------------------------*/
1137 wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB;
1138 wctsCBs.wctsNotifyCBData = &gWDICb;
1139 wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB;
1140 wctsCBs.wctsRxMsgCBData = &gWDICb;
1141
1142 gWDICb.bCTOpened = eWLAN_PAL_FALSE;
1143 gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName ,
1144 WDI_CT_CHANNEL_SIZE,
1145 &wctsCBs );
1146
1147 if ( NULL == gWDICb.wctsHandle )
1148 {
1149 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1150 "%s: Failed to open WCTS transport", __FUNCTION__);
1151 goto fail_wcts_open;
1152 }
1153
1154 gWDICb.driverMode = (tDriverType)driverType;
1155 /* FTM mode not need to open Transport Driver */
1156 if(eDRIVER_TYPE_MFG != (tDriverType)driverType)
1157 {
1158 /*------------------------------------------------------------------------
1159 Open the Data Transport
1160 ------------------------------------------------------------------------*/
1161 if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb))
1162 {
1163 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1164 "%s: Failed to open the DT Transport", __FUNCTION__);
1165 goto fail_wdts_open;
1166 }
1167 }
1168
1169 /*The WDI is initialized - set state to init */
1170 gWDICb.uGlobalState = WDI_INIT_ST;
1171
1172 /*Send the context as a ptr to the global WDI Control Block*/
1173 *ppWDIGlobalCtx = &gWDICb;
1174
1175 /*Fill in the device capabilities*/
1176 pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE;
1177 pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations;
1178 pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids;
1179 return WDI_STATUS_SUCCESS;
1180
1181 /* ERROR handlers
1182 Undo everything that completed successfully */
1183
1184 fail_wdts_open:
1185 {
1186 wpt_status eventStatus;
1187
1188 /* Closing WCTS in this scenario is tricky since it has to close
1189 the SMD channel and then we get notified asynchronously when
1190 the channel has been closed. So we take some of the logic from
1191 the "normal" close procedure in WDI_Close()
1192 */
1193
1194 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
1195 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1196 {
1197 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1198 "%s: Failed to reset WCTS action event", __FUNCTION__);
1199 }
1200
1201 WCTS_CloseTransport(gWDICb.wctsHandle);
1202
1203 /* Wait for WCTS to close the control transport. If we were able
1204 to reset the event flag, then we'll wait for the event,
1205 otherwise we'll wait for a maximum amount of time required for
1206 the channel to be closed */
1207 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1208 {
1209 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
1210 WDI_WCTS_ACTION_TIMEOUT);
1211 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1212 {
1213 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1214 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1215 }
1216 }
1217 else
1218 {
1219 wpalSleep(WDI_WCTS_ACTION_TIMEOUT);
1220 }
1221 }
1222 fail_wcts_open:
1223 wpalEventDelete(&gWDICb.wctsActionEvent);
1224 fail_wcts_event:
1225 wpalEventDelete(&gWDICb.setPowerStateEvent);
1226 fail_power_event:
1227 WDI_DP_UtilsExit(&gWDICb);
1228 fail_dp_util_init:
1229 gWDICb.magic = 0;
1230 fail_bss_queue:
1231 /* entries 0 thru i-1 were successfully initialized */
1232 while (0 < i)
1233 {
1234 i--;
1235 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1236 }
1237 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1238 fail_assoc_queue:
1239 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1240 fail_pend_queue:
1241 wpalTimerDelete(&gWDICb.wptResponseTimer);
1242 fail_timer:
1243 wpalMutexDelete(&gWDICb.wptMutex);
1244 fail_mutex:
1245 wpalClose(gWDICb.pPALContext);
1246 fail_wpalOpen:
1247 WDI_STATableClose(&gWDICb);
1248 fail_STATableInit:
1249 gWDIInitialized = eWLAN_PAL_FALSE;
1250
1251 return WDI_STATUS_E_FAILURE;
1252
1253}/*WDI_Init*/;
1254
1255/**
1256 @brief WDI_Start will be called when the upper MAC is ready to
1257 commence operation with the WLAN Device. Upon the call
1258 of this API the WLAN DAL will pack and send a HAL Start
1259 message to the lower RIVA sub-system if the SMD channel
1260 has been fully opened and the RIVA subsystem is up.
1261
1262 If the RIVA sub-system is not yet up and running DAL
1263 will queue the request for Open and will wait for the
1264 SMD notification before attempting to send down the
1265 message to HAL.
1266
1267 WDI_Init must have been called.
1268
1269 @param wdiStartParams: the start parameters as specified by
1270 the Device Interface
1271
1272 wdiStartRspCb: callback for passing back the response of
1273 the start operation received from the device
1274
1275 pUserData: user data will be passed back with the
1276 callback
1277
1278 @see WDI_Start
1279 @return Result of the function call
1280*/
1281WDI_Status
1282WDI_Start
1283(
1284 WDI_StartReqParamsType* pwdiStartParams,
1285 WDI_StartRspCb wdiStartRspCb,
1286 void* pUserData
1287)
1288{
1289 WDI_EventInfoType wdiEventData;
1290 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1291
1292 /*------------------------------------------------------------------------
1293 Sanity Check
1294 ------------------------------------------------------------------------*/
1295 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1296 {
1297 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1298 "WDI API call before module is initialized - Fail request");
1299
1300 return WDI_STATUS_E_NOT_ALLOWED;
1301 }
1302
1303 /*------------------------------------------------------------------------
1304 Fill in Event data and post to the Main FSM
1305 ------------------------------------------------------------------------*/
1306 wdiEventData.wdiRequest = WDI_START_REQ;
1307 wdiEventData.pEventData = pwdiStartParams;
1308 wdiEventData.uEventDataSize = sizeof(*pwdiStartParams);
1309 wdiEventData.pCBfnc = wdiStartRspCb;
1310 wdiEventData.pUserData = pUserData;
1311
1312 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1313
1314}/*WDI_Start*/
1315
1316/**
1317 @brief WDI_Stop will be called when the upper MAC is ready to
1318 stop any operation with the WLAN Device. Upon the call
1319 of this API the WLAN DAL will pack and send a HAL Stop
1320 message to the lower RIVA sub-system if the DAL Core is
1321 in started state.
1322
1323 In state BUSY this request will be queued.
1324
1325 Request will not be accepted in any other state.
1326
1327 WDI_Start must have been called.
1328
1329 @param wdiStopParams: the stop parameters as specified by
1330 the Device Interface
1331
1332 wdiStopRspCb: callback for passing back the response of
1333 the stop operation received from the device
1334
1335 pUserData: user data will be passed back with the
1336 callback
1337
1338 @see WDI_Start
1339 @return Result of the function call
1340*/
1341WDI_Status
1342WDI_Stop
1343(
1344 WDI_StopReqParamsType* pwdiStopParams,
1345 WDI_StopRspCb wdiStopRspCb,
1346 void* pUserData
1347)
1348{
1349 WDI_EventInfoType wdiEventData;
1350 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1351
1352 /*------------------------------------------------------------------------
1353 Sanity Check
1354 ------------------------------------------------------------------------*/
1355 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1356 {
1357 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1358 "WDI API call before module is initialized - Fail request");
1359
1360 return WDI_STATUS_E_NOT_ALLOWED;
1361 }
1362
1363 /* Free the global variables */
1364 wpalMemoryFree(gpHostWlanFeatCaps);
1365 wpalMemoryFree(gpFwWlanFeatCaps);
1366
1367 /*------------------------------------------------------------------------
1368 Fill in Event data and post to the Main FSM
1369 ------------------------------------------------------------------------*/
1370 wdiEventData.wdiRequest = WDI_STOP_REQ;
1371 wdiEventData.pEventData = pwdiStopParams;
1372 wdiEventData.uEventDataSize = sizeof(*pwdiStopParams);
1373 wdiEventData.pCBfnc = wdiStopRspCb;
1374 wdiEventData.pUserData = pUserData;
1375
1376 return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData);
1377
1378}/*WDI_Stop*/
1379
1380
1381
1382/**
1383 @brief WDI_Close will be called when the upper MAC no longer
1384 needs to interact with DAL. DAL will free its control
1385 block.
1386
1387 It is only accepted in state STOPPED.
1388
1389 WDI_Stop must have been called.
1390
1391 @param none
1392
1393 @see WDI_Stop
1394 @return Result of the function call
1395*/
1396WDI_Status
1397WDI_Close
1398(
1399 void
1400)
1401{
1402 wpt_uint8 i;
1403 WDI_EventInfoType wdiEventData;
1404 wpt_status wptStatus;
1405 wpt_status eventStatus;
1406 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1407
1408 /*------------------------------------------------------------------------
1409 Sanity Check
1410 ------------------------------------------------------------------------*/
1411 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1412 {
1413 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1414 "WDI API call before module is initialized - Fail request");
1415
1416 return WDI_STATUS_E_NOT_ALLOWED;
1417 }
1418
1419 /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ
1420 (the control transport will be closed by the FSM and we'll want
1421 to wait until that completes)*/
1422 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
1423 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1424 {
1425 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1426 "%s: Failed to reset WCTS action event", __FUNCTION__);
1427 /* fall through and try to finish closing via the FSM */
1428 }
1429
1430 /*------------------------------------------------------------------------
1431 Fill in Event data and post to the Main FSM
1432 ------------------------------------------------------------------------*/
1433 wdiEventData.wdiRequest = WDI_CLOSE_REQ;
1434 wdiEventData.pEventData = NULL;
1435 wdiEventData.uEventDataSize = 0;
1436 wdiEventData.pCBfnc = NULL;
1437 wdiEventData.pUserData = NULL;
1438
1439 gWDIInitialized = eWLAN_PAL_FALSE;
1440
1441 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData);
1442
1443 /*Wait for WCTS to close the control transport
1444 (but only if we were able to reset the event flag*/
1445 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1446 {
1447 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
1448 WDI_WCTS_ACTION_TIMEOUT);
1449 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1450 {
1451 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1452 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1453 }
1454 }
1455
1456 /* Destroy the WCTS action event */
1457 wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent);
1458 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1459 {
1460 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1461 "WDI Close failed to destroy an event");
1462 WDI_ASSERT(0);
1463 }
1464
1465 /* Destroy the Set Power State event */
1466 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1467 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1468 {
1469 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1470 "WDI Close failed to destroy an event");
1471
1472 WDI_ASSERT(0);
1473 }
1474
1475 /*------------------------------------------------------------------------
1476 Closes the Data Path Utility Module
1477 ------------------------------------------------------------------------*/
1478 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1479 {
1480 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1481 "WDI Init failed to close the DP Util Module");
1482
1483 WDI_ASSERT(0);
1484 }
1485
1486 /*destroy the BSS sessions pending Queue */
1487 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1488 {
1489 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1490 }
1491
1492 /* destroy the WDI Pending Assoc Id Request Queue*/
1493 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1494
1495 /* destroy the WDI Pending Request Queue*/
1496 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1497
1498 /*destroy the response timer */
1499 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1500
1501 /*invalidate the main synchro mutex */
1502 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1503 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1504 {
1505 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1506 "Failed to delete mutex %d", wptStatus);
1507 WDI_ASSERT(0);
1508 }
1509
1510 /*Clear control block. note that this will clear the "magic"
1511 which will inhibit all asynchronous callbacks*/
1512 WDI_CleanCB(&gWDICb);
1513
1514 return wptStatus;
1515
1516}/*WDI_Close*/
1517
1518/**
1519 @brief WDI_Shutdown will be called during 'SSR shutdown' operation.
1520 This will do most of the WDI stop & close
1521 operations without doing any handshake with Riva
1522
1523 This will also make sure that the control transport
1524 will NOT be closed.
1525
1526 This request will not be queued.
1527
1528
1529 WDI_Start must have been called.
1530
1531 @param closeTransport: Close control channel if this is set
1532
1533 @return Result of the function call
1534*/
1535WDI_Status
1536WDI_Shutdown
1537(
1538 wpt_boolean closeTransport
1539)
1540{
1541 WDI_EventInfoType wdiEventData;
1542 wpt_status wptStatus;
1543 int i = 0;
1544 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1545
1546 /*------------------------------------------------------------------------
1547 Sanity Check
1548 ------------------------------------------------------------------------*/
1549 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1550 {
1551 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1552 "WDI API call before module is initialized - Fail request");
1553
1554 return WDI_STATUS_E_NOT_ALLOWED;
1555 }
1556
1557 /*------------------------------------------------------------------------
1558 Fill in Event data and post to the Main FSM
1559 ------------------------------------------------------------------------*/
1560 wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ;
1561 wdiEventData.pEventData = NULL;
1562 wdiEventData.uEventDataSize = 0;
1563
1564 /* Shutdown will not be queued, if the state is busy timer will be
1565 * stopped & this message will be processed.*/
1566 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData);
1567 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1568 {
1569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1570 "%s: Failed to process shutdown event", __FUNCTION__);
1571 }
1572 /* Destroy the Set Power State event */
1573 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1574 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1575 {
1576 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1577 "WDI Close failed to destroy an event");
1578
1579 WDI_ASSERT(0);
1580 }
1581 /*------------------------------------------------------------------------
1582 Closes the Data Path Utility Module
1583 ------------------------------------------------------------------------*/
1584 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1585 {
1586 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1587 "WDI Init failed to close the DP Util Module");
1588
1589 WDI_ASSERT(0);
1590 }
1591 if ( closeTransport )
1592 {
1593 /* Close control transport, called from module unload */
1594 WCTS_CloseTransport(gWDICb.wctsHandle);
1595 }
1596
1597 /*destroy the BSS sessions pending Queue */
1598 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1599 {
1600 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1601 }
1602
1603 /* destroy the WDI Pending Assoc Id Request Queue*/
1604 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1605 /* destroy the WDI Pending Request Queue*/
1606 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1607 /*destroy the response timer */
1608 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1609
1610 /*invalidate the main synchro mutex */
1611 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1612 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1613 {
1614 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1615 "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus);
1616 WDI_ASSERT(0);
1617 }
1618
1619 /*Clear control block. note that this will clear the "magic"
1620 which will inhibit all asynchronous callbacks*/
1621 WDI_CleanCB(&gWDICb);
1622 return wptStatus;
1623
1624}/*WDI_Shutdown*/
1625
1626
1627/*========================================================================
1628
1629 SCAN APIs
1630
1631==========================================================================*/
1632
1633/**
1634 @brief WDI_InitScanReq will be called when the upper MAC wants
1635 the WLAN Device to get ready for a scan procedure. Upon
1636 the call of this API the WLAN DAL will pack and send a
1637 HAL Init Scan request message to the lower RIVA
1638 sub-system if DAL is in state STARTED.
1639
1640 In state BUSY this request will be queued. Request won't
1641 be allowed in any other state.
1642
1643 WDI_Start must have been called.
1644
1645 @param wdiInitScanParams: the init scan parameters as specified
1646 by the Device Interface
1647
1648 wdiInitScanRspCb: callback for passing back the response
1649 of the init scan operation received from the device
1650
1651 pUserData: user data will be passed back with the
1652 callback
1653
1654 @see WDI_Start
1655 @return Result of the function call
1656*/
1657WDI_Status
1658WDI_InitScanReq
1659(
1660 WDI_InitScanReqParamsType* pwdiInitScanParams,
1661 WDI_InitScanRspCb wdiInitScanRspCb,
1662 void* pUserData
1663)
1664{
1665 WDI_EventInfoType wdiEventData;
1666 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1667
1668 /*------------------------------------------------------------------------
1669 Sanity Check
1670 ------------------------------------------------------------------------*/
1671 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1672 {
1673 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1674 "WDI API call before module is initialized - Fail request");
1675
1676 return WDI_STATUS_E_NOT_ALLOWED;
1677 }
1678
1679 /*------------------------------------------------------------------------
1680 Fill in Event data and post to the Main FSM
1681 ------------------------------------------------------------------------*/
1682 wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ;
1683 wdiEventData.pEventData = pwdiInitScanParams;
1684 wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams);
1685 wdiEventData.pCBfnc = wdiInitScanRspCb;
1686 wdiEventData.pUserData = pUserData;
1687
1688 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1689
1690}/*WDI_InitScanReq*/
1691
1692/**
1693 @brief WDI_StartScanReq will be called when the upper MAC
1694 wishes to change the Scan channel on the WLAN Device.
1695 Upon the call of this API the WLAN DAL will pack and
1696 send a HAL Start Scan request message to the lower RIVA
1697 sub-system if DAL is in state STARTED.
1698
1699 In state BUSY this request will be queued. Request won't
1700 be allowed in any other state.
1701
1702 WDI_InitScanReq must have been called.
1703
1704 @param wdiStartScanParams: the start scan parameters as
1705 specified by the Device Interface
1706
1707 wdiStartScanRspCb: callback for passing back the
1708 response of the start scan operation received from the
1709 device
1710
1711 pUserData: user data will be passed back with the
1712 callback
1713
1714 @see WDI_InitScanReq
1715 @return Result of the function call
1716*/
1717WDI_Status
1718WDI_StartScanReq
1719(
1720 WDI_StartScanReqParamsType* pwdiStartScanParams,
1721 WDI_StartScanRspCb wdiStartScanRspCb,
1722 void* pUserData
1723)
1724{
1725 WDI_EventInfoType wdiEventData;
1726 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1727
1728 /*------------------------------------------------------------------------
1729 Sanity Check
1730 ------------------------------------------------------------------------*/
1731 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1732 {
1733 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1734 "WDI API call before module is initialized - Fail request");
1735
1736 return WDI_STATUS_E_NOT_ALLOWED;
1737 }
1738
1739 /*------------------------------------------------------------------------
1740 Fill in Event data and post to the Main FSM
1741 ------------------------------------------------------------------------*/
1742 wdiEventData.wdiRequest = WDI_START_SCAN_REQ;
1743 wdiEventData.pEventData = pwdiStartScanParams;
1744 wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams);
1745 wdiEventData.pCBfnc = wdiStartScanRspCb;
1746 wdiEventData.pUserData = pUserData;
1747
1748 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1749
1750}/*WDI_StartScanReq*/
1751
1752
1753/**
1754 @brief WDI_EndScanReq will be called when the upper MAC is
1755 wants to end scanning for a particular channel that it
1756 had set before by calling Scan Start on the WLAN Device.
1757 Upon the call of this API the WLAN DAL will pack and
1758 send a HAL End Scan request message to the lower RIVA
1759 sub-system if DAL is in state STARTED.
1760
1761 In state BUSY this request will be queued. Request won't
1762 be allowed in any other state.
1763
1764 WDI_StartScanReq must have been called.
1765
1766 @param wdiEndScanParams: the end scan parameters as specified
1767 by the Device Interface
1768
1769 wdiEndScanRspCb: callback for passing back the response
1770 of the end scan operation received from the device
1771
1772 pUserData: user data will be passed back with the
1773 callback
1774
1775 @see WDI_StartScanReq
1776 @return Result of the function call
1777*/
1778WDI_Status
1779WDI_EndScanReq
1780(
1781 WDI_EndScanReqParamsType* pwdiEndScanParams,
1782 WDI_EndScanRspCb wdiEndScanRspCb,
1783 void* pUserData
1784)
1785{
1786 WDI_EventInfoType wdiEventData;
1787 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1788
1789 /*------------------------------------------------------------------------
1790 Sanity Check
1791 ------------------------------------------------------------------------*/
1792 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1793 {
1794 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1795 "WDI API call before module is initialized - Fail request");
1796
1797 return WDI_STATUS_E_NOT_ALLOWED;
1798 }
1799
1800 /*------------------------------------------------------------------------
1801 Fill in Event data and post to the Main FSM
1802 ------------------------------------------------------------------------*/
1803 wdiEventData.wdiRequest = WDI_END_SCAN_REQ;
1804 wdiEventData.pEventData = pwdiEndScanParams;
1805 wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams);
1806 wdiEventData.pCBfnc = wdiEndScanRspCb;
1807 wdiEventData.pUserData = pUserData;
1808
1809 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1810
1811}/*WDI_EndScanReq*/
1812
1813
1814/**
1815 @brief WDI_FinishScanReq will be called when the upper MAC has
1816 completed the scan process on the WLAN Device. Upon the
1817 call of this API the WLAN DAL will pack and send a HAL
1818 Finish Scan Request request message to the lower RIVA
1819 sub-system if DAL is in state STARTED.
1820
1821 In state BUSY this request will be queued. Request won't
1822 be allowed in any other state.
1823
1824 WDI_InitScanReq must have been called.
1825
1826 @param wdiFinishScanParams: the finish scan parameters as
1827 specified by the Device Interface
1828
1829 wdiFinishScanRspCb: callback for passing back the
1830 response of the finish scan operation received from the
1831 device
1832
1833 pUserData: user data will be passed back with the
1834 callback
1835
1836 @see WDI_InitScanReq
1837 @return Result of the function call
1838*/
1839WDI_Status
1840WDI_FinishScanReq
1841(
1842 WDI_FinishScanReqParamsType* pwdiFinishScanParams,
1843 WDI_FinishScanRspCb wdiFinishScanRspCb,
1844 void* pUserData
1845)
1846{
1847 WDI_EventInfoType wdiEventData;
1848 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1849
1850 /*------------------------------------------------------------------------
1851 Sanity Check
1852 ------------------------------------------------------------------------*/
1853 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1854 {
1855 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1856 "WDI API call before module is initialized - Fail request");
1857
1858 return WDI_STATUS_E_NOT_ALLOWED;
1859 }
1860
1861 /*------------------------------------------------------------------------
1862 Fill in Event data and post to the Main FSM
1863 ------------------------------------------------------------------------*/
1864 wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ;
1865 wdiEventData.pEventData = pwdiFinishScanParams;
1866 wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams);
1867 wdiEventData.pCBfnc = wdiFinishScanRspCb;
1868 wdiEventData.pUserData = pUserData;
1869
1870 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1871
1872}/*WDI_FinishScanReq*/
1873
1874/*========================================================================
1875
1876 ASSOCIATION APIs
1877
1878==========================================================================*/
1879
1880/**
1881 @brief WDI_JoinReq will be called when the upper MAC is ready
1882 to start an association procedure to a BSS. Upon the
1883 call of this API the WLAN DAL will pack and send a HAL
1884 Join request message to the lower RIVA sub-system if
1885 DAL is in state STARTED.
1886
1887 In state BUSY this request will be queued. Request won't
1888 be allowed in any other state.
1889
1890 WDI_Start must have been called.
1891
1892 @param wdiJoinParams: the join parameters as specified by
1893 the Device Interface
1894
1895 wdiJoinRspCb: callback for passing back the response of
1896 the join operation received from the device
1897
1898 pUserData: user data will be passed back with the
1899 callback
1900
1901 @see WDI_Start
1902 @return Result of the function call
1903*/
1904WDI_Status
1905WDI_JoinReq
1906(
1907 WDI_JoinReqParamsType* pwdiJoinParams,
1908 WDI_JoinRspCb wdiJoinRspCb,
1909 void* pUserData
1910)
1911{
1912 WDI_EventInfoType wdiEventData;
1913 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1914
1915 /*------------------------------------------------------------------------
1916 Sanity Check
1917 ------------------------------------------------------------------------*/
1918 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1919 {
1920 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1921 "WDI API call before module is initialized - Fail request");
1922
1923 return WDI_STATUS_E_NOT_ALLOWED;
1924 }
1925
1926 /*------------------------------------------------------------------------
1927 Fill in Event data and post to the Main FSM
1928 ------------------------------------------------------------------------*/
1929 wdiEventData.wdiRequest = WDI_JOIN_REQ;
1930 wdiEventData.pEventData = pwdiJoinParams;
1931 wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams);
1932 wdiEventData.pCBfnc = wdiJoinRspCb;
1933 wdiEventData.pUserData = pUserData;
1934
1935 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1936
1937}/*WDI_JoinReq*/
1938
1939/**
1940 @brief WDI_ConfigBSSReq will be called when the upper MAC
1941 wishes to configure the newly acquired or in process of
1942 being acquired BSS to the HW . Upon the call of this API
1943 the WLAN DAL will pack and send a HAL Config BSS request
1944 message to the lower RIVA sub-system if DAL is in state
1945 STARTED.
1946
1947 In state BUSY this request will be queued. Request won't
1948 be allowed in any other state.
1949
1950 WDI_JoinReq must have been called.
1951
1952 @param wdiConfigBSSParams: the config BSS parameters as
1953 specified by the Device Interface
1954
1955 wdiConfigBSSRspCb: callback for passing back the
1956 response of the config BSS operation received from the
1957 device
1958
1959 pUserData: user data will be passed back with the
1960 callback
1961
1962 @see WDI_JoinReq
1963 @return Result of the function call
1964*/
1965WDI_Status
1966WDI_ConfigBSSReq
1967(
1968 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams,
1969 WDI_ConfigBSSRspCb wdiConfigBSSRspCb,
1970 void* pUserData
1971)
1972{
1973 WDI_EventInfoType wdiEventData;
1974 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1975
1976 /*------------------------------------------------------------------------
1977 Sanity Check
1978 ------------------------------------------------------------------------*/
1979 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1980 {
1981 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1982 "WDI API call before module is initialized - Fail request");
1983
1984 return WDI_STATUS_E_NOT_ALLOWED;
1985 }
1986
1987 /*------------------------------------------------------------------------
1988 Fill in Event data and post to the Main FSM
1989 ------------------------------------------------------------------------*/
1990 wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ;
1991 wdiEventData.pEventData = pwdiConfigBSSParams;
1992 wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams);
1993 wdiEventData.pCBfnc = wdiConfigBSSRspCb;
1994 wdiEventData.pUserData = pUserData;
1995
1996 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1997
1998}/*WDI_ConfigBSSReq*/
1999
2000/**
2001 @brief WDI_DelBSSReq will be called when the upper MAC is
2002 disassociating from the BSS and wishes to notify HW.
2003 Upon the call of this API the WLAN DAL will pack and
2004 send a HAL Del BSS request message to the lower RIVA
2005 sub-system if DAL is in state STARTED.
2006
2007 In state BUSY this request will be queued. Request won't
2008 be allowed in any other state.
2009
2010 WDI_ConfigBSSReq or WDI_PostAssocReq must have been called.
2011
2012 @param wdiDelBSSParams: the del BSS parameters as specified by
2013 the Device Interface
2014
2015 wdiDelBSSRspCb: callback for passing back the response
2016 of the del bss operation received from the device
2017
2018 pUserData: user data will be passed back with the
2019 callback
2020
2021 @see WDI_ConfigBSSReq, WDI_PostAssocReq
2022 @return Result of the function call
2023*/
2024WDI_Status
2025WDI_DelBSSReq
2026(
2027 WDI_DelBSSReqParamsType* pwdiDelBSSParams,
2028 WDI_DelBSSRspCb wdiDelBSSRspCb,
2029 void* pUserData
2030)
2031{
2032 WDI_EventInfoType wdiEventData;
2033 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2034
2035 /*------------------------------------------------------------------------
2036 Sanity Check
2037 ------------------------------------------------------------------------*/
2038 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2039 {
2040 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2041 "WDI API call before module is initialized - Fail request");
2042
2043 return WDI_STATUS_E_NOT_ALLOWED;
2044 }
2045
2046 /*------------------------------------------------------------------------
2047 Fill in Event data and post to the Main FSM
2048 ------------------------------------------------------------------------*/
2049 wdiEventData.wdiRequest = WDI_DEL_BSS_REQ;
2050 wdiEventData.pEventData = pwdiDelBSSParams;
2051 wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams);
2052 wdiEventData.pCBfnc = wdiDelBSSRspCb;
2053 wdiEventData.pUserData = pUserData;
2054
2055 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2056
2057}/*WDI_DelBSSReq*/
2058
2059/**
2060 @brief WDI_PostAssocReq will be called when the upper MAC has
2061 associated to a BSS and wishes to configure HW for
2062 associated state. Upon the call of this API the WLAN DAL
2063 will pack and send a HAL Post Assoc request message to
2064 the lower RIVA sub-system if DAL is in state STARTED.
2065
2066 In state BUSY this request will be queued. Request won't
2067 be allowed in any other state.
2068
2069 WDI_JoinReq must have been called.
2070
2071 @param wdiPostAssocReqParams: the assoc parameters as specified
2072 by the Device Interface
2073
2074 wdiPostAssocRspCb: callback for passing back the
2075 response of the post assoc operation received from the
2076 device
2077
2078 pUserData: user data will be passed back with the
2079 callback
2080
2081 @see WDI_JoinReq
2082 @return Result of the function call
2083*/
2084WDI_Status
2085WDI_PostAssocReq
2086(
2087 WDI_PostAssocReqParamsType* pwdiPostAssocReqParams,
2088 WDI_PostAssocRspCb wdiPostAssocRspCb,
2089 void* pUserData
2090)
2091{
2092 WDI_EventInfoType wdiEventData;
2093 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2094
2095 /*------------------------------------------------------------------------
2096 Sanity Check
2097 ------------------------------------------------------------------------*/
2098 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2099 {
2100 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2101 "WDI API call before module is initialized - Fail request");
2102
2103 return WDI_STATUS_E_NOT_ALLOWED;
2104 }
2105
2106 /*------------------------------------------------------------------------
2107 Fill in Event data and post to the Main FSM
2108 ------------------------------------------------------------------------*/
2109 wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ;
2110 wdiEventData.pEventData = pwdiPostAssocReqParams;
2111 wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams);
2112 wdiEventData.pCBfnc = wdiPostAssocRspCb;
2113 wdiEventData.pUserData = pUserData;
2114
2115 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2116
2117}/*WDI_PostAssocReq*/
2118
2119/**
2120 @brief WDI_DelSTAReq will be called when the upper MAC when an
2121 association with another STA has ended and the station
2122 must be deleted from HW. Upon the call of this API the
2123 WLAN DAL will pack and send a HAL Del STA request
2124 message to the lower RIVA sub-system if DAL is in state
2125 STARTED.
2126
2127 In state BUSY this request will be queued. Request won't
2128 be allowed in any other state.
2129
2130 WDI_PostAssocReq must have been called.
2131
2132 @param wdiDelSTAParams: the Del STA parameters as specified by
2133 the Device Interface
2134
2135 wdiDelSTARspCb: callback for passing back the response
2136 of the del STA operation received from the device
2137
2138 pUserData: user data will be passed back with the
2139 callback
2140
2141 @see WDI_PostAssocReq
2142 @return Result of the function call
2143*/
2144WDI_Status
2145WDI_DelSTAReq
2146(
2147 WDI_DelSTAReqParamsType* pwdiDelSTAParams,
2148 WDI_DelSTARspCb wdiDelSTARspCb,
2149 void* pUserData
2150)
2151{
2152 WDI_EventInfoType wdiEventData;
2153 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2154
2155 /*------------------------------------------------------------------------
2156 Sanity Check
2157 ------------------------------------------------------------------------*/
2158 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2159 {
2160 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2161 "WDI API call before module is initialized - Fail request");
2162
2163 return WDI_STATUS_E_NOT_ALLOWED;
2164 }
2165
2166 /*------------------------------------------------------------------------
2167 Fill in Event data and post to the Main FSM
2168 ------------------------------------------------------------------------*/
2169 wdiEventData.wdiRequest = WDI_DEL_STA_REQ;
2170 wdiEventData.pEventData = pwdiDelSTAParams;
2171 wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams);
2172 wdiEventData.pCBfnc = wdiDelSTARspCb;
2173 wdiEventData.pUserData = pUserData;
2174
2175 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2176
2177}/*WDI_DelSTAReq*/
2178
2179/*========================================================================
2180
2181 SECURITY APIs
2182
2183==========================================================================*/
2184
2185/**
2186 @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to
2187 install a BSS encryption key on the HW. Upon the call of this
2188 API the WLAN DAL will pack and send a Set BSS Key request
2189 message to the lower RIVA sub-system if DAL is in state
2190 STARTED.
2191
2192 In state BUSY this request will be queued. Request won't
2193 be allowed in any other state.
2194
2195 WDI_PostAssocReq must have been called.
2196
2197 @param wdiSetBSSKeyParams: the BSS Key set parameters as
2198 specified by the Device Interface
2199
2200 wdiSetBSSKeyRspCb: callback for passing back the
2201 response of the set BSS Key operation received from the
2202 device
2203
2204 pUserData: user data will be passed back with the
2205 callback
2206
2207 @see WDI_PostAssocReq
2208 @return Result of the function call
2209*/
2210WDI_Status
2211WDI_SetBSSKeyReq
2212(
2213 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams,
2214 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb,
2215 void* pUserData
2216)
2217{
2218 WDI_EventInfoType wdiEventData;
2219 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2220
2221 /*------------------------------------------------------------------------
2222 Sanity Check
2223 ------------------------------------------------------------------------*/
2224 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2225 {
2226 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2227 "WDI API call before module is initialized - Fail request");
2228
2229 return WDI_STATUS_E_NOT_ALLOWED;
2230 }
2231
2232 /*------------------------------------------------------------------------
2233 Fill in Event data and post to the Main FSM
2234 ------------------------------------------------------------------------*/
2235 wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ;
2236 wdiEventData.pEventData = pwdiSetBSSKeyParams;
2237 wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams);
2238 wdiEventData.pCBfnc = wdiSetBSSKeyRspCb;
2239 wdiEventData.pUserData = pUserData;
2240
2241 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2242
2243}/*WDI_SetBSSKeyReq*/
2244
2245/**
2246 @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to
2247 uninstall a BSS key from HW. Upon the call of this API the
2248 WLAN DAL will pack and send a HAL Remove BSS Key request
2249 message to the lower RIVA sub-system if DAL is in state
2250 STARTED.
2251
2252 In state BUSY this request will be queued. Request won't
2253 be allowed in any other state.
2254
2255 WDI_SetBSSKeyReq must have been called.
2256
2257 @param wdiRemoveBSSKeyParams: the remove BSS key parameters as
2258 specified by the Device Interface
2259
2260 wdiRemoveBSSKeyRspCb: callback for passing back the
2261 response of the remove BSS key operation received from
2262 the device
2263
2264 pUserData: user data will be passed back with the
2265 callback
2266
2267 @see WDI_SetBSSKeyReq
2268 @return Result of the function call
2269*/
2270WDI_Status
2271WDI_RemoveBSSKeyReq
2272(
2273 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams,
2274 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb,
2275 void* pUserData
2276)
2277{
2278 WDI_EventInfoType wdiEventData;
2279 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2280
2281 /*------------------------------------------------------------------------
2282 Sanity Check
2283 ------------------------------------------------------------------------*/
2284 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2285 {
2286 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2287 "WDI API call before module is initialized - Fail request");
2288
2289 return WDI_STATUS_E_NOT_ALLOWED;
2290 }
2291
2292 /*------------------------------------------------------------------------
2293 Fill in Event data and post to the Main FSM
2294 ------------------------------------------------------------------------*/
2295 wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ;
2296 wdiEventData.pEventData = pwdiRemoveBSSKeyParams;
2297 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams);
2298 wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb;
2299 wdiEventData.pUserData = pUserData;
2300
2301 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2302
2303}/*WDI_RemoveBSSKeyReq*/
2304
2305
2306/**
2307 @brief WDI_SetSTAKeyReq will be called when the upper MAC is
2308 ready to install a STA(ast) encryption key in HW. Upon
2309 the call of this API the WLAN DAL will pack and send a
2310 HAL Set STA Key request message to the lower RIVA
2311 sub-system if DAL is in state STARTED.
2312
2313 In state BUSY this request will be queued. Request won't
2314 be allowed in any other state.
2315
2316 WDI_PostAssocReq must have been called.
2317
2318 @param wdiSetSTAKeyParams: the set STA key parameters as
2319 specified by the Device Interface
2320
2321 wdiSetSTAKeyRspCb: callback for passing back the
2322 response of the set STA key operation received from the
2323 device
2324
2325 pUserData: user data will be passed back with the
2326 callback
2327
2328 @see WDI_PostAssocReq
2329 @return Result of the function call
2330*/
2331WDI_Status
2332WDI_SetSTAKeyReq
2333(
2334 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams,
2335 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb,
2336 void* pUserData
2337)
2338{
2339 WDI_EventInfoType wdiEventData;
2340 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2341
2342 /*------------------------------------------------------------------------
2343 Sanity Check
2344 ------------------------------------------------------------------------*/
2345 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2346 {
2347 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2348 "WDI API call before module is initialized - Fail request");
2349
2350 return WDI_STATUS_E_NOT_ALLOWED;
2351 }
2352
2353 /*------------------------------------------------------------------------
2354 Fill in Event data and post to the Main FSM
2355 ------------------------------------------------------------------------*/
2356 wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ;
2357 wdiEventData.pEventData = pwdiSetSTAKeyParams;
2358 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams);
2359 wdiEventData.pCBfnc = wdiSetSTAKeyRspCb;
2360 wdiEventData.pUserData = pUserData;
2361
2362 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2363
2364}/*WDI_SetSTAKeyReq*/
2365
2366
2367/**
2368 @brief WDI_RemoveSTAKeyReq will be called when the upper MAC
2369 wants to uninstall a previously set STA key in HW. Upon
2370 the call of this API the WLAN DAL will pack and send a
2371 HAL Remove STA Key request message to the lower RIVA
2372 sub-system if DAL is in state STARTED.
2373
2374 In state BUSY this request will be queued. Request won't
2375 be allowed in any other state.
2376
2377 WDI_SetSTAKeyReq must have been called.
2378
2379 @param wdiRemoveSTAKeyParams: the remove STA key parameters as
2380 specified by the Device Interface
2381
2382 wdiRemoveSTAKeyRspCb: callback for passing back the
2383 response of the remove STA key operation received from
2384 the device
2385
2386 pUserData: user data will be passed back with the
2387 callback
2388
2389 @see WDI_SetSTAKeyReq
2390 @return Result of the function call
2391*/
2392WDI_Status
2393WDI_RemoveSTAKeyReq
2394(
2395 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams,
2396 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb,
2397 void* pUserData
2398)
2399{
2400 WDI_EventInfoType wdiEventData;
2401 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2402
2403 /*------------------------------------------------------------------------
2404 Sanity Check
2405 ------------------------------------------------------------------------*/
2406 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2407 {
2408 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2409 "WDI API call before module is initialized - Fail request");
2410
2411 return WDI_STATUS_E_NOT_ALLOWED;
2412 }
2413
2414 /*------------------------------------------------------------------------
2415 Fill in Event data and post to the Main FSM
2416 ------------------------------------------------------------------------*/
2417 wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ;
2418 wdiEventData.pEventData = pwdiRemoveSTAKeyParams;
2419 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams);
2420 wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb;
2421 wdiEventData.pUserData = pUserData;
2422
2423 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2424
2425}/*WDI_RemoveSTAKeyReq*/
2426
2427
2428/**
2429 @brief WDI_SetSTABcastKeyReq will be called when the upper MAC
2430 wants to install a STA Bcast encryption key on the HW.
2431 Upon the call of this API the WLAN DAL will pack and
2432 send a HAL Start request message to the lower RIVA
2433 sub-system if DAL is in state STARTED.
2434
2435 In state BUSY this request will be queued. Request won't
2436 be allowed in any other state.
2437
2438 WDI_PostAssocReq must have been called.
2439
2440 @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as
2441 specified by the Device Interface
2442
2443 wdiSetSTABcastKeyRspCb: callback for passing back the
2444 response of the set BSS Key operation received from the
2445 device
2446
2447 pUserData: user data will be passed back with the
2448 callback
2449
2450 @see WDI_PostAssocReq
2451 @return Result of the function call
2452*/
2453WDI_Status
2454WDI_SetSTABcastKeyReq
2455(
2456 WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams,
2457 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb,
2458 void* pUserData
2459)
2460
2461{
2462 WDI_EventInfoType wdiEventData;
2463 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2464
2465 /*------------------------------------------------------------------------
2466 Sanity Check
2467 ------------------------------------------------------------------------*/
2468 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2469 {
2470 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2471 "WDI API call before module is initialized - Fail request");
2472
2473 return WDI_STATUS_E_NOT_ALLOWED;
2474 }
2475
2476 /*------------------------------------------------------------------------
2477 Fill in Event data and post to the Main FSM
2478 ------------------------------------------------------------------------*/
2479 wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ;
2480 wdiEventData.pEventData = pwdiSetSTABcastKeyParams;
2481 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams);
2482 wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb;
2483 wdiEventData.pUserData = pUserData;
2484
2485 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2486
2487}/*WDI_SetSTABcastKeyReq*/
2488
2489/**
2490 @brief WDI_RemoveSTABcastKeyReq will be called when the upper
2491 MAC wants to uninstall a STA Bcast key from HW. Upon the
2492 call of this API the WLAN DAL will pack and send a HAL
2493 Remove STA Bcast Key request message to the lower RIVA
2494 sub-system if DAL is in state STARTED.
2495
2496 In state BUSY this request will be queued. Request won't
2497 be allowed in any other state.
2498
2499 WDI_SetSTABcastKeyReq must have been called.
2500
2501 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
2502 parameters as specified by the Device
2503 Interface
2504
2505 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2506 response of the remove STA Bcast key operation received
2507 from the device
2508
2509 pUserData: user data will be passed back with the
2510 callback
2511
2512 @see WDI_SetSTABcastKeyReq
2513 @return Result of the function call
2514*/
2515WDI_Status
2516WDI_RemoveSTABcastKeyReq
2517(
2518 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams,
2519 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb,
2520 void* pUserData
2521)
2522{
2523 WDI_EventInfoType wdiEventData;
2524 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2525
2526 /*------------------------------------------------------------------------
2527 Sanity Check
2528 ------------------------------------------------------------------------*/
2529 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2530 {
2531 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2532 "WDI API call before module is initialized - Fail request");
2533
2534 return WDI_STATUS_E_NOT_ALLOWED;
2535 }
2536
2537 /*------------------------------------------------------------------------
2538 Fill in Event data and post to the Main FSM
2539 ------------------------------------------------------------------------*/
2540 wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ;
2541 wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams;
2542 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams);
2543 wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb;
2544 wdiEventData.pUserData = pUserData;
2545
2546 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2547
2548}/*WDI_RemoveSTABcastKeyReq*/
2549
2550/**
2551 @brief WDI_SetMaxTxPowerReq will be called when the upper
2552 MAC wants to set Max Tx Power to HW. Upon the
2553 call of this API the WLAN DAL will pack and send a HAL
2554 Remove STA Bcast Key request message to the lower RIVA
2555 sub-system if DAL is in state STARTED.
2556
2557 In state BUSY this request will be queued. Request won't
2558 be allowed in any other state.
2559
2560 WDI_SetSTABcastKeyReq must have been called.
2561
2562 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
2563 parameters as specified by the Device
2564 Interface
2565
2566 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2567 response of the remove STA Bcast key operation received
2568 from the device
2569
2570 pUserData: user data will be passed back with the
2571 callback
2572
2573 @see WDI_SetMaxTxPowerReq
2574 @return Result of the function call
2575*/
2576WDI_Status
2577WDI_SetMaxTxPowerReq
2578(
2579 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams,
2580 WDA_SetMaxTxPowerRspCb wdiReqStatusCb,
2581 void* pUserData
2582)
2583{
2584 WDI_EventInfoType wdiEventData;
2585 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2586
2587 /*------------------------------------------------------------------------
2588 Sanity Check
2589 ------------------------------------------------------------------------*/
2590 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2591 {
2592 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2593 "WDI API call before module is initialized - Fail request");
2594
2595 return WDI_STATUS_E_NOT_ALLOWED;
2596 }
2597
2598 /*------------------------------------------------------------------------
2599 Fill in Event data and post to the Main FSM
2600 ------------------------------------------------------------------------*/
2601 wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ;
2602 wdiEventData.pEventData = pwdiSetMaxTxPowerParams;
2603 wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams);
2604 wdiEventData.pCBfnc = wdiReqStatusCb;
2605 wdiEventData.pUserData = pUserData;
2606
2607 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2608}
2609
2610#ifdef FEATURE_WLAN_CCX
2611WDI_Status
2612WDI_TSMStatsReq
2613(
2614 WDI_TSMStatsReqParamsType* pwdiTsmReqParams,
2615 WDI_TsmRspCb wdiReqStatusCb,
2616 void* pUserData
2617)
2618{
2619 WDI_EventInfoType wdiEventData;
2620 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2621
2622 /*------------------------------------------------------------------------
2623 Sanity Check
2624 ------------------------------------------------------------------------*/
2625 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2626 {
2627 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2628 "WDI API call before module is initialized - Fail request");
2629
2630 return WDI_STATUS_E_NOT_ALLOWED;
2631 }
2632
2633 /*------------------------------------------------------------------------
2634 Fill in Event data and post to the Main FSM
2635 ------------------------------------------------------------------------*/
2636 wdiEventData.wdiRequest = WDI_TSM_STATS_REQ;
2637 wdiEventData.pEventData = pwdiTsmReqParams;
2638 wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams);
2639 wdiEventData.pCBfnc = wdiReqStatusCb;
2640 wdiEventData.pUserData = pUserData;
2641
2642 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2643
2644}
2645#endif
2646
2647/*========================================================================
2648
2649 QoS and BA APIs
2650
2651==========================================================================*/
2652
2653/**
2654 @brief WDI_AddTSReq will be called when the upper MAC to inform
2655 the device of a successful add TSpec negotiation. HW
2656 needs to receive the TSpec Info from the UMAC in order
2657 to configure properly the QoS data traffic. Upon the
2658 call of this API the WLAN DAL will pack and send a HAL
2659 Add TS request message to the lower RIVA sub-system if
2660 DAL is in state STARTED.
2661
2662 In state BUSY this request will be queued. Request won't
2663 be allowed in any other state.
2664
2665 WDI_PostAssocReq must have been called.
2666
2667 @param wdiAddTsReqParams: the add TS parameters as specified by
2668 the Device Interface
2669
2670 wdiAddTsRspCb: callback for passing back the response of
2671 the add TS operation received from the device
2672
2673 pUserData: user data will be passed back with the
2674 callback
2675
2676 @see WDI_PostAssocReq
2677 @return Result of the function call
2678*/
2679WDI_Status
2680WDI_AddTSReq
2681(
2682 WDI_AddTSReqParamsType* pwdiAddTsReqParams,
2683 WDI_AddTsRspCb wdiAddTsRspCb,
2684 void* pUserData
2685)
2686{
2687 WDI_EventInfoType wdiEventData;
2688 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2689
2690 /*------------------------------------------------------------------------
2691 Sanity Check
2692 ------------------------------------------------------------------------*/
2693 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2694 {
2695 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2696 "WDI API call before module is initialized - Fail request");
2697
2698 return WDI_STATUS_E_NOT_ALLOWED;
2699 }
2700
2701 /*------------------------------------------------------------------------
2702 Fill in Event data and post to the Main FSM
2703 ------------------------------------------------------------------------*/
2704 wdiEventData.wdiRequest = WDI_ADD_TS_REQ;
2705 wdiEventData.pEventData = pwdiAddTsReqParams;
2706 wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams);
2707 wdiEventData.pCBfnc = wdiAddTsRspCb;
2708 wdiEventData.pUserData = pUserData;
2709
2710 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2711
2712}/*WDI_AddTSReq*/
2713
2714
2715
2716/**
2717 @brief WDI_DelTSReq will be called when the upper MAC has ended
2718 admission on a specific AC. This is to inform HW that
2719 QoS traffic parameters must be rest. Upon the call of
2720 this API the WLAN DAL will pack and send a HAL Del TS
2721 request message to the lower RIVA sub-system if DAL is
2722 in state STARTED.
2723
2724 In state BUSY this request will be queued. Request won't
2725 be allowed in any other state.
2726
2727 WDI_AddTSReq must have been called.
2728
2729 @param wdiDelTsReqParams: the del TS parameters as specified by
2730 the Device Interface
2731
2732 wdiDelTsRspCb: callback for passing back the response of
2733 the del TS operation received from the device
2734
2735 pUserData: user data will be passed back with the
2736 callback
2737
2738 @see WDI_AddTSReq
2739 @return Result of the function call
2740*/
2741WDI_Status
2742WDI_DelTSReq
2743(
2744 WDI_DelTSReqParamsType* pwdiDelTsReqParams,
2745 WDI_DelTsRspCb wdiDelTsRspCb,
2746 void* pUserData
2747)
2748{
2749 WDI_EventInfoType wdiEventData;
2750 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2751
2752 /*------------------------------------------------------------------------
2753 Sanity Check
2754 ------------------------------------------------------------------------*/
2755 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2756 {
2757 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2758 "WDI API call before module is initialized - Fail request");
2759
2760 return WDI_STATUS_E_NOT_ALLOWED;
2761 }
2762
2763 /*------------------------------------------------------------------------
2764 Fill in Event data and post to the Main FSM
2765 ------------------------------------------------------------------------*/
2766 wdiEventData.wdiRequest = WDI_DEL_TS_REQ;
2767 wdiEventData.pEventData = pwdiDelTsReqParams;
2768 wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams);
2769 wdiEventData.pCBfnc = wdiDelTsRspCb;
2770 wdiEventData.pUserData = pUserData;
2771
2772 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2773
2774}/*WDI_DelTSReq*/
2775
2776
2777
2778/**
2779 @brief WDI_UpdateEDCAParams will be called when the upper MAC
2780 wishes to update the EDCA parameters used by HW for QoS
2781 data traffic. Upon the call of this API the WLAN DAL
2782 will pack and send a HAL Update EDCA Params request
2783 message to the lower RIVA sub-system if DAL is in state
2784 STARTED.
2785
2786 In state BUSY this request will be queued. Request won't
2787 be allowed in any other state.
2788
2789 WDI_PostAssocReq must have been called.
2790
2791 @param wdiUpdateEDCAParams: the start parameters as specified
2792 by the Device Interface
2793
2794 wdiUpdateEDCAParamsRspCb: callback for passing back the
2795 response of the start operation received from the device
2796
2797 pUserData: user data will be passed back with the
2798 callback
2799
2800 @see WDI_PostAssocReq
2801 @return Result of the function call
2802*/
2803WDI_Status
2804WDI_UpdateEDCAParams
2805(
2806 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams,
2807 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb,
2808 void* pUserData
2809)
2810{
2811 WDI_EventInfoType wdiEventData;
2812 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2813
2814 /*------------------------------------------------------------------------
2815 Sanity Check
2816 ------------------------------------------------------------------------*/
2817 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2818 {
2819 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2820 "WDI API call before module is initialized - Fail request");
2821
2822 return WDI_STATUS_E_NOT_ALLOWED;
2823 }
2824
2825 /*------------------------------------------------------------------------
2826 Fill in Event data and post to the Main FSM
2827 ------------------------------------------------------------------------*/
2828 wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ;
2829 wdiEventData.pEventData = pwdiUpdateEDCAParams;
2830 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams);
2831 wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb;
2832 wdiEventData.pUserData = pUserData;
2833
2834 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2835
2836}/*WDI_UpdateEDCAParams*/
2837
2838
2839/**
2840 @brief WDI_AddBASessionReq will be called when the upper MAC has setup
2841 successfully a BA session and needs to notify the HW for
2842 the appropriate settings to take place. Upon the call of
2843 this API the WLAN DAL will pack and send a HAL Add BA
2844 request message to the lower RIVA sub-system if DAL is
2845 in state STARTED.
2846
2847 In state BUSY this request will be queued. Request won't
2848 be allowed in any other state.
2849
2850 WDI_PostAssocReq must have been called.
2851
2852 @param wdiAddBAReqParams: the add BA parameters as specified by
2853 the Device Interface
2854
2855 wdiAddBARspCb: callback for passing back the response of
2856 the add BA operation received from the device
2857
2858 pUserData: user data will be passed back with the
2859 callback
2860
2861 @see WDI_PostAssocReq
2862 @return Result of the function call
2863*/
2864WDI_Status
2865WDI_AddBASessionReq
2866(
2867 WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams,
2868 WDI_AddBASessionRspCb wdiAddBASessionRspCb,
2869 void* pUserData
2870)
2871{
2872 WDI_EventInfoType wdiEventData;
2873 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2874
2875 /*------------------------------------------------------------------------
2876 Sanity Check
2877 ------------------------------------------------------------------------*/
2878 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2879 {
2880 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2881 "WDI API call before module is initialized - Fail request");
2882
2883 return WDI_STATUS_E_NOT_ALLOWED;
2884 }
2885
2886 /*------------------------------------------------------------------------
2887 Fill in Event data and post to the Main FSM
2888 ------------------------------------------------------------------------*/
2889 wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ;
2890 wdiEventData.pEventData = pwdiAddBASessionReqParams;
2891 wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams);
2892 wdiEventData.pCBfnc = wdiAddBASessionRspCb;
2893 wdiEventData.pUserData = pUserData;
2894
2895 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2896
2897}/*WDI_AddBASessionReq*/
2898
2899/**
2900 @brief WDI_DelBAReq will be called when the upper MAC wants to
2901 inform HW that it has deleted a previously created BA
2902 session. Upon the call of this API the WLAN DAL will
2903 pack and send a HAL Del BA request message to the lower
2904 RIVA sub-system if DAL is in state STARTED.
2905
2906 In state BUSY this request will be queued. Request won't
2907 be allowed in any other state.
2908
2909 WDI_AddBAReq must have been called.
2910
2911 @param wdiDelBAReqParams: the del BA parameters as specified by
2912 the Device Interface
2913
2914 wdiDelBARspCb: callback for passing back the response of
2915 the del BA operation received from the device
2916
2917 pUserData: user data will be passed back with the
2918 callback
2919
2920 @see WDI_AddBAReq
2921 @return Result of the function call
2922*/
2923WDI_Status
2924WDI_DelBAReq
2925(
2926 WDI_DelBAReqParamsType* pwdiDelBAReqParams,
2927 WDI_DelBARspCb wdiDelBARspCb,
2928 void* pUserData
2929)
2930{
2931 WDI_EventInfoType wdiEventData;
2932 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2933
2934 /*------------------------------------------------------------------------
2935 Sanity Check
2936 ------------------------------------------------------------------------*/
2937 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2938 {
2939 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2940 "WDI API call before module is initialized - Fail request");
2941
2942 return WDI_STATUS_E_NOT_ALLOWED;
2943 }
2944
2945 /*------------------------------------------------------------------------
2946 Fill in Event data and post to the Main FSM
2947 ------------------------------------------------------------------------*/
2948 wdiEventData.wdiRequest = WDI_DEL_BA_REQ;
2949 wdiEventData.pEventData = pwdiDelBAReqParams;
2950 wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams);
2951 wdiEventData.pCBfnc = wdiDelBARspCb;
2952 wdiEventData.pUserData = pUserData;
2953
2954 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2955
2956}/*WDI_DelBAReq*/
2957
2958/*========================================================================
2959
2960 Power Save APIs
2961
2962==========================================================================*/
2963
2964/**
2965 @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC
2966 wants to set the power save related configurations of
2967 the WLAN Device. Upon the call of this API the WLAN DAL
2968 will pack and send a HAL Update CFG request message to
2969 the lower RIVA sub-system if DAL is in state STARTED.
2970
2971 In state BUSY this request will be queued. Request won't
2972 be allowed in any other state.
2973
2974 WDI_Start must have been called.
2975
2976 @param pwdiPowerSaveCfg: the power save cfg parameters as
2977 specified by the Device Interface
2978
2979 wdiSetPwrSaveCfgCb: callback for passing back the
2980 response of the set power save cfg operation received
2981 from the device
2982
2983 pUserData: user data will be passed back with the
2984 callback
2985
2986 @see WDI_Start
2987 @return Result of the function call
2988*/
2989WDI_Status
2990WDI_SetPwrSaveCfgReq
2991(
2992 WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg,
2993 WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb,
2994 void* pUserData
2995)
2996{
2997 WDI_EventInfoType wdiEventData;
2998 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2999
3000 /*------------------------------------------------------------------------
3001 Sanity Check
3002 ------------------------------------------------------------------------*/
3003 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3004 {
3005 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3006 "WDI API call before module is initialized - Fail request");
3007
3008 return WDI_STATUS_E_NOT_ALLOWED;
3009 }
3010
3011 /*------------------------------------------------------------------------
3012 Fill in Event data and post to the Main FSM
3013 ------------------------------------------------------------------------*/
3014 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
3015 wdiEventData.pEventData = pwdiPowerSaveCfg;
3016 wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg);
3017 wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb;
3018 wdiEventData.pUserData = pUserData;
3019
3020 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3021
3022}/*WDI_SetPwrSaveCfgReq*/
3023
3024/**
3025 @brief WDI_EnterImpsReq will be called when the upper MAC to
3026 request the device to get into IMPS power state. Upon
3027 the call of this API the WLAN DAL will send a HAL Enter
3028 IMPS request message to the lower RIVA sub-system if DAL
3029 is in state STARTED.
3030
3031 In state BUSY this request will be queued. Request won't
3032 be allowed in any other state.
3033
3034
3035 @param wdiEnterImpsRspCb: callback for passing back the
3036 response of the Enter IMPS operation received from the
3037 device
3038
3039 pUserData: user data will be passed back with the
3040 callback
3041
3042 @see WDI_Start
3043 @return Result of the function call
3044*/
3045WDI_Status
3046WDI_EnterImpsReq
3047(
3048 WDI_EnterImpsRspCb wdiEnterImpsRspCb,
3049 void* pUserData
3050)
3051{
3052 WDI_EventInfoType wdiEventData;
3053 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3054
3055 /*------------------------------------------------------------------------
3056 Sanity Check
3057 ------------------------------------------------------------------------*/
3058 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3059 {
3060 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3061 "WDI API call before module is initialized - Fail request");
3062
3063 return WDI_STATUS_E_NOT_ALLOWED;
3064 }
3065
3066 /*------------------------------------------------------------------------
3067 Fill in Event data and post to the Main FSM
3068 ------------------------------------------------------------------------*/
3069 wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ;
3070 wdiEventData.pEventData = NULL;
3071 wdiEventData.uEventDataSize = 0;
3072 wdiEventData.pCBfnc = wdiEnterImpsRspCb;
3073 wdiEventData.pUserData = pUserData;
3074
3075 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3076
3077}/*WDI_EnterImpsReq*/
3078
3079/**
3080 @brief WDI_ExitImpsReq will be called when the upper MAC to
3081 request the device to get out of IMPS power state. Upon
3082 the call of this API the WLAN DAL will send a HAL Exit
3083 IMPS request message to the lower RIVA sub-system if DAL
3084 is in state STARTED.
3085
3086 In state BUSY this request will be queued. Request won't
3087 be allowed in any other state.
3088
3089
3090
3091 @param wdiExitImpsRspCb: callback for passing back the response
3092 of the Exit IMPS operation received from the device
3093
3094 pUserData: user data will be passed back with the
3095 callback
3096
3097 @see WDI_Start
3098 @return Result of the function call
3099*/
3100WDI_Status
3101WDI_ExitImpsReq
3102(
3103 WDI_ExitImpsRspCb wdiExitImpsRspCb,
3104 void* pUserData
3105)
3106{
3107 WDI_EventInfoType wdiEventData;
3108 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3109
3110 /*------------------------------------------------------------------------
3111 Sanity Check
3112 ------------------------------------------------------------------------*/
3113 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3114 {
3115 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3116 "WDI API call before module is initialized - Fail request");
3117
3118 return WDI_STATUS_E_NOT_ALLOWED;
3119 }
3120
3121 /*------------------------------------------------------------------------
3122 Fill in Event data and post to the Main FSM
3123 ------------------------------------------------------------------------*/
3124 wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ;
3125 wdiEventData.pEventData = NULL;
3126 wdiEventData.uEventDataSize = 0;
3127 wdiEventData.pCBfnc = wdiExitImpsRspCb;
3128 wdiEventData.pUserData = pUserData;
3129
3130 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3131
3132}/*WDI_ExitImpsReq*/
3133
3134/**
3135 @brief WDI_EnterBmpsReq will be called when the upper MAC to
3136 request the device to get into BMPS power state. Upon
3137 the call of this API the WLAN DAL will pack and send a
3138 HAL Enter BMPS request message to the lower RIVA
3139 sub-system if DAL is in state STARTED.
3140
3141 In state BUSY this request will be queued. Request won't
3142 be allowed in any other state.
3143
3144 WDI_PostAssocReq must have been called.
3145
3146 @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as
3147 specified by the Device Interface
3148
3149 wdiEnterBmpsRspCb: callback for passing back the
3150 response of the Enter BMPS operation received from the
3151 device
3152
3153 pUserData: user data will be passed back with the
3154 callback
3155
3156 @see WDI_PostAssocReq
3157 @return Result of the function call
3158*/
3159WDI_Status
3160WDI_EnterBmpsReq
3161(
3162 WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams,
3163 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb,
3164 void* pUserData
3165)
3166{
3167 WDI_EventInfoType wdiEventData;
3168 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3169
3170 /*------------------------------------------------------------------------
3171 Sanity Check
3172 ------------------------------------------------------------------------*/
3173 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3174 {
3175 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3176 "WDI API call before module is initialized - Fail request");
3177
3178 return WDI_STATUS_E_NOT_ALLOWED;
3179 }
3180
3181 /*------------------------------------------------------------------------
3182 Fill in Event data and post to the Main FSM
3183 ------------------------------------------------------------------------*/
3184 wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ;
3185 wdiEventData.pEventData = pwdiEnterBmpsReqParams;
3186 wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams);
3187 wdiEventData.pCBfnc = wdiEnterBmpsRspCb;
3188 wdiEventData.pUserData = pUserData;
3189
3190 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3191
3192}/*WDI_EnterBmpsReq*/
3193
3194/**
3195 @brief WDI_ExitBmpsReq will be called when the upper MAC to
3196 request the device to get out of BMPS power state. Upon
3197 the call of this API the WLAN DAL will pack and send a
3198 HAL Exit BMPS request message to the lower RIVA
3199 sub-system if DAL is in state STARTED.
3200
3201 In state BUSY this request will be queued. Request won't
3202 be allowed in any other state.
3203
3204 WDI_PostAssocReq must have been called.
3205
3206 @param pwdiExitBmpsReqParams: the Exit BMPS parameters as
3207 specified by the Device Interface
3208
3209 wdiExitBmpsRspCb: callback for passing back the response
3210 of the Exit BMPS operation received from the device
3211
3212 pUserData: user data will be passed back with the
3213 callback
3214
3215 @see WDI_PostAssocReq
3216 @return Result of the function call
3217*/
3218WDI_Status
3219WDI_ExitBmpsReq
3220(
3221 WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams,
3222 WDI_ExitBmpsRspCb wdiExitBmpsRspCb,
3223 void* pUserData
3224)
3225{
3226 WDI_EventInfoType wdiEventData;
3227 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3228
3229 /*------------------------------------------------------------------------
3230 Sanity Check
3231 ------------------------------------------------------------------------*/
3232 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3233 {
3234 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3235 "WDI API call before module is initialized - Fail request");
3236
3237 return WDI_STATUS_E_NOT_ALLOWED;
3238 }
3239
3240 /*------------------------------------------------------------------------
3241 Fill in Event data and post to the Main FSM
3242 ------------------------------------------------------------------------*/
3243 wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ;
3244 wdiEventData.pEventData = pwdiExitBmpsReqParams;
3245 wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams);
3246 wdiEventData.pCBfnc = wdiExitBmpsRspCb;
3247 wdiEventData.pUserData = pUserData;
3248
3249 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3250
3251}/*WDI_ExitBmpsReq*/
3252
3253/**
3254 @brief WDI_EnterUapsdReq will be called when the upper MAC to
3255 request the device to get into UAPSD power state. Upon
3256 the call of this API the WLAN DAL will pack and send a
3257 HAL Enter UAPSD request message to the lower RIVA
3258 sub-system if DAL is in state STARTED.
3259
3260 In state BUSY this request will be queued. Request won't
3261 be allowed in any other state.
3262
3263 WDI_PostAssocReq must have been called.
3264 WDI_SetUapsdAcParamsReq must have been called.
3265
3266 @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as
3267 specified by the Device Interface
3268
3269 wdiEnterUapsdRspCb: callback for passing back the
3270 response of the Enter UAPSD operation received from the
3271 device
3272
3273 pUserData: user data will be passed back with the
3274 callback
3275
3276 @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq
3277 @return Result of the function call
3278*/
3279WDI_Status
3280WDI_EnterUapsdReq
3281(
3282 WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams,
3283 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb,
3284 void* pUserData
3285)
3286{
3287 WDI_EventInfoType wdiEventData;
3288 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3289
3290 /*------------------------------------------------------------------------
3291 Sanity Check
3292 ------------------------------------------------------------------------*/
3293 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3294 {
3295 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3296 "WDI API call before module is initialized - Fail request");
3297
3298 return WDI_STATUS_E_NOT_ALLOWED;
3299 }
3300
3301 /*------------------------------------------------------------------------
3302 Fill in Event data and post to the Main FSM
3303 ------------------------------------------------------------------------*/
3304 wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ;
3305 wdiEventData.pEventData = pwdiEnterUapsdReqParams;
3306 wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams);
3307 wdiEventData.pCBfnc = wdiEnterUapsdRspCb;
3308 wdiEventData.pUserData = pUserData;
3309
3310 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3311
3312}/*WDI_EnterUapsdReq*/
3313
3314/**
3315 @brief WDI_ExitUapsdReq will be called when the upper MAC to
3316 request the device to get out of UAPSD power state. Upon
3317 the call of this API the WLAN DAL will send a HAL Exit
3318 UAPSD request message to the lower RIVA sub-system if
3319 DAL is in state STARTED.
3320
3321 In state BUSY this request will be queued. Request won't
3322 be allowed in any other state.
3323
3324 WDI_PostAssocReq must have been called.
3325
3326 @param wdiExitUapsdRspCb: callback for passing back the
3327 response of the Exit UAPSD operation received from the
3328 device
3329
3330 pUserData: user data will be passed back with the
3331 callback
3332
3333 @see WDI_PostAssocReq
3334 @return Result of the function call
3335*/
3336WDI_Status
3337WDI_ExitUapsdReq
3338(
3339 WDI_ExitUapsdRspCb wdiExitUapsdRspCb,
3340 void* pUserData
3341)
3342{
3343 WDI_EventInfoType wdiEventData;
3344 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3345
3346 /*------------------------------------------------------------------------
3347 Sanity Check
3348 ------------------------------------------------------------------------*/
3349 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3350 {
3351 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3352 "WDI API call before module is initialized - Fail request");
3353
3354 return WDI_STATUS_E_NOT_ALLOWED;
3355 }
3356
3357 /*------------------------------------------------------------------------
3358 Fill in Event data and post to the Main FSM
3359 ------------------------------------------------------------------------*/
3360 wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ;
3361 wdiEventData.pEventData = NULL;
3362 wdiEventData.uEventDataSize = 0;
3363 wdiEventData.pCBfnc = wdiExitUapsdRspCb;
3364 wdiEventData.pUserData = pUserData;
3365
3366 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3367
3368}/*WDI_ExitUapsdReq*/
3369
3370/**
3371 @brief WDI_UpdateUapsdParamsReq will be called when the upper
3372 MAC wants to set the UAPSD related configurations
3373 of an associated STA (while acting as an AP) to the WLAN
3374 Device. Upon the call of this API the WLAN DAL will pack
3375 and send a HAL Update UAPSD params request message to
3376 the lower RIVA sub-system if DAL is in state STARTED.
3377
3378 In state BUSY this request will be queued. Request won't
3379 be allowed in any other state.
3380
3381 WDI_ConfigBSSReq must have been called.
3382
3383 @param pwdiUpdateUapsdReqParams: the UAPSD parameters
3384 as specified by the Device Interface
3385
3386 wdiUpdateUapsdParamsCb: callback for passing back the
3387 response of the update UAPSD params operation received
3388 from the device
3389
3390 pUserData: user data will be passed back with the
3391 callback
3392
3393 @see WDI_ConfigBSSReq
3394 @return Result of the function call
3395*/
3396WDI_Status
3397WDI_UpdateUapsdParamsReq
3398(
3399 WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams,
3400 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb,
3401 void* pUserData
3402)
3403{
3404 WDI_EventInfoType wdiEventData;
3405 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3406
3407 /*------------------------------------------------------------------------
3408 Sanity Check
3409 ------------------------------------------------------------------------*/
3410 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3411 {
3412 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3413 "WDI API call before module is initialized - Fail request");
3414
3415 return WDI_STATUS_E_NOT_ALLOWED;
3416 }
3417
3418 /*------------------------------------------------------------------------
3419 Fill in Event data and post to the Main FSM
3420 ------------------------------------------------------------------------*/
3421 wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ;
3422 wdiEventData.pEventData = pwdiUpdateUapsdReqParams;
3423 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);;
3424 wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb;
3425 wdiEventData.pUserData = pUserData;
3426
3427 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3428
3429}/*WDI_UpdateUapsdParamsReq*/
3430
3431/**
3432 @brief WDI_SetUapsdAcParamsReq will be called when the upper
3433 MAC wants to set the UAPSD related configurations before
3434 requesting for enter UAPSD power state to the WLAN
3435 Device. Upon the call of this API the WLAN DAL will pack
3436 and send a HAL Set UAPSD params request message to
3437 the lower RIVA sub-system if DAL is in state STARTED.
3438
3439 In state BUSY this request will be queued. Request won't
3440 be allowed in any other state.
3441
3442 WDI_PostAssocReq must have been called.
3443
3444 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3445 the Device Interface
3446
3447 wdiSetUapsdAcParamsCb: callback for passing back the
3448 response of the set UAPSD params operation received from
3449 the device
3450
3451 pUserData: user data will be passed back with the
3452 callback
3453
3454 @see WDI_PostAssocReq
3455 @return Result of the function call
3456*/
3457WDI_Status
3458WDI_SetUapsdAcParamsReq
3459(
3460 WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo,
3461 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb,
3462 void* pUserData
3463)
3464{
3465 WDI_EventInfoType wdiEventData;
3466 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3467
3468 /*------------------------------------------------------------------------
3469 Sanity Check
3470 ------------------------------------------------------------------------*/
3471 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3472 {
3473 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3474 "WDI API call before module is initialized - Fail request");
3475
3476 return WDI_STATUS_E_NOT_ALLOWED;
3477 }
3478
3479 /*------------------------------------------------------------------------
3480 Fill in Event data and post to the Main FSM
3481 ------------------------------------------------------------------------*/
3482 wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ;
3483 wdiEventData.pEventData = pwdiUapsdInfo;
3484 wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo);
3485 wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb;
3486 wdiEventData.pUserData = pUserData;
3487
3488 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3489
3490}/*WDI_SetUapsdAcParamsReq*/
3491
3492/**
3493 @brief WDI_ConfigureRxpFilterReq will be called when the upper
3494 MAC wants to set/reset the RXP filters for received pkts
3495 (MC, BC etc.). Upon the call of this API the WLAN DAL will pack
3496 and send a HAL configure RXP filter request message to
3497 the lower RIVA sub-system.
3498
3499 In state BUSY this request will be queued. Request won't
3500 be allowed in any other state.
3501
3502
3503 @param pwdiConfigureRxpFilterReqParams: the RXP
3504 filter as specified by the Device
3505 Interface
3506
3507 wdiConfigureRxpFilterCb: callback for passing back the
3508 response of the configure RXP filter operation received
3509 from the device
3510
3511 pUserData: user data will be passed back with the
3512 callback
3513
3514 @return Result of the function call
3515*/
3516WDI_Status
3517WDI_ConfigureRxpFilterReq
3518(
3519 WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams,
3520 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb,
3521 void* pUserData
3522)
3523{
3524 WDI_EventInfoType wdiEventData;
3525 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3526
3527 /*------------------------------------------------------------------------
3528 Sanity Check
3529 ------------------------------------------------------------------------*/
3530 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3531 {
3532 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3533 "WDI API call before module is initialized - Fail request");
3534
3535 return WDI_STATUS_E_NOT_ALLOWED;
3536 }
3537
3538 /*------------------------------------------------------------------------
3539 Fill in Event data and post to the Main FSM
3540 ------------------------------------------------------------------------*/
3541 wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ;
3542 wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams;
3543 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams);
3544 wdiEventData.pCBfnc = wdiConfigureRxpFilterCb;
3545 wdiEventData.pUserData = pUserData;
3546
3547 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3548}/*WDI_ConfigureRxpFilterReq*/
3549
3550/**
3551 @brief WDI_SetBeaconFilterReq will be called when the upper MAC
3552 wants to set the beacon filters while in power save.
3553 Upon the call of this API the WLAN DAL will pack and
3554 send a Beacon filter request message to the
3555 lower RIVA sub-system.
3556
3557 In state BUSY this request will be queued. Request won't
3558 be allowed in any other state.
3559
3560
3561 @param pwdiBeaconFilterReqParams: the beacon
3562 filter as specified by the Device
3563 Interface
3564
3565 wdiBeaconFilterCb: callback for passing back the
3566 response of the set beacon filter operation received
3567 from the device
3568
3569 pUserData: user data will be passed back with the
3570 callback
3571
3572 @return Result of the function call
3573*/
3574WDI_Status
3575WDI_SetBeaconFilterReq
3576(
3577 WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3578 WDI_SetBeaconFilterCb wdiBeaconFilterCb,
3579 void* pUserData
3580)
3581{
3582 WDI_EventInfoType wdiEventData;
3583 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3584
3585 /*------------------------------------------------------------------------
3586 Sanity Check
3587 ------------------------------------------------------------------------*/
3588 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3589 {
3590 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3591 "WDI API call before module is initialized - Fail request");
3592
3593 return WDI_STATUS_E_NOT_ALLOWED;
3594 }
3595
3596 /*------------------------------------------------------------------------
3597 Fill in Event data and post to the Main FSM
3598 ------------------------------------------------------------------------*/
3599 wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ;
3600 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3601 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3602 wdiEventData.pCBfnc = wdiBeaconFilterCb;
3603 wdiEventData.pUserData = pUserData;
3604
3605 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3606}/*WDI_SetBeaconFilterReq*/
3607
3608/**
3609 @brief WDI_RemBeaconFilterReq will be called when the upper MAC
3610 wants to remove the beacon filter for particular IE
3611 while in power save. Upon the call of this API the WLAN
3612 DAL will pack and send a remove Beacon filter request
3613 message to the lower RIVA sub-system.
3614
3615 In state BUSY this request will be queued. Request won't
3616 be allowed in any other state.
3617
3618
3619 @param pwdiBeaconFilterReqParams: the beacon
3620 filter as specified by the Device
3621 Interface
3622
3623 wdiBeaconFilterCb: callback for passing back the
3624 response of the remove beacon filter operation received
3625 from the device
3626
3627 pUserData: user data will be passed back with the
3628 callback
3629
3630 @return Result of the function call
3631*/
3632WDI_Status
3633WDI_RemBeaconFilterReq
3634(
3635 WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3636 WDI_RemBeaconFilterCb wdiBeaconFilterCb,
3637 void* pUserData
3638)
3639{
3640 WDI_EventInfoType wdiEventData;
3641 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3642
3643 /*------------------------------------------------------------------------
3644 Sanity Check
3645 ------------------------------------------------------------------------*/
3646 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3647 {
3648 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3649 "WDI API call before module is initialized - Fail request");
3650
3651 return WDI_STATUS_E_NOT_ALLOWED;
3652 }
3653
3654 /*------------------------------------------------------------------------
3655 Fill in Event data and post to the Main FSM
3656 ------------------------------------------------------------------------*/
3657 wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ;
3658 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3659 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3660 wdiEventData.pCBfnc = wdiBeaconFilterCb;
3661 wdiEventData.pUserData = pUserData;
3662
3663 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3664}/*WDI_RemBeaconFilterReq*/
3665
3666/**
3667 @brief WDI_SetRSSIThresholdsReq will be called when the upper
3668 MAC wants to set the RSSI thresholds related
3669 configurations while in power save. Upon the call of
3670 this API the WLAN DAL will pack and send a HAL Set RSSI
3671 thresholds request message to the lower RIVA
3672 sub-system if DAL is in state STARTED.
3673
3674 In state BUSY this request will be queued. Request won't
3675 be allowed in any other state.
3676
3677 WDI_PostAssocReq must have been called.
3678
3679 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3680 the Device Interface
3681
3682 wdiSetUapsdAcParamsCb: callback for passing back the
3683 response of the set UAPSD params operation received from
3684 the device
3685
3686 pUserData: user data will be passed back with the
3687 callback
3688
3689 @see WDI_PostAssocReq
3690 @return Result of the function call
3691*/
3692WDI_Status
3693WDI_SetRSSIThresholdsReq
3694(
3695 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams,
3696 WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb,
3697 void* pUserData
3698)
3699{
3700 WDI_EventInfoType wdiEventData;
3701 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3702
3703 /*------------------------------------------------------------------------
3704 Sanity Check
3705 ------------------------------------------------------------------------*/
3706 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3707 {
3708 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3709 "WDI API call before module is initialized - Fail request");
3710
3711 return WDI_STATUS_E_NOT_ALLOWED;
3712 }
3713
3714 /*------------------------------------------------------------------------
3715 Fill in Event data and post to the Main FSM
3716 ------------------------------------------------------------------------*/
3717 wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ;
3718 wdiEventData.pEventData = pwdiRSSIThresholdsParams;
3719 wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);;
3720 wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb;
3721 wdiEventData.pUserData = pUserData;
3722
3723 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3724}/* WDI_SetRSSIThresholdsReq*/
3725
3726/**
3727 @brief WDI_HostOffloadReq will be called when the upper MAC
3728 wants to set the filter to minimize unnecessary host
3729 wakeup due to broadcast traffic while in power save.
3730 Upon the call of this API the WLAN DAL will pack and
3731 send a HAL host offload request message to the
3732 lower RIVA sub-system if DAL is in state STARTED.
3733
3734 In state BUSY this request will be queued. Request won't
3735 be allowed in any other state.
3736
3737 WDI_PostAssocReq must have been called.
3738
3739 @param pwdiHostOffloadParams: the host offload as specified
3740 by the Device Interface
3741
3742 wdiHostOffloadCb: callback for passing back the response
3743 of the host offload operation received from the
3744 device
3745
3746 pUserData: user data will be passed back with the
3747 callback
3748
3749 @see WDI_PostAssocReq
3750 @return Result of the function call
3751*/
3752WDI_Status
3753WDI_HostOffloadReq
3754(
3755 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams,
3756 WDI_HostOffloadCb wdiHostOffloadCb,
3757 void* pUserData
3758)
3759{
3760 WDI_EventInfoType wdiEventData;
3761 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3762
3763 /*------------------------------------------------------------------------
3764 Sanity Check
3765 ------------------------------------------------------------------------*/
3766 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3767 {
3768 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3769 "WDI API call before module is initialized - Fail request");
3770
3771 return WDI_STATUS_E_NOT_ALLOWED;
3772 }
3773
3774 /*------------------------------------------------------------------------
3775 Fill in Event data and post to the Main FSM
3776 ------------------------------------------------------------------------*/
3777 wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ;
3778 wdiEventData.pEventData = pwdiHostOffloadParams;
3779 wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);;
3780 wdiEventData.pCBfnc = wdiHostOffloadCb;
3781 wdiEventData.pUserData = pUserData;
3782
3783 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3784}/*WDI_HostOffloadReq*/
3785
3786/**
3787 @brief WDI_KeepAliveReq will be called when the upper MAC
3788 wants to set the filter to send NULL or unsolicited ARP responses
3789 and minimize unnecessary host wakeups due to while in power save.
3790 Upon the call of this API the WLAN DAL will pack and
3791 send a HAL Keep Alive request message to the
3792 lower RIVA sub-system if DAL is in state STARTED.
3793
3794 In state BUSY this request will be queued. Request won't
3795 be allowed in any other state.
3796
3797 WDI_PostAssocReq must have been called.
3798
3799 @param pwdiKeepAliveParams: the Keep Alive as specified
3800 by the Device Interface
3801
3802 wdiKeepAliveCb: callback for passing back the response
3803 of the Keep Alive operation received from the
3804 device
3805
3806 pUserData: user data will be passed back with the
3807 callback
3808
3809 @see WDI_PostAssocReq
3810 @return Result of the function call
3811*/
3812WDI_Status
3813WDI_KeepAliveReq
3814(
3815 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams,
3816 WDI_KeepAliveCb wdiKeepAliveCb,
3817 void* pUserData
3818)
3819{
3820 WDI_EventInfoType wdiEventData;
3821 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3822
3823 /*------------------------------------------------------------------------
3824 Sanity Check
3825 ------------------------------------------------------------------------*/
3826 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3827 {
3828 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3829 "WDI_KeepAliveReq: WDI API call before module "
3830 "is initialized - Fail request");
3831
3832 return WDI_STATUS_E_NOT_ALLOWED;
3833 }
3834
3835 /*------------------------------------------------------------------------
3836 Fill in Event data and post to the Main FSM
3837 ------------------------------------------------------------------------*/
3838 wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ;
3839 wdiEventData.pEventData = pwdiKeepAliveParams;
3840 wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams);
3841 wdiEventData.pCBfnc = wdiKeepAliveCb;
3842 wdiEventData.pUserData = pUserData;
3843
3844 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3845}/*WDI_KeepAliveReq*/
3846
3847/**
3848 @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC
3849 wants to set the Wowl Bcast ptrn to minimize unnecessary
3850 host wakeup due to broadcast traffic while in power
3851 save. Upon the call of this API the WLAN DAL will pack
3852 and send a HAL Wowl Bcast ptrn request message to the
3853 lower RIVA sub-system if DAL is in state STARTED.
3854
3855 In state BUSY this request will be queued. Request won't
3856 be allowed in any other state.
3857
3858 WDI_PostAssocReq must have been called.
3859
3860 @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as
3861 specified by the Device Interface
3862
3863 wdiWowlAddBcPtrnCb: callback for passing back the
3864 response of the add Wowl bcast ptrn operation received
3865 from the device
3866
3867 pUserData: user data will be passed back with the
3868 callback
3869
3870 @see WDI_PostAssocReq
3871 @return Result of the function call
3872*/
3873WDI_Status
3874WDI_WowlAddBcPtrnReq
3875(
3876 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams,
3877 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb,
3878 void* pUserData
3879)
3880{
3881 WDI_EventInfoType wdiEventData;
3882 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3883
3884 /*------------------------------------------------------------------------
3885 Sanity Check
3886 ------------------------------------------------------------------------*/
3887 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3888 {
3889 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3890 "WDI API call before module is initialized - Fail request");
3891
3892 return WDI_STATUS_E_NOT_ALLOWED;
3893 }
3894
3895 /*------------------------------------------------------------------------
3896 Fill in Event data and post to the Main FSM
3897 ------------------------------------------------------------------------*/
3898 wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ;
3899 wdiEventData.pEventData = pwdiWowlAddBcPtrnParams;
3900 wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);;
3901 wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb;
3902 wdiEventData.pUserData = pUserData;
3903
3904 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3905}/*WDI_WowlAddBcPtrnReq*/
3906
3907/**
3908 @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC
3909 wants to clear the Wowl Bcast ptrn. Upon the call of
3910 this API the WLAN DAL will pack and send a HAL delete
3911 Wowl Bcast ptrn request message to the lower RIVA
3912 sub-system if DAL is in state STARTED.
3913
3914 In state BUSY this request will be queued. Request won't
3915 be allowed in any other state.
3916
3917 WDI_WowlAddBcPtrnReq must have been called.
3918
3919 @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as
3920 specified by the Device Interface
3921
3922 wdiWowlDelBcPtrnCb: callback for passing back the
3923 response of the del Wowl bcast ptrn operation received
3924 from the device
3925
3926 pUserData: user data will be passed back with the
3927 callback
3928
3929 @see WDI_WowlAddBcPtrnReq
3930 @return Result of the function call
3931*/
3932WDI_Status
3933WDI_WowlDelBcPtrnReq
3934(
3935 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams,
3936 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb,
3937 void* pUserData
3938)
3939{
3940 WDI_EventInfoType wdiEventData;
3941 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3942
3943 /*------------------------------------------------------------------------
3944 Sanity Check
3945 ------------------------------------------------------------------------*/
3946 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3947 {
3948 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3949 "WDI API call before module is initialized - Fail request");
3950
3951 return WDI_STATUS_E_NOT_ALLOWED;
3952 }
3953
3954 /*------------------------------------------------------------------------
3955 Fill in Event data and post to the Main FSM
3956 ------------------------------------------------------------------------*/
3957 wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ;
3958 wdiEventData.pEventData = pwdiWowlDelBcPtrnParams;
3959 wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);;
3960 wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb;
3961 wdiEventData.pUserData = pUserData;
3962
3963 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3964}/*WDI_WowlDelBcPtrnReq*/
3965
3966/**
3967 @brief WDI_WowlEnterReq will be called when the upper MAC
3968 wants to enter the Wowl state to minimize unnecessary
3969 host wakeup while in power save. Upon the call of this
3970 API the WLAN DAL will pack and send a HAL Wowl enter
3971 request message to the lower RIVA sub-system if DAL is
3972 in state STARTED.
3973
3974 In state BUSY this request will be queued. Request won't
3975 be allowed in any other state.
3976
3977 WDI_PostAssocReq must have been called.
3978
3979 @param pwdiWowlEnterReqParams: the Wowl enter info as
3980 specified by the Device Interface
3981
3982 wdiWowlEnterReqCb: callback for passing back the
3983 response of the enter Wowl operation received from the
3984 device
3985
3986 pUserData: user data will be passed back with the
3987 callback
3988
3989 @see WDI_PostAssocReq
3990 @return Result of the function call
3991*/
3992WDI_Status
3993WDI_WowlEnterReq
3994(
3995 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams,
3996 WDI_WowlEnterReqCb wdiWowlEnterCb,
3997 void* pUserData
3998)
3999{
4000 WDI_EventInfoType wdiEventData;
4001 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4002
4003 /*------------------------------------------------------------------------
4004 Sanity Check
4005 ------------------------------------------------------------------------*/
4006 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4007 {
4008 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4009 "WDI API call before module is initialized - Fail request");
4010
4011 return WDI_STATUS_E_NOT_ALLOWED;
4012 }
4013
4014 /*------------------------------------------------------------------------
4015 Fill in Event data and post to the Main FSM
4016 ------------------------------------------------------------------------*/
4017 wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ;
4018 wdiEventData.pEventData = pwdiWowlEnterParams;
4019 wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);;
4020 wdiEventData.pCBfnc = wdiWowlEnterCb;
4021 wdiEventData.pUserData = pUserData;
4022
4023 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4024}/*WDI_WowlEnterReq*/
4025
4026/**
4027 @brief WDI_WowlExitReq will be called when the upper MAC
4028 wants to exit the Wowl state. Upon the call of this API
4029 the WLAN DAL will pack and send a HAL Wowl exit request
4030 message to the lower RIVA sub-system if DAL is in state
4031 STARTED.
4032
4033 In state BUSY this request will be queued. Request won't
4034 be allowed in any other state.
4035
4036 WDI_WowlEnterReq must have been called.
4037
4038 @param pwdiWowlExitReqParams: the Wowl exit info as
4039 specified by the Device Interface
4040
4041 wdiWowlExitReqCb: callback for passing back the response
4042 of the exit Wowl operation received from the device
4043
4044 pUserData: user data will be passed back with the
4045 callback
4046
4047 @see WDI_WowlEnterReq
4048 @return Result of the function call
4049*/
4050WDI_Status
4051WDI_WowlExitReq
4052(
4053 WDI_WowlExitReqCb wdiWowlExitCb,
4054 void* pUserData
4055)
4056{
4057 WDI_EventInfoType wdiEventData;
4058 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4059
4060 /*------------------------------------------------------------------------
4061 Sanity Check
4062 ------------------------------------------------------------------------*/
4063 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4064 {
4065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4066 "WDI API call before module is initialized - Fail request");
4067
4068 return WDI_STATUS_E_NOT_ALLOWED;
4069 }
4070
4071 /*------------------------------------------------------------------------
4072 Fill in Event data and post to the Main FSM
4073 ------------------------------------------------------------------------*/
4074 wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ;
4075 wdiEventData.pEventData = NULL;
4076 wdiEventData.uEventDataSize = 0;
4077 wdiEventData.pCBfnc = wdiWowlExitCb;
4078 wdiEventData.pUserData = pUserData;
4079
4080 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4081}/*WDI_WowlExitReq*/
4082
4083/**
4084 @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when
4085 the upper MAC wants to dynamically adjusts the listen
4086 interval based on the WLAN/MSM activity. Upon the call
4087 of this API the WLAN DAL will pack and send a HAL
4088 configure Apps Cpu Wakeup State request message to the
4089 lower RIVA sub-system.
4090
4091 In state BUSY this request will be queued. Request won't
4092 be allowed in any other state.
4093
4094
4095 @param pwdiConfigureAppsCpuWakeupStateReqParams: the
4096 Apps Cpu Wakeup State as specified by the
4097 Device Interface
4098
4099 wdiConfigureAppsCpuWakeupStateCb: callback for passing
4100 back the response of the configure Apps Cpu Wakeup State
4101 operation received from the device
4102
4103 pUserData: user data will be passed back with the
4104 callback
4105
4106 @return Result of the function call
4107*/
4108WDI_Status
4109WDI_ConfigureAppsCpuWakeupStateReq
4110(
4111 WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams,
4112 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb,
4113 void* pUserData
4114)
4115{
4116 WDI_EventInfoType wdiEventData;
4117 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4118
4119 /*------------------------------------------------------------------------
4120 Sanity Check
4121 ------------------------------------------------------------------------*/
4122 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4123 {
4124 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4125 "WDI API call before module is initialized - Fail request");
4126
4127 return WDI_STATUS_E_NOT_ALLOWED;
4128 }
4129
4130 /*------------------------------------------------------------------------
4131 Fill in Event data and post to the Main FSM
4132 ------------------------------------------------------------------------*/
4133 wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
4134 wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams;
4135 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams);
4136 wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb;
4137 wdiEventData.pUserData = pUserData;
4138
4139 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4140}/*WDI_ConfigureAppsCpuWakeupStateReq*/
4141/**
4142 @brief WDI_FlushAcReq will be called when the upper MAC wants
4143 to to perform a flush operation on a given AC. Upon the
4144 call of this API the WLAN DAL will pack and send a HAL
4145 Flush AC request message to the lower RIVA sub-system if
4146 DAL is in state STARTED.
4147
4148 In state BUSY this request will be queued. Request won't
4149 be allowed in any other state.
4150
4151 WDI_AddBAReq must have been called.
4152
4153 @param pwdiFlushAcReqParams: the Flush AC parameters as
4154 specified by the Device Interface
4155
4156 wdiFlushAcRspCb: callback for passing back the response
4157 of the Flush AC operation received from the device
4158
4159 pUserData: user data will be passed back with the
4160 callback
4161
4162 @see WDI_AddBAReq
4163 @return Result of the function call
4164*/
4165WDI_Status
4166WDI_FlushAcReq
4167(
4168 WDI_FlushAcReqParamsType* pwdiFlushAcReqParams,
4169 WDI_FlushAcRspCb wdiFlushAcRspCb,
4170 void* pUserData
4171)
4172{
4173 WDI_EventInfoType wdiEventData;
4174 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4175
4176 /*------------------------------------------------------------------------
4177 Sanity Check
4178 ------------------------------------------------------------------------*/
4179 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4180 {
4181 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4182 "WDI API call before module is initialized - Fail request");
4183
4184 return WDI_STATUS_E_NOT_ALLOWED;
4185 }
4186
4187 /*------------------------------------------------------------------------
4188 Fill in Event data and post to the Main FSM
4189 ------------------------------------------------------------------------*/
4190 wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ;
4191 wdiEventData.pEventData = pwdiFlushAcReqParams;
4192 wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams);
4193 wdiEventData.pCBfnc = wdiFlushAcRspCb;
4194 wdiEventData.pUserData = pUserData;
4195
4196 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4197
4198}/*WDI_FlushAcReq*/
4199
4200/**
4201 @brief WDI_BtAmpEventReq will be called when the upper MAC
4202 wants to notify the lower mac on a BT AMP event. This is
4203 to inform BTC-SLM that some BT AMP event occurred. Upon
4204 the call of this API the WLAN DAL will pack and send a
4205 HAL BT AMP event request message to the lower RIVA
4206 sub-system if DAL is in state STARTED.
4207
4208 In state BUSY this request will be queued. Request won't
4209 be allowed in any other state.
4210
4211
4212 @param wdiBtAmpEventReqParams: the BT AMP event parameters as
4213 specified by the Device Interface
4214
4215 wdiBtAmpEventRspCb: callback for passing back the
4216 response of the BT AMP event operation received from the
4217 device
4218
4219 pUserData: user data will be passed back with the
4220 callback
4221
4222 @return Result of the function call
4223*/
4224WDI_Status
4225WDI_BtAmpEventReq
4226(
4227 WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams,
4228 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb,
4229 void* pUserData
4230)
4231{
4232 WDI_EventInfoType wdiEventData;
4233 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4234
4235 /*------------------------------------------------------------------------
4236 Sanity Check
4237 ------------------------------------------------------------------------*/
4238 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4239 {
4240 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4241 "WDI API call before module is initialized - Fail request");
4242
4243 return WDI_STATUS_E_NOT_ALLOWED;
4244 }
4245
4246 /*------------------------------------------------------------------------
4247 Fill in Event data and post to the Main FSM
4248 ------------------------------------------------------------------------*/
4249 wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ;
4250 wdiEventData.pEventData = pwdiBtAmpEventReqParams;
4251 wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams);
4252 wdiEventData.pCBfnc = wdiBtAmpEventRspCb;
4253 wdiEventData.pUserData = pUserData;
4254
4255 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4256
4257}/*WDI_BtAmpEventReq*/
4258
4259
4260
4261/*========================================================================
4262
4263 CONTROL APIs
4264
4265==========================================================================*/
4266/**
4267 @brief WDI_SwitchChReq will be called when the upper MAC wants
4268 the WLAN HW to change the current channel of operation.
4269 Upon the call of this API the WLAN DAL will pack and
4270 send a HAL Start request message to the lower RIVA
4271 sub-system if DAL is in state STARTED.
4272
4273 In state BUSY this request will be queued. Request won't
4274 be allowed in any other state.
4275
4276 WDI_Start must have been called.
4277
4278 @param wdiSwitchChReqParams: the switch ch parameters as
4279 specified by the Device Interface
4280
4281 wdiSwitchChRspCb: callback for passing back the response
4282 of the switch ch operation received from the device
4283
4284 pUserData: user data will be passed back with the
4285 callback
4286
4287 @see WDI_Start
4288 @return Result of the function call
4289*/
4290WDI_Status
4291WDI_SwitchChReq
4292(
4293 WDI_SwitchChReqParamsType* pwdiSwitchChReqParams,
4294 WDI_SwitchChRspCb wdiSwitchChRspCb,
4295 void* pUserData
4296)
4297{
4298 WDI_EventInfoType wdiEventData;
4299 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4300
4301 /*------------------------------------------------------------------------
4302 Sanity Check
4303 ------------------------------------------------------------------------*/
4304 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4305 {
4306 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4307 "WDI API call before module is initialized - Fail request");
4308
4309 return WDI_STATUS_E_NOT_ALLOWED;
4310 }
4311
4312 /*------------------------------------------------------------------------
4313 Fill in Event data and post to the Main FSM
4314 ------------------------------------------------------------------------*/
4315 wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ;
4316 wdiEventData.pEventData = pwdiSwitchChReqParams;
4317 wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams);
4318 wdiEventData.pCBfnc = wdiSwitchChRspCb;
4319 wdiEventData.pUserData = pUserData;
4320
4321 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4322
4323}/*WDI_SwitchChReq*/
4324
4325
4326/**
4327 @brief WDI_ConfigSTAReq will be called when the upper MAC
4328 wishes to add or update a STA in HW. Upon the call of
4329 this API the WLAN DAL will pack and send a HAL Start
4330 message request message to the lower RIVA sub-system if
4331 DAL is in state STARTED.
4332
4333 In state BUSY this request will be queued. Request won't
4334 be allowed in any other state.
4335
4336 WDI_Start must have been called.
4337
4338 @param wdiConfigSTAReqParams: the config STA parameters as
4339 specified by the Device Interface
4340
4341 wdiConfigSTARspCb: callback for passing back the
4342 response of the config STA operation received from the
4343 device
4344
4345 pUserData: user data will be passed back with the
4346 callback
4347
4348 @see WDI_Start
4349 @return Result of the function call
4350*/
4351WDI_Status
4352WDI_ConfigSTAReq
4353(
4354 WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams,
4355 WDI_ConfigSTARspCb wdiConfigSTARspCb,
4356 void* pUserData
4357)
4358{
4359 WDI_EventInfoType wdiEventData;
4360 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4361
4362 /*------------------------------------------------------------------------
4363 Sanity Check
4364 ------------------------------------------------------------------------*/
4365 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4366 {
4367 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4368 "WDI API call before module is initialized - Fail request");
4369
4370 return WDI_STATUS_E_NOT_ALLOWED;
4371 }
4372
4373 /*------------------------------------------------------------------------
4374 Fill in Event data and post to the Main FSM
4375 ------------------------------------------------------------------------*/
4376 wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ;
4377 wdiEventData.pEventData = pwdiConfigSTAReqParams;
4378 wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams);
4379 wdiEventData.pCBfnc = wdiConfigSTARspCb;
4380 wdiEventData.pUserData = pUserData;
4381
4382 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4383
4384}/*WDI_ConfigSTAReq*/
4385
4386/**
4387 @brief WDI_SetLinkStateReq will be called when the upper MAC
4388 wants to change the state of an ongoing link. Upon the
4389 call of this API the WLAN DAL will pack and send a HAL
4390 Start message request message to the lower RIVA
4391 sub-system if DAL is in state STARTED.
4392
4393 In state BUSY this request will be queued. Request won't
4394 be allowed in any other state.
4395
4396 WDI_JoinStartReq must have been called.
4397
4398 @param wdiSetLinkStateReqParams: the set link state parameters
4399 as specified by the Device Interface
4400
4401 wdiSetLinkStateRspCb: callback for passing back the
4402 response of the set link state operation received from
4403 the device
4404
4405 pUserData: user data will be passed back with the
4406 callback
4407
4408 @see WDI_JoinStartReq
4409 @return Result of the function call
4410*/
4411WDI_Status
4412WDI_SetLinkStateReq
4413(
4414 WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams,
4415 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb,
4416 void* pUserData
4417)
4418{
4419 WDI_EventInfoType wdiEventData;
4420 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4421
4422 /*------------------------------------------------------------------------
4423 Sanity Check
4424 ------------------------------------------------------------------------*/
4425 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4426 {
4427 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4428 "WDI API call before module is initialized - Fail request");
4429
4430 return WDI_STATUS_E_NOT_ALLOWED;
4431 }
4432
4433 /*------------------------------------------------------------------------
4434 Fill in Event data and post to the Main FSM
4435 ------------------------------------------------------------------------*/
4436 wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ;
4437 wdiEventData.pEventData = pwdiSetLinkStateReqParams;
4438 wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams);
4439 wdiEventData.pCBfnc = wdiSetLinkStateRspCb;
4440 wdiEventData.pUserData = pUserData;
4441
4442 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4443
4444}/*WDI_SetLinkStateReq*/
4445
4446
4447/**
4448 @brief WDI_GetStatsReq will be called when the upper MAC wants
4449 to get statistics (MIB counters) from the device. Upon
4450 the call of this API the WLAN DAL will pack and send a
4451 HAL Start request message to the lower RIVA sub-system
4452 if DAL is in state STARTED.
4453
4454 In state BUSY this request will be queued. Request won't
4455 be allowed in any other state.
4456
4457 WDI_Start must have been called.
4458
4459 @param wdiGetStatsReqParams: the stats parameters to get as
4460 specified by the Device Interface
4461
4462 wdiGetStatsRspCb: callback for passing back the response
4463 of the get stats operation received from the device
4464
4465 pUserData: user data will be passed back with the
4466 callback
4467
4468 @see WDI_Start
4469 @return Result of the function call
4470*/
4471WDI_Status
4472WDI_GetStatsReq
4473(
4474 WDI_GetStatsReqParamsType* pwdiGetStatsReqParams,
4475 WDI_GetStatsRspCb wdiGetStatsRspCb,
4476 void* pUserData
4477)
4478{
4479 WDI_EventInfoType wdiEventData;
4480 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4481
4482 /*------------------------------------------------------------------------
4483 Sanity Check
4484 ------------------------------------------------------------------------*/
4485 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4486 {
4487 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4488 "WDI API call before module is initialized - Fail request");
4489
4490 return WDI_STATUS_E_NOT_ALLOWED;
4491 }
4492
4493 /*------------------------------------------------------------------------
4494 Fill in Event data and post to the Main FSM
4495 ------------------------------------------------------------------------*/
4496 wdiEventData.wdiRequest = WDI_GET_STATS_REQ;
4497 wdiEventData.pEventData = pwdiGetStatsReqParams;
4498 wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams);
4499 wdiEventData.pCBfnc = wdiGetStatsRspCb;
4500 wdiEventData.pUserData = pUserData;
4501
4502 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4503
4504}/*WDI_GetStatsReq*/
4505
4506
4507/**
4508 @brief WDI_UpdateCfgReq will be called when the upper MAC when
4509 it wishes to change the configuration of the WLAN
4510 Device. Upon the call of this API the WLAN DAL will pack
4511 and send a HAL Update CFG request message to the lower
4512 RIVA sub-system if DAL is in state STARTED.
4513
4514 In state BUSY this request will be queued. Request won't
4515 be allowed in any other state.
4516
4517 WDI_Start must have been called.
4518
4519 @param wdiUpdateCfgReqParams: the update cfg parameters as
4520 specified by the Device Interface
4521
4522 wdiUpdateCfgsRspCb: callback for passing back the
4523 response of the update cfg operation received from the
4524 device
4525
4526 pUserData: user data will be passed back with the
4527 callback
4528
4529 @see WDI_Start
4530 @return Result of the function call
4531*/
4532WDI_Status
4533WDI_UpdateCfgReq
4534(
4535 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams,
4536 WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb,
4537 void* pUserData
4538)
4539{
4540 WDI_EventInfoType wdiEventData;
4541 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4542
4543 /*------------------------------------------------------------------------
4544 Sanity Check
4545 ------------------------------------------------------------------------*/
4546 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4547 {
4548 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4549 "WDI API call before module is initialized - Fail request");
4550
4551 return WDI_STATUS_E_NOT_ALLOWED;
4552 }
4553
4554 /*------------------------------------------------------------------------
4555 Fill in Event data and post to the Main FSM
4556 ------------------------------------------------------------------------*/
4557 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
4558 wdiEventData.pEventData = pwdiUpdateCfgReqParams;
4559 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams);
4560 wdiEventData.pCBfnc = wdiUpdateCfgsRspCb;
4561 wdiEventData.pUserData = pUserData;
4562
4563 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4564
4565}/*WDI_UpdateCfgReq*/
4566
4567
4568
4569/**
4570 @brief WDI_AddBAReq will be called when the upper MAC has setup
4571 successfully a BA session and needs to notify the HW for
4572 the appropriate settings to take place. Upon the call of
4573 this API the WLAN DAL will pack and send a HAL Add BA
4574 request message to the lower RIVA sub-system if DAL is
4575 in state STARTED.
4576
4577 In state BUSY this request will be queued. Request won't
4578 be allowed in any other state.
4579
4580 WDI_PostAssocReq must have been called.
4581
4582 @param wdiAddBAReqParams: the add BA parameters as specified by
4583 the Device Interface
4584
4585 wdiAddBARspCb: callback for passing back the response of
4586 the add BA operation received from the device
4587
4588 pUserData: user data will be passed back with the
4589 callback
4590
4591 @see WDI_PostAssocReq
4592 @return Result of the function call
4593*/
4594WDI_Status
4595WDI_AddBAReq
4596(
4597 WDI_AddBAReqParamsType* pwdiAddBAReqParams,
4598 WDI_AddBARspCb wdiAddBARspCb,
4599 void* pUserData
4600)
4601{
4602 WDI_EventInfoType wdiEventData;
4603 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4604
4605 /*------------------------------------------------------------------------
4606 Sanity Check
4607 ------------------------------------------------------------------------*/
4608 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4609 {
4610 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4611 "WDI API call before module is initialized - Fail request");
4612
4613 return WDI_STATUS_E_NOT_ALLOWED;
4614 }
4615
4616 /*------------------------------------------------------------------------
4617 Fill in Event data and post to the Main FSM
4618 ------------------------------------------------------------------------*/
4619 wdiEventData.wdiRequest = WDI_ADD_BA_REQ;
4620 wdiEventData.pEventData = pwdiAddBAReqParams;
4621 wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams);
4622 wdiEventData.pCBfnc = wdiAddBARspCb;
4623 wdiEventData.pUserData = pUserData;
4624
4625 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4626
4627}/*WDI_AddBAReq*/
4628
4629
4630/**
4631 @brief WDI_TriggerBAReq will be called when the upper MAC has setup
4632 successfully a BA session and needs to notify the HW for
4633 the appropriate settings to take place. Upon the call of
4634 this API the WLAN DAL will pack and send a HAL Add BA
4635 request message to the lower RIVA sub-system if DAL is
4636 in state STARTED.
4637
4638 In state BUSY this request will be queued. Request won't
4639 be allowed in any other state.
4640
4641 WDI_PostAssocReq must have been called.
4642
4643 @param wdiAddBAReqParams: the add BA parameters as specified by
4644 the Device Interface
4645
4646 wdiAddBARspCb: callback for passing back the response of
4647 the add BA operation received from the device
4648
4649 pUserData: user data will be passed back with the
4650 callback
4651
4652 @see WDI_PostAssocReq
4653 @return Result of the function call
4654*/
4655WDI_Status
4656WDI_TriggerBAReq
4657(
4658 WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams,
4659 WDI_TriggerBARspCb wdiTriggerBARspCb,
4660 void* pUserData
4661)
4662{
4663 WDI_EventInfoType wdiEventData;
4664 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4665
4666 /*------------------------------------------------------------------------
4667 Sanity Check
4668 ------------------------------------------------------------------------*/
4669 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4670 {
4671 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4672 "WDI API call before module is initialized - Fail request");
4673
4674 return WDI_STATUS_E_NOT_ALLOWED;
4675 }
4676
4677 /*------------------------------------------------------------------------
4678 Fill in Event data and post to the Main FSM
4679 ------------------------------------------------------------------------*/
4680 wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ;
4681 wdiEventData.pEventData = pwdiTriggerBAReqParams;
4682 wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams);
4683 wdiEventData.pCBfnc = wdiTriggerBARspCb;
4684 wdiEventData.pUserData = pUserData;
4685
4686 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4687
4688}/*WDI_AddBAReq*/
4689
4690/**
4691 @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC
4692 wishes to update any of the Beacon parameters used by HW.
4693 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request
4694 message to the lower RIVA sub-system if DAL is in state
4695 STARTED.
4696
4697 In state BUSY this request will be queued. Request won't
4698 be allowed in any other state.
4699
4700 WDI_PostAssocReq must have been called.
4701
4702 @param wdiUpdateBeaconParams: the Beacon parameters as specified
4703 by the Device Interface
4704
4705 wdiUpdateBeaconParamsRspCb: callback for passing back the
4706 response of the start operation received from the device
4707
4708 pUserData: user data will be passed back with the
4709 callback
4710
4711 @see WDI_PostAssocReq
4712 @return Result of the function call
4713*/
4714WDI_Status
4715WDI_UpdateBeaconParamsReq
4716(
4717 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams,
4718 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb,
4719 void* pUserData
4720)
4721{
4722 WDI_EventInfoType wdiEventData;
4723 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4724
4725 /*------------------------------------------------------------------------
4726 Sanity Check
4727 ------------------------------------------------------------------------*/
4728 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4729 {
4730 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4731 "WDI API call before module is initialized - Fail request");
4732
4733 return WDI_STATUS_E_NOT_ALLOWED;
4734 }
4735
4736 /*------------------------------------------------------------------------
4737 Fill in Event data and post to the Main FSM
4738 ------------------------------------------------------------------------*/
4739 wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ;
4740 wdiEventData.pEventData = pwdiUpdateBeaconParams;
4741 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams);
4742 wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb;
4743 wdiEventData.pUserData = pUserData;
4744
4745 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4746
4747}/*WDI_UpdateBeaconParamsReq*/
4748
4749/**
4750 @brief WDI_SendBeaconParamsReq will be called when the upper MAC
4751 wishes to update the Beacon template used by HW.
4752 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request
4753 message to the lower RIVA sub-system if DAL is in state
4754 STARTED.
4755
4756 In state BUSY this request will be queued. Request won't
4757 be allowed in any other state.
4758
4759 WDI_PostAssocReq must have been called.
4760
4761 @param wdiSendBeaconParams: the Beacon parameters as specified
4762 by the Device Interface
4763
4764 wdiSendBeaconParamsRspCb: callback for passing back the
4765 response of the start operation received from the device
4766
4767 pUserData: user data will be passed back with the
4768 callback
4769
4770 @see WDI_PostAssocReq
4771 @return Result of the function call
4772*/
4773WDI_Status
4774WDI_SendBeaconParamsReq
4775(
4776 WDI_SendBeaconParamsType* pwdiSendBeaconParams,
4777 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb,
4778 void* pUserData
4779)
4780{
4781 WDI_EventInfoType wdiEventData;
4782 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4783
4784 /*------------------------------------------------------------------------
4785 Sanity Check
4786 ------------------------------------------------------------------------*/
4787 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4788 {
4789 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4790 "WDI API call before module is initialized - Fail request");
4791
4792 return WDI_STATUS_E_NOT_ALLOWED;
4793 }
4794
4795 /*------------------------------------------------------------------------
4796 Fill in Event data and post to the Main FSM
4797 ------------------------------------------------------------------------*/
4798 wdiEventData.wdiRequest = WDI_SND_BCON_REQ;
4799 wdiEventData.pEventData = pwdiSendBeaconParams;
4800 wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams);
4801 wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb;
4802 wdiEventData.pUserData = pUserData;
4803
4804 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4805
4806}/*WDI_SendBeaconParamsReq*/
4807
4808/**
4809 @brief WDI_UpdateProbeRspTemplateReq will be called when the
4810 upper MAC wants to update the probe response template to
4811 be transmitted as Soft AP
4812 Upon the call of this API the WLAN DAL will
4813 pack and send the probe rsp template message to the
4814 lower RIVA sub-system if DAL is in state STARTED.
4815
4816 In state BUSY this request will be queued. Request won't
4817 be allowed in any other state.
4818
4819
4820 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
4821 specified by the Device Interface
4822
4823 wdiSendBeaconParamsRspCb: callback for passing back the
4824 response of the Send Beacon Params operation received
4825 from the device
4826
4827 pUserData: user data will be passed back with the
4828 callback
4829
4830 @see WDI_AddBAReq
4831 @return Result of the function call
4832*/
4833
4834WDI_Status
4835WDI_UpdateProbeRspTemplateReq
4836(
4837 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams,
4838 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb,
4839 void* pUserData
4840)
4841{
4842 WDI_EventInfoType wdiEventData;
4843 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4844
4845 /*------------------------------------------------------------------------
4846 Sanity Check
4847 ------------------------------------------------------------------------*/
4848 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4849 {
4850 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4851 "WDI API call before module is initialized - Fail request");
4852
4853 return WDI_STATUS_E_NOT_ALLOWED;
4854 }
4855
4856 /*------------------------------------------------------------------------
4857 Fill in Event data and post to the Main FSM
4858 ------------------------------------------------------------------------*/
4859 wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ;
4860 wdiEventData.pEventData = pwdiUpdateProbeRspParams;
4861 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams);
4862 wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb;
4863 wdiEventData.pUserData = pUserData;
4864
4865 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4866
4867}/*WDI_UpdateProbeRspTemplateReq*/
4868
4869/**
4870 @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob
4871 to the NV memory.
4872
4873
4874 @param wdiNvDownloadReqParams: the NV Download parameters as specified by
4875 the Device Interface
4876
4877 wdiNvDownloadRspCb: callback for passing back the response of
4878 the NV Download operation received from the device
4879
4880 pUserData: user data will be passed back with the
4881 callback
4882
4883 @see WDI_PostAssocReq
4884 @return Result of the function call
4885*/
4886WDI_Status
4887WDI_NvDownloadReq
4888(
4889 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams,
4890 WDI_NvDownloadRspCb wdiNvDownloadRspCb,
4891 void* pUserData
4892)
4893{
4894 WDI_EventInfoType wdiEventData;
4895
4896 /*------------------------------------------------------------------------
4897 Sanity Check
4898 ------------------------------------------------------------------------*/
4899 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4900 {
4901 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4902 "WDI API call before module is initialized - Fail request");
4903
4904 return WDI_STATUS_E_NOT_ALLOWED;
4905 }
4906
4907 /*------------------------------------------------------------------------
4908 Fill in Event data and post to the Main FSM
4909 ------------------------------------------------------------------------*/
4910 wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ;
4911 wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams;
4912 wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams);
4913 wdiEventData.pCBfnc = wdiNvDownloadRspCb;
4914 wdiEventData.pUserData = pUserData;
4915
4916 return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData);
4917
4918}/*WDI_NVDownloadReq*/
4919
4920#ifdef WLAN_FEATURE_P2P
4921/**
4922 @brief WDI_SetP2PGONOAReq will be called when the
4923 upper MAC wants to send Notice of Absence
4924 Upon the call of this API the WLAN DAL will
4925 pack and send the probe rsp template message to the
4926 lower RIVA sub-system if DAL is in state STARTED.
4927
4928 In state BUSY this request will be queued. Request won't
4929 be allowed in any other state.
4930
4931
4932 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
4933 specified by the Device Interface
4934
4935 wdiSendBeaconParamsRspCb: callback for passing back the
4936 response of the Send Beacon Params operation received
4937 from the device
4938
4939 pUserData: user data will be passed back with the
4940 callback
4941
4942 @see WDI_AddBAReq
4943 @return Result of the function call
4944*/
4945WDI_Status
4946WDI_SetP2PGONOAReq
4947(
4948 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams,
4949 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb,
4950 void* pUserData
4951)
4952{
4953 WDI_EventInfoType wdiEventData;
4954 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4955
4956 /*------------------------------------------------------------------------
4957 Sanity Check
4958 ------------------------------------------------------------------------*/
4959 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4960 {
4961 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4962 "WDI API call before module is initialized - Fail request");
4963
4964 return WDI_STATUS_E_NOT_ALLOWED;
4965 }
4966
4967 /*------------------------------------------------------------------------
4968 Fill in Event data and post to the Main FSM
4969 ------------------------------------------------------------------------*/
4970 wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ;
4971 wdiEventData.pEventData = pwdiP2PGONOAReqParams;
4972 wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams);
4973 wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb;
4974 wdiEventData.pUserData = pUserData;
4975
4976 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4977
4978}/*WDI_SetP2PGONOAReq*/
4979#endif
4980
4981/**
4982 @brief WDI_AddSTASelfReq will be called when the
4983 UMAC wanted to add STA self while opening any new session
4984 In state BUSY this request will be queued. Request won't
4985 be allowed in any other state.
4986
4987
4988 @param pwdiAddSTASelfParams: the add sta self parameters as
4989 specified by the Device Interface
4990
4991 pUserData: user data will be passed back with the
4992 callback
4993
4994 @see
4995 @return Result of the function call
4996*/
4997WDI_Status
4998WDI_AddSTASelfReq
4999(
5000 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams,
5001 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb,
5002 void* pUserData
5003)
5004{
5005 WDI_EventInfoType wdiEventData;
5006 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5007
5008 /*------------------------------------------------------------------------
5009 Sanity Check
5010 ------------------------------------------------------------------------*/
5011 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5012 {
5013 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5014 "WDI API call before module is initialized - Fail request");
5015
5016 return WDI_STATUS_E_NOT_ALLOWED;
5017 }
5018
5019 /*------------------------------------------------------------------------
5020 Fill in Event data and post to the Main FSM
5021 ------------------------------------------------------------------------*/
5022 wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ;
5023 wdiEventData.pEventData = pwdiAddSTASelfReqParams;
5024 wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams);
5025 wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb;
5026 wdiEventData.pUserData = pUserData;
5027
5028 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5029
5030}/*WDI_AddSTASelfReq*/
5031
5032
5033#ifdef WLAN_FEATURE_VOWIFI_11R
5034/**
5035 @brief WDI_AggrAddTSReq will be called when the upper MAC to inform
5036 the device of a successful add TSpec negotiation. HW
5037 needs to receive the TSpec Info from the UMAC in order
5038 to configure properly the QoS data traffic. Upon the
5039 call of this API the WLAN DAL will pack and send a HAL
5040 Add TS request message to the lower RIVA sub-system if
5041 DAL is in state STARTED.
5042
5043 In state BUSY this request will be queued. Request won't
5044 be allowed in any other state.
5045
5046 WDI_PostAssocReq must have been called.
5047
5048 @param wdiAddTsReqParams: the add TS parameters as specified by
5049 the Device Interface
5050
5051 wdiAddTsRspCb: callback for passing back the response of
5052 the add TS operation received from the device
5053
5054 pUserData: user data will be passed back with the
5055 callback
5056
5057 @see WDI_PostAssocReq
5058 @return Result of the function call
5059*/
5060WDI_Status
5061WDI_AggrAddTSReq
5062(
5063 WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams,
5064 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb,
5065 void* pUserData
5066)
5067{
5068 WDI_EventInfoType wdiEventData;
5069 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5070
5071 /*------------------------------------------------------------------------
5072 Sanity Check
5073 ------------------------------------------------------------------------*/
5074 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5075 {
5076 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5077 "WDI API call before module is initialized - Fail request");
5078
5079 return WDI_STATUS_E_NOT_ALLOWED;
5080 }
5081
5082 /*------------------------------------------------------------------------
5083 Fill in Event data and post to the Main FSM
5084 ------------------------------------------------------------------------*/
5085 wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ;
5086 wdiEventData.pEventData = pwdiAggrAddTsReqParams;
5087 wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams);
5088 wdiEventData.pCBfnc = wdiAggrAddTsRspCb;
5089 wdiEventData.pUserData = pUserData;
5090
5091 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5092
5093}/*WDI_AggrAddTSReq*/
5094
5095#endif /* WLAN_FEATURE_VOWIFI_11R */
5096
5097#ifdef ANI_MANF_DIAG
5098/**
5099 @brief WDI_FTMCommandReq
5100 Post FTM Command Event
5101
5102 @param ftmCommandReq: FTM Command Body
5103 @param ftmCommandRspCb: FTM Response from HAL CB
5104 @param pUserData: Client Data
5105
5106 @see
5107 @return Result of the function call
5108*/
5109WDI_Status
5110WDI_FTMCommandReq
5111(
5112 WDI_FTMCommandReqType *ftmCommandReq,
5113 WDI_FTMCommandRspCb ftmCommandRspCb,
5114 void *pUserData
5115)
5116{
5117 WDI_EventInfoType wdiEventData;
5118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5119
5120 /*------------------------------------------------------------------------
5121 Sanity Check
5122 ------------------------------------------------------------------------*/
5123 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5124 {
5125 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5126 "WDI API call before module is initialized - Fail request");
5127
5128 return WDI_STATUS_E_NOT_ALLOWED;
5129 }
5130
5131 /*------------------------------------------------------------------------
5132 Fill in Event data and post to the Main FSM
5133 ------------------------------------------------------------------------*/
5134 wdiEventData.wdiRequest = WDI_FTM_CMD_REQ;
5135 wdiEventData.pEventData = (void *)ftmCommandReq;
5136 wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32);
5137 wdiEventData.pCBfnc = ftmCommandRspCb;
5138 wdiEventData.pUserData = pUserData;
5139
5140 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5141}
5142#endif /* ANI_MANF_DIAG */
5143/**
5144 @brief WDI_HostResumeReq will be called
5145
5146 In state BUSY this request will be queued. Request won't
5147 be allowed in any other state.
5148
5149
5150 @param pwdiResumeReqParams: as specified by
5151 the Device Interface
5152
5153 wdiResumeReqRspCb: callback for passing back the response of
5154 the Resume Req received from the device
5155
5156 pUserData: user data will be passed back with the
5157 callback
5158
5159 @see
5160 @return Result of the function call
5161*/
5162WDI_Status
5163WDI_HostResumeReq
5164(
5165 WDI_ResumeParamsType* pwdiResumeReqParams,
5166 WDI_HostResumeEventRspCb wdiResumeReqRspCb,
5167 void* pUserData
5168)
5169{
5170 WDI_EventInfoType wdiEventData;
5171 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5172
5173 /*------------------------------------------------------------------------
5174 Sanity Check
5175 ------------------------------------------------------------------------*/
5176 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5177 {
5178 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5179 "WDI API call before module is initialized - Fail request");
5180
5181 return WDI_STATUS_E_NOT_ALLOWED;
5182 }
5183
5184 /*------------------------------------------------------------------------
5185 Fill in Event data and post to the Main FSM
5186 ------------------------------------------------------------------------*/
5187 wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ;
5188 wdiEventData.pEventData = pwdiResumeReqParams;
5189 wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams);
5190 wdiEventData.pCBfnc = wdiResumeReqRspCb;
5191 wdiEventData.pUserData = pUserData;
5192
5193 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5194
5195}/*WDI_HostResumeReq*/
5196
5197/**
5198 @brief WDI_DelSTASelfReq will be called
5199
5200 In state BUSY this request will be queued. Request won't
5201 be allowed in any other state.
5202
5203
5204 @param pwdiDelStaSelfReqParams: as specified by
5205 the Device Interface
5206
5207 wdiDelStaSelfRspCb: callback for passing back the response of
5208 the add TS operation received from the device
5209
5210 pUserData: user data will be passed back with the
5211 callback
5212
5213 @see WDI_PostAssocReq
5214 @return Result of the function call
5215*/
5216WDI_Status
5217WDI_DelSTASelfReq
5218(
5219 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams,
5220 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb,
5221 void* pUserData
5222)
5223{
5224 WDI_EventInfoType wdiEventData;
5225 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5226
5227 /*------------------------------------------------------------------------
5228 Sanity Check
5229 ------------------------------------------------------------------------*/
5230 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5231 {
5232 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5233 "WDI API call before module is initialized - Fail request");
5234
5235 return WDI_STATUS_E_NOT_ALLOWED;
5236 }
5237
5238 /*------------------------------------------------------------------------
5239 Fill in Event data and post to the Main FSM
5240 ------------------------------------------------------------------------*/
5241 wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ;
5242 wdiEventData.pEventData = pwdiDelStaSelfReqParams;
5243 wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams);
5244 wdiEventData.pCBfnc = wdiDelStaSelfRspCb;
5245 wdiEventData.pUserData = pUserData;
5246
5247 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5248
5249}/*WDI_AggrAddTSReq*/
5250
5251/**
5252 @brief WDI_SetTxPerTrackingReq will be called when the upper MAC
5253 wants to set the Tx Per Tracking configurations.
5254 Upon the call of this API the WLAN DAL will pack
5255 and send a HAL Set Tx Per Tracking request message to the
5256 lower RIVA sub-system if DAL is in state STARTED.
5257
5258 In state BUSY this request will be queued. Request won't
5259 be allowed in any other state.
5260
5261 @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as
5262 specified by the Device Interface
5263
5264 pwdiSetTxPerTrackingRspCb: callback for passing back the
5265 response of the set Tx PER Tracking configurations operation received
5266 from the device
5267
5268 pUserData: user data will be passed back with the
5269 callback
5270
5271 @return Result of the function call
5272*/
5273WDI_Status
5274WDI_SetTxPerTrackingReq
5275(
5276 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams,
5277 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb,
5278 void* pUserData
5279)
5280{
5281 WDI_EventInfoType wdiEventData;
5282 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5283
5284 /*------------------------------------------------------------------------
5285 Sanity Check
5286 ------------------------------------------------------------------------*/
5287 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5288 {
5289 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5290 "WDI API call before module is initialized - Fail request");
5291
5292 return WDI_STATUS_E_NOT_ALLOWED;
5293 }
5294
5295 /*------------------------------------------------------------------------
5296 Fill in Event data and post to the Main FSM
5297 ------------------------------------------------------------------------*/
5298 wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ;
5299 wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams;
5300 wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams);
5301 wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb;
5302 wdiEventData.pUserData = pUserData;
5303
5304 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5305
5306}/*WDI_SetTxPerTrackingReq*/
5307
5308/**
5309 @brief WDI_SetTmLevelReq
5310 If HW Thermal condition changed, driver should react based on new
5311 HW thermal condition.
5312
5313 @param pwdiSetTmLevelReq: New thermal condition information
5314
5315 pwdiSetTmLevelRspCb: callback
5316
5317 usrData: user data will be passed back with the
5318 callback
5319
5320 @return Result of the function call
5321*/
5322WDI_Status
5323WDI_SetTmLevelReq
5324(
5325 WDI_SetTmLevelReqType *pwdiSetTmLevelReq,
5326 WDI_SetTmLevelCb pwdiSetTmLevelRspCb,
5327 void *usrData
5328)
5329{
5330 WDI_EventInfoType wdiEventData;
5331 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5332
5333 /*------------------------------------------------------------------------
5334 Sanity Check
5335 ------------------------------------------------------------------------*/
5336 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5337 {
5338 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5339 "WDI API call before module is initialized - Fail request");
5340
5341 return WDI_STATUS_E_NOT_ALLOWED;
5342 }
5343
5344 /*------------------------------------------------------------------------
5345 Fill in Event data and post to the Main FSM
5346 ------------------------------------------------------------------------*/
5347 wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ;
5348 wdiEventData.pEventData = pwdiSetTmLevelReq;
5349 wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq);
5350 wdiEventData.pCBfnc = pwdiSetTmLevelRspCb;
5351 wdiEventData.pUserData = usrData;
5352
5353 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5354}
5355
5356/**
5357 @brief WDI_HostSuspendInd
5358
5359 Suspend Indication from the upper layer will be sent
5360 down to HAL
5361
5362 @param WDI_SuspendResumeIndParamsType
5363
5364 @see
5365
5366 @return Status of the request
5367*/
5368WDI_Status
5369WDI_HostSuspendInd
5370(
5371 WDI_SuspendParamsType* pwdiSuspendIndParams
5372)
5373{
5374
5375 WDI_EventInfoType wdiEventData;
5376 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5377
5378 /*------------------------------------------------------------------------
5379 Sanity Check
5380 ------------------------------------------------------------------------*/
5381 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5382 {
5383 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5384 "WDI API call before module is initialized - Fail request");
5385
5386 return WDI_STATUS_E_NOT_ALLOWED;
5387 }
5388
5389 /*------------------------------------------------------------------------
5390 Fill in Event data and post to the Main FSM
5391 ------------------------------------------------------------------------*/
5392 wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND;
5393 wdiEventData.pEventData = pwdiSuspendIndParams;
5394 wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams);
5395 wdiEventData.pCBfnc = NULL;
5396 wdiEventData.pUserData = NULL;
5397
5398 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5399
5400}/*WDI_HostSuspendInd*/
5401
5402/**
5403 @brief WDI_HALDumpCmdReq
5404 Post HAL DUMP Command Event
5405
5406 @param halDumpCmdReqParams: Hal Dump Command Body
5407 @param halDumpCmdRspCb: HAL DUMP Response from HAL CB
5408 @param pUserData: Client Data
5409
5410 @see
5411 @return Result of the function call
5412*/
5413WDI_Status WDI_HALDumpCmdReq
5414(
5415 WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams,
5416 WDI_HALDumpCmdRspCb halDumpCmdRspCb,
5417 void *pUserData
5418)
5419{
5420 WDI_EventInfoType wdiEventData;
5421 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5422
5423 /*------------------------------------------------------------------------
5424 Sanity Check
5425 ------------------------------------------------------------------------*/
5426 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5427 {
5428 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5429 "WDI API call before module is initialized - Fail request");
5430
5431 return WDI_STATUS_E_NOT_ALLOWED;
5432 }
5433
5434 /*------------------------------------------------------------------------
5435 Fill in Event data and post to the Main FSM
5436 ------------------------------------------------------------------------*/
5437 wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ;
5438 wdiEventData.pEventData = (void *)halDumpCmdReqParams;
5439 wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType);
5440 wdiEventData.pCBfnc = halDumpCmdRspCb;
5441 wdiEventData.pUserData = pUserData;
5442
5443 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5444}
5445
5446/*============================================================================
5447
5448 DAL Control Path Main FSM Function Implementation
5449
5450 ============================================================================*/
5451
5452/**
5453 @brief Main FSM Start function for all states except BUSY
5454
5455
5456 @param pWDICtx: pointer to the WLAN DAL context
5457 wdiEV: event posted to the main DAL FSM
5458 pEventData: pointer to the event information
5459 structure
5460
5461 @see
5462 @return Result of the function call
5463*/
5464WDI_Status
5465WDI_PostMainEvent
5466(
5467 WDI_ControlBlockType* pWDICtx,
5468 WDI_MainEventType wdiEV,
5469 WDI_EventInfoType* pEventData
5470
5471)
5472{
5473 WDI_Status wdiStatus;
5474 WDI_MainFuncType pfnWDIMainEvHdlr;
5475 WDI_MainStateType wdiOldState;
5476 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5477
5478 /*-------------------------------------------------------------------------
5479 Sanity check
5480 -------------------------------------------------------------------------*/
5481 if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) ||
5482 ( wdiEV >= WDI_MAX_EVENT ))
5483 {
5484 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5485 "Invalid state or event in Post Main Ev function ST: %d EV: %d",
5486 pWDICtx->uGlobalState, wdiEV);
5487 return WDI_STATUS_E_NOT_ALLOWED;
5488 }
5489
5490 /*Access to the global state must be locked */
5491 wpalMutexAcquire(&pWDICtx->wptMutex);
5492
5493 /*Fetch event handler for state*/
5494 pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV];
5495
5496 wdiOldState = pWDICtx->uGlobalState;
5497
5498 /*
5499 --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a
5500 response comes from CCPU for the request sent by host:
5501 the WDI global state will be in WDI_BUSY_ST already, so do not set it to BUSY again.
5502 This state will be set to WDI_STARTED_ST in WDI_MainRsp, if it is a expected response.
5503 --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the
5504 CCPU:
5505 don't change the state */
5506 if ( WDI_RESPONSE_EVENT != wdiEV)
5507 {
5508 /*Transition to BUSY State - the request is now being processed by the FSM,
5509 if the request fails we shall transition back to the old state, if not
5510 the request will manage its own state transition*/
5511 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
5512 }
5513 /* If the state function associated with the EV is NULL it means that this
5514 event is not allowed in this state*/
5515 if ( NULL != pfnWDIMainEvHdlr )
5516 {
5517 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5518 "Posting event %d in state: %d to the Main FSM",
5519 wdiEV, wdiOldState);
5520 wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData);
5521 }
5522 else
5523 {
5524 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5525 "Unexpected event %d in state: %d",
5526 wdiEV, wdiOldState);
5527 wdiStatus = WDI_STATUS_E_NOT_ALLOWED;
5528 }
5529
5530 /* If a request handles itself well it will end up in a success or in a
5531 pending
5532 Success - means that the request was processed and the proper state
5533 transition already occurred or will occur when the resp is received
5534 - NO other state transition or dequeueing is required
5535
5536 Pending - means the request could not be processed at this moment in time
5537 because the FSM was already busy so no state transition or dequeueing
5538 is necessary anymore
5539
5540 Success for synchronous case means that the transition may occur and
5541 processing of pending requests may continue - so it should go through
5542 and restores the state and continue processing queued requests*/
5543 if (( WDI_STATUS_SUCCESS != wdiStatus )&&
5544 ( WDI_STATUS_PENDING != wdiStatus ))
5545 {
5546 if ( WDI_RESPONSE_EVENT != wdiEV)
5547 {
5548 /*The request has failed or could not be processed - transition back to
5549 the old state - check to see if anything was queued and try to execute
5550 The dequeue logic should post a message to a thread and return - no
5551 actual processing can occur */
5552 WDI_STATE_TRANSITION( pWDICtx, wdiOldState);
5553 }
5554 WDI_DequeuePendingReq(pWDICtx);
5555
5556 }
5557
5558 /* we have completed processing the event */
5559 wpalMutexRelease(&pWDICtx->wptMutex);
5560
5561 return wdiStatus;
5562
5563}/*WDI_PostMainEvent*/
5564
5565
5566/*--------------------------------------------------------------------------
5567 INIT State Functions
5568--------------------------------------------------------------------------*/
5569/**
5570 @brief Main FSM Start function for all states except BUSY
5571
5572
5573 @param pWDICtx: pointer to the WLAN DAL context
5574 pEventData: pointer to the event information structure
5575
5576 @see
5577 @return Result of the function call
5578*/
5579WDI_Status
5580WDI_MainStart
5581(
5582 WDI_ControlBlockType* pWDICtx,
5583 WDI_EventInfoType* pEventData
5584)
5585{
5586
5587 /*--------------------------------------------------------------------
5588 Sanity Check
5589 ----------------------------------------------------------------------*/
5590 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5591 {
5592 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5593 "Invalid parameters on Main Start %x %x",
5594 pWDICtx, pEventData);
5595 return WDI_STATUS_E_FAILURE;
5596 }
5597
5598 wpalMutexAcquire(&pWDICtx->wptMutex);
5599
5600 /*--------------------------------------------------------------------
5601 Check if the Control Transport has been opened
5602 ----------------------------------------------------------------------*/
5603 if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened )
5604 {
5605 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5606 "Control Transport not yet Open - queueing the request");
5607
5608 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
5609 WDI_QueuePendingReq( pWDICtx, pEventData);
5610
5611 wpalMutexRelease(&pWDICtx->wptMutex);
5612 return WDI_STATUS_PENDING;
5613 }
5614
5615 wpalMutexRelease(&pWDICtx->wptMutex);
5616
5617 /*Return Success*/
5618 return WDI_ProcessRequest( pWDICtx, pEventData );
5619
5620}/*WDI_MainStart*/
5621
5622/**
5623 @brief Main FSM Response function for state INIT
5624
5625
5626 @param pWDICtx: pointer to the WLAN DAL context
5627 pEventData: pointer to the event information structure
5628
5629 @see
5630 @return Result of the function call
5631*/
5632WDI_Status
5633WDI_MainRspInit
5634(
5635 WDI_ControlBlockType* pWDICtx,
5636 WDI_EventInfoType* pEventData
5637)
5638{
5639 /*------------------------------------------------------------------------
5640 Not expecting a response from the device before it is started
5641 ------------------------------------------------------------------------*/
5642 WDI_ASSERT(0);
5643
5644 /*Return Success*/
5645 return WDI_STATUS_E_NOT_ALLOWED;
5646}/* WDI_MainRspInit */
5647
5648/**
5649 @brief Main FSM Close function for all states except BUSY
5650
5651
5652 @param pWDICtx: pointer to the WLAN DAL context
5653 pEventData: pointer to the event information structure
5654
5655 @see
5656 @return Result of the function call
5657*/
5658WDI_Status
5659WDI_MainClose
5660(
5661 WDI_ControlBlockType* pWDICtx,
5662 WDI_EventInfoType* pEventData
5663)
5664{
5665
5666 /*--------------------------------------------------------------------
5667 Sanity Check
5668 ----------------------------------------------------------------------*/
5669 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5670 {
5671 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5672 "Invalid parameters on Main Close %x %x",
5673 pWDICtx, pEventData);
5674 return WDI_STATUS_E_FAILURE;
5675 }
5676
5677 /*Return Success*/
5678 return WDI_ProcessRequest( pWDICtx, pEventData );
5679
5680}/*WDI_MainClose*/
5681/*--------------------------------------------------------------------------
5682 STARTED State Functions
5683--------------------------------------------------------------------------*/
5684/**
5685 @brief Main FSM Start function for state STARTED
5686
5687
5688 @param pWDICtx: pointer to the WLAN DAL context
5689 pEventData: pointer to the event information structure
5690
5691 @see
5692 @return Result of the function call
5693*/
5694WDI_Status
5695WDI_MainStartStarted
5696(
5697 WDI_ControlBlockType* pWDICtx,
5698 WDI_EventInfoType* pEventData
5699)
5700{
5701 WDI_StartRspCb wdiStartRspCb = NULL;
5702 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5703
5704 /*--------------------------------------------------------------------
5705 Sanity Check
5706 ----------------------------------------------------------------------*/
5707 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5708 {
5709 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5710 "Invalid parameters on Main Start %x %x",
5711 pWDICtx, pEventData);
5712 return WDI_STATUS_E_FAILURE;
5713 }
5714
5715 /*--------------------------------------------------------------------
5716 Nothing to do transport was already started
5717 ----------------------------------------------------------------------*/
5718 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5719 "Received start while transport was already started - nothing to do");
5720
5721 wpalMutexAcquire(&pWDICtx->wptMutex);
5722
5723 /*Transition back to started because the post function transitioned us to
5724 busy*/
5725 WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST);
5726
5727 /*Check to see if any request is pending*/
5728 WDI_DequeuePendingReq(pWDICtx);
5729
5730 wpalMutexRelease(&pWDICtx->wptMutex);
5731
5732 /*Tell UMAC Success*/
5733 wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc;
5734
5735 /*Notify UMAC*/
5736 wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData);
5737
5738 /*Return Success*/
5739 return WDI_STATUS_SUCCESS;
5740
5741}/*WDI_MainStartStarted*/
5742
5743/**
5744 @brief Main FSM Stop function for state STARTED
5745
5746
5747 @param pWDICtx: pointer to the WLAN DAL context
5748 pEventData: pointer to the event information structure
5749
5750 @see
5751 @return Result of the function call
5752*/
5753WDI_Status
5754WDI_MainStopStarted
5755(
5756 WDI_ControlBlockType* pWDICtx,
5757 WDI_EventInfoType* pEventData
5758)
5759{
5760 /*--------------------------------------------------------------------
5761 Sanity Check
5762 ----------------------------------------------------------------------*/
5763 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5764 {
5765 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5766 "Invalid parameters on Main Start %x %x",
5767 pWDICtx, pEventData);
5768 return WDI_STATUS_E_FAILURE;
5769 }
5770
5771 /*State at this point is BUSY - because we enter this state before posting
5772 an event to the FSM in order to prevent potential race conditions*/
5773
5774 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
5775 "Processing stop request in FSM");
5776
5777 /*Return Success*/
5778 return WDI_ProcessRequest( pWDICtx, pEventData );
5779
5780}/*WDI_MainStopStarted*/
5781/**
5782 @brief Main FSM Request function for state started
5783
5784
5785 @param pWDICtx: pointer to the WLAN DAL context
5786 pEventData: pointer to the event information structure
5787
5788 @see
5789 @return Result of the function call
5790*/
5791WDI_Status
5792WDI_MainReqStarted
5793(
5794 WDI_ControlBlockType* pWDICtx,
5795 WDI_EventInfoType* pEventData
5796)
5797{
5798
5799 /*--------------------------------------------------------------------
5800 Sanity Check
5801 ----------------------------------------------------------------------*/
5802 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5803 {
5804 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5805 "Invalid parameters on Main Req Started %x %x",
5806 pWDICtx, pEventData);
5807 return WDI_STATUS_E_FAILURE;
5808 }
5809
5810 /*State at this point is BUSY - because we enter this state before posting
5811 an event to the FSM in order to prevent potential race conditions*/
5812
5813 /*Return Success*/
5814 return WDI_ProcessRequest( pWDICtx, pEventData );
5815
5816}/*WDI_MainReqStarted*/
5817
5818/**
5819 @brief Main FSM Response function for all states except INIT
5820
5821
5822 @param pWDICtx: pointer to the WLAN DAL context
5823 pEventData: pointer to the event information structure
5824
5825 @see
5826 @return Result of the function call
5827*/
5828WDI_Status
5829WDI_MainRsp
5830(
5831 WDI_ControlBlockType* pWDICtx,
5832 WDI_EventInfoType* pEventData
5833)
5834{
5835 WDI_Status wdiStatus;
5836 wpt_boolean expectedResponse;
5837
5838 /*--------------------------------------------------------------------
5839 Sanity Check
5840 ----------------------------------------------------------------------*/
5841 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5842 {
5843 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5844 "Invalid parameters on Main Response %x %x",
5845 pWDICtx, pEventData);
5846 return WDI_STATUS_E_FAILURE;
5847 }
5848
5849 if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse )
5850 {
5851 /* we received an expected response */
5852 expectedResponse = eWLAN_PAL_TRUE;
5853
5854 /*We expect that we will transition to started after this processing*/
5855 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
5856
5857 /* we are no longer expecting a response */
5858 pWDICtx->wdiExpectedResponse = WDI_MAX_RESP;
5859 }
5860 else
5861 {
5862 /* we received an indication or unexpected response */
5863 expectedResponse = eWLAN_PAL_FALSE;
5864 /* for indications no need to update state from what it is right
5865 now, unless it explicitly does it in the indication handler (say
5866 for device failure ind) */
5867 pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState;
5868 }
5869
5870 /*Process the response and indication */
5871 wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData );
5872
5873 /*Lock the CB as we are about to do a state transition*/
5874 wpalMutexAcquire(&pWDICtx->wptMutex);
5875
5876 /*Transition to the expected state after the response processing
5877 - this should always be started state with the following exceptions:
5878 1. processing of a failed start response
5879 2. device failure detected while processing response
5880 3. stop response received*/
5881 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
5882
5883 /*Dequeue request that may have been queued while we were waiting for the
5884 response */
5885 if ( expectedResponse )
5886 {
5887 WDI_DequeuePendingReq(pWDICtx);
5888 }
5889
5890 wpalMutexRelease(&pWDICtx->wptMutex);
5891
5892 /*Return Success - always */
5893 return WDI_STATUS_SUCCESS;
5894
5895}/*WDI_MainRsp*/
5896
5897/*--------------------------------------------------------------------------
5898 STOPPED State Functions
5899--------------------------------------------------------------------------*/
5900/**
5901 @brief Main FSM Stop function for state STOPPED
5902
5903
5904 @param pWDICtx: pointer to the WLAN DAL context
5905 pEventData: pointer to the event information structure
5906
5907 @see
5908 @return Result of the function call
5909*/
5910WDI_Status
5911WDI_MainStopStopped
5912(
5913 WDI_ControlBlockType* pWDICtx,
5914 WDI_EventInfoType* pEventData
5915)
5916{
5917 /*--------------------------------------------------------------------
5918 Sanity Check
5919 ----------------------------------------------------------------------*/
5920 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5921 {
5922 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5923 "Invalid parameters on Main Stop Stopped %x %x",
5924 pWDICtx, pEventData);
5925 return WDI_STATUS_E_FAILURE;
5926 }
5927
5928 /*We should normally not get a STOP request if we are already stopped
5929 since we should normally be stopped by the UMAC. However in some
5930 error situations we put ourselves in the stopped state without the
5931 UMAC knowing, so when we get a STOP request in this state we still
5932 process it since we need to clean up the underlying state */
5933 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5934 "Processing stop request while stopped in FSM");
5935
5936 /*Return Success*/
5937 return WDI_ProcessRequest( pWDICtx, pEventData );
5938
5939}/*WDI_MainStopStopped*/
5940
5941/*--------------------------------------------------------------------------
5942 BUSY State Functions
5943--------------------------------------------------------------------------*/
5944/**
5945 @brief Main FSM Start function for state BUSY
5946
5947
5948 @param pWDICtx: pointer to the WLAN DAL context
5949 pEventData: pointer to the event information structure
5950
5951 @see
5952 @return Result of the function call
5953*/
5954WDI_Status
5955WDI_MainStartBusy
5956(
5957 WDI_ControlBlockType* pWDICtx,
5958 WDI_EventInfoType* pEventData
5959)
5960{
5961 /*--------------------------------------------------------------------
5962 Sanity Check
5963 ----------------------------------------------------------------------*/
5964 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5965 {
5966 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5967 "Invalid parameters on Main Start in BUSY %x %x",
5968 pWDICtx, pEventData);
5969 return WDI_STATUS_E_FAILURE;
5970 }
5971
5972 /*--------------------------------------------------------------------
5973 Check if the Control Transport has been opened
5974 ----------------------------------------------------------------------*/
5975 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5976 "WDI Busy state - queue start request");
5977
5978 /*Queue the start request*/
5979 WDI_QueuePendingReq( pWDICtx, pEventData);
5980
5981 /*Return Success*/
5982 return WDI_STATUS_PENDING;
5983}/*WDI_MainStartBusy*/
5984
5985/**
5986 @brief Main FSM Stop function for state BUSY
5987
5988
5989 @param pWDICtx: pointer to the WLAN DAL context
5990 pEventData: pointer to the event information structure
5991
5992 @see
5993 @return Result of the function call
5994*/
5995WDI_Status
5996WDI_MainStopBusy
5997(
5998 WDI_ControlBlockType* pWDICtx,
5999 WDI_EventInfoType* pEventData
6000)
6001{
6002 /*--------------------------------------------------------------------
6003 Sanity Check
6004 ----------------------------------------------------------------------*/
6005 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6006 {
6007 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6008 "Invalid parameters on Main Stop in BUSY %x %x",
6009 pWDICtx, pEventData);
6010 return WDI_STATUS_E_FAILURE;
6011 }
6012
6013 /*--------------------------------------------------------------------
6014 Check if the Control Transport has been opened
6015 ----------------------------------------------------------------------*/
6016 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6017 "WDI Busy state - queue stop request");
6018
6019 WDI_QueuePendingReq( pWDICtx, pEventData);
6020 return WDI_STATUS_PENDING;
6021
6022}/*WDI_MainStopBusy*/
6023
6024/**
6025 @brief Main FSM Request function for state BUSY
6026
6027
6028 @param pWDICtx: pointer to the WLAN DAL context
6029 pEventData: pointer to the event information structure
6030
6031 @see
6032 @return Result of the function call
6033*/
6034WDI_Status
6035WDI_MainReqBusy
6036(
6037 WDI_ControlBlockType* pWDICtx,
6038 WDI_EventInfoType* pEventData
6039)
6040{
6041 /*--------------------------------------------------------------------
6042 Sanity Check
6043 ----------------------------------------------------------------------*/
6044 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6045 {
6046 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6047 "Invalid parameters on Main Request in BUSY %x %x",
6048 pWDICtx, pEventData);
6049 return WDI_STATUS_E_FAILURE;
6050 }
6051
6052 /*--------------------------------------------------------------------
6053 Check if the Control Transport has been opened
6054 ----------------------------------------------------------------------*/
6055 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6056 "WDI Busy state - queue request %d because waiting for response %d",
6057 pEventData->wdiRequest, pWDICtx->wdiExpectedResponse);
6058
6059 WDI_QueuePendingReq( pWDICtx, pEventData);
6060 return WDI_STATUS_PENDING;
6061
6062}/*WDI_MainReqBusy*/
6063/**
6064 @brief Main FSM Close function for state BUSY
6065
6066
6067 @param pWDICtx: pointer to the WLAN DAL context
6068 pEventData: pointer to the event information structure
6069
6070 @see
6071 @return Result of the function call
6072*/
6073WDI_Status
6074WDI_MainCloseBusy
6075(
6076 WDI_ControlBlockType* pWDICtx,
6077 WDI_EventInfoType* pEventData
6078)
6079{
6080 /*--------------------------------------------------------------------
6081 Sanity Check
6082 ----------------------------------------------------------------------*/
6083 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6084 {
6085 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6086 "Invalid parameters on Main Close in BUSY %x %x",
6087 pWDICtx, pEventData);
6088 return WDI_STATUS_E_FAILURE;
6089 }
6090
6091 /*--------------------------------------------------------------------
6092 Check if the Control Transport has been opened
6093 ----------------------------------------------------------------------*/
6094 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6095 "WDI Busy state - queue close request");
6096
6097 WDI_QueuePendingReq( pWDICtx, pEventData);
6098 return WDI_STATUS_PENDING;
6099
6100}/*WDI_MainCloseBusy*/
6101
6102/**
6103 @brief Main FSM Shutdown function for INIT & STARTED states
6104
6105
6106 @param pWDICtx: pointer to the WLAN DAL context
6107 pEventData: pointer to the event information structure
6108
6109 @see
6110 @return Result of the function call
6111*/
6112WDI_Status
6113WDI_MainShutdown
6114(
6115 WDI_ControlBlockType* pWDICtx,
6116 WDI_EventInfoType* pEventData
6117)
6118{
6119 /*--------------------------------------------------------------------
6120 Sanity Check
6121 ----------------------------------------------------------------------*/
6122 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6123 {
6124 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6125 "Invalid parameters on Main Start %x %x",
6126 pWDICtx, pEventData);
6127 return WDI_STATUS_E_FAILURE;
6128 }
6129
6130 /*State at this point is BUSY - because we enter this state before posting
6131 an event to the FSM in order to prevent potential race conditions*/
6132
6133 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6134 "Processing shutdown request in FSM");
6135
6136 /*Return Success*/
6137 return WDI_ProcessRequest( pWDICtx, pEventData );
6138
6139}/*WDI_MainShutdown*/
6140
6141/**
6142 @brief Main FSM Shutdown function for BUSY state
6143
6144
6145 @param pWDICtx: pointer to the WLAN DAL context
6146 pEventData: pointer to the event information structure
6147
6148 @see
6149 @return Result of the function call
6150*/
6151WDI_Status
6152WDI_MainShutdownBusy
6153(
6154 WDI_ControlBlockType* pWDICtx,
6155 WDI_EventInfoType* pEventData
6156)
6157{
6158 /*--------------------------------------------------------------------
6159 Sanity Check
6160 ----------------------------------------------------------------------*/
6161 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6162 {
6163 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6164 "Invalid parameters on Main Start %x %x",
6165 pWDICtx, pEventData);
6166 return WDI_STATUS_E_FAILURE;
6167 }
6168
6169 /* If you are waiting for a HAL response at this stage, you are not
6170 * going to get it. Riva is already shutdown/crashed.
6171 */
6172 wpalTimerStop(&gWDICb.wptResponseTimer);
6173
6174 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6175 "Processing shutdown request in FSM: Busy state ");
6176
6177 return WDI_ProcessRequest( pWDICtx, pEventData );
6178
6179}/*WDI_MainShutdownBusy*/
6180
6181
6182/*=======================================================================
6183
6184 WLAN DAL Control Path Main Processing Functions
6185
6186*=======================================================================*/
6187
6188/*========================================================================
6189 Main DAL Control Path Request Processing API
6190========================================================================*/
6191/**
6192 @brief Process Start Request function (called when Main FSM
6193 allows it)
6194
6195 @param pWDICtx: pointer to the WLAN DAL context
6196 pEventData: pointer to the event information structure
6197
6198 @see
6199 @return Result of the function call
6200*/
6201WDI_Status
6202WDI_ProcessStartReq
6203(
6204 WDI_ControlBlockType* pWDICtx,
6205 WDI_EventInfoType* pEventData
6206)
6207{
6208 WDI_StartReqParamsType* pwdiStartParams = NULL;
6209 WDI_StartRspCb wdiStartRspCb = NULL;
6210 wpt_uint8* pSendBuffer = NULL;
6211 wpt_uint16 usDataOffset = 0;
6212 wpt_uint16 usSendSize = 0;
6213
6214 tHalMacStartReqMsg halStartReq;
6215 wpt_uint16 usLen = 0;
6216 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6217
6218 /*-------------------------------------------------------------------------
6219 Sanity check
6220 -------------------------------------------------------------------------*/
6221 if (( NULL == pEventData ) ||
6222 ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) ||
6223 ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc)))
6224 {
6225 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6226 "%s: Invalid parameters", __FUNCTION__);
6227 WDI_ASSERT(0);
6228 return WDI_STATUS_E_FAILURE;
6229 }
6230
6231 /*-----------------------------------------------------------------------
6232 Get message buffer
6233 -----------------------------------------------------------------------*/
6234 usLen = sizeof(halStartReq.startReqParams) +
6235 pwdiStartParams->usConfigBufferLen;
6236
6237 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ,
6238 usLen,
6239 &pSendBuffer, &usDataOffset, &usSendSize))||
6240 ( usSendSize < (usDataOffset + usLen )))
6241 {
6242 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6243 "Unable to get send buffer in start req %x %x %x",
6244 pEventData, pwdiStartParams, wdiStartRspCb);
6245 WDI_ASSERT(0);
6246 return WDI_STATUS_E_FAILURE;
6247 }
6248
6249 /*-----------------------------------------------------------------------
6250 Fill in the message
6251 -----------------------------------------------------------------------*/
6252 halStartReq.startReqParams.driverType =
6253 WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType);
6254
6255 halStartReq.startReqParams.uConfigBufferLen =
6256 pwdiStartParams->usConfigBufferLen;
6257 wpalMemoryCopy( pSendBuffer+usDataOffset,
6258 &halStartReq.startReqParams,
6259 sizeof(halStartReq.startReqParams));
6260
6261 usDataOffset += sizeof(halStartReq.startReqParams);
6262 wpalMemoryCopy( pSendBuffer+usDataOffset,
6263 pwdiStartParams->pConfigBuffer,
6264 pwdiStartParams->usConfigBufferLen);
6265
6266 pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB;
6267 pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData;
6268
6269 /*Save Low Level Ind CB and associated user data - it will be used further
6270 on when an indication is coming from the lower MAC*/
6271 pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB;
6272 pWDICtx->pIndUserData = pwdiStartParams->pIndUserData;
6273
6274 pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled;
6275 /*-------------------------------------------------------------------------
6276 Send Start Request to HAL
6277 -------------------------------------------------------------------------*/
6278 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6279 wdiStartRspCb, pEventData->pUserData, WDI_START_RESP);
6280
6281
6282}/*WDI_ProcessStartReq*/
6283
6284/**
6285 @brief Process Stop Request function (called when Main FSM
6286 allows it)
6287
6288 @param pWDICtx: pointer to the WLAN DAL context
6289 pEventData: pointer to the event information structure
6290
6291 @see
6292 @return Result of the function call
6293*/
6294WDI_Status
6295WDI_ProcessStopReq
6296(
6297 WDI_ControlBlockType* pWDICtx,
6298 WDI_EventInfoType* pEventData
6299)
6300{
6301 WDI_StopReqParamsType* pwdiStopParams = NULL;
6302 WDI_StopRspCb wdiStopRspCb = NULL;
6303 wpt_uint8* pSendBuffer = NULL;
6304 wpt_uint16 usDataOffset = 0;
6305 wpt_uint16 usSendSize = 0;
6306
6307 tHalMacStopReqMsg halStopReq;
6308 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6309
6310 /*-------------------------------------------------------------------------
6311 Sanity check
6312 -------------------------------------------------------------------------*/
6313 if (( NULL == pEventData ) ||
6314 ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) ||
6315 ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc)))
6316 {
6317 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6318 "%s: Invalid parameters", __FUNCTION__);
6319 WDI_ASSERT(0);
6320 return WDI_STATUS_E_FAILURE;
6321 }
6322
6323 /*-----------------------------------------------------------------------
6324 Get message buffer
6325 -----------------------------------------------------------------------*/
6326 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ,
6327 sizeof(halStopReq.stopReqParams),
6328 &pSendBuffer, &usDataOffset, &usSendSize))||
6329 ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) )))
6330 {
6331 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6332 "Unable to get send buffer in stop req %x %x %x",
6333 pEventData, pwdiStopParams, wdiStopRspCb);
6334 WDI_ASSERT(0);
6335 return WDI_STATUS_E_FAILURE;
6336 }
6337
6338 /*-----------------------------------------------------------------------
6339 Fill in the message
6340 -----------------------------------------------------------------------*/
6341 halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON(
6342 pwdiStopParams->wdiStopReason);
6343
6344 wpalMemoryCopy( pSendBuffer+usDataOffset,
6345 &halStopReq.stopReqParams,
6346 sizeof(halStopReq.stopReqParams));
6347
6348 pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB;
6349 pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData;
6350
6351 /*! TO DO: stop the data services */
6352 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6353 {
6354 /*Stop the STA Table !UT- check this logic again
6355 It is safer to do it here than on the response - because a stop is imminent*/
6356 WDI_STATableStop(pWDICtx);
6357
6358 /* Reset the event to be not signalled */
6359 if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
6360 {
6361 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6362 "WDI Init failed to reset power state event");
6363
6364 WDI_ASSERT(0);
6365 return VOS_STATUS_E_FAILURE;
6366 }
6367 /* Stop Transport Driver, DXE */
6368 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb);
6369 /*
6370 * Wait for the event to be set once the ACK comes back from DXE
6371 */
6372 if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent,
6373 WDI_SET_POWER_STATE_TIMEOUT))
6374 {
6375 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6376 "WDI Init failed to wait on an event");
6377
6378 WDI_ASSERT(0);
6379 return VOS_STATUS_E_FAILURE;
6380 }
6381 }
6382
6383 /*-------------------------------------------------------------------------
6384 Send Stop Request to HAL
6385 -------------------------------------------------------------------------*/
6386 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6387 wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP);
6388
6389}/*WDI_ProcessStopReq*/
6390
6391/**
6392 @brief Process Close Request function (called when Main FSM
6393 allows it)
6394
6395 @param pWDICtx: pointer to the WLAN DAL context
6396 pEventData: pointer to the event information structure
6397
6398 @see
6399 @return Result of the function call
6400*/
6401WDI_Status
6402WDI_ProcessCloseReq
6403(
6404 WDI_ControlBlockType* pWDICtx,
6405 WDI_EventInfoType* pEventData
6406)
6407{
6408 wpt_status wptStatus;
6409 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6410
6411 /*Lock control block for cleanup*/
6412 wpalMutexAcquire(&pWDICtx->wptMutex);
6413
6414 /*Clear all pending request*/
6415 WDI_ClearPendingRequests(pWDICtx);
6416
6417 /* Close Control transport*/
6418 WCTS_CloseTransport(pWDICtx->wctsHandle);
6419
6420 /* Close Data transport*/
6421 /* FTM mode does not open Data Path */
6422 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6423 {
6424 WDTS_Close(pWDICtx);
6425 }
6426
6427 /*Close the STA Table !UT- check this logic again*/
6428 WDI_STATableClose(pWDICtx);
6429
6430 /*close the PAL */
6431 wptStatus = wpalClose(pWDICtx->pPALContext);
6432 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
6433 {
6434 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6435 "Failed to wpal Close %d", wptStatus);
6436 WDI_ASSERT(0);
6437 }
6438
6439 /*Transition back to init state*/
6440 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
6441
6442 wpalMutexRelease(&pWDICtx->wptMutex);
6443
6444 /*Make sure the expected state is properly defaulted to Init*/
6445 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
6446
6447 return WDI_STATUS_SUCCESS;
6448}/*WDI_ProcessCloseReq*/
6449
6450
6451/*===========================================================================
6452 SCANING REQUEST PROCESSING API
6453===========================================================================*/
6454
6455/**
6456 @brief Process Init Scan Request function (called when Main FSM
6457 allows it)
6458
6459 @param pWDICtx: pointer to the WLAN DAL context
6460 pEventData: pointer to the event information structure
6461
6462 @see
6463 @return Result of the function call
6464*/
6465WDI_Status
6466WDI_ProcessInitScanReq
6467(
6468 WDI_ControlBlockType* pWDICtx,
6469 WDI_EventInfoType* pEventData
6470)
6471{
6472 WDI_InitScanReqParamsType* pwdiInitScanParams = NULL;
6473 WDI_InitScanRspCb wdiInitScanRspCb = NULL;
6474 wpt_uint8* pSendBuffer = NULL;
6475 wpt_uint16 usDataOffset = 0;
6476 wpt_uint16 usSendSize = 0;
6477 wpt_uint8 i = 0;
6478
6479 tHalInitScanReqMsg halInitScanReqMsg;
6480
6481 /*This is temporary fix.
6482 * It shold be removed once host and riva changes are in sync*/
6483 tHalInitScanConReqMsg halInitScanConReqMsg;
6484
6485 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6486
6487 /*-------------------------------------------------------------------------
6488 Sanity check
6489 -------------------------------------------------------------------------*/
6490 if (( NULL == pEventData ) ||
6491 ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) ||
6492 ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc)))
6493 {
6494 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6495 "%s: Invalid parameters", __FUNCTION__);
6496 WDI_ASSERT(0);
6497 return WDI_STATUS_E_FAILURE;
6498 }
6499
6500#if 0
6501 wpalMutexAcquire(&pWDICtx->wptMutex);
6502 /*-----------------------------------------------------------------------
6503 Check to see if SCAN is already in progress - if so reject the req
6504 We only allow one scan at a time
6505 ! TO DO: - revisit this constraint
6506 -----------------------------------------------------------------------*/
6507 if ( pWDICtx->bScanInProgress )
6508 {
6509 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6510 "Scan is already in progress - subsequent scan is not allowed"
6511 " until the first scan completes");
6512
6513 wpalMutexRelease(&pWDICtx->wptMutex);
6514 return WDI_STATUS_E_NOT_ALLOWED;
6515 }
6516
6517 pWDICtx->bScanInProgress = eWLAN_PAL_TRUE;
6518 pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST;
6519
6520 wpalMutexRelease(&pWDICtx->wptMutex);
6521#endif
6522
6523 if (pwdiInitScanParams->wdiReqInfo.bUseNOA)
6524 {
6525 /*This is temporary fix.
6526 * It shold be removed once host and riva changes are in sync*/
6527 /*-----------------------------------------------------------------------
6528 Get message buffer
6529 -----------------------------------------------------------------------*/
6530 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ,
6531 sizeof(halInitScanConReqMsg.initScanParams),
6532 &pSendBuffer, &usDataOffset, &usSendSize))||
6533 ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) )))
6534 {
6535 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6536 "Unable to get send buffer in init scan req %x %x %x",
6537 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6538 WDI_ASSERT(0);
6539 return WDI_STATUS_E_FAILURE;
6540 }
6541
6542
6543 /*-----------------------------------------------------------------------
6544 Fill in the message
6545 -----------------------------------------------------------------------*/
6546 halInitScanConReqMsg.initScanParams.scanMode =
6547 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6548
6549 wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid,
6550 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6551
6552 halInitScanConReqMsg.initScanParams.notifyBss =
6553 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
6554 halInitScanConReqMsg.initScanParams.frameType =
6555 pwdiInitScanParams->wdiReqInfo.ucFrameType;
6556 halInitScanConReqMsg.initScanParams.frameLength =
6557 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6558
6559 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr,
6560 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6561
6562#ifdef WLAN_FEATURE_P2P
6563 halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA;
6564 halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration;
6565#endif
6566
6567 halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt =
6568 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6569
6570 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6571 {
6572 halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] =
6573 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6574 }
6575
6576 wpalMemoryCopy( pSendBuffer+usDataOffset,
6577 &halInitScanConReqMsg.initScanParams,
6578 sizeof(halInitScanConReqMsg.initScanParams));
6579 }
6580 else
6581 {
6582 /*-----------------------------------------------------------------------
6583 Get message buffer
6584 -----------------------------------------------------------------------*/
6585 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ,
6586 sizeof(halInitScanReqMsg.initScanParams),
6587 &pSendBuffer, &usDataOffset, &usSendSize))||
6588 ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) )))
6589 {
6590 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6591 "Unable to get send buffer in init scan req %x %x %x",
6592 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6593 WDI_ASSERT(0);
6594 return WDI_STATUS_E_FAILURE;
6595 }
6596
6597
6598 /*-----------------------------------------------------------------------
6599 Fill in the message
6600 -----------------------------------------------------------------------*/
6601 halInitScanReqMsg.initScanParams.scanMode =
6602 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6603
6604 wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid,
6605 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6606
6607 halInitScanReqMsg.initScanParams.notifyBss =
6608 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
6609 halInitScanReqMsg.initScanParams.frameType =
6610 pwdiInitScanParams->wdiReqInfo.ucFrameType;
6611 halInitScanReqMsg.initScanParams.frameLength =
6612 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6613
6614 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr,
6615 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6616
6617 halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt =
6618 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6619
6620 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6621 {
6622 halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] =
6623 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6624 }
6625
6626 wpalMemoryCopy( pSendBuffer+usDataOffset,
6627 &halInitScanReqMsg.initScanParams,
6628 sizeof(halInitScanReqMsg.initScanParams));
6629 }
6630
6631 pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB;
6632 pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData;
6633
6634 /*-------------------------------------------------------------------------
6635 Send Init Scan Request to HAL
6636 -------------------------------------------------------------------------*/
6637 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6638 wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP);
6639
6640}/*WDI_ProcessInitScanReq*/
6641
6642/**
6643 @brief Process Start Scan Request function (called when Main
6644 FSM allows it)
6645
6646 @param pWDICtx: pointer to the WLAN DAL context
6647 pEventData: pointer to the event information structure
6648
6649 @see
6650 @return Result of the function call
6651*/
6652WDI_Status
6653WDI_ProcessStartScanReq
6654(
6655 WDI_ControlBlockType* pWDICtx,
6656 WDI_EventInfoType* pEventData
6657)
6658{
6659 WDI_StartScanReqParamsType* pwdiStartScanParams = NULL;
6660 WDI_StartScanRspCb wdiStartScanRspCb = NULL;
6661 wpt_uint8* pSendBuffer = NULL;
6662 wpt_uint16 usDataOffset = 0;
6663 wpt_uint16 usSendSize = 0;
6664
6665 tHalStartScanReqMsg halStartScanReqMsg;
6666 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6667
6668 /*-------------------------------------------------------------------------
6669 Sanity check
6670 -------------------------------------------------------------------------*/
6671 if (( NULL == pEventData ) ||
6672 ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) ||
6673 ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc)))
6674 {
6675 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6676 "%s: Invalid parameters", __FUNCTION__);
6677 WDI_ASSERT(0);
6678 return WDI_STATUS_E_FAILURE;
6679 }
6680
6681#if 0
6682 wpalMutexAcquire(&pWDICtx->wptMutex);
6683 /*-----------------------------------------------------------------------
6684 Check to see if SCAN is already in progress - start scan is only
6685 allowed when a scan is ongoing and the state of the scan procedure
6686 is either init or end
6687 -----------------------------------------------------------------------*/
6688 if (( !pWDICtx->bScanInProgress ) ||
6689 (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) &&
6690 ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState )))
6691 {
6692 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6693 "Scan start not allowed in this state %d %d",
6694 pWDICtx->bScanInProgress, pWDICtx->uScanState);
6695
6696 wpalMutexRelease(&pWDICtx->wptMutex);
6697 return WDI_STATUS_E_NOT_ALLOWED;
6698 }
6699
6700 pWDICtx->uScanState = WDI_SCAN_STARTED_ST;
6701
6702 wpalMutexRelease(&pWDICtx->wptMutex);
6703#endif
6704
6705 /*-----------------------------------------------------------------------
6706 Get message buffer
6707 -----------------------------------------------------------------------*/
6708 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ,
6709 sizeof(halStartScanReqMsg.startScanParams),
6710 &pSendBuffer, &usDataOffset, &usSendSize))||
6711 ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) )))
6712 {
6713 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6714 "Unable to get send buffer in start scan req %x %x %x",
6715 pEventData, pwdiStartScanParams, wdiStartScanRspCb);
6716 WDI_ASSERT(0);
6717 return WDI_STATUS_E_FAILURE;
6718 }
6719
6720 halStartScanReqMsg.startScanParams.scanChannel =
6721 pwdiStartScanParams->ucChannel;
6722 wpalMemoryCopy( pSendBuffer+usDataOffset,
6723 &halStartScanReqMsg.startScanParams,
6724 sizeof(halStartScanReqMsg.startScanParams));
6725
6726 pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB;
6727 pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData;
6728
6729 /*-------------------------------------------------------------------------
6730 Send Start Scan Request to HAL
6731 -------------------------------------------------------------------------*/
6732 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6733 wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP);
6734}/*WDI_ProcessStartScanReq*/
6735
6736
6737/**
6738 @brief Process End Scan Request function (called when Main FSM
6739 allows it)
6740
6741 @param pWDICtx: pointer to the WLAN DAL context
6742 pEventData: pointer to the event information structure
6743
6744 @see
6745 @return Result of the function call
6746*/
6747WDI_Status
6748WDI_ProcessEndScanReq
6749(
6750 WDI_ControlBlockType* pWDICtx,
6751 WDI_EventInfoType* pEventData
6752)
6753{
6754 WDI_EndScanReqParamsType* pwdiEndScanParams = NULL;
6755 WDI_EndScanRspCb wdiEndScanRspCb = NULL;
6756 wpt_uint8* pSendBuffer = NULL;
6757 wpt_uint16 usDataOffset = 0;
6758 wpt_uint16 usSendSize = 0;
6759
6760 tHalEndScanReqMsg halEndScanReqMsg;
6761 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6762
6763 /*-------------------------------------------------------------------------
6764 Sanity check
6765 -------------------------------------------------------------------------*/
6766 if (( NULL == pEventData ) ||
6767 ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) ||
6768 ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc)))
6769 {
6770 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6771 "%s: Invalid parameters", __FUNCTION__);
6772 WDI_ASSERT(0);
6773 return WDI_STATUS_E_FAILURE;
6774 }
6775
6776 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6777 * sometimes because of this check the scan request is not being
6778 * forwarded to HAL and result in hang*/
6779#if 0
6780 wpalMutexAcquire(&pWDICtx->wptMutex);
6781 /*-----------------------------------------------------------------------
6782 Check to see if SCAN is already in progress - end scan is only
6783 allowed when a scan is ongoing and the state of the scan procedure
6784 is started
6785 -----------------------------------------------------------------------*/
6786 if (( !pWDICtx->bScanInProgress ) ||
6787 ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState ))
6788 {
6789 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6790 "End start not allowed in this state %d %d",
6791 pWDICtx->bScanInProgress, pWDICtx->uScanState);
6792
6793 wpalMutexRelease(&pWDICtx->wptMutex);
6794 return WDI_STATUS_E_NOT_ALLOWED;
6795 }
6796
6797 pWDICtx->uScanState = WDI_SCAN_ENDED_ST;
6798
6799 wpalMutexRelease(&pWDICtx->wptMutex);
6800#endif
6801
6802 /*-----------------------------------------------------------------------
6803 Get message buffer
6804 -----------------------------------------------------------------------*/
6805 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ,
6806 sizeof(halEndScanReqMsg.endScanParams),
6807 &pSendBuffer, &usDataOffset, &usSendSize))||
6808 ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) )))
6809 {
6810 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6811 "Unable to get send buffer in start scan req %x %x %x",
6812 pEventData, pwdiEndScanParams, wdiEndScanRspCb);
6813 WDI_ASSERT(0);
6814 return WDI_STATUS_E_FAILURE;
6815 }
6816
6817 halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel;
6818
6819 wpalMemoryCopy( pSendBuffer+usDataOffset,
6820 &halEndScanReqMsg.endScanParams,
6821 sizeof(halEndScanReqMsg.endScanParams));
6822
6823 pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB;
6824 pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData;
6825
6826 /*-------------------------------------------------------------------------
6827 Send End Scan Request to HAL
6828 -------------------------------------------------------------------------*/
6829 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6830 wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP);
6831}/*WDI_ProcessEndScanReq*/
6832
6833
6834/**
6835 @brief Process Finish Scan Request function (called when Main
6836 FSM allows it)
6837
6838 @param pWDICtx: pointer to the WLAN DAL context
6839 pEventData: pointer to the event information structure
6840
6841 @see
6842 @return Result of the function call
6843*/
6844WDI_Status
6845WDI_ProcessFinishScanReq
6846(
6847 WDI_ControlBlockType* pWDICtx,
6848 WDI_EventInfoType* pEventData
6849)
6850{
6851 WDI_FinishScanReqParamsType* pwdiFinishScanParams;
6852 WDI_FinishScanRspCb wdiFinishScanRspCb;
6853 wpt_uint8* pSendBuffer = NULL;
6854 wpt_uint16 usDataOffset = 0;
6855 wpt_uint16 usSendSize = 0;
6856 wpt_uint8 i = 0;
6857
6858 tHalFinishScanReqMsg halFinishScanReqMsg;
6859 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6860
6861 /*-------------------------------------------------------------------------
6862 Sanity check
6863 -------------------------------------------------------------------------*/
6864 if (( NULL == pEventData ) ||
6865 ( NULL == pEventData->pEventData) ||
6866 ( NULL == pEventData->pCBfnc))
6867 {
6868 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6869 "%s: Invalid parameters", __FUNCTION__);
6870 WDI_ASSERT(0);
6871 return WDI_STATUS_E_FAILURE;
6872 }
6873
6874 pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData;
6875 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc;
6876 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6877 * sometimes because of this check the scan request is not being
6878 * forwarded to HAL and result in hang*/
6879#if 0
6880 wpalMutexAcquire(&pWDICtx->wptMutex);
6881 /*-----------------------------------------------------------------------
6882 Check to see if SCAN is already in progress
6883 Finish scan gets invoked any scan states. ie. abort scan
6884 It should be allowed in any states.
6885 -----------------------------------------------------------------------*/
6886 if ( !pWDICtx->bScanInProgress )
6887 {
6888 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6889 "Finish start not allowed in this state %d",
6890 pWDICtx->bScanInProgress );
6891
6892 wpalMutexRelease(&pWDICtx->wptMutex);
6893 return WDI_STATUS_E_NOT_ALLOWED;
6894 }
6895
6896 /*-----------------------------------------------------------------------
6897 It is safe to reset the scan flags here because until the response comes
6898 back all subsequent requests will be blocked at BUSY state
6899 -----------------------------------------------------------------------*/
6900 pWDICtx->uScanState = WDI_SCAN_FINISHED_ST;
6901 pWDICtx->bScanInProgress = eWLAN_PAL_FALSE;
6902 wpalMutexRelease(&pWDICtx->wptMutex);
6903#endif
6904
6905 if ( pWDICtx->bInBmps )
6906 {
6907 // notify DTS that we are entering BMPS
6908 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL);
6909 }
6910
6911 /*-----------------------------------------------------------------------
6912 Get message buffer
6913 -----------------------------------------------------------------------*/
6914 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ,
6915 sizeof(halFinishScanReqMsg.finishScanParams),
6916 &pSendBuffer, &usDataOffset, &usSendSize))||
6917 ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) )))
6918 {
6919 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6920 "Unable to get send buffer in start scan req %x %x %x",
6921 pEventData, pwdiFinishScanParams, wdiFinishScanRspCb);
6922 WDI_ASSERT(0);
6923 return WDI_STATUS_E_FAILURE;
6924 }
6925
6926 halFinishScanReqMsg.finishScanParams.scanMode =
6927 WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode);
6928
6929 halFinishScanReqMsg.finishScanParams.currentOperChannel =
6930 pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel;
6931
6932 halFinishScanReqMsg.finishScanParams.cbState =
6933 WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState);
6934
6935 wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid,
6936 pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6937
6938 halFinishScanReqMsg.finishScanParams.notifyBss =
6939 pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ;
6940 halFinishScanReqMsg.finishScanParams.frameType =
6941 pwdiFinishScanParams->wdiReqInfo.ucFrameType ;
6942 halFinishScanReqMsg.finishScanParams.frameLength =
6943 pwdiFinishScanParams->wdiReqInfo.ucFrameLength ;
6944
6945 halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt =
6946 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ;
6947
6948 for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6949 {
6950 halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] =
6951 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ;
6952 }
6953
6954 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr,
6955 &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr);
6956
6957 wpalMemoryCopy( pSendBuffer+usDataOffset,
6958 &halFinishScanReqMsg.finishScanParams,
6959 sizeof(halFinishScanReqMsg.finishScanParams));
6960
6961 pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB;
6962 pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData;
6963
6964 /*-------------------------------------------------------------------------
6965 Send Finish Scan Request to HAL
6966 -------------------------------------------------------------------------*/
6967 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6968 wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP);
6969}/*WDI_ProcessFinishScanReq*/
6970
6971
6972/*==========================================================================
6973 ASSOCIATION REQUEST API
6974==========================================================================*/
6975/**
6976 @brief Process BSS Join for a given Session
6977
6978 @param pWDICtx: pointer to the WLAN DAL context
6979 pEventData: pointer to the event information structure
6980
6981 @see
6982 @return Result of the function call
6983*/
6984WDI_Status
6985WDI_ProcessBSSSessionJoinReq
6986(
6987 WDI_ControlBlockType* pWDICtx,
6988 WDI_JoinReqParamsType* pwdiJoinParams,
6989 WDI_JoinRspCb wdiJoinRspCb,
6990 void* pUserData
6991)
6992{
6993 WDI_BSSSessionType* pBSSSes = NULL;
6994 wpt_uint8* pSendBuffer = NULL;
6995 wpt_uint16 usDataOffset = 0;
6996 wpt_uint16 usSendSize = 0;
6997 wpt_uint8 ucCurrentBSSSesIdx = 0;
6998
6999 tHalJoinReqMsg halJoinReqMsg;
7000 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7001
7002 /*------------------------------------------------------------------------
7003 Check to see if we have any session with this BSSID already stored, we
7004 should not
7005 ------------------------------------------------------------------------*/
7006 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7007 pwdiJoinParams->wdiReqInfo.macBSSID,
7008 &pBSSSes);
7009
7010 if ( NULL != pBSSSes )
7011 {
7012 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7013 "Association for this BSSID is already in place");
7014
7015 return WDI_STATUS_E_NOT_ALLOWED;
7016 }
7017
7018 wpalMutexAcquire(&pWDICtx->wptMutex);
7019 /*------------------------------------------------------------------------
7020 Fetch an empty session block
7021 ------------------------------------------------------------------------*/
7022 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7023 if ( NULL == pBSSSes )
7024 {
7025
7026 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7027 "DAL has no free sessions - cannot run another join");
7028
7029 wpalMutexRelease(&pWDICtx->wptMutex);
7030 return WDI_STATUS_RES_FAILURE;
7031 }
7032
7033 /*Save BSS Session Info*/
7034 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7035 wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID,
7036 WDI_MAC_ADDR_LEN);
7037
7038 /*Transition to state Joining*/
7039 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7040 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7041
7042 wpalMutexRelease(&pWDICtx->wptMutex);
7043
7044 /*-----------------------------------------------------------------------
7045 Get message buffer
7046 -----------------------------------------------------------------------*/
7047 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ,
7048 sizeof(halJoinReqMsg.joinReqParams),
7049 &pSendBuffer, &usDataOffset, &usSendSize))||
7050 ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) )))
7051 {
7052 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7053 "Unable to get send buffer in join req %x %x %x",
7054 pUserData, pwdiJoinParams, wdiJoinRspCb);
7055 WDI_ASSERT(0);
7056 return WDI_STATUS_E_FAILURE;
7057 }
7058
7059 wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId,
7060 pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
7061
7062 wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr,
7063 pwdiJoinParams->wdiReqInfo.macSTASelf,
7064 WDI_MAC_ADDR_LEN);
7065
7066 halJoinReqMsg.joinReqParams.ucChannel =
7067 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel;
7068
7069 halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState;
7070
7071#ifndef WLAN_FEATURE_VOWIFI
7072 halJoinReqMsg.joinReqParams.ucLocalPowerConstraint =
7073 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint;
7074#endif
7075
7076 halJoinReqMsg.joinReqParams.secondaryChannelOffset =
7077 WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo.
7078 wdiSecondaryChannelOffset);
7079
7080 wpalMemoryCopy( pSendBuffer+usDataOffset,
7081 &halJoinReqMsg.joinReqParams,
7082 sizeof(halJoinReqMsg.joinReqParams));
7083
7084 pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB;
7085 pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData;
7086
7087 /*-------------------------------------------------------------------------
7088 Send Join Request to HAL
7089 -------------------------------------------------------------------------*/
7090 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7091 wdiJoinRspCb, pUserData, WDI_JOIN_RESP);
7092
7093}/*WDI_ProcessBSSSessionJoinReq*/
7094
7095/**
7096 @brief Process Join Request function (called when Main FSM
7097 allows it)
7098
7099 @param pWDICtx: pointer to the WLAN DAL context
7100 pEventData: pointer to the event information structure
7101
7102 @see
7103 @return Result of the function call
7104*/
7105WDI_Status
7106WDI_ProcessJoinReq
7107(
7108 WDI_ControlBlockType* pWDICtx,
7109 WDI_EventInfoType* pEventData
7110)
7111{
7112 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7113 WDI_JoinReqParamsType* pwdiJoinParams = NULL;
7114 WDI_JoinRspCb wdiJoinRspCb = NULL;
7115 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7116
7117 /*-------------------------------------------------------------------------
7118 Sanity check
7119 -------------------------------------------------------------------------*/
7120 if (( NULL == pEventData ) ||
7121 ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) ||
7122 ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc)))
7123 {
7124 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7125 "%s: Invalid parameters", __FUNCTION__);
7126 WDI_ASSERT(0);
7127 return WDI_STATUS_E_FAILURE;
7128 }
7129
7130 /*-------------------------------------------------------------------------
7131 Check to see if we are in the middle of an association, if so queue, if
7132 not it means it is free to process request
7133 -------------------------------------------------------------------------*/
7134 wpalMutexAcquire(&pWDICtx->wptMutex);
7135
7136 if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress )
7137 {
7138 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7139 "Association is currently in progress, queueing new join req");
7140
7141 /*Association is in progress - queue current one*/
7142 wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData,
7143 pwdiJoinParams->wdiReqInfo.macBSSID);
7144
7145 wpalMutexRelease(&pWDICtx->wptMutex);
7146
7147 return wdiStatus;
7148 }
7149
7150 /*Starting a new association */
7151 pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE;
7152 wpalMutexRelease(&pWDICtx->wptMutex);
7153
7154 /*Process the Join Request*/
7155 return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams,
7156 wdiJoinRspCb,pEventData->pUserData);
7157
7158}/*WDI_ProcessJoinReq*/
7159
7160
7161/**
7162 @brief Process Config BSS Request function (called when Main
7163 FSM allows it)
7164
7165 @param pWDICtx: pointer to the WLAN DAL context
7166 pEventData: pointer to the event information structure
7167
7168 @see
7169 @return Result of the function call
7170*/
7171WDI_Status
7172WDI_ProcessConfigBSSReq
7173(
7174 WDI_ControlBlockType* pWDICtx,
7175 WDI_EventInfoType* pEventData
7176)
7177{
7178 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams;
7179 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
7180 wpt_uint8 ucCurrentBSSSesIdx = 0;
7181 WDI_BSSSessionType* pBSSSes = NULL;
7182 wpt_uint16 uMsgSize = 0;
7183 wpt_uint8* pSendBuffer = NULL;
7184 wpt_uint16 usDataOffset = 0;
7185 wpt_uint16 usSendSize = 0;
7186 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7187
7188 tConfigBssReqMsg halConfigBssReqMsg;
7189 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7190
7191 /*-------------------------------------------------------------------------
7192 Sanity check
7193 -------------------------------------------------------------------------*/
7194 if (( NULL == pEventData ) ||
7195 ( NULL == pEventData->pEventData ) ||
7196 ( NULL == pEventData->pCBfnc ))
7197 {
7198 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7199 "%s: Invalid parameters", __FUNCTION__);
7200 WDI_ASSERT(0);
7201 return WDI_STATUS_E_FAILURE;
7202 }
7203
7204 pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData;
7205 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc;
7206 /*-------------------------------------------------------------------------
7207 Check to see if we are in the middle of an association, if so queue, if
7208 not it means it is free to process request
7209 -------------------------------------------------------------------------*/
7210 wpalMutexAcquire(&pWDICtx->wptMutex);
7211
7212 /*------------------------------------------------------------------------
7213 Find the BSS for which the request is made
7214 ------------------------------------------------------------------------*/
7215 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7216 pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7217 &pBSSSes);
7218
7219 if ( NULL == pBSSSes )
7220 {
7221#ifdef WLAN_FEATURE_VOWIFI_11R
7222 /*------------------------------------------------------------------------
7223 Fetch an empty session block
7224 ------------------------------------------------------------------------*/
7225 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7226 if ( NULL == pBSSSes )
7227 {
7228
7229 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7230 "DAL has no free sessions - cannot run another join");
7231
7232 wpalMutexRelease(&pWDICtx->wptMutex);
7233 return WDI_STATUS_RES_FAILURE;
7234 }
7235
7236 /*Save BSS Session Info*/
7237 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7238 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7239 WDI_MAC_ADDR_LEN);
7240
7241 /*Transition to state Joining*/
7242 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7243 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7244#else
7245 /* If the BSS type is IBSS create the session here as there is no Join
7246 * Request in case of IBSS*/
7247 if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) ||
7248 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) ||
7249 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) ||
7250 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE))
7251 {
7252 /*------------------------------------------------------------------------
7253 Fetch an empty session block
7254 ------------------------------------------------------------------------*/
7255 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7256 if ( NULL == pBSSSes )
7257 {
7258
7259 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7260 "DAL has no free sessions - cannot run another join");
7261
7262 wpalMutexRelease(&pWDICtx->wptMutex);
7263 return WDI_STATUS_RES_FAILURE;
7264 }
7265
7266 /*Save BSS Session Info*/
7267 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7268 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7269 WDI_MAC_ADDR_LEN);
7270
7271 /*Transition to state Joining*/
7272 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7273 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7274 }
7275 else
7276 {
7277 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7278 "Association sequence for this BSS does not yet exist");
7279 /* for IBSS testing */
7280 wpalMutexRelease(&pWDICtx->wptMutex);
7281 return WDI_STATUS_E_NOT_ALLOWED;
7282 }
7283#endif
7284 }
7285
7286 /*------------------------------------------------------------------------
7287 Check if this BSS is being currently processed or queued,
7288 if queued - queue the new request as well
7289 ------------------------------------------------------------------------*/
7290 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7291 {
7292 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7293 "Association sequence for this BSS exists but currently queued");
7294
7295 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7296
7297 wpalMutexRelease(&pWDICtx->wptMutex);
7298
7299 return wdiStatus;
7300 }
7301
7302 /* Cache the request for response processing */
7303 wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq,
7304 pwdiConfigBSSParams,
7305 sizeof(pWDICtx->wdiCachedConfigBssReq));
7306
7307 wpalMutexRelease(&pWDICtx->wptMutex);
7308
7309 uMsgSize = sizeof(halConfigBssReqMsg.configBssParams);
7310
7311 /*-----------------------------------------------------------------------
7312 Get message buffer
7313 -----------------------------------------------------------------------*/
7314 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ,
7315 uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))||
7316 ( usSendSize < (usDataOffset + uMsgSize )))
7317 {
7318 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7319 "Unable to get send buffer in config bss req %x %x %x",
7320 pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb);
7321 WDI_ASSERT(0);
7322 return WDI_STATUS_E_FAILURE;
7323 }
7324
7325 /*Copy the BSS request */
7326 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.configBssParams,
7327 &pwdiConfigBSSParams->wdiReqInfo);
7328
7329 /* Need to fill in the STA Index to invalid, since at this point we have not
7330 yet received it from HAL */
7331 halConfigBssReqMsg.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
7332
7333 /* Need to fill in the BSS index */
7334 halConfigBssReqMsg.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7335
7336 wpalMemoryCopy( pSendBuffer+usDataOffset,
7337 &halConfigBssReqMsg.configBssParams,
7338 sizeof(halConfigBssReqMsg.configBssParams));
7339
7340 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
7341 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
7342
7343 /*-------------------------------------------------------------------------
7344 Send Config BSS Request to HAL
7345 -------------------------------------------------------------------------*/
7346 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7347 wdiConfigBSSRspCb, pEventData->pUserData,
7348 WDI_CONFIG_BSS_RESP);
7349
7350}/*WDI_ProcessConfigBSSReq*/
7351
7352
7353/**
7354 @brief Process Del BSS Request function (called when Main FSM
7355 allows it)
7356
7357 @param pWDICtx: pointer to the WLAN DAL context
7358 pEventData: pointer to the event information structure
7359
7360 @see
7361 @return Result of the function call
7362*/
7363WDI_Status
7364WDI_ProcessDelBSSReq
7365(
7366 WDI_ControlBlockType* pWDICtx,
7367 WDI_EventInfoType* pEventData
7368)
7369{
7370 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7371 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
7372 wpt_uint8 ucCurrentBSSSesIdx = 0;
7373 WDI_BSSSessionType* pBSSSes = NULL;
7374 wpt_uint8* pSendBuffer = NULL;
7375 wpt_uint16 usDataOffset = 0;
7376 wpt_uint16 usSendSize = 0;
7377 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7378
7379 tDeleteBssReqMsg halBssReqMsg;
7380 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7381
7382 /*-------------------------------------------------------------------------
7383 Sanity check
7384 -------------------------------------------------------------------------*/
7385 if (( NULL == pEventData ) ||
7386 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7387 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7388 {
7389 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7390 "%s: Invalid parameters", __FUNCTION__);
7391 WDI_ASSERT(0);
7392 return WDI_STATUS_E_FAILURE;
7393 }
7394
7395 /*-------------------------------------------------------------------------
7396 Check to see if we are in the middle of an association, if so queue, if
7397 not it means it is free to process request
7398 -------------------------------------------------------------------------*/
7399 wpalMutexAcquire(&pWDICtx->wptMutex);
7400
7401 /*------------------------------------------------------------------------
7402 Find the BSS for which the request is made
7403 ------------------------------------------------------------------------*/
7404 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7405 pwdiDelBSSParams->ucBssIdx,
7406 &pBSSSes);
7407
7408 if ( NULL == pBSSSes )
7409 {
7410 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7411 "Association sequence for this BSS does not yet exist");
7412
7413 wpalMutexRelease(&pWDICtx->wptMutex);
7414
7415 return WDI_STATUS_E_NOT_ALLOWED;
7416 }
7417
7418 /*------------------------------------------------------------------------
7419 Check if this BSS is being currently processed or queued,
7420 if queued - queue the new request as well
7421 ------------------------------------------------------------------------*/
7422 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7423 {
7424 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7425 "Association sequence for this BSS exists but currently queued");
7426
7427 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7428
7429 wpalMutexRelease(&pWDICtx->wptMutex);
7430
7431 return wdiStatus;
7432 }
7433
7434 /*-----------------------------------------------------------------------
7435 If we receive a Del BSS request for an association that is already in
7436 progress, it indicates that the assoc has failed => we no longer have
7437 an association in progress => we must check for pending associations
7438 that were queued and start as soon as the Del BSS response is received
7439 -----------------------------------------------------------------------*/
7440 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7441 {
7442 /*We can switch to false here because even if a subsequent Join comes in
7443 it will only be processed when DAL transitions out of BUSY state which
7444 happens when the Del BSS request comes */
7445 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7446
7447 /*Former association is complete - prepare next pending assoc for
7448 processing */
7449 WDI_DequeueAssocRequest(pWDICtx);
7450 }
7451
7452 wpalMutexRelease(&pWDICtx->wptMutex);
7453 /*-----------------------------------------------------------------------
7454 Get message buffer
7455 -----------------------------------------------------------------------*/
7456 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
7457 sizeof(halBssReqMsg.deleteBssParams),
7458 &pSendBuffer, &usDataOffset, &usSendSize))||
7459 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7460 {
7461 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7462 "Unable to get send buffer in start req %x %x %x",
7463 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7464 WDI_ASSERT(0);
7465 return WDI_STATUS_E_FAILURE;
7466 }
7467
7468 /*Fill in the message request structure*/
7469
7470 /*BSS Index is saved on config BSS response and Post Assoc Response */
7471 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
7472
7473 wpalMemoryCopy( pSendBuffer+usDataOffset,
7474 &halBssReqMsg.deleteBssParams,
7475 sizeof(halBssReqMsg.deleteBssParams));
7476
7477 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
7478 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
7479
7480
7481 /*-------------------------------------------------------------------------
7482 Send Del BSS Request to HAL
7483 -------------------------------------------------------------------------*/
7484 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7485 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7486
7487
7488}/*WDI_ProcessDelBSSReq*/
7489
7490/**
7491 @brief Process Post Assoc Request function (called when Main
7492 FSM allows it)
7493
7494 @param pWDICtx: pointer to the WLAN DAL context
7495 pEventData: pointer to the event information structure
7496
7497 @see
7498 @return Result of the function call
7499*/
7500WDI_Status
7501WDI_ProcessPostAssocReq
7502(
7503 WDI_ControlBlockType* pWDICtx,
7504 WDI_EventInfoType* pEventData
7505)
7506{
7507 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7508 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
7509 wpt_uint8 ucCurrentBSSSesIdx = 0;
7510 WDI_BSSSessionType* pBSSSes = NULL;
7511 wpt_uint8* pSendBuffer = NULL;
7512 wpt_uint16 usDataOffset = 0;
7513 wpt_uint16 usSendSize = 0;
7514 wpt_uint16 uMsgSize = 0;
7515 wpt_uint16 uOffset = 0;
7516 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7517
7518 tPostAssocReqMsg halPostAssocReqMsg;
7519 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7520
7521 /*-------------------------------------------------------------------------
7522 Sanity check
7523 -------------------------------------------------------------------------*/
7524 if (( NULL == pEventData ) ||
7525 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7526 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7527 {
7528 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7529 "%s: Invalid parameters", __FUNCTION__);
7530 WDI_ASSERT(0);
7531 return WDI_STATUS_E_FAILURE;
7532 }
7533
7534 /*-------------------------------------------------------------------------
7535 Check to see if we are in the middle of an association, if so queue, if
7536 not it means it is free to process request
7537 -------------------------------------------------------------------------*/
7538 wpalMutexAcquire(&pWDICtx->wptMutex);
7539
7540 /*------------------------------------------------------------------------
7541 Find the BSS for which the request is made
7542 ------------------------------------------------------------------------*/
7543 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7544 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7545 &pBSSSes);
7546
7547 if ( NULL == pBSSSes )
7548 {
7549 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7550 "Association sequence for this BSS does not yet exist - "
7551 "operation not allowed");
7552
7553 wpalMutexRelease(&pWDICtx->wptMutex);
7554 return WDI_STATUS_E_NOT_ALLOWED;
7555 }
7556
7557 /*------------------------------------------------------------------------
7558 Check if this BSS is being currently processed or queued,
7559 if queued - queue the new request as well
7560 ------------------------------------------------------------------------*/
7561 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7562 {
7563 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7564 "Association sequence for this BSS exists but currently queued");
7565
7566 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7567
7568 wpalMutexRelease(&pWDICtx->wptMutex);
7569
7570 return wdiStatus;
7571 }
7572
7573 /*-----------------------------------------------------------------------
7574 If Post Assoc was not yet received - the current association must
7575 be in progress
7576 -----------------------------------------------------------------------*/
7577 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
7578 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7579 {
7580 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7581 "Association sequence for this BSS association no longer in "
7582 "progress - not allowed");
7583
7584 wpalMutexRelease(&pWDICtx->wptMutex);
7585 return WDI_STATUS_E_NOT_ALLOWED;
7586 }
7587
7588 /*-----------------------------------------------------------------------
7589 Post Assoc Request is only allowed in Joining state
7590 -----------------------------------------------------------------------*/
7591 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7592 {
7593 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7594 "Post Assoc not allowed before JOIN - failing request");
7595
7596 wpalMutexRelease(&pWDICtx->wptMutex);
7597 return WDI_STATUS_E_NOT_ALLOWED;
7598 }
7599
7600 wpalMutexRelease(&pWDICtx->wptMutex);
7601
7602 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7603 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7604 /*-----------------------------------------------------------------------
7605 Fill message for tx over the bus
7606 -----------------------------------------------------------------------*/
7607 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
7608 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7609 ( usSendSize < (usDataOffset + uMsgSize )))
7610 {
7611 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7612 "Unable to get send buffer in start req %x %x %x",
7613 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7614 WDI_ASSERT(0);
7615 return WDI_STATUS_E_FAILURE;
7616 }
7617
7618 /*Copy the STA parameters */
7619 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7620 &pwdiPostAssocParams->wdiSTAParams );
7621
7622 /* Need to fill in the self STA Index */
7623 if ( WDI_STATUS_SUCCESS !=
7624 WDI_STATableFindStaidByAddr(pWDICtx,
7625 pwdiPostAssocParams->wdiSTAParams.macSTA,
7626 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7627 {
7628 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7629 "This station does not exist in the WDI Station Table %d");
7630 wpalMutexRelease(&pWDICtx->wptMutex);
7631 return WDI_STATUS_E_FAILURE;
7632 }
7633
7634 /* Need to fill in the BSS index */
7635 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
7636 pBSSSes->ucBSSIdx;
7637
7638 /*Copy the BSS parameters */
7639 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7640 &pwdiPostAssocParams->wdiBSSParams);
7641
7642 /* Need to fill in the STA index of the peer */
7643 if ( WDI_STATUS_SUCCESS !=
7644 WDI_STATableFindStaidByAddr(pWDICtx,
7645 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
7646 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
7647 {
7648 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7649 "This station does not exist in the WDI Station Table %d");
7650 wpalMutexRelease(&pWDICtx->wptMutex);
7651 return WDI_STATUS_E_FAILURE;
7652 }
7653
7654 /* Need to fill in the BSS index */
7655 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
7656 pBSSSes->ucBSSIdx;
7657
7658
7659 wpalMemoryCopy( pSendBuffer+usDataOffset,
7660 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7661 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
7662
7663 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7664
7665 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7666 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7667 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
7668
7669
7670 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
7671 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
7672
7673
7674 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
7675 pwdiPostAssocParams,
7676 sizeof(pWDICtx->wdiCachedPostAssocReq));
7677
7678 /*-------------------------------------------------------------------------
7679 Send Post Assoc Request to HAL
7680 -------------------------------------------------------------------------*/
7681 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7682 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7683
7684
7685}/*WDI_ProcessPostAssocReq*/
7686
7687/**
7688 @brief Process Del STA Request function (called when Main FSM
7689 allows it)
7690
7691 @param pWDICtx: pointer to the WLAN DAL context
7692 pEventData: pointer to the event information structure
7693
7694 @see
7695 @return Result of the function call
7696*/
7697WDI_Status
7698WDI_ProcessDelSTAReq
7699(
7700 WDI_ControlBlockType* pWDICtx,
7701 WDI_EventInfoType* pEventData
7702)
7703{
7704 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7705 WDI_DelSTARspCb wdiDelSTARspCb;
7706 wpt_uint8 ucCurrentBSSSesIdx = 0;
7707 WDI_BSSSessionType* pBSSSes = NULL;
7708 wpt_uint8* pSendBuffer = NULL;
7709 wpt_uint16 usDataOffset = 0;
7710 wpt_uint16 usSendSize = 0;
7711 wpt_macAddr macBSSID;
7712 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7713
7714 tDeleteStaReqMsg halDelStaReqMsg;
7715 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7716
7717 /*-------------------------------------------------------------------------
7718 Sanity check
7719 -------------------------------------------------------------------------*/
7720 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7721 ( NULL == pEventData->pCBfnc ))
7722 {
7723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7724 "%s: Invalid parameters", __FUNCTION__);
7725 WDI_ASSERT(0);
7726 return WDI_STATUS_E_FAILURE;
7727 }
7728
7729 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7730 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7731 /*-------------------------------------------------------------------------
7732 Check to see if we are in the middle of an association, if so queue, if
7733 not it means it is free to process request
7734 -------------------------------------------------------------------------*/
7735 wpalMutexAcquire(&pWDICtx->wptMutex);
7736
7737 /*------------------------------------------------------------------------
7738 Find the BSS for which the request is made and identify WDI session
7739 ------------------------------------------------------------------------*/
7740 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7741 pwdiDelSTAParams->ucSTAIdx,
7742 &macBSSID))
7743 {
7744 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7745 "This station does not exist in the WDI Station Table %d");
7746 wpalMutexRelease(&pWDICtx->wptMutex);
7747 return WDI_STATUS_E_FAILURE;
7748 }
7749
7750 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7751 if ( NULL == pBSSSes )
7752 {
7753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7754 "Association sequence for this BSS does not yet exist");
7755
7756 wpalMutexRelease(&pWDICtx->wptMutex);
7757 return WDI_STATUS_E_NOT_ALLOWED;
7758 }
7759
7760 /*------------------------------------------------------------------------
7761 Check if this BSS is being currently processed or queued,
7762 if queued - queue the new request as well
7763 ------------------------------------------------------------------------*/
7764 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7765 {
7766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7767 "Association sequence for this BSS exists but currently queued");
7768
7769 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7770 wpalMutexRelease(&pWDICtx->wptMutex);
7771 return wdiStatus;
7772 }
7773
7774 wpalMutexRelease(&pWDICtx->wptMutex);
7775 /*-----------------------------------------------------------------------
7776 Get message buffer
7777 -----------------------------------------------------------------------*/
7778 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
7779 sizeof(halDelStaReqMsg.delStaParams),
7780 &pSendBuffer, &usDataOffset, &usSendSize))||
7781 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7782 {
7783 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7784 "Unable to get send buffer in start req %x %x %x",
7785 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7786 WDI_ASSERT(0);
7787 return WDI_STATUS_E_FAILURE;
7788 }
7789
7790 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7791 wpalMemoryCopy( pSendBuffer+usDataOffset,
7792 &halDelStaReqMsg.delStaParams,
7793 sizeof(halDelStaReqMsg.delStaParams));
7794
7795 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
7796 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
7797
7798 /*-------------------------------------------------------------------------
7799 Send Del STA Request to HAL
7800 -------------------------------------------------------------------------*/
7801 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7802 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7803
7804}/*WDI_ProcessDelSTAReq*/
7805
7806
7807/*==========================================================================
7808 SECURITY REQUEST PROCESSING API
7809==========================================================================*/
7810/**
7811 @brief Process Set BSS Key Request function (called when Main FSM
7812 allows it)
7813
7814 @param pWDICtx: pointer to the WLAN DAL context
7815 pEventData: pointer to the event information structure
7816
7817 @see
7818 @return Result of the function call
7819*/
7820WDI_Status
7821WDI_ProcessSetBssKeyReq
7822(
7823 WDI_ControlBlockType* pWDICtx,
7824 WDI_EventInfoType* pEventData
7825)
7826{
7827 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7828 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
7829 wpt_uint8 ucCurrentBSSSesIdx = 0;
7830 WDI_BSSSessionType* pBSSSes = NULL;
7831 wpt_uint8* pSendBuffer = NULL;
7832 wpt_uint16 usDataOffset = 0;
7833 wpt_uint16 usSendSize = 0;
7834 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7835 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7836 wpt_uint8 keyIndex = 0;
7837
7838 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7839
7840 /*-------------------------------------------------------------------------
7841 Sanity check
7842 -------------------------------------------------------------------------*/
7843 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7844 ( NULL == pEventData->pCBfnc ))
7845 {
7846 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7847 "%s: Invalid parameters", __FUNCTION__);
7848 WDI_ASSERT(0);
7849 return WDI_STATUS_E_FAILURE;
7850 }
7851
7852 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7853 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7854 /*-------------------------------------------------------------------------
7855 Check to see if we are in the middle of an association, if so queue, if
7856 not it means it is free to process request
7857 -------------------------------------------------------------------------*/
7858 wpalMutexAcquire(&pWDICtx->wptMutex);
7859
7860 /*------------------------------------------------------------------------
7861 Find the BSS for which the request is made
7862 ------------------------------------------------------------------------*/
7863 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7864 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7865 &pBSSSes);
7866
7867 if ( NULL == pBSSSes )
7868 {
7869 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7870 "Association sequence for this BSS does not yet exist");
7871
7872 wpalMutexRelease(&pWDICtx->wptMutex);
7873 return WDI_STATUS_E_NOT_ALLOWED;
7874 }
7875
7876 /*------------------------------------------------------------------------
7877 Check if this BSS is being currently processed or queued,
7878 if queued - queue the new request as well
7879 ------------------------------------------------------------------------*/
7880 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7881 {
7882 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7883 "Association sequence for this BSS exists but currently queued");
7884
7885 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7886 wpalMutexRelease(&pWDICtx->wptMutex);
7887 return wdiStatus;
7888 }
7889
7890
7891 wpalMutexRelease(&pWDICtx->wptMutex);
7892 /*-----------------------------------------------------------------------
7893 Get message buffer
7894 -----------------------------------------------------------------------*/
7895 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
7896 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
7897 &pSendBuffer, &usDataOffset, &usSendSize))||
7898 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
7899 {
7900 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7901 "Unable to get send buffer in set bss key req %x %x %x",
7902 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
7903 WDI_ASSERT(0);
7904 return WDI_STATUS_E_FAILURE;
7905 }
7906
7907 /*-----------------------------------------------------------------------
7908 Copy the Key parameters into the HAL message
7909 -----------------------------------------------------------------------*/
7910
7911 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
7912
7913 halSetBssKeyReqMsg.setBssKeyParams.encType =
7914 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
7915
7916 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
7917 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
7918
7919 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
7920 keyIndex++)
7921 {
7922 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
7923 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
7924 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
7925 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
7926 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
7927 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
7928 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
7929 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
7930 WDI_MAX_KEY_RSC_LEN);
7931 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
7932 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
7933 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
7934 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
7935 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
7936 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
7937 WDI_MAX_KEY_LENGTH);
7938 }
7939
7940 wpalMemoryCopy( pSendBuffer+usDataOffset,
7941 &halSetBssKeyReqMsg.setBssKeyParams,
7942 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
7943
7944 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
7945 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
7946
7947 /*-------------------------------------------------------------------------
7948 Send Set BSS Key Request to HAL
7949 -------------------------------------------------------------------------*/
7950 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7951 wdiSetBSSKeyRspCb, pEventData->pUserData,
7952 WDI_SET_BSS_KEY_RESP);
7953
7954}/*WDI_ProcessSetBssKeyReq*/
7955
7956/**
7957 @brief Process Remove BSS Key Request function (called when Main
7958 FSM allows it)
7959
7960 @param pWDICtx: pointer to the WLAN DAL context
7961 pEventData: pointer to the event information structure
7962
7963 @see
7964 @return Result of the function call
7965*/
7966WDI_Status
7967WDI_ProcessRemoveBssKeyReq
7968(
7969 WDI_ControlBlockType* pWDICtx,
7970 WDI_EventInfoType* pEventData
7971)
7972{
7973 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
7974 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
7975 wpt_uint8 ucCurrentBSSSesIdx = 0;
7976 WDI_BSSSessionType* pBSSSes = NULL;
7977 wpt_uint8* pSendBuffer = NULL;
7978 wpt_uint16 usDataOffset = 0;
7979 wpt_uint16 usSendSize = 0;
7980 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7981 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
7982 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7983
7984 /*-------------------------------------------------------------------------
7985 Sanity check
7986 -------------------------------------------------------------------------*/
7987 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7988 ( NULL == pEventData->pCBfnc ))
7989 {
7990 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7991 "%s: Invalid parameters", __FUNCTION__);
7992 WDI_ASSERT(0);
7993 return WDI_STATUS_E_FAILURE;
7994 }
7995
7996 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
7997 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
7998 /*-------------------------------------------------------------------------
7999 Check to see if we are in the middle of an association, if so queue, if
8000 not it means it is free to process request
8001 -------------------------------------------------------------------------*/
8002 wpalMutexAcquire(&pWDICtx->wptMutex);
8003
8004 /*------------------------------------------------------------------------
8005 Find the BSS for which the request is made
8006 ------------------------------------------------------------------------*/
8007 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8008 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8009 &pBSSSes);
8010
8011 if ( NULL == pBSSSes )
8012 {
8013 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8014 "Association sequence for this BSS does not yet exist");
8015
8016 wpalMutexRelease(&pWDICtx->wptMutex);
8017 return WDI_STATUS_E_NOT_ALLOWED;
8018 }
8019
8020 /*------------------------------------------------------------------------
8021 Check if this BSS is being currently processed or queued,
8022 if queued - queue the new request as well
8023 ------------------------------------------------------------------------*/
8024 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8025 {
8026 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8027 "Association sequence for this BSS exists but currently queued");
8028
8029 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8030 wpalMutexRelease(&pWDICtx->wptMutex);
8031 return wdiStatus;
8032 }
8033
8034
8035 wpalMutexRelease(&pWDICtx->wptMutex);
8036
8037 /*-----------------------------------------------------------------------
8038 Get message buffer
8039 -----------------------------------------------------------------------*/
8040 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
8041 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8042 &pSendBuffer, &usDataOffset, &usSendSize))||
8043 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8044 {
8045 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8046 "Unable to get send buffer in set bss key req %x %x %x",
8047 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8048 WDI_ASSERT(0);
8049 return WDI_STATUS_E_FAILURE;
8050 }
8051 /*-----------------------------------------------------------------------
8052 Copy the Key parameters into the HAL message
8053 -----------------------------------------------------------------------*/
8054 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8055
8056 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
8057 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8058
8059 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8060
8061 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
8062 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8063
8064 wpalMemoryCopy( pSendBuffer+usDataOffset,
8065 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8066 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
8067
8068 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
8069 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
8070
8071 /*-------------------------------------------------------------------------
8072 Send Remove BSS Key Request to HAL
8073 -------------------------------------------------------------------------*/
8074 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8075 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
8076 WDI_RMV_BSS_KEY_RESP);
8077}/*WDI_ProcessRemoveBssKeyReq*/
8078
8079/**
8080 @brief Process Set STA KeyRequest function (called when Main FSM
8081 allows it)
8082
8083 @param pWDICtx: pointer to the WLAN DAL context
8084 pEventData: pointer to the event information structure
8085
8086 @see
8087 @return Result of the function call
8088*/
8089WDI_Status
8090WDI_ProcessSetStaKeyReq
8091(
8092 WDI_ControlBlockType* pWDICtx,
8093 WDI_EventInfoType* pEventData
8094)
8095{
8096 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8097 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8098 WDI_BSSSessionType* pBSSSes = NULL;
8099 wpt_uint8* pSendBuffer = NULL;
8100 wpt_uint16 usDataOffset = 0;
8101 wpt_uint16 usSendSize = 0;
8102 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8103 wpt_macAddr macBSSID;
8104 wpt_uint8 ucCurrentBSSSesIdx;
8105 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8106 wpt_uint8 keyIndex = 0;
8107
8108 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8109
8110 /*-------------------------------------------------------------------------
8111 Sanity check
8112 -------------------------------------------------------------------------*/
8113 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8114 ( NULL == pEventData->pCBfnc ))
8115 {
8116 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8117 "%s: Invalid parameters", __FUNCTION__);
8118 WDI_ASSERT(0);
8119 return WDI_STATUS_E_FAILURE;
8120 }
8121
8122 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8123 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8124 /*-------------------------------------------------------------------------
8125 Check to see if we are in the middle of an association, if so queue, if
8126 not it means it is free to process request
8127 -------------------------------------------------------------------------*/
8128 wpalMutexAcquire(&pWDICtx->wptMutex);
8129
8130 /*------------------------------------------------------------------------
8131 Find the BSS for which the request is made and identify WDI session
8132 ------------------------------------------------------------------------*/
8133 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8134 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8135 &macBSSID))
8136 {
8137 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8138 "This station does not exist in the WDI Station Table %d");
8139 wpalMutexRelease(&pWDICtx->wptMutex);
8140 return WDI_STATUS_E_FAILURE;
8141 }
8142
8143 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8144 if ( NULL == pBSSSes )
8145 {
8146 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8147 "Association sequence for this BSS does not yet exist");
8148
8149 wpalMutexRelease(&pWDICtx->wptMutex);
8150 return WDI_STATUS_E_NOT_ALLOWED;
8151 }
8152
8153 /*------------------------------------------------------------------------
8154 Check if this BSS is being currently processed or queued,
8155 if queued - queue the new request as well
8156 ------------------------------------------------------------------------*/
8157 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8158 {
8159 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8160 "Association sequence for this BSS exists but currently queued");
8161
8162 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8163 wpalMutexRelease(&pWDICtx->wptMutex);
8164 return wdiStatus;
8165 }
8166
8167
8168 wpalMutexRelease(&pWDICtx->wptMutex);
8169 /*-----------------------------------------------------------------------
8170 Get message buffer
8171 -----------------------------------------------------------------------*/
8172 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
8173 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8174 &pSendBuffer, &usDataOffset, &usSendSize))||
8175 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8176 {
8177 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8178 "Unable to get send buffer in set bss key req %x %x %x",
8179 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8180 WDI_ASSERT(0);
8181 return WDI_STATUS_E_FAILURE;
8182 }
8183 /*-----------------------------------------------------------------------
8184 Copy the STA Key parameters into the HAL message
8185 -----------------------------------------------------------------------*/
8186 halSetStaKeyReqMsg.setStaKeyParams.encType =
8187 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8188
8189 halSetStaKeyReqMsg.setStaKeyParams.wepType =
8190 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8191
8192 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8193
8194 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8195
8196 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8197
8198#ifdef WLAN_SOFTAP_FEATURE
8199 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8200 keyIndex++)
8201 {
8202 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
8203 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8204 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8205 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8206 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8207 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8208 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
8209 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
8210 WDI_MAX_KEY_RSC_LEN);
8211 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
8212 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
8213 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
8214 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8215 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
8216 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
8217 WDI_MAX_KEY_LENGTH);
8218 }
8219#else
8220 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
8221 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8222 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8223 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8224 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8225 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8226 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
8227 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
8228 WDI_MAX_KEY_RSC_LEN);
8229 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
8230 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
8231 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
8232 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8233 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
8234 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
8235 WDI_MAX_KEY_LENGTH);
8236#endif
8237
8238 wpalMemoryCopy( pSendBuffer+usDataOffset,
8239 &halSetStaKeyReqMsg.setStaKeyParams,
8240 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
8241
8242 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
8243 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
8244
8245 /*-------------------------------------------------------------------------
8246 Send Set STA Key Request to HAL
8247 -------------------------------------------------------------------------*/
8248 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8249 wdiSetSTAKeyRspCb, pEventData->pUserData,
8250 WDI_SET_STA_KEY_RESP);
8251
8252}/*WDI_ProcessSetSTAKeyReq*/
8253
8254/**
8255 @brief Process Remove STA Key Request function (called when
8256 Main FSM allows it)
8257
8258 @param pWDICtx: pointer to the WLAN DAL context
8259 pEventData: pointer to the event information structure
8260
8261 @see
8262 @return Result of the function call
8263*/
8264WDI_Status
8265WDI_ProcessRemoveStaKeyReq
8266(
8267 WDI_ControlBlockType* pWDICtx,
8268 WDI_EventInfoType* pEventData
8269)
8270{
8271 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8272 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8273 WDI_BSSSessionType* pBSSSes = NULL;
8274 wpt_uint8* pSendBuffer = NULL;
8275 wpt_uint16 usDataOffset = 0;
8276 wpt_uint16 usSendSize = 0;
8277 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8278 wpt_macAddr macBSSID;
8279 wpt_uint8 ucCurrentBSSSesIdx;
8280 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8281 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8282
8283 /*-------------------------------------------------------------------------
8284 Sanity check
8285 -------------------------------------------------------------------------*/
8286 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8287 ( NULL == pEventData->pCBfnc ))
8288 {
8289 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8290 "%s: Invalid parameters", __FUNCTION__);
8291 WDI_ASSERT(0);
8292 return WDI_STATUS_E_FAILURE;
8293 }
8294
8295 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8296 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8297 /*-------------------------------------------------------------------------
8298 Check to see if we are in the middle of an association, if so queue, if
8299 not it means it is free to process request
8300 -------------------------------------------------------------------------*/
8301 wpalMutexAcquire(&pWDICtx->wptMutex);
8302
8303 /*------------------------------------------------------------------------
8304 Find the BSS for which the request is made and identify WDI session
8305 ------------------------------------------------------------------------*/
8306 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8307 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8308 &macBSSID))
8309 {
8310 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8311 "This station does not exist in the WDI Station Table %d");
8312 wpalMutexRelease(&pWDICtx->wptMutex);
8313 return WDI_STATUS_E_FAILURE;
8314 }
8315
8316 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8317 if ( NULL == pBSSSes )
8318 {
8319 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8320 "Association sequence for this BSS does not yet exist");
8321
8322 wpalMutexRelease(&pWDICtx->wptMutex);
8323 return WDI_STATUS_E_NOT_ALLOWED;
8324 }
8325
8326 /*------------------------------------------------------------------------
8327 Check if this BSS is being currently processed or queued,
8328 if queued - queue the new request as well
8329 ------------------------------------------------------------------------*/
8330 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8331 {
8332 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8333 "Association sequence for this BSS exists but currently queued");
8334
8335 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8336 wpalMutexRelease(&pWDICtx->wptMutex);
8337 return wdiStatus;
8338 }
8339
8340
8341
8342 wpalMutexRelease(&pWDICtx->wptMutex);
8343 /*-----------------------------------------------------------------------
8344 Get message buffer
8345 -----------------------------------------------------------------------*/
8346 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
8347 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8348 &pSendBuffer, &usDataOffset, &usSendSize))||
8349 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8350 {
8351 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8352 "Unable to get send buffer in set bss key req %x %x %x",
8353 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8354 WDI_ASSERT(0);
8355 return WDI_STATUS_E_FAILURE;
8356 }
8357
8358 /*-----------------------------------------------------------------------
8359 Copy the Key parameters into the HAL message
8360 -----------------------------------------------------------------------*/
8361
8362 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
8363 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8364
8365 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
8366 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8367
8368 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
8369 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8370
8371 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
8372 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8373
8374 wpalMemoryCopy( pSendBuffer+usDataOffset,
8375 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8376 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
8377
8378 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
8379 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
8380
8381 /*-------------------------------------------------------------------------
8382 Send Remove STA Key Request to HAL
8383 -------------------------------------------------------------------------*/
8384 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8385 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
8386 WDI_RMV_STA_KEY_RESP);
8387
8388}/*WDI_ProcessRemoveSTAKeyReq*/
8389
8390/**
8391 @brief Process Set STA KeyRequest function (called when Main FSM
8392 allows it)
8393
8394 @param pWDICtx: pointer to the WLAN DAL context
8395 pEventData: pointer to the event information structure
8396
8397 @see
8398 @return Result of the function call
8399*/
8400WDI_Status
8401WDI_ProcessSetStaBcastKeyReq
8402(
8403 WDI_ControlBlockType* pWDICtx,
8404 WDI_EventInfoType* pEventData
8405)
8406{
8407 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8408 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8409 WDI_BSSSessionType* pBSSSes = NULL;
8410 wpt_uint8* pSendBuffer = NULL;
8411 wpt_uint16 usDataOffset = 0;
8412 wpt_uint16 usSendSize = 0;
8413 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8414 wpt_macAddr macBSSID;
8415 wpt_uint8 ucCurrentBSSSesIdx;
8416 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8417 wpt_uint8 keyIndex = 0;
8418
8419 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8420
8421 /*-------------------------------------------------------------------------
8422 Sanity check
8423 -------------------------------------------------------------------------*/
8424 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8425 ( NULL == pEventData->pCBfnc ))
8426 {
8427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8428 "%s: Invalid parameters", __FUNCTION__);
8429 WDI_ASSERT(0);
8430 return WDI_STATUS_E_FAILURE;
8431 }
8432
8433 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8434 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8435 /*-------------------------------------------------------------------------
8436 Check to see if we are in the middle of an association, if so queue, if
8437 not it means it is free to process request
8438 -------------------------------------------------------------------------*/
8439 wpalMutexAcquire(&pWDICtx->wptMutex);
8440
8441 /*------------------------------------------------------------------------
8442 Find the BSS for which the request is made and identify WDI session
8443 ------------------------------------------------------------------------*/
8444 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8445 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8446 &macBSSID))
8447 {
8448 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8449 "This station does not exist in the WDI Station Table %d");
8450 wpalMutexRelease(&pWDICtx->wptMutex);
8451 return WDI_STATUS_E_FAILURE;
8452 }
8453
8454 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8455 if ( NULL == pBSSSes )
8456 {
8457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8458 "Association sequence for this BSS does not yet exist");
8459
8460 wpalMutexRelease(&pWDICtx->wptMutex);
8461 return WDI_STATUS_E_NOT_ALLOWED;
8462 }
8463
8464 /*------------------------------------------------------------------------
8465 Check if this BSS is being currently processed or queued,
8466 if queued - queue the new request as well
8467 ------------------------------------------------------------------------*/
8468 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8469 {
8470 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8471 "Association sequence for this BSS exists but currently queued");
8472
8473 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8474 wpalMutexRelease(&pWDICtx->wptMutex);
8475 return wdiStatus;
8476 }
8477
8478
8479 wpalMutexRelease(&pWDICtx->wptMutex);
8480 /*-----------------------------------------------------------------------
8481 Get message buffer
8482 -----------------------------------------------------------------------*/
8483 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
8484 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8485 &pSendBuffer, &usDataOffset, &usSendSize))||
8486 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8487 {
8488 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8489 "Unable to get send buffer in set bss key req %x %x %x",
8490 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8491 WDI_ASSERT(0);
8492 return WDI_STATUS_E_FAILURE;
8493 }
8494 /*-----------------------------------------------------------------------
8495 Copy the STA Key parameters into the HAL message
8496 -----------------------------------------------------------------------*/
8497 halSetStaKeyReqMsg.setStaKeyParams.encType =
8498 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8499
8500 halSetStaKeyReqMsg.setStaKeyParams.wepType =
8501 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8502
8503 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8504
8505 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8506
8507 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8508
8509#ifdef WLAN_SOFTAP_FEATURE
8510 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8511 keyIndex++)
8512 {
8513 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
8514 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8515 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8516 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8517 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8518 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8519 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
8520 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
8521 WDI_MAX_KEY_RSC_LEN);
8522 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
8523 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
8524 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
8525 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8526 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
8527 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
8528 WDI_MAX_KEY_LENGTH);
8529 }
8530#else
8531 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
8532 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8533 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8534 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8535 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8536 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8537 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
8538 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
8539 WDI_MAX_KEY_RSC_LEN);
8540 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
8541 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
8542 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
8543 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8544 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
8545 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
8546 WDI_MAX_KEY_LENGTH);
8547#endif
8548
8549 wpalMemoryCopy( pSendBuffer+usDataOffset,
8550 &halSetStaKeyReqMsg.setStaKeyParams,
8551 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
8552
8553 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
8554 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
8555
8556 /*-------------------------------------------------------------------------
8557 Send Set STA Key Request to HAL
8558 -------------------------------------------------------------------------*/
8559 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8560 wdiSetSTAKeyRspCb, pEventData->pUserData,
8561 WDI_SET_STA_KEY_RESP);
8562
8563}/*WDI_ProcessSetSTABcastKeyReq*/
8564
8565/**
8566 @brief Process Remove STA Key Request function (called when
8567 Main FSM allows it)
8568
8569 @param pWDICtx: pointer to the WLAN DAL context
8570 pEventData: pointer to the event information structure
8571
8572 @see
8573 @return Result of the function call
8574*/
8575WDI_Status
8576WDI_ProcessRemoveStaBcastKeyReq
8577(
8578 WDI_ControlBlockType* pWDICtx,
8579 WDI_EventInfoType* pEventData
8580)
8581{
8582 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8583 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8584 WDI_BSSSessionType* pBSSSes = NULL;
8585 wpt_uint8* pSendBuffer = NULL;
8586 wpt_uint16 usDataOffset = 0;
8587 wpt_uint16 usSendSize = 0;
8588 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8589 wpt_macAddr macBSSID;
8590 wpt_uint8 ucCurrentBSSSesIdx;
8591 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8592 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8593
8594 /*-------------------------------------------------------------------------
8595 Sanity check
8596 -------------------------------------------------------------------------*/
8597 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8598 ( NULL == pEventData->pCBfnc ))
8599 {
8600 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8601 "%s: Invalid parameters", __FUNCTION__);
8602 WDI_ASSERT(0);
8603 return WDI_STATUS_E_FAILURE;
8604 }
8605
8606 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8607 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8608 /*-------------------------------------------------------------------------
8609 Check to see if we are in the middle of an association, if so queue, if
8610 not it means it is free to process request
8611 -------------------------------------------------------------------------*/
8612 wpalMutexAcquire(&pWDICtx->wptMutex);
8613
8614 /*------------------------------------------------------------------------
8615 Find the BSS for which the request is made and identify WDI session
8616 ------------------------------------------------------------------------*/
8617 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8618 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
8619 &macBSSID))
8620 {
8621 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8622 "This station does not exist in the WDI Station Table %d");
8623 wpalMutexRelease(&pWDICtx->wptMutex);
8624 return WDI_STATUS_E_FAILURE;
8625 }
8626
8627 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8628 if ( NULL == pBSSSes )
8629 {
8630 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8631 "Association sequence for this BSS does not yet exist");
8632
8633 wpalMutexRelease(&pWDICtx->wptMutex);
8634 return WDI_STATUS_E_NOT_ALLOWED;
8635 }
8636
8637 /*------------------------------------------------------------------------
8638 Check if this BSS is being currently processed or queued,
8639 if queued - queue the new request as well
8640 ------------------------------------------------------------------------*/
8641 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8642 {
8643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8644 "Association sequence for this BSS exists but currently queued");
8645
8646 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8647 wpalMutexRelease(&pWDICtx->wptMutex);
8648 return wdiStatus;
8649 }
8650
8651
8652
8653 wpalMutexRelease(&pWDICtx->wptMutex);
8654 /*-----------------------------------------------------------------------
8655 Get message buffer
8656 -----------------------------------------------------------------------*/
8657 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
8658 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8659 &pSendBuffer, &usDataOffset, &usSendSize))||
8660 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8661 {
8662 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8663 "Unable to get send buffer in set bss key req %x %x %x",
8664 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8665 WDI_ASSERT(0);
8666 return WDI_STATUS_E_FAILURE;
8667 }
8668
8669 /*-----------------------------------------------------------------------
8670 Copy the Key parameters into the HAL message
8671 -----------------------------------------------------------------------*/
8672
8673 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
8674 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8675
8676 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
8677 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8678
8679 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
8680 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8681
8682 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
8683 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8684
8685 wpalMemoryCopy( pSendBuffer+usDataOffset,
8686 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8687 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
8688
8689 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
8690 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
8691
8692 /*-------------------------------------------------------------------------
8693 Send Remove STA Key Request to HAL
8694 -------------------------------------------------------------------------*/
8695 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8696 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
8697 WDI_RMV_STA_KEY_RESP);
8698
8699}/*WDI_ProcessRemoveSTABcastKeyReq*/
8700
8701/*==========================================================================
8702 QOS and BA PROCESSING REQUEST API
8703==========================================================================*/
8704/**
8705 @brief Process Add TSpec Request function (called when Main FSM
8706 allows it)
8707
8708 @param pWDICtx: pointer to the WLAN DAL context
8709 pEventData: pointer to the event information structure
8710
8711 @see
8712 @return Result of the function call
8713*/
8714WDI_Status
8715WDI_ProcessAddTSpecReq
8716(
8717 WDI_ControlBlockType* pWDICtx,
8718 WDI_EventInfoType* pEventData
8719)
8720{
8721 WDI_AddTSReqParamsType* pwdiAddTSParams;
8722 WDI_AddTsRspCb wdiAddTSRspCb;
8723 wpt_uint8 ucCurrentBSSSesIdx = 0;
8724 WDI_BSSSessionType* pBSSSes = NULL;
8725 wpt_uint8* pSendBuffer = NULL;
8726 wpt_uint16 usDataOffset = 0;
8727 wpt_uint16 usSendSize = 0;
8728 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8729 wpt_macAddr macBSSID;
8730 tAddTsParams halAddTsParams = {0};
8731
8732 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8733
8734 /*-------------------------------------------------------------------------
8735 Sanity check
8736 -------------------------------------------------------------------------*/
8737 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8738 ( NULL == pEventData->pCBfnc ))
8739 {
8740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8741 "%s: Invalid parameters", __FUNCTION__);
8742 WDI_ASSERT(0);
8743 return WDI_STATUS_E_FAILURE;
8744 }
8745
8746 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8747 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8748 /*-------------------------------------------------------------------------
8749 Check to see if we are in the middle of an association, if so queue, if
8750 not it means it is free to process request
8751 -------------------------------------------------------------------------*/
8752 wpalMutexAcquire(&pWDICtx->wptMutex);
8753
8754 /*------------------------------------------------------------------------
8755 Find the BSS for which the request is made and identify WDI session
8756 ------------------------------------------------------------------------*/
8757 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8758 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
8759 &macBSSID))
8760 {
8761 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8762 "This station does not exist in the WDI Station Table %d");
8763 wpalMutexRelease(&pWDICtx->wptMutex);
8764 return WDI_STATUS_E_FAILURE;
8765 }
8766
8767 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8768 if ( NULL == pBSSSes )
8769 {
8770 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8771 "Association sequence for this BSS does not yet exist");
8772
8773 wpalMutexRelease(&pWDICtx->wptMutex);
8774 return WDI_STATUS_E_NOT_ALLOWED;
8775 }
8776
8777 /*------------------------------------------------------------------------
8778 Check if this BSS is being currently processed or queued,
8779 if queued - queue the new request as well
8780 ------------------------------------------------------------------------*/
8781 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8782 {
8783 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8784 "Association sequence for this BSS exists but currently queued");
8785
8786 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8787 wpalMutexRelease(&pWDICtx->wptMutex);
8788 return wdiStatus;
8789 }
8790
8791 wpalMutexRelease(&pWDICtx->wptMutex);
8792 /*-----------------------------------------------------------------------
8793 Get message buffer
8794 ! TO DO : proper conversion into the HAL Message Request Format
8795 -----------------------------------------------------------------------*/
8796 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8797 sizeof(halAddTsParams),
8798 &pSendBuffer, &usDataOffset,
8799 &usSendSize))||
8800 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8801 {
8802 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8803 "Unable to get send buffer in set bss key req %x %x %x",
8804 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8805 WDI_ASSERT(0);
8806 return WDI_STATUS_E_FAILURE;
8807 }
8808
8809 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8810 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8811
8812 //TSPEC IE
8813 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8814 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
8815 halAddTsParams.tspec.nomMsduSz =
8816 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
8817 halAddTsParams.tspec.maxMsduSz =
8818 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
8819 halAddTsParams.tspec.minSvcInterval =
8820 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
8821 halAddTsParams.tspec.maxSvcInterval =
8822 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
8823 halAddTsParams.tspec.inactInterval =
8824 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
8825 halAddTsParams.tspec.suspendInterval =
8826 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
8827 halAddTsParams.tspec.svcStartTime =
8828 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
8829 halAddTsParams.tspec.minDataRate =
8830 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
8831 halAddTsParams.tspec.meanDataRate =
8832 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
8833 halAddTsParams.tspec.peakDataRate =
8834 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
8835 halAddTsParams.tspec.maxBurstSz =
8836 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
8837 halAddTsParams.tspec.delayBound =
8838 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
8839 halAddTsParams.tspec.minPhyRate =
8840 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
8841 halAddTsParams.tspec.surplusBw =
8842 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
8843 halAddTsParams.tspec.mediumTime =
8844 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8845
8846 //TSPEC IE : TS INFO : TRAFFIC
8847 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
8848 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
8849 halAddTsParams.tspec.tsinfo.traffic.userPrio =
8850 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
8851 halAddTsParams.tspec.tsinfo.traffic.psb =
8852 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
8853 halAddTsParams.tspec.tsinfo.traffic.aggregation =
8854 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
8855 halAddTsParams.tspec.tsinfo.traffic.direction =
8856 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
8857 halAddTsParams.tspec.tsinfo.traffic.tsid =
8858 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
8859 halAddTsParams.tspec.tsinfo.traffic.trafficType =
8860 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
8861
8862 //TSPEC IE : TS INFO : SCHEDULE
8863 halAddTsParams.tspec.tsinfo.schedule.rsvd =
8864 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
8865 halAddTsParams.tspec.tsinfo.schedule.schedule =
8866 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
8867
8868 wpalMemoryCopy( pSendBuffer+usDataOffset,
8869 &halAddTsParams,
8870 sizeof(halAddTsParams));
8871
8872 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
8873 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
8874
8875 /*-------------------------------------------------------------------------
8876 Send Add TS Request to HAL
8877 -------------------------------------------------------------------------*/
8878 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8879 wdiAddTSRspCb, pEventData->pUserData,
8880 WDI_ADD_TS_RESP);
8881}/*WDI_ProcessAddTSpecReq*/
8882
8883
8884/**
8885 @brief Process Del TSpec Request function (called when Main FSM
8886 allows it)
8887
8888 @param pWDICtx: pointer to the WLAN DAL context
8889 pEventData: pointer to the event information structure
8890
8891 @see
8892 @return Result of the function call
8893*/
8894WDI_Status
8895WDI_ProcessDelTSpecReq
8896(
8897 WDI_ControlBlockType* pWDICtx,
8898 WDI_EventInfoType* pEventData
8899)
8900{
8901 WDI_DelTSReqParamsType* pwdiDelTSParams;
8902 WDI_DelTsRspCb wdiDelTSRspCb;
8903 wpt_uint8 ucCurrentBSSSesIdx = 0;
8904 WDI_BSSSessionType* pBSSSes = NULL;
8905 wpt_uint8* pSendBuffer = NULL;
8906 wpt_uint16 usDataOffset = 0;
8907 wpt_uint16 usSendSize = 0;
8908 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8909 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8910
8911 /*-------------------------------------------------------------------------
8912 Sanity check
8913 -------------------------------------------------------------------------*/
8914 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8915 ( NULL == pEventData->pCBfnc ))
8916 {
8917 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8918 "%s: Invalid parameters", __FUNCTION__);
8919 WDI_ASSERT(0);
8920 return WDI_STATUS_E_FAILURE;
8921 }
8922
8923 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
8924 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
8925
8926 /*-------------------------------------------------------------------------
8927 Check to see if we are in the middle of an association, if so queue, if
8928 not it means it is free to process request
8929 -------------------------------------------------------------------------*/
8930 wpalMutexAcquire(&pWDICtx->wptMutex);
8931
8932 /*------------------------------------------------------------------------
8933 Find the BSS for which the request is made
8934 ------------------------------------------------------------------------*/
8935 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
8936 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
8937 &pBSSSes);
8938
8939 if ( NULL == pBSSSes )
8940 {
8941 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8942 "Association sequence for this BSS does not yet exist");
8943
8944 wpalMutexRelease(&pWDICtx->wptMutex);
8945 return WDI_STATUS_E_NOT_ALLOWED;
8946 }
8947
8948 /*------------------------------------------------------------------------
8949 Check if this BSS is being currently processed or queued,
8950 if queued - queue the new request as well
8951 ------------------------------------------------------------------------*/
8952 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8953 {
8954 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8955 "Association sequence for this BSS exists but currently queued");
8956
8957 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8958 wpalMutexRelease(&pWDICtx->wptMutex);
8959 return wdiStatus;
8960 }
8961
8962
8963 wpalMutexRelease(&pWDICtx->wptMutex);
8964 /*-----------------------------------------------------------------------
8965 Get message buffer
8966 ! TO DO : proper conversion into the HAL Message Request Format
8967 -----------------------------------------------------------------------*/
8968 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
8969 sizeof(pwdiDelTSParams->wdiDelTSInfo),
8970 &pSendBuffer, &usDataOffset, &usSendSize))||
8971 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
8972 {
8973 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8974 "Unable to get send buffer in set bss key req %x %x %x",
8975 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
8976 WDI_ASSERT(0);
8977 return WDI_STATUS_E_FAILURE;
8978 }
8979
8980 wpalMemoryCopy( pSendBuffer+usDataOffset,
8981 &pwdiDelTSParams->wdiDelTSInfo,
8982 sizeof(pwdiDelTSParams->wdiDelTSInfo));
8983
8984 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
8985 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
8986
8987 /*-------------------------------------------------------------------------
8988 Send Del TS Request to HAL
8989 -------------------------------------------------------------------------*/
8990 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8991 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
8992}/*WDI_ProcessDelTSpecReq*/
8993
8994/**
8995 @brief Process Update EDCA Params Request function (called when
8996 Main FSM allows it)
8997
8998 @param pWDICtx: pointer to the WLAN DAL context
8999 pEventData: pointer to the event information structure
9000
9001 @see
9002 @return Result of the function call
9003*/
9004WDI_Status
9005WDI_ProcessUpdateEDCAParamsReq
9006(
9007 WDI_ControlBlockType* pWDICtx,
9008 WDI_EventInfoType* pEventData
9009)
9010{
9011 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9012 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
9013 wpt_uint8 ucCurrentBSSSesIdx = 0;
9014 WDI_BSSSessionType* pBSSSes = NULL;
9015 wpt_uint8* pSendBuffer = NULL;
9016 wpt_uint16 usDataOffset = 0;
9017 wpt_uint16 usSendSize = 0;
9018 WDI_Status wdiStatus;
9019 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9020
9021 /*-------------------------------------------------------------------------
9022 Sanity check
9023 -------------------------------------------------------------------------*/
9024 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9025 ( NULL == pEventData->pCBfnc ))
9026 {
9027 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9028 "%s: Invalid parameters", __FUNCTION__);
9029 WDI_ASSERT(0);
9030 return WDI_STATUS_E_FAILURE;
9031 }
9032
9033 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9034 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9035 /*-------------------------------------------------------------------------
9036 Check to see if we are in the middle of an association, if so queue, if
9037 not it means it is free to process request
9038 -------------------------------------------------------------------------*/
9039 wpalMutexAcquire(&pWDICtx->wptMutex);
9040
9041 /*------------------------------------------------------------------------
9042 Find the BSS for which the request is made
9043 ------------------------------------------------------------------------*/
9044 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9045 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9046 &pBSSSes);
9047
9048 if ( NULL == pBSSSes )
9049 {
9050 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9051 "Association sequence for this BSS does not yet exist");
9052
9053 wpalMutexRelease(&pWDICtx->wptMutex);
9054 return WDI_STATUS_E_NOT_ALLOWED;
9055 }
9056
9057 /*------------------------------------------------------------------------
9058 Check if this BSS is being currently processed or queued,
9059 if queued - queue the new request as well
9060 ------------------------------------------------------------------------*/
9061 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9062 {
9063 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9064 "Association sequence for this BSS exists but currently queued");
9065
9066 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9067 wpalMutexRelease(&pWDICtx->wptMutex);
9068 return wdiStatus;
9069 }
9070
9071
9072 wpalMutexRelease(&pWDICtx->wptMutex);
9073 /*-----------------------------------------------------------------------
9074 Get message buffer
9075 ! TO DO : proper conversion into the HAL Message Request Format
9076 -----------------------------------------------------------------------*/
9077 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
9078 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9079 &pSendBuffer, &usDataOffset, &usSendSize))||
9080 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9081 {
9082 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9083 "Unable to get send buffer in set bss key req %x %x %x",
9084 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9085 WDI_ASSERT(0);
9086 return WDI_STATUS_E_FAILURE;
9087 }
9088
9089 wpalMemoryCopy( pSendBuffer+usDataOffset,
9090 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9091 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
9092
9093 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
9094 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
9095
9096 /*-------------------------------------------------------------------------
9097 Send Update EDCA Params Request to HAL
9098 -------------------------------------------------------------------------*/
9099 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9100 wdiUpdateEDCARspCb, pEventData->pUserData,
9101 WDI_UPD_EDCA_PRMS_RESP);
9102}/*WDI_ProcessUpdateEDCAParamsReq*/
9103
9104/**
9105 @brief Process Add BA Request function (called when Main FSM
9106 allows it)
9107
9108 @param pWDICtx: pointer to the WLAN DAL context
9109 pEventData: pointer to the event information structure
9110
9111 @see
9112 @return Result of the function call
9113*/
9114WDI_Status
9115WDI_ProcessAddBASessionReq
9116(
9117 WDI_ControlBlockType* pWDICtx,
9118 WDI_EventInfoType* pEventData
9119)
9120{
9121 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9122 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
9123 wpt_uint8 ucCurrentBSSSesIdx = 0;
9124 WDI_BSSSessionType* pBSSSes = NULL;
9125 wpt_uint8* pSendBuffer = NULL;
9126 wpt_uint16 usDataOffset = 0;
9127 wpt_uint16 usSendSize = 0;
9128 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9129 wpt_macAddr macBSSID;
9130
9131 tAddBASessionReqMsg halAddBASessionReq;
9132 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9133
9134 /*-------------------------------------------------------------------------
9135 Sanity check
9136 -------------------------------------------------------------------------*/
9137 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9138 ( NULL == pEventData->pCBfnc ))
9139 {
9140 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9141 "%s: Invalid parameters", __FUNCTION__);
9142 WDI_ASSERT(0);
9143 return WDI_STATUS_E_FAILURE;
9144 }
9145
9146 pwdiAddBASessionParams =
9147 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
9148 wdiAddBASessionRspCb =
9149 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9150 /*-------------------------------------------------------------------------
9151 Check to see if we are in the middle of an association, if so queue, if
9152 not it means it is free to process request
9153 -------------------------------------------------------------------------*/
9154 wpalMutexAcquire(&pWDICtx->wptMutex);
9155
9156 /*------------------------------------------------------------------------
9157 Find the BSS for which the request is made
9158 ------------------------------------------------------------------------*/
9159 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9160 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
9161 &macBSSID))
9162 {
9163 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9164 "This station does not exist in the WDI Station Table %d");
9165 wpalMutexRelease(&pWDICtx->wptMutex);
9166 return WDI_STATUS_E_FAILURE;
9167 }
9168
9169
9170 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
9171
9172 if ( NULL == pBSSSes )
9173 {
9174 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9175 "Association sequence for this BSS does not yet exist");
9176
9177 wpalMutexRelease(&pWDICtx->wptMutex);
9178 return WDI_STATUS_E_NOT_ALLOWED;
9179 }
9180
9181 /*------------------------------------------------------------------------
9182 Check if this BSS is being currently processed or queued,
9183 if queued - queue the new request as well
9184 ------------------------------------------------------------------------*/
9185 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9186 {
9187 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9188 "Association sequence for this BSS exists but currently queued");
9189
9190 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9191 wpalMutexRelease(&pWDICtx->wptMutex);
9192 return wdiStatus;
9193 }
9194
9195
9196 wpalMutexRelease(&pWDICtx->wptMutex);
9197 /*-----------------------------------------------------------------------
9198 Get message buffer
9199 -----------------------------------------------------------------------*/
9200 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9201 WDI_ADD_BA_SESSION_REQ,
9202 sizeof(halAddBASessionReq.addBASessionParams),
9203 &pSendBuffer, &usDataOffset, &usSendSize))||
9204 ( usSendSize <
9205 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9206 {
9207 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9208 "Unable to get send buffer in Add BA session req %x %x %x",
9209 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9210 WDI_ASSERT(0);
9211 return WDI_STATUS_E_FAILURE;
9212 }
9213
9214 halAddBASessionReq.addBASessionParams.staIdx =
9215 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9216 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9217 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9218 WDI_MAC_ADDR_LEN);
9219 halAddBASessionReq.addBASessionParams.baTID =
9220 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9221 halAddBASessionReq.addBASessionParams.baPolicy =
9222 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9223 halAddBASessionReq.addBASessionParams.baBufferSize =
9224 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9225 halAddBASessionReq.addBASessionParams.baTimeout =
9226 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9227 halAddBASessionReq.addBASessionParams.baSSN =
9228 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9229 halAddBASessionReq.addBASessionParams.baDirection =
9230 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9231
9232 wpalMemoryCopy( pSendBuffer+usDataOffset,
9233 &halAddBASessionReq.addBASessionParams,
9234 sizeof(halAddBASessionReq.addBASessionParams));
9235
9236 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
9237 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
9238
9239 /*-------------------------------------------------------------------------
9240 Send Start Request to HAL
9241 -------------------------------------------------------------------------*/
9242 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9243 wdiAddBASessionRspCb, pEventData->pUserData,
9244 WDI_ADD_BA_SESSION_RESP);
9245}/*WDI_ProcessAddBASessionReq*/
9246
9247/**
9248 @brief Process Del BA Request function (called when Main FSM
9249 allows it)
9250
9251 @param pWDICtx: pointer to the WLAN DAL context
9252 pEventData: pointer to the event information structure
9253
9254 @see
9255 @return Result of the function call
9256*/
9257WDI_Status
9258WDI_ProcessDelBAReq
9259(
9260 WDI_ControlBlockType* pWDICtx,
9261 WDI_EventInfoType* pEventData
9262)
9263{
9264 WDI_DelBAReqParamsType* pwdiDelBAParams;
9265 WDI_DelBARspCb wdiDelBARspCb;
9266 wpt_uint8 ucCurrentBSSSesIdx = 0;
9267 WDI_BSSSessionType* pBSSSes = NULL;
9268 wpt_uint8* pSendBuffer = NULL;
9269 wpt_uint16 usDataOffset = 0;
9270 wpt_uint16 usSendSize = 0;
9271 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9272 wpt_macAddr macBSSID;
9273 tDelBAParams halDelBAparam;
9274 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9275
9276 /*-------------------------------------------------------------------------
9277 Sanity check
9278 -------------------------------------------------------------------------*/
9279 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9280 ( NULL == pEventData->pCBfnc ))
9281 {
9282 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9283 "%s: Invalid parameters", __FUNCTION__);
9284 WDI_ASSERT(0);
9285 return WDI_STATUS_E_FAILURE;
9286 }
9287
9288 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9289 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9290 /*-------------------------------------------------------------------------
9291 Check to see if we are in the middle of an association, if so queue, if
9292 not it means it is free to process request
9293 -------------------------------------------------------------------------*/
9294 wpalMutexAcquire(&pWDICtx->wptMutex);
9295
9296 /*------------------------------------------------------------------------
9297 Find the BSS for which the request is made
9298 ------------------------------------------------------------------------*/
9299 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9300 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
9301 &macBSSID))
9302 {
9303 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9304 "This station does not exist in the WDI Station Table %d");
9305 wpalMutexRelease(&pWDICtx->wptMutex);
9306 return WDI_STATUS_E_FAILURE;
9307 }
9308
9309 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
9310
9311 if ( NULL == pBSSSes )
9312 {
9313 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9314 "Association sequence for this BSS does not yet exist");
9315
9316 wpalMutexRelease(&pWDICtx->wptMutex);
9317 return WDI_STATUS_E_NOT_ALLOWED;
9318 }
9319
9320 /*------------------------------------------------------------------------
9321 Check if this BSS is being currently processed or queued,
9322 if queued - queue the new request as well
9323 ------------------------------------------------------------------------*/
9324 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9325 {
9326 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9327 "Association sequence for this BSS exists but currently queued");
9328
9329 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9330 wpalMutexRelease(&pWDICtx->wptMutex);
9331 return wdiStatus;
9332 }
9333
9334 wpalMutexRelease(&pWDICtx->wptMutex);
9335 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
9336 sizeof(halDelBAparam),
9337 &pSendBuffer, &usDataOffset, &usSendSize))||
9338 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9339 {
9340 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9341 "Unable to get send buffer for DEL BA req %x %x %x",
9342 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9343 WDI_ASSERT(0);
9344 return WDI_STATUS_E_FAILURE;
9345 }
9346
9347 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9348 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9349 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9350
9351 wpalMemoryCopy( pSendBuffer+usDataOffset,
9352 &halDelBAparam,
9353 sizeof(halDelBAparam));
9354
9355 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
9356 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
9357
9358 /*-------------------------------------------------------------------------
9359 Send Start Request to HAL
9360 -------------------------------------------------------------------------*/
9361 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9362 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
9363}/*WDI_ProcessDelBAReq*/
9364
9365#ifdef FEATURE_WLAN_CCX
9366
9367WDI_Status
9368WDI_ProcessTSMStatsReq
9369(
9370 WDI_ControlBlockType* pWDICtx,
9371 WDI_EventInfoType* pEventData
9372)
9373{
9374 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9375 WDI_TsmRspCb wdiTSMRspCb;
9376 wpt_uint8 ucCurrentBSSSesIdx = 0;
9377 WDI_BSSSessionType* pBSSSes = NULL;
9378 wpt_uint8* pSendBuffer = NULL;
9379 wpt_uint16 usDataOffset = 0;
9380 wpt_uint16 usSendSize = 0;
9381 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9382 tTsmStatsParams halTsmStatsReqParams = {0};
9383
9384 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9385
9386 /*-------------------------------------------------------------------------
9387 Sanity check
9388 -------------------------------------------------------------------------*/
9389 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9390 ( NULL == pEventData->pCBfnc ))
9391 {
9392 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9393 "%s: Invalid parameters", __FUNCTION__);
9394 WDI_ASSERT(0);
9395 return WDI_STATUS_E_FAILURE;
9396 }
9397
9398 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9399 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9400 /*-------------------------------------------------------------------------
9401 Check to see if we are in the middle of an association, if so queue, if
9402 not it means it is free to process request
9403 -------------------------------------------------------------------------*/
9404 wpalMutexAcquire(&pWDICtx->wptMutex);
9405
9406 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9407 if ( NULL == pBSSSes )
9408 {
9409 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9410 "Association sequence for this BSS does not yet exist");
9411
9412 wpalMutexRelease(&pWDICtx->wptMutex);
9413 return WDI_STATUS_E_NOT_ALLOWED;
9414 }
9415
9416 /*------------------------------------------------------------------------
9417 Check if this BSS is being currently processed or queued,
9418 if queued - queue the new request as well
9419 ------------------------------------------------------------------------*/
9420 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9421 {
9422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
9423 "Association sequence for this BSS exists but currently queued");
9424
9425 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9426 wpalMutexRelease(&pWDICtx->wptMutex);
9427 return wdiStatus;
9428 }
9429
9430 wpalMutexRelease(&pWDICtx->wptMutex);
9431 /*-----------------------------------------------------------------------
9432 Get message buffer
9433 ! TO DO : proper conversion into the HAL Message Request Format
9434 -----------------------------------------------------------------------*/
9435 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9436 sizeof(halTsmStatsReqParams),
9437 &pSendBuffer, &usDataOffset, &usSendSize))||
9438 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9439 {
9440 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9441 "Unable to get send buffer in set bss key req %x %x %x",
9442 pEventData, pwdiTSMParams, wdiTSMRspCb);
9443 WDI_ASSERT(0);
9444 return WDI_STATUS_E_FAILURE;
9445 }
9446
9447 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9448 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9449 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9450 WDI_MAC_ADDR_LEN);
9451 wpalMemoryCopy( pSendBuffer+usDataOffset,
9452 &halTsmStatsReqParams,
9453 sizeof(halTsmStatsReqParams));
9454
9455 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9456 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9457
9458 /*-------------------------------------------------------------------------
9459 Send TSM Stats Request to HAL
9460 -------------------------------------------------------------------------*/
9461 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9462 wdiTSMRspCb, pEventData->pUserData,
9463 WDI_TSM_STATS_RESP);
9464}/*WDI_ProcessTSMStatsReq*/
9465
9466#endif
9467
9468
9469/**
9470 @brief Process Flush AC Request function (called when Main FSM
9471 allows it)
9472
9473 @param pWDICtx: pointer to the WLAN DAL context
9474 pEventData: pointer to the event information structure
9475
9476 @see
9477 @return Result of the function call
9478*/
9479WDI_Status
9480WDI_ProcessFlushAcReq
9481(
9482 WDI_ControlBlockType* pWDICtx,
9483 WDI_EventInfoType* pEventData
9484)
9485{
9486 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9487 WDI_FlushAcRspCb wdiFlushAcRspCb;
9488 wpt_uint8* pSendBuffer = NULL;
9489 wpt_uint16 usDataOffset = 0;
9490 wpt_uint16 usSendSize = 0;
9491 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9492
9493 /*-------------------------------------------------------------------------
9494 Sanity check
9495 -------------------------------------------------------------------------*/
9496 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9497 ( NULL == pEventData->pCBfnc ))
9498 {
9499 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9500 "%s: Invalid parameters", __FUNCTION__);
9501 WDI_ASSERT(0);
9502 return WDI_STATUS_E_FAILURE;
9503 }
9504
9505 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9506 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9507 /*-----------------------------------------------------------------------
9508 Get message buffer
9509 ! TO DO : proper conversion into the HAL Message Request Format
9510 -----------------------------------------------------------------------*/
9511 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
9512 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9513 &pSendBuffer, &usDataOffset, &usSendSize))||
9514 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9515 {
9516 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9517 "Unable to get send buffer in set bss key req %x %x %x",
9518 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9519 WDI_ASSERT(0);
9520 return WDI_STATUS_E_FAILURE;
9521 }
9522
9523 wpalMemoryCopy( pSendBuffer+usDataOffset,
9524 &pwdiFlushAcParams->wdiFlushAcInfo,
9525 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
9526
9527 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
9528 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
9529
9530 /*-------------------------------------------------------------------------
9531 Send Start Request to HAL
9532 -------------------------------------------------------------------------*/
9533 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9534 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
9535}/*WDI_ProcessFlushAcReq*/
9536
9537/**
9538 @brief Process BT AMP event Request function (called when Main
9539 FSM allows it)
9540
9541 @param pWDICtx: pointer to the WLAN DAL context
9542 pEventData: pointer to the event information structure
9543
9544 @see
9545 @return Result of the function call
9546*/
9547WDI_Status
9548WDI_ProcessBtAmpEventReq
9549(
9550 WDI_ControlBlockType* pWDICtx,
9551 WDI_EventInfoType* pEventData
9552)
9553{
9554 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9555 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
9556 wpt_uint8* pSendBuffer = NULL;
9557 wpt_uint16 usDataOffset = 0;
9558 wpt_uint16 usSendSize = 0;
9559
9560 tBtAmpEventMsg haltBtAmpEventMsg;
9561 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9562
9563 /*-------------------------------------------------------------------------
9564 Sanity check
9565 -------------------------------------------------------------------------*/
9566 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9567 ( NULL == pEventData->pCBfnc ))
9568 {
9569 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9570 "%s: Invalid parameters", __FUNCTION__);
9571 WDI_ASSERT(0);
9572 return WDI_STATUS_E_FAILURE;
9573 }
9574
9575 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9576 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9577 /*-----------------------------------------------------------------------
9578 Get message buffer
9579 ! TO DO : proper conversion into the HAL Message Request Format
9580 -----------------------------------------------------------------------*/
9581 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
9582 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9583 &pSendBuffer, &usDataOffset, &usSendSize))||
9584 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9585 {
9586 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9587 "Unable to get send buffer in BT AMP event req %x %x %x",
9588 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9589 WDI_ASSERT(0);
9590 return WDI_STATUS_E_FAILURE;
9591 }
9592
9593 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
9594 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
9595 wpalMemoryCopy( pSendBuffer+usDataOffset,
9596 &haltBtAmpEventMsg.btAmpEventParams,
9597 sizeof(haltBtAmpEventMsg.btAmpEventParams));
9598
9599 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
9600 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
9601
9602 /*-------------------------------------------------------------------------
9603 Send Start Request to HAL
9604 -------------------------------------------------------------------------*/
9605 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9606 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
9607}/*WDI_ProcessBtAmpEventReq*/
9608
9609/**
9610 @brief Process Add STA self Request function (called when Main FSM
9611 allows it)
9612
9613 @param pWDICtx: pointer to the WLAN DAL context
9614 pEventData: pointer to the event information structure
9615
9616 @see
9617 @return Result of the function call
9618*/
9619WDI_Status
9620WDI_ProcessAddSTASelfReq
9621(
9622 WDI_ControlBlockType* pWDICtx,
9623 WDI_EventInfoType* pEventData
9624)
9625{
9626 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9627 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
9628 wpt_uint8* pSendBuffer = NULL;
9629 wpt_uint16 usDataOffset = 0;
9630 wpt_uint16 usSendSize = 0;
9631 tAddStaSelfParams halAddSTASelfParams;
9632 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9633
9634 /*-------------------------------------------------------------------------
9635 Sanity check
9636 -------------------------------------------------------------------------*/
9637 if (( NULL == pEventData ) ||
9638 ( NULL == pEventData->pEventData) ||
9639 ( NULL == pEventData->pCBfnc))
9640 {
9641 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9642 "%s: Invalid parameters", __FUNCTION__);
9643 WDI_ASSERT(0);
9644 return WDI_STATUS_E_FAILURE;
9645 }
9646
9647 pwdiAddSTASelfReqParams =
9648 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
9649 wdiAddSTASelfReqRspCb =
9650 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9651 /*-----------------------------------------------------------------------
9652 Get message buffer
9653 -----------------------------------------------------------------------*/
9654 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9655 WDI_ADD_STA_SELF_REQ,
9656 sizeof(tAddStaSelfParams),
9657 &pSendBuffer, &usDataOffset, &usSendSize))||
9658 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9659 {
9660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9661 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9662 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9663 WDI_ASSERT(0);
9664 return WDI_STATUS_E_FAILURE;
9665 }
9666
9667 /* Cache the request for response processing */
9668 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
9669 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9670
9671 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
9672 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9673
9674 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9675 sizeof(tAddStaSelfParams));
9676
9677 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
9678 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
9679
9680 /*-------------------------------------------------------------------------
9681 Send Update Probe Resp Template Request to HAL
9682 -------------------------------------------------------------------------*/
9683 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9684 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9685 WDI_ADD_STA_SELF_RESP);
9686}/*WDI_ProcessAddSTASelfReq*/
9687
9688
9689
9690/**
9691 @brief Process Del Sta Self Request function (called when Main
9692 FSM allows it)
9693
9694 @param pWDICtx: pointer to the WLAN DAL context
9695 pEventData: pointer to the event information structure
9696
9697 @see
9698 @return Result of the function call
9699*/
9700WDI_Status
9701WDI_ProcessDelSTASelfReq
9702(
9703 WDI_ControlBlockType* pWDICtx,
9704 WDI_EventInfoType* pEventData
9705)
9706{
9707 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9708 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
9709 wpt_uint8* pSendBuffer = NULL;
9710 wpt_uint16 usDataOffset = 0;
9711 wpt_uint16 usSendSize = 0;
9712 tDelStaSelfParams halSetDelSelfSTAParams;
9713 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9714
9715 /*-------------------------------------------------------------------------
9716 Sanity check
9717 -------------------------------------------------------------------------*/
9718 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9719 ( NULL == pEventData->pCBfnc ))
9720 {
9721 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9722 "%s: Invalid parameters", __FUNCTION__);
9723 WDI_ASSERT(0);
9724 return WDI_STATUS_E_FAILURE;
9725 }
9726
9727 pwdiDelStaSelfReqParams =
9728 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9729 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9730
9731 /*-----------------------------------------------------------------------
9732 Get message buffer
9733 ! TO DO : proper conversion into the HAL Message Request Format
9734 -----------------------------------------------------------------------*/
9735 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
9736 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9737 &pSendBuffer, &usDataOffset, &usSendSize))||
9738 ( usSendSize <
9739 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9740 {
9741 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9742 "Unable to get send buffer in Del Sta Self req %x %x %x",
9743 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9744 WDI_ASSERT(0);
9745 return WDI_STATUS_E_FAILURE;
9746 }
9747
9748 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
9749 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9750
9751 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9752 sizeof(tDelStaSelfParams));
9753
9754 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
9755 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
9756
9757 /*-------------------------------------------------------------------------
9758 Send Start Request to HAL
9759 -------------------------------------------------------------------------*/
9760 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9761 wdiDelStaSelfRspCb, pEventData->pUserData,
9762 WDI_DEL_STA_SELF_RESP);
9763
9764}
9765
9766
9767/**
9768 @brief Process Host Resume Request function (called when Main
9769 FSM allows it)
9770
9771 @param pWDICtx: pointer to the WLAN DAL context
9772 pEventData: pointer to the event information structure
9773
9774 @see
9775 @return Result of the function call
9776*/
9777WDI_Status
9778WDI_ProcessHostResumeReq
9779(
9780 WDI_ControlBlockType* pWDICtx,
9781 WDI_EventInfoType* pEventData
9782)
9783{
9784 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
9785 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
9786 wpt_uint8* pSendBuffer = NULL;
9787 wpt_uint16 usDataOffset = 0;
9788 wpt_uint16 usSendSize = 0;
9789 tHalWlanHostResumeReqParam halResumeReqParams;
9790
9791 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9792
9793 /*-------------------------------------------------------------------------
9794 Sanity check
9795 -------------------------------------------------------------------------*/
9796 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9797 ( NULL == pEventData->pCBfnc ))
9798 {
9799 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9800 "%s: Invalid parameters ",__FUNCTION__);
9801 WDI_ASSERT(0);
9802 return WDI_STATUS_E_FAILURE;
9803 }
9804
9805 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
9806 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
9807
9808 /*-----------------------------------------------------------------------
9809 Get message buffer
9810 -----------------------------------------------------------------------*/
9811 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9812 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
9813 &pSendBuffer, &usDataOffset, &usSendSize))||
9814 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
9815 {
9816 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9817 "Unable to get send buffer in Start In Nav Meas req %x %x %x",
9818 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
9819 WDI_ASSERT(0);
9820 return WDI_STATUS_E_FAILURE;
9821 }
9822
9823 halResumeReqParams.configuredMcstBcstFilterSetting =
9824 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
9825
9826 wpalMemoryCopy( pSendBuffer+usDataOffset,
9827 &halResumeReqParams,
9828 sizeof(halResumeReqParams));
9829
9830 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
9831 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
9832
9833 /*-------------------------------------------------------------------------
9834 Send Start Request to HAL
9835 -------------------------------------------------------------------------*/
9836 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9837 wdiHostResumeRspCb, pEventData->pUserData,
9838 WDI_HOST_RESUME_RESP);
9839}/*WDI_ProcessHostResumeReq*/
9840
9841/**
9842 @brief Process set Tx Per Tracking Parameters Request function (called
9843 when Main FSM allows it)
9844
9845 @param pWDICtx: pointer to the WLAN DAL context
9846 pEventData: pointer to the event information structure
9847
9848 @see
9849 @return Result of the function call
9850*/
9851WDI_Status
9852WDI_ProcessSetTxPerTrackingReq
9853(
9854 WDI_ControlBlockType* pWDICtx,
9855 WDI_EventInfoType* pEventData
9856)
9857{
9858 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
9859 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
9860 wpt_uint8* pSendBuffer = NULL;
9861 wpt_uint16 usDataOffset = 0;
9862 wpt_uint16 usSendSize = 0;
9863 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
9864 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9865
9866 /*-------------------------------------------------------------------------
9867 Sanity check
9868 -------------------------------------------------------------------------*/
9869 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9870 ( NULL == pEventData->pCBfnc ))
9871 {
9872 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9873 "%s: Invalid parameters ",__FUNCTION__);
9874 WDI_ASSERT(0);
9875 return WDI_STATUS_E_FAILURE;
9876 }
9877
9878 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
9879 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
9880
9881 /*-----------------------------------------------------------------------
9882 Get message buffer
9883 ! TO DO : proper conversion into the HAL Message Request Format
9884 -----------------------------------------------------------------------*/
9885 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
9886 sizeof(halTxPerTrackingReqParam),
9887 &pSendBuffer, &usDataOffset, &usSendSize))||
9888 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
9889 {
9890 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9891 "Unable to get send buffer in set tx per tracking req %x %x %x",
9892 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
9893 WDI_ASSERT(0);
9894 return WDI_STATUS_E_FAILURE;
9895 }
9896
9897 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
9898 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
9899 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
9900 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
9901
9902 wpalMemoryCopy( pSendBuffer+usDataOffset,
9903 &halTxPerTrackingReqParam,
9904 sizeof(halTxPerTrackingReqParam));
9905
9906 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
9907 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
9908
9909 /*-------------------------------------------------------------------------
9910 Send Get STA Request to HAL
9911 -------------------------------------------------------------------------*/
9912 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9913 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
9914}/*WDI_ProcessSetTxPerTrackingReq*/
9915
9916/*=========================================================================
9917 Indications
9918=========================================================================*/
9919
9920/**
9921 @brief Process Suspend Indications function (called when Main FSM allows it)
9922
9923 @param pWDICtx: pointer to the WLAN DAL context
9924 pEventData: pointer to the event information structure
9925
9926 @see
9927 @return Result of the function call
9928*/
9929WDI_Status
9930WDI_ProcessHostSuspendInd
9931(
9932 WDI_ControlBlockType* pWDICtx,
9933 WDI_EventInfoType* pEventData
9934)
9935{
9936 WDI_SuspendParamsType *pSuspendIndParams;
9937 wpt_uint8* pSendBuffer = NULL;
9938 wpt_uint16 usDataOffset = 0;
9939 wpt_uint16 usSendSize = 0;
9940 WDI_Status wdiStatus;
9941 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
9942 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9943
9944 /*-------------------------------------------------------------------------
9945 Sanity check
9946 -------------------------------------------------------------------------*/
9947 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
9948 {
9949 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9950 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
9951 WDI_ASSERT(0);
9952 return WDI_STATUS_E_FAILURE;
9953 }
9954
9955 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
9956
9957 /*-----------------------------------------------------------------------
9958 Get message buffer
9959 -----------------------------------------------------------------------*/
9960 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9961 WDI_HOST_SUSPEND_IND,
9962 sizeof(halWlanSuspendIndparams),
9963 &pSendBuffer, &usDataOffset, &usSendSize))||
9964 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
9965 {
9966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9967 "Unable to get send buffer in Suspend Ind ");
9968 WDI_ASSERT(0);
9969 return WDI_STATUS_E_FAILURE;
9970 }
9971
9972 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
9973 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
9974
9975 halWlanSuspendIndparams.activeSessionCount =
9976 WDI_GetActiveSessionsCount(pWDICtx);
9977
9978 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
9979 sizeof(tHalWlanHostSuspendIndParam));
9980
9981 /*-------------------------------------------------------------------------
9982 Send Suspend Request to HAL
9983 -------------------------------------------------------------------------*/
9984 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
9985 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
9986
9987 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
9988 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
9989}/*WDI_ProcessHostSuspendInd*/
9990
9991/*==========================================================================
9992 MISC CONTROL PROCESSING REQUEST API
9993==========================================================================*/
9994/**
9995 @brief Process Channel Switch Request function (called when
9996 Main FSM allows it)
9997
9998 @param pWDICtx: pointer to the WLAN DAL context
9999 pEventData: pointer to the event information structure
10000
10001 @see
10002 @return Result of the function call
10003*/
10004WDI_Status
10005WDI_ProcessChannelSwitchReq
10006(
10007 WDI_ControlBlockType* pWDICtx,
10008 WDI_EventInfoType* pEventData
10009)
10010{
10011 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10012 WDI_SwitchChRspCb wdiSwitchChRspCb;
10013 wpt_uint8* pSendBuffer = NULL;
10014 wpt_uint16 usDataOffset = 0;
10015 wpt_uint16 usSendSize = 0;
10016 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10017 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10018
10019 /*-------------------------------------------------------------------------
10020 Sanity check
10021 -------------------------------------------------------------------------*/
10022 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10023 ( NULL == pEventData->pCBfnc ))
10024 {
10025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10026 "%s: Invalid parameters", __FUNCTION__);
10027 WDI_ASSERT(0);
10028 return WDI_STATUS_E_FAILURE;
10029 }
10030
10031 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10032 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10033 /*-----------------------------------------------------------------------
10034 Get message buffer
10035 ! TO DO : proper conversion into the HAL Message Request Format
10036 -----------------------------------------------------------------------*/
10037 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
10038 sizeof(halSwitchChannelReq.switchChannelParams),
10039 &pSendBuffer, &usDataOffset, &usSendSize))||
10040 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10041 {
10042 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10043 "Unable to get send buffer in channel switch req %x %x %x",
10044 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10045 WDI_ASSERT(0);
10046 return WDI_STATUS_E_FAILURE;
10047 }
10048
10049 halSwitchChannelReq.switchChannelParams.channelNumber =
10050 pwdiSwitchChParams->wdiChInfo.ucChannel;
10051#ifndef WLAN_FEATURE_VOWIFI
10052 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
10053 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10054#endif
10055 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
10056 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10057
10058#ifdef WLAN_FEATURE_VOWIFI
10059 halSwitchChannelReq.switchChannelParams.maxTxPower
10060 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
10061 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10062 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10063 WDI_MAC_ADDR_LEN);
10064 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10065 pwdiSwitchChParams->wdiChInfo.macBSSId,
10066 WDI_MAC_ADDR_LEN);
10067#endif
10068 wpalMemoryCopy( pSendBuffer+usDataOffset,
10069 &halSwitchChannelReq.switchChannelParams,
10070 sizeof(halSwitchChannelReq.switchChannelParams));
10071
10072 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
10073 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
10074
10075 /*-------------------------------------------------------------------------
10076 Send Switch Channel Request to HAL
10077 -------------------------------------------------------------------------*/
10078 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10079 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
10080}/*WDI_ProcessChannelSwitchReq*/
10081
10082/**
10083 @brief Process Config STA Request function (called when Main FSM
10084 allows it)
10085
10086 @param pWDICtx: pointer to the WLAN DAL context
10087 pEventData: pointer to the event information structure
10088
10089 @see
10090 @return Result of the function call
10091*/
10092WDI_Status
10093WDI_ProcessConfigStaReq
10094(
10095 WDI_ControlBlockType* pWDICtx,
10096 WDI_EventInfoType* pEventData
10097)
10098{
10099 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10100 WDI_ConfigSTARspCb wdiConfigSTARspCb;
10101 wpt_uint8 ucCurrentBSSSesIdx = 0;
10102 WDI_BSSSessionType* pBSSSes = NULL;
10103 wpt_uint8* pSendBuffer = NULL;
10104 wpt_uint16 usDataOffset = 0;
10105 wpt_uint16 usSendSize = 0;
10106 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10107
10108 tConfigStaReqMsg halConfigStaReqMsg;
10109 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10110
10111 /*-------------------------------------------------------------------------
10112 Sanity check
10113 -------------------------------------------------------------------------*/
10114 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10115 ( NULL == pEventData->pCBfnc ))
10116 {
10117 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10118 "%s: Invalid parameters", __FUNCTION__);
10119 WDI_ASSERT(0);
10120 return WDI_STATUS_E_FAILURE;
10121 }
10122
10123 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10124 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10125 /*-------------------------------------------------------------------------
10126 Check to see if we are in the middle of an association, if so queue, if
10127 not it means it is free to process request
10128 -------------------------------------------------------------------------*/
10129 wpalMutexAcquire(&pWDICtx->wptMutex);
10130
10131 /*------------------------------------------------------------------------
10132 Find the BSS for which the request is made
10133 ------------------------------------------------------------------------*/
10134 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10135 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10136 &pBSSSes);
10137
10138 if ( NULL == pBSSSes )
10139 {
10140 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10141 "Association sequence for this BSS does not yet exist");
10142
10143 wpalMutexRelease(&pWDICtx->wptMutex);
10144 return WDI_STATUS_E_NOT_ALLOWED;
10145 }
10146
10147 /*------------------------------------------------------------------------
10148 Check if this BSS is being currently processed or queued,
10149 if queued - queue the new request as well
10150 ------------------------------------------------------------------------*/
10151 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10152 {
10153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10154 "Association sequence for this BSS exists but currently queued");
10155
10156 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10157 wpalMutexRelease(&pWDICtx->wptMutex);
10158 return wdiStatus;
10159 }
10160
10161 wpalMutexRelease(&pWDICtx->wptMutex);
10162 /*-----------------------------------------------------------------------
10163 Get message buffer
10164 -----------------------------------------------------------------------*/
10165 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10166 sizeof(halConfigStaReqMsg.configStaParams),
10167 &pSendBuffer, &usDataOffset, &usSendSize))||
10168 ( usSendSize < (usDataOffset + sizeof(halConfigStaReqMsg.configStaParams) )))
10169 {
10170 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10171 "Unable to get send buffer in config sta req %x %x %x",
10172 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10173 WDI_ASSERT(0);
10174 return WDI_STATUS_E_FAILURE;
10175 }
10176
10177 /*Copy the station context*/
10178 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.configStaParams,
10179 &pwdiConfigSTAParams->wdiReqInfo);
10180
10181 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10182 {
10183 /* Need to fill in the self STA Index */
10184 if ( WDI_STATUS_SUCCESS !=
10185 WDI_STATableFindStaidByAddr(pWDICtx,
10186 pwdiConfigSTAParams->wdiReqInfo.macSTA,
10187 (wpt_uint8*)&halConfigStaReqMsg.configStaParams.staIdx ))
10188 {
10189 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10190 "This station does not exist in the WDI Station Table %d");
10191 wpalMutexRelease(&pWDICtx->wptMutex);
10192 return WDI_STATUS_E_FAILURE;
10193 }
10194 }
10195 else
10196 {
10197 /* Need to fill in the STA Index to invalid, since at this point we have not
10198 yet received it from HAL */
10199 halConfigStaReqMsg.configStaParams.staIdx = WDI_STA_INVALID_IDX;
10200 }
10201
10202 /* Need to fill in the BSS index */
10203 halConfigStaReqMsg.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
10204
10205 wpalMemoryCopy( pSendBuffer+usDataOffset,
10206 &halConfigStaReqMsg.configStaParams,
10207 sizeof(halConfigStaReqMsg.configStaParams));
10208
10209 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
10210 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
10211
10212 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10213 pwdiConfigSTAParams,
10214 sizeof(pWDICtx->wdiCachedConfigStaReq));
10215
10216 /*-------------------------------------------------------------------------
10217 Send Config STA Request to HAL
10218 -------------------------------------------------------------------------*/
10219 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10220 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
10221}/*WDI_ProcessConfigStaReq*/
10222
10223
10224/**
10225 @brief Process Set Link State Request function (called when
10226 Main FSM allows it)
10227
10228 @param pWDICtx: pointer to the WLAN DAL context
10229 pEventData: pointer to the event information structure
10230
10231 @see
10232 @return Result of the function call
10233*/
10234WDI_Status
10235WDI_ProcessSetLinkStateReq
10236(
10237 WDI_ControlBlockType* pWDICtx,
10238 WDI_EventInfoType* pEventData
10239)
10240{
10241 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10242 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
10243 wpt_uint8 ucCurrentBSSSesIdx = 0;
10244 WDI_BSSSessionType* pBSSSes = NULL;
10245 wpt_uint8* pSendBuffer = NULL;
10246 wpt_uint16 usDataOffset = 0;
10247 wpt_uint16 usSendSize = 0;
10248 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10249 tLinkStateParams halLinkStateReqMsg;
10250 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10251
10252 /*-------------------------------------------------------------------------
10253 Sanity check
10254 -------------------------------------------------------------------------*/
10255 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10256 ( NULL == pEventData->pCBfnc ))
10257 {
10258 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10259 "%s: Invalid parameters", __FUNCTION__);
10260 WDI_ASSERT(0);
10261 return WDI_STATUS_E_FAILURE;
10262 }
10263
10264 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10265 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10266 /*-------------------------------------------------------------------------
10267 Check to see if we are in the middle of an association, if so queue, if
10268 not it means it is free to process request
10269 -------------------------------------------------------------------------*/
10270 wpalMutexAcquire(&pWDICtx->wptMutex);
10271
10272 /*------------------------------------------------------------------------
10273 Find the BSS for which the request is made
10274 ------------------------------------------------------------------------*/
10275 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10276 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10277 &pBSSSes);
10278
10279 if ( NULL == pBSSSes )
10280 {
10281 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
10282 "Set link request received outside association session");
10283 }
10284 else
10285 {
10286 /*------------------------------------------------------------------------
10287 Check if this BSS is being currently processed or queued,
10288 if queued - queue the new request as well
10289 ------------------------------------------------------------------------*/
10290 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10291 {
10292 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10293 "Association sequence for this BSS exists but currently queued");
10294
10295 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10296 wpalMutexRelease(&pWDICtx->wptMutex);
10297 return wdiStatus;
10298 }
10299 }
10300 /* If the link is set to enter IDLE - the Session allocated for this BSS
10301 will be deleted on the Set Link State response coming from HAL
10302 - cache the request for response processing */
10303 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
10304 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10305
10306 wpalMutexRelease(&pWDICtx->wptMutex);
10307 /*-----------------------------------------------------------------------
10308 Get message buffer
10309 ! TO DO : proper conversion into the HAL Message Request Format
10310 -----------------------------------------------------------------------*/
10311
10312 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
10313 sizeof(halLinkStateReqMsg),
10314 &pSendBuffer, &usDataOffset, &usSendSize))||
10315 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10316 {
10317 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10318 "Unable to get send buffer in set bss key req %x %x %x",
10319 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10320 WDI_ASSERT(0);
10321 return WDI_STATUS_E_FAILURE;
10322 }
10323
10324 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10325 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10326
10327 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10328 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10329
10330 halLinkStateReqMsg.state =
10331 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10332
10333 wpalMemoryCopy( pSendBuffer+usDataOffset,
10334 &halLinkStateReqMsg,
10335 sizeof(halLinkStateReqMsg));
10336
10337 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
10338 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
10339
10340 /*-------------------------------------------------------------------------
10341 Send Set Link State Request to HAL
10342 -------------------------------------------------------------------------*/
10343 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10344 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
10345}/*WDI_ProcessSetLinkStateReq*/
10346
10347
10348/**
10349 @brief Process Get Stats Request function (called when Main FSM
10350 allows it)
10351
10352 @param pWDICtx: pointer to the WLAN DAL context
10353 pEventData: pointer to the event information structure
10354
10355 @see
10356 @return Result of the function call
10357*/
10358WDI_Status
10359WDI_ProcessGetStatsReq
10360(
10361 WDI_ControlBlockType* pWDICtx,
10362 WDI_EventInfoType* pEventData
10363)
10364{
10365 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10366 WDI_GetStatsRspCb wdiGetStatsRspCb;
10367 wpt_uint8* pSendBuffer = NULL;
10368 wpt_uint16 usDataOffset = 0;
10369 wpt_uint16 usSendSize = 0;
10370 wpt_uint8 ucCurrentBSSSesIdx = 0;
10371 WDI_BSSSessionType* pBSSSes = NULL;
10372 wpt_macAddr macBSSID;
10373 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10374 tHalStatsReqMsg halStatsReqMsg;
10375 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10376
10377 /*-------------------------------------------------------------------------
10378 Sanity check
10379 -------------------------------------------------------------------------*/
10380 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10381 ( NULL == pEventData->pCBfnc ) )
10382 {
10383 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10384 "%s: Invalid parameters", __FUNCTION__);
10385 WDI_ASSERT(0);
10386 return WDI_STATUS_E_FAILURE;
10387 }
10388
10389 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10390 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10391
10392 /*-------------------------------------------------------------------------
10393 Check to see if we are in the middle of an association, if so queue, if
10394 not it means it is free to process request
10395 -------------------------------------------------------------------------*/
10396 wpalMutexAcquire(&pWDICtx->wptMutex);
10397
10398 /*------------------------------------------------------------------------
10399 Find the BSS for which the request is made
10400 ------------------------------------------------------------------------*/
10401 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10402 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
10403 &macBSSID))
10404 {
10405 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10406 "This station does not exist in the WDI Station Table %d");
10407 wpalMutexRelease(&pWDICtx->wptMutex);
10408 return WDI_STATUS_E_FAILURE;
10409 }
10410
10411 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10412 if ( NULL == pBSSSes )
10413 {
10414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10415 "Association sequence for this BSS does not yet exist");
10416
10417 wpalMutexRelease(&pWDICtx->wptMutex);
10418 return WDI_STATUS_E_NOT_ALLOWED;
10419 }
10420
10421 /*------------------------------------------------------------------------
10422 Check if this BSS is being currently processed or queued,
10423 if queued - queue the new request as well
10424 ------------------------------------------------------------------------*/
10425 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10426 {
10427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10428 "Association sequence for this BSS exists but currently queued");
10429
10430 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10431 wpalMutexRelease(&pWDICtx->wptMutex);
10432 return wdiStatus;
10433 }
10434
10435
10436 wpalMutexRelease(&pWDICtx->wptMutex);
10437
10438 /*-----------------------------------------------------------------------
10439 Get message buffer
10440 -----------------------------------------------------------------------*/
10441 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
10442 sizeof(halStatsReqMsg.statsReqParams),
10443 &pSendBuffer, &usDataOffset, &usSendSize))||
10444 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10445 {
10446 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10447 "Unable to get send buffer in set bss key req %x %x %x",
10448 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10449 WDI_ASSERT(0);
10450 return WDI_STATUS_E_FAILURE;
10451 }
10452
10453 halStatsReqMsg.statsReqParams.staId =
10454 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
10455 halStatsReqMsg.statsReqParams.statsMask =
10456 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
10457 wpalMemoryCopy( pSendBuffer+usDataOffset,
10458 &halStatsReqMsg.statsReqParams,
10459 sizeof(halStatsReqMsg.statsReqParams));
10460
10461 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
10462 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
10463
10464 /*-------------------------------------------------------------------------
10465 Send Get STA Request to HAL
10466 -------------------------------------------------------------------------*/
10467 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10468 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
10469}/*WDI_ProcessGetStatsReq*/
10470
10471/**
10472 @brief Process Update Cfg Request function (called when Main
10473 FSM allows it)
10474
10475 @param pWDICtx: pointer to the WLAN DAL context
10476 pEventData: pointer to the event information structure
10477
10478 @see
10479 @return Result of the function call
10480*/
10481WDI_Status
10482WDI_ProcessUpdateCfgReq
10483(
10484 WDI_ControlBlockType* pWDICtx,
10485 WDI_EventInfoType* pEventData
10486)
10487{
10488 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10489 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10490
10491 wpt_uint8* pSendBuffer = NULL;
10492 wpt_uint16 usDataOffset = 0;
10493 wpt_uint16 usSendSize = 0;
10494 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10495
10496 /*-------------------------------------------------------------------------
10497 Sanity check
10498 -------------------------------------------------------------------------*/
10499 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10500 ( NULL == pEventData->pCBfnc))
10501 {
10502 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10503 "%s: Invalid parameters", __FUNCTION__);
10504 WDI_ASSERT(0);
10505 return WDI_STATUS_E_FAILURE;
10506 }
10507
10508 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10509 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10510
10511 /*-----------------------------------------------------------------------
10512 Get message buffer
10513 ! TO DO : proper conversion into the HAL Message Request Format
10514 -----------------------------------------------------------------------*/
10515
10516 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
10517 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10518 &pSendBuffer, &usDataOffset, &usSendSize))||
10519 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10520 {
10521 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10522 "Unable to get send buffer in set bss key req %x %x %x",
10523 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10524 WDI_ASSERT(0);
10525 return WDI_STATUS_E_FAILURE;
10526 }
10527
10528 wpalMemoryCopy( pSendBuffer+usDataOffset,
10529 &pwdiUpdateCfgParams->uConfigBufferLen,
10530 sizeof(wpt_uint32));
10531 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10532 pwdiUpdateCfgParams->pConfigBuffer,
10533 pwdiUpdateCfgParams->uConfigBufferLen);
10534
10535 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
10536 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
10537
10538 /*-------------------------------------------------------------------------
10539 Send Update Cfg Request to HAL
10540 -------------------------------------------------------------------------*/
10541
10542 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10543 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
10544
10545}/*WDI_ProcessUpdateCfgReq*/
10546
10547
10548/**
10549 @brief Process Add BA Request function (called when Main FSM
10550 allows it)
10551
10552 @param pWDICtx: pointer to the WLAN DAL context
10553 pEventData: pointer to the event information structure
10554
10555 @see
10556 @return Result of the function call
10557*/
10558WDI_Status
10559WDI_ProcessAddBAReq
10560(
10561 WDI_ControlBlockType* pWDICtx,
10562 WDI_EventInfoType* pEventData
10563)
10564{
10565 WDI_AddBAReqParamsType* pwdiAddBAParams;
10566 WDI_AddBARspCb wdiAddBARspCb;
10567 wpt_uint8 ucCurrentBSSSesIdx = 0;
10568 WDI_BSSSessionType* pBSSSes = NULL;
10569 wpt_uint8* pSendBuffer = NULL;
10570 wpt_uint16 usDataOffset = 0;
10571 wpt_uint16 usSendSize = 0;
10572 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10573 wpt_macAddr macBSSID;
10574
10575 tAddBAReqMsg halAddBAReq;
10576 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10577
10578 /*-------------------------------------------------------------------------
10579 Sanity check
10580 -------------------------------------------------------------------------*/
10581 if (( NULL == pEventData ) ||
10582 ( NULL == pEventData->pEventData) ||
10583 ( NULL == pEventData->pCBfnc ))
10584 {
10585 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10586 "%s: Invalid parameters", __FUNCTION__);
10587 WDI_ASSERT(0);
10588 return WDI_STATUS_E_FAILURE;
10589 }
10590
10591 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10592 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10593
10594 /*-------------------------------------------------------------------------
10595 Check to see if we are in the middle of an association, if so queue, if
10596 not it means it is free to process request
10597 -------------------------------------------------------------------------*/
10598 wpalMutexAcquire(&pWDICtx->wptMutex);
10599
10600 /*------------------------------------------------------------------------
10601 Find the BSS for which the request is made
10602 ------------------------------------------------------------------------*/
10603 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10604 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
10605 &macBSSID))
10606 {
10607 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10608 "This station does not exist in the WDI Station Table %d");
10609 wpalMutexRelease(&pWDICtx->wptMutex);
10610 return WDI_STATUS_E_FAILURE;
10611 }
10612
10613 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10614 if ( NULL == pBSSSes )
10615 {
10616 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10617 "Association sequence for this BSS does not yet exist");
10618
10619 wpalMutexRelease(&pWDICtx->wptMutex);
10620 return WDI_STATUS_E_NOT_ALLOWED;
10621 }
10622
10623 /*------------------------------------------------------------------------
10624 Check if this BSS is being currently processed or queued,
10625 if queued - queue the new request as well
10626 ------------------------------------------------------------------------*/
10627 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10628 {
10629 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10630 "Association sequence for this BSS exists but currently queued");
10631
10632 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10633 wpalMutexRelease(&pWDICtx->wptMutex);
10634 return wdiStatus;
10635 }
10636
10637
10638 wpalMutexRelease(&pWDICtx->wptMutex);
10639 /*-----------------------------------------------------------------------
10640 Get message buffer
10641 -----------------------------------------------------------------------*/
10642 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
10643 sizeof(halAddBAReq.addBAParams),
10644 &pSendBuffer, &usDataOffset, &usSendSize))||
10645 ( usSendSize <
10646 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10647 {
10648 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10649 "Unable to get send buffer in Add BA req %x %x %x",
10650 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10651 WDI_ASSERT(0);
10652 return WDI_STATUS_E_FAILURE;
10653 }
10654
10655 halAddBAReq.addBAParams.baSessionID =
10656 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10657 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10658#ifdef FEATURE_ON_CHIP_REORDERING
10659 halAddBAReq.addBAParams.isReorderingDoneOnChip =
10660 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10661#endif
10662
10663 wpalMemoryCopy( pSendBuffer+usDataOffset,
10664 &halAddBAReq.addBAParams,
10665 sizeof(halAddBAReq.addBAParams));
10666
10667 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
10668 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
10669
10670 /*-------------------------------------------------------------------------
10671 Send Start Request to HAL
10672 -------------------------------------------------------------------------*/
10673 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10674 wdiAddBARspCb, pEventData->pUserData,
10675 WDI_ADD_BA_RESP);
10676}/*WDI_ProcessAddBAReq*/
10677
10678
10679
10680/**
10681 @brief Process Trigger BA Request function (called when Main FSM
10682 allows it)
10683
10684 @param pWDICtx: pointer to the WLAN DAL context
10685 pEventData: pointer to the event information structure
10686
10687 @see
10688 @return Result of the function call
10689*/
10690WDI_Status
10691WDI_ProcessTriggerBAReq
10692(
10693 WDI_ControlBlockType* pWDICtx,
10694 WDI_EventInfoType* pEventData
10695)
10696{
10697 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10698 WDI_TriggerBARspCb wdiTriggerBARspCb;
10699 wpt_uint8 ucCurrentBSSSesIdx = 0;
10700 WDI_BSSSessionType* pBSSSes = NULL;
10701 wpt_uint8* pSendBuffer = NULL;
10702 wpt_uint16 usDataOffset = 0;
10703 wpt_uint16 usSendSize = 0;
10704 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10705 wpt_uint16 index;
10706 wpt_macAddr macBSSID;
10707
10708 tTriggerBAReqMsg halTriggerBAReq;
10709 tTriggerBaReqCandidate* halTriggerBACandidate;
10710 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10712
10713 /*-------------------------------------------------------------------------
10714 Sanity check
10715 -------------------------------------------------------------------------*/
10716 if (( NULL == pEventData ) ||
10717 ( NULL == pEventData->pEventData ) ||
10718 ( NULL == pEventData->pCBfnc ))
10719 {
10720 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10721 "%s: Invalid parameters", __FUNCTION__);
10722 WDI_ASSERT(0);
10723 return WDI_STATUS_E_FAILURE;
10724 }
10725
10726 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10727 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10728 /*-------------------------------------------------------------------------
10729 Check to see if we are in the middle of an association, if so queue, if
10730 not it means it is free to process request
10731 -------------------------------------------------------------------------*/
10732 wpalMutexAcquire(&pWDICtx->wptMutex);
10733
10734 /*------------------------------------------------------------------------
10735 Find the BSS for which the request is made
10736 ------------------------------------------------------------------------*/
10737 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10738 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
10739 &macBSSID))
10740 {
10741 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10742 "This station does not exist in the WDI Station Table %d");
10743 wpalMutexRelease(&pWDICtx->wptMutex);
10744 return WDI_STATUS_E_FAILURE;
10745 }
10746
10747 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10748 if ( NULL == pBSSSes )
10749 {
10750 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10751 "Association sequence for this BSS does not yet exist");
10752
10753 wpalMutexRelease(&pWDICtx->wptMutex);
10754 return WDI_STATUS_E_NOT_ALLOWED;
10755 }
10756
10757 /*------------------------------------------------------------------------
10758 Check if this BSS is being currently processed or queued,
10759 if queued - queue the new request as well
10760 ------------------------------------------------------------------------*/
10761 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10762 {
10763 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10764 "Association sequence for this BSS exists but currently queued");
10765
10766 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10767 wpalMutexRelease(&pWDICtx->wptMutex);
10768 return wdiStatus;
10769 }
10770
10771
10772 wpalMutexRelease(&pWDICtx->wptMutex);
10773 /*-----------------------------------------------------------------------
10774 Get message buffer
10775 -----------------------------------------------------------------------*/
10776 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10777 WDI_TRIGGER_BA_REQ,
10778 sizeof(halTriggerBAReq.triggerBAParams) +
10779 (sizeof(tTriggerBaReqCandidate) *
10780 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
10781 &pSendBuffer, &usDataOffset, &usSendSize))||
10782 ( usSendSize <
10783 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
10784 (sizeof(tTriggerBaReqCandidate) *
10785 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
10786 {
10787 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10788 "Unable to get send buffer in Trigger BA req %x %x %x",
10789 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
10790 WDI_ASSERT(0);
10791 return WDI_STATUS_E_FAILURE;
10792 }
10793
10794 halTriggerBAReq.triggerBAParams.baSessionID =
10795 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
10796 halTriggerBAReq.triggerBAParams.baCandidateCnt =
10797 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
10798
10799 wpalMemoryCopy( pSendBuffer+usDataOffset,
10800 &halTriggerBAReq.triggerBAParams,
10801 sizeof(halTriggerBAReq.triggerBAParams));
10802
10803 wdiTriggerBACandidate =
10804 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
10805 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
10806 sizeof(halTriggerBAReq.triggerBAParams));
10807
10808 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
10809 index++)
10810 {
10811 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
10812 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
10813 halTriggerBACandidate++;
10814 wdiTriggerBACandidate++;
10815 }
10816
10817 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
10818 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
10819
10820 /*-------------------------------------------------------------------------
10821 Send Start Request to HAL
10822 -------------------------------------------------------------------------*/
10823 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10824 wdiTriggerBARspCb, pEventData->pUserData,
10825 WDI_TRIGGER_BA_RESP);
10826}/*WDI_ProcessTriggerBAReq*/
10827
10828
10829
10830/**
10831 @brief Process Update Beacon Params Request function (called when Main FSM
10832 allows it)
10833
10834 @param pWDICtx: pointer to the WLAN DAL context
10835 pEventData: pointer to the event information structure
10836
10837 @see
10838 @return Result of the function call
10839*/
10840WDI_Status
10841WDI_ProcessUpdateBeaconParamsReq
10842(
10843 WDI_ControlBlockType* pWDICtx,
10844 WDI_EventInfoType* pEventData
10845)
10846{
10847 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
10848 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
10849 wpt_uint8* pSendBuffer = NULL;
10850 wpt_uint16 usDataOffset = 0;
10851 wpt_uint16 usSendSize = 0;
10852 tUpdateBeaconParams halUpdateBeaconParams;
10853 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10854
10855 /*-------------------------------------------------------------------------
10856 Sanity check
10857 -------------------------------------------------------------------------*/
10858 if (( NULL == pEventData ) ||
10859 ( NULL == pEventData->pEventData) ||
10860 ( NULL == pEventData->pCBfnc))
10861 {
10862 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10863 "%s: Invalid parameters", __FUNCTION__);
10864 WDI_ASSERT(0);
10865 return WDI_STATUS_E_FAILURE;
10866 }
10867
10868 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
10869 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
10870 /*-----------------------------------------------------------------------
10871 Get message buffer
10872 -----------------------------------------------------------------------*/
10873 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
10874 sizeof(halUpdateBeaconParams),
10875 &pSendBuffer, &usDataOffset, &usSendSize))||
10876 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
10877 {
10878 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10879 "Unable to get send buffer in set bss key req %x %x %x",
10880 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
10881 WDI_ASSERT(0);
10882 return WDI_STATUS_E_FAILURE;
10883 }
10884
10885 /*BSS Index of the BSS*/
10886 halUpdateBeaconParams.bssIdx =
10887 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
10888 /*shortPreamble mode. HAL should update all the STA rates when it
10889 receives this message*/
10890 halUpdateBeaconParams.fShortPreamble =
10891 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
10892 /* short Slot time.*/
10893 halUpdateBeaconParams.fShortSlotTime =
10894 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
10895 /* Beacon Interval */
10896 halUpdateBeaconParams.beaconInterval =
10897 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
10898
10899 /*Protection related */
10900 halUpdateBeaconParams.llaCoexist =
10901 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
10902 halUpdateBeaconParams.llbCoexist =
10903 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
10904 halUpdateBeaconParams.llgCoexist =
10905 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
10906 halUpdateBeaconParams.ht20MhzCoexist =
10907 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
10908 halUpdateBeaconParams.llnNonGFCoexist =
10909 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
10910 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
10911 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
10912 halUpdateBeaconParams.fRIFSMode =
10913 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
10914 halUpdateBeaconParams.paramChangeBitmap =
10915 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
10916
10917 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
10918 sizeof(halUpdateBeaconParams));
10919
10920 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
10921 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
10922
10923 /*-------------------------------------------------------------------------
10924 Send Del TS Request to HAL
10925 -------------------------------------------------------------------------*/
10926 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10927 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
10928}/*WDI_ProcessUpdateBeaconParamsReq*/
10929
10930
10931
10932/**
10933 @brief Process Send Beacon template Request function (called when Main FSM
10934 allows it)
10935
10936 @param pWDICtx: pointer to the WLAN DAL context
10937 pEventData: pointer to the event information structure
10938
10939 @see
10940 @return Result of the function call
10941*/
10942WDI_Status
10943WDI_ProcessSendBeaconParamsReq
10944(
10945 WDI_ControlBlockType* pWDICtx,
10946 WDI_EventInfoType* pEventData
10947)
10948{
10949 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
10950 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
10951 wpt_uint8* pSendBuffer = NULL;
10952 wpt_uint16 usDataOffset = 0;
10953 wpt_uint16 usSendSize = 0;
10954 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10955
10956 tSendBeaconReqMsg halSendBeaconReq;
10957 /*-------------------------------------------------------------------------
10958 Sanity check
10959 -------------------------------------------------------------------------*/
10960 if (( NULL == pEventData ) ||
10961 ( NULL == pEventData->pEventData ) ||
10962 ( NULL == pEventData->pCBfnc ))
10963 {
10964 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10965 "%s: Invalid parameters", __FUNCTION__);
10966 WDI_ASSERT(0);
10967 return WDI_STATUS_E_FAILURE;
10968 }
10969
10970 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
10971 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
10972 /*-----------------------------------------------------------------------
10973 Get message buffer
10974 -----------------------------------------------------------------------*/
10975 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
10976 sizeof(halSendBeaconReq.sendBeaconParam),
10977 &pSendBuffer, &usDataOffset, &usSendSize))||
10978 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
10979 {
10980 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10981 "Unable to get send buffer in send beacon req %x %x %x",
10982 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
10983 WDI_ASSERT(0);
10984 return WDI_STATUS_E_FAILURE;
10985 }
10986
10987 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
10988 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
10989 WDI_MAC_ADDR_LEN);
10990 halSendBeaconReq.sendBeaconParam.beaconLength =
10991 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
10992 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
10993 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
10994 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
10995#ifdef WLAN_SOFTAP_FEATURE
10996 halSendBeaconReq.sendBeaconParam.timIeOffset =
10997 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
10998#endif
10999#ifdef WLAN_FEATURE_P2P
11000 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
11001 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11002#endif
11003
11004 wpalMemoryCopy( pSendBuffer+usDataOffset,
11005 &halSendBeaconReq.sendBeaconParam,
11006 sizeof(halSendBeaconReq.sendBeaconParam));
11007
11008 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
11009 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
11010
11011 /*-------------------------------------------------------------------------
11012 Send Del TS Request to HAL
11013 -------------------------------------------------------------------------*/
11014 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11015 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
11016}/*WDI_ProcessSendBeaconParamsReq*/
11017
11018/**
11019 @brief Process Update Beacon Params Request function (called when Main FSM
11020 allows it)
11021
11022 @param pWDICtx: pointer to the WLAN DAL context
11023 pEventData: pointer to the event information structure
11024
11025 @see
11026 @return Result of the function call
11027*/
11028WDI_Status
11029WDI_ProcessUpdateProbeRspTemplateReq
11030(
11031 WDI_ControlBlockType* pWDICtx,
11032 WDI_EventInfoType* pEventData
11033)
11034{
11035 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11036 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
11037 wpt_uint8* pSendBuffer = NULL;
11038 wpt_uint16 usDataOffset = 0;
11039 wpt_uint16 usSendSize = 0;
11040 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
11041 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11042
11043 /*-------------------------------------------------------------------------
11044 Sanity check
11045 -------------------------------------------------------------------------*/
11046 if (( NULL == pEventData ) ||
11047 ( NULL == pEventData->pEventData) ||
11048 ( NULL == pEventData->pCBfnc))
11049 {
11050 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11051 "%s: Invalid parameters", __FUNCTION__);
11052 WDI_ASSERT(0);
11053 return WDI_STATUS_E_FAILURE;
11054 }
11055
11056 pwdiUpdateProbeRespTmplParams =
11057 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
11058 wdiUpdateProbeRespTmplRspCb =
11059 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11060 /*-----------------------------------------------------------------------
11061 Get message buffer
11062 -----------------------------------------------------------------------*/
11063 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
11064 sizeof(halUpdateProbeRspTmplParams),
11065 &pSendBuffer, &usDataOffset, &usSendSize))||
11066 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11067 {
11068 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11069 "Unable to get send buffer in set bss key req %x %x %x",
11070 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11071 WDI_ASSERT(0);
11072 return WDI_STATUS_E_FAILURE;
11073 }
11074
11075 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
11076 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
11077 WDI_MAC_ADDR_LEN);
11078
11079 halUpdateProbeRspTmplParams.probeRespTemplateLen =
11080 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11081
11082 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11083 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
11084 BEACON_TEMPLATE_SIZE);
11085
11086
11087 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11088 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11089 WDI_PROBE_REQ_BITMAP_IE_LEN);
11090
11091 wpalMemoryCopy( pSendBuffer+usDataOffset,
11092 &halUpdateProbeRspTmplParams,
11093 sizeof(halUpdateProbeRspTmplParams));
11094
11095 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
11096 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
11097
11098 /*-------------------------------------------------------------------------
11099 Send Update Probe Resp Template Request to HAL
11100 -------------------------------------------------------------------------*/
11101 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11102 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11103 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
11104}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11105
11106/**
11107 @brief Process NV blob download function (called when Main FSM
11108 allows it)
11109
11110 @param pWDICtx: pointer to the WLAN DAL context
11111 pEventData: pointer to the event information structure
11112
11113 @see
11114 @return Result of the function call
11115*/
11116WDI_Status
11117WDI_ProcessNvDownloadReq
11118(
11119 WDI_ControlBlockType* pWDICtx,
11120 WDI_EventInfoType* pEventData
11121)
11122{
11123
11124 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11125 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11126
11127 /*-------------------------------------------------------------------------
11128 Sanity check
11129 -------------------------------------------------------------------------*/
11130 if (( NULL == pEventData ) ||
11131 ( NULL == (pwdiNvDownloadReqParams =
11132 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
11133 ( NULL == (wdiNvDownloadRspCb =
11134 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11135 {
11136 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11137 "%s: Invalid parameters", __FUNCTION__);
11138 WDI_ASSERT(0);
11139 return WDI_STATUS_E_FAILURE;
11140 }
11141
11142 /*Intialize the Nv Blob Info */
11143 pWDICtx->wdiNvBlobInfo.usTotalFragment =
11144 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11145
11146 /*cache the wdi nv request message here if the the first fragment
11147 * To issue the request to HAL for the next fragment */
11148 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11149 {
11150 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11151 pwdiNvDownloadReqParams,
11152 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11153
11154 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11155 pWDICtx->pRspCBUserData = pEventData->pUserData;
11156 }
11157
11158 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11159}
11160
11161/**
11162 @brief Process Set Max Tx Power Request function (called when Main
11163 FSM allows it)
11164
11165 @param pWDICtx: pointer to the WLAN DAL context
11166 pEventData: pointer to the event information structure
11167
11168 @see
11169 @return Result of the function call
11170*/
11171WDI_Status WDI_ProcessSetMaxTxPowerReq
11172(
11173 WDI_ControlBlockType* pWDICtx,
11174 WDI_EventInfoType* pEventData
11175)
11176{
11177 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11178 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
11179 wpt_uint8* pSendBuffer = NULL;
11180 wpt_uint16 usDataOffset = 0;
11181 wpt_uint16 usSendSize = 0;
11182 tSetMaxTxPwrReq halSetMaxTxPower;
11183 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11184
11185 /*-------------------------------------------------------------------------
11186 Sanity check
11187 -------------------------------------------------------------------------*/
11188 if (( NULL == pEventData ) ||
11189 ( NULL == pEventData->pEventData ) ||
11190 ( NULL == pEventData->pCBfnc ))
11191 {
11192 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11193 "%s: Invalid parameters", __FUNCTION__);
11194 WDI_ASSERT(0);
11195 return WDI_STATUS_E_FAILURE;
11196 }
11197 pwdiSetMaxTxPowerParams =
11198 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
11199 wdiSetMaxTxPowerRspCb =
11200 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11201
11202 /*-----------------------------------------------------------------------
11203 Get message buffer
11204 -----------------------------------------------------------------------*/
11205if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
11206 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11207 &pSendBuffer, &usDataOffset, &usSendSize))||
11208 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
11209)))
11210 {
11211 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11212 "Unable to get Set Max Tx Power req %x %x %x",
11213 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11214 WDI_ASSERT(0);
11215 return WDI_STATUS_E_FAILURE;
11216 }
11217
11218 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11219 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11220 WDI_MAC_ADDR_LEN);
11221
11222 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11223 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11224 WDI_MAC_ADDR_LEN);
11225 halSetMaxTxPower.setMaxTxPwrParams.power =
11226 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
11227
11228 wpalMemoryCopy( pSendBuffer+usDataOffset,
11229 &halSetMaxTxPower.setMaxTxPwrParams,
11230 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
11231
11232 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
11233 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
11234
11235 /*-------------------------------------------------------------------------
11236 Send Del TS Request to HAL
11237 -------------------------------------------------------------------------*/
11238 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11239 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11240 WDI_SET_MAX_TX_POWER_RESP);
11241
11242}
11243
11244#ifdef WLAN_FEATURE_P2P
11245
11246/**
11247 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11248 allows it)
11249
11250 @param pWDICtx: pointer to the WLAN DAL context
11251 pEventData: pointer to the event information structure
11252
11253 @see
11254 @return Result of the function call
11255*/
11256WDI_Status
11257WDI_ProcessP2PGONOAReq
11258(
11259 WDI_ControlBlockType* pWDICtx,
11260 WDI_EventInfoType* pEventData
11261)
11262{
11263 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11264 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
11265 wpt_uint8* pSendBuffer = NULL;
11266 wpt_uint16 usDataOffset = 0;
11267 wpt_uint16 usSendSize = 0;
11268 tSetP2PGONOAParams halSetP2PGONOAParams;
11269 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11270
11271 /*-------------------------------------------------------------------------
11272 Sanity check
11273 -------------------------------------------------------------------------*/
11274 if (( NULL == pEventData ) ||
11275 ( NULL == pEventData->pEventData) ||
11276 ( NULL == pEventData->pCBfnc))
11277 {
11278 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11279 "%s: Invalid parameters", __FUNCTION__);
11280 WDI_ASSERT(0);
11281 return WDI_STATUS_E_FAILURE;
11282 }
11283
11284 pwdiP2PGONOAReqParams =
11285 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
11286 wdiP2PGONOAReqRspCb =
11287 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11288 /*-----------------------------------------------------------------------
11289 Get message buffer
11290 -----------------------------------------------------------------------*/
11291 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11292 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
11293 sizeof(halSetP2PGONOAParams),
11294 &pSendBuffer, &usDataOffset, &usSendSize))||
11295 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11296 {
11297 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11298 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11299 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11300 WDI_ASSERT(0);
11301 return WDI_STATUS_E_FAILURE;
11302 }
11303
11304 halSetP2PGONOAParams.opp_ps =
11305 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
11306 halSetP2PGONOAParams.ctWindow =
11307 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11308 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
11309 halSetP2PGONOAParams.duration =
11310 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
11311 halSetP2PGONOAParams.interval =
11312 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
11313 halSetP2PGONOAParams.single_noa_duration =
11314 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
11315 halSetP2PGONOAParams.psSelection =
11316 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11317
11318 wpalMemoryCopy( pSendBuffer+usDataOffset,
11319 &halSetP2PGONOAParams,
11320 sizeof(halSetP2PGONOAParams));
11321
11322 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
11323 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
11324
11325 /*-------------------------------------------------------------------------
11326 Send Update Probe Resp Template Request to HAL
11327 -------------------------------------------------------------------------*/
11328 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11329 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11330 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
11331}/*WDI_ProcessP2PGONOAReq*/
11332
11333#endif
11334
11335
11336/**
11337 @brief Function to handle the ack from DXE once the power
11338 state is set.
11339 @param None
11340
11341 @see
11342 @return void
11343*/
11344void
11345WDI_SetPowerStateCb
11346(
11347 wpt_status status,
11348 unsigned int dxePhyAddr,
11349 void *pContext
11350)
11351{
11352 wpt_status wptStatus;
11353 WDI_ControlBlockType *pCB = NULL;
11354 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11355 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11356 {
11357 //it shouldn't happen, put an error msg
11358 }
11359 /*
11360 * Trigger the event to bring the Enter BMPS req function to come
11361 * out of wait
11362*/
11363 if( NULL != pContext )
11364 {
11365 pCB = (WDI_ControlBlockType *)pContext;
11366 }
11367 else
11368 {
11369 //put an error msg
11370 pCB = &gWDICb;
11371 }
11372 pCB->dxePhyAddr = dxePhyAddr;
11373 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11374 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11375 {
11376 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11377 "Failed to set an event");
11378
11379 WDI_ASSERT(0);
11380 }
11381 return;
11382}
11383
11384
11385/**
11386 @brief Process Enter IMPS Request function (called when
11387 Main FSM allows it)
11388
11389 @param pWDICtx: pointer to the WLAN DAL context
11390 pEventData: pointer to the event information structure
11391
11392 @see
11393 @return Result of the function call
11394*/
11395WDI_Status
11396WDI_ProcessEnterImpsReq
11397(
11398 WDI_ControlBlockType* pWDICtx,
11399 WDI_EventInfoType* pEventData
11400)
11401{
11402 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
11403 wpt_uint8* pSendBuffer = NULL;
11404 wpt_uint16 usDataOffset = 0;
11405 wpt_uint16 usSendSize = 0;
11406 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11407
11408 /*-------------------------------------------------------------------------
11409 Sanity check
11410 -------------------------------------------------------------------------*/
11411 if (( NULL == pEventData ) ||
11412 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11413 {
11414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11415 "%s: Invalid parameters", __FUNCTION__);
11416 WDI_ASSERT(0);
11417 return WDI_STATUS_E_FAILURE;
11418 }
11419
11420 /*-----------------------------------------------------------------------
11421 Get message buffer
11422 ! TO DO : proper conversion into the HAL Message Request Format
11423 -----------------------------------------------------------------------*/
11424 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
11425 0,
11426 &pSendBuffer, &usDataOffset, &usSendSize))||
11427 ( usSendSize < (usDataOffset )))
11428 {
11429 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11430 "Unable to get send buffer in Enter IMPS req %x %x",
11431 pEventData, wdiEnterImpsRspCb);
11432 WDI_ASSERT(0);
11433 return WDI_STATUS_E_FAILURE;
11434 }
11435
11436 /* Reset the event to be not signalled */
11437 if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
11438 {
11439 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11440 "WDI Init failed to reset an event");
11441
11442 WDI_ASSERT(0);
11443 return VOS_STATUS_E_FAILURE;
11444 }
11445
11446 // notify DTS that we are entering IMPS
11447 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11448
11449 /*
11450 * Wait for the event to be set once the ACK comes back from DXE
11451 */
11452 if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent,
11453 WDI_SET_POWER_STATE_TIMEOUT))
11454 {
11455 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11456 "WDI Init failed to wait on an event");
11457
11458 WDI_ASSERT(0);
11459 return VOS_STATUS_E_FAILURE;
11460 }
11461
11462 /*-------------------------------------------------------------------------
11463 Send Get STA Request to HAL
11464 -------------------------------------------------------------------------*/
11465 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11466 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
11467}/*WDI_ProcessEnterImpsReq*/
11468
11469/**
11470 @brief Process Exit IMPS Request function (called when
11471 Main FSM allows it)
11472
11473 @param pWDICtx: pointer to the WLAN DAL context
11474 pEventData: pointer to the event information structure
11475
11476 @see
11477 @return Result of the function call
11478*/
11479WDI_Status
11480WDI_ProcessExitImpsReq
11481(
11482 WDI_ControlBlockType* pWDICtx,
11483 WDI_EventInfoType* pEventData
11484)
11485{
11486 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
11487 wpt_uint8* pSendBuffer = NULL;
11488 wpt_uint16 usDataOffset = 0;
11489 wpt_uint16 usSendSize = 0;
11490 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11491
11492 /*-------------------------------------------------------------------------
11493 Sanity check
11494 -------------------------------------------------------------------------*/
11495 if (( NULL == pEventData ) ||
11496 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11497 {
11498 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11499 "%s: Invalid parameters", __FUNCTION__);
11500 WDI_ASSERT(0);
11501 return WDI_STATUS_E_FAILURE;
11502 }
11503
11504 /*-----------------------------------------------------------------------
11505 Get message buffer
11506 ! TO DO : proper conversion into the HAL Message Request Format
11507 -----------------------------------------------------------------------*/
11508 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
11509 0,
11510 &pSendBuffer, &usDataOffset, &usSendSize))||
11511 ( usSendSize < (usDataOffset )))
11512 {
11513 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11514 "Unable to get send buffer in Exit IMPS req %x %x",
11515 pEventData, wdiExitImpsRspCb);
11516 WDI_ASSERT(0);
11517 return WDI_STATUS_E_FAILURE;
11518 }
11519
11520 /*-------------------------------------------------------------------------
11521 Send Get STA Request to HAL
11522 -------------------------------------------------------------------------*/
11523 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11524 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
11525}/*WDI_ProcessExitImpsReq*/
11526
11527/**
11528 @brief Process Enter BMPS Request function (called when Main
11529 FSM allows it)
11530
11531 @param pWDICtx: pointer to the WLAN DAL context
11532 pEventData: pointer to the event information structure
11533
11534 @see
11535 @return Result of the function call
11536*/
11537WDI_Status
11538WDI_ProcessEnterBmpsReq
11539(
11540 WDI_ControlBlockType* pWDICtx,
11541 WDI_EventInfoType* pEventData
11542)
11543{
11544 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11545 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
11546 wpt_uint8* pSendBuffer = NULL;
11547 wpt_uint16 usDataOffset = 0;
11548 wpt_uint16 usSendSize = 0;
11549 tHalEnterBmpsReqParams enterBmpsReq;
11550 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11551
11552 /*-------------------------------------------------------------------------
11553 Sanity check
11554 -------------------------------------------------------------------------*/
11555 if (( NULL == pEventData ) ||
11556 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11557 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11558 {
11559 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11560 "%s: Invalid parameters", __FUNCTION__);
11561 WDI_ASSERT(0);
11562 return WDI_STATUS_E_FAILURE;
11563 }
11564
11565 /*-----------------------------------------------------------------------
11566 Get message buffer
11567 ! TO DO : proper conversion into the HAL Message Request Format
11568 -----------------------------------------------------------------------*/
11569 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
11570 sizeof(enterBmpsReq),
11571 &pSendBuffer, &usDataOffset, &usSendSize))||
11572 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11573 {
11574 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11575 "Unable to get send buffer in Enter BMPS req %x %x %x",
11576 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11577 WDI_ASSERT(0);
11578 return WDI_STATUS_E_FAILURE;
11579 }
11580
11581 /* Reset the event to be not signalled */
11582 if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
11583 {
11584 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11585 "WDI Init failed to reset an event");
11586
11587 WDI_ASSERT(0);
11588 return VOS_STATUS_E_FAILURE;
11589 }
11590
11591 // notify DTS that we are entering BMPS
11592 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11593
11594/*
11595 * Wait for the event to be set once the ACK comes back from DXE
11596 */
11597 if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent,
11598 WDI_SET_POWER_STATE_TIMEOUT))
11599 {
11600 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11601 "WDI Init failed to wait on an event");
11602
11603 WDI_ASSERT(0);
11604 return VOS_STATUS_E_FAILURE;
11605 }
11606
11607 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11608
11609 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11610 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11611 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11612 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11613
11614 // For CCX and 11R Roaming
11615 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11616 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11617 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11618
11619 wpalMemoryCopy( pSendBuffer+usDataOffset,
11620 &enterBmpsReq,
11621 sizeof(enterBmpsReq));
11622
11623 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
11624 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
11625
11626 /*-------------------------------------------------------------------------
11627 Send Get STA Request to HAL
11628 -------------------------------------------------------------------------*/
11629 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11630 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
11631}/*WDI_ProcessEnterBmpsReq*/
11632
11633/**
11634 @brief Process Exit BMPS Request function (called when Main FSM
11635 allows it)
11636
11637 @param pWDICtx: pointer to the WLAN DAL context
11638 pEventData: pointer to the event information structure
11639
11640 @see
11641 @return Result of the function call
11642*/
11643WDI_Status
11644WDI_ProcessExitBmpsReq
11645(
11646 WDI_ControlBlockType* pWDICtx,
11647 WDI_EventInfoType* pEventData
11648)
11649{
11650 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11651 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
11652 wpt_uint8* pSendBuffer = NULL;
11653 wpt_uint16 usDataOffset = 0;
11654 wpt_uint16 usSendSize = 0;
11655 tHalExitBmpsReqParams exitBmpsReq;
11656 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11657
11658 /*-------------------------------------------------------------------------
11659 Sanity check
11660 -------------------------------------------------------------------------*/
11661 if (( NULL == pEventData ) ||
11662 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11663 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11664 {
11665 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11666 "%s: Invalid parameters", __FUNCTION__);
11667 WDI_ASSERT(0);
11668 return WDI_STATUS_E_FAILURE;
11669 }
11670
11671 /*-----------------------------------------------------------------------
11672 Get message buffer
11673 ! TO DO : proper conversion into the HAL Message Request Format
11674 -----------------------------------------------------------------------*/
11675 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
11676 sizeof(exitBmpsReq),
11677 &pSendBuffer, &usDataOffset, &usSendSize))||
11678 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11679 {
11680 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11681 "Unable to get send buffer in Exit BMPS req %x %x %x",
11682 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11683 WDI_ASSERT(0);
11684 return WDI_STATUS_E_FAILURE;
11685 }
11686 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11687
11688 wpalMemoryCopy( pSendBuffer+usDataOffset,
11689 &exitBmpsReq,
11690 sizeof(exitBmpsReq));
11691
11692 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
11693 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
11694
11695 /*-------------------------------------------------------------------------
11696 Send Get STA Request to HAL
11697 -------------------------------------------------------------------------*/
11698 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11699 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
11700}/*WDI_ProcessExitBmpsReq*/
11701
11702/**
11703 @brief Process Enter UAPSD Request function (called when Main
11704 FSM allows it)
11705
11706 @param pWDICtx: pointer to the WLAN DAL context
11707 pEventData: pointer to the event information structure
11708
11709 @see
11710 @return Result of the function call
11711*/
11712WDI_Status
11713WDI_ProcessEnterUapsdReq
11714(
11715 WDI_ControlBlockType* pWDICtx,
11716 WDI_EventInfoType* pEventData
11717)
11718{
11719 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11720 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
11721 wpt_uint8* pSendBuffer = NULL;
11722 wpt_uint16 usDataOffset = 0;
11723 wpt_uint16 usSendSize = 0;
11724 tUapsdReqParams enterUapsdReq;
11725 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11726
11727 /*-------------------------------------------------------------------------
11728 Sanity check
11729 -------------------------------------------------------------------------*/
11730 if (( NULL == pEventData ) ||
11731 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11732 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11733 {
11734 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11735 "%s: Invalid parameters", __FUNCTION__);
11736 WDI_ASSERT(0);
11737 return WDI_STATUS_E_FAILURE;
11738 }
11739
11740 /*-----------------------------------------------------------------------
11741 Get message buffer
11742 ! TO DO : proper conversion into the HAL Message Request Format
11743 -----------------------------------------------------------------------*/
11744 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
11745 sizeof(enterUapsdReq),
11746 &pSendBuffer, &usDataOffset, &usSendSize))||
11747 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
11748 {
11749 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11750 "Unable to get send buffer in Enter UAPSD req %x %x %x",
11751 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
11752 WDI_ASSERT(0);
11753 return WDI_STATUS_E_FAILURE;
11754 }
11755
11756 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
11757 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
11758 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
11759 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
11760 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
11761 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
11762 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
11763 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
11764
11765 wpalMemoryCopy( pSendBuffer+usDataOffset,
11766 &enterUapsdReq,
11767 sizeof(enterUapsdReq));
11768
11769 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
11770 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
11771
11772 /*-------------------------------------------------------------------------
11773 Send Get STA Request to HAL
11774 -------------------------------------------------------------------------*/
11775 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11776 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
11777}/*WDI_ProcessEnterUapsdReq*/
11778
11779/**
11780 @brief Process Exit UAPSD Request function (called when
11781 Main FSM allows it)
11782
11783 @param pWDICtx: pointer to the WLAN DAL context
11784 pEventData: pointer to the event information structure
11785
11786 @see
11787 @return Result of the function call
11788*/
11789WDI_Status
11790WDI_ProcessExitUapsdReq
11791(
11792 WDI_ControlBlockType* pWDICtx,
11793 WDI_EventInfoType* pEventData
11794)
11795{
11796 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
11797 wpt_uint8* pSendBuffer = NULL;
11798 wpt_uint16 usDataOffset = 0;
11799 wpt_uint16 usSendSize = 0;
11800 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11801
11802 /*-------------------------------------------------------------------------
11803 Sanity check
11804 -------------------------------------------------------------------------*/
11805 if (( NULL == pEventData ) ||
11806 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
11807 {
11808 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11809 "%s: Invalid parameters", __FUNCTION__);
11810 WDI_ASSERT(0);
11811 return WDI_STATUS_E_FAILURE;
11812 }
11813
11814 /*-----------------------------------------------------------------------
11815 Get message buffer
11816 ! TO DO : proper conversion into the HAL Message Request Format
11817 -----------------------------------------------------------------------*/
11818 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
11819 0,
11820 &pSendBuffer, &usDataOffset, &usSendSize))||
11821 ( usSendSize < (usDataOffset )))
11822 {
11823 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11824 "Unable to get send buffer in Exit UAPSD req %x %x",
11825 pEventData, wdiExitUapsdRspCb);
11826 WDI_ASSERT(0);
11827 return WDI_STATUS_E_FAILURE;
11828 }
11829
11830 /*-------------------------------------------------------------------------
11831 Send Get STA Request to HAL
11832 -------------------------------------------------------------------------*/
11833 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11834 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
11835}/*WDI_ProcessExitUapsdReq*/
11836
11837/**
11838 @brief Process Set UAPSD params Request function (called when
11839 Main FSM allows it)
11840
11841 @param pWDICtx: pointer to the WLAN DAL context
11842 pEventData: pointer to the event information structure
11843
11844 @see
11845 @return Result of the function call
11846*/
11847WDI_Status
11848WDI_ProcessSetUapsdAcParamsReq
11849(
11850 WDI_ControlBlockType* pWDICtx,
11851 WDI_EventInfoType* pEventData
11852)
11853{
11854 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
11855 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
11856 wpt_uint8* pSendBuffer = NULL;
11857 wpt_uint16 usDataOffset = 0;
11858 wpt_uint16 usSendSize = 0;
11859 tUapsdInfo uapsdAcParamsReq;
11860 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11861
11862 /*-------------------------------------------------------------------------
11863 Sanity check
11864 -------------------------------------------------------------------------*/
11865 if (( NULL == pEventData ) ||
11866 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
11867 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
11868 {
11869 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11870 "%s: Invalid parameters", __FUNCTION__);
11871 WDI_ASSERT(0);
11872 return WDI_STATUS_E_FAILURE;
11873 }
11874
11875 /*-----------------------------------------------------------------------
11876 Get message buffer
11877 ! TO DO : proper conversion into the HAL Message Request Format
11878 -----------------------------------------------------------------------*/
11879 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
11880 sizeof(uapsdAcParamsReq),
11881 &pSendBuffer, &usDataOffset, &usSendSize))||
11882 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
11883 {
11884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11885 "Unable to get send buffer in Set UAPSD params req %x %x %x",
11886 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
11887 WDI_ASSERT(0);
11888 return WDI_STATUS_E_FAILURE;
11889 }
11890
11891 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
11892 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
11893 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
11894 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
11895 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
11896 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
11897
11898 wpalMemoryCopy( pSendBuffer+usDataOffset,
11899 &uapsdAcParamsReq,
11900 sizeof(uapsdAcParamsReq));
11901
11902 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
11903 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
11904
11905 /*-------------------------------------------------------------------------
11906 Send Get STA Request to HAL
11907 -------------------------------------------------------------------------*/
11908 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11909 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
11910}/*WDI_ProcessSetUapsdAcParamsReq*/
11911
11912/**
11913 @brief Process update UAPSD params Request function (called
11914 when Main FSM allows it)
11915
11916 @param pWDICtx: pointer to the WLAN DAL context
11917 pEventData: pointer to the event information structure
11918
11919 @see
11920 @return Result of the function call
11921*/
11922WDI_Status
11923WDI_ProcessUpdateUapsdParamsReq
11924(
11925 WDI_ControlBlockType* pWDICtx,
11926 WDI_EventInfoType* pEventData
11927)
11928{
11929 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
11930 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
11931 wpt_uint8* pSendBuffer = NULL;
11932 wpt_uint16 usDataOffset = 0;
11933 wpt_uint16 usSendSize = 0;
11934 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11935
11936 /*-------------------------------------------------------------------------
11937 Sanity check
11938 -------------------------------------------------------------------------*/
11939 if (( NULL == pEventData ) ||
11940 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
11941 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
11942 {
11943 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11944 "%s: Invalid parameters", __FUNCTION__);
11945 WDI_ASSERT(0);
11946 return WDI_STATUS_E_FAILURE;
11947 }
11948
11949 /*-----------------------------------------------------------------------
11950 Get message buffer
11951 ! TO DO : proper conversion into the HAL Message Request Format
11952 -----------------------------------------------------------------------*/
11953 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
11954 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
11955 &pSendBuffer, &usDataOffset, &usSendSize))||
11956 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
11957 {
11958 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11959 "Unable to get send buffer in Update UAPSD params req %x %x %x",
11960 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
11961 WDI_ASSERT(0);
11962 return WDI_STATUS_E_FAILURE;
11963 }
11964
11965 wpalMemoryCopy( pSendBuffer+usDataOffset,
11966 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
11967 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
11968
11969 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
11970 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
11971
11972 /*-------------------------------------------------------------------------
11973 Send Get STA Request to HAL
11974 -------------------------------------------------------------------------*/
11975 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11976 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
11977}/*WDI_ProcessUpdateUapsdParamsReq*/
11978
11979/**
11980 @brief Process Configure RXP filter Request function (called
11981 when Main FSM allows it)
11982
11983 @param pWDICtx: pointer to the WLAN DAL context
11984 pEventData: pointer to the event information structure
11985
11986 @see
11987 @return Result of the function call
11988*/
11989WDI_Status
11990WDI_ProcessConfigureRxpFilterReq
11991(
11992 WDI_ControlBlockType* pWDICtx,
11993 WDI_EventInfoType* pEventData
11994)
11995{
11996 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
11997 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
11998 wpt_uint8* pSendBuffer = NULL;
11999 wpt_uint16 usDataOffset = 0;
12000 wpt_uint16 usSendSize = 0;
12001 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12002
12003 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12004
12005 /*-------------------------------------------------------------------------
12006 Sanity check
12007 -------------------------------------------------------------------------*/
12008 if (( NULL == pEventData ) ||
12009 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12010 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12011 {
12012 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12013 "%s: Invalid parameters", __FUNCTION__);
12014 WDI_ASSERT(0);
12015 return WDI_STATUS_E_FAILURE;
12016 }
12017
12018 /*-----------------------------------------------------------------------
12019 Get message buffer
12020 -----------------------------------------------------------------------*/
12021 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
12022 sizeof(halRxpFilterParams),
12023 &pSendBuffer, &usDataOffset, &usSendSize))||
12024 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12025 {
12026 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12027 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12028 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12029 WDI_ASSERT(0);
12030 return WDI_STATUS_E_FAILURE;
12031 }
12032
12033 halRxpFilterParams.setMcstBcstFilterSetting =
12034 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
12035 halRxpFilterParams.setMcstBcstFilter =
12036 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12037
12038 wpalMemoryCopy( pSendBuffer+usDataOffset,
12039 &halRxpFilterParams,
12040 sizeof(halRxpFilterParams));
12041
12042 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
12043 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
12044
12045 /*-------------------------------------------------------------------------
12046 Send Get STA Request to HAL
12047 -------------------------------------------------------------------------*/
12048 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12049 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
12050}/*WDI_ProcessConfigureRxpFilterReq*/
12051
12052/**
12053 @brief Process set beacon filter Request function (called
12054 when Main FSM allows it)
12055
12056 @param pWDICtx: pointer to the WLAN DAL context
12057 pEventData: pointer to the event information structure
12058
12059 @see
12060 @return Result of the function call
12061*/
12062WDI_Status
12063WDI_ProcessSetBeaconFilterReq
12064(
12065 WDI_ControlBlockType* pWDICtx,
12066 WDI_EventInfoType* pEventData
12067)
12068{
12069 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12070 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
12071 wpt_uint8* pSendBuffer = NULL;
12072 wpt_uint16 usDataOffset = 0;
12073 wpt_uint16 usSendSize = 0;
12074 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12075
12076 /*-------------------------------------------------------------------------
12077 Sanity check
12078 -------------------------------------------------------------------------*/
12079 if (( NULL == pEventData ) ||
12080 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12081 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12082 {
12083 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12084 "%s: Invalid parameters", __FUNCTION__);
12085 WDI_ASSERT(0);
12086 return WDI_STATUS_E_FAILURE;
12087 }
12088
12089 /*-----------------------------------------------------------------------
12090 Get message buffer
12091 ! TO DO : proper conversion into the HAL Message Request Format
12092 -----------------------------------------------------------------------*/
12093 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
12094 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12095 &pSendBuffer, &usDataOffset, &usSendSize))||
12096 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12097 {
12098 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12099 "Unable to get send buffer in Set beacon filter req %x %x %x",
12100 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12101 WDI_ASSERT(0);
12102 return WDI_STATUS_E_FAILURE;
12103 }
12104
12105 wpalMemoryCopy( pSendBuffer+usDataOffset,
12106 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12107 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12108 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12109 &pwdiBeaconFilterParams->aFilters[0],
12110 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
12111
12112 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
12113 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
12114
12115 /*-------------------------------------------------------------------------
12116 Send Get STA Request to HAL
12117 -------------------------------------------------------------------------*/
12118 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12119 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
12120}/*WDI_ProcessSetBeaconFilterReq*/
12121
12122/**
12123 @brief Process remove beacon filter Request function (called
12124 when Main FSM allows it)
12125
12126 @param pWDICtx: pointer to the WLAN DAL context
12127 pEventData: pointer to the event information structure
12128
12129 @see
12130 @return Result of the function call
12131*/
12132WDI_Status
12133WDI_ProcessRemBeaconFilterReq
12134(
12135 WDI_ControlBlockType* pWDICtx,
12136 WDI_EventInfoType* pEventData
12137)
12138{
12139 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12140 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
12141 wpt_uint8* pSendBuffer = NULL;
12142 wpt_uint16 usDataOffset = 0;
12143 wpt_uint16 usSendSize = 0;
12144 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12145
12146 /*-------------------------------------------------------------------------
12147 Sanity check
12148 -------------------------------------------------------------------------*/
12149 if (( NULL == pEventData ) ||
12150 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12151 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12152 {
12153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12154 "%s: Invalid parameters", __FUNCTION__);
12155 WDI_ASSERT(0);
12156 return WDI_STATUS_E_FAILURE;
12157 }
12158
12159 /*-----------------------------------------------------------------------
12160 Get message buffer
12161 ! TO DO : proper conversion into the HAL Message Request Format
12162 -----------------------------------------------------------------------*/
12163 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
12164 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12165 &pSendBuffer, &usDataOffset, &usSendSize))||
12166 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12167 {
12168 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12169 "Unable to get send buffer in remove beacon filter req %x %x %x",
12170 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12171 WDI_ASSERT(0);
12172 return WDI_STATUS_E_FAILURE;
12173 }
12174
12175 wpalMemoryCopy( pSendBuffer+usDataOffset,
12176 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12177 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12178
12179 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
12180 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
12181
12182 /*-------------------------------------------------------------------------
12183 Send Get STA Request to HAL
12184 -------------------------------------------------------------------------*/
12185 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12186 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
12187}
12188
12189/**
12190 @brief Process set RSSI thresholds Request function (called
12191 when Main FSM allows it)
12192
12193 @param pWDICtx: pointer to the WLAN DAL context
12194 pEventData: pointer to the event information structure
12195
12196 @see
12197 @return Result of the function call
12198*/
12199WDI_Status
12200WDI_ProcessSetRSSIThresholdsReq
12201(
12202 WDI_ControlBlockType* pWDICtx,
12203 WDI_EventInfoType* pEventData
12204)
12205{
12206 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12207 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
12208 wpt_uint8* pSendBuffer = NULL;
12209 wpt_uint16 usDataOffset = 0;
12210 wpt_uint16 usSendSize = 0;
12211 tHalRSSIThresholds rssiThresholdsReq;
12212 WDI_Status ret_status = 0;
12213 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12214
12215 /*-------------------------------------------------------------------------
12216 Sanity check
12217 -------------------------------------------------------------------------*/
12218 if (( NULL == pEventData ) ||
12219 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12220 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12221 {
12222 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12223 "%s: Invalid parameters", __FUNCTION__);
12224 WDI_ASSERT(0);
12225 return WDI_STATUS_E_FAILURE;
12226 }
12227
12228 /*-----------------------------------------------------------------------
12229 Get message buffer
12230 ! TO DO : proper conversion into the HAL Message Request Format
12231 -----------------------------------------------------------------------*/
12232 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
12233 sizeof(rssiThresholdsReq),
12234 &pSendBuffer, &usDataOffset, &usSendSize))||
12235 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12236 {
12237 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12238 "Unable to get send buffer in remove beacon filter req %x %x %x",
12239 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12240 WDI_ASSERT(0);
12241 return WDI_STATUS_E_FAILURE;
12242 }
12243
12244 rssiThresholdsReq.bReserved10 =
12245 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
12246 rssiThresholdsReq.bRssiThres1NegNotify =
12247 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
12248 rssiThresholdsReq.bRssiThres1PosNotify =
12249 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
12250 rssiThresholdsReq.bRssiThres2NegNotify =
12251 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
12252 rssiThresholdsReq.bRssiThres2PosNotify =
12253 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
12254 rssiThresholdsReq.bRssiThres3NegNotify =
12255 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
12256 rssiThresholdsReq.bRssiThres3PosNotify =
12257 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
12258 rssiThresholdsReq.ucRssiThreshold1 =
12259 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
12260 rssiThresholdsReq.ucRssiThreshold2 =
12261 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
12262 rssiThresholdsReq.ucRssiThreshold3 =
12263 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12264
12265 wpalMemoryCopy( pSendBuffer+usDataOffset,
12266 &rssiThresholdsReq,
12267 sizeof(rssiThresholdsReq));
12268
12269 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
12270 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
12271
12272 /*-------------------------------------------------------------------------
12273 Send Set threshold req to HAL
12274 -------------------------------------------------------------------------*/
12275 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12276 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12277 {
12278 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12279 // req. Then as a result of processing the threshold cross ind, we trigger
12280 // a Set threshold req, then we need to indicate to WDI that it needs to
12281 // go to busy state as a result of the indication as we sent a req in the
12282 // same WDI context.
12283 // Hence expected state transition is to busy.
12284 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12285 }
12286
12287 return ret_status;
12288}
12289
12290/**
12291 @brief Process set RSSI thresholds Request function (called
12292 when Main FSM allows it)
12293
12294 @param pWDICtx: pointer to the WLAN DAL context
12295 pEventData: pointer to the event information structure
12296
12297 @see
12298 @return Result of the function call
12299*/
12300WDI_Status
12301WDI_ProcessHostOffloadReq
12302(
12303 WDI_ControlBlockType* pWDICtx,
12304 WDI_EventInfoType* pEventData
12305)
12306{
12307 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12308 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
12309 wpt_uint8* pSendBuffer = NULL;
12310 wpt_uint16 usDataOffset = 0;
12311 wpt_uint16 usSendSize = 0;
12312 tHalHostOffloadReq hostOffloadParams;
12313 tHalNSOffloadParams nsOffloadParams;
12314
12315 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12316
12317 /*-------------------------------------------------------------------------
12318 Sanity check
12319 -------------------------------------------------------------------------*/
12320 if (( NULL == pEventData ) ||
12321 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12322 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12323 {
12324 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12325 "%s: Invalid parameters", __FUNCTION__);
12326 WDI_ASSERT(0);
12327 return WDI_STATUS_E_FAILURE;
12328 }
12329
12330 /*-----------------------------------------------------------------------
12331 Get message buffer
12332 ! TO DO : proper conversion into the HAL Message Request Format
12333 -----------------------------------------------------------------------*/
12334 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
12335 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12336 &pSendBuffer, &usDataOffset, &usSendSize))||
12337 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12338 {
12339 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12340 "Unable to get send buffer in host offload req %x %x %x",
12341 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12342 WDI_ASSERT(0);
12343 return WDI_STATUS_E_FAILURE;
12344 }
12345
12346 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12347 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
12348 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12349 {
12350 // ARP Offload
12351 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12352 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12353 4);
12354 }
12355 else
12356 {
12357 // NS Offload
12358 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12359 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12360 16);
12361
12362#ifdef WLAN_NS_OFFLOAD
12363 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12364 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12365 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12366 16);
12367 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12368 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12369 16);
12370 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12371 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12372 16);
12373 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12374 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12375 16);
12376 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12377 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12378 6);
12379 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12380 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12381 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
12382#endif // WLAN_NS_OFFLOAD
12383 }
12384
12385 // copy hostOffloadParams into pSendBuffer
12386 wpalMemoryCopy( pSendBuffer+usDataOffset,
12387 &hostOffloadParams,
12388 sizeof(hostOffloadParams));
12389
12390#ifdef WLAN_NS_OFFLOAD
12391 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12392 {
12393 // copy nsOffloadParams into pSendBuffer
12394 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12395 &nsOffloadParams,
12396 sizeof(nsOffloadParams));
12397 }
12398#endif // WLAN_NS_OFFLOAD
12399
12400 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
12401 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
12402
12403 /*-------------------------------------------------------------------------
12404 Send Get STA Request to HAL
12405 -------------------------------------------------------------------------*/
12406 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12407 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
12408}/*WDI_ProcessHostOffloadReq*/
12409
12410/**
12411 @brief Process Keep Alive Request function (called
12412 when Main FSM allows it)
12413
12414 @param pWDICtx: pointer to the WLAN DAL context
12415 pEventData: pointer to the event information structure
12416
12417 @see
12418 @return Result of the function call
12419*/
12420WDI_Status
12421WDI_ProcessKeepAliveReq
12422(
12423 WDI_ControlBlockType* pWDICtx,
12424 WDI_EventInfoType* pEventData
12425)
12426{
12427 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12428 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
12429 wpt_uint8* pSendBuffer = NULL;
12430 wpt_uint16 usDataOffset = 0;
12431 wpt_uint16 usSendSize = 0;
12432 tHalKeepAliveReq keepAliveReq;
12433 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12434
12435 /*-------------------------------------------------------------------------
12436 Sanity check
12437 -------------------------------------------------------------------------*/
12438 if (( NULL == pEventData ) ||
12439 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12440 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12441 {
12442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12443 "Invalid parameters in Keep Alive req");
12444 WDI_ASSERT(0);
12445 return WDI_STATUS_E_FAILURE;
12446 }
12447
12448 /*-----------------------------------------------------------------------
12449 Get message buffer
12450 ! TO DO : proper conversion into the HAL Message Request Format
12451 -----------------------------------------------------------------------*/
12452 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
12453 sizeof(keepAliveReq),
12454 &pSendBuffer, &usDataOffset, &usSendSize))||
12455 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12456 {
12457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12458 "Unable to get send buffer in keep alive req %x %x %x",
12459 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12460 WDI_ASSERT(0);
12461 return WDI_STATUS_E_FAILURE;
12462 }
12463
12464 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12465 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12466
12467 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12468 {
12469 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12470 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12471 HAL_IPV4_ADDR_LEN);
12472 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12473 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
12474 HAL_IPV4_ADDR_LEN);
12475 wpalMemoryCopy(keepAliveReq.destMacAddr,
12476 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12477 HAL_MAC_ADDR_LEN);
12478 }
12479
12480 wpalMemoryCopy( pSendBuffer+usDataOffset,
12481 &keepAliveReq,
12482 sizeof(keepAliveReq));
12483
12484 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12485 "Process keep alive req %d",sizeof(keepAliveReq));
12486
12487 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12488 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12489
12490 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
12491 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
12492
12493 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12494 "Sending keep alive req to HAL");
12495
12496 /*-------------------------------------------------------------------------
12497 Send Get STA Request to HAL
12498 -------------------------------------------------------------------------*/
12499 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12500 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
12501}/*WDI_ProcessKeepAliveReq*/
12502
12503
12504/**
12505 @brief Process Wowl add bc ptrn Request function (called
12506 when Main FSM allows it)
12507
12508 @param pWDICtx: pointer to the WLAN DAL context
12509 pEventData: pointer to the event information structure
12510
12511 @see
12512 @return Result of the function call
12513*/
12514WDI_Status
12515WDI_ProcessWowlAddBcPtrnReq
12516(
12517 WDI_ControlBlockType* pWDICtx,
12518 WDI_EventInfoType* pEventData
12519)
12520{
12521 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12522 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
12523 wpt_uint8* pSendBuffer = NULL;
12524 wpt_uint16 usDataOffset = 0;
12525 wpt_uint16 usSendSize = 0;
12526 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
12527 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12528
12529 /*-------------------------------------------------------------------------
12530 Sanity check
12531 -------------------------------------------------------------------------*/
12532 if (( NULL == pEventData ) ||
12533 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12534 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12535 {
12536 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12537 "%s: Invalid parameters", __FUNCTION__);
12538 WDI_ASSERT(0);
12539 return WDI_STATUS_E_FAILURE;
12540 }
12541
12542 /*-----------------------------------------------------------------------
12543 Get message buffer
12544 ! TO DO : proper conversion into the HAL Message Request Format
12545 -----------------------------------------------------------------------*/
12546 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
12547 sizeof(wowlAddBcPtrnReq),
12548 &pSendBuffer, &usDataOffset, &usSendSize))||
12549 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12550 {
12551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12552 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12553 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12554 WDI_ASSERT(0);
12555 return WDI_STATUS_E_FAILURE;
12556 }
12557
12558 wowlAddBcPtrnReq.ucPatternId =
12559 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
12560 wowlAddBcPtrnReq.ucPatternByteOffset =
12561 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
12562 wowlAddBcPtrnReq.ucPatternMaskSize =
12563 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
12564 wowlAddBcPtrnReq.ucPatternSize =
12565 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12566
12567 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12568 {
12569 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12570 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12571 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12572 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12573 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12574 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12575 }
12576 else
12577 {
12578 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12579 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12580 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12581 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12582 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12583 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12584
12585 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12586 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12587 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12588 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12589 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12590 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12591 }
12592
12593 wpalMemoryCopy( pSendBuffer+usDataOffset,
12594 &wowlAddBcPtrnReq,
12595 sizeof(wowlAddBcPtrnReq));
12596
12597 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
12598 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
12599
12600 /*-------------------------------------------------------------------------
12601 Send Get STA Request to HAL
12602 -------------------------------------------------------------------------*/
12603 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12604 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
12605}/*WDI_ProcessWowlAddBcPtrnReq*/
12606
12607/**
12608 @brief Process Wowl delete bc ptrn Request function (called
12609 when Main FSM allows it)
12610
12611 @param pWDICtx: pointer to the WLAN DAL context
12612 pEventData: pointer to the event information structure
12613
12614 @see
12615 @return Result of the function call
12616*/
12617WDI_Status
12618WDI_ProcessWowlDelBcPtrnReq
12619(
12620 WDI_ControlBlockType* pWDICtx,
12621 WDI_EventInfoType* pEventData
12622)
12623{
12624 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12625 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
12626 wpt_uint8* pSendBuffer = NULL;
12627 wpt_uint16 usDataOffset = 0;
12628 wpt_uint16 usSendSize = 0;
12629 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
12630 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12631
12632 /*-------------------------------------------------------------------------
12633 Sanity check
12634 -------------------------------------------------------------------------*/
12635 if (( NULL == pEventData ) ||
12636 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12637 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12638 {
12639 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12640 "%s: Invalid parameters", __FUNCTION__);
12641 WDI_ASSERT(0);
12642 return WDI_STATUS_E_FAILURE;
12643 }
12644
12645 /*-----------------------------------------------------------------------
12646 Get message buffer
12647 ! TO DO : proper conversion into the HAL Message Request Format
12648 -----------------------------------------------------------------------*/
12649 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
12650 sizeof(wowlDelBcPtrnReq),
12651 &pSendBuffer, &usDataOffset, &usSendSize))||
12652 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12653 {
12654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12655 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12656 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12657 WDI_ASSERT(0);
12658 return WDI_STATUS_E_FAILURE;
12659 }
12660
12661 wowlDelBcPtrnReq.ucPatternId =
12662 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
12663 wpalMemoryCopy( pSendBuffer+usDataOffset,
12664 &wowlDelBcPtrnReq,
12665 sizeof(wowlDelBcPtrnReq));
12666
12667 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
12668 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
12669
12670 /*-------------------------------------------------------------------------
12671 Send Get STA Request to HAL
12672 -------------------------------------------------------------------------*/
12673 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12674 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
12675}/*WDI_ProcessWowlDelBcPtrnReq*/
12676
12677/**
12678 @brief Process Wowl enter Request function (called
12679 when Main FSM allows it)
12680
12681 @param pWDICtx: pointer to the WLAN DAL context
12682 pEventData: pointer to the event information structure
12683
12684 @see
12685 @return Result of the function call
12686*/
12687WDI_Status
12688WDI_ProcessWowlEnterReq
12689(
12690 WDI_ControlBlockType* pWDICtx,
12691 WDI_EventInfoType* pEventData
12692)
12693{
12694 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
12695 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
12696 wpt_uint8* pSendBuffer = NULL;
12697 wpt_uint16 usDataOffset = 0;
12698 wpt_uint16 usSendSize = 0;
12699 tHalWowlEnterParams wowlEnterReq;
12700 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12701
12702 /*-------------------------------------------------------------------------
12703 Sanity check
12704 -------------------------------------------------------------------------*/
12705 if (( NULL == pEventData ) ||
12706 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
12707 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
12708 {
12709 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12710 "%s: Invalid parameters", __FUNCTION__);
12711 WDI_ASSERT(0);
12712 return WDI_STATUS_E_FAILURE;
12713 }
12714
12715 /*-----------------------------------------------------------------------
12716 Get message buffer
12717 ! TO DO : proper conversion into the HAL Message Request Format
12718 -----------------------------------------------------------------------*/
12719 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
12720 sizeof(wowlEnterReq),
12721 &pSendBuffer, &usDataOffset, &usSendSize))||
12722 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
12723 {
12724 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12725 "Unable to get send buffer in Wowl enter req %x %x %x",
12726 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
12727 WDI_ASSERT(0);
12728 return WDI_STATUS_E_FAILURE;
12729 }
12730
12731 wowlEnterReq.ucMagicPktEnable =
12732 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
12733 wowlEnterReq.ucPatternFilteringEnable =
12734 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
12735 wowlEnterReq.ucUcastPatternFilteringEnable =
12736 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
12737 wowlEnterReq.ucWowChnlSwitchRcv =
12738 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
12739 wowlEnterReq.ucWowDeauthRcv =
12740 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
12741 wowlEnterReq.ucWowDisassocRcv =
12742 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
12743 wowlEnterReq.ucWowMaxMissedBeacons =
12744 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
12745 wowlEnterReq.ucWowMaxSleepUsec =
12746 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
12747
12748#ifdef WLAN_WAKEUP_EVENTS
12749 wowlEnterReq.ucWoWEAPIDRequestEnable =
12750 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
12751
12752 wowlEnterReq.ucWoWEAPOL4WayEnable =
12753 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
12754
12755 wowlEnterReq.ucWowNetScanOffloadMatch =
12756 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
12757
12758 wowlEnterReq.ucWowGTKRekeyError =
12759 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
12760
12761 wowlEnterReq.ucWoWBSSConnLoss =
12762 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
12763#endif // WLAN_WAKEUP_EVENTS
12764
12765 wpalMemoryCopy(wowlEnterReq.magicPtrn,
12766 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
12767 sizeof(tSirMacAddr));
12768
12769 wpalMemoryCopy( pSendBuffer+usDataOffset,
12770 &wowlEnterReq,
12771 sizeof(wowlEnterReq));
12772
12773 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
12774 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
12775
12776 /*-------------------------------------------------------------------------
12777 Send Get STA Request to HAL
12778 -------------------------------------------------------------------------*/
12779 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12780 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
12781}/*WDI_ProcessWowlEnterReq*/
12782
12783/**
12784 @brief Process Wowl exit Request function (called when Main FSM
12785 allows it)
12786
12787 @param pWDICtx: pointer to the WLAN DAL context
12788 pEventData: pointer to the event information structure
12789
12790 @see
12791 @return Result of the function call
12792*/
12793WDI_Status
12794WDI_ProcessWowlExitReq
12795(
12796 WDI_ControlBlockType* pWDICtx,
12797 WDI_EventInfoType* pEventData
12798)
12799{
12800 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
12801 wpt_uint8* pSendBuffer = NULL;
12802 wpt_uint16 usDataOffset = 0;
12803 wpt_uint16 usSendSize = 0;
12804 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12805
12806 /*-------------------------------------------------------------------------
12807 Sanity check
12808 -------------------------------------------------------------------------*/
12809 if (( NULL == pEventData ) ||
12810 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
12811 {
12812 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12813 "%s: Invalid parameters", __FUNCTION__);
12814 WDI_ASSERT(0);
12815 return WDI_STATUS_E_FAILURE;
12816 }
12817
12818 /*-----------------------------------------------------------------------
12819 Get message buffer
12820 ! TO DO : proper conversion into the HAL Message Request Format
12821 -----------------------------------------------------------------------*/
12822 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
12823 0,
12824 &pSendBuffer, &usDataOffset, &usSendSize))||
12825 ( usSendSize < (usDataOffset )))
12826 {
12827 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12828 "Unable to get send buffer in Wowl Exit req %x %x",
12829 pEventData, wdiWowlExitCb);
12830 WDI_ASSERT(0);
12831 return WDI_STATUS_E_FAILURE;
12832 }
12833
12834 /*-------------------------------------------------------------------------
12835 Send Get STA Request to HAL
12836 -------------------------------------------------------------------------*/
12837 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12838 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
12839}/*WDI_ProcessWowlExitReq*/
12840
12841/**
12842 @brief Process Configure Apps Cpu Wakeup State Request function
12843 (called when Main FSM allows it)
12844
12845 @param pWDICtx: pointer to the WLAN DAL context
12846 pEventData: pointer to the event information structure
12847
12848 @see
12849 @return Result of the function call
12850*/
12851WDI_Status
12852WDI_ProcessConfigureAppsCpuWakeupStateReq
12853(
12854 WDI_ControlBlockType* pWDICtx,
12855 WDI_EventInfoType* pEventData
12856)
12857{
12858 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
12859 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
12860 wpt_uint8* pSendBuffer = NULL;
12861 wpt_uint16 usDataOffset = 0;
12862 wpt_uint16 usSendSize = 0;
12863 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
12864 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12865
12866 /*-------------------------------------------------------------------------
12867 Sanity check
12868 -------------------------------------------------------------------------*/
12869 if (( NULL == pEventData ) ||
12870 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
12871 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
12872 {
12873 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12874 "%s: Invalid parameters", __FUNCTION__);
12875 WDI_ASSERT(0);
12876 return WDI_STATUS_E_FAILURE;
12877 }
12878
12879 /*-----------------------------------------------------------------------
12880 Get message buffer
12881 -----------------------------------------------------------------------*/
12882 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
12883 sizeof(halCfgAppsCpuWakeupStateReqParams),
12884 &pSendBuffer, &usDataOffset, &usSendSize))||
12885 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
12886 {
12887 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12888 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
12889 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
12890 WDI_ASSERT(0);
12891 return WDI_STATUS_E_FAILURE;
12892 }
12893
12894 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
12895 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
12896
12897 wpalMemoryCopy( pSendBuffer+usDataOffset,
12898 &halCfgAppsCpuWakeupStateReqParams,
12899 sizeof(halCfgAppsCpuWakeupStateReqParams));
12900
12901 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
12902 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
12903
12904 /*-------------------------------------------------------------------------
12905 Send Get STA Request to HAL
12906 -------------------------------------------------------------------------*/
12907 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12908 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
12909 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
12910}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
12911
12912#ifdef WLAN_FEATURE_VOWIFI_11R
12913/**
12914 @brief Process Aggregated Add TSpec Request function (called when Main FSM
12915 allows it)
12916
12917 @param pWDICtx: pointer to the WLAN DAL context
12918 pEventData: pointer to the event information structure
12919
12920 @see
12921 @return Result of the function call
12922*/
12923WDI_Status
12924WDI_ProcessAggrAddTSpecReq
12925(
12926 WDI_ControlBlockType* pWDICtx,
12927 WDI_EventInfoType* pEventData
12928)
12929{
12930 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
12931 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
12932 wpt_uint8 ucCurrentBSSSesIdx = 0;
12933 WDI_BSSSessionType* pBSSSes = NULL;
12934 wpt_uint8* pSendBuffer = NULL;
12935 wpt_uint16 usDataOffset = 0;
12936 wpt_uint16 usSendSize = 0;
12937 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
12938 wpt_macAddr macBSSID;
12939 tAggrAddTsReq halAggrAddTsReq;
12940 int i;
12941 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12942
12943 /*-------------------------------------------------------------------------
12944 Sanity check
12945 -------------------------------------------------------------------------*/
12946 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
12947 ( NULL == pEventData->pCBfnc ))
12948 {
12949 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12950 "%s: Invalid parameters", __FUNCTION__);
12951 WDI_ASSERT(0);
12952 return WDI_STATUS_E_FAILURE;
12953 }
12954 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
12955 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
12956 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
12957 /*-------------------------------------------------------------------------
12958 Check to see if we are in the middle of an association, if so queue, if
12959 not it means it is free to process request
12960 -------------------------------------------------------------------------*/
12961 wpalMutexAcquire(&pWDICtx->wptMutex);
12962
12963 /*------------------------------------------------------------------------
12964 Find the BSS for which the request is made and identify WDI session
12965 ------------------------------------------------------------------------*/
12966 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
12967 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
12968 &macBSSID))
12969 {
12970 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12971 "This station does not exist in the WDI Station Table %d");
12972 wpalMutexRelease(&pWDICtx->wptMutex);
12973 return WDI_STATUS_E_FAILURE;
12974 }
12975
12976 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
12977 if ( NULL == pBSSSes )
12978 {
12979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12980 "Association sequence for this BSS does not yet exist");
12981
12982 wpalMutexRelease(&pWDICtx->wptMutex);
12983 return WDI_STATUS_E_NOT_ALLOWED;
12984 }
12985
12986 /*------------------------------------------------------------------------
12987 Check if this BSS is being currently processed or queued,
12988 if queued - queue the new request as well
12989 ------------------------------------------------------------------------*/
12990 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
12991 {
12992 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12993 "Association sequence for this BSS exists but currently queued");
12994
12995 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
12996 wpalMutexRelease(&pWDICtx->wptMutex);
12997 return wdiStatus;
12998 }
12999
13000 wpalMutexRelease(&pWDICtx->wptMutex);
13001 /*-----------------------------------------------------------------------
13002 Get message buffer
13003 ! TO DO : proper conversion into the HAL Message Request Format
13004 -----------------------------------------------------------------------*/
13005 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
13006 sizeof(tAggrAddTsParams),
13007 &pSendBuffer, &usDataOffset, &usSendSize))||
13008 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13009 {
13010 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13011 "Unable to get send buffer in set bss key req %x %x %x",
13012 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13013 WDI_ASSERT(0);
13014 return WDI_STATUS_E_FAILURE;
13015 }
13016
13017 halAggrAddTsReq.aggrAddTsParam.staIdx =
13018 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
13019 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
13020 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13021
13022 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13023 {
13024 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
13025 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
13026 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
13027 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
13028 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
13029 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13030 ackPolicy;
13031 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
13032 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13033 accessPolicy;
13034 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
13035 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13036 userPrio;
13037 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
13038 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13039 psb;
13040 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
13041 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13042 aggregation;
13043 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
13044 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13045 direction;
13046 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
13047 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13048 trafficType;
13049 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
13050 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13051 trafficType;
13052 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
13053 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
13054 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
13055 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
13056
13057
13058 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
13059 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
13060 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
13061 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
13062 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
13063 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
13064 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
13065 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
13066 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
13067 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
13068 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
13069 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
13070 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
13071 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
13072 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
13073 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
13074 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
13075 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
13076 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
13077 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
13078 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
13079 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
13080 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
13081 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
13082 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
13083 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
13084 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
13085 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
13086 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
13087 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13088 }
13089
13090 wpalMemoryCopy( pSendBuffer+usDataOffset,
13091 &halAggrAddTsReq,
13092 sizeof(halAggrAddTsReq));
13093
13094 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
13095 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
13096
13097 /*-------------------------------------------------------------------------
13098 Send Add TS Request to HAL
13099 -------------------------------------------------------------------------*/
13100 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13101 wdiAggrAddTSRspCb, pEventData->pUserData,
13102 WDI_AGGR_ADD_TS_RESP);
13103}/*WDI_ProcessAggrAddTSpecReq*/
13104#endif /* WLAN_FEATURE_VOWIFI_11R */
13105
13106/**
13107 @brief Process Shutdown Request function (called when Main FSM
13108 allows it)
13109
13110 @param pWDICtx: pointer to the WLAN DAL context
13111 pEventData: pointer to the event information structure
13112
13113 @see
13114 @return Result of the function call
13115*/
13116WDI_Status
13117WDI_ProcessShutdownReq
13118(
13119 WDI_ControlBlockType* pWDICtx,
13120 WDI_EventInfoType* pEventData
13121 )
13122{
13123 wpt_status wptStatus;
13124
13125
13126 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13127
13128 /*-------------------------------------------------------------------------
13129 Sanity check
13130 -------------------------------------------------------------------------*/
13131 if ( NULL == pEventData )
13132 {
13133 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13134 "%s: Invalid parameters", __FUNCTION__);
13135 WDI_ASSERT(0);
13136 return WDI_STATUS_E_FAILURE;
13137 }
13138
13139 wpalMutexAcquire(&pWDICtx->wptMutex);
13140
13141
13142 gWDIInitialized = eWLAN_PAL_FALSE;
13143 /*! TO DO: stop the data services */
13144 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13145 {
13146 /*Stop the STA Table !UT- check this logic again
13147 It is safer to do it here than on the response - because a stop is imminent*/
13148 WDI_STATableStop(pWDICtx);
13149
13150 /* Stop Transport Driver, DXE */
13151 WDTS_Stop(pWDICtx);
13152 }
13153
13154 /*Clear all pending request*/
13155 WDI_ClearPendingRequests(pWDICtx);
13156 /* Close Data transport*/
13157 /* FTM mode does not open Data Path */
13158 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13159 {
13160 WDTS_Close(pWDICtx);
13161 }
13162 /*Close the STA Table !UT- check this logic again*/
13163 WDI_STATableClose(pWDICtx);
13164 /*close the PAL */
13165 wptStatus = wpalClose(pWDICtx->pPALContext);
13166 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13167 {
13168 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13169 "Failed to wpal Close %d", wptStatus);
13170 WDI_ASSERT(0);
13171 }
13172
13173 /*Transition back to init state*/
13174 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13175
13176 wpalMutexRelease(&pWDICtx->wptMutex);
13177
13178 /*Make sure the expected state is properly defaulted to Init*/
13179 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
13180
13181
13182 return WDI_STATUS_SUCCESS;
13183}/*WDI_ProcessShutdownReq*/
13184
13185/*========================================================================
13186 Main DAL Control Path Response Processing API
13187========================================================================*/
13188
13189/**
13190 @brief Process Start Response function (called when a response
13191 is being received over the bus from HAL)
13192
13193 @param pWDICtx: pointer to the WLAN DAL context
13194 pEventData: pointer to the event information structure
13195
13196 @see
13197 @return Result of the function call
13198*/
13199WDI_Status
13200WDI_ProcessStartRsp
13201(
13202 WDI_ControlBlockType* pWDICtx,
13203 WDI_EventInfoType* pEventData
13204)
13205{
13206 WDI_StartRspParamsType wdiRspParams;
13207 WDI_StartRspCb wdiStartRspCb = NULL;
13208
13209 tHalMacStartRspParams* startRspParams;
13210
13211#ifndef HAL_SELF_STA_PER_BSS
13212 WDI_AddStaParams wdiAddSTAParam = {0};
13213#endif
13214 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13215
13216 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
13217 /*-------------------------------------------------------------------------
13218 Sanity check
13219 -------------------------------------------------------------------------*/
13220 if (( NULL == pEventData ) ||
13221 ( NULL == pEventData->pEventData) ||
13222 ( NULL == wdiStartRspCb ))
13223 {
13224 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13225 "%s: Invalid parameters", __FUNCTION__);
13226 WDI_ASSERT(0);
13227 return WDI_STATUS_E_FAILURE;
13228 }
13229
13230 /*-------------------------------------------------------------------------
13231 Extract response and send it to UMAC
13232 -------------------------------------------------------------------------*/
13233 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13234 {
13235 // not enough data was received
13236 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13237 "Invalid response length in Start Resp Expect %x Rcvd %x",
13238 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13239 WDI_ASSERT(0);
13240 return WDI_STATUS_E_FAILURE;
13241 }
13242
13243 /*-------------------------------------------------------------------------
13244 Unpack HAL Response Message - the header was already extracted by the
13245 main Response Handling procedure
13246 -------------------------------------------------------------------------*/
13247 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13248
13249 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13250 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13251 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13252 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13253 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13254 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13255 wdiRspParams.wlanReportedVersion.major =
13256 startRspParams->wcnssWlanVersion.major;
13257 wdiRspParams.wlanReportedVersion.minor =
13258 startRspParams->wcnssWlanVersion.minor;
13259 wdiRspParams.wlanReportedVersion.version =
13260 startRspParams->wcnssWlanVersion.version;
13261 wdiRspParams.wlanReportedVersion.revision =
13262 startRspParams->wcnssWlanVersion.revision;
13263 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13264 startRspParams->wcnssCrmVersionString,
13265 sizeof(wdiRspParams.wcnssSoftwareVersion));
13266 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13267 startRspParams->wcnssWlanVersionString,
13268 sizeof(wdiRspParams.wcnssHardwareVersion));
13269 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13270
13271 wpalMutexAcquire(&pWDICtx->wptMutex);
13272 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13273 {
13274 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13275
13276 /*Cache the start response for further use*/
13277 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
13278 &wdiRspParams,
13279 sizeof(pWDICtx->wdiCachedStartRspParams));
13280
13281 }
13282 else
13283 {
13284 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13285 "Failed to start device with status %s(%d)",
13286 WDI_getHALStatusMsgString(startRspParams->status),
13287 startRspParams->status);
13288
13289 /*Set the expected state transition to stopped - because the start has
13290 failed*/
13291 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13292
13293 wpalMutexRelease(&pWDICtx->wptMutex);
13294
13295 /*Notify UMAC*/
13296 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13297
13298 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13299
13300 /*Although the response is an error - it was processed by our function
13301 so as far as the caller is concerned this is a succesful reponse processing*/
13302 return WDI_STATUS_SUCCESS;
13303 }
13304
13305 wpalMutexRelease(&pWDICtx->wptMutex);
13306
13307 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13308 {
13309 /* FTM mode does not need to execute below */
13310 /* Notify UMAC */
13311 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13312 return WDI_STATUS_SUCCESS;
13313 }
13314
13315 /* START the Data transport */
13316 WDTS_startTransport(pWDICtx);
13317
13318 /*Start the STA Table !- check this logic again*/
13319 WDI_STATableStart(pWDICtx);
13320
13321#ifndef HAL_SELF_STA_PER_BSS
13322 /* Store the Self STA Index */
13323 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13324
13325 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13326 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13327 WDI_MAC_ADDR_LEN);
13328
13329 /* At this point add the self-STA */
13330
13331 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13332 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13333 /*! TO DO: wdiAddSTAParam.dpuSig */
13334 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13335 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13336 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13337
13338 //all DPU indices are the same for self STA
13339 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13340 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13341 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13342 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13343 WDI_MAC_ADDR_LEN);
13344 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13345 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13346
13347 /* Note: Since we don't get an explicit config STA request for self STA, we
13348 add the self STA upon receiving the Start response message. But the
13349 self STA entry in the table is deleted when WDI gets an explicit delete STA
13350 request */
13351 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13352#endif
13353
13354 /*Notify UMAC*/
13355 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13356
13357 return WDI_STATUS_SUCCESS;
13358}/*WDI_ProcessStartRsp*/
13359
13360
13361/**
13362 @brief Process Stop Response function (called when a response
13363 is being received over the bus from HAL)
13364
13365 @param pWDICtx: pointer to the WLAN DAL context
13366 pEventData: pointer to the event information structure
13367
13368 @see
13369 @return Result of the function call
13370*/
13371WDI_Status
13372WDI_ProcessStopRsp
13373(
13374 WDI_ControlBlockType* pWDICtx,
13375 WDI_EventInfoType* pEventData
13376)
13377{
13378 WDI_Status wdiStatus;
13379 WDI_StopRspCb wdiStopRspCb = NULL;
13380
13381 tHalMacStopRspMsg halMacStopRspMsg;
13382 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13383
13384 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
13385 /*-------------------------------------------------------------------------
13386 Sanity check
13387 -------------------------------------------------------------------------*/
13388 if (( NULL == pEventData ) ||
13389 ( NULL == pEventData->pEventData) ||
13390 ( NULL == wdiStopRspCb ))
13391 {
13392 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13393 "%s: Invalid parameters", __FUNCTION__);
13394 WDI_ASSERT(0);
13395 return WDI_STATUS_E_FAILURE;
13396 }
13397
13398 /*-------------------------------------------------------------------------
13399 Extract response and send it to UMAC
13400 -------------------------------------------------------------------------*/
13401 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13402 {
13403 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13404 "Invalid response length in Stop Resp %x %x",
13405 pEventData->uEventDataSize);
13406 WDI_ASSERT(0);
13407 return WDI_STATUS_E_FAILURE;
13408 }
13409
13410 /*-------------------------------------------------------------------------
13411 Unpack HAL Response Message - the header was already extracted by the
13412 main Response Handling procedure
13413 -------------------------------------------------------------------------*/
13414 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13415 pEventData->pEventData,
13416 sizeof(halMacStopRspMsg.stopRspParams));
13417
13418 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
13419
13420 wpalMutexAcquire(&pWDICtx->wptMutex);
13421
13422 /*--------------------------------------------------------------------------
13423 Check to see if the stop went OK
13424 --------------------------------------------------------------------------*/
13425 if ( WDI_STATUS_SUCCESS != wdiStatus )
13426 {
13427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13428 "Failed to stop the device with status %s (%d)",
13429 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13430 halMacStopRspMsg.stopRspParams.status);
13431
13432 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13433
13434 wpalMutexRelease(&pWDICtx->wptMutex);
13435 return WDI_STATUS_E_FAILURE;
13436 }
13437
13438 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13439
13440 /*Transition now as WDI may get preempted imediately after it sends
13441 up the Stop Response and it will not get to process the state transition
13442 from Main Rsp function*/
13443 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13444 wpalMutexRelease(&pWDICtx->wptMutex);
13445
13446 /*! TO DO: - STOP the Data transport */
13447
13448 /*Notify UMAC*/
13449 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13450
13451 return WDI_STATUS_SUCCESS;
13452}/*WDI_ProcessStopRsp*/
13453
13454/**
13455 @brief Process Close Rsp function (called when a response
13456 is being received over the bus from HAL)
13457
13458 @param pWDICtx: pointer to the WLAN DAL context
13459 pEventData: pointer to the event information structure
13460
13461 @see
13462 @return Result of the function call
13463*/
13464WDI_Status
13465WDI_ProcessCloseRsp
13466(
13467 WDI_ControlBlockType* pWDICtx,
13468 WDI_EventInfoType* pEventData
13469)
13470{
13471 /*There is no close response comming from HAL - function just kept for
13472 simmetry */
13473 WDI_ASSERT(0);
13474 return WDI_STATUS_SUCCESS;
13475}/*WDI_ProcessCloseRsp*/
13476
13477
13478/*============================================================================
13479 SCAN RESPONSE PROCESSING API
13480============================================================================*/
13481
13482/**
13483 @brief Process Init Scan Rsp function (called when a response
13484 is being received over the bus from HAL)
13485
13486 @param pWDICtx: pointer to the WLAN DAL context
13487 pEventData: pointer to the event information structure
13488
13489 @see
13490 @return Result of the function call
13491*/
13492WDI_Status
13493WDI_ProcessInitScanRsp
13494(
13495 WDI_ControlBlockType* pWDICtx,
13496 WDI_EventInfoType* pEventData
13497)
13498{
13499 WDI_Status wdiStatus;
13500 WDI_InitScanRspCb wdiInitScanRspCb;
13501 tHalInitScanRspMsg halInitScanRspMsg;
13502 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13503
13504 /*-------------------------------------------------------------------------
13505 Sanity check
13506 -------------------------------------------------------------------------*/
13507 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13508 ( NULL == pEventData->pEventData))
13509 {
13510 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13511 "%s: Invalid parameters", __FUNCTION__);
13512 WDI_ASSERT(0);
13513 return WDI_STATUS_E_FAILURE;
13514 }
13515
13516 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13517 if( NULL == wdiInitScanRspCb)
13518 {
13519 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13520 "%s: call back function is NULL", __FUNCTION__);
13521 WDI_ASSERT(0);
13522 return WDI_STATUS_E_FAILURE;
13523 }
13524
13525 /*-------------------------------------------------------------------------
13526 Unpack HAL Response Message - the header was already extracted by the
13527 main Response Handling procedure
13528 -------------------------------------------------------------------------*/
13529 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13530 pEventData->pEventData,
13531 sizeof(halInitScanRspMsg.initScanRspParams));
13532
13533 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
13534
13535 if ( pWDICtx->bInBmps )
13536 {
13537 // notify DTS that we are entering Full power
13538 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13539 }
13540
13541 /*Notify UMAC*/
13542 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13543
13544 return WDI_STATUS_SUCCESS;
13545}/*WDI_ProcessInitScanRsp*/
13546
13547
13548/**
13549 @brief Process Start Scan Rsp function (called when a response
13550 is being received over the bus from HAL)
13551
13552 @param pWDICtx: pointer to the WLAN DAL context
13553 pEventData: pointer to the event information structure
13554
13555 @see
13556 @return Result of the function call
13557*/
13558WDI_Status
13559WDI_ProcessStartScanRsp
13560(
13561 WDI_ControlBlockType* pWDICtx,
13562 WDI_EventInfoType* pEventData
13563)
13564{
13565 WDI_StartScanRspParamsType wdiStartScanParams;
13566 WDI_StartScanRspCb wdiStartScanRspCb;
13567
13568 tHalStartScanRspMsg halStartScanRspMsg;
13569 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13570
13571 /*-------------------------------------------------------------------------
13572 Sanity check
13573 -------------------------------------------------------------------------*/
13574 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13575 ( NULL == pEventData->pEventData))
13576 {
13577 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13578 "%s: Invalid parameters", __FUNCTION__);
13579 WDI_ASSERT(0);
13580 return WDI_STATUS_E_FAILURE;
13581 }
13582
13583 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13584 if( NULL == wdiStartScanRspCb)
13585 {
13586 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13587 "%s: call back function is NULL", __FUNCTION__);
13588 WDI_ASSERT(0);
13589 return WDI_STATUS_E_FAILURE;
13590 }
13591
13592 /*-------------------------------------------------------------------------
13593 Extract response and send it to UMAC
13594 -------------------------------------------------------------------------*/
13595 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13596 pEventData->pEventData,
13597 sizeof(halStartScanRspMsg.startScanRspParams));
13598
13599 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13600 halStartScanRspMsg.startScanRspParams.status);
13601#ifdef WLAN_FEATURE_VOWIFI
13602 wdiStartScanParams.ucTxMgmtPower =
13603 halStartScanRspMsg.startScanRspParams.txMgmtPower;
13604 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
13605 halStartScanRspMsg.startScanRspParams.startTSF,
13606 2);
13607#endif
13608
13609 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13610 {
13611 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13612 "Start scan failed with status %s (%d)",
13613 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13614 halStartScanRspMsg.startScanRspParams.status);
13615 /* send the status to UMAC, don't return from here*/
13616 }
13617
13618 /*Notify UMAC*/
13619 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13620
13621 return WDI_STATUS_SUCCESS;
13622
13623}/*WDI_ProcessStartScanRsp*/
13624
13625
13626/**
13627 @brief Process End Scan Response function (called when a
13628 response is being received over the bus from HAL)
13629
13630 @param pWDICtx: pointer to the WLAN DAL context
13631 pEventData: pointer to the event information structure
13632
13633 @see
13634 @return Result of the function call
13635*/
13636WDI_Status
13637WDI_ProcessEndScanRsp
13638(
13639 WDI_ControlBlockType* pWDICtx,
13640 WDI_EventInfoType* pEventData
13641)
13642{
13643 WDI_Status wdiStatus;
13644 tHalEndScanRspMsg halEndScanRspMsg;
13645 WDI_EndScanRspCb wdiEndScanRspCb;
13646 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13647
13648 /*-------------------------------------------------------------------------
13649 Sanity check
13650 -------------------------------------------------------------------------*/
13651 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13652 ( NULL == pEventData->pEventData))
13653 {
13654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13655 "%s: Invalid parameters", __FUNCTION__);
13656 WDI_ASSERT(0);
13657 return WDI_STATUS_E_FAILURE;
13658 }
13659
13660 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
13661
13662 /*-------------------------------------------------------------------------
13663 Extract response and send it to UMAC
13664 -------------------------------------------------------------------------*/
13665 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
13666 pEventData->pEventData,
13667 sizeof(halEndScanRspMsg.endScanRspParams));
13668
13669 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
13670
13671 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
13672 {
13673 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13674 "End Scan failed with status %s (%d )",
13675 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
13676 halEndScanRspMsg.endScanRspParams.status);
13677 /* send the status to UMAC, don't return from here*/
13678 }
13679
13680 /*Notify UMAC*/
13681 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13682
13683 return WDI_STATUS_SUCCESS;
13684}/*WDI_ProcessEndScanRsp*/
13685
13686
13687/**
13688 @brief Process Finish Scan Response function (called when a
13689 response is being received over the bus from HAL)
13690
13691 @param pWDICtx: pointer to the WLAN DAL context
13692 pEventData: pointer to the event information structure
13693
13694 @see
13695 @return Result of the function call
13696*/
13697WDI_Status
13698WDI_ProcessFinishScanRsp
13699(
13700 WDI_ControlBlockType* pWDICtx,
13701 WDI_EventInfoType* pEventData
13702)
13703{
13704 WDI_Status wdiStatus;
13705 WDI_FinishScanRspCb wdiFinishScanRspCb;
13706
13707 tHalFinishScanRspMsg halFinishScanRspMsg;
13708 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13709
13710 /*-------------------------------------------------------------------------
13711 Sanity check
13712 -------------------------------------------------------------------------*/
13713 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13714 ( NULL == pEventData->pEventData))
13715 {
13716 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13717 "%s: Invalid parameters", __FUNCTION__);
13718 WDI_ASSERT(0);
13719 return WDI_STATUS_E_FAILURE;
13720 }
13721
13722 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
13723
13724 /*-------------------------------------------------------------------------
13725 Extract response and send it to UMAC
13726 -------------------------------------------------------------------------*/
13727 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
13728 pEventData->pEventData,
13729 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
13730
13731 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
13732
13733 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
13734 "Finish scan response reported status: %d",
13735 halFinishScanRspMsg.finishScanRspParams.status);
13736
13737 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
13738 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
13739 {
13740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13741 "Finish Scan failed with status %s (%d)",
13742 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
13743 halFinishScanRspMsg.finishScanRspParams.status);
13744 /* send the status to UMAC, don't return from here*/
13745 }
13746
13747 /*Notify UMAC*/
13748 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13749
13750 return WDI_STATUS_SUCCESS;
13751}/*WDI_ProcessFinishScanRsp*/
13752
13753/**
13754 @brief Process Join Response function (called when a response
13755 is being received over the bus from HAL)
13756
13757 @param pWDICtx: pointer to the WLAN DAL context
13758 pEventData: pointer to the event information structure
13759
13760 @see
13761 @return Result of the function call
13762*/
13763WDI_Status
13764WDI_ProcessJoinRsp
13765(
13766 WDI_ControlBlockType* pWDICtx,
13767 WDI_EventInfoType* pEventData
13768)
13769{
13770 WDI_Status wdiStatus;
13771 WDI_JoinRspCb wdiJoinRspCb;
13772 WDI_BSSSessionType* pBSSSes = NULL;
13773
13774 tHalJoinRspMsg halJoinRspMsg;
13775 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13776
13777 /*-------------------------------------------------------------------------
13778 Sanity check
13779 -------------------------------------------------------------------------*/
13780 if (( NULL == pWDICtx ) ||
13781 ( NULL == pWDICtx->pfncRspCB ) ||
13782 ( NULL == pEventData ) ||
13783 ( NULL == pEventData->pEventData))
13784 {
13785 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13786 "%s: Invalid parameters", __FUNCTION__);
13787 WDI_ASSERT(0);
13788 return WDI_STATUS_E_FAILURE;
13789 }
13790
13791 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
13792
13793 /*-------------------------------------------------------------------------
13794 Extract response and send it to UMAC
13795 -------------------------------------------------------------------------*/
13796 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
13797 pEventData->pEventData,
13798 sizeof(halJoinRspMsg.joinRspParams));
13799
13800 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
13801
13802 wpalMutexAcquire(&pWDICtx->wptMutex);
13803
13804 /*-----------------------------------------------------------------------
13805 Join response can only be received for an existing assoc that
13806 is current and in progress
13807 -----------------------------------------------------------------------*/
13808 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
13809 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
13810 {
13811 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13812 "Association sequence for this BSS does not yet exist or "
13813 "association no longer in progress - mysterious HAL response");
13814
13815 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13816 wpalMutexRelease(&pWDICtx->wptMutex);
13817 return WDI_STATUS_E_NOT_ALLOWED;
13818 }
13819
13820 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
13821
13822 /*-----------------------------------------------------------------------
13823 Join Response is only allowed in init state
13824 -----------------------------------------------------------------------*/
13825 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
13826 {
13827 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13828 "Join only allowed in Joining state - failure state is %d "
13829 "strange HAL response", pBSSSes->wdiAssocState);
13830
13831 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13832
13833 wpalMutexRelease(&pWDICtx->wptMutex);
13834 return WDI_STATUS_E_NOT_ALLOWED;
13835 }
13836
13837
13838 /*-----------------------------------------------------------------------
13839 If assoc has failed the current session will be deleted
13840 -----------------------------------------------------------------------*/
13841 if ( WDI_STATUS_SUCCESS != wdiStatus )
13842 {
13843 /*Association was failed by HAL - remove session*/
13844 WDI_DeleteSession(pWDICtx, pBSSSes);
13845
13846 /*Association no longer in progress */
13847 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
13848
13849 /*Association no longer in progress - prepare pending assoc for processing*/
13850 WDI_DequeueAssocRequest(pWDICtx);
13851
13852 }
13853 else
13854 {
13855 /*Transition to state Joining - this may be redundant as we are supposed
13856 to be in this state already - but just to be safe*/
13857 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
13858 }
13859
13860 wpalMutexRelease(&pWDICtx->wptMutex);
13861
13862 /*Notify UMAC*/
13863 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13864
13865 return WDI_STATUS_SUCCESS;
13866}/*WDI_ProcessJoinRsp*/
13867
13868
13869/**
13870 @brief Process Config BSS Response function (called when a
13871 response is being received over the bus from HAL)
13872
13873 @param pWDICtx: pointer to the WLAN DAL context
13874 pEventData: pointer to the event information structure
13875
13876 @see
13877 @return Result of the function call
13878*/
13879WDI_Status
13880WDI_ProcessConfigBSSRsp
13881(
13882 WDI_ControlBlockType* pWDICtx,
13883 WDI_EventInfoType* pEventData
13884)
13885{
13886 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
13887 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
13888 wpt_uint8 ucCurrentBSSSesIdx = 0;
13889 WDI_BSSSessionType* pBSSSes = NULL;
13890
13891 tConfigBssRspMsg halConfigBssRspMsg;
13892 WDI_AddStaParams wdiBcastAddSTAParam = {0};
13893 WDI_AddStaParams wdiAddSTAParam = {0};
13894
13895 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13896
13897 /*-------------------------------------------------------------------------
13898 Sanity check
13899 -------------------------------------------------------------------------*/
13900 if (( NULL == pEventData ) ||
13901 ( NULL == pEventData->pEventData))
13902 {
13903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13904 "%s: Invalid parameters", __FUNCTION__);
13905 WDI_ASSERT(0);
13906 return WDI_STATUS_E_FAILURE;
13907 }
13908
13909 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
13910
13911 /*-------------------------------------------------------------------------
13912 Extract response and send it to UMAC
13913 -------------------------------------------------------------------------*/
13914 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
13915 pEventData->pEventData,
13916 sizeof(halConfigBssRspMsg.configBssRspParams));
13917
13918 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13919 halConfigBssRspMsg.configBssRspParams.status);
13920 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
13921 {
13922 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
13923 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
13924 WDI_MAC_ADDR_LEN);
13925
13926 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
13927
13928 wdiConfigBSSParams.ucBcastSig =
13929 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
13930
13931 wdiConfigBSSParams.ucUcastSig =
13932 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
13933
13934 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
13935
13936 #ifdef WLAN_FEATURE_VOWIFI
13937 wdiConfigBSSParams.ucTxMgmtPower =
13938 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
13939 #endif
13940 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
13941 halConfigBssRspMsg.configBssRspParams.staMac,
13942 WDI_MAC_ADDR_LEN );
13943
13944 wpalMutexAcquire(&pWDICtx->wptMutex);
13945 /*------------------------------------------------------------------------
13946 Find the BSS for which the request is made
13947 ------------------------------------------------------------------------*/
13948 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
13949 wdiConfigBSSParams.macBSSID,
13950 &pBSSSes);
13951
13952 /*-----------------------------------------------------------------------
13953 Config BSS response can only be received for an existing assoc that
13954 is current and in progress
13955 -----------------------------------------------------------------------*/
13956 if ( NULL == pBSSSes )
13957 {
13958 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13959 "Association sequence for this BSS does not yet exist "
13960 "- mysterious HAL response");
13961
13962 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13963
13964 wpalMutexRelease(&pWDICtx->wptMutex);
13965 return WDI_STATUS_E_NOT_ALLOWED;
13966 }
13967
13968 /*Save data for this BSS*/
13969 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
13970 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
13971 pBSSSes->bcastDpuIndex =
13972 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
13973 pBSSSes->bcastDpuSignature =
13974 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
13975 pBSSSes->bcastMgmtDpuIndex =
13976 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
13977 pBSSSes->bcastMgmtDpuSignature =
13978 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
13979 pBSSSes->ucRmfEnabled =
13980 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
13981 pBSSSes->bcastStaIdx =
13982 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
13983
13984 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
13985
13986 /*-------------------------------------------------------------------------
13987 Add Peer STA
13988 -------------------------------------------------------------------------*/
13989 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
13990 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
13991 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
13992
13993 /*This info can be retrieved from the cached initial request*/
13994 wdiAddSTAParam.ucWmmEnabled =
13995 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
13996 wdiAddSTAParam.ucHTCapable =
13997 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
13998 wdiAddSTAParam.ucStaType =
13999 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14000
14001 /* MAC Address of STA */
14002 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14003 halConfigBssRspMsg.configBssRspParams.staMac,
14004 WDI_MAC_ADDR_LEN);
14005
14006 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14007 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14008 WDI_MAC_ADDR_LEN);
14009
14010 /*Add BSS specific parameters*/
14011 wdiAddSTAParam.bcastMgmtDpuIndex =
14012 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
14013 wdiAddSTAParam.bcastMgmtDpuSignature =
14014 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
14015 wdiAddSTAParam.bcastDpuIndex =
14016 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
14017 wdiAddSTAParam.bcastDpuSignature =
14018 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
14019 wdiAddSTAParam.ucRmfEnabled =
14020 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14021 wdiAddSTAParam.ucBSSIdx =
14022 halConfigBssRspMsg.configBssRspParams.bssIdx;
14023
14024 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14025 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
14026
14027 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14028 /*-------------------------------------------------------------------------
14029 Add Broadcast STA only in AP mode
14030 -------------------------------------------------------------------------*/
14031 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
14032 WDI_BSS_OPERATIONAL_MODE_AP )
14033 {
14034 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14035 "Add BCAST STA to table for index: %d",
14036 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14037
14038 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
14039 sizeof(WDI_AddStaParams) );
14040
14041 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14042 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14043 }
14044 wpalMutexRelease(&pWDICtx->wptMutex);
14045 }
14046 else
14047 {
14048 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14049 "Config BSS RSP failed with status : %s(%d)",
14050 WDI_getHALStatusMsgString(
14051 halConfigBssRspMsg.configBssRspParams.status),
14052 halConfigBssRspMsg.configBssRspParams.status);
14053
14054
14055 /*Association was failed by HAL - remove session*/
14056 WDI_DeleteSession(pWDICtx, pBSSSes);
14057
14058 /*Association no longer in progress */
14059 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14060
14061 /*Association no longer in progress - prepare pending assoc for processing*/
14062 WDI_DequeueAssocRequest(pWDICtx);
14063
14064 }
14065
14066 /*Notify UMAC*/
14067 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14068
14069 return WDI_STATUS_SUCCESS;
14070}/*WDI_ProcessConfigBSSRsp*/
14071
14072
14073/**
14074 @brief Process Del BSS Response function (called when a response
14075 is being received over the bus from HAL)
14076
14077 @param pWDICtx: pointer to the WLAN DAL context
14078 pEventData: pointer to the event information structure
14079
14080 @see
14081 @return Result of the function call
14082*/
14083WDI_Status
14084WDI_ProcessDelBSSRsp
14085(
14086 WDI_ControlBlockType* pWDICtx,
14087 WDI_EventInfoType* pEventData
14088)
14089{
14090 WDI_DelBSSRspParamsType wdiDelBSSParams;
14091 WDI_DelBSSRspCb wdiDelBSSRspCb;
14092 wpt_uint8 ucCurrentBSSSesIdx = 0;
14093 WDI_BSSSessionType* pBSSSes = NULL;
14094
14095 tDeleteBssRspMsg halDelBssRspMsg;
14096 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14097
14098 /*-------------------------------------------------------------------------
14099 Sanity check
14100 -------------------------------------------------------------------------*/
14101 if (( NULL == pEventData ) ||
14102 ( NULL == pEventData->pEventData))
14103 {
14104 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14105 "%s: Invalid parameters", __FUNCTION__);
14106 WDI_ASSERT(0);
14107 return WDI_STATUS_E_FAILURE;
14108 }
14109
14110 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14111
14112 /*-------------------------------------------------------------------------
14113 Extract response and send it to UMAC
14114 -------------------------------------------------------------------------*/
14115 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14116 pEventData->pEventData,
14117 sizeof(halDelBssRspMsg.deleteBssRspParams));
14118
14119
14120 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14121 halDelBssRspMsg.deleteBssRspParams.status);
14122
14123 wpalMutexAcquire(&pWDICtx->wptMutex);
14124
14125 /*------------------------------------------------------------------------
14126 Find the BSS for which the request is made
14127 ------------------------------------------------------------------------*/
14128 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14129 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14130 &pBSSSes);
14131
14132 /*-----------------------------------------------------------------------
14133 Del BSS response can only be received for an existing assoc that
14134 is current and in progress
14135 -----------------------------------------------------------------------*/
14136 if ( NULL == pBSSSes )
14137 {
14138 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14139 "Association sequence for this BSS does not yet exist or "
14140 "association no longer in progress - mysterious HAL response");
14141
14142 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14143
14144 wpalMutexRelease(&pWDICtx->wptMutex);
14145 return WDI_STATUS_E_NOT_ALLOWED;
14146 }
14147
14148 /*Extract BSSID for the response to UMAC*/
14149 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
14150 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14151
14152 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14153
14154 /*-----------------------------------------------------------------------
14155 The current session will be deleted
14156 -----------------------------------------------------------------------*/
14157 WDI_DeleteSession(pWDICtx, pBSSSes);
14158
14159 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14160 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14161 {
14162 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14163 }
14164
14165 /* Delete the STA's in this BSS */
14166 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
14167
14168 wpalMutexRelease(&pWDICtx->wptMutex);
14169
14170 /*Notify UMAC*/
14171 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14172
14173 return WDI_STATUS_SUCCESS;
14174}/*WDI_ProcessDelBSSRsp*/
14175
14176/**
14177 @brief Process Post Assoc Rsp function (called when a response
14178 is being received over the bus from HAL)
14179
14180 @param pWDICtx: pointer to the WLAN DAL context
14181 pEventData: pointer to the event information structure
14182
14183 @see
14184 @return Result of the function call
14185*/
14186WDI_Status
14187WDI_ProcessPostAssocRsp
14188(
14189 WDI_ControlBlockType* pWDICtx,
14190 WDI_EventInfoType* pEventData
14191)
14192{
14193 WDI_PostAssocRspParamsType wdiPostAssocParams;
14194 WDI_PostAssocRspCb wdiPostAssocRspCb;
14195 wpt_uint8 ucCurrentBSSSesIdx = 0;
14196 WDI_BSSSessionType* pBSSSes = NULL;
14197 tPostAssocRspMsg halPostAssocRspMsg;
14198 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14199
14200 /*-------------------------------------------------------------------------
14201 Sanity check
14202 -------------------------------------------------------------------------*/
14203 if (( NULL == pEventData ) ||
14204 ( NULL == pEventData->pEventData))
14205 {
14206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14207 "%s: Invalid parameters", __FUNCTION__);
14208 WDI_ASSERT(0);
14209 return WDI_STATUS_E_FAILURE;
14210 }
14211
14212 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14213
14214 /*-------------------------------------------------------------------------
14215 Extract response and send it to UMAC
14216 -------------------------------------------------------------------------*/
14217 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14218 pEventData->pEventData,
14219 sizeof(halPostAssocRspMsg.postAssocRspParams));
14220
14221 /*Extract the Post Assoc STA Params */
14222
14223 wdiPostAssocParams.staParams.ucSTAIdx =
14224 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
14225 wdiPostAssocParams.staParams.ucUcastSig =
14226 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14227 wdiPostAssocParams.staParams.ucBcastSig =
14228 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14229
14230 wdiPostAssocParams.wdiStatus =
14231 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
14232
14233 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14234 included in the response */
14235 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14236 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
14237 WDI_MAC_ADDR_LEN);
14238
14239 /* Extract Post Assoc BSS Params */
14240
14241 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14242 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14243 WDI_MAC_ADDR_LEN);
14244
14245 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14246 included in the response */
14247 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
14248 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14249 .macSTA, WDI_MAC_ADDR_LEN);
14250
14251 wdiPostAssocParams.bssParams.ucBcastSig =
14252 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14253
14254 wdiPostAssocParams.bssParams.ucUcastSig =
14255 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14256
14257 wdiPostAssocParams.bssParams.ucBSSIdx =
14258 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14259
14260 wdiPostAssocParams.bssParams.ucSTAIdx =
14261 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14262
14263 wpalMutexAcquire(&pWDICtx->wptMutex);
14264
14265 /*------------------------------------------------------------------------
14266 Find the BSS for which the request is made
14267 ------------------------------------------------------------------------*/
14268 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14269 wdiPostAssocParams.bssParams.
14270 macBSSID, &pBSSSes);
14271
14272 /*-----------------------------------------------------------------------
14273 Post assoc response can only be received for an existing assoc that
14274 is current and in progress
14275 -----------------------------------------------------------------------*/
14276 if (( NULL == pBSSSes ) ||
14277 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
14278 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14279 {
14280 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14281 "Association sequence for this BSS does not yet exist or "
14282 "association no longer in progress - mysterious HAL response");
14283
14284 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14285
14286 wpalMutexRelease(&pWDICtx->wptMutex);
14287 return WDI_STATUS_E_NOT_ALLOWED;
14288 }
14289
14290 /*-----------------------------------------------------------------------
14291 Post Assoc Request is only allowed in Joining state
14292 -----------------------------------------------------------------------*/
14293 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14294 {
14295 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14296 "Post Assoc not allowed before JOIN - failing request "
14297 "strange HAL response");
14298
14299 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14300
14301 wpalMutexRelease(&pWDICtx->wptMutex);
14302 return WDI_STATUS_E_NOT_ALLOWED;
14303 }
14304
14305 /*-----------------------------------------------------------------------
14306 If assoc has failed the current session will be deleted
14307 -----------------------------------------------------------------------*/
14308 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14309 {
14310 /*Association was failed by HAL - remove session*/
14311 WDI_DeleteSession(pWDICtx, pBSSSes);
14312 }
14313 else
14314 {
14315 /*Transition to state POST Assoc*/
14316 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
14317
14318 /*Save DPU Info*/
14319 pBSSSes->bcastMgmtDpuIndex =
14320 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
14321 pBSSSes->bcastMgmtDpuSignature =
14322 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
14323 pBSSSes->bcastDpuIndex =
14324 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
14325 pBSSSes->bcastDpuSignature =
14326 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14327
14328 pBSSSes->ucBSSIdx =
14329 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14330 }
14331
14332 /*Association no longer in progress */
14333 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14334
14335 /*Association no longer in progress - prepare pending assoc for processing*/
14336 WDI_DequeueAssocRequest(pWDICtx);
14337
14338 wpalMutexRelease(&pWDICtx->wptMutex);
14339
14340 /*Notify UMAC*/
14341 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14342
14343 return WDI_STATUS_SUCCESS;
14344}/*WDI_ProcessPostAssocRsp*/
14345
14346/**
14347 @brief Process Del STA Rsp function (called when a response is
14348 being received over the bus from HAL)
14349
14350 @param pWDICtx: pointer to the WLAN DAL context
14351 pEventData: pointer to the event information structure
14352
14353 @see
14354 @return Result of the function call
14355*/
14356WDI_Status
14357WDI_ProcessDelSTARsp
14358(
14359 WDI_ControlBlockType* pWDICtx,
14360 WDI_EventInfoType* pEventData
14361)
14362{
14363 WDI_DelSTARspParamsType wdiDelSTARsp;
14364 WDI_DelSTARspCb wdiDelSTARspCb;
14365 wpt_uint8 staType;
14366 tDeleteStaRspMsg halDelStaRspMsg;
14367 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14368
14369 /*-------------------------------------------------------------------------
14370 Sanity check
14371 -------------------------------------------------------------------------*/
14372 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14373 ( NULL == pEventData->pEventData))
14374 {
14375 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14376 "%s: Invalid parameters", __FUNCTION__);
14377 WDI_ASSERT(0);
14378 return WDI_STATUS_E_FAILURE;
14379 }
14380
14381 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14382
14383 /*-------------------------------------------------------------------------
14384 Extract response and send it to UMAC
14385 -------------------------------------------------------------------------*/
14386 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
14387 pEventData->pEventData,
14388 sizeof(halDelStaRspMsg.delStaRspParams));
14389
14390 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
14391 wdiDelSTARsp.wdiStatus =
14392 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
14393
14394 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14395
14396 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14397 if(staType == WDI_STA_ENTRY_SELF)
14398 {
14399 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14400
14401 /* At this point add the self-STA */
14402
14403 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14404 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14405 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14406
14407#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14408#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14409
14410 //all DPU indices are the same for self STA
14411 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14412 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14413 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14414 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14415 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14416 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
14417 }
14418 else
14419 {
14420 //Delete the station in the table
14421 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14422 }
14423
14424 /*Notify UMAC*/
14425 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14426
14427 return WDI_STATUS_SUCCESS;
14428}/*WDI_ProcessDelSTARsp*/
14429
14430
14431/*==========================================================================
14432 Security Response Processing Functions
14433==========================================================================*/
14434
14435/**
14436 @brief Process Set BSS Key Rsp function (called when a response
14437 is being received over the bus from HAL)
14438
14439 @param pWDICtx: pointer to the WLAN DAL context
14440 pEventData: pointer to the event information structure
14441
14442 @see
14443 @return Result of the function call
14444*/
14445WDI_Status
14446WDI_ProcessSetBssKeyRsp
14447(
14448 WDI_ControlBlockType* pWDICtx,
14449 WDI_EventInfoType* pEventData
14450)
14451{
14452 WDI_Status wdiStatus;
14453 eHalStatus halStatus;
14454 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14455 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14456
14457 /*-------------------------------------------------------------------------
14458 Sanity check
14459 -------------------------------------------------------------------------*/
14460 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14461 ( NULL == pEventData->pEventData))
14462 {
14463 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14464 "%s: Invalid parameters", __FUNCTION__);
14465 WDI_ASSERT(0);
14466 return WDI_STATUS_E_FAILURE;
14467 }
14468
14469 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14470
14471 /*-------------------------------------------------------------------------
14472 Extract response and send it to UMAC
14473 -------------------------------------------------------------------------*/
14474 halStatus = *((eHalStatus*)pEventData->pEventData);
14475 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14476
14477 if ( eHAL_STATUS_SUCCESS != halStatus )
14478 {
14479 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14480 "Set BSS Key failed with status %s (%d)",
14481 WDI_getHALStatusMsgString(halStatus),
14482 halStatus);
14483 /* send the status to UMAC, don't return from here*/
14484 }
14485
14486 /*Notify UMAC*/
14487 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14488
14489 return WDI_STATUS_SUCCESS;
14490}/*WDI_ProcessSetBssKeyRsp*/
14491
14492/**
14493 @brief Process Remove BSS Key Rsp function (called when a response
14494 is being received over the bus from HAL)
14495
14496 @param pWDICtx: pointer to the WLAN DAL context
14497 pEventData: pointer to the event information structure
14498
14499 @see
14500 @return Result of the function call
14501*/
14502WDI_Status
14503WDI_ProcessRemoveBssKeyRsp
14504(
14505 WDI_ControlBlockType* pWDICtx,
14506 WDI_EventInfoType* pEventData
14507)
14508{
14509 WDI_Status wdiStatus;
14510 eHalStatus halStatus;
14511 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14512 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14513
14514 /*-------------------------------------------------------------------------
14515 Sanity check
14516 -------------------------------------------------------------------------*/
14517 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14518 ( NULL == pEventData->pEventData))
14519 {
14520 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14521 "%s: Invalid parameters", __FUNCTION__);
14522 WDI_ASSERT(0);
14523 return WDI_STATUS_E_FAILURE;
14524 }
14525
14526 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14527
14528 /*-------------------------------------------------------------------------
14529 Extract response and send it to UMAC
14530 -------------------------------------------------------------------------*/
14531 halStatus = *((eHalStatus*)pEventData->pEventData);
14532 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14533
14534 if ( eHAL_STATUS_SUCCESS != halStatus )
14535 {
14536 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14537 "Remove BSS Key failed with status %s (%d )",
14538 WDI_getHALStatusMsgString(halStatus),
14539 halStatus);
14540 /* send the status to UMAC, don't return from here*/
14541 }
14542
14543 /*Notify UMAC*/
14544 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14545
14546 return WDI_STATUS_SUCCESS;
14547}/*WDI_ProcessSetBssKeyRsp*/
14548
14549
14550/**
14551 @brief Process Set STA Key Rsp function (called when a response
14552 is being received over the bus from HAL)
14553
14554 @param pWDICtx: pointer to the WLAN DAL context
14555 pEventData: pointer to the event information structure
14556
14557 @see
14558 @return Result of the function call
14559*/
14560WDI_Status
14561WDI_ProcessSetStaKeyRsp
14562(
14563 WDI_ControlBlockType* pWDICtx,
14564 WDI_EventInfoType* pEventData
14565)
14566{
14567 WDI_Status wdiStatus;
14568 eHalStatus halStatus;
14569 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14570 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14571
14572 /*-------------------------------------------------------------------------
14573 Sanity check
14574 -------------------------------------------------------------------------*/
14575 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14576 ( NULL == pEventData->pEventData))
14577 {
14578 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14579 "%s: Invalid parameters", __FUNCTION__);
14580 WDI_ASSERT(0);
14581 return WDI_STATUS_E_FAILURE;
14582 }
14583
14584 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14585
14586 /*-------------------------------------------------------------------------
14587 Extract response and send it to UMAC
14588 -------------------------------------------------------------------------*/
14589 halStatus = *((eHalStatus*)pEventData->pEventData);
14590 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14591
14592 if ( eHAL_STATUS_SUCCESS != halStatus )
14593 {
14594 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14595 "Set STA Key failed with status %s (%d)",
14596 WDI_getHALStatusMsgString(halStatus),
14597 halStatus);
14598 /* send the status to UMAC, don't return from here*/
14599 }
14600
14601 /*Notify UMAC*/
14602 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14603
14604 return WDI_STATUS_SUCCESS;
14605}/*WDI_ProcessSetSTAKeyRsp*/
14606
14607/**
14608 @brief Process Remove STA Key Rsp function (called when a
14609 response is being received over the bus from HAL)
14610
14611 @param pWDICtx: pointer to the WLAN DAL context
14612 pEventData: pointer to the event information structure
14613
14614 @see
14615 @return Result of the function call
14616*/
14617WDI_Status
14618WDI_ProcessRemoveStaKeyRsp
14619(
14620 WDI_ControlBlockType* pWDICtx,
14621 WDI_EventInfoType* pEventData
14622)
14623{
14624 WDI_Status wdiStatus;
14625 eHalStatus halStatus;
14626 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14627 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14628
14629 /*-------------------------------------------------------------------------
14630 Sanity check
14631 -------------------------------------------------------------------------*/
14632 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14633 ( NULL == pEventData->pEventData))
14634 {
14635 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14636 "%s: Invalid parameters", __FUNCTION__);
14637 WDI_ASSERT(0);
14638 return WDI_STATUS_E_FAILURE;
14639 }
14640
14641 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14642
14643 /*-------------------------------------------------------------------------
14644 Extract response and send it to UMAC
14645 -------------------------------------------------------------------------*/
14646 halStatus = *((eHalStatus*)pEventData->pEventData);
14647 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14648
14649 if ( eHAL_STATUS_SUCCESS != halStatus )
14650 {
14651 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14652 "Remove STA Key failed with status %s (%d)",
14653 WDI_getHALStatusMsgString(halStatus),
14654 halStatus);
14655 /* send the status to UMAC, don't return from here*/
14656 }
14657
14658 /*Notify UMAC*/
14659 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14660
14661 return WDI_STATUS_SUCCESS;
14662}/*WDI_ProcessRemoveStaKeyRsp*/
14663
14664/**
14665 @brief Process Set STA Bcast Key Rsp function (called when a
14666 response is being received over the bus from HAL)
14667
14668 @param pWDICtx: pointer to the WLAN DAL context
14669 pEventData: pointer to the event information structure
14670
14671 @see
14672 @return Result of the function call
14673*/
14674WDI_Status
14675WDI_ProcessSetStaBcastKeyRsp
14676(
14677 WDI_ControlBlockType* pWDICtx,
14678 WDI_EventInfoType* pEventData
14679)
14680{
14681 WDI_Status wdiStatus;
14682 eHalStatus halStatus;
14683 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
14684 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14685
14686 /*-------------------------------------------------------------------------
14687 Sanity check
14688 -------------------------------------------------------------------------*/
14689 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14690 ( NULL == pEventData->pEventData))
14691 {
14692 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14693 "%s: Invalid parameters", __FUNCTION__);
14694 WDI_ASSERT(0);
14695 return WDI_STATUS_E_FAILURE;
14696 }
14697
14698 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14699
14700 /*-------------------------------------------------------------------------
14701 Extract response and send it to UMAC
14702 -------------------------------------------------------------------------*/
14703 wpalMemoryCopy( &halStatus,
14704 pEventData->pEventData,
14705 sizeof(halStatus));
14706
14707 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14708
14709 if ( eHAL_STATUS_SUCCESS != halStatus )
14710 {
14711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14712 "Set STA Key failed with status %s (%d)",
14713 WDI_getHALStatusMsgString(halStatus),
14714 halStatus);
14715 /* send the status to UMAC, don't return from here*/
14716 }
14717
14718 /*Notify UMAC*/
14719 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14720
14721 return WDI_STATUS_SUCCESS;
14722}/*WDI_ProcessSetSTABcastKeyRsp*/
14723
14724/**
14725 @brief Process Remove STA Bcast Key Rsp function (called when a
14726 response is being received over the bus from HAL)
14727
14728 @param pWDICtx: pointer to the WLAN DAL context
14729 pEventData: pointer to the event information structure
14730
14731 @see
14732 @return Result of the function call
14733*/
14734WDI_Status
14735WDI_ProcessRemoveStaBcastKeyRsp
14736(
14737 WDI_ControlBlockType* pWDICtx,
14738 WDI_EventInfoType* pEventData
14739)
14740{
14741 WDI_Status wdiStatus;
14742 eHalStatus halStatus;
14743 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
14744 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14745
14746 /*-------------------------------------------------------------------------
14747 Sanity check
14748 -------------------------------------------------------------------------*/
14749 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14750 ( NULL == pEventData->pEventData))
14751 {
14752 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14753 "%s: Invalid parameters", __FUNCTION__);
14754 WDI_ASSERT(0);
14755 return WDI_STATUS_E_FAILURE;
14756 }
14757
14758 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14759
14760 /*-------------------------------------------------------------------------
14761 Extract response and send it to UMAC
14762 -------------------------------------------------------------------------*/
14763 wpalMemoryCopy( &halStatus,
14764 pEventData->pEventData,
14765 sizeof(halStatus));
14766
14767 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14768
14769 if ( eHAL_STATUS_SUCCESS != halStatus )
14770 {
14771 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14772 "Remove STA Key failed with status %s (%d)",
14773 WDI_getHALStatusMsgString(halStatus),
14774 halStatus);
14775 /* send the status to UMAC, don't return from here*/
14776 }
14777
14778 /*Notify UMAC*/
14779 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14780
14781 return WDI_STATUS_SUCCESS;
14782}/*WDI_ProcessRemoveStaBcastKeyRsp*/
14783
14784
14785/*==========================================================================
14786 QoS and BA Response Processing Functions
14787==========================================================================*/
14788
14789/**
14790 @brief Process Add TSpec Rsp function (called when a response
14791 is being received over the bus from HAL)
14792
14793 @param pWDICtx: pointer to the WLAN DAL context
14794 pEventData: pointer to the event information structure
14795
14796 @see
14797 @return Result of the function call
14798*/
14799WDI_Status
14800WDI_ProcessAddTSpecRsp
14801(
14802 WDI_ControlBlockType* pWDICtx,
14803 WDI_EventInfoType* pEventData
14804)
14805{
14806 WDI_Status wdiStatus;
14807 eHalStatus halStatus;
14808 WDI_AddTsRspCb wdiAddTsRspCb;
14809 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14810
14811 /*-------------------------------------------------------------------------
14812 Sanity check
14813 -------------------------------------------------------------------------*/
14814 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14815 ( NULL == pEventData->pEventData))
14816 {
14817 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14818 "%s: Invalid parameters", __FUNCTION__);
14819 WDI_ASSERT(0);
14820 return WDI_STATUS_E_FAILURE;
14821 }
14822
14823 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
14824
14825 /*-------------------------------------------------------------------------
14826 Extract response and send it to UMAC
14827 -------------------------------------------------------------------------*/
14828 halStatus = *((eHalStatus*)pEventData->pEventData);
14829 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14830
14831 /*Notify UMAC*/
14832 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14833
14834 return WDI_STATUS_SUCCESS;
14835}/*WDI_ProcessAddTSpecRsp*/
14836
14837
14838/**
14839 @brief Process Del TSpec Rsp function (called when a response
14840 is being received over the bus from HAL)
14841
14842 @param pWDICtx: pointer to the WLAN DAL context
14843 pEventData: pointer to the event information structure
14844
14845 @see
14846 @return Result of the function call
14847*/
14848WDI_Status
14849WDI_ProcessDelTSpecRsp
14850(
14851 WDI_ControlBlockType* pWDICtx,
14852 WDI_EventInfoType* pEventData
14853)
14854{
14855 WDI_Status wdiStatus;
14856 eHalStatus halStatus;
14857 WDI_DelTsRspCb wdiDelTsRspCb;
14858 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14859
14860 /*-------------------------------------------------------------------------
14861 Sanity check
14862 -------------------------------------------------------------------------*/
14863 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14864 ( NULL == pEventData->pEventData))
14865 {
14866 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14867 "%s: Invalid parameters", __FUNCTION__);
14868 WDI_ASSERT(0);
14869 return WDI_STATUS_E_FAILURE;
14870 }
14871
14872 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
14873
14874 /*-------------------------------------------------------------------------
14875 Extract response and send it to UMAC
14876 -------------------------------------------------------------------------*/
14877 halStatus = *((eHalStatus*)pEventData->pEventData);
14878 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14879
14880 /*Notify UMAC*/
14881 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14882
14883 return WDI_STATUS_SUCCESS;
14884}/*WDI_ProcessDelTSpecRsp*/
14885
14886/**
14887 @brief Process Update EDCA Parameters Rsp function (called when a
14888 response is being received over the bus from HAL)
14889
14890 @param pWDICtx: pointer to the WLAN DAL context
14891 pEventData: pointer to the event information structure
14892
14893 @see
14894 @return Result of the function call
14895*/
14896WDI_Status
14897WDI_ProcessUpdateEDCAParamsRsp
14898(
14899 WDI_ControlBlockType* pWDICtx,
14900 WDI_EventInfoType* pEventData
14901)
14902{
14903 WDI_Status wdiStatus;
14904 eHalStatus halStatus;
14905 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
14906 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14907
14908 /*-------------------------------------------------------------------------
14909 Sanity check
14910 -------------------------------------------------------------------------*/
14911 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14912 ( NULL == pEventData->pEventData))
14913 {
14914 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14915 "%s: Invalid parameters", __FUNCTION__);
14916 WDI_ASSERT(0);
14917 return WDI_STATUS_E_FAILURE;
14918 }
14919
14920 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
14921
14922 /*-------------------------------------------------------------------------
14923 Extract response and send it to UMAC
14924 -------------------------------------------------------------------------*/
14925 halStatus = *((eHalStatus*)pEventData->pEventData);
14926 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14927
14928 /*Notify UMAC*/
14929 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14930
14931 return WDI_STATUS_SUCCESS;
14932}/*WDI_ProcessUpdateEDCAParamsRsp*/
14933
14934
14935/**
14936 @brief Process Add BA Rsp function (called when a response
14937 is being received over the bus from HAL)
14938
14939 @param pWDICtx: pointer to the WLAN DAL context
14940 pEventData: pointer to the event information structure
14941
14942 @see
14943 @return Result of the function call
14944*/
14945WDI_Status
14946WDI_ProcessAddBASessionRsp
14947(
14948 WDI_ControlBlockType* pWDICtx,
14949 WDI_EventInfoType* pEventData
14950)
14951{
14952 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
14953
14954 tAddBASessionRspParams halBASessionRsp;
14955 WDI_AddBASessionRspParamsType wdiBASessionRsp;
14956
14957
14958 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14959
14960 /*-------------------------------------------------------------------------
14961 Sanity check
14962 -------------------------------------------------------------------------*/
14963 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14964 ( NULL == pEventData->pEventData))
14965 {
14966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14967 "%s: Invalid parameters", __FUNCTION__);
14968 WDI_ASSERT(0);
14969 return WDI_STATUS_E_FAILURE;
14970 }
14971
14972 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
14973
14974 /*-------------------------------------------------------------------------
14975 Extract response and send it to UMAC
14976 -------------------------------------------------------------------------*/
14977 wpalMemoryCopy( &halBASessionRsp,
14978 pEventData->pEventData,
14979 sizeof(halBASessionRsp));
14980
14981 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
14982
14983 if ( eHAL_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
14984 {
14985 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
14986 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
14987 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
14988 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
14989 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
14990 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
14991 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
14992 }
14993
14994 /*Notify UMAC*/
14995 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
14996
14997 return WDI_STATUS_SUCCESS;
14998}/*WDI_ProcessAddSessionBARsp*/
14999
15000
15001/**
15002 @brief Process Del BA Rsp function (called when a response
15003 is being received over the bus from HAL)
15004
15005 @param pWDICtx: pointer to the WLAN DAL context
15006 pEventData: pointer to the event information structure
15007
15008 @see
15009 @return Result of the function call
15010*/
15011WDI_Status
15012WDI_ProcessDelBARsp
15013(
15014 WDI_ControlBlockType* pWDICtx,
15015 WDI_EventInfoType* pEventData
15016)
15017{
15018 WDI_Status wdiStatus;
15019 eHalStatus halStatus;
15020 WDI_DelBARspCb wdiDelBARspCb;
15021 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15022
15023 /*-------------------------------------------------------------------------
15024 Sanity check
15025 -------------------------------------------------------------------------*/
15026 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15027 ( NULL == pEventData->pEventData))
15028 {
15029 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15030 "%s: Invalid parameters", __FUNCTION__);
15031 WDI_ASSERT(0);
15032 return WDI_STATUS_E_FAILURE;
15033 }
15034
15035 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15036
15037 /*-------------------------------------------------------------------------
15038 Extract response and send it to UMAC
15039 -------------------------------------------------------------------------*/
15040 halStatus = *((eHalStatus*)pEventData->pEventData);
15041 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15042
15043 if ( eHAL_STATUS_SUCCESS == halStatus )
15044 {
15045 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15046 }
15047
15048 /*Notify UMAC*/
15049 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15050
15051 return WDI_STATUS_SUCCESS;
15052}/*WDI_ProcessDelBARsp*/
15053
15054#ifdef FEATURE_WLAN_CCX
15055/**
15056 @brief Process TSM Stats Rsp function (called when a response
15057 is being received over the bus from HAL)
15058
15059 @param pWDICtx: pointer to the WLAN DAL context
15060 pEventData: pointer to the event information structure
15061
15062 @see
15063 @return Result of the function call
15064*/
15065WDI_Status
15066WDI_ProcessTsmStatsRsp
15067(
15068 WDI_ControlBlockType* pWDICtx,
15069 WDI_EventInfoType* pEventData
15070)
15071{
15072 WDI_TsmRspCb wdiTsmStatsRspCb;
15073 tTsmStatsRspMsg halTsmStatsRspMsg;
15074 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15075 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15076
15077 /*-------------------------------------------------------------------------
15078 Sanity check
15079 -------------------------------------------------------------------------*/
15080 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15081 ( NULL == pEventData->pEventData))
15082 {
15083 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15084 "%s: Invalid parameters", __FUNCTION__);
15085 WDI_ASSERT(0);
15086 return WDI_STATUS_E_FAILURE;
15087 }
15088
15089 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15090
15091 /*-------------------------------------------------------------------------
15092 Unpack HAL Response Message - the header was already extracted by the
15093 main Response Handling procedure
15094 -------------------------------------------------------------------------*/
15095 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15096 pEventData->pEventData,
15097 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15098
15099 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15100 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15101 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15102 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15103 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15104 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15105 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15106 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15107 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15108 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15109 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15110 halTsmStatsRspMsg.tsmStatsRspParams.status);
15111
15112 /*Notify UMAC*/
15113 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15114
15115 return WDI_STATUS_SUCCESS;
15116}/*WDI_ProcessTsmStatsRsp*/
15117
15118#endif
15119
15120
15121
15122/**
15123 @brief Process Flush AC Rsp function (called when a response
15124 is being received over the bus from HAL)
15125
15126 @param pWDICtx: pointer to the WLAN DAL context
15127 pEventData: pointer to the event information structure
15128
15129 @see
15130 @return Result of the function call
15131*/
15132WDI_Status
15133WDI_ProcessFlushAcRsp
15134(
15135 WDI_ControlBlockType* pWDICtx,
15136 WDI_EventInfoType* pEventData
15137)
15138{
15139 WDI_Status wdiStatus;
15140 eHalStatus halStatus;
15141 WDI_FlushAcRspCb wdiFlushAcRspCb;
15142 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15143
15144 /*-------------------------------------------------------------------------
15145 Sanity check
15146 -------------------------------------------------------------------------*/
15147 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15148 ( NULL == pEventData->pEventData))
15149 {
15150 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15151 "%s: Invalid parameters", __FUNCTION__);
15152 WDI_ASSERT(0);
15153 return WDI_STATUS_E_FAILURE;
15154 }
15155
15156 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15157
15158 /*-------------------------------------------------------------------------
15159 Extract response and send it to UMAC
15160 -------------------------------------------------------------------------*/
15161 wpalMemoryCopy( &halStatus,
15162 pEventData->pEventData,
15163 sizeof(halStatus));
15164
15165 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15166
15167 /*Notify UMAC*/
15168 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15169
15170 return WDI_STATUS_SUCCESS;
15171}/*WDI_ProcessFlushAcRsp*/
15172
15173/**
15174 @brief Process BT AMP event Rsp function (called when a
15175 response is being received over the bus from HAL)
15176
15177 @param pWDICtx: pointer to the WLAN DAL context
15178 pEventData: pointer to the event information structure
15179
15180 @see
15181 @return Result of the function call
15182*/
15183WDI_Status
15184WDI_ProcessBtAmpEventRsp
15185(
15186 WDI_ControlBlockType* pWDICtx,
15187 WDI_EventInfoType* pEventData
15188)
15189{
15190 WDI_Status wdiStatus;
15191 eHalStatus halStatus;
15192 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15193 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15194
15195 /*-------------------------------------------------------------------------
15196 Sanity check
15197 -------------------------------------------------------------------------*/
15198 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15199 ( NULL == pEventData->pEventData))
15200 {
15201 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15202 "%s: Invalid parameters", __FUNCTION__);
15203 WDI_ASSERT(0);
15204 return WDI_STATUS_E_FAILURE;
15205 }
15206
15207 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15208
15209 /*-------------------------------------------------------------------------
15210 Extract response and send it to UMAC
15211 -------------------------------------------------------------------------*/
15212 wpalMemoryCopy( &halStatus,
15213 pEventData->pEventData,
15214 sizeof(halStatus));
15215
15216 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15217
15218 /*Notify UMAC*/
15219 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15220
15221 return WDI_STATUS_SUCCESS;
15222}/*WDI_ProcessBtAmpEventRsp*/
15223
15224
15225/**
15226 @brief Process ADD STA SELF Rsp function (called
15227 when a response is being received over the bus from HAL)
15228
15229 @param pWDICtx: pointer to the WLAN DAL context
15230 pEventData: pointer to the event information structure
15231
15232 @see
15233 @return Result of the function call
15234*/
15235WDI_Status
15236WDI_ProcessAddSTASelfRsp
15237(
15238 WDI_ControlBlockType* pWDICtx,
15239 WDI_EventInfoType* pEventData
15240)
15241{
15242 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15243 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15244 tAddStaSelfRspMsg halAddStaSelfRsp;
15245 WDI_AddStaParams wdiAddSTAParam = {0};
15246 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15247
15248 /*-------------------------------------------------------------------------
15249 Sanity check
15250 -------------------------------------------------------------------------*/
15251 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15252 ( NULL == pEventData->pEventData))
15253 {
15254 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15255 "%s: Invalid parameters", __FUNCTION__);
15256 WDI_ASSERT(0);
15257 return WDI_STATUS_E_FAILURE;
15258 }
15259
15260 wdiAddSTASelfReqParamsRspCb =
15261 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15262
15263 /*-------------------------------------------------------------------------
15264 Extract response and send it to UMAC
15265 -------------------------------------------------------------------------*/
15266 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15267 pEventData->pEventData,
15268 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15269
15270
15271 wdiAddSTASelfParams.wdiStatus =
15272 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
15273
15274 wdiAddSTASelfParams.ucSTASelfIdx =
15275 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
15276 wdiAddSTASelfParams.dpuIdx =
15277 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
15278 wdiAddSTASelfParams.dpuSignature =
15279 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15280
15281 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15282 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15283 WDI_MAC_ADDR_LEN);
15284
15285
15286#ifdef HAL_SELF_STA_PER_BSS
15287
15288 /* At this point add the self-STA */
15289
15290 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15291 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15292 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15293
15294 //all DPU indices are the same for self STA
15295
15296 /*DPU Information*/
15297 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
15298 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15299 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15300 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15301 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15302 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15303
15304 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15305 WDI_MAC_ADDR_LEN);
15306
15307 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15308 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15309
15310 if(halAddStaSelfRsp.addStaSelfRspParams.status
15311 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15312 {
15313 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15314 }
15315#endif
15316
15317 /*Notify UMAC*/
15318 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15319
15320 return WDI_STATUS_SUCCESS;
15321}/*WDI_ProcessAddSTASelfRsp*/
15322
15323
15324
15325/**
15326 @brief WDI_ProcessDelSTASelfRsp function (called when a
15327 response is being received over the bus from HAL)
15328
15329 @param pWDICtx: pointer to the WLAN DAL context
15330 pEventData: pointer to the event information structure
15331
15332 @see
15333 @return Result of the function call
15334*/
15335WDI_Status
15336WDI_ProcessDelSTASelfRsp
15337(
15338 WDI_ControlBlockType* pWDICtx,
15339 WDI_EventInfoType* pEventData
15340)
15341{
15342 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15343 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15344 tDelStaSelfRspParams delStaSelfRspParams;
15345 wpt_uint8 ucStaIdx;
15346
15347 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15348
15349 /*-------------------------------------------------------------------------
15350 Sanity check
15351 -------------------------------------------------------------------------*/
15352 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15353 ( NULL == pEventData->pEventData))
15354 {
15355 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15356 "%s: Invalid parameters", __FUNCTION__);
15357 WDI_ASSERT(0);
15358 return WDI_STATUS_E_FAILURE;
15359 }
15360
15361 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15362
15363 /*-------------------------------------------------------------------------
15364 Extract response and send it to UMAC
15365 -------------------------------------------------------------------------*/
15366
15367 wpalMemoryCopy( &delStaSelfRspParams,
15368 (wpt_uint8*)pEventData->pEventData,
15369 sizeof(tDelStaSelfRspParams));
15370
15371 wdiDelStaSelfRspParams.wdiStatus =
15372 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
15373
15374 /* delStaSelfRspParams.status is not
15375 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15376 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15377 {
15378 WDI_Status wdiStatus;
15379 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
15380 delStaSelfRspParams.selfMacAddr,
15381 &ucStaIdx);
15382 if(WDI_STATUS_E_FAILURE == wdiStatus)
15383 {
15384 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15385 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15386 WDI_ASSERT(0);
15387 return WDI_STATUS_E_FAILURE;
15388 }
15389 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15390 }
15391
15392 /*Notify UMAC*/
15393 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15394
15395 return WDI_STATUS_SUCCESS;
15396}
15397
15398
15399
15400/*===========================================================================
15401 Miscellaneous Control Response Processing API
15402===========================================================================*/
15403
15404/**
15405 @brief Process Channel Switch Rsp function (called when a response
15406 is being received over the bus from HAL)
15407
15408 @param pWDICtx: pointer to the WLAN DAL context
15409 pEventData: pointer to the event information structure
15410
15411 @see
15412 @return Result of the function call
15413*/
15414WDI_Status
15415WDI_ProcessChannelSwitchRsp
15416(
15417 WDI_ControlBlockType* pWDICtx,
15418 WDI_EventInfoType* pEventData
15419)
15420{
15421 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15422 WDI_SwitchChRspCb wdiChSwitchRspCb;
15423 tSwitchChannelRspParams halSwitchChannelRsp;
15424 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15425
15426 /*-------------------------------------------------------------------------
15427 Sanity check
15428 -------------------------------------------------------------------------*/
15429 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15430 ( NULL == pEventData->pEventData))
15431 {
15432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15433 "%s: Invalid parameters", __FUNCTION__);
15434 WDI_ASSERT(0);
15435 return WDI_STATUS_E_FAILURE;
15436 }
15437
15438 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15439
15440 /*-------------------------------------------------------------------------
15441 Extract response and send it to UMAC
15442 -------------------------------------------------------------------------*/
15443 wpalMemoryCopy( &halSwitchChannelRsp,
15444 (wpt_uint8*)pEventData->pEventData,
15445 sizeof(halSwitchChannelRsp));
15446
15447 wdiSwitchChRsp.wdiStatus =
15448 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
15449 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15450
15451#ifdef WLAN_FEATURE_VOWIFI
15452 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
15453#endif
15454
15455 /*Notify UMAC*/
15456 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15457
15458 return WDI_STATUS_SUCCESS;
15459}/*WDI_ProcessChannelSwitchRsp*/
15460
15461
15462/**
15463 @brief Process Config STA Rsp function (called when a response
15464 is being received over the bus from HAL)
15465
15466 @param pWDICtx: pointer to the WLAN DAL context
15467 pEventData: pointer to the event information structure
15468
15469 @see
15470 @return Result of the function call
15471*/
15472WDI_Status
15473WDI_ProcessConfigStaRsp
15474(
15475 WDI_ControlBlockType* pWDICtx,
15476 WDI_EventInfoType* pEventData
15477)
15478{
15479 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15480 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15481 WDI_AddStaParams wdiAddSTAParam;
15482
15483 WDI_BSSSessionType* pBSSSes = NULL;
15484 wpt_uint8 ucCurrentBSSSesIdx = 0;
15485
15486 tConfigStaRspMsg halConfigStaRsp;
15487 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15488
15489 /*-------------------------------------------------------------------------
15490 Sanity check
15491 -------------------------------------------------------------------------*/
15492 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15493 ( NULL == pEventData->pEventData))
15494 {
15495 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15496 "%s: Invalid parameters", __FUNCTION__);
15497 WDI_ASSERT(0);
15498 return WDI_STATUS_E_FAILURE;
15499 }
15500
15501 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15502
15503 /*-------------------------------------------------------------------------
15504 Extract response and send it to UMAC
15505 -------------------------------------------------------------------------*/
15506 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15507 pEventData->pEventData,
15508 sizeof(halConfigStaRsp.configStaRspParams));
15509
15510
15511 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15512 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15513 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15514 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15515 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15516
15517 /* MAC Address of STA - take from cache as it does not come back in the
15518 response*/
15519 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
15520 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
15521 WDI_MAC_ADDR_LEN);
15522
15523 wdiCfgSTAParams.wdiStatus =
15524 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
15525
15526 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15527 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15528 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15529
15530 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15531 {
15532 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15533 {
15534 /* ADD STA to table */
15535 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15536 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15537 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15538
15539 /*This info can be retrieved from the cached initial request*/
15540 wdiAddSTAParam.ucWmmEnabled =
15541 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
15542 wdiAddSTAParam.ucHTCapable =
15543 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15544 wdiAddSTAParam.ucStaType =
15545 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15546
15547 /* MAC Address of STA */
15548 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15549 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
15550 WDI_MAC_ADDR_LEN);
15551
15552 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15553 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15554 WDI_MAC_ADDR_LEN);
15555
15556 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15557 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15558 &pBSSSes);
15559
15560 if ( NULL == pBSSSes )
15561 {
15562 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15563 "Association for this BSSID is not in place");
15564
15565 WDI_ASSERT(0);
15566 return WDI_STATUS_E_NOT_ALLOWED;
15567 }
15568
15569 /*Add BSS specific parameters*/
15570 wdiAddSTAParam.bcastMgmtDpuIndex =
15571 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15572 wdiAddSTAParam.bcastMgmtDpuSignature =
15573 halConfigStaRsp.configStaRspParams.ucMgmtSig;
15574 wdiAddSTAParam.bcastDpuIndex =
15575 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15576 wdiAddSTAParam.bcastDpuSignature =
15577 halConfigStaRsp.configStaRspParams.ucBcastSig;
15578 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15579 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
15580
15581 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15582 }
15583 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15584 {
15585 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
15586
15587 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
15588 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15589 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
15590 halConfigStaRsp.configStaRspParams.ucBcastSig;
15591 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
15592 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15593 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
15594 halConfigStaRsp.configStaRspParams.ucMgmtSig;
15595 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
15596 halConfigStaRsp.configStaRspParams.bssIdx;
15597 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
15598 halConfigStaRsp.configStaRspParams.dpuIndex;
15599 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
15600 halConfigStaRsp.configStaRspParams.ucUcastSig;
15601 }
15602 }
15603
15604 /*Notify UMAC*/
15605 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
15606
15607 return WDI_STATUS_SUCCESS;
15608}/*WDI_ProcessConfigStaRsp*/
15609
15610
15611/**
15612 @brief Process Set Link State Rsp function (called when a
15613 response is being received over the bus from HAL)
15614
15615 @param pWDICtx: pointer to the WLAN DAL context
15616 pEventData: pointer to the event information structure
15617
15618 @see
15619 @return Result of the function call
15620*/
15621WDI_Status
15622WDI_ProcessSetLinkStateRsp
15623(
15624 WDI_ControlBlockType* pWDICtx,
15625 WDI_EventInfoType* pEventData
15626)
15627{
15628 WDI_Status wdiStatus;
15629 eHalStatus halStatus;
15630 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
15631
15632 WDI_BSSSessionType* pBSSSes = NULL;
15633 wpt_uint8 ucCurrentBSSSesIdx = 0;
15634 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15635
15636 /*-------------------------------------------------------------------------
15637 Sanity check
15638 -------------------------------------------------------------------------*/
15639 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15640 ( NULL == pEventData->pEventData))
15641 {
15642 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15643 "%s: Invalid parameters", __FUNCTION__);
15644 WDI_ASSERT(0);
15645 return WDI_STATUS_E_FAILURE;
15646 }
15647
15648 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
15649
15650 wpalMutexAcquire(&pWDICtx->wptMutex);
15651
15652 /*If the link is being transitioned to idle - the BSS is to be deleted
15653 - this type of ending a session is possible when UMAC has failed an
15654 - association session during Join*/
15655 if ( WDI_LINK_IDLE_STATE ==
15656 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15657 {
15658 /*------------------------------------------------------------------------
15659 Find the BSS for which the request is made
15660 ------------------------------------------------------------------------*/
15661 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15662 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
15663 &pBSSSes);
15664
15665 /*-----------------------------------------------------------------------
15666 Del BSS response can only be received for an existing assoc that
15667 is current and in progress
15668 -----------------------------------------------------------------------*/
15669 if ( NULL == pBSSSes )
15670 {
15671 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
15672 "Set link response received outside association session");
15673 }
15674 else
15675 {
15676 /* For BT AMP roles no need to delete the sessions if assoc fails. There
15677 will be del BSS coming after this to stop the beaconing & cleaning up the
15678 sessions*/
15679 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
15680 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
15681 {
15682 /*-----------------------------------------------------------------------
15683 The current session will be deleted
15684 -----------------------------------------------------------------------*/
15685 WDI_DeleteSession(pWDICtx, pBSSSes);
15686
15687 /*-----------------------------------------------------------------------
15688 Check to see if this association is in progress - if so disable the
15689 flag as this has ended
15690 -----------------------------------------------------------------------*/
15691 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
15692 {
15693 /*Association no longer in progress */
15694 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
15695 /*Association no longer in progress - prepare pending assoc for processing*/
15696 WDI_DequeueAssocRequest(pWDICtx);
15697 }
15698 }
15699 }
15700 }
15701 /* If the link state has been set to POST ASSOC, reset the "association in
15702 progress" flag */
15703 if ( WDI_LINK_POSTASSOC_STATE ==
15704 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15705 {
15706 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
15707 WDI_DequeueAssocRequest(pWDICtx);
15708 }
15709
15710 wpalMutexRelease(&pWDICtx->wptMutex);
15711
15712 /*-------------------------------------------------------------------------
15713 Extract response and send it to UMAC
15714 -------------------------------------------------------------------------*/
15715 wpalMemoryCopy( &halStatus,
15716 pEventData->pEventData,
15717 sizeof(halStatus));
15718
15719 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15720
15721 /*Notify UMAC*/
15722 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15723
15724 return WDI_STATUS_SUCCESS;
15725}/*WDI_ProcessSetLinkStateRsp*/
15726
15727/**
15728 @brief Process Get Stats Rsp function (called when a response is
15729 being received over the bus from HAL)
15730
15731 @param pWDICtx: pointer to the WLAN DAL context
15732 pEventData: pointer to the event information structure
15733
15734 @see
15735 @return Result of the function call
15736*/
15737WDI_Status
15738WDI_ProcessGetStatsRsp
15739(
15740 WDI_ControlBlockType* pWDICtx,
15741 WDI_EventInfoType* pEventData
15742)
15743{
15744 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
15745 WDI_GetStatsRspCb wdiGetStatsRspCb;
15746 tHalStatsRspParams* pHalStatsRspParams;
15747
15748 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15749
15750 /*-------------------------------------------------------------------------
15751 Sanity check
15752 -------------------------------------------------------------------------*/
15753 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15754 ( NULL == pEventData->pEventData))
15755 {
15756 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15757 "%s: Invalid parameters", __FUNCTION__);
15758 WDI_ASSERT(0);
15759 return WDI_STATUS_E_FAILURE;
15760 }
15761
15762 /*-------------------------------------------------------------------------
15763 Extract response and send it to UMAC
15764 -------------------------------------------------------------------------*/
15765 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
15766
15767 /*allocate the stats response buffer */
15768 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
15769 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
15770 + sizeof(WDI_GetStatsRspParamsType));
15771
15772 if(NULL == wdiGetStatsRsp)
15773 {
15774 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15775 "Failed to allocate memory in Get Stats Response %x %x %x ",
15776 pWDICtx, pEventData, pEventData->pEventData);
15777 WDI_ASSERT(0);
15778 return WDI_STATUS_E_FAILURE;
15779 }
15780
15781 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
15782
15783 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
15784 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
15785 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
15786 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
15787 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
15788 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
15789
15790 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
15791 wpalMemoryCopy(wdiGetStatsRsp + 1,
15792 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
15793 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
15794
15795 /*Notify UMAC*/
15796 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
15797
15798 wpalMemoryFree(wdiGetStatsRsp);
15799
15800 return WDI_STATUS_SUCCESS;
15801}/*WDI_ProcessGetStatsRsp*/
15802
15803
15804/**
15805 @brief Process Update Cfg Rsp function (called when a response is
15806 being received over the bus from HAL)
15807
15808 @param pWDICtx: pointer to the WLAN DAL context
15809 pEventData: pointer to the event information structure
15810
15811 @see
15812 @return Result of the function call
15813*/
15814WDI_Status
15815WDI_ProcessUpdateCfgRsp
15816(
15817 WDI_ControlBlockType* pWDICtx,
15818 WDI_EventInfoType* pEventData
15819)
15820{
15821 WDI_Status wdiStatus;
15822 eHalStatus halStatus;
15823 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
15824 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15825
15826 /*-------------------------------------------------------------------------
15827 Sanity check
15828 -------------------------------------------------------------------------*/
15829 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15830 ( NULL == pEventData->pEventData))
15831 {
15832 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15833 "%s: Invalid parameters", __FUNCTION__);
15834 WDI_ASSERT(0);
15835 return WDI_STATUS_E_FAILURE;
15836 }
15837
15838 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
15839
15840 /*-------------------------------------------------------------------------
15841 Extract response and send it to UMAC
15842 -------------------------------------------------------------------------*/
15843 halStatus = *((eHalStatus*)pEventData->pEventData);
15844 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15845
15846 /*Notify UMAC*/
15847 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15848
15849 return WDI_STATUS_SUCCESS;
15850}/*WDI_ProcessUpdateCfgRsp*/
15851
15852
15853
15854/**
15855 @brief Process Add BA Rsp function (called when a response
15856 is being received over the bus from HAL)
15857
15858 @param pWDICtx: pointer to the WLAN DAL context
15859 pEventData: pointer to the event information structure
15860
15861 @see
15862 @return Result of the function call
15863*/
15864WDI_Status
15865WDI_ProcessAddBARsp
15866(
15867 WDI_ControlBlockType* pWDICtx,
15868 WDI_EventInfoType* pEventData
15869)
15870{
15871 WDI_AddBARspCb wdiAddBARspCb;
15872
15873 tAddBARspParams halAddBARsp;
15874 WDI_AddBARspinfoType wdiAddBARsp;
15875
15876 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15877
15878 /*-------------------------------------------------------------------------
15879 Sanity check
15880 -------------------------------------------------------------------------*/
15881 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15882 ( NULL == pEventData->pEventData))
15883 {
15884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15885 "%s: Invalid parameters", __FUNCTION__);
15886 WDI_ASSERT(0);
15887 return WDI_STATUS_E_FAILURE;
15888 }
15889
15890 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
15891
15892 /*-------------------------------------------------------------------------
15893 Extract response and send it to UMAC
15894 -------------------------------------------------------------------------*/
15895 wpalMemoryCopy( &halAddBARsp,
15896 pEventData->pEventData,
15897 sizeof(halAddBARsp));
15898
15899 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
15900
15901 if ( eHAL_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
15902 {
15903 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
15904 }
15905
15906 /*Notify UMAC*/
15907 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
15908
15909 return WDI_STATUS_SUCCESS;
15910}/*WDI_ProcessAddSessionBARsp*/
15911
15912/**
15913 @brief Process Add BA Rsp function (called when a response
15914 is being received over the bus from HAL)
15915
15916 @param pWDICtx: pointer to the WLAN DAL context
15917 pEventData: pointer to the event information structure
15918
15919 @see
15920 @return Result of the function call
15921*/
15922WDI_Status
15923WDI_ProcessTriggerBARsp
15924(
15925 WDI_ControlBlockType* pWDICtx,
15926 WDI_EventInfoType* pEventData
15927)
15928{
15929 WDI_TriggerBARspCb wdiTriggerBARspCb;
15930
15931 tTriggerBARspParams* halTriggerBARsp;
15932 tTriggerBaRspCandidate* halBaCandidate;
15933 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
15934 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
15935 wpt_uint16 index;
15936 wpt_uint16 TidIndex;
15937
15938 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15939
15940 /*-------------------------------------------------------------------------
15941 Sanity check
15942 -------------------------------------------------------------------------*/
15943 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15944 ( NULL == pEventData->pEventData))
15945 {
15946 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15947 "%s: Invalid parameters", __FUNCTION__);
15948 WDI_ASSERT(0);
15949 return WDI_STATUS_E_FAILURE;
15950 }
15951
15952 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
15953
15954 /*-------------------------------------------------------------------------
15955 Extract response and send it to UMAC
15956 -------------------------------------------------------------------------*/
15957 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
15958
15959 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
15960 halTriggerBARsp->baCandidateCnt *
15961 sizeof(WDI_TriggerBARspCandidateType));
15962 if(NULL == wdiTriggerBARsp)
15963 {
15964 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15965 "Failed to allocate memory in Trigger BA Response %x %x %x ",
15966 pWDICtx, pEventData, pEventData->pEventData);
15967 wpalMemoryFree(halTriggerBARsp);
15968 WDI_ASSERT(0);
15969 return WDI_STATUS_E_FAILURE;
15970 }
15971
15972 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
15973
15974 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
15975 {
15976 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
15977 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
15978 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
15979
15980 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
15981 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
15982
15983 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
15984 {
15985 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
15986 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
15987 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
15988 {
15989 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
15990 halBaCandidate->baInfo[TidIndex].fBaEnable;
15991 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
15992 halBaCandidate->baInfo[TidIndex].startingSeqNum;
15993 }
15994 wdiTriggerBARspCandidate++;
15995 halBaCandidate++;
15996 }
15997 }
15998
15999 /*Notify UMAC*/
16000 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16001
16002 wpalMemoryFree(wdiTriggerBARsp);
16003 return WDI_STATUS_SUCCESS;
16004}/*WDI_ProcessAddSessionBARsp*/
16005
16006/**
16007 @brief Process Update Beacon Params Rsp function (called when a response
16008 is being received over the bus from HAL)
16009
16010 @param pWDICtx: pointer to the WLAN DAL context
16011 pEventData: pointer to the event information structure
16012
16013 @see
16014 @return Result of the function call
16015*/
16016WDI_Status
16017WDI_ProcessUpdateBeaconParamsRsp
16018(
16019 WDI_ControlBlockType* pWDICtx,
16020 WDI_EventInfoType* pEventData
16021)
16022{
16023 WDI_Status wdiStatus;
16024 eHalStatus halStatus;
16025 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16026 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16027
16028 /*-------------------------------------------------------------------------
16029 Sanity check
16030 -------------------------------------------------------------------------*/
16031 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16032 ( NULL == pEventData->pEventData))
16033 {
16034 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16035 "%s: Invalid parameters", __FUNCTION__);
16036 WDI_ASSERT(0);
16037 return WDI_STATUS_E_FAILURE;
16038 }
16039
16040 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16041
16042 /*-------------------------------------------------------------------------
16043 Extract response and send it to UMAC
16044 -------------------------------------------------------------------------*/
16045 wpalMemoryCopy( &halStatus,
16046 pEventData->pEventData,
16047 sizeof(halStatus));
16048
16049 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16050
16051 /*Notify UMAC*/
16052 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16053
16054 return WDI_STATUS_SUCCESS;
16055}/*WDI_ProcessUpdateBeaconParamsRsp*/
16056
16057/**
16058 @brief Process Send Beacon template Rsp function (called when a response
16059 is being received over the bus from HAL)
16060
16061 @param pWDICtx: pointer to the WLAN DAL context
16062 pEventData: pointer to the event information structure
16063
16064 @see
16065 @return Result of the function call
16066*/
16067WDI_Status
16068WDI_ProcessSendBeaconParamsRsp
16069(
16070 WDI_ControlBlockType* pWDICtx,
16071 WDI_EventInfoType* pEventData
16072)
16073{
16074 WDI_Status wdiStatus;
16075 eHalStatus halStatus;
16076 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16077 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16078
16079 /*-------------------------------------------------------------------------
16080 Sanity check
16081 -------------------------------------------------------------------------*/
16082 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16083 ( NULL == pEventData->pEventData))
16084 {
16085 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16086 "%s: Invalid parameters", __FUNCTION__);
16087 WDI_ASSERT(0);
16088 return WDI_STATUS_E_FAILURE;
16089 }
16090
16091 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16092
16093 /*-------------------------------------------------------------------------
16094 Extract response and send it to UMAC
16095 -------------------------------------------------------------------------*/
16096 wpalMemoryCopy( &halStatus,
16097 pEventData->pEventData,
16098 sizeof(halStatus));
16099
16100 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16101
16102 /*Notify UMAC*/
16103 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16104
16105 return WDI_STATUS_SUCCESS;
16106}/*WDI_ProcessSendBeaconParamsRsp*/
16107
16108
16109/**
16110 @brief Process Update Probe Resp Template Rsp function (called
16111 when a response is being received over the bus from HAL)
16112
16113 @param pWDICtx: pointer to the WLAN DAL context
16114 pEventData: pointer to the event information structure
16115
16116 @see
16117 @return Result of the function call
16118*/
16119WDI_Status
16120WDI_ProcessUpdateProbeRspTemplateRsp
16121(
16122 WDI_ControlBlockType* pWDICtx,
16123 WDI_EventInfoType* pEventData
16124)
16125{
16126 WDI_Status wdiStatus;
16127 eHalStatus halStatus;
16128 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16129 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16130
16131 /*-------------------------------------------------------------------------
16132 Sanity check
16133 -------------------------------------------------------------------------*/
16134 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16135 ( NULL == pEventData->pEventData))
16136 {
16137 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16138 "%s: Invalid parameters", __FUNCTION__);
16139 WDI_ASSERT(0);
16140 return WDI_STATUS_E_FAILURE;
16141 }
16142
16143 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16144
16145 /*-------------------------------------------------------------------------
16146 Extract response and send it to UMAC
16147 -------------------------------------------------------------------------*/
16148 wpalMemoryCopy( &halStatus,
16149 pEventData->pEventData,
16150 sizeof(halStatus));
16151
16152 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16153
16154 /*Notify UMAC*/
16155 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16156
16157 return WDI_STATUS_SUCCESS;
16158}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16159
16160 /**
16161 @brief Process Set Max Tx Power Rsp function (called when a response
16162 is being received over the bus from HAL)
16163
16164 @param pWDICtx: pointer to the WLAN DAL context
16165 pEventData: pointer to the event information structure
16166
16167 @see
16168 @return Result of the function call
16169*/
16170WDI_Status
16171WDI_ProcessSetMaxTxPowerRsp
16172(
16173 WDI_ControlBlockType* pWDICtx,
16174 WDI_EventInfoType* pEventData
16175)
16176{
16177 tSetMaxTxPwrRspMsg halTxpowerrsp;
16178
16179 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
16180
16181 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16182 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16183
16184 /*-------------------------------------------------------------------------
16185 Sanity check
16186 -------------------------------------------------------------------------*/
16187 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16188 ( NULL == pEventData->pEventData))
16189 {
16190 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16191 "%s: Invalid parameters", __FUNCTION__);
16192 WDI_ASSERT(0);
16193 return WDI_STATUS_E_FAILURE;
16194 }
16195
16196 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16197
16198 /*-------------------------------------------------------------------------
16199 Extract response and send it to UMAC
16200 -------------------------------------------------------------------------*/
16201 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16202 pEventData->pEventData,
16203 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
16204
16205 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16206 {
16207 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16208 "Error status returned in Set Max Tx Power Response ");
16209 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16210 return WDI_STATUS_E_FAILURE;
16211 }
16212
16213 wdiSetMaxTxPowerRspMsg.wdiStatus =
16214 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
16215 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
16216
16217 /*Notify UMAC*/
16218 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16219
16220 return WDI_STATUS_SUCCESS;
16221}
16222
16223#ifdef WLAN_FEATURE_P2P
16224/**
16225 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
16226 when a response is being received over the bus from HAL)
16227
16228 @param pWDICtx: pointer to the WLAN DAL context
16229 pEventData: pointer to the event information structure
16230
16231 @see
16232 @return Result of the function call
16233*/
16234WDI_Status
16235WDI_ProcessP2PGONOARsp
16236(
16237 WDI_ControlBlockType* pWDICtx,
16238 WDI_EventInfoType* pEventData
16239)
16240{
16241 WDI_Status wdiStatus;
16242 eHalStatus halStatus;
16243 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16244 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16245
16246 /*-------------------------------------------------------------------------
16247 Sanity check
16248 -------------------------------------------------------------------------*/
16249 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16250 ( NULL == pEventData->pEventData))
16251 {
16252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16253 "%s: Invalid parameters", __FUNCTION__);
16254 WDI_ASSERT(0);
16255 return WDI_STATUS_E_FAILURE;
16256 }
16257
16258 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16259
16260 /*-------------------------------------------------------------------------
16261 Extract response and send it to UMAC
16262 -------------------------------------------------------------------------*/
16263 wpalMemoryCopy( &halStatus,
16264 pEventData->pEventData,
16265 sizeof(halStatus));
16266
16267 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16268
16269 /*Notify UMAC*/
16270 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16271
16272 return WDI_STATUS_SUCCESS;
16273}/*WDI_ProcessP2PGONOARsp*/
16274#endif
16275/**
16276 @brief Process Enter IMPS Rsp function (called when a response
16277 is being received over the bus from HAL)
16278
16279 @param pWDICtx: pointer to the WLAN DAL context
16280 pEventData: pointer to the event information structure
16281
16282 @see
16283 @return Result of the function call
16284*/
16285WDI_Status
16286WDI_ProcessEnterImpsRsp
16287(
16288 WDI_ControlBlockType* pWDICtx,
16289 WDI_EventInfoType* pEventData
16290)
16291{
16292 WDI_Status wdiStatus;
16293 eHalStatus halStatus;
16294 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16295 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16296
16297 /*-------------------------------------------------------------------------
16298 Sanity check
16299 -------------------------------------------------------------------------*/
16300 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16301 ( NULL == pEventData->pEventData))
16302 {
16303 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16304 "%s: Invalid parameters", __FUNCTION__);
16305 WDI_ASSERT(0);
16306 return WDI_STATUS_E_FAILURE;
16307 }
16308
16309 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16310
16311 /*-------------------------------------------------------------------------
16312 Extract response and send it to UMAC
16313 -------------------------------------------------------------------------*/
16314 halStatus = *((eHalStatus*)pEventData->pEventData);
16315
16316 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16317
16318 /*Notify UMAC*/
16319 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16320
16321 return WDI_STATUS_SUCCESS;
16322}/*WDI_ProcessEnterImpsRsp*/
16323
16324/**
16325 @brief Process Exit IMPS Rsp function (called when a response
16326 is being received over the bus from HAL)
16327
16328 @param pWDICtx: pointer to the WLAN DAL context
16329 pEventData: pointer to the event information structure
16330
16331 @see
16332 @return Result of the function call
16333*/
16334WDI_Status
16335WDI_ProcessExitImpsRsp
16336(
16337 WDI_ControlBlockType* pWDICtx,
16338 WDI_EventInfoType* pEventData
16339)
16340{
16341 WDI_Status wdiStatus;
16342 eHalStatus halStatus;
16343 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16344 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16345
16346 /*-------------------------------------------------------------------------
16347 Sanity check
16348 -------------------------------------------------------------------------*/
16349 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16350 ( NULL == pEventData->pEventData))
16351 {
16352 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16353 "%s: Invalid parameters", __FUNCTION__);
16354 WDI_ASSERT(0);
16355 return WDI_STATUS_E_FAILURE;
16356 }
16357
16358 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16359
16360 /*-------------------------------------------------------------------------
16361 Extract response and send it to UMAC
16362 -------------------------------------------------------------------------*/
16363 halStatus = *((eHalStatus*)pEventData->pEventData);
16364 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16365
16366 // notify DTS that we are entering Full power
16367 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16368
16369 /*Notify UMAC*/
16370 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16371
16372 return WDI_STATUS_SUCCESS;
16373}/*WDI_ProcessExitImpsRsp*/
16374
16375/**
16376 @brief Process Enter BMPS Rsp function (called when a response
16377 is being received over the bus from HAL)
16378
16379 @param pWDICtx: pointer to the WLAN DAL context
16380 pEventData: pointer to the event information structure
16381
16382 @see
16383 @return Result of the function call
16384*/
16385WDI_Status
16386WDI_ProcessEnterBmpsRsp
16387(
16388 WDI_ControlBlockType* pWDICtx,
16389 WDI_EventInfoType* pEventData
16390)
16391{
16392 WDI_Status wdiStatus;
16393 eHalStatus halStatus;
16394 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16395 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16396
16397 /*-------------------------------------------------------------------------
16398 Sanity check
16399 -------------------------------------------------------------------------*/
16400 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16401 ( NULL == pEventData->pEventData))
16402 {
16403 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16404 "%s: Invalid parameters", __FUNCTION__);
16405 WDI_ASSERT(0);
16406 return WDI_STATUS_E_FAILURE;
16407 }
16408
16409 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
16410
16411 /*-------------------------------------------------------------------------
16412 Extract response and send it to UMAC
16413 -------------------------------------------------------------------------*/
16414 halStatus = *((eHalStatus*)pEventData->pEventData);
16415 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16416
16417 /*Notify UMAC*/
16418 wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16419
16420 return WDI_STATUS_SUCCESS;
16421}/*WDI_ProcessEnterBmpsRsp*/
16422
16423/**
16424 @brief Process Exit BMPS Rsp function (called when a response
16425 is being received over the bus from HAL)
16426
16427 @param pWDICtx: pointer to the WLAN DAL context
16428 pEventData: pointer to the event information structure
16429
16430 @see
16431 @return Result of the function call
16432*/
16433WDI_Status
16434WDI_ProcessExitBmpsRsp
16435(
16436 WDI_ControlBlockType* pWDICtx,
16437 WDI_EventInfoType* pEventData
16438)
16439{
16440 WDI_Status wdiStatus;
16441 eHalStatus halStatus;
16442 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
16443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16444
16445 /*-------------------------------------------------------------------------
16446 Sanity check
16447 -------------------------------------------------------------------------*/
16448 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16449 ( NULL == pEventData->pEventData))
16450 {
16451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16452 "%s: Invalid parameters", __FUNCTION__);
16453 WDI_ASSERT(0);
16454 return WDI_STATUS_E_FAILURE;
16455 }
16456
16457 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16458
16459 /*-------------------------------------------------------------------------
16460 Extract response and send it to UMAC
16461 -------------------------------------------------------------------------*/
16462 halStatus = *((eHalStatus*)pEventData->pEventData);
16463 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16464
16465 // notify DTS that we are entering Full power
16466 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16467
16468 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16469
16470 /*Notify UMAC*/
16471 wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16472
16473 return WDI_STATUS_SUCCESS;
16474}/*WDI_ProcessExitBmpsRsp*/
16475
16476/**
16477 @brief Process Enter UAPSD Rsp function (called when a response
16478 is being received over the bus from HAL)
16479
16480 @param pWDICtx: pointer to the WLAN DAL context
16481 pEventData: pointer to the event information structure
16482
16483 @see
16484 @return Result of the function call
16485*/
16486WDI_Status
16487WDI_ProcessEnterUapsdRsp
16488(
16489 WDI_ControlBlockType* pWDICtx,
16490 WDI_EventInfoType* pEventData
16491)
16492{
16493 WDI_Status wdiStatus;
16494 eHalStatus halStatus;
16495 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
16496 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16497
16498 /*-------------------------------------------------------------------------
16499 Sanity check
16500 -------------------------------------------------------------------------*/
16501 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16502 ( NULL == pEventData->pEventData))
16503 {
16504 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16505 "%s: Invalid parameters", __FUNCTION__);
16506 WDI_ASSERT(0);
16507 return WDI_STATUS_E_FAILURE;
16508 }
16509
16510 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16511
16512 /*-------------------------------------------------------------------------
16513 Extract response and send it to UMAC
16514 -------------------------------------------------------------------------*/
16515 halStatus = *((eHalStatus*)pEventData->pEventData);
16516 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16517
16518 if(WDI_STATUS_SUCCESS == wdiStatus)
16519 {
16520 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
16521 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
16522 // the traffic to decide when to suspend the trigger frames when there is no traffic
16523 // activity on the trigger enabled ACs
16524 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
16525
16526#ifdef WLAN_PERF
16527 // Increment the BD signature to refresh the fast path BD utilization
16528 pWDICtx->uBdSigSerialNum++;
16529#endif
16530 }
16531
16532 /*Notify UMAC*/
16533 wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16534
16535 return WDI_STATUS_SUCCESS;
16536}/*WDI_ProcessEnterUapsdRsp*/
16537
16538/**
16539 @brief Process Exit UAPSD Rsp function (called when a response
16540 is being received over the bus from HAL)
16541
16542 @param pWDICtx: pointer to the WLAN DAL context
16543 pEventData: pointer to the event information structure
16544
16545 @see
16546 @return Result of the function call
16547*/
16548WDI_Status
16549WDI_ProcessExitUapsdRsp
16550(
16551 WDI_ControlBlockType* pWDICtx,
16552 WDI_EventInfoType* pEventData
16553)
16554{
16555 WDI_Status wdiStatus;
16556 eHalStatus halStatus;
16557 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
16558 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16559
16560 /*-------------------------------------------------------------------------
16561 Sanity check
16562 -------------------------------------------------------------------------*/
16563 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16564 ( NULL == pEventData->pEventData))
16565 {
16566 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16567 "%s: Invalid parameters", __FUNCTION__);
16568 WDI_ASSERT(0);
16569 return WDI_STATUS_E_FAILURE;
16570 }
16571
16572 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
16573
16574 /*-------------------------------------------------------------------------
16575 Extract response and send it to UMAC
16576 -------------------------------------------------------------------------*/
16577 halStatus = *((eHalStatus*)pEventData->pEventData);
16578 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16579
16580 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
16581 // directly instead of the FW WQ.
16582 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
16583
16584#ifdef WLAN_PERF
16585 // Increment the BD signature to refresh the fast path BD utilization
16586 pWDICtx->uBdSigSerialNum++;
16587#endif
16588
16589 /*Notify UMAC*/
16590 wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16591
16592 return WDI_STATUS_SUCCESS;
16593}/*WDI_ProcessExitUapsdRsp*/
16594
16595/**
16596 @brief Process set UAPSD params Rsp function (called when a
16597 response is being received over the bus from HAL)
16598
16599 @param pWDICtx: pointer to the WLAN DAL context
16600 pEventData: pointer to the event information structure
16601
16602 @see
16603 @return Result of the function call
16604*/
16605WDI_Status
16606WDI_ProcessSetUapsdAcParamsRsp
16607(
16608 WDI_ControlBlockType* pWDICtx,
16609 WDI_EventInfoType* pEventData
16610)
16611{
16612 WDI_Status wdiStatus;
16613 eHalStatus halStatus;
16614 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
16615 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16616
16617 /*-------------------------------------------------------------------------
16618 Sanity check
16619 -------------------------------------------------------------------------*/
16620 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16621 ( NULL == pEventData->pEventData))
16622 {
16623 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16624 "%s: Invalid parameters", __FUNCTION__);
16625 WDI_ASSERT(0);
16626 return WDI_STATUS_E_FAILURE;
16627 }
16628
16629 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
16630
16631 /*-------------------------------------------------------------------------
16632 Extract response and send it to UMAC
16633 -------------------------------------------------------------------------*/
16634 halStatus = *((eHalStatus*)pEventData->pEventData);
16635 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16636
16637 /*Notify UMAC*/
16638 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16639
16640 return WDI_STATUS_SUCCESS;
16641}/*WDI_ProcessSetUapsdAcParamsRsp*/
16642
16643/**
16644 @brief Process update UAPSD params Rsp function (called when a
16645 response is being received over the bus from HAL)
16646
16647 @param pWDICtx: pointer to the WLAN DAL context
16648 pEventData: pointer to the event information structure
16649
16650 @see
16651 @return Result of the function call
16652*/
16653WDI_Status
16654WDI_ProcessUpdateUapsdParamsRsp
16655(
16656 WDI_ControlBlockType* pWDICtx,
16657 WDI_EventInfoType* pEventData
16658)
16659{
16660 WDI_Status wdiStatus;
16661 eHalStatus halStatus;
16662 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
16663 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16664
16665 /*-------------------------------------------------------------------------
16666 Sanity check
16667 -------------------------------------------------------------------------*/
16668 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16669 ( NULL == pEventData->pEventData))
16670 {
16671 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16672 "%s: Invalid parameters", __FUNCTION__);
16673 WDI_ASSERT(0);
16674 return WDI_STATUS_E_FAILURE;
16675 }
16676
16677 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
16678
16679 /*-------------------------------------------------------------------------
16680 Extract response and send it to UMAC
16681 -------------------------------------------------------------------------*/
16682 halStatus = *((eHalStatus*)pEventData->pEventData);
16683 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16684
16685 /*Notify UMAC*/
16686 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16687
16688 return WDI_STATUS_SUCCESS;
16689}/*WDI_ProcessUpdateUapsdParamsRsp*/
16690
16691/**
16692 @brief Process Configure RXP filter Rsp function (called when a
16693 response is being received over the bus from HAL)
16694
16695 @param pWDICtx: pointer to the WLAN DAL context
16696 pEventData: pointer to the event information structure
16697
16698 @see
16699 @return Result of the function call
16700*/
16701WDI_Status
16702WDI_ProcessConfigureRxpFilterRsp
16703(
16704 WDI_ControlBlockType* pWDICtx,
16705 WDI_EventInfoType* pEventData
16706)
16707{
16708 WDI_Status wdiStatus;
16709 eHalStatus halStatus;
16710 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
16711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16712
16713 /*-------------------------------------------------------------------------
16714 Sanity check
16715 -------------------------------------------------------------------------*/
16716 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16717 ( NULL == pEventData->pEventData))
16718 {
16719 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16720 "%s: Invalid parameters", __FUNCTION__);
16721 WDI_ASSERT(0);
16722 return WDI_STATUS_E_FAILURE;
16723 }
16724
16725 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
16726
16727 /*-------------------------------------------------------------------------
16728 Extract response and send it to UMAC
16729 -------------------------------------------------------------------------*/
16730 halStatus = *((eHalStatus*)pEventData->pEventData);
16731 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16732
16733 /*Notify UMAC*/
16734 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16735
16736 return WDI_STATUS_SUCCESS;
16737}/*WDI_ProcessConfigureRxpFilterRsp*/
16738
16739/**
16740 @brief Process Set beacon filter Rsp function (called when a
16741 response is being received over the bus from HAL)
16742
16743 @param pWDICtx: pointer to the WLAN DAL context
16744 pEventData: pointer to the event information structure
16745
16746 @see
16747 @return Result of the function call
16748*/
16749WDI_Status
16750WDI_ProcessSetBeaconFilterRsp
16751(
16752 WDI_ControlBlockType* pWDICtx,
16753 WDI_EventInfoType* pEventData
16754)
16755{
16756 WDI_Status wdiStatus;
16757 eHalStatus halStatus;
16758 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
16759 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16760
16761 /*-------------------------------------------------------------------------
16762 Sanity check
16763 -------------------------------------------------------------------------*/
16764 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16765 ( NULL == pEventData->pEventData))
16766 {
16767 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16768 "%s: Invalid parameters", __FUNCTION__);
16769 WDI_ASSERT(0);
16770 return WDI_STATUS_E_FAILURE;
16771 }
16772
16773 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
16774
16775 /*-------------------------------------------------------------------------
16776 Extract response and send it to UMAC
16777 -------------------------------------------------------------------------*/
16778 halStatus = *((eHalStatus*)pEventData->pEventData);
16779 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16780
16781 /*Notify UMAC*/
16782 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16783
16784 return WDI_STATUS_SUCCESS;
16785}/*WDI_ProcessSetBeaconFilterRsp*/
16786
16787/**
16788 @brief Process remove beacon filter Rsp function (called when a
16789 response is being received over the bus from HAL)
16790
16791 @param pWDICtx: pointer to the WLAN DAL context
16792 pEventData: pointer to the event information structure
16793
16794 @see
16795 @return Result of the function call
16796*/
16797WDI_Status
16798WDI_ProcessRemBeaconFilterRsp
16799(
16800 WDI_ControlBlockType* pWDICtx,
16801 WDI_EventInfoType* pEventData
16802)
16803{
16804 WDI_Status wdiStatus;
16805 eHalStatus halStatus;
16806 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
16807 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16808
16809 /*-------------------------------------------------------------------------
16810 Sanity check
16811 -------------------------------------------------------------------------*/
16812 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16813 ( NULL == pEventData->pEventData))
16814 {
16815 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16816 "%s: Invalid parameters", __FUNCTION__);
16817 WDI_ASSERT(0);
16818 return WDI_STATUS_E_FAILURE;
16819 }
16820
16821 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
16822
16823 /*-------------------------------------------------------------------------
16824 Extract response and send it to UMAC
16825 -------------------------------------------------------------------------*/
16826 halStatus = *((eHalStatus*)pEventData->pEventData);
16827 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16828
16829 /*Notify UMAC*/
16830 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16831
16832 return WDI_STATUS_SUCCESS;
16833}/*WDI_ProcessRemBeaconFilterRsp*/
16834
16835/**
16836 @brief Process set RSSI thresholds Rsp function (called when a
16837 response is being received over the bus from HAL)
16838
16839 @param pWDICtx: pointer to the WLAN DAL context
16840 pEventData: pointer to the event information structure
16841
16842 @see
16843 @return Result of the function call
16844*/
16845WDI_Status
16846WDI_ProcessSetRSSIThresoldsRsp
16847(
16848 WDI_ControlBlockType* pWDICtx,
16849 WDI_EventInfoType* pEventData
16850)
16851{
16852 WDI_Status wdiStatus;
16853 eHalStatus halStatus;
16854 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
16855 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16856
16857 /*-------------------------------------------------------------------------
16858 Sanity check
16859 -------------------------------------------------------------------------*/
16860 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16861 ( NULL == pEventData->pEventData))
16862 {
16863 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16864 "%s: Invalid parameters", __FUNCTION__);
16865 WDI_ASSERT(0);
16866 return WDI_STATUS_E_FAILURE;
16867 }
16868
16869 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
16870
16871 /*-------------------------------------------------------------------------
16872 Extract response and send it to UMAC
16873 -------------------------------------------------------------------------*/
16874 halStatus = *((eHalStatus*)pEventData->pEventData);
16875 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16876
16877 /*Notify UMAC*/
16878 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
16879
16880 return WDI_STATUS_SUCCESS;
16881}/*WDI_ProcessSetRSSIThresoldsRsp*/
16882
16883/**
16884 @brief Process host offload Rsp function (called when a
16885 response is being received over the bus from HAL)
16886
16887 @param pWDICtx: pointer to the WLAN DAL context
16888 pEventData: pointer to the event information structure
16889
16890 @see
16891 @return Result of the function call
16892*/
16893WDI_Status
16894WDI_ProcessHostOffloadRsp
16895(
16896 WDI_ControlBlockType* pWDICtx,
16897 WDI_EventInfoType* pEventData
16898)
16899{
16900 WDI_Status wdiStatus;
16901 eHalStatus halStatus;
16902 WDI_HostOffloadCb wdiHostOffloadCb;
16903 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16904
16905 /*-------------------------------------------------------------------------
16906 Sanity check
16907 -------------------------------------------------------------------------*/
16908 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16909 ( NULL == pEventData->pEventData))
16910 {
16911 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16912 "%s: Invalid parameters", __FUNCTION__);
16913 WDI_ASSERT(0);
16914 return WDI_STATUS_E_FAILURE;
16915 }
16916
16917 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
16918
16919 /*-------------------------------------------------------------------------
16920 Extract response and send it to UMAC
16921 -------------------------------------------------------------------------*/
16922 halStatus = *((eHalStatus*)pEventData->pEventData);
16923 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16924
16925 /*Notify UMAC*/
16926 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
16927
16928 return WDI_STATUS_SUCCESS;
16929}/*WDI_ProcessHostOffloadRsp*/
16930
16931/**
16932 @brief Process keep alive Rsp function (called when a
16933 response is being received over the bus from HAL)
16934
16935 @param pWDICtx: pointer to the WLAN DAL context
16936 pEventData: pointer to the event information structure
16937
16938 @see
16939 @return Result of the function call
16940*/
16941WDI_Status
16942WDI_ProcessKeepAliveRsp
16943(
16944 WDI_ControlBlockType* pWDICtx,
16945 WDI_EventInfoType* pEventData
16946)
16947{
16948 WDI_Status wdiStatus;
16949 eHalStatus halStatus;
16950 WDI_KeepAliveCb wdiKeepAliveCb;
16951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16952 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16953 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
16954
16955
16956 /*-------------------------------------------------------------------------
16957 Sanity check
16958 -------------------------------------------------------------------------*/
16959 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16960 ( NULL == pEventData->pEventData))
16961 {
16962 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16963 "%s: Invalid parameters", __FUNCTION__);
16964 WDI_ASSERT(0);
16965 return WDI_STATUS_E_FAILURE;
16966 }
16967
16968 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
16969
16970 /*-------------------------------------------------------------------------
16971 Extract response and send it to UMAC
16972 -------------------------------------------------------------------------*/
16973 halStatus = *((eHalStatus*)pEventData->pEventData);
16974 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16975
16976 /*Notify UMAC*/
16977 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
16978
16979 return WDI_STATUS_SUCCESS;
16980}/*WDI_ProcessKeepAliveRsp*/
16981
16982/**
16983 @brief Process wowl add ptrn Rsp function (called when a
16984 response is being received over the bus from HAL)
16985
16986 @param pWDICtx: pointer to the WLAN DAL context
16987 pEventData: pointer to the event information structure
16988
16989 @see
16990 @return Result of the function call
16991*/
16992WDI_Status
16993WDI_ProcessWowlAddBcPtrnRsp
16994(
16995 WDI_ControlBlockType* pWDICtx,
16996 WDI_EventInfoType* pEventData
16997)
16998{
16999 WDI_Status wdiStatus;
17000 eHalStatus halStatus;
17001 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
17002 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17003
17004 /*-------------------------------------------------------------------------
17005 Sanity check
17006 -------------------------------------------------------------------------*/
17007 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17008 ( NULL == pEventData->pEventData))
17009 {
17010 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17011 "%s: Invalid parameters", __FUNCTION__);
17012 WDI_ASSERT(0);
17013 return WDI_STATUS_E_FAILURE;
17014 }
17015
17016 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17017
17018 /*-------------------------------------------------------------------------
17019 Extract response and send it to UMAC
17020 -------------------------------------------------------------------------*/
17021 halStatus = *((eHalStatus*)pEventData->pEventData);
17022 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17023
17024 /*Notify UMAC*/
17025 wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17026
17027 return WDI_STATUS_SUCCESS;
17028}/*WDI_ProcessWowlAddBcPtrnRsp*/
17029
17030/**
17031 @brief Process wowl delete ptrn Rsp function (called when a
17032 response is being received over the bus from HAL)
17033
17034 @param pWDICtx: pointer to the WLAN DAL context
17035 pEventData: pointer to the event information structure
17036
17037 @see
17038 @return Result of the function call
17039*/
17040WDI_Status
17041WDI_ProcessWowlDelBcPtrnRsp
17042(
17043 WDI_ControlBlockType* pWDICtx,
17044 WDI_EventInfoType* pEventData
17045)
17046{
17047 WDI_Status wdiStatus;
17048 eHalStatus halStatus;
17049 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
17050 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17051
17052 /*-------------------------------------------------------------------------
17053 Sanity check
17054 -------------------------------------------------------------------------*/
17055 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17056 ( NULL == pEventData->pEventData))
17057 {
17058 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17059 "%s: Invalid parameters", __FUNCTION__);
17060 WDI_ASSERT(0);
17061 return WDI_STATUS_E_FAILURE;
17062 }
17063
17064 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17065
17066 /*-------------------------------------------------------------------------
17067 Extract response and send it to UMAC
17068 -------------------------------------------------------------------------*/
17069 halStatus = *((eHalStatus*)pEventData->pEventData);
17070 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17071
17072 /*Notify UMAC*/
17073 wdiWowlDelBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17074
17075 return WDI_STATUS_SUCCESS;
17076}/*WDI_ProcessWowlDelBcPtrnRsp*/
17077
17078/**
17079 @brief Process wowl enter Rsp function (called when a response
17080 is being received over the bus from HAL)
17081
17082 @param pWDICtx: pointer to the WLAN DAL context
17083 pEventData: pointer to the event information structure
17084
17085 @see
17086 @return Result of the function call
17087*/
17088WDI_Status
17089WDI_ProcessWowlEnterRsp
17090(
17091 WDI_ControlBlockType* pWDICtx,
17092 WDI_EventInfoType* pEventData
17093)
17094{
17095 WDI_Status wdiStatus;
17096 eHalStatus halStatus;
17097 WDI_WowlEnterReqCb wdiWowlEnterCb;
17098 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17099
17100 /*-------------------------------------------------------------------------
17101 Sanity check
17102 -------------------------------------------------------------------------*/
17103 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17104 ( NULL == pEventData->pEventData))
17105 {
17106 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17107 "%s: Invalid parameters", __FUNCTION__);
17108 WDI_ASSERT(0);
17109 return WDI_STATUS_E_FAILURE;
17110 }
17111
17112 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17113
17114 /*-------------------------------------------------------------------------
17115 Extract response and send it to UMAC
17116 -------------------------------------------------------------------------*/
17117 halStatus = *((eHalStatus*)pEventData->pEventData);
17118 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17119
17120 /*Notify UMAC*/
17121 wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData);
17122
17123 return WDI_STATUS_SUCCESS;
17124}/*WDI_ProcessWowlEnterRsp*/
17125
17126/**
17127 @brief Process wowl exit Rsp function (called when a response
17128 is being received over the bus from HAL)
17129
17130 @param pWDICtx: pointer to the WLAN DAL context
17131 pEventData: pointer to the event information structure
17132
17133 @see
17134 @return Result of the function call
17135*/
17136WDI_Status
17137WDI_ProcessWowlExitRsp
17138(
17139 WDI_ControlBlockType* pWDICtx,
17140 WDI_EventInfoType* pEventData
17141)
17142{
17143 WDI_Status wdiStatus;
17144 eHalStatus halStatus;
17145 WDI_WowlExitReqCb wdiWowlExitCb;
17146 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17147
17148 /*-------------------------------------------------------------------------
17149 Sanity check
17150 -------------------------------------------------------------------------*/
17151 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17152 ( NULL == pEventData->pEventData))
17153 {
17154 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17155 "%s: Invalid parameters", __FUNCTION__);
17156 WDI_ASSERT(0);
17157 return WDI_STATUS_E_FAILURE;
17158 }
17159
17160 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17161
17162 /*-------------------------------------------------------------------------
17163 Extract response and send it to UMAC
17164 -------------------------------------------------------------------------*/
17165 halStatus = *((eHalStatus*)pEventData->pEventData);
17166 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17167
17168 /*Notify UMAC*/
17169 wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData);
17170
17171 return WDI_STATUS_SUCCESS;
17172}/*WDI_ProcessWowlExitRsp*/
17173
17174/**
17175 @brief Process Configure Apps CPU wakeup State Rsp function
17176 (called when a response is being received over the bus
17177 from HAL)
17178
17179 @param pWDICtx: pointer to the WLAN DAL context
17180 pEventData: pointer to the event information structure
17181
17182 @see
17183 @return Result of the function call
17184*/
17185WDI_Status
17186WDI_ProcessConfigureAppsCpuWakeupStateRsp
17187(
17188 WDI_ControlBlockType* pWDICtx,
17189 WDI_EventInfoType* pEventData
17190)
17191{
17192 WDI_Status wdiStatus;
17193 eHalStatus halStatus;
17194 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17195 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17196
17197 /*-------------------------------------------------------------------------
17198 Sanity check
17199 -------------------------------------------------------------------------*/
17200 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17201 ( NULL == pEventData->pEventData))
17202 {
17203 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17204 "%s: Invalid parameters", __FUNCTION__);
17205 WDI_ASSERT(0);
17206 return WDI_STATUS_E_FAILURE;
17207 }
17208
17209 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17210
17211 /*-------------------------------------------------------------------------
17212 Extract response and send it to UMAC
17213 -------------------------------------------------------------------------*/
17214 halStatus = *((eHalStatus*)pEventData->pEventData);
17215 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17216
17217 /*Notify UMAC*/
17218 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17219
17220 return WDI_STATUS_SUCCESS;
17221}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17222
17223
17224/**
17225 @brief Process Nv download(called when a response
17226 is being received over the bus from HAL,will check if the responce is )
17227
17228 @param pWDICtx: pointer to the WLAN DAL context
17229 pEventData: pointer to the event information structure
17230
17231 @see
17232 @return Result of the function call
17233*/
17234WDI_Status
17235WDI_ProcessNvDownloadRsp
17236(
17237 WDI_ControlBlockType* pWDICtx,
17238 WDI_EventInfoType* pEventData
17239)
17240{
17241
17242 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17243 tHalNvImgDownloadRspParams halNvDownloadRsp;
17244 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17245
17246 /*-------------------------------------------------------------------------
17247 Sanity check
17248 -------------------------------------------------------------------------*/
17249 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17250 ( NULL == pEventData->pEventData))
17251 {
17252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17253 "%s: Invalid parameters", __FUNCTION__);
17254 WDI_ASSERT(0);
17255 return WDI_STATUS_E_FAILURE;
17256 }
17257
17258 /*-------------------------------------------------------------------------
17259 Extract response and send it to UMAC
17260 -------------------------------------------------------------------------*/
17261 wpalMemoryCopy( &halNvDownloadRsp,
17262 pEventData->pEventData,
17263 sizeof(halNvDownloadRsp));
17264
17265 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17266
17267 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
17268 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17269 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
17270 {
17271 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
17272 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
17273 }
17274 else
17275 {
17276 /*Reset the Nv related global information in WDI context information */
17277 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17278 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17279 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17280 /*call WDA callback function for last fragment */
17281 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17282 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17283 }
17284
17285 return WDI_STATUS_SUCCESS;
17286}
17287#ifdef WLAN_FEATURE_VOWIFI_11R
17288/**
17289 @brief Process Add TSpec Rsp function (called when a response
17290 is being received over the bus from HAL)
17291
17292 @param pWDICtx: pointer to the WLAN DAL context
17293 pEventData: pointer to the event information structure
17294
17295 @see
17296 @return Result of the function call
17297*/
17298WDI_Status
17299WDI_ProcessAggrAddTSpecRsp
17300(
17301 WDI_ControlBlockType* pWDICtx,
17302 WDI_EventInfoType* pEventData
17303)
17304{
17305 WDI_Status wdiStatus;
17306 tAggrAddTsRspParams aggrAddTsRsp;
17307 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17308 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17309
17310 /*-------------------------------------------------------------------------
17311 Sanity check
17312 -------------------------------------------------------------------------*/
17313 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17314 ( NULL == pEventData->pEventData))
17315 {
17316 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17317 "%s: Invalid parameters", __FUNCTION__);
17318 WDI_ASSERT(0);
17319 return WDI_STATUS_E_FAILURE;
17320 }
17321
17322 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17323
17324 /*-------------------------------------------------------------------------
17325 Extract response and send it to UMAC
17326 -------------------------------------------------------------------------*/
17327 wpalMemoryCopy( &aggrAddTsRsp,
17328 pEventData->pEventData,
17329 sizeof(aggrAddTsRsp));
17330
17331 /* What is the difference between status0 and status1? */
17332 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
17333
17334 /*Notify UMAC*/
17335 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17336
17337 return WDI_STATUS_SUCCESS;
17338}/*WDI_ProcessAddTSpecRsp*/
17339#endif /* WLAN_FEATURE_VOWIFI_11R */
17340
17341/**
17342 @brief WDI_ProcessHostResumeRsp function (called when a
17343 response is being received over the bus from HAL)
17344
17345 @param pWDICtx: pointer to the WLAN DAL context
17346 pEventData: pointer to the event information structure
17347
17348 @see
17349 @return Result of the function call
17350*/
17351WDI_Status
17352WDI_ProcessHostResumeRsp
17353(
17354 WDI_ControlBlockType* pWDICtx,
17355 WDI_EventInfoType* pEventData
17356)
17357{
17358 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17359 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17360 tHalHostResumeRspParams hostResumeRspMsg;
17361 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17362
17363 /*-------------------------------------------------------------------------
17364 Sanity check
17365 -------------------------------------------------------------------------*/
17366 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17367 ( NULL == pEventData->pEventData))
17368 {
17369 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17370 "%s: Invalid parameters", __FUNCTION__);
17371 WDI_ASSERT(0);
17372 return WDI_STATUS_E_FAILURE;
17373 }
17374
17375 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17376
17377 /*-------------------------------------------------------------------------
17378 Extract response and send it to UMAC
17379 -------------------------------------------------------------------------*/
17380
17381 wpalMemoryCopy( &hostResumeRspMsg,
17382 (wpt_uint8*)pEventData->pEventData,
17383 sizeof(hostResumeRspMsg));
17384
17385 wdiResumeRspParams.wdiStatus =
17386 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
17387
17388 /*Notify UMAC*/
17389 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17390
17391 return WDI_STATUS_SUCCESS;
17392}
17393
17394/**
17395 @brief Process Set Tx PER Rsp function (called when a response
17396 is being received over the bus from HAL)
17397
17398 @param pWDICtx: pointer to the WLAN DAL context
17399 pEventData: pointer to the event information structure
17400
17401 @see
17402 @return Result of the function call
17403*/
17404WDI_Status
17405WDI_ProcessSetTxPerTrackingRsp
17406(
17407 WDI_ControlBlockType* pWDICtx,
17408 WDI_EventInfoType* pEventData
17409)
17410{
17411 WDI_Status wdiStatus;
17412 eHalStatus halStatus;
17413 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17414 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17415
17416 /*-------------------------------------------------------------------------
17417 Sanity check
17418 -------------------------------------------------------------------------*/
17419 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17420 ( NULL == pEventData->pEventData))
17421 {
17422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17423 "%s: Invalid parameters", __FUNCTION__);
17424 WDI_ASSERT(0);
17425 return WDI_STATUS_E_FAILURE;
17426 }
17427
17428 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
17429
17430 /*-------------------------------------------------------------------------
17431 Extract response and send it to UMAC
17432 -------------------------------------------------------------------------*/
17433 halStatus = *((eHalStatus*)pEventData->pEventData);
17434 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17435
17436 /*Notify UMAC*/
17437 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17438
17439 return WDI_STATUS_SUCCESS;
17440}/*WDI_ProcessSetTxPerTrackingRsp*/
17441
17442/*==========================================================================
17443 Indications from HAL
17444 ==========================================================================*/
17445/**
17446 @brief Process Low RSSI Indication function (called when an
17447 indication of this kind is being received over the bus
17448 from HAL)
17449
17450 @param pWDICtx: pointer to the WLAN DAL context
17451 pEventData: pointer to the event information structure
17452
17453 @see
17454 @return Result of the function call
17455*/
17456WDI_Status
17457WDI_ProcessLowRSSIInd
17458(
17459 WDI_ControlBlockType* pWDICtx,
17460 WDI_EventInfoType* pEventData
17461)
17462{
17463 WDI_LowLevelIndType wdiInd;
17464 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
17465 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17466
17467 /*-------------------------------------------------------------------------
17468 Sanity check
17469 -------------------------------------------------------------------------*/
17470 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17471 ( NULL == pEventData->pEventData))
17472 {
17473 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17474 "%s: Invalid parameters", __FUNCTION__);
17475 WDI_ASSERT(0);
17476 return WDI_STATUS_E_FAILURE;
17477 }
17478
17479 /*-------------------------------------------------------------------------
17480 Extract indication and send it to UMAC
17481 -------------------------------------------------------------------------*/
17482 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
17483 pEventData->pEventData,
17484 sizeof(tHalRSSINotification));
17485
17486 /*Fill in the indication parameters*/
17487 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
17488 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
17489 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
17490 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
17491 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
17492 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
17493 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
17494 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
17495 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
17496 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
17497 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
17498 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
17499 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
17500
17501 /*Notify UMAC*/
17502 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17503
17504 return WDI_STATUS_SUCCESS;
17505}/*WDI_ProcessLowRSSIInd*/
17506
17507
17508/**
17509 @brief Process Missed Beacon Indication function (called when
17510 an indication of this kind is being received over the
17511 bus from HAL)
17512
17513 @param pWDICtx: pointer to the WLAN DAL context
17514 pEventData: pointer to the event information structure
17515
17516 @see
17517 @return Result of the function call
17518*/
17519WDI_Status
17520WDI_ProcessMissedBeaconInd
17521(
17522 WDI_ControlBlockType* pWDICtx,
17523 WDI_EventInfoType* pEventData
17524)
17525{
17526 WDI_Status wdiStatus;
17527 eHalStatus halStatus;
17528 WDI_LowLevelIndType wdiInd;
17529 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17530
17531 /*-------------------------------------------------------------------------
17532 Sanity check
17533 -------------------------------------------------------------------------*/
17534 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17535 ( NULL == pEventData->pEventData))
17536 {
17537 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17538 "%s: Invalid parameters", __FUNCTION__);
17539 WDI_ASSERT(0);
17540 return WDI_STATUS_E_FAILURE;
17541 }
17542
17543 /*-------------------------------------------------------------------------
17544 Extract indication and send it to UMAC
17545 -------------------------------------------------------------------------*/
17546 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17547 halStatus = *((eHalStatus*)pEventData->pEventData);
17548 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17549
17550 /*Fill in the indication parameters*/
17551 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
17552
17553 /*Notify UMAC*/
17554 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17555
17556 return WDI_STATUS_SUCCESS;
17557}/*WDI_ProcessMissedBeaconInd*/
17558
17559
17560/**
17561 @brief Process Unk Addr Frame Indication function (called when
17562 an indication of this kind is being received over the
17563 bus from HAL)
17564
17565 @param pWDICtx: pointer to the WLAN DAL context
17566 pEventData: pointer to the event information structure
17567
17568 @see
17569 @return Result of the function call
17570*/
17571WDI_Status
17572WDI_ProcessUnkAddrFrameInd
17573(
17574 WDI_ControlBlockType* pWDICtx,
17575 WDI_EventInfoType* pEventData
17576)
17577{
17578 WDI_Status wdiStatus;
17579 eHalStatus halStatus;
17580 WDI_LowLevelIndType wdiInd;
17581 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17582
17583 /*-------------------------------------------------------------------------
17584 Sanity check
17585 -------------------------------------------------------------------------*/
17586 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17587 ( NULL == pEventData->pEventData))
17588 {
17589 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17590 "%s: Invalid parameters", __FUNCTION__);
17591 WDI_ASSERT(0);
17592 return WDI_STATUS_E_FAILURE;
17593 }
17594
17595 /*-------------------------------------------------------------------------
17596 Extract indication and send it to UMAC
17597 -------------------------------------------------------------------------*/
17598 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17599 halStatus = *((eHalStatus*)pEventData->pEventData);
17600 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17601
17602 /*Fill in the indication parameters*/
17603 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
17604 /* ! TO DO - fill in from HAL struct:
17605 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
17606
17607 /*Notify UMAC*/
17608 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17609
17610 return WDI_STATUS_SUCCESS;
17611}/*WDI_ProcessUnkAddrFrameInd*/
17612
17613
17614/**
17615 @brief Process MIC Failure Indication function (called when an
17616 indication of this kind is being received over the bus
17617 from HAL)
17618
17619 @param pWDICtx: pointer to the WLAN DAL context
17620 pEventData: pointer to the event information structure
17621
17622 @see
17623 @return Result of the function call
17624*/
17625WDI_Status
17626WDI_ProcessMicFailureInd
17627(
17628 WDI_ControlBlockType* pWDICtx,
17629 WDI_EventInfoType* pEventData
17630)
17631{
17632 WDI_LowLevelIndType wdiInd;
17633 tpSirMicFailureInd pHalMicFailureInd;
17634
17635 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17636
17637 /*-------------------------------------------------------------------------
17638 Sanity check
17639 -------------------------------------------------------------------------*/
17640 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17641 ( NULL == pEventData->pEventData))
17642 {
17643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17644 "%s: Invalid parameters", __FUNCTION__);
17645 WDI_ASSERT(0);
17646 return WDI_STATUS_E_FAILURE;
17647 }
17648
17649 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
17650 /*-------------------------------------------------------------------------
17651 Extract indication and send it to UMAC
17652 -------------------------------------------------------------------------*/
17653
17654 /*Fill in the indication parameters*/
17655 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
17656 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
17657 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
17658 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
17659 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
17660 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
17661 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
17662 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
17663 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
17664 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
17665 pHalMicFailureInd->info.multicast;
17666 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
17667 pHalMicFailureInd->info.IV1;
17668 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
17669 pHalMicFailureInd->info.keyId;
17670 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
17671 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
17672 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
17673 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
17674 /*Notify UMAC*/
17675 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17676
17677 return WDI_STATUS_SUCCESS;
17678}/*WDI_ProcessMicFailureInd*/
17679
17680
17681/**
17682 @brief Process Fatal Failure Indication function (called when
17683 an indication of this kind is being received over the
17684 bus from HAL)
17685
17686 @param pWDICtx: pointer to the WLAN DAL context
17687 pEventData: pointer to the event information structure
17688
17689 @see
17690 @return Result of the function call
17691*/
17692WDI_Status
17693WDI_ProcessFatalErrorInd
17694(
17695 WDI_ControlBlockType* pWDICtx,
17696 WDI_EventInfoType* pEventData
17697)
17698{
17699 WDI_Status wdiStatus;
17700 eHalStatus halStatus;
17701 WDI_LowLevelIndType wdiInd;
17702 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17703
17704 /*-------------------------------------------------------------------------
17705 Sanity check
17706 -------------------------------------------------------------------------*/
17707 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17708 ( NULL == pEventData->pEventData))
17709 {
17710 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17711 "%s: Invalid parameters", __FUNCTION__);
17712 WDI_ASSERT(0);
17713 return WDI_STATUS_E_FAILURE;
17714 }
17715
17716 /*-------------------------------------------------------------------------
17717 Extract indication and send it to UMAC
17718 -------------------------------------------------------------------------*/
17719
17720 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17721 halStatus = *((eHalStatus*)pEventData->pEventData);
17722 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17723
17724 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17725 "Fatal failure received from device %d ", halStatus );
17726
17727 /*Fill in the indication parameters*/
17728 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
17729 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
17730
17731 /*Notify UMAC*/
17732 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17733
17734 return WDI_STATUS_SUCCESS;
17735}/*WDI_ProcessFatalErrorInd*/
17736
17737/**
17738 @brief Process Delete STA Indication function (called when
17739 an indication of this kind is being received over the
17740 bus from HAL)
17741
17742 @param pWDICtx: pointer to the WLAN DAL context
17743 pEventData: pointer to the event information structure
17744
17745 @see
17746 @return Result of the function call
17747*/
17748WDI_Status
17749WDI_ProcessDelSTAInd
17750(
17751 WDI_ControlBlockType* pWDICtx,
17752 WDI_EventInfoType* pEventData
17753)
17754{
17755 tDeleteStaContextParams halDelSTACtx;
17756 WDI_LowLevelIndType wdiInd;
17757 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17758
17759 /*-------------------------------------------------------------------------
17760 Sanity check
17761 -------------------------------------------------------------------------*/
17762 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17763 ( NULL == pEventData->pEventData))
17764 {
17765 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17766 "%s: Invalid parameters", __FUNCTION__);
17767 WDI_ASSERT(0);
17768 return WDI_STATUS_E_FAILURE;
17769 }
17770
17771 /*-------------------------------------------------------------------------
17772 Extract indication and send it to UMAC
17773 -------------------------------------------------------------------------*/
17774
17775 /* Parameters need to be unpacked according to HAL struct*/
17776 wpalMemoryCopy( &halDelSTACtx,
17777 pEventData->pEventData,
17778 sizeof(halDelSTACtx));
17779
17780 /*Fill in the indication parameters*/
17781 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
17782
17783 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
17784 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
17785 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
17786 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
17787
17788 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
17789 halDelSTACtx.assocId;
17790 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
17791 halDelSTACtx.staId;
17792 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
17793 halDelSTACtx.reasonCode;
17794
17795 /*Notify UMAC*/
17796 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17797
17798 return WDI_STATUS_SUCCESS;
17799}/*WDI_ProcessDelSTAInd*/
17800
17801/**
17802*@brief Process Coex Indication function (called when
17803 an indication of this kind is being received over the
17804 bus from HAL)
17805
17806 @param pWDICtx: pointer to the WLAN DAL context
17807 pEventData: pointer to the event information structure
17808
17809 @see
17810 @return Result of the function call
17811*/
17812WDI_Status
17813WDI_ProcessCoexInd
17814(
17815 WDI_ControlBlockType* pWDICtx,
17816 WDI_EventInfoType* pEventData
17817)
17818{
17819 WDI_LowLevelIndType wdiInd;
17820 tCoexIndMsg halCoexIndMsg;
17821 wpt_uint32 index;
17822 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17823
17824 /*-------------------------------------------------------------------------
17825 Sanity check
17826 -------------------------------------------------------------------------*/
17827 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17828 ( NULL == pEventData->pEventData ))
17829 {
17830 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17831 "%s: Invalid parameters", __FUNCTION__);
17832 WDI_ASSERT( 0 );
17833 return WDI_STATUS_E_FAILURE;
17834 }
17835
17836 /*-------------------------------------------------------------------------
17837 Extract indication and send it to UMAC
17838 -------------------------------------------------------------------------*/
17839 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
17840 pEventData->pEventData,
17841 sizeof(halCoexIndMsg.coexIndParams) );
17842
17843 /*Fill in the indication parameters*/
17844 wdiInd.wdiIndicationType = WDI_COEX_IND;
17845 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
17846 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
17847 {
17848 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
17849 }
17850
17851 // DEBUG
17852 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
17853 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
17854 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
17855 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
17856 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
17857 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
17858 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
17859
17860 /*Notify UMAC*/
17861 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17862
17863 return WDI_STATUS_SUCCESS;
17864}/*WDI_ProcessCoexInd*/
17865
17866/**
17867*@brief Process Tx Complete Indication function (called when
17868 an indication of this kind is being received over the
17869 bus from HAL)
17870
17871 @param pWDICtx: pointer to the WLAN DAL context
17872 pEventData: pointer to the event information structure
17873
17874 @see
17875 @return Result of the function call
17876*/
17877WDI_Status
17878WDI_ProcessTxCompleteInd
17879(
17880 WDI_ControlBlockType* pWDICtx,
17881 WDI_EventInfoType* pEventData
17882)
17883{
17884 WDI_LowLevelIndType wdiInd;
17885 tTxComplIndMsg halTxComplIndMsg;
17886 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17887
17888 /*-------------------------------------------------------------------------
17889 Sanity check
17890 -------------------------------------------------------------------------*/
17891 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17892 ( NULL == pEventData->pEventData ))
17893 {
17894 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17895 "%s: Invalid parameters", __FUNCTION__);
17896 WDI_ASSERT( 0 );
17897 return WDI_STATUS_E_FAILURE;
17898 }
17899
17900 /*-------------------------------------------------------------------------
17901 Extract indication and send it to UMAC
17902 -------------------------------------------------------------------------*/
17903 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
17904 pEventData->pEventData,
17905 sizeof(halTxComplIndMsg.txComplParams) );
17906
17907 /*Fill in the indication parameters*/
17908 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
17909 wdiInd.wdiIndicationData.tx_complete_status
17910 = halTxComplIndMsg.txComplParams.status;
17911
17912 /*Notify UMAC*/
17913 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17914
17915 return WDI_STATUS_SUCCESS;
17916}/*WDI_ProcessTxCompleteInd*/
17917
17918#ifdef WLAN_FEATURE_P2P
17919/**
17920*@brief Process Noa Attr Indication function (called when
17921 an indication of this kind is being received over the
17922 bus from HAL)
17923
17924 @param pWDICtx: pointer to the WLAN DAL context
17925 pEventData: pointer to the event information structure
17926
17927 @see
17928 @return Result of the function call
17929*/
17930WDI_Status
17931WDI_ProcessP2pNoaAttrInd
17932(
17933 WDI_ControlBlockType* pWDICtx,
17934 WDI_EventInfoType* pEventData
17935)
17936{
17937 WDI_LowLevelIndType wdiInd;
17938 tNoaAttrIndMsg halNoaAttrIndMsg;
17939 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17940
17941 /*-------------------------------------------------------------------------
17942 Sanity check
17943 -------------------------------------------------------------------------*/
17944 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17945 ( NULL == pEventData->pEventData ))
17946 {
17947 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17948 "%s: Invalid parameters", __FUNCTION__);
17949 WDI_ASSERT( 0 );
17950 return WDI_STATUS_E_FAILURE;
17951 }
17952
17953 /*-------------------------------------------------------------------------
17954 Extract indication and send it to UMAC
17955 -------------------------------------------------------------------------*/
17956 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
17957 pEventData->pEventData,
17958 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
17959
17960 /*Fill in the indication parameters*/
17961 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
17962
17963 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
17964 = halNoaAttrIndMsg.noaAttrIndParams.status;
17965
17966 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
17967 = halNoaAttrIndMsg.noaAttrIndParams.index;
17968 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
17969 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
17970 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
17971 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
17972
17973 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
17974 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
17975 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
17976 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
17977 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
17978 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
17979 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
17980 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
17981
17982 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
17983 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
17984 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
17985 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
17986 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
17987 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
17988 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
17989 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
17990
17991 /*Notify UMAC*/
17992 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17993
17994 return WDI_STATUS_SUCCESS;
17995}/*WDI_ProcessNoaAttrInd*/
17996#endif
17997
17998/**
17999 @brief Process Tx PER Hit Indication function (called when
18000 an indication of this kind is being received over the
18001 bus from HAL)
18002
18003 @param pWDICtx: pointer to the WLAN DAL context
18004 pEventData: pointer to the event information structure
18005
18006 @see
18007 @return Result of the function call
18008*/
18009WDI_Status
18010WDI_ProcessTxPerHitInd
18011(
18012 WDI_ControlBlockType* pWDICtx,
18013 WDI_EventInfoType* pEventData
18014)
18015{
18016 WDI_LowLevelIndType wdiInd;
18017 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18018
18019 /*-------------------------------------------------------------------------
18020 Extract indication and send it to UMAC
18021 -------------------------------------------------------------------------*/
18022 /*Fill in the indication parameters*/
18023 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18024
18025 /*Notify UMAC*/
18026 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18027
18028 return WDI_STATUS_SUCCESS;
18029}/*WDI_ProcessTxPerHitInd*/
18030
18031#ifdef ANI_MANF_DIAG
18032/**
18033 @brief WDI_ProcessFTMCommandReq
18034 Process FTM Command, simply route to HAL
18035
18036 @param pWDICtx: pointer to the WLAN DAL context
18037 pEventData: pointer to the event information structure
18038
18039 @see
18040 @return Result of the function call
18041*/
18042WDI_Status
18043WDI_ProcessFTMCommandReq
18044(
18045 WDI_ControlBlockType* pWDICtx,
18046 WDI_EventInfoType* pEventData
18047)
18048{
18049 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18050 wpt_uint8 *ftmCommandBuffer = NULL;
18051 wpt_uint16 dataOffset;
18052 wpt_uint16 bufferSize;
18053 /*-------------------------------------------------------------------------
18054 Sanity check
18055 -------------------------------------------------------------------------*/
18056 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18057 ( NULL == pEventData->pEventData))
18058
18059 {
18060 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18061 "%s: Invalid parameters", __FUNCTION__);
18062 WDI_ASSERT(0);
18063 return WDI_STATUS_E_FAILURE;
18064 }
18065
18066 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18067
18068 /* Get MSG Buffer */
18069 WDI_GetMessageBuffer(pWDICtx,
18070 WDI_FTM_CMD_REQ,
18071 ftmCommandReq->bodyLength,
18072 &ftmCommandBuffer,
18073 &dataOffset,
18074 &bufferSize);
18075
18076 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18077 ftmCommandReq->FTMCommandBody,
18078 ftmCommandReq->bodyLength);
18079
18080 /* Send MSG */
18081 return WDI_SendMsg(pWDICtx,
18082 ftmCommandBuffer,
18083 bufferSize,
18084 pEventData->pCBfnc,
18085 pEventData->pUserData,
18086 WDI_FTM_CMD_RESP);
18087}
18088
18089/**
18090 @brief WDI_ProcessFTMCommandRsp
18091 Process FTM Command Response from HAL, simply route to HDD FTM
18092
18093 @param pWDICtx: pointer to the WLAN DAL context
18094 pEventData: pointer to the event information structure
18095
18096 @see
18097 @return Result of the function call
18098*/
18099WDI_Status
18100WDI_ProcessFTMCommandRsp
18101(
18102 WDI_ControlBlockType* pWDICtx,
18103 WDI_EventInfoType* pEventData
18104)
18105{
18106 WDI_FTMCommandRspCb ftmCMDRspCb;
18107 tProcessPttRspParams *ftmCMDRspData = NULL;
18108 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18109
18110 /*-------------------------------------------------------------------------
18111 Sanity check
18112 -------------------------------------------------------------------------*/
18113 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18114 ( NULL == pEventData->pEventData))
18115 {
18116 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18117 "%s: Invalid parameters", __FUNCTION__);
18118 WDI_ASSERT(0);
18119 return WDI_STATUS_E_FAILURE;
18120 }
18121
18122 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18123
18124 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18125
18126 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18127 (void *)&ftmCMDRspData->pttMsgBuffer,
18128 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18129
18130 /*Notify UMAC*/
18131 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18132
18133 return WDI_STATUS_SUCCESS;
18134}
18135#endif /* ANI_MANF_DIAG */
18136/**
18137 @brief WDI_ProcessHalDumpCmdReq
18138 Process hal dump Command, simply route to HAL
18139
18140 @param pWDICtx: pointer to the WLAN DAL context
18141 pEventData: pointer to the event information structure
18142
18143 @see
18144 @return Result of the function call
18145*/
18146WDI_Status
18147WDI_ProcessHALDumpCmdReq
18148(
18149 WDI_ControlBlockType* pWDICtx,
18150 WDI_EventInfoType* pEventData
18151)
18152{
18153 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18154 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18155 wpt_uint16 usDataOffset = 0;
18156 wpt_uint16 usSendSize = 0;
18157 tHalDumpCmdReqMsg halDumpCmdReqMsg;
18158 wpt_uint8* pSendBuffer = NULL;
18159
18160 /*-------------------------------------------------------------------------
18161 Sanity check
18162 -------------------------------------------------------------------------*/
18163 if (( NULL == pEventData ) ||
18164 ( NULL == pEventData->pEventData) ||
18165 ( NULL == pEventData->pCBfnc ))
18166 {
18167 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18168 "%s: Invalid parameters", __FUNCTION__);
18169 WDI_ASSERT(0);
18170 return WDI_STATUS_E_FAILURE;
18171 }
18172
18173 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18174 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18175
18176 /* Copying the HAL DUMP Command Information HAL Structure*/
18177 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
18178 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
18179 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
18180 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
18181 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
18182 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
18183 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
18184 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
18185 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
18186 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
18187
18188 /*-----------------------------------------------------------------------
18189 Get message buffer
18190 -----------------------------------------------------------------------*/
18191 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
18192 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18193 &pSendBuffer, &usDataOffset, &usSendSize))||
18194 ( usSendSize <
18195 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18196 {
18197 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18198 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18199 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18200 WDI_ASSERT(0);
18201 return WDI_STATUS_E_FAILURE;
18202 }
18203
18204 wpalMemoryCopy( pSendBuffer+usDataOffset,
18205 &halDumpCmdReqMsg.dumpCmdReqParams,
18206 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
18207
18208 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
18209 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
18210
18211 /*-------------------------------------------------------------------------
18212 Send Start Request to HAL
18213 -------------------------------------------------------------------------*/
18214 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18215 wdiHALDumpCmdRspCb, pEventData->pUserData,
18216 WDI_HAL_DUMP_CMD_RESP);
18217}
18218
18219/**
18220 @brief WDI_ProcessHalDumpCmdRsp
18221 Process hal Dump Command Response from HAL, simply route to HDD
18222
18223 @param pWDICtx: pointer to the WLAN DAL context
18224 pEventData: pointer to the event information structure
18225
18226 @see
18227 @return Result of the function call
18228*/
18229WDI_Status
18230WDI_ProcessHALDumpCmdRsp
18231(
18232 WDI_ControlBlockType* pWDICtx,
18233 WDI_EventInfoType* pEventData
18234)
18235{
18236 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18237 tpHalDumpCmdRspParams halDumpCmdRspParams;
18238 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18239
18240 /*-------------------------------------------------------------------------
18241 Sanity check
18242 -------------------------------------------------------------------------*/
18243 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18244 ( NULL == pEventData->pEventData))
18245 {
18246 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18247 "%s: Invalid parameters", __FUNCTION__);
18248 WDI_ASSERT(0);
18249 return WDI_STATUS_E_FAILURE;
18250 }
18251
18252 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
18253
18254 /*Initialize the WDI Response structure */
18255 wdiHALDumpCmdRsp.usBufferLen = 0;
18256 wdiHALDumpCmdRsp.pBuffer = NULL;
18257
18258 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
18259
18260 wdiHALDumpCmdRsp.wdiStatus =
18261 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
18262
18263 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18264 (halDumpCmdRspParams->rspLength != 0))
18265 {
18266 /* Copy the response data */
18267 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18268 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
18269 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18270 wdiHALDumpCmdRsp.pBuffer,
18271 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18272 }
18273
18274 /*Notify UMAC*/
18275 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18276
18277 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18278 {
18279 /* Free the allocated buffer */
18280 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18281 }
18282 return WDI_STATUS_SUCCESS;
18283}
18284
18285/*==========================================================================
18286 CONTRL TRANSPORT INTERACTION
18287
18288 Callback function registered with the control transport - for receiving
18289 notifications and packets
18290==========================================================================*/
18291/**
18292 @brief This callback is invoked by the control transport
18293 when it wishes to send up a notification like the ones
18294 mentioned above.
18295
18296 @param
18297
18298 wctsHandle: handle to the control transport service
18299 wctsEvent: the event being notified
18300 wctsNotifyCBData: the callback data of the user
18301
18302 @see WCTS_OpenTransport
18303
18304 @return None
18305*/
18306void
18307WDI_NotifyMsgCTSCB
18308(
18309 WCTS_HandleType wctsHandle,
18310 WCTS_NotifyEventType wctsEvent,
18311 void* wctsNotifyCBData
18312)
18313{
18314 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
18315 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18316
18317 if (NULL == pWDICtx )
18318 {
18319 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18320 "%s: Invalid parameters", __FUNCTION__);
18321 WDI_ASSERT(0);
18322 return;
18323 }
18324
18325 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18326 {
18327 /* callback presumably occurred after close */
18328 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18329 "%s: Invalid control block", __FUNCTION__);
18330 return;
18331 }
18332
18333 if ( WCTS_EVENT_OPEN == wctsEvent )
18334 {
18335 /*Flag must be set atomically as it is checked from incoming request
18336 functions*/
18337 wpalMutexAcquire(&pWDICtx->wptMutex);
18338 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
18339
18340 /*Nothing to do - so try to dequeue any pending request that may have
18341 occurred while we were trying to establish this*/
18342 WDI_DequeuePendingReq(pWDICtx);
18343 wpalMutexRelease(&pWDICtx->wptMutex);
18344 }
18345 else if ( WCTS_EVENT_CLOSE == wctsEvent )
18346 {
18347 /*Flag must be set atomically as it is checked from incoming request
18348 functions*/
18349 wpalMutexAcquire(&pWDICtx->wptMutex);
18350 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
18351
18352 /*No other request will be processed from now on - fail all*/
18353 WDI_ClearPendingRequests(pWDICtx);
18354 wpalMutexRelease(&pWDICtx->wptMutex);
18355
18356 /*Notify that the Control Channel is closed */
18357 wpalEventSet(&pWDICtx->wctsActionEvent);
18358 }
18359
18360}/*WDI_NotifyMsgCTSCB*/
18361
18362
18363/**
18364 @brief This callback is invoked by the control transport
18365 when it wishes to send up a packet received over the
18366 bus.
18367
18368 @param
18369
18370 wctsHandle: handle to the control transport service
18371 pMsg: the packet
18372 uLen: the packet length
18373 wctsRxMsgCBData: the callback data of the user
18374
18375 @see WCTS_OpenTransport
18376
18377 @return None
18378*/
18379void
18380WDI_RXMsgCTSCB
18381(
18382 WCTS_HandleType wctsHandle,
18383 void* pMsg,
18384 wpt_uint32 uLen,
18385 void* wctsRxMsgCBData
18386)
18387{
18388 tHalMsgHeader *pHalMsgHeader;
18389 WDI_EventInfoType wdiEventData;
18390 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18391 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18392
18393 /*------------------------------------------------------------------------
18394 Sanity check
18395 ------------------------------------------------------------------------*/
18396 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
18397 ( uLen < sizeof(tHalMsgHeader)))
18398 {
18399 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18400 "%s: Invalid parameters", __FUNCTION__);
18401 WDI_ASSERT(0);
18402 return;
18403 }
18404
18405 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18406 {
18407 /* callback presumably occurred after close */
18408 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18409 "%s: Invalid control block", __FUNCTION__);
18410 return;
18411 }
18412
18413 /*The RX Callback is expected to be serialized in the proper control thread
18414 context - so no serialization is necessary here
18415 ! - revisit this assumption */
18416
18417 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18418
18419 if ( uLen != pHalMsgHeader->msgLen )
18420 {
18421 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18422 "Invalid packet received from HAL - catastrophic failure");
18423 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18424 return;
18425 }
18426
18427 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18428
18429 /*The message itself starts after the header*/
18430 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18431 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18432 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18433 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18434
18435
18436 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18437 {
18438 /*Stop the timer as the response was received */
18439 /*!UT - check for potential race conditions between stop and response */
18440 wpalTimerStop(&pWDICtx->wptResponseTimer);
18441 }
18442 /* Check if we receive a response message which is not expected */
18443 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
18444 {
18445 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18446 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
18447 WDI_getRespMsgString(wdiEventData.wdiResponse),
18448 wdiEventData.wdiResponse,
18449 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18450 pWDICtx->wdiExpectedResponse);
18451 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
18452 return;
18453 }
18454
18455 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18456 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
18457
18458 /*Post response event to the state machine*/
18459 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
18460
18461}/*WDI_RXMsgCTSCB*/
18462
18463
18464/*========================================================================
18465 Internal Helper Routines
18466========================================================================*/
18467
18468/**
18469 @brief WDI_CleanCB - internal helper routine used to clean the
18470 WDI Main Control Block
18471
18472 @param pWDICtx - pointer to the control block
18473
18474 @return Result of the function call
18475*/
18476WPT_INLINE WDI_Status
18477WDI_CleanCB
18478(
18479 WDI_ControlBlockType* pWDICtx
18480)
18481{
18482 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18483
18484 /*Clean the WDI Control Block*/
18485 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
18486
18487 pWDICtx->uGlobalState = WDI_MAX_ST;
18488 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
18489 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
18490
18491 WDI_ResetAssocSessions( pWDICtx );
18492
18493 return WDI_STATUS_SUCCESS;
18494}/*WDI_CleanCB*/
18495
18496
18497/**
18498 @brief Process request helper function
18499
18500
18501 @param pWDICtx: pointer to the WLAN DAL context
18502 pEventData: pointer to the event information structure
18503
18504 @see
18505 @return Result of the function call
18506*/
18507WPT_INLINE WDI_Status
18508WDI_ProcessRequest
18509(
18510 WDI_ControlBlockType* pWDICtx,
18511 WDI_EventInfoType* pEventData
18512)
18513{
18514 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18515
18516 /*!! Skip sanity check as this is called from the FSM functionss which
18517 already checked these pointers*/
18518
18519 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
18520 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
18521 {
18522 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18523 "Calling request processing function for req %s (%d) %x",
18524 WDI_getReqMsgString(pEventData->wdiRequest),
18525 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
18526 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
18527 }
18528 else
18529 {
18530 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18531 "Operation %d is not yet implemented ",
18532 pEventData->wdiRequest);
18533 return WDI_STATUS_E_NOT_IMPLEMENT;
18534 }
18535}/*WDI_ProcessRequest*/
18536
18537
18538/**
18539 @brief Get message helper function - it allocates memory for a
18540 message that is to be sent to HAL accross the bus and
18541 prefixes it with a send message header
18542
18543 @param pWDICtx: pointer to the WLAN DAL context
18544 wdiReqType: type of the request being sent
18545 uBufferLen: message buffer len
18546 pMsgBuffer: resulting allocated buffer
18547 pusDataOffset: offset in the buffer where the caller
18548 can start copying its message data
18549 puBufferSize: the resulting buffer size (offset+buff
18550 len)
18551
18552 @see
18553 @return Result of the function call
18554*/
18555WDI_Status
18556WDI_GetMessageBuffer
18557(
18558 WDI_ControlBlockType* pWDICtx,
18559 WDI_RequestEnumType wdiReqType,
18560 wpt_uint16 usBufferLen,
18561 wpt_uint8** pMsgBuffer,
18562 wpt_uint16* pusDataOffset,
18563 wpt_uint16* pusBufferSize
18564)
18565{
18566 tHalMsgHeader halMsgHeader;
18567 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18568
18569 /*!! No sanity check here as we trust the called - ! check this assumption
18570 again*/
18571
18572 /*-------------------------------------------------------------------------
18573 Try to allocate message buffer from PAL
18574 -------------------------------------------------------------------------*/
18575 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
18576 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
18577 if ( NULL == *pMsgBuffer )
18578 {
18579 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18580 "Unable to allocate message buffer for req %s (%d)",
18581 WDI_getReqMsgString(wdiReqType),
18582 wdiReqType);
18583 WDI_ASSERT(0);
18584 return WDI_STATUS_MEM_FAILURE;
18585 }
18586
18587 /*-------------------------------------------------------------------------
18588 Fill in the message header
18589 -------------------------------------------------------------------------*/
18590 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
18591 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
18592 *pusDataOffset = sizeof(halMsgHeader);
18593 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
18594
18595 return WDI_STATUS_SUCCESS;
18596}/*WDI_GetMessageBuffer*/
18597
18598
18599/**
18600 @brief Send message helper function - sends a message over the
18601 bus using the control tranport and saves some info in
18602 the CB
18603
18604 @param pWDICtx: pointer to the WLAN DAL context
18605 pSendBuffer: buffer to be sent
18606
18607 usSendSize size of the buffer to be sent
18608 pRspCb: response callback - save in the WDI
18609 CB
18610 pUserData: user data associated with the
18611 callback
18612 wdiExpectedResponse: the code of the response that is
18613 expected to be rx-ed for this request
18614
18615 @see
18616 @return Result of the function call
18617*/
18618WDI_Status
18619WDI_SendMsg
18620(
18621 WDI_ControlBlockType* pWDICtx,
18622 wpt_uint8* pSendBuffer,
18623 wpt_uint32 usSendSize,
18624 void* pRspCb,
18625 void* pUserData,
18626 WDI_ResponseEnumType wdiExpectedResponse
18627)
18628{
Jeff Johnsond13512a2012-07-17 11:42:19 -070018629 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018630 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18631
18632 /*------------------------------------------------------------------------
18633 Save needed info in the CB
18634 ------------------------------------------------------------------------*/
18635 pWDICtx->pRspCBUserData = pUserData;
18636 pWDICtx->pfncRspCB = pRspCb;
18637 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
18638
18639 /*-----------------------------------------------------------------------
18640 Call the CTS to send this message over - free message afterwards
18641 - notify transport failure
18642 Note: CTS is reponsible for freeing the message buffer.
18643 -----------------------------------------------------------------------*/
18644 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
18645 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070018646 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070018647 "Failed to send message over the bus - catastrophic failure");
18648
Jeff Johnsond13512a2012-07-17 11:42:19 -070018649 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018650 }
18651
Jeff Johnsond13512a2012-07-17 11:42:19 -070018652 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070018653 if ( NULL != pWDICtx->wdiReqStatusCB )
18654 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070018655 /*Inform originator whether request went through or not*/
18656 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
18657 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018658 pWDICtx->wdiReqStatusCB = NULL;
18659 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070018660 callback(wdiStatus, callbackContext);
18661
18662 /*For WDI requests which have registered a request callback,
18663 inform the WDA caller of the same via setting the return value
18664 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
18665 end up repeating the functonality in the req callback for the
18666 WDI_STATUS_E_FAILURE case*/
18667 if (wdiStatus == WDI_STATUS_E_FAILURE)
18668 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070018669 }
18670
Jeff Johnsond13512a2012-07-17 11:42:19 -070018671 if ( wdiStatus == WDI_STATUS_SUCCESS )
18672 {
Jeff Johnson295189b2012-06-20 16:38:30 -070018673 /*Start timer for the expected response */
18674 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070018675 }
18676 else
18677 {
18678 /*Inform upper stack layers that a transport fatal error occured*/
18679 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
18680 }
Jeff Johnson295189b2012-06-20 16:38:30 -070018681
Jeff Johnsond13512a2012-07-17 11:42:19 -070018682 return wdiStatus;
18683
Jeff Johnson295189b2012-06-20 16:38:30 -070018684}/*WDI_SendMsg*/
18685
18686
18687
18688/**
18689 @brief Send indication helper function - sends a message over
18690 the bus using the control transport and saves some info
18691 in the CB
18692
18693 @param pWDICtx: pointer to the WLAN DAL context
18694 pSendBuffer: buffer to be sent
18695 usSendSize: size of the buffer to be sent
18696
18697 @see
18698 @return Result of the function call
18699*/
18700WDI_Status
18701WDI_SendIndication
18702(
18703 WDI_ControlBlockType* pWDICtx,
18704 wpt_uint8* pSendBuffer,
18705 wpt_uint32 usSendSize
18706)
18707{
18708 wpt_uint32 uStatus ;
18709 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18710
18711 /*-----------------------------------------------------------------------
18712 Call the CTS to send this message over
18713 Note: CTS is reponsible for freeing the message buffer.
18714 -----------------------------------------------------------------------*/
18715 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
18716 (void*)pSendBuffer, usSendSize );
18717
18718 /*Inform Upper MAC about the outcome of the request*/
18719 if ( NULL != pWDICtx->wdiReqStatusCB )
18720 {
18721 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18722 "Send indication status : %d", uStatus);
18723
18724 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
18725 WDI_STATUS_SUCCESS,
18726 pWDICtx->pReqStatusUserData);
18727 }
18728
18729 /*If sending of the message failed - it is considered catastrophic and
18730 indicates an error with the device*/
18731 if ( 0 != uStatus)
18732 {
18733 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18734 "Failed to send indication over the bus - catastrophic failure");
18735
18736 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
18737 return WDI_STATUS_E_FAILURE;
18738 }
18739
18740 return WDI_STATUS_SUCCESS;
18741}/*WDI_SendIndication*/
18742
18743
18744/**
18745 @brief WDI_DetectedDeviceError - called internally by DAL when
18746 it has detected a failure in the device
18747
18748 @param pWDICtx: pointer to the WLAN DAL context
18749 usErrorCode: error code detected by WDI or received
18750 from HAL
18751
18752 @see
18753 @return None
18754*/
18755void
18756WDI_DetectedDeviceError
18757(
18758 WDI_ControlBlockType* pWDICtx,
18759 wpt_uint16 usErrorCode
18760)
18761{
18762 WDI_LowLevelIndType wdiInd;
18763 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18764
18765 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18766 "Device Error detected code: %d - transitioning to stopped state",
18767 usErrorCode);
18768
18769 wpalMutexAcquire(&pWDICtx->wptMutex);
18770
18771 WDI_STATableStop(pWDICtx);
18772
18773 WDI_ResetAssocSessions(pWDICtx);
18774
18775 /*Set the expected state transition to stopped - because the device
18776 experienced a failure*/
18777 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
18778
18779 /*Transition to stopped to fail all incomming requests from this point on*/
18780 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
18781
18782 WDI_ClearPendingRequests(pWDICtx);
18783
18784 /*TO DO: - there should be an attempt to reset the device here*/
18785
18786 wpalMutexRelease(&pWDICtx->wptMutex);
18787
18788 /*------------------------------------------------------------------------
18789 Notify UMAC if a handler is registered
18790 ------------------------------------------------------------------------*/
18791 if (pWDICtx->wdiLowLevelIndCB)
18792 {
18793 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18794 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
18795
18796 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
18797 }
18798}/*WDI_DetectedDeviceError*/
18799
18800/**
18801 @brief This callback is invoked by the wpt when a timer that
18802 we started on send message has expire - this should
18803 never happen - it means device is stuck and cannot
18804 reply - trigger catastrophic failure
18805 @param
18806
18807 pUserData: the callback data of the user (ptr to WDI CB)
18808
18809 @see
18810 @return None
18811*/
18812void
18813WDI_ResponseTimerCB
18814(
18815 void *pUserData
18816)
18817{
18818 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
18819 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18820
18821 if (NULL == pWDICtx )
18822 {
18823 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18824 "%s: Invalid parameters", __FUNCTION__);
18825 WDI_ASSERT(0);
18826 return;
18827 }
18828
18829 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
18830 {
18831
18832 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18833 "Timeout occurred while waiting for %s (%d) message from device "
18834 " - catastrophic failure",
18835 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18836 pWDICtx->wdiExpectedResponse);
18837 /* WDI timeout means Riva is not responding or SMD communication to Riva
18838 * is not happening. The only possible way to recover from this error
18839 * is to initiate SSR from APPS */
18840 wpalRivaSubystemRestart();
18841 }
18842 else
18843 {
18844 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18845 "Timeout occurred but not waiting for any response %d",
18846 pWDICtx->wdiExpectedResponse);
18847 }
18848
18849 return;
18850
18851}/*WDI_ResponseTimerCB*/
18852
18853
18854/**
18855 @brief Process response helper function
18856
18857
18858 @param pWDICtx: pointer to the WLAN DAL context
18859 pEventData: pointer to the event information structure
18860
18861 @see
18862 @return Result of the function call
18863*/
18864WPT_INLINE WDI_Status
18865WDI_ProcessResponse
18866(
18867 WDI_ControlBlockType* pWDICtx,
18868 WDI_EventInfoType* pEventData
18869)
18870{
18871 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18872
18873 /* Skip sanity check as this is called from the FSM functions which
18874 already checked these pointers
18875 ! - revisit this assumption */
18876 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
18877 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
18878 {
18879 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18880 "Calling response processing function for resp %s (%d) %x",
18881 WDI_getRespMsgString(pEventData->wdiResponse),
18882 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
18883 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
18884 }
18885 else
18886 {
18887 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18888 "Operation %d is not yet implemented ",
18889 pEventData->wdiResponse);
18890 return WDI_STATUS_E_NOT_IMPLEMENT;
18891 }
18892}/*WDI_ProcessResponse*/
18893
18894
18895/*=========================================================================
18896 QUEUE SUPPORT UTILITY FUNCTIONS
18897=========================================================================*/
18898
18899/**
18900 @brief Utility function used by the DAL Core to help queue a
18901 request that cannot be processed right away.
18902 @param
18903
18904 pWDICtx: - pointer to the WDI control block
18905 pEventData: - pointer to the evnt info that needs to be
18906 queued
18907
18908 @see
18909 @return Result of the operation
18910*/
18911WDI_Status
18912WDI_QueuePendingReq
18913(
18914 WDI_ControlBlockType* pWDICtx,
18915 WDI_EventInfoType* pEventData
18916)
18917{
18918 wpt_list_node* pNode;
18919 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
18920 void* pEventInfo = NULL;
18921 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18922
18923 if ( NULL == pEventDataQueue )
18924 {
18925 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18926 "Cannot allocate memory for queueing");
18927 WDI_ASSERT(0);
18928 return WDI_STATUS_MEM_FAILURE;
18929 }
18930
18931 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
18932 pEventDataQueue->pUserData = pEventData->pUserData;
18933 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
18934 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
18935 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
18936
18937 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
18938 {
18939 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
18940
18941 if ( NULL == pEventInfo )
18942 {
18943 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18944 "Cannot allocate memory for queueing event data info");
18945 WDI_ASSERT(0);
18946 wpalMemoryFree(pEventDataQueue);
18947 return WDI_STATUS_MEM_FAILURE;
18948 }
18949
18950 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
18951
18952 }
18953 pEventDataQueue->pEventData = pEventInfo;
18954
18955 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
18956 pNode = (wpt_list_node*)pEventDataQueue;
18957
18958 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
18959
18960 return WDI_STATUS_SUCCESS;
18961}/*WDI_QueuePendingReq*/
18962
18963/**
18964 @brief Callback function for serializing queued message
18965 processing in the control context
18966 @param
18967
18968 pMsg - pointer to the message
18969
18970 @see
18971 @return Result of the operation
18972*/
18973void
18974WDI_PALCtrlMsgCB
18975(
18976 wpt_msg *pMsg
18977)
18978{
18979 WDI_EventInfoType* pEventData = NULL;
18980 WDI_ControlBlockType* pWDICtx = NULL;
18981 WDI_Status wdiStatus;
18982 WDI_ReqStatusCb pfnReqStatusCB;
18983 void* pUserData;
18984 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18985
18986 if (( NULL == pMsg )||
18987 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
18988 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
18989 {
18990 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18991 "Invalid message received on serialize ctrl context API");
18992 WDI_ASSERT(0);
18993 return;
18994 }
18995
18996 /*Transition back to the state that we had before serialization
18997 - serialization transitions us to BUSY to stop any incomming requests
18998 ! TO DO L: possible race condition here if a request comes in between the
18999 state transition and the post function*/
19000
19001 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
19002
19003 /*-----------------------------------------------------------------------
19004 Check to see what type of event we are serializing
19005 - responses are never expected to come through here
19006 -----------------------------------------------------------------------*/
19007 switch ( pEventData->wdiRequest )
19008 {
19009
19010 case WDI_STOP_REQ:
19011
19012 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19013 break;
19014
19015
19016 case WDI_NV_DOWNLOAD_REQ:
19017 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19018 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19019 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19020 {
19021 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19022 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19023 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19024 }
19025 else
19026 {
19027 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19028 }
19029
19030 break;
19031
19032 default:
19033 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19034 break;
19035 }/*switch ( pEventData->wdiRequest )*/
19036
19037 if ( WDI_STATUS_SUCCESS != wdiStatus )
19038 {
19039 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19040
19041 if ( NULL != pfnReqStatusCB )
19042 {
19043 /*Fail the request*/
19044 pfnReqStatusCB( wdiStatus, pUserData);
19045 }
19046 }
19047
19048 /* Free data - that was allocated when queueing*/
19049 if( pEventData != NULL )
19050 {
19051 if( pEventData->pEventData != NULL )
19052 {
19053 wpalMemoryFree(pEventData->pEventData);
19054 }
19055 wpalMemoryFree(pEventData);
19056 }
19057
19058 if( pMsg != NULL )
19059 {
19060 wpalMemoryFree(pMsg);
19061 }
19062
19063}/*WDI_PALCtrlMsgCB*/
19064
19065/**
19066 @brief Utility function used by the DAL Core to help dequeue
19067 and schedule for execution a pending request
19068 @param
19069
19070 pWDICtx: - pointer to the WDI control block
19071 pEventData: - pointer to the evnt info that needs to be
19072 queued
19073
19074 @see
19075 @return Result of the operation
19076*/
19077WDI_Status
19078WDI_DequeuePendingReq
19079(
19080 WDI_ControlBlockType* pWDICtx
19081)
19082{
19083 wpt_list_node* pNode = NULL;
19084 WDI_EventInfoType* pEventData;
19085 wpt_msg* palMsg;
19086 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19087
19088 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
19089
19090 if ( NULL == pNode )
19091 {
19092 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19093 "List is empty - return");
19094 return WDI_STATUS_SUCCESS;
19095 }
19096
19097 /*The node actually points to the 1st element inside the Event Data struct -
19098 just cast it back to the struct*/
19099 pEventData = (WDI_EventInfoType*)pNode;
19100
19101 /*Serialize processing in the control thread
19102 !TO DO: - check to see if these are all the messages params that need
19103 to be filled in*/
19104 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19105
19106 if ( NULL == palMsg )
19107 {
19108 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19109 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
19110 WDI_ASSERT(0);
19111 return WDI_STATUS_MEM_FAILURE;
19112 }
19113 palMsg->pContext = pWDICtx;
19114 palMsg->callback = WDI_PALCtrlMsgCB;
19115 palMsg->ptr = pEventData;
19116
19117 /*Save the global state as we need it on the other side*/
19118 palMsg->val = pWDICtx->uGlobalState;
19119
19120 /*Transition back to BUSY as we need to handle a queued request*/
19121 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
19122
19123 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19124
19125 return WDI_STATUS_PENDING;
19126}/*WDI_DequeuePendingReq*/
19127
19128
19129/**
19130 @brief Utility function used by the DAL Core to help queue
19131 an association request that cannot be processed right
19132 away.- The assoc requests will be queued by BSSID
19133 @param
19134
19135 pWDICtx: - pointer to the WDI control block
19136 pEventData: pointer to the evnt info that needs to be queued
19137 macBSSID: bssid
19138
19139 @see
19140 @return Result of the operation
19141*/
19142WDI_Status
19143WDI_QueueNewAssocRequest
19144(
19145 WDI_ControlBlockType* pWDICtx,
19146 WDI_EventInfoType* pEventData,
19147 wpt_macAddr macBSSID
19148)
19149{
19150 wpt_uint8 i;
19151 WDI_BSSSessionType* pSession = NULL;
19152 wpt_list_node* pNode;
19153 WDI_EventInfoType* pEventDataQueue;
19154 void* pEventInfo;
19155 WDI_NextSessionIdType* pSessionIdElement;
19156 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19157
19158
19159 /*------------------------------------------------------------------------
19160 Search for a session that matches the BSSID
19161 ------------------------------------------------------------------------*/
19162 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19163 {
19164 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19165 {
19166 /*Found an empty session*/
19167 pSession = &pWDICtx->aBSSSessions[i];
19168 break;
19169 }
19170 }
19171
19172 if ( i >= WDI_MAX_BSS_SESSIONS )
19173 {
19174 /*Cannot find any empty sessions*/
19175 return WDI_STATUS_E_FAILURE;
19176 }
19177
19178 /*------------------------------------------------------------------------
19179 Fill in the BSSID for this session and set the usage flag
19180 ------------------------------------------------------------------------*/
19181 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
19182 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
19183
19184 /*------------------------------------------------------------------------
19185 Allocate memory for this and place it in the queue
19186 ------------------------------------------------------------------------*/
19187 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19188 if ( NULL == pEventDataQueue )
19189 {
19190 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19191 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19192 WDI_ASSERT(0);
19193 return WDI_STATUS_MEM_FAILURE;
19194 }
19195
19196 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19197 if ( NULL == pSessionIdElement )
19198 {
19199 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19200 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19201 WDI_ASSERT(0);
19202 wpalMemoryFree(pEventDataQueue);
19203 return WDI_STATUS_MEM_FAILURE;
19204 }
19205
19206 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19207 if ( NULL == pEventInfo )
19208 {
19209 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19210 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19211 WDI_ASSERT(0);
19212 wpalMemoryFree(pSessionIdElement);
19213 wpalMemoryFree(pEventDataQueue);
19214 return WDI_STATUS_MEM_FAILURE;
19215 }
19216
19217 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19218 pEventDataQueue->pUserData = pEventData->pUserData;
19219 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19220 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
19221 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
19222
19223 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19224 pEventDataQueue->pEventData = pEventInfo;
19225
19226 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
19227 pNode = (wpt_list_node*)pEventDataQueue;
19228
19229 /*This association is currently being queued*/
19230 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
19231
19232 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
19233
19234 /*We need to maintain a separate list that keeps track of the order in which
19235 the new assoc requests are being queued such that we can start processing
19236 them in the order that they had arrived*/
19237 pSessionIdElement->ucIndex = i;
19238 pNode = (wpt_list_node*)pSessionIdElement;
19239
19240 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19241 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
19242 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
19243
19244 /*Return pending as this is what the status of the request is since it has
19245 been queued*/
19246 return WDI_STATUS_PENDING;
19247}/*WDI_QueueNewAssocRequest*/
19248
19249/**
19250 @brief Utility function used by the DAL Core to help queue
19251 an association request that cannot be processed right
19252 away.- The assoc requests will be queued by BSSID
19253 @param
19254
19255 pWDICtx: - pointer to the WDI control block
19256 pSession: - session in which to queue
19257 pEventData: pointer to the event info that needs to be
19258 queued
19259
19260 @see
19261 @return Result of the operation
19262*/
19263WDI_Status
19264WDI_QueueAssocRequest
19265(
19266 WDI_ControlBlockType* pWDICtx,
19267 WDI_BSSSessionType* pSession,
19268 WDI_EventInfoType* pEventData
19269)
19270{
19271 wpt_list_node* pNode;
19272 WDI_EventInfoType* pEventDataQueue;
19273 void* pEventInfo;
19274 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19275
19276 /*------------------------------------------------------------------------
19277 Sanity check
19278 ------------------------------------------------------------------------*/
19279 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19280 {
19281 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19282 "%s: Invalid parameters", __FUNCTION__);
19283
19284 return WDI_STATUS_E_FAILURE;
19285 }
19286
19287 /*------------------------------------------------------------------------
19288 Allocate memory for this and place it in the queue
19289 ------------------------------------------------------------------------*/
19290 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19291 if ( NULL == pEventDataQueue )
19292 {
19293 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19294 "%s: Cannot allocate memory for queueing", __FUNCTION__);
19295 WDI_ASSERT(0);
19296 return WDI_STATUS_MEM_FAILURE;
19297 }
19298
19299 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19300 if ( NULL == pEventInfo )
19301 {
19302 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19303 "%s: Cannot allocate memory for queueing event data info",
19304 __FUNCTION__);
19305 WDI_ASSERT(0);
19306 wpalMemoryFree(pEventDataQueue);
19307 return WDI_STATUS_MEM_FAILURE;
19308 }
19309
19310 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19311 pEventDataQueue->pUserData = pEventData->pUserData;
19312 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19313 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
19314 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
19315 pEventDataQueue->pEventData = pEventInfo;
19316
19317 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19318
19319 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
19320 pNode = (wpt_list_node*)pEventDataQueue;
19321
19322 /*This association is currently being queued*/
19323 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
19324
19325 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
19326
19327 /*The result of this operation is pending because the request has been
19328 queued and it will be processed at a later moment in time */
19329 return WDI_STATUS_PENDING;
19330}/*WDI_QueueAssocRequest*/
19331
19332/**
19333 @brief Utility function used by the DAL Core to help dequeue
19334 an association request that was pending
19335 The request will be queued up in front of the main
19336 pending queue for imediate processing
19337 @param
19338
19339 pWDICtx: - pointer to the WDI control block
19340
19341
19342 @see
19343 @return Result of the operation
19344*/
19345WDI_Status
19346WDI_DequeueAssocRequest
19347(
19348 WDI_ControlBlockType* pWDICtx
19349)
19350{
19351 wpt_list_node* pNode = NULL;
19352 WDI_NextSessionIdType* pSessionIdElement;
19353 WDI_BSSSessionType* pSession;
19354 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19355
19356 /*------------------------------------------------------------------------
19357 Sanity check
19358 ------------------------------------------------------------------------*/
19359 if ( NULL == pWDICtx )
19360 {
19361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19362 "%s: Invalid parameters", __FUNCTION__);
19363
19364 return WDI_STATUS_E_FAILURE;
19365 }
19366
19367 /*------------------------------------------------------------------------
19368 An association has been completed => a new association can occur
19369 Check to see if there are any pending associations ->
19370 If so , transfer all the pending requests into the busy queue for
19371 processing
19372 These requests have arrived prior to the requests in the busy queue
19373 (bc they needed to be processed in order to be placed in this queue)
19374 => they will be placed at the front of the busy queue
19375 ------------------------------------------------------------------------*/
19376 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
19377
19378 if ( NULL == pNode )
19379 {
19380 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19381 "List is empty - return");
19382 return WDI_STATUS_SUCCESS;
19383 }
19384
19385 /*The node actually points to the 1st element inside the Session Id struct -
19386 just cast it back to the struct*/
19387 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
19388
19389 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19390 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19391
19392 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19393 {
19394 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
19395
19396 /*Transfer all the pending requests in this assoc queue to
19397 the front of the main waiting queue for subsequent execution*/
19398 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
19399 while ( NULL != pNode )
19400 {
19401 /*Place it in front of the main pending list*/
19402 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19403 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
19404 }
19405 }
19406 else
19407 {
19408 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
19409 "Invalid session id queued up for assoc");
19410 WPAL_ASSERT(0);
19411 wpalMemoryFree(pSessionIdElement);
19412 return WDI_STATUS_E_FAILURE;
19413 }
19414
19415 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19416 wpalMemoryFree(pSessionIdElement);
19417 return WDI_STATUS_SUCCESS;
19418}/*WDI_DequeueAssocRequest*/
19419
19420/**
19421 @brief Utility function used by the DAL Core to clear any
19422 pending requests - all req cb will be called with
19423 failure and the queue will be emptied.
19424 @param
19425
19426 pWDICtx: - pointer to the WDI control block
19427
19428 @see
19429 @return Result of the operation
19430*/
19431WDI_Status
19432WDI_ClearPendingRequests
19433(
19434 WDI_ControlBlockType* pWDICtx
19435)
19436{
19437 wpt_list_node* pNode = NULL;
19438 WDI_EventInfoType* pEventDataQueue = NULL;
19439 WDI_ReqStatusCb pfnReqStatusCB;
19440 void* pUserData;
19441 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19442
19443 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
19444
19445 /*------------------------------------------------------------------------
19446 Go through all the requests and fail them - this will only be called
19447 when device is being stopped or an error was detected - either case the
19448 pending requests can no longer be sent down to HAL
19449 ------------------------------------------------------------------------*/
19450 while( pNode )
19451 {
19452 /*The node actually points to the 1st element inside the Event Data struct -
19453 just cast it back to the struct*/
19454 pEventDataQueue = (WDI_EventInfoType*)pNode;
19455
19456 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
19457 if ( NULL != pfnReqStatusCB )
19458 {
19459 /*Fail the request*/
19460 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
19461 }
19462 /* Free data - that was allocated when queueing */
19463 if ( pEventDataQueue->pEventData != NULL )
19464 {
19465 wpalMemoryFree(pEventDataQueue->pEventData);
19466 }
19467 wpalMemoryFree(pEventDataQueue);
19468
19469 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
19470 {
19471 break;
19472 }
19473 }
19474
19475 return WDI_STATUS_SUCCESS;
19476}/*WDI_ClearPendingRequests*/
19477
19478/**
19479 @brief Helper routine used to init the BSS Sessions in the WDI control block
19480
19481
19482 @param pWDICtx: pointer to the WLAN DAL context
19483
19484 @see
19485*/
19486void
19487WDI_ResetAssocSessions
19488(
19489 WDI_ControlBlockType* pWDICtx
19490)
19491{
19492 wpt_uint8 i;
19493 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19494
19495 /*-------------------------------------------------------------------------
19496 No Sanity check
19497 -------------------------------------------------------------------------*/
19498 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19499 {
19500 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
19501 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
19502 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
19503 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
19504 }
19505}/*WDI_ResetAssocSessions*/
19506
19507/**
19508 @brief Helper routine used to find a session based on the BSSID
19509
19510
19511 @param pWDICtx: pointer to the WLAN DAL context
19512 macBSSID: BSSID of the session
19513 pSession: pointer to the session (if found)
19514
19515 @see
19516 @return Index of the session in the array
19517*/
19518wpt_uint8
19519WDI_FindAssocSession
19520(
19521 WDI_ControlBlockType* pWDICtx,
19522 wpt_macAddr macBSSID,
19523 WDI_BSSSessionType** ppSession
19524)
19525{
19526 wpt_uint8 i;
19527 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19528
19529 /*-------------------------------------------------------------------------
19530 Sanity check
19531 -------------------------------------------------------------------------*/
19532 if ( NULL == ppSession )
19533 {
19534 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19535 "%s: Invalid parameters", __FUNCTION__);
19536 return WDI_MAX_BSS_SESSIONS;
19537 }
19538
19539 *ppSession = NULL;
19540
19541 /*------------------------------------------------------------------------
19542 Search for a session that matches the BSSID
19543 ------------------------------------------------------------------------*/
19544 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19545 {
19546 if ( eWLAN_PAL_TRUE ==
19547 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
19548 {
19549 /*Found the session*/
19550 *ppSession = &pWDICtx->aBSSSessions[i];
19551 return i;
19552 }
19553 }
19554
19555 return i;
19556}/*WDI_FindAssocSession*/
19557
19558/**
19559 @brief Helper routine used to find a session based on the BSSID
19560
19561
19562 @param pWDICtx: pointer to the WLAN DAL context
19563 ucBSSIdx: BSS Index of the session
19564 ppSession: out pointer to the session (if found)
19565
19566 @see
19567 @return Index of the session in the array
19568*/
19569wpt_uint8
19570WDI_FindAssocSessionByBSSIdx
19571(
19572 WDI_ControlBlockType* pWDICtx,
19573 wpt_uint16 ucBSSIdx,
19574 WDI_BSSSessionType** ppSession
19575)
19576{
19577 wpt_uint8 i;
19578 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19579
19580 /*-------------------------------------------------------------------------
19581 Sanity check
19582 -------------------------------------------------------------------------*/
19583 if ( NULL == ppSession )
19584 {
19585 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19586 "%s: Invalid parameters", __FUNCTION__);
19587 return WDI_MAX_BSS_SESSIONS;
19588 }
19589
19590 *ppSession = NULL;
19591
19592 /*------------------------------------------------------------------------
19593 Search for a session that matches the BSSID
19594 ------------------------------------------------------------------------*/
19595 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19596 {
19597 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
19598 {
19599 /*Found the session*/
19600 *ppSession = &pWDICtx->aBSSSessions[i];
19601 return i;
19602 }
19603 }
19604
19605 return i;
19606}/*WDI_FindAssocSessionByBSSIdx*/
19607
19608/**
19609 @brief Helper routine used to find a session based on the BSSID
19610
19611
19612 @param pWDICtx: pointer to the WLAN DAL context
19613 ucBSSIdx: BSS Index of the session
19614 ppSession: out pointer to the session (if found)
19615
19616 @see
19617 @return Index of the session in the array
19618*/
19619wpt_uint8
19620WDI_FindAssocSessionByIdx
19621(
19622 WDI_ControlBlockType* pWDICtx,
19623 wpt_uint16 usIdx,
19624 WDI_BSSSessionType** ppSession
19625)
19626{
19627 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19628
19629 /*-------------------------------------------------------------------------
19630 Sanity check
19631 -------------------------------------------------------------------------*/
19632 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
19633 {
19634 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19635 "%s: Invalid parameters", __FUNCTION__);
19636 return WDI_MAX_BSS_SESSIONS;
19637 }
19638
19639 /*Found the session*/
19640 *ppSession = &pWDICtx->aBSSSessions[usIdx];
19641
19642 return usIdx;
19643
19644}/*WDI_FindAssocSessionByBSSIdx*/
19645
19646/**
19647 @brief Helper routine used to find an empty session in the WDI
19648 CB
19649
19650
19651 @param pWDICtx: pointer to the WLAN DAL context
19652 pSession: pointer to the session (if found)
19653
19654 @see
19655 @return Index of the session in the array
19656*/
19657wpt_uint8
19658WDI_FindEmptySession
19659(
19660 WDI_ControlBlockType* pWDICtx,
19661 WDI_BSSSessionType** ppSession
19662)
19663{
19664 wpt_uint8 i;
19665 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19666 /*-------------------------------------------------------------------------
19667 Sanity check
19668 -------------------------------------------------------------------------*/
19669 if ( NULL == ppSession )
19670 {
19671 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19672 "%s: Invalid parameters", __FUNCTION__);
19673 return WDI_MAX_BSS_SESSIONS;
19674 }
19675
19676 *ppSession = NULL;
19677
19678 /*------------------------------------------------------------------------
19679 Search for a session that it is not in use
19680 ------------------------------------------------------------------------*/
19681 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19682 {
19683 if ( ! pWDICtx->aBSSSessions[i].bInUse )
19684 {
19685 /*Found a session*/
19686 *ppSession = &pWDICtx->aBSSSessions[i];
19687 return i;
19688 }
19689 }
19690
19691 return i;
19692}/*WDI_FindEmptySession*/
19693
19694
19695/**
19696 @brief Helper routine used to get the total count of active
19697 sessions
19698
19699
19700 @param pWDICtx: pointer to the WLAN DAL context
19701
19702 @see
19703 @return Number of sessions in use
19704*/
19705wpt_uint8
19706WDI_GetActiveSessionsCount
19707(
19708 WDI_ControlBlockType* pWDICtx
19709)
19710{
19711 wpt_uint8 i, ucCount = 0;
19712 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19713
19714 /*------------------------------------------------------------------------
19715 Count all sessions in use
19716 ------------------------------------------------------------------------*/
19717 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19718 {
19719 if ( pWDICtx->aBSSSessions[i].bInUse )
19720 {
19721 ucCount++;
19722 }
19723 }
19724
19725 return ucCount;
19726}/*WDI_GetActiveSessionsCount*/
19727
19728/**
19729 @brief Helper routine used to delete session in the WDI
19730 CB
19731
19732
19733 @param pWDICtx: pointer to the WLAN DAL context
19734 pSession: pointer to the session (if found)
19735
19736 @see
19737 @return Index of the session in the array
19738*/
19739void
19740WDI_DeleteSession
19741(
19742 WDI_ControlBlockType* pWDICtx,
19743 WDI_BSSSessionType* ppSession
19744)
19745{
19746 /*-------------------------------------------------------------------------
19747 Sanity check
19748 -------------------------------------------------------------------------*/
19749 if ( NULL == ppSession )
19750 {
19751 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19752 "%s: Invalid parameters", __FUNCTION__);
19753 return ;
19754 }
19755
19756 /*------------------------------------------------------------------------
19757 Reset the entries int session
19758 ------------------------------------------------------------------------*/
19759 wpal_list_destroy(&ppSession->wptPendingQueue);
19760 wpalMemoryZero(ppSession, sizeof(*ppSession));
19761 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
19762 ppSession->bInUse = eWLAN_PAL_FALSE;
19763 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
19764 wpal_list_init(&ppSession->wptPendingQueue);
19765
19766}/*WDI_DeleteSession*/
19767
19768/**
19769 @brief Utility function to add the broadcast STA to the the STA table.
19770 The bcast STA ID is assigned by HAL and must be valid.
19771 @param
19772
19773 WDI_AddStaParams: - pointer to the WDI Add STA params
19774 usBcastStaIdx: - Broadcast STA index passed by HAL
19775
19776 @see
19777 @return void
19778*/
19779void
19780WDI_AddBcastSTAtoSTATable
19781(
19782 WDI_ControlBlockType* pWDICtx,
19783 WDI_AddStaParams * staParams,
19784 wpt_uint16 usBcastStaIdx
19785)
19786{
19787 WDI_AddStaParams wdiAddSTAParam = {0};
19788 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
19789 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19790
19791 /*---------------------------------------------------------------------
19792 Sanity check
19793 ---------------------------------------------------------------------*/
19794 if ( NULL == staParams )
19795 {
19796 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19797 "%s: Invalid parameters", __FUNCTION__);
19798
19799 return;
19800 }
19801
19802 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
19803 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
19804 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
19805 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
19806 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
19807 wdiAddSTAParam.dpuSig = staParams->dpuSig;
19808 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
19809 WDI_MAC_ADDR_LEN );
19810 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
19811 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
19812 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
19813 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
19814 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
19815 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
19816 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
19817
19818 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
19819}
19820
19821/**
19822 @brief NV blob will be divided into fragments of size 4kb and
19823 Sent to HAL
19824
19825 @param pWDICtx: pointer to the WLAN DAL context
19826 pEventData: pointer to the event information structure
19827
19828 @see
19829 @return Result of the function call
19830 */
19831
19832WDI_Status WDI_SendNvBlobReq
19833(
19834 WDI_ControlBlockType* pWDICtx,
19835 WDI_EventInfoType* pEventData
19836)
19837{
19838
19839 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
19840 wpt_uint8* pSendBuffer = NULL;
19841 wpt_uint16 usDataOffset = 0;
19842 wpt_uint16 usSendSize = 0;
19843 wpt_uint16 usCurrentFragmentSize =0;
19844 wpt_uint8* pSrcBuffer = NULL;
19845 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
19846 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
19847
19848 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
19849 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
19850 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
19851
19852 /* Sanity Check is done by the caller */
19853 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
19854
19855 /* Update the current Fragment Number */
19856 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
19857
19858 /*Update the HAL REQ structure */
19859 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
19860 halNvImgDownloadParam.nvImageReqParams.fragNumber =
19861 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
19862
19863 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
19864 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
19865 image will be sent to HAL*/
19866
19867 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
19868 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
19869 {
19870 /* Taking care of boundry condition */
19871 if( !(usCurrentFragmentSize =
19872 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
19873 usCurrentFragmentSize = FRAGMENT_SIZE;
19874
19875 /*Update the HAL REQ structure */
19876 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
19877 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
19878
19879 }
19880 else
19881 {
19882 usCurrentFragmentSize = FRAGMENT_SIZE;
19883
19884 /*Update the HAL REQ structure */
19885 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
19886 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
19887 }
19888
19889 /*-----------------------------------------------------------------------
19890 Get message buffer
19891 -----------------------------------------------------------------------*/
19892 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
19893 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
19894 &pSendBuffer, &usDataOffset, &usSendSize))||
19895 ( usSendSize <
19896 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
19897 {
19898 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19899 "Unable to get send buffer in NV Download req %x %x ",
19900 pEventData, pwdiNvDownloadReqParams);
19901 WDI_ASSERT(0);
19902 return WDI_STATUS_E_FAILURE;
19903 }
19904
19905 /* Copying the Hal NV download REQ structure */
19906 wpalMemoryCopy(pSendBuffer + usDataOffset ,
19907 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
19908
19909 /* Appending the NV image fragment */
19910 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
19911 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
19912 usCurrentFragmentSize);
19913
19914 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
19915 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
19916
19917 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
19918 wdiNvDownloadRspCb, pEventData->pUserData,
19919 WDI_NV_DOWNLOAD_RESP);
19920
19921}
19922/*============================================================================
19923 Helper inline functions for
19924 ============================================================================*/
19925/**
19926 @brief Helper routine used to find a session based on the BSSID
19927 @param pContext: pointer to the WLAN DAL context
19928 @param pDPContext: pointer to the Datapath context
19929
19930 @see
19931 @return
19932*/
19933WPT_INLINE void
19934WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
19935{
19936 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19937
19938 pCB->pDPContext = pDPContext;
19939 return;
19940}
19941
19942/**
19943 @brief Helper routine used to find a session based on the BSSID
19944
19945
19946 @param pContext: pointer to the WLAN DAL context
19947
19948 @see
19949 @return pointer to Datapath context
19950*/
19951WPT_INLINE void *
19952WDI_DS_GetDatapathContext (void *pContext)
19953{
19954 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19955 return pCB->pDPContext;
19956}
19957/**
19958 @brief Helper routine used to find a session based on the BSSID
19959
19960
19961 @param pContext: pointer to the WLAN DAL context
19962 @param pDTDriverContext: pointer to the Transport Driver context
19963
19964 @see
19965 @return void
19966*/
19967WPT_INLINE void
19968WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
19969{
19970 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19971
19972 pCB->pDTDriverContext = pDTDriverContext;
19973 return;
19974}
19975
19976/**
19977 @brief Helper routine used to find a session based on the BSSID
19978
19979
19980 @param pWDICtx: pointer to the WLAN DAL context
19981
19982 @see
19983 @return pointer to datapath context
19984*/
19985WPT_INLINE void *
19986WDT_GetTransportDriverContext (void *pContext)
19987{
19988 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19989 return(pCB->pDTDriverContext);
19990}
19991
19992/*============================================================================
19993 Helper inline converters
19994 ============================================================================*/
19995/*Convert WDI driver type into HAL driver type*/
19996WPT_STATIC WPT_INLINE WDI_Status
19997WDI_HAL_2_WDI_STATUS
19998(
19999 eHalStatus halStatus
20000)
20001{
20002 /*Lightweight function - no sanity checks and no unecessary code to increase
20003 the chances of getting inlined*/
20004 switch( halStatus )
20005 {
20006 case eHAL_STATUS_SUCCESS:
20007 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20008 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20009 return WDI_STATUS_SUCCESS;
20010 case eHAL_STATUS_FAILURE:
20011 return WDI_STATUS_E_FAILURE;
20012 case eHAL_STATUS_FAILED_ALLOC:
20013 return WDI_STATUS_MEM_FAILURE;
20014 /*The rest of the HAL error codes must be kept hidden from the UMAC as
20015 they refer to specific internal modules of our device*/
20016 default:
20017 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20018 }
20019
20020 return WDI_STATUS_E_FAILURE;
20021}/*WDI_HAL_2_WDI_STATUS*/
20022
20023/*Convert WDI request type into HAL request type*/
20024WPT_STATIC WPT_INLINE tHalHostMsgType
20025WDI_2_HAL_REQ_TYPE
20026(
20027 WDI_RequestEnumType wdiReqType
20028)
20029{
20030 /*Lightweight function - no sanity checks and no unecessary code to increase
20031 the chances of getting inlined*/
20032 switch( wdiReqType )
20033 {
20034 case WDI_START_REQ:
20035 return WLAN_HAL_START_REQ;
20036 case WDI_STOP_REQ:
20037 return WLAN_HAL_STOP_REQ;
20038 case WDI_INIT_SCAN_REQ:
20039 return WLAN_HAL_INIT_SCAN_REQ;
20040 case WDI_START_SCAN_REQ:
20041 return WLAN_HAL_START_SCAN_REQ;
20042 case WDI_END_SCAN_REQ:
20043 return WLAN_HAL_END_SCAN_REQ;
20044 case WDI_FINISH_SCAN_REQ:
20045 return WLAN_HAL_FINISH_SCAN_REQ;
20046 case WDI_JOIN_REQ:
20047 return WLAN_HAL_JOIN_REQ;
20048 case WDI_CONFIG_BSS_REQ:
20049 return WLAN_HAL_CONFIG_BSS_REQ;
20050 case WDI_DEL_BSS_REQ:
20051 return WLAN_HAL_DELETE_BSS_REQ;
20052 case WDI_POST_ASSOC_REQ:
20053 return WLAN_HAL_POST_ASSOC_REQ;
20054 case WDI_DEL_STA_REQ:
20055 return WLAN_HAL_DELETE_STA_REQ;
20056 case WDI_SET_BSS_KEY_REQ:
20057 return WLAN_HAL_SET_BSSKEY_REQ;
20058 case WDI_RMV_BSS_KEY_REQ:
20059 return WLAN_HAL_RMV_BSSKEY_REQ;
20060 case WDI_SET_STA_KEY_REQ:
20061 return WLAN_HAL_SET_STAKEY_REQ;
20062 case WDI_RMV_STA_KEY_REQ:
20063 return WLAN_HAL_RMV_STAKEY_REQ;
20064 case WDI_SET_STA_BCAST_KEY_REQ:
20065 return WLAN_HAL_SET_BCASTKEY_REQ;
20066 case WDI_RMV_STA_BCAST_KEY_REQ:
20067 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
20068 return WLAN_HAL_RMV_STAKEY_REQ;
20069 case WDI_ADD_TS_REQ:
20070 return WLAN_HAL_ADD_TS_REQ;
20071 case WDI_DEL_TS_REQ:
20072 return WLAN_HAL_DEL_TS_REQ;
20073 case WDI_UPD_EDCA_PRMS_REQ:
20074 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
20075 case WDI_ADD_BA_REQ:
20076 return WLAN_HAL_ADD_BA_REQ;
20077 case WDI_DEL_BA_REQ:
20078 return WLAN_HAL_DEL_BA_REQ;
20079#ifdef FEATURE_WLAN_CCX
20080 case WDI_TSM_STATS_REQ:
20081 return WLAN_HAL_TSM_STATS_REQ;
20082#endif
20083 case WDI_CH_SWITCH_REQ:
20084 return WLAN_HAL_CH_SWITCH_REQ;
20085 case WDI_CONFIG_STA_REQ:
20086 return WLAN_HAL_CONFIG_STA_REQ;
20087 case WDI_SET_LINK_ST_REQ:
20088 return WLAN_HAL_SET_LINK_ST_REQ;
20089 case WDI_GET_STATS_REQ:
20090 return WLAN_HAL_GET_STATS_REQ;
20091 case WDI_UPDATE_CFG_REQ:
20092 return WLAN_HAL_UPDATE_CFG_REQ;
20093 case WDI_ADD_BA_SESSION_REQ:
20094 return WLAN_HAL_ADD_BA_SESSION_REQ;
20095 case WDI_TRIGGER_BA_REQ:
20096 return WLAN_HAL_TRIGGER_BA_REQ;
20097 case WDI_UPD_BCON_PRMS_REQ:
20098 return WLAN_HAL_UPDATE_BEACON_REQ;
20099 case WDI_SND_BCON_REQ:
20100 return WLAN_HAL_SEND_BEACON_REQ;
20101 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20102 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20103 case WDI_SET_MAX_TX_POWER_REQ:
20104 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20105#ifdef WLAN_FEATURE_P2P
20106 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20107 return WLAN_HAL_SET_P2P_GONOA_REQ;
20108#endif
20109 case WDI_ENTER_IMPS_REQ:
20110 return WLAN_HAL_ENTER_IMPS_REQ;
20111 case WDI_EXIT_IMPS_REQ:
20112 return WLAN_HAL_EXIT_IMPS_REQ;
20113 case WDI_ENTER_BMPS_REQ:
20114 return WLAN_HAL_ENTER_BMPS_REQ;
20115 case WDI_EXIT_BMPS_REQ:
20116 return WLAN_HAL_EXIT_BMPS_REQ;
20117 case WDI_ENTER_UAPSD_REQ:
20118 return WLAN_HAL_ENTER_UAPSD_REQ;
20119 case WDI_EXIT_UAPSD_REQ:
20120 return WLAN_HAL_EXIT_UAPSD_REQ;
20121 case WDI_SET_UAPSD_PARAM_REQ:
20122 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
20123 case WDI_UPDATE_UAPSD_PARAM_REQ:
20124 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
20125 case WDI_CONFIGURE_RXP_FILTER_REQ:
20126 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
20127 case WDI_SET_BEACON_FILTER_REQ:
20128 return WLAN_HAL_ADD_BCN_FILTER_REQ;
20129 case WDI_REM_BEACON_FILTER_REQ:
20130 return WLAN_HAL_REM_BCN_FILTER_REQ;
20131 case WDI_SET_RSSI_THRESHOLDS_REQ:
20132 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20133 case WDI_HOST_OFFLOAD_REQ:
20134 return WLAN_HAL_HOST_OFFLOAD_REQ;
20135 case WDI_WOWL_ADD_BC_PTRN_REQ:
20136 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20137 case WDI_WOWL_DEL_BC_PTRN_REQ:
20138 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20139 case WDI_WOWL_ENTER_REQ:
20140 return WLAN_HAL_ENTER_WOWL_REQ;
20141 case WDI_WOWL_EXIT_REQ:
20142 return WLAN_HAL_EXIT_WOWL_REQ;
20143 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20144 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20145 case WDI_NV_DOWNLOAD_REQ:
20146 return WLAN_HAL_DOWNLOAD_NV_REQ;
20147 case WDI_FLUSH_AC_REQ:
20148 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20149 case WDI_BTAMP_EVENT_REQ:
20150 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20151#ifdef WLAN_FEATURE_VOWIFI_11R
20152 case WDI_AGGR_ADD_TS_REQ:
20153 return WLAN_HAL_AGGR_ADD_TS_REQ;
20154#endif /* WLAN_FEATURE_VOWIFI_11R */
20155#ifdef ANI_MANF_DIAG
20156 case WDI_FTM_CMD_REQ:
20157 return WLAN_HAL_PROCESS_PTT_REQ;
20158#endif /* ANI_MANF_DIAG */
20159 case WDI_ADD_STA_SELF_REQ:
20160 return WLAN_HAL_ADD_STA_SELF_REQ;
20161 case WDI_DEL_STA_SELF_REQ:
20162 return WLAN_HAL_DEL_STA_SELF_REQ;
20163 case WDI_HOST_RESUME_REQ:
20164 return WLAN_HAL_HOST_RESUME_REQ;
20165 case WDI_HOST_SUSPEND_IND:
20166 return WLAN_HAL_HOST_SUSPEND_IND;
20167 case WDI_KEEP_ALIVE_REQ:
20168 return WLAN_HAL_KEEP_ALIVE_REQ;
20169
20170#ifdef FEATURE_WLAN_SCAN_PNO
20171 case WDI_SET_PREF_NETWORK_REQ:
20172 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20173 case WDI_SET_RSSI_FILTER_REQ:
20174 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20175 case WDI_UPDATE_SCAN_PARAMS_REQ:
20176 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20177#endif // FEATURE_WLAN_SCAN_PNO
20178 case WDI_SET_TX_PER_TRACKING_REQ:
20179 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20180#ifdef WLAN_FEATURE_PACKET_FILTERING
20181 case WDI_8023_MULTICAST_LIST_REQ:
20182 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20183 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
20184 return WLAN_HAL_SET_PACKET_FILTER_REQ;
20185 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20186 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20187 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20188 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20189#endif // WLAN_FEATURE_PACKET_FILTERING
20190 case WDI_HAL_DUMP_CMD_REQ:
20191 return WLAN_HAL_DUMP_COMMAND_REQ;
20192#ifdef WLAN_FEATURE_GTK_OFFLOAD
20193 case WDI_GTK_OFFLOAD_REQ:
20194 return WLAN_HAL_GTK_OFFLOAD_REQ;
20195 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20196 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20197#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20198
20199 case WDI_INIT_SCAN_CON_REQ:
20200 return WLAN_HAL_INIT_SCAN_CON_REQ;
20201 case WDI_SET_POWER_PARAMS_REQ:
20202 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20203 case WDI_SET_TM_LEVEL_REQ:
20204 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20205 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20206 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
20207 default:
20208 return WLAN_HAL_MSG_MAX;
20209 }
20210
20211}/*WDI_2_HAL_REQ_TYPE*/
20212
20213/*Convert WDI response type into HAL response type*/
20214WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20215HAL_2_WDI_RSP_TYPE
20216(
20217 tHalHostMsgType halMsg
20218)
20219{
20220 /*Lightweight function - no sanity checks and no unecessary code to increase
20221 the chances of getting inlined*/
20222 switch( halMsg )
20223 {
20224 case WLAN_HAL_START_RSP:
20225 return WDI_START_RESP;
20226 case WLAN_HAL_STOP_RSP:
20227 return WDI_STOP_RESP;
20228 case WLAN_HAL_INIT_SCAN_RSP:
20229 return WDI_INIT_SCAN_RESP;
20230 case WLAN_HAL_START_SCAN_RSP:
20231 return WDI_START_SCAN_RESP;
20232 case WLAN_HAL_END_SCAN_RSP:
20233 return WDI_END_SCAN_RESP;
20234 case WLAN_HAL_FINISH_SCAN_RSP:
20235 return WDI_FINISH_SCAN_RESP;
20236 case WLAN_HAL_CONFIG_STA_RSP:
20237 return WDI_CONFIG_STA_RESP;
20238 case WLAN_HAL_DELETE_STA_RSP:
20239 return WDI_DEL_STA_RESP;
20240 case WLAN_HAL_CONFIG_BSS_RSP:
20241 return WDI_CONFIG_BSS_RESP;
20242 case WLAN_HAL_DELETE_BSS_RSP:
20243 return WDI_DEL_BSS_RESP;
20244 case WLAN_HAL_JOIN_RSP:
20245 return WDI_JOIN_RESP;
20246 case WLAN_HAL_POST_ASSOC_RSP:
20247 return WDI_POST_ASSOC_RESP;
20248 case WLAN_HAL_SET_BSSKEY_RSP:
20249 return WDI_SET_BSS_KEY_RESP;
20250 case WLAN_HAL_SET_STAKEY_RSP:
20251 return WDI_SET_STA_KEY_RESP;
20252 case WLAN_HAL_RMV_BSSKEY_RSP:
20253 return WDI_RMV_BSS_KEY_RESP;
20254 case WLAN_HAL_RMV_STAKEY_RSP:
20255 return WDI_RMV_STA_KEY_RESP;
20256 case WLAN_HAL_SET_BCASTKEY_RSP:
20257 return WDI_SET_STA_BCAST_KEY_RESP;
20258 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20259 // return WDI_RMV_STA_BCAST_KEY_RESP;
20260 case WLAN_HAL_ADD_TS_RSP:
20261 return WDI_ADD_TS_RESP;
20262 case WLAN_HAL_DEL_TS_RSP:
20263 return WDI_DEL_TS_RESP;
20264 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20265 return WDI_UPD_EDCA_PRMS_RESP;
20266 case WLAN_HAL_ADD_BA_RSP:
20267 return WDI_ADD_BA_RESP;
20268 case WLAN_HAL_DEL_BA_RSP:
20269 return WDI_DEL_BA_RESP;
20270#ifdef FEATURE_WLAN_CCX
20271 case WLAN_HAL_TSM_STATS_RSP:
20272 return WDI_TSM_STATS_RESP;
20273#endif
20274 case WLAN_HAL_CH_SWITCH_RSP:
20275 return WDI_CH_SWITCH_RESP;
20276 case WLAN_HAL_SET_LINK_ST_RSP:
20277 return WDI_SET_LINK_ST_RESP;
20278 case WLAN_HAL_GET_STATS_RSP:
20279 return WDI_GET_STATS_RESP;
20280 case WLAN_HAL_UPDATE_CFG_RSP:
20281 return WDI_UPDATE_CFG_RESP;
20282 case WLAN_HAL_ADD_BA_SESSION_RSP:
20283 return WDI_ADD_BA_SESSION_RESP;
20284 case WLAN_HAL_TRIGGER_BA_RSP:
20285 return WDI_TRIGGER_BA_RESP;
20286 case WLAN_HAL_UPDATE_BEACON_RSP:
20287 return WDI_UPD_BCON_PRMS_RESP;
20288 case WLAN_HAL_SEND_BEACON_RSP:
20289 return WDI_SND_BCON_RESP;
20290 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20291 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20292 /*Indications*/
20293 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20294 return WDI_HAL_RSSI_NOTIFICATION_IND;
20295 case WLAN_HAL_MISSED_BEACON_IND:
20296 return WDI_HAL_MISSED_BEACON_IND;
20297 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20298 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20299 case WLAN_HAL_MIC_FAILURE_IND:
20300 return WDI_HAL_MIC_FAILURE_IND;
20301 case WLAN_HAL_FATAL_ERROR_IND:
20302 return WDI_HAL_FATAL_ERROR_IND;
20303 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20304 return WDI_HAL_DEL_STA_IND;
20305 case WLAN_HAL_COEX_IND:
20306 return WDI_HAL_COEX_IND;
20307 case WLAN_HAL_OTA_TX_COMPL_IND:
20308 return WDI_HAL_TX_COMPLETE_IND;
20309#ifdef WLAN_FEATURE_P2P
20310 case WLAN_HAL_P2P_NOA_ATTR_IND:
20311 return WDI_HAL_P2P_NOA_ATTR_IND;
20312#endif
20313 case WLAN_HAL_TX_PER_HIT_IND:
20314 return WDI_HAL_TX_PER_HIT_IND;
20315 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20316 return WDI_SET_MAX_TX_POWER_RESP;
20317#ifdef WLAN_FEATURE_P2P
20318 case WLAN_HAL_SET_P2P_GONOA_RSP:
20319 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20320#endif
20321 case WLAN_HAL_ENTER_IMPS_RSP:
20322 return WDI_ENTER_IMPS_RESP;
20323 case WLAN_HAL_EXIT_IMPS_RSP:
20324 return WDI_EXIT_IMPS_RESP;
20325 case WLAN_HAL_ENTER_BMPS_RSP:
20326 return WDI_ENTER_BMPS_RESP;
20327 case WLAN_HAL_EXIT_BMPS_RSP:
20328 return WDI_EXIT_BMPS_RESP;
20329 case WLAN_HAL_ENTER_UAPSD_RSP:
20330 return WDI_ENTER_UAPSD_RESP;
20331 case WLAN_HAL_EXIT_UAPSD_RSP:
20332 return WDI_EXIT_UAPSD_RESP;
20333 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
20334 return WDI_SET_UAPSD_PARAM_RESP;
20335 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
20336 return WDI_UPDATE_UAPSD_PARAM_RESP;
20337 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
20338 return WDI_CONFIGURE_RXP_FILTER_RESP;
20339 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20340 return WDI_SET_BEACON_FILTER_RESP;
20341 case WLAN_HAL_REM_BCN_FILTER_RSP:
20342 return WDI_REM_BEACON_FILTER_RESP;
20343 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20344 return WDI_SET_RSSI_THRESHOLDS_RESP;
20345 case WLAN_HAL_HOST_OFFLOAD_RSP:
20346 return WDI_HOST_OFFLOAD_RESP;
20347 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20348 return WDI_WOWL_ADD_BC_PTRN_RESP;
20349 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20350 return WDI_WOWL_DEL_BC_PTRN_RESP;
20351 case WLAN_HAL_ENTER_WOWL_RSP:
20352 return WDI_WOWL_ENTER_RESP;
20353 case WLAN_HAL_EXIT_WOWL_RSP:
20354 return WDI_WOWL_EXIT_RESP;
20355 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20356 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20357 case WLAN_HAL_DOWNLOAD_NV_RSP:
20358 return WDI_NV_DOWNLOAD_RESP;
20359 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20360 return WDI_FLUSH_AC_RESP;
20361 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20362 return WDI_BTAMP_EVENT_RESP;
20363#ifdef ANI_MANF_DIAG
20364 case WLAN_HAL_PROCESS_PTT_RSP:
20365 return WDI_FTM_CMD_RESP;
20366#endif /* ANI_MANF_DIAG */
20367 case WLAN_HAL_ADD_STA_SELF_RSP:
20368 return WDI_ADD_STA_SELF_RESP;
20369case WLAN_HAL_DEL_STA_SELF_RSP:
20370 return WDI_DEL_STA_SELF_RESP;
20371 case WLAN_HAL_HOST_RESUME_RSP:
20372 return WDI_HOST_RESUME_RESP;
20373 case WLAN_HAL_KEEP_ALIVE_RSP:
20374 return WDI_KEEP_ALIVE_RESP;
20375#ifdef FEATURE_WLAN_SCAN_PNO
20376 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20377 return WDI_SET_PREF_NETWORK_RESP;
20378 case WLAN_HAL_SET_RSSI_FILTER_RSP:
20379 return WDI_SET_RSSI_FILTER_RESP;
20380 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20381 return WDI_UPDATE_SCAN_PARAMS_RESP;
20382 case WLAN_HAL_PREF_NETW_FOUND_IND:
20383 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20384#endif // FEATURE_WLAN_SCAN_PNO
20385 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20386 return WDI_SET_TX_PER_TRACKING_RESP;
20387#ifdef WLAN_FEATURE_PACKET_FILTERING
20388 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20389 return WDI_8023_MULTICAST_LIST_RESP;
20390 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20391 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20392 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20393 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20394 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20395 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20396#endif // WLAN_FEATURE_PACKET_FILTERING
20397
20398 case WLAN_HAL_DUMP_COMMAND_RSP:
20399 return WDI_HAL_DUMP_CMD_RESP;
20400 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20401 return WDI_SET_POWER_PARAMS_RESP;
20402#ifdef WLAN_FEATURE_VOWIFI_11R
20403 case WLAN_HAL_AGGR_ADD_TS_RSP:
20404 return WDI_AGGR_ADD_TS_RESP;
20405#endif
20406
20407#ifdef WLAN_FEATURE_GTK_OFFLOAD
20408 case WLAN_HAL_GTK_OFFLOAD_RSP:
20409 return WDI_GTK_OFFLOAD_RESP;
20410 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20411 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20412#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20413#ifdef WLAN_WAKEUP_EVENTS
20414 case WLAN_HAL_WAKE_REASON_IND:
20415 return WDI_HAL_WAKE_REASON_IND;
20416#endif // WLAN_WAKEUP_EVENTS
20417
20418 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20419 return WDI_SET_TM_LEVEL_RESP;
20420 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20421 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
20422 default:
20423 return eDRIVER_TYPE_MAX;
20424 }
20425
20426}/*HAL_2_WDI_RSP_TYPE*/
20427
20428
20429/*Convert WDI driver type into HAL driver type*/
20430WPT_STATIC WPT_INLINE tDriverType
20431WDI_2_HAL_DRV_TYPE
20432(
20433 WDI_DriverType wdiDriverType
20434)
20435{
20436 /*Lightweight function - no sanity checks and no unecessary code to increase
20437 the chances of getting inlined*/
20438 switch( wdiDriverType )
20439 {
20440 case WDI_DRIVER_TYPE_PRODUCTION:
20441 return eDRIVER_TYPE_PRODUCTION;
20442 case WDI_DRIVER_TYPE_MFG:
20443 return eDRIVER_TYPE_MFG;
20444 case WDI_DRIVER_TYPE_DVT:
20445 return eDRIVER_TYPE_DVT;
20446 }
20447
20448 return eDRIVER_TYPE_MAX;
20449}/*WDI_2_HAL_DRV_TYPE*/
20450
20451
20452/*Convert WDI stop reason into HAL stop reason*/
20453WPT_STATIC WPT_INLINE tHalStopType
20454WDI_2_HAL_STOP_REASON
20455(
20456 WDI_StopType wdiDriverType
20457)
20458{
20459 /*Lightweight function - no sanity checks and no unecessary code to increase
20460 the chances of getting inlined*/
20461 switch( wdiDriverType )
20462 {
20463 case WDI_STOP_TYPE_SYS_RESET:
20464 return HAL_STOP_TYPE_SYS_RESET;
20465 case WDI_DRIVER_TYPE_MFG:
20466 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
20467 case WDI_STOP_TYPE_RF_KILL:
20468 return HAL_STOP_TYPE_RF_KILL;
20469 }
20470
20471 return HAL_STOP_TYPE_MAX;
20472}/*WDI_2_HAL_STOP_REASON*/
20473
20474
20475/*Convert WDI scan mode type into HAL scan mode type*/
20476WPT_STATIC WPT_INLINE eHalSysMode
20477WDI_2_HAL_SCAN_MODE
20478(
20479 WDI_ScanMode wdiScanMode
20480)
20481{
20482 /*Lightweight function - no sanity checks and no unecessary code to increase
20483 the chances of getting inlined*/
20484 switch( wdiScanMode )
20485 {
20486 case WDI_SCAN_MODE_NORMAL:
20487 return eHAL_SYS_MODE_NORMAL;
20488 case WDI_SCAN_MODE_LEARN:
20489 return eHAL_SYS_MODE_LEARN;
20490 case WDI_SCAN_MODE_SCAN:
20491 return eHAL_SYS_MODE_SCAN;
20492 case WDI_SCAN_MODE_PROMISC:
20493 return eHAL_SYS_MODE_PROMISC;
20494 case WDI_SCAN_MODE_SUSPEND_LINK:
20495 return eHAL_SYS_MODE_SUSPEND_LINK;
20496 }
20497
20498 return eHAL_SYS_MODE_MAX;
20499}/*WDI_2_HAL_SCAN_MODE*/
20500
20501/*Convert WDI sec ch offset into HAL sec ch offset type*/
20502WPT_STATIC WPT_INLINE tSirMacHTSecondaryChannelOffset
20503WDI_2_HAL_SEC_CH_OFFSET
20504(
20505 WDI_HTSecondaryChannelOffset wdiSecChOffset
20506)
20507{
20508 /*Lightweight function - no sanity checks and no unecessary code to increase
20509 the chances of getting inlined*/
20510 switch( wdiSecChOffset )
20511 {
20512 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
20513 return eHT_SECONDARY_CHANNEL_OFFSET_NONE;
20514 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
20515 return eHT_SECONDARY_CHANNEL_OFFSET_UP;
20516 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
20517 return eHT_SECONDARY_CHANNEL_OFFSET_DOWN;
20518 }
20519
20520 return eHT_SECONDARY_CHANNEL_OFFSET_MAX;
20521}/*WDI_2_HAL_SEC_CH_OFFSET*/
20522
20523/*Convert WDI BSS type into HAL BSS type*/
20524WPT_STATIC WPT_INLINE tSirBssType
20525WDI_2_HAL_BSS_TYPE
20526(
20527 WDI_BssType wdiBSSType
20528)
20529{
20530 /*Lightweight function - no sanity checks and no unecessary code to increase
20531 the chances of getting inlined*/
20532 switch( wdiBSSType )
20533 {
20534 case WDI_INFRASTRUCTURE_MODE:
20535 return eSIR_INFRASTRUCTURE_MODE;
20536 case WDI_INFRA_AP_MODE:
20537 return eSIR_INFRA_AP_MODE;
20538 case WDI_IBSS_MODE:
20539 return eSIR_IBSS_MODE;
20540 case WDI_BTAMP_STA_MODE:
20541 return eSIR_BTAMP_STA_MODE;
20542 case WDI_BTAMP_AP_MODE:
20543 return eSIR_BTAMP_AP_MODE;
20544 case WDI_BSS_AUTO_MODE:
20545 return eSIR_AUTO_MODE;
20546 }
20547
20548 return eSIR_DONOT_USE_BSS_TYPE;
20549}/*WDI_2_HAL_BSS_TYPE*/
20550
20551/*Convert WDI NW type into HAL NW type*/
20552WPT_STATIC WPT_INLINE tSirNwType
20553WDI_2_HAL_NW_TYPE
20554(
20555 WDI_NwType wdiNWType
20556)
20557{
20558 /*Lightweight function - no sanity checks and no unecessary code to increase
20559 the chances of getting inlined*/
20560 switch( wdiNWType )
20561 {
20562 case WDI_11A_NW_TYPE:
20563 return eSIR_11A_NW_TYPE;
20564 case WDI_11B_NW_TYPE:
20565 return eSIR_11B_NW_TYPE;
20566 case WDI_11G_NW_TYPE:
20567 return eSIR_11G_NW_TYPE;
20568 case WDI_11N_NW_TYPE:
20569 return eSIR_11N_NW_TYPE;
20570 }
20571
20572 return eSIR_DONOT_USE_NW_TYPE;
20573}/*WDI_2_HAL_NW_TYPE*/
20574
20575/*Convert WDI chanel bonding type into HAL cb type*/
20576WPT_STATIC WPT_INLINE ePhyChanBondState
20577WDI_2_HAL_CB_STATE
20578(
20579 WDI_PhyChanBondState wdiCbState
20580)
20581{
20582 /*Lightweight function - no sanity checks and no unecessary code to increase
20583 the chances of getting inlined*/
20584 switch ( wdiCbState )
20585 {
20586 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
20587 return PHY_SINGLE_CHANNEL_CENTERED;
20588 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
20589 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
20590 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
20591 return PHY_DOUBLE_CHANNEL_CENTERED;
20592 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
20593 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
20594 }
20595
20596 return PHY_CHANNEL_BONDING_STATE_MAX;
20597}/*WDI_2_HAL_CB_STATE*/
20598
20599/*Convert WDI chanel bonding type into HAL cb type*/
20600WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
20601WDI_2_HAL_HT_OPER_MODE
20602(
20603 WDI_HTOperatingMode wdiHTOperMode
20604)
20605{
20606 /*Lightweight function - no sanity checks and no unecessary code to increase
20607 the chances of getting inlined*/
20608 switch ( wdiHTOperMode )
20609 {
20610 case WDI_HT_OP_MODE_PURE:
20611 return eSIR_HT_OP_MODE_PURE;
20612 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
20613 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
20614 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
20615 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
20616 case WDI_HT_OP_MODE_MIXED:
20617 return eSIR_HT_OP_MODE_MIXED;
20618 }
20619
20620 return eSIR_HT_OP_MODE_MAX;
20621}/*WDI_2_HAL_HT_OPER_MODE*/
20622
20623/*Convert WDI mimo PS type into HAL mimo PS type*/
20624WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
20625WDI_2_HAL_MIMO_PS
20626(
20627 WDI_HTMIMOPowerSaveState wdiHTOperMode
20628)
20629{
20630 /*Lightweight function - no sanity checks and no unecessary code to increase
20631 the chances of getting inlined*/
20632 switch ( wdiHTOperMode )
20633 {
20634 case WDI_HT_MIMO_PS_STATIC:
20635 return eSIR_HT_MIMO_PS_STATIC;
20636 case WDI_HT_MIMO_PS_DYNAMIC:
20637 return eSIR_HT_MIMO_PS_DYNAMIC;
20638 case WDI_HT_MIMO_PS_NA:
20639 return eSIR_HT_MIMO_PS_NA;
20640 case WDI_HT_MIMO_PS_NO_LIMIT:
20641 return eSIR_HT_MIMO_PS_NO_LIMIT;
20642 }
20643
20644 return eSIR_HT_MIMO_PS_MAX;
20645}/*WDI_2_HAL_MIMO_PS*/
20646
20647/*Convert WDI ENC type into HAL ENC type*/
20648WPT_STATIC WPT_INLINE tAniEdType
20649WDI_2_HAL_ENC_TYPE
20650(
20651 WDI_EncryptType wdiEncType
20652)
20653{
20654 /*Lightweight function - no sanity checks and no unecessary code to increase
20655 the chances of getting inlined*/
20656 switch ( wdiEncType )
20657 {
20658 case WDI_ENCR_NONE:
20659 return eSIR_ED_NONE;
20660
20661 case WDI_ENCR_WEP40:
20662 return eSIR_ED_WEP40;
20663
20664 case WDI_ENCR_WEP104:
20665 return eSIR_ED_WEP104;
20666
20667 case WDI_ENCR_TKIP:
20668 return eSIR_ED_TKIP;
20669
20670 case WDI_ENCR_CCMP:
20671 return eSIR_ED_CCMP;
20672
20673 case WDI_ENCR_AES_128_CMAC:
20674 return eSIR_ED_AES_128_CMAC;
20675#if defined(FEATURE_WLAN_WAPI)
20676 case WDI_ENCR_WPI:
20677 return eSIR_ED_WPI;
20678#endif
20679 default:
20680 return eSIR_ED_NOT_IMPLEMENTED;
20681 }
20682
20683}/*WDI_2_HAL_ENC_TYPE*/
20684
20685/*Convert WDI WEP type into HAL WEP type*/
20686WPT_STATIC WPT_INLINE tAniWepType
20687WDI_2_HAL_WEP_TYPE
20688(
20689 WDI_WepType wdiWEPType
20690)
20691{
20692 /*Lightweight function - no sanity checks and no unecessary code to increase
20693 the chances of getting inlined*/
20694 switch ( wdiWEPType )
20695 {
20696 case WDI_WEP_STATIC:
20697 return eSIR_WEP_STATIC;
20698
20699 case WDI_WEP_DYNAMIC:
20700 return eSIR_WEP_DYNAMIC;
20701 }
20702
20703 return eSIR_WEP_MAX;
20704}/*WDI_2_HAL_WEP_TYPE*/
20705
20706WPT_STATIC WPT_INLINE tSirLinkState
20707WDI_2_HAL_LINK_STATE
20708(
20709 WDI_LinkStateType wdiLinkState
20710)
20711{
20712 /*Lightweight function - no sanity checks and no unecessary code to increase
20713 the chances of getting inlined*/
20714 switch ( wdiLinkState )
20715 {
20716 case WDI_LINK_IDLE_STATE:
20717 return eSIR_LINK_IDLE_STATE;
20718
20719 case WDI_LINK_PREASSOC_STATE:
20720 return eSIR_LINK_PREASSOC_STATE;
20721
20722 case WDI_LINK_POSTASSOC_STATE:
20723 return eSIR_LINK_POSTASSOC_STATE;
20724
20725 case WDI_LINK_AP_STATE:
20726 return eSIR_LINK_AP_STATE;
20727
20728 case WDI_LINK_IBSS_STATE:
20729 return eSIR_LINK_IBSS_STATE;
20730
20731 case WDI_LINK_BTAMP_PREASSOC_STATE:
20732 return eSIR_LINK_BTAMP_PREASSOC_STATE;
20733
20734 case WDI_LINK_BTAMP_POSTASSOC_STATE:
20735 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
20736
20737 case WDI_LINK_BTAMP_AP_STATE:
20738 return eSIR_LINK_BTAMP_AP_STATE;
20739
20740 case WDI_LINK_BTAMP_STA_STATE:
20741 return eSIR_LINK_BTAMP_STA_STATE;
20742
20743 case WDI_LINK_LEARN_STATE:
20744 return eSIR_LINK_LEARN_STATE;
20745
20746 case WDI_LINK_SCAN_STATE:
20747 return eSIR_LINK_SCAN_STATE;
20748
20749 case WDI_LINK_FINISH_SCAN_STATE:
20750 return eSIR_LINK_FINISH_SCAN_STATE;
20751
20752 case WDI_LINK_INIT_CAL_STATE:
20753 return eSIR_LINK_INIT_CAL_STATE;
20754
20755 case WDI_LINK_FINISH_CAL_STATE:
20756 return eSIR_LINK_FINISH_CAL_STATE;
20757
20758#ifdef WLAN_FEATURE_P2P
20759 case WDI_LINK_LISTEN_STATE:
20760 return eSIR_LINK_LISTEN_STATE;
20761#endif
20762
20763 default:
20764 return eSIR_LINK_MAX;
20765 }
20766}
20767
20768/*Translate a STA Context from WDI into HAL*/
20769WPT_STATIC WPT_INLINE
20770void
20771WDI_CopyWDIStaCtxToHALStaCtx
20772(
20773 tConfigStaParams* phalConfigSta,
20774 WDI_ConfigStaReqInfoType* pwdiConfigSta
20775)
20776{
20777 wpt_uint8 i;
20778 /*Lightweight function - no sanity checks and no unecessary code to increase
20779 the chances of getting inlined*/
20780
20781 wpalMemoryCopy(phalConfigSta->bssId,
20782 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
20783
20784 wpalMemoryCopy(phalConfigSta->staMac,
20785 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
20786
20787 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
20788 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
20789 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
20790 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
20791 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
20792 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
20793 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
20794 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
20795 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
20796 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
20797 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
20798 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
20799 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
20800 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
20801 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
20802 phalConfigSta->action = pwdiConfigSta->wdiAction;
20803 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
20804 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
20805 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
20806 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
20807 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
20808 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
20809 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
20810
20811 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
20812
20813 phalConfigSta->supportedRates.opRateMode =
20814 pwdiConfigSta->wdiSupportedRates.opRateMode;
20815 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
20816 {
20817 phalConfigSta->supportedRates.llbRates[i] =
20818 pwdiConfigSta->wdiSupportedRates.llbRates[i];
20819 }
20820 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
20821 {
20822 phalConfigSta->supportedRates.llaRates[i] =
20823 pwdiConfigSta->wdiSupportedRates.llaRates[i];
20824 }
20825 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
20826 {
20827 phalConfigSta->supportedRates.aniLegacyRates[i] =
20828 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
20829 }
20830 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
20831 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
20832 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
20833 {
20834 phalConfigSta->supportedRates.supportedMCSSet[i] =
20835 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
20836 }
20837 phalConfigSta->supportedRates.rxHighestDataRate =
20838 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
20839
20840#ifdef WLAN_FEATURE_P2P
20841 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
20842#endif
20843
20844}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
20845
20846/*Translate a Rate set info from WDI into HAL*/
20847WPT_STATIC WPT_INLINE void
20848WDI_CopyWDIRateSetToHALRateSet
20849(
20850 tSirMacRateSet* pHalRateSet,
20851 WDI_RateSet* pwdiRateSet
20852)
20853{
20854 wpt_uint8 i;
20855 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
20856
20857 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
20858 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
20859
20860 for ( i = 0; i < pHalRateSet->numRates; i++ )
20861 {
20862 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
20863 }
20864
20865}/*WDI_CopyWDIRateSetToHALRateSet*/
20866
20867
20868/*Translate an EDCA Parameter Record from WDI into HAL*/
20869WPT_STATIC WPT_INLINE void
20870WDI_CopyWDIEDCAParamsToHALEDCAParams
20871(
20872 tSirMacEdcaParamRecord* phalEdcaParam,
20873 WDI_EdcaParamRecord* pWDIEdcaParam
20874)
20875{
20876 /*Lightweight function - no sanity checks and no unecessary code to increase
20877 the chances of getting inlined*/
20878
20879 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
20880 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
20881 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
20882 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
20883
20884 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
20885 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
20886 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
20887}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
20888
20889
20890/*Copy a management frame header from WDI fmt into HAL fmt*/
20891WPT_STATIC WPT_INLINE void
20892WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
20893(
20894 tSirMacMgmtHdr* pmacMgmtHdr,
20895 WDI_MacMgmtHdr* pwdiMacMgmtHdr
20896)
20897{
20898 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
20899 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
20900 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
20901 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
20902 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
20903 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
20904 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
20905 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
20906 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
20907 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
20908 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
20909
20910 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
20911 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
20912
20913 wpalMemoryCopy(pmacMgmtHdr->da,
20914 pwdiMacMgmtHdr->da, 6);
20915 wpalMemoryCopy(pmacMgmtHdr->sa,
20916 pwdiMacMgmtHdr->sa, 6);
20917 wpalMemoryCopy(pmacMgmtHdr->bssId,
20918 pwdiMacMgmtHdr->bssId, 6);
20919
20920 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
20921 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
20922 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
20923
20924}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
20925
20926
20927/*Copy config bss parameters from WDI fmt into HAL fmt*/
20928WPT_STATIC WPT_INLINE void
20929WDI_CopyWDIConfigBSSToHALConfigBSS
20930(
20931 tConfigBssParams* phalConfigBSS,
20932 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
20933)
20934{
20935
20936 wpt_uint8 keyIndex = 0;
20937 wpalMemoryCopy( phalConfigBSS->bssId,
20938 pwdiConfigBSS->macBSSID,
20939 WDI_MAC_ADDR_LEN);
20940
20941#ifdef HAL_SELF_STA_PER_BSS
20942 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
20943 pwdiConfigBSS->macSelfAddr,
20944 WDI_MAC_ADDR_LEN);
20945#endif
20946
20947 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
20948
20949 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
20950 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
20951
20952 phalConfigBSS->shortSlotTimeSupported =
20953 pwdiConfigBSS->ucShortSlotTimeSupported;
20954 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
20955 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
20956 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
20957 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
20958 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
20959 phalConfigBSS->fLsigTXOPProtectionFullSupport =
20960 pwdiConfigBSS->ucTXOPProtectionFullSupport;
20961 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
20962 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
20963 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
20964 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
20965 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
20966 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
20967 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
20968 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
20969 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
20970 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
20971
20972 phalConfigBSS->htOperMode =
20973 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
20974
20975 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
20976 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
20977 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
20978 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
20979
20980#ifdef WLAN_FEATURE_VOWIFI
20981 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
20982#endif
20983
20984 /*! Used 32 as magic number because that is how the ssid is declared inside the
20985 hal header - hal needs a macro for it */
20986 phalConfigBSS->ssId.length =
20987 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
20988 pwdiConfigBSS->wdiSSID.ucLength : 32;
20989 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
20990 pwdiConfigBSS->wdiSSID.sSSID,
20991 phalConfigBSS->ssId.length);
20992
20993 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
20994 &pwdiConfigBSS->wdiSTAContext);
20995
20996 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
20997 &pwdiConfigBSS->wdiRateSet);
20998
20999 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21000
21001 if(phalConfigBSS->edcaParamsValid)
21002 {
21003 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21004 &pwdiConfigBSS->wdiBEEDCAParams);
21005 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21006 &pwdiConfigBSS->wdiBKEDCAParams);
21007 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21008 &pwdiConfigBSS->wdiVIEDCAParams);
21009 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21010 &pwdiConfigBSS->wdiVOEDCAParams);
21011 }
21012
21013 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
21014
21015 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21016
21017#ifdef WLAN_FEATURE_VOWIFI_11R
21018
21019 phalConfigBSS->extSetStaKeyParamValid =
21020 pwdiConfigBSS->bExtSetStaKeyParamValid;
21021
21022 if( phalConfigBSS->extSetStaKeyParamValid )
21023 {
21024 /*-----------------------------------------------------------------------
21025 Copy the STA Key parameters into the HAL message
21026 -----------------------------------------------------------------------*/
21027 phalConfigBSS->extSetStaKeyParam.encType =
21028 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21029
21030 phalConfigBSS->extSetStaKeyParam.wepType =
21031 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21032
21033 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21034
21035 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21036
21037 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21038
21039#ifdef WLAN_SOFTAP_FEATURE
21040 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21041 keyIndex++)
21042 {
21043 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
21044 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21045 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21046 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21047 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21048 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21049 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
21050 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
21051 WDI_MAX_KEY_RSC_LEN);
21052 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
21053 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
21054 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
21055 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21056 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
21057 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
21058 WDI_MAX_KEY_LENGTH);
21059 }
21060#else
21061 phalConfigBSS->extSetStaKeyParam.key.keyId =
21062 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21063 phalConfigBSS->extSetStaKeyParam.key.unicast =
21064 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21065 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21066 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21067 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
21068 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
21069 WDI_MAX_KEY_RSC_LEN);
21070 phalConfigBSS->extSetStaKeyParam.key.paeRole =
21071 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
21072 phalConfigBSS->extSetStaKeyParam.key.keyLength =
21073 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21074 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
21075 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
21076 WDI_MAX_KEY_LENGTH);
21077#endif
21078 }
21079 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21080 {
21081 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
21082 sizeof(phalConfigBSS->extSetStaKeyParam) );
21083 }
21084
21085#endif /*WLAN_FEATURE_VOWIFI_11R*/
21086
21087}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21088
21089
21090/*Extract the request CB function and user data from a request structure
21091 pointed to by user data */
21092WPT_STATIC WPT_INLINE void
21093WDI_ExtractRequestCBFromEvent
21094(
21095 WDI_EventInfoType* pEvent,
21096 WDI_ReqStatusCb* ppfnReqCB,
21097 void** ppUserData
21098)
21099{
21100 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21101 switch ( pEvent->wdiRequest )
21102 {
21103 case WDI_START_REQ:
21104 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21105 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21106 break;
21107 case WDI_STOP_REQ:
21108 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21109 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21110 break;
21111 case WDI_INIT_SCAN_REQ:
21112 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21113 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21114 break;
21115 case WDI_START_SCAN_REQ:
21116 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21117 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21118 break;
21119 case WDI_END_SCAN_REQ:
21120 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21121 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21122 break;
21123 case WDI_FINISH_SCAN_REQ:
21124 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21125 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21126 break;
21127 case WDI_JOIN_REQ:
21128 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21129 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21130 break;
21131 case WDI_CONFIG_BSS_REQ:
21132 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21133 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21134 break;
21135 case WDI_DEL_BSS_REQ:
21136 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21137 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21138 break;
21139 case WDI_POST_ASSOC_REQ:
21140 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21141 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21142 break;
21143 case WDI_DEL_STA_REQ:
21144 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21145 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21146 break;
21147 case WDI_DEL_STA_SELF_REQ:
21148 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21149 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21150 break;
21151
21152 case WDI_SET_BSS_KEY_REQ:
21153 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21154 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21155 break;
21156 case WDI_RMV_BSS_KEY_REQ:
21157 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21158 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21159 break;
21160 case WDI_SET_STA_KEY_REQ:
21161 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21162 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21163 break;
21164 case WDI_RMV_STA_KEY_REQ:
21165 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21166 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21167 break;
21168 case WDI_ADD_TS_REQ:
21169 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21170 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21171 break;
21172 case WDI_DEL_TS_REQ:
21173 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21174 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21175 break;
21176 case WDI_UPD_EDCA_PRMS_REQ:
21177 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21178 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21179 break;
21180 case WDI_ADD_BA_SESSION_REQ:
21181 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21182 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21183 break;
21184 case WDI_DEL_BA_REQ:
21185 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21186 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21187 break;
21188#ifdef FEATURE_WLAN_CCX
21189 case WDI_TSM_STATS_REQ:
21190 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21191 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21192 break;
21193#endif
21194 case WDI_CH_SWITCH_REQ:
21195 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21196 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21197 break;
21198 case WDI_CONFIG_STA_REQ:
21199 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21200 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21201 break;
21202 case WDI_SET_LINK_ST_REQ:
21203 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21204 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21205 break;
21206 case WDI_GET_STATS_REQ:
21207 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21208 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21209 break;
21210 case WDI_UPDATE_CFG_REQ:
21211 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21212 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21213 break;
21214 case WDI_ADD_BA_REQ:
21215 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21216 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21217 break;
21218 case WDI_TRIGGER_BA_REQ:
21219 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21220 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21221 break;
21222 case WDI_UPD_BCON_PRMS_REQ:
21223 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21224 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21225 break;
21226 case WDI_SND_BCON_REQ:
21227 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21228 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21229 break;
21230 case WDI_ENTER_BMPS_REQ:
21231 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21232 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21233 break;
21234 case WDI_EXIT_BMPS_REQ:
21235 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21236 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21237 break;
21238 case WDI_ENTER_UAPSD_REQ:
21239 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21240 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21241 break;
21242 case WDI_UPDATE_UAPSD_PARAM_REQ:
21243 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21244 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21245 break;
21246 case WDI_CONFIGURE_RXP_FILTER_REQ:
21247 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21248 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21249 break;
21250 case WDI_SET_BEACON_FILTER_REQ:
21251 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21252 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21253 break;
21254 case WDI_REM_BEACON_FILTER_REQ:
21255 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21256 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21257 break;
21258 case WDI_SET_RSSI_THRESHOLDS_REQ:
21259 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21260 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21261 break;
21262 case WDI_HOST_OFFLOAD_REQ:
21263 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21264 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21265 break;
21266 case WDI_WOWL_ADD_BC_PTRN_REQ:
21267 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21268 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21269 break;
21270 case WDI_WOWL_DEL_BC_PTRN_REQ:
21271 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21272 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21273 break;
21274 case WDI_WOWL_ENTER_REQ:
21275 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21276 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21277 break;
21278 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21279 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21280 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21281 break;
21282 case WDI_FLUSH_AC_REQ:
21283 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21284 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21285 break;
21286 case WDI_BTAMP_EVENT_REQ:
21287 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21288 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21289 break;
21290 case WDI_KEEP_ALIVE_REQ:
21291 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21292 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21293 break;
21294 case WDI_SET_TX_PER_TRACKING_REQ:
21295 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21296 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21297 default:
21298 *ppfnReqCB = NULL;
21299 *ppUserData = NULL;
21300 break;
21301 }
21302}/*WDI_ExtractRequestCBFromEvent*/
21303
21304
21305/**
21306 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
21307 frame xtl is enabled for a particular STA.
21308
21309 WDI_PostAssocReq must have been called.
21310
21311 @param uSTAIdx: STA index
21312
21313 @see WDI_PostAssocReq
21314 @return Result of the function call
21315*/
21316wpt_boolean
21317WDI_IsHwFrameTxTranslationCapable
21318(
21319 wpt_uint8 uSTAIdx
21320)
21321{
21322 /*!! FIX ME - this must eventually be per station - for now just feedback
21323 uma value*/
21324 /*------------------------------------------------------------------------
21325 Sanity Check
21326 ------------------------------------------------------------------------*/
21327 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21328 {
21329 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21330 "WDI API call before module is initialized - Fail request");
21331
21332 return WDI_STATUS_E_NOT_ALLOWED;
21333 }
21334
21335
21336 return gWDICb.bFrameTransEnabled;
21337}/*WDI_IsHwFrameTxTranslationCapable*/
21338
21339#ifdef FEATURE_WLAN_SCAN_PNO
21340/**
21341 @brief WDI_SetPreferredNetworkList
21342
21343 @param pwdiPNOScanReqParams: the Set PNO as specified
21344 by the Device Interface
21345
21346 wdiPNOScanCb: callback for passing back the response
21347 of the Set PNO operation received from the
21348 device
21349
21350 pUserData: user data will be passed back with the
21351 callback
21352
21353 @return Result of the function call
21354*/
21355WDI_Status
21356WDI_SetPreferredNetworkReq
21357(
21358 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21359 WDI_PNOScanCb wdiPNOScanCb,
21360 void* pUserData
21361)
21362{
21363 WDI_EventInfoType wdiEventData = {{0}};
21364 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21365
21366 /*------------------------------------------------------------------------
21367 Sanity Check
21368 ------------------------------------------------------------------------*/
21369 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21370 {
21371 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21372 "WDI API call before module is initialized - Fail request");
21373
21374 return WDI_STATUS_E_NOT_ALLOWED;
21375 }
21376
21377 /*------------------------------------------------------------------------
21378 Fill in Event data and post to the Main FSM
21379 ------------------------------------------------------------------------*/
21380 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
21381 wdiEventData.pEventData = pwdiPNOScanReqParams;
21382 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
21383 wdiEventData.pCBfnc = wdiPNOScanCb;
21384 wdiEventData.pUserData = pUserData;
21385
21386 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21387}
21388
21389
21390/**
21391 @brief WDI_SetRssiFilterReq
21392
21393 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
21394 specified by the Device Interface
21395
21396 wdiRssiFilterCb: callback for passing back the response
21397 of the Set RSSI Filter operation received from the
21398 device
21399
21400 pUserData: user data will be passed back with the
21401 callback
21402
21403 @return Result of the function call
21404*/
21405WDI_Status
21406WDI_SetRssiFilterReq
21407(
21408 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
21409 WDI_RssiFilterCb wdiRssiFilterCb,
21410 void* pUserData
21411)
21412{
21413 WDI_EventInfoType wdiEventData = {{0}};
21414 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21415
21416 /*------------------------------------------------------------------------
21417 Sanity Check
21418 ------------------------------------------------------------------------*/
21419 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21420 {
21421 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21422 "WDI API call before module is initialized - Fail request");
21423
21424 return WDI_STATUS_E_NOT_ALLOWED;
21425 }
21426
21427 /*------------------------------------------------------------------------
21428 Fill in Event data and post to the Main FSM
21429 ------------------------------------------------------------------------*/
21430 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
21431 wdiEventData.pEventData = pwdiRssiFilterReqParams;
21432 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
21433 wdiEventData.pCBfnc = wdiRssiFilterCb;
21434 wdiEventData.pUserData = pUserData;
21435
21436 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21437}/*WDI_SetRssiFilterReq*/
21438
21439/**
21440 @brief WDI_UpdateScanParamsReq
21441
21442 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
21443 by the Device Interface
21444
21445 wdiUpdateScanParamsCb: callback for passing back the response
21446 of the Set PNO operation received from the
21447 device
21448
21449 pUserData: user data will be passed back with the
21450 callback
21451
21452 @return Result of the function call
21453*/
21454WDI_Status
21455WDI_UpdateScanParamsReq
21456(
21457 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
21458 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
21459 void* pUserData
21460)
21461{
21462 WDI_EventInfoType wdiEventData = {{0}};
21463 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21464
21465 /*------------------------------------------------------------------------
21466 Sanity Check
21467 ------------------------------------------------------------------------*/
21468 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21469 {
21470 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21471 "WDI API call before module is initialized - Fail request");
21472
21473 return WDI_STATUS_E_NOT_ALLOWED;
21474 }
21475
21476 /*------------------------------------------------------------------------
21477 Fill in Event data and post to the Main FSM
21478 ------------------------------------------------------------------------*/
21479 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
21480 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
21481 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
21482 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
21483 wdiEventData.pUserData = pUserData;
21484
21485 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21486}
21487
21488/**
21489 @brief Helper function to pack Set Preferred Network List
21490 Request parameters
21491
21492 @param pWDICtx: pointer to the WLAN DAL context
21493 pwdiPNOScanReqParams: pointer to the info received
21494 from upper layers
21495 ppSendBuffer, pSize - out pointers of the packed buffer
21496 and its size
21497
21498 @return Result of the function call
21499*/
21500
21501WDI_Status
21502WDI_PackPreferredNetworkList
21503(
21504 WDI_ControlBlockType* pWDICtx,
21505 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21506 wpt_uint8** ppSendBuffer,
21507 wpt_uint16* pSize
21508)
21509{
21510 wpt_uint8* pSendBuffer = NULL;
21511 wpt_uint16 usDataOffset = 0;
21512 wpt_uint16 usSendSize = 0;
21513 tPrefNetwListParams pPrefNetwListParams = {0};
21514 wpt_uint8 i;
21515 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21516
21517 /*-----------------------------------------------------------------------
21518 Get message buffer
21519 -----------------------------------------------------------------------*/
21520 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21521 sizeof(pPrefNetwListParams),
21522 &pSendBuffer, &usDataOffset, &usSendSize))||
21523 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21524 {
21525 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21526 "Unable to get send buffer in Set PNO req %x ",
21527 pwdiPNOScanReqParams);
21528 WDI_ASSERT(0);
21529 return WDI_STATUS_E_FAILURE;
21530 }
21531
21532 /*-------------------------------------------------------------------------
21533 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21534 -------------------------------------------------------------------------*/
21535 pPrefNetwListParams.enable =
21536 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
21537 pPrefNetwListParams.modePNO =
21538 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21539
21540 pPrefNetwListParams.ucNetworksCount =
21541 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
21542 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
21543 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
21544 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21545
21546 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21547 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
21548 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
21549 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
21550 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
21551
21552 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
21553 {
21554 /*SSID of the BSS*/
21555 pPrefNetwListParams.aNetworks[i].ssId.length
21556 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
21557
21558 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
21559 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
21560 pPrefNetwListParams.aNetworks[i].ssId.length);
21561
21562 /*Authentication type for the network*/
21563 pPrefNetwListParams.aNetworks[i].authentication =
21564 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
21565
21566 /*Encryption type for the network*/
21567 pPrefNetwListParams.aNetworks[i].encryption =
21568 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
21569
21570 /*Indicate the channel on which the Network can be found
21571 0 - if all channels */
21572 pPrefNetwListParams.aNetworks[i].ucChannelCount =
21573 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
21574
21575 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
21576 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
21577 pPrefNetwListParams.aNetworks[i].ucChannelCount);
21578
21579 /*Indicates the RSSI threshold for the network to be considered*/
21580 pPrefNetwListParams.aNetworks[i].rssiThreshold =
21581 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
21582
21583 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21584 "WDI SET PNO: SSID %d %s",
21585 pPrefNetwListParams.aNetworks[i].ssId.length,
21586 pPrefNetwListParams.aNetworks[i].ssId.ssId);
21587 }
21588
21589 pPrefNetwListParams.scanTimers.ucScanTimersCount =
21590 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
21591 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
21592 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
21593 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
21594
21595 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21596 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
21597 pPrefNetwListParams.scanTimers.ucScanTimersCount,
21598 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
21599 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
21600
21601 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
21602 {
21603 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
21604 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
21605 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
21606 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
21607 }
21608
21609 /*Copy the probe template*/
21610 pPrefNetwListParams.us24GProbeSize =
21611 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
21612 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21613 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
21614 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21615
21616 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
21617 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
21618 pPrefNetwListParams.us24GProbeSize);
21619
21620 pPrefNetwListParams.us5GProbeSize =
21621 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
21622 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21623 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
21624 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21625
21626 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
21627 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
21628 pPrefNetwListParams.us5GProbeSize);
21629
21630 /*Pack the buffer*/
21631 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
21632 sizeof(pPrefNetwListParams));
21633
21634 /*Set the output values*/
21635 *ppSendBuffer = pSendBuffer;
21636 *pSize = usSendSize;
21637
21638 return WDI_STATUS_SUCCESS;
21639}/*WDI_PackPreferredNetworkList*/
21640
21641/**
21642 @brief Helper function to pack Set Preferred Network List
21643 Request parameters
21644
21645 @param pWDICtx: pointer to the WLAN DAL context
21646 pwdiPNOScanReqParams: pointer to the info received
21647 from upper layers
21648 ppSendBuffer, pSize - out pointers of the packed buffer
21649 and its size
21650
21651 @return Result of the function call
21652*/
21653
21654WDI_Status
21655WDI_PackPreferredNetworkListNew
21656(
21657 WDI_ControlBlockType* pWDICtx,
21658 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21659 wpt_uint8** ppSendBuffer,
21660 wpt_uint16* pSize
21661)
21662{
21663 wpt_uint8* pSendBuffer = NULL;
21664 wpt_uint16 usDataOffset = 0;
21665 wpt_uint16 usSendSize = 0;
21666 tPrefNetwListParamsNew pPrefNetwListParams;
21667 wpt_uint8 i;
21668 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21669
21670 /*-----------------------------------------------------------------------
21671 Get message buffer
21672 -----------------------------------------------------------------------*/
21673 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21674 sizeof(pPrefNetwListParams),
21675 &pSendBuffer, &usDataOffset, &usSendSize))||
21676 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21677 {
21678 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21679 "Unable to get send buffer in Set PNO req %x ",
21680 pwdiPNOScanReqParams);
21681 WDI_ASSERT(0);
21682 return WDI_STATUS_E_FAILURE;
21683 }
21684
21685 /*-------------------------------------------------------------------------
21686 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21687 -------------------------------------------------------------------------*/
21688 pPrefNetwListParams.enable =
21689 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
21690 pPrefNetwListParams.modePNO =
21691 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21692
21693 pPrefNetwListParams.ucNetworksCount =
21694 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
21695 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
21696 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
21697 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21698
21699 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21700 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
21701 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
21702 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
21703 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
21704
21705 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
21706 {
21707 /*SSID of the BSS*/
21708 pPrefNetwListParams.aNetworks[i].ssId.length
21709 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
21710
21711 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
21712 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
21713 pPrefNetwListParams.aNetworks[i].ssId.length);
21714
21715 /*Authentication type for the network*/
21716 pPrefNetwListParams.aNetworks[i].authentication =
21717 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
21718
21719 /*Encryption type for the network*/
21720 pPrefNetwListParams.aNetworks[i].encryption =
21721 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
21722
21723 /*SSID bcast type for the network*/
21724 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
21725 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
21726
21727 /*Indicate the channel on which the Network can be found
21728 0 - if all channels */
21729 pPrefNetwListParams.aNetworks[i].ucChannelCount =
21730 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
21731
21732 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
21733 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
21734 pPrefNetwListParams.aNetworks[i].ucChannelCount);
21735
21736 /*Indicates the RSSI threshold for the network to be considered*/
21737 pPrefNetwListParams.aNetworks[i].rssiThreshold =
21738 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
21739
21740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21741 "WDI SET PNO: SSID %d %s",
21742 pPrefNetwListParams.aNetworks[i].ssId.length,
21743 pPrefNetwListParams.aNetworks[i].ssId.ssId);
21744 }
21745
21746 pPrefNetwListParams.scanTimers.ucScanTimersCount =
21747 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
21748 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
21749 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
21750 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
21751
21752 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21753 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
21754 pPrefNetwListParams.scanTimers.ucScanTimersCount,
21755 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
21756 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
21757
21758 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
21759 {
21760 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
21761 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
21762 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
21763 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
21764 }
21765
21766 /*Copy the probe template*/
21767 pPrefNetwListParams.us24GProbeSize =
21768 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
21769 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21770 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
21771 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21772
21773 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
21774 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
21775 pPrefNetwListParams.us24GProbeSize);
21776
21777 pPrefNetwListParams.us5GProbeSize =
21778 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
21779 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21780 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
21781 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21782
21783 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
21784 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
21785 pPrefNetwListParams.us5GProbeSize);
21786
21787 /*Pack the buffer*/
21788 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
21789 sizeof(pPrefNetwListParams));
21790
21791 /*Set the output values*/
21792 *ppSendBuffer = pSendBuffer;
21793 *pSize = usSendSize;
21794
21795 return WDI_STATUS_SUCCESS;
21796}/*WDI_PackPreferredNetworkListNew*/
21797
21798/**
21799 @brief Process Set Preferred Network List Request function
21800
21801 @param pWDICtx: pointer to the WLAN DAL context
21802 pEventData: pointer to the event information structure
21803
21804 @return Result of the function call
21805*/
21806WDI_Status
21807WDI_ProcessSetPreferredNetworkReq
21808(
21809 WDI_ControlBlockType* pWDICtx,
21810 WDI_EventInfoType* pEventData
21811)
21812{
21813 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
21814 WDI_PNOScanCb wdiPNOScanCb = NULL;
21815 wpt_uint8* pSendBuffer = NULL;
21816 wpt_uint16 usSendSize = 0;
21817 WDI_Status wdiStatus;
21818
21819 /*-------------------------------------------------------------------------
21820 Sanity check
21821 -------------------------------------------------------------------------*/
21822 if (( NULL == pEventData ) ||
21823 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
21824 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
21825 {
21826 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21827 "%s: Invalid parameters", __FUNCTION__);
21828 WDI_ASSERT(0);
21829 return WDI_STATUS_E_FAILURE;
21830 }
21831
21832 /*-------------------------------------------------------------------------
21833 Pack the PNO request structure based on version
21834 -------------------------------------------------------------------------*/
21835 if ( pWDICtx->wdiPNOVersion > 0 )
21836 {
21837 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21838 "%s: PNO new version %d ", __FUNCTION__,
21839 pWDICtx->wdiPNOVersion);
21840
21841 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
21842 &pSendBuffer, &usSendSize);
21843 }
21844 else
21845 {
21846 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21847 "%s: PNO old version %d ", __FUNCTION__,
21848 pWDICtx->wdiPNOVersion);
21849
21850 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
21851 &pSendBuffer, &usSendSize);
21852 }
21853
21854 if (( WDI_STATUS_SUCCESS != wdiStatus )||
21855 ( NULL == pSendBuffer )||( 0 == usSendSize ))
21856 {
21857 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21858 "%s: failed to pack request parameters", __FUNCTION__);
21859 WDI_ASSERT(0);
21860 return wdiStatus;
21861 }
21862
21863 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
21864 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
21865
21866 /*-------------------------------------------------------------------------
21867 Send Get STA Request to HAL
21868 -------------------------------------------------------------------------*/
21869 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
21870 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
21871}
21872
21873/**
21874 @brief Process Set RSSI Filter Request function
21875
21876 @param pWDICtx: pointer to the WLAN DAL context
21877 pEventData: pointer to the event information structure
21878
21879 @see
21880 @return Result of the function call
21881*/
21882WDI_Status
21883WDI_ProcessSetRssiFilterReq
21884(
21885 WDI_ControlBlockType* pWDICtx,
21886 WDI_EventInfoType* pEventData
21887)
21888{
21889 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
21890 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
21891 wpt_uint8* pSendBuffer = NULL;
21892 wpt_uint16 usDataOffset = 0;
21893 wpt_uint16 usSendSize = 0;
21894 wpt_uint8 ucRssiThreshold;
21895
21896 /*-------------------------------------------------------------------------
21897 Sanity check
21898 -------------------------------------------------------------------------*/
21899 if (( NULL == pEventData ) ||
21900 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
21901 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
21902 {
21903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21904 "%s: Invalid parameters", __FUNCTION__);
21905 WDI_ASSERT(0);
21906 return WDI_STATUS_E_FAILURE;
21907 }
21908
21909 /*-----------------------------------------------------------------------
21910 Get message buffer
21911 -----------------------------------------------------------------------*/
21912 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21913 sizeof(ucRssiThreshold),
21914 &pSendBuffer, &usDataOffset, &usSendSize))||
21915 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
21916 {
21917 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21918 "Unable to get send buffer in Set PNO req %x %x %x",
21919 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
21920 WDI_ASSERT(0);
21921 return WDI_STATUS_E_FAILURE;
21922 }
21923
21924 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
21925
21926 wpalMemoryCopy( pSendBuffer+usDataOffset,
21927 &ucRssiThreshold,
21928 sizeof(ucRssiThreshold));
21929
21930 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
21931 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
21932
21933 /*-------------------------------------------------------------------------
21934 Send Get STA Request to HAL
21935 -------------------------------------------------------------------------*/
21936 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
21937 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
21938}
21939
21940
21941/**
21942 @brief Process Update Scan Params function
21943
21944 @param pWDICtx: pointer to the WLAN DAL context
21945 pEventData: pointer to the event information structure
21946
21947 @see
21948 @return Result of the function call
21949*/
21950WDI_Status
21951WDI_ProcessUpdateScanParamsReq
21952(
21953 WDI_ControlBlockType* pWDICtx,
21954 WDI_EventInfoType* pEventData
21955)
21956{
21957 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
21958 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
21959 wpt_uint8* pSendBuffer = NULL;
21960 wpt_uint16 usDataOffset = 0;
21961 wpt_uint16 usSendSize = 0;
21962 tUpdateScanParams updateScanParams = {0};
21963
21964
21965 /*-------------------------------------------------------------------------
21966 Sanity check
21967 -------------------------------------------------------------------------*/
21968 if (( NULL == pEventData ) ||
21969 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
21970 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
21971 {
21972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21973 "%s: Invalid parameters", __FUNCTION__);
21974 WDI_ASSERT(0);
21975 return WDI_STATUS_E_FAILURE;
21976 }
21977
21978 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21979 "Begin WDI Update Scan Parameters");
21980 /*-----------------------------------------------------------------------
21981 Get message buffer
21982 -----------------------------------------------------------------------*/
21983 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
21984 sizeof(updateScanParams),
21985 &pSendBuffer, &usDataOffset, &usSendSize))||
21986 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
21987 {
21988 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21989 "Unable to get send buffer in Update Scan Params req %x %x %x",
21990 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
21991 WDI_ASSERT(0);
21992 return WDI_STATUS_E_FAILURE;
21993 }
21994
21995 //
21996 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
21997 //
21998
21999 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22000 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
22001 updateScanParams.ucChannelCount =
22002 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22003 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22004 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22005 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22006
22007 wpalMemoryCopy( updateScanParams.aChannels,
22008 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22009 updateScanParams.ucChannelCount);
22010
22011 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22012 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22013 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22014 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22015 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22016
22017 wpalMemoryCopy( pSendBuffer+usDataOffset,
22018 &updateScanParams,
22019 sizeof(updateScanParams));
22020
22021 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
22022 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
22023
22024 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22025 "End Update Scan Parameters");
22026 /*-------------------------------------------------------------------------
22027 Send Get STA Request to HAL
22028 -------------------------------------------------------------------------*/
22029 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22030 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
22031}
22032
22033/**
22034 @brief Process Preferred Network Found Indication function
22035
22036 @param pWDICtx: pointer to the WLAN DAL context
22037 pEventData: pointer to the event information structure
22038
22039 @see
22040 @return Result of the function call
22041*/
22042WDI_Status
22043WDI_ProcessPrefNetworkFoundInd
22044(
22045 WDI_ControlBlockType* pWDICtx,
22046 WDI_EventInfoType* pEventData
22047)
22048{
22049 WDI_LowLevelIndType wdiInd;
22050 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22051
22052
22053 /*-------------------------------------------------------------------------
22054 Sanity check
22055 -------------------------------------------------------------------------*/
22056 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22057 ( NULL == pEventData->pEventData ))
22058 {
22059 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22060 "%s: Invalid parameters", __FUNCTION__);
22061 WDI_ASSERT( 0 );
22062 return WDI_STATUS_E_FAILURE;
22063 }
22064
22065 /*-------------------------------------------------------------------------
22066 Extract indication and send it to UMAC
22067 -------------------------------------------------------------------------*/
22068 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22069 pEventData->pEventData,
22070 sizeof(tPrefNetwFoundParams));
22071
22072 /*Fill in the indication parameters*/
22073 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
22074
22075 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22076
22077 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
22078 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
22079 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
22080
22081 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22082 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
22083 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22084
22085 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22086 prefNetwFoundInd.prefNetwFoundParams.rssi;
22087
22088 // DEBUG
22089 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22090 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22091 wdiInd.wdiIndicationType,
22092 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22093 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22094
22095 /*Notify UMAC*/
22096 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
22097
22098 return WDI_STATUS_SUCCESS;
22099}
22100
22101/**
22102 @brief Process PNO Rsp function (called when a
22103 response is being received over the bus from HAL)
22104
22105 @param pWDICtx: pointer to the WLAN DAL context
22106 pEventData: pointer to the event information structure
22107
22108 @see
22109 @return Result of the function call
22110*/
22111WDI_Status
22112WDI_ProcessSetPreferredNetworkRsp
22113(
22114 WDI_ControlBlockType* pWDICtx,
22115 WDI_EventInfoType* pEventData
22116)
22117{
22118 WDI_Status wdiStatus;
22119 eHalStatus halStatus;
22120 WDI_PNOScanCb wdiPNOScanCb = NULL;
22121 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22122
22123 /*-------------------------------------------------------------------------
22124 Sanity check
22125 -------------------------------------------------------------------------*/
22126 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22127 ( NULL == pEventData->pEventData ))
22128 {
22129 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22130 "%s: Invalid parameters", __FUNCTION__);
22131 WDI_ASSERT(0);
22132 return WDI_STATUS_E_FAILURE;
22133 }
22134
22135
22136 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
22137
22138 /*-------------------------------------------------------------------------
22139 Extract response and send it to UMAC
22140 -------------------------------------------------------------------------*/
22141 halStatus = *((eHalStatus*)pEventData->pEventData);
22142 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22143
22144 /*Notify UMAC*/
22145 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22146
22147 return WDI_STATUS_SUCCESS;
22148}/*WDI_ProcessSetPreferredNetworkRsp*/
22149
22150/**
22151 @brief Process RSSI Filter Rsp function (called when a
22152 response is being received over the bus from HAL)
22153
22154 @param pWDICtx: pointer to the WLAN DAL context
22155 pEventData: pointer to the event information structure
22156
22157 @see
22158 @return Result of the function call
22159*/
22160WDI_Status
22161WDI_ProcessSetRssiFilterRsp
22162(
22163 WDI_ControlBlockType* pWDICtx,
22164 WDI_EventInfoType* pEventData
22165)
22166{
22167 WDI_Status wdiStatus;
22168 eHalStatus halStatus;
22169 WDI_RssiFilterCb wdiRssiFilterCb;
22170 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22171
22172 /*-------------------------------------------------------------------------
22173 Sanity check
22174 -------------------------------------------------------------------------*/
22175 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22176 ( NULL == pEventData->pEventData ))
22177 {
22178 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22179 "%s: Invalid parameters", __FUNCTION__);
22180 WDI_ASSERT(0);
22181 return WDI_STATUS_E_FAILURE;
22182 }
22183
22184 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
22185
22186 /*-------------------------------------------------------------------------
22187 Extract response and send it to UMAC
22188 -------------------------------------------------------------------------*/
22189 halStatus = *((eHalStatus*)pEventData->pEventData);
22190 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22191
22192 /*Notify UMAC*/
22193 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22194
22195 return WDI_STATUS_SUCCESS;
22196}/*WDI_ProcessSetRssiFilterRsp*/
22197
22198/**
22199 @brief Process Update Scan Params Rsp function (called when a
22200 response is being received over the bus from HAL)
22201
22202 @param pWDICtx: pointer to the WLAN DAL context
22203 pEventData: pointer to the event information structure
22204
22205 @see
22206 @return Result of the function call
22207*/
22208WDI_Status
22209WDI_ProcessUpdateScanParamsRsp
22210(
22211 WDI_ControlBlockType* pWDICtx,
22212 WDI_EventInfoType* pEventData
22213)
22214{
22215 WDI_Status wdiStatus;
22216 tUpdateScanParamsResp halUpdScanParams;
22217 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
22218 wpt_uint32 uStatus;
22219 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22220
22221 /*-------------------------------------------------------------------------
22222 Sanity check
22223 -------------------------------------------------------------------------*/
22224 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22225 ( NULL == pEventData->pEventData ))
22226 {
22227 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22228 "%s: Invalid parameters", __FUNCTION__);
22229 WDI_ASSERT(0);
22230 return WDI_STATUS_E_FAILURE;
22231 }
22232
22233 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22234 "Process UPD scan params ptr : %x", __FUNCTION__);
22235
22236 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
22237
22238 /*-------------------------------------------------------------------------
22239 Extract response and send it to UMAC
22240 -------------------------------------------------------------------------*/
22241 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22242 pEventData->pEventData,
22243 sizeof(halUpdScanParams.status));
22244
22245 uStatus = halUpdScanParams.status;
22246
22247 /*Extract PNO version - 1st bit of the status */
22248 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
22249
22250 /*Remove version bit*/
22251 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
22252
22253 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
22254
22255 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22256 "UPD Scan Parameters rsp with status: %d",
22257 halUpdScanParams.status);
22258
22259 /*Notify UMAC*/
22260 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22261
22262 return WDI_STATUS_SUCCESS;
22263}
22264#endif // FEATURE_WLAN_SCAN_PNO
22265
22266#ifdef WLAN_FEATURE_PACKET_FILTERING
22267WDI_Status
22268WDI_8023MulticastListReq
22269(
22270 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22271 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22272 void* pUserData
22273)
22274{
22275 WDI_EventInfoType wdiEventData;
22276 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22277
22278 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22279 "%s", __FUNCTION__);
22280
22281 /*------------------------------------------------------------------------
22282 Sanity Check
22283 ------------------------------------------------------------------------*/
22284 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22285 {
22286 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22287 "WDI API call before module is initialized - Fail request");
22288
22289 return WDI_STATUS_E_NOT_ALLOWED;
22290 }
22291
22292 /*------------------------------------------------------------------------
22293 Fill in Event data and post to the Main FSM
22294 ------------------------------------------------------------------------*/
22295 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
22296 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
22297 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
22298 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
22299 wdiEventData.pUserData = pUserData;
22300
22301 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22302}
22303
22304WDI_Status
22305WDI_ReceiveFilterSetFilterReq
22306(
22307 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22308 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22309 void* pUserData
22310)
22311{
22312 WDI_EventInfoType wdiEventData;
22313 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22314
22315 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22316 "%s",__FUNCTION__);
22317
22318 /*------------------------------------------------------------------------
22319 Sanity Check
22320 ------------------------------------------------------------------------*/
22321 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22322 {
22323 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22324 "WDI API call before module is initialized - Fail request");
22325
22326 return WDI_STATUS_E_NOT_ALLOWED;
22327 }
22328
22329 /*------------------------------------------------------------------------
22330 Fill in Event data and post to the Main FSM
22331 ------------------------------------------------------------------------*/
22332 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
22333 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22334 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22335 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
22336 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
22337 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
22338 wdiEventData.pUserData = pUserData;
22339
22340
22341 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22342}
22343
22344WDI_Status
22345WDI_FilterMatchCountReq
22346(
22347 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
22348 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
22349 void* pUserData
22350)
22351{
22352 WDI_EventInfoType wdiEventData;
22353 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22354
22355 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22356 "%s",__FUNCTION__);
22357
22358 /*------------------------------------------------------------------------
22359 Sanity Check
22360 ------------------------------------------------------------------------*/
22361 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22362 {
22363 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22364 "WDI API call before module is initialized - Fail request");
22365
22366 return WDI_STATUS_E_NOT_ALLOWED;
22367 }
22368
22369 /*------------------------------------------------------------------------
22370 Fill in Event data and post to the Main FSM
22371 ------------------------------------------------------------------------*/
22372 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
22373 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
22374 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
22375 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
22376 wdiEventData.pUserData = pUserData;
22377
22378
22379 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22380}
22381
22382WDI_Status
22383WDI_ReceiveFilterClearFilterReq
22384(
22385 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
22386 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
22387 void* pUserData
22388)
22389{
22390 WDI_EventInfoType wdiEventData;
22391 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22392
22393 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22394 "%s",__FUNCTION__);
22395
22396 /*------------------------------------------------------------------------
22397 Sanity Check
22398 ------------------------------------------------------------------------*/
22399 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22400 {
22401 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22402 "WDI API call before module is initialized - Fail request");
22403
22404 return WDI_STATUS_E_NOT_ALLOWED;
22405 }
22406
22407 /*------------------------------------------------------------------------
22408 Fill in Event data and post to the Main FSM
22409 ------------------------------------------------------------------------*/
22410 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
22411 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
22412 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
22413 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
22414 wdiEventData.pUserData = pUserData;
22415
22416
22417 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22418}
22419
22420/**
22421 @brief Process 8023 Multicast List Request function
22422
22423 @param pWDICtx: pointer to the WLAN DAL context
22424 pEventData: pointer to the event information structure
22425
22426 @see
22427 @return Result of the function call
22428*/
22429WDI_Status
22430WDI_Process8023MulticastListReq
22431(
22432 WDI_ControlBlockType* pWDICtx,
22433 WDI_EventInfoType* pEventData
22434)
22435{
22436 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
22437 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
22438 wpt_uint8* pSendBuffer = NULL;
22439 wpt_uint16 usDataOffset = 0;
22440 wpt_uint16 usSendSize = 0;
22441 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
22442 wpt_uint8 i;
22443
22444 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22445 "%s",__FUNCTION__);
22446
22447 /*-------------------------------------------------------------------------
22448 Sanity check
22449 -------------------------------------------------------------------------*/
22450 if (( NULL == pEventData ) ||
22451 ( NULL == (pwdiFltPktSetMcListReqParamsType =
22452 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
22453 ( NULL == (wdi8023MulticastListCb =
22454 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
22455 {
22456 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22457 "%s: Invalid parameters", __FUNCTION__);
22458 WDI_ASSERT(0);
22459 return WDI_STATUS_E_FAILURE;
22460 }
22461
22462 /*-----------------------------------------------------------------------
22463 Get message buffer
22464 -----------------------------------------------------------------------*/
22465 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22466 WDI_8023_MULTICAST_LIST_REQ,
22467 sizeof(tHalRcvFltMcAddrListType),
22468 &pSendBuffer, &usDataOffset, &usSendSize))||
22469 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
22470 {
22471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22472 "Unable to get send buffer in "
22473 "WDI_Process8023MulticastListReq() %x %x %x",
22474 pEventData, pwdiFltPktSetMcListReqParamsType,
22475 wdi8023MulticastListCb);
22476 WDI_ASSERT(0);
22477 return WDI_STATUS_E_FAILURE;
22478 }
22479
22480 rcvFltMcAddrListType.cMulticastAddr =
22481 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
22482 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
22483 {
22484 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
22485 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
22486 sizeof(tSirMacAddr));
22487 }
22488
22489 wpalMemoryCopy( pSendBuffer+usDataOffset,
22490 &rcvFltMcAddrListType,
22491 sizeof(rcvFltMcAddrListType));
22492
22493 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
22494 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
22495
22496
22497 /*-------------------------------------------------------------------------
22498 Send Get STA Request to HAL
22499 -------------------------------------------------------------------------*/
22500 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22501 wdi8023MulticastListCb, pEventData->pUserData,
22502 WDI_8023_MULTICAST_LIST_RESP);
22503}
22504
22505/**
22506 @brief Process Receive Filter Set Filter Request function
22507
22508 @param pWDICtx: pointer to the WLAN DAL context
22509 pEventData: pointer to the event information structure
22510
22511 @see
22512 @return Result of the function call
22513*/
22514WDI_Status
22515WDI_ProcessReceiveFilterSetFilterReq
22516(
22517 WDI_ControlBlockType* pWDICtx,
22518 WDI_EventInfoType* pEventData
22519)
22520{
22521 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
22522 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
22523 wpt_uint8* pSendBuffer = NULL;
22524 wpt_uint16 usDataOffset = 0;
22525 wpt_uint16 usSendSize = 0;
22526 wpt_uint32 usRcvPktFilterCfgSize;
22527 tHalRcvPktFilterCfgType *pRcvPktFilterCfg;
22528 wpt_uint8 i;
22529
22530 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22531 "%s",__FUNCTION__);
22532
22533 /*-------------------------------------------------------------------------
22534 Sanity check
22535 -------------------------------------------------------------------------*/
22536 if (( NULL == pEventData ) ||
22537 ( NULL == (pwdiSetRcvPktFilterReqInfo =
22538 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
22539 ( NULL == (wdiReceiveFilterSetFilterCb =
22540 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
22541 {
22542 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22543 "%s: Invalid parameters", __FUNCTION__);
22544 WDI_ASSERT(0);
22545 return WDI_STATUS_E_FAILURE;
22546 }
22547
22548 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
22549 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
22550 * sizeof(tHalRcvPktFilterParams));
22551
22552 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
22553 usRcvPktFilterCfgSize);
22554
22555 if(NULL == pRcvPktFilterCfg)
22556 {
22557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22558 "%s: Failed to allocate memory for "
22559 "tHalRcvPktFilterCfgType: %x %x %x ",
22560 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
22561 WDI_ASSERT(0);
22562 return WDI_STATUS_E_FAILURE;
22563 }
22564
22565 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
22566
22567 /*-----------------------------------------------------------------------
22568 Get message buffer
22569 -----------------------------------------------------------------------*/
22570 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
22571 usRcvPktFilterCfgSize,
22572 &pSendBuffer, &usDataOffset, &usSendSize))||
22573 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
22574 {
22575 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22576 "Unable to get send buffer in "
22577 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
22578 pEventData, pwdiSetRcvPktFilterReqInfo,
22579 wdiReceiveFilterSetFilterCb);
22580 WDI_ASSERT(0);
22581 wpalMemoryFree(pRcvPktFilterCfg);
22582 return WDI_STATUS_E_FAILURE;
22583 }
22584
22585 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22586 "UsData Off %d UsSend %d cfg %d",usDataOffset,
22587 usSendSize,usRcvPktFilterCfgSize);
22588
22589 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
22590 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
22591 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
22592 pRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
22593
22594
22595 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22596 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
22597 pRcvPktFilterCfg->filterType);
22598 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22599 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
22600 pRcvPktFilterCfg->coleasceTime);
22601
22602 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
22603 {
22604 pRcvPktFilterCfg->paramsData[i].protocolLayer =
22605 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
22606 pRcvPktFilterCfg->paramsData[i].cmpFlag =
22607 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
22608 pRcvPktFilterCfg->paramsData[i].dataOffset =
22609 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
22610 pRcvPktFilterCfg->paramsData[i].dataLength =
22611 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
22612
22613 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
22614 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
22615 8);
22616 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
22617 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
22618 8);
22619
22620 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22621 "Out:Proto %d Comp Flag %d \n",
22622 pRcvPktFilterCfg->paramsData[i].protocolLayer,
22623 pRcvPktFilterCfg->paramsData[i].cmpFlag);
22624
22625 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22626 "Data Offset %d Data Len %d\n",
22627 pRcvPktFilterCfg->paramsData[i].dataOffset,
22628 pRcvPktFilterCfg->paramsData[i].dataLength);
22629
22630 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22631 "CData: %d:%d:%d:%d:%d:%d\n",
22632 pRcvPktFilterCfg->paramsData[i].compareData[0],
22633 pRcvPktFilterCfg->paramsData[i].compareData[1],
22634 pRcvPktFilterCfg->paramsData[i].compareData[2],
22635 pRcvPktFilterCfg->paramsData[i].compareData[3],
22636 pRcvPktFilterCfg->paramsData[i].compareData[4],
22637 pRcvPktFilterCfg->paramsData[i].compareData[5]);
22638
22639 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22640 "MData: %d:%d:%d:%d:%d:%d\n",
22641 pRcvPktFilterCfg->paramsData[i].dataMask[0],
22642 pRcvPktFilterCfg->paramsData[i].dataMask[1],
22643 pRcvPktFilterCfg->paramsData[i].dataMask[2],
22644 pRcvPktFilterCfg->paramsData[i].dataMask[3],
22645 pRcvPktFilterCfg->paramsData[i].dataMask[4],
22646 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
22647 }
22648
22649 wpalMemoryCopy( pSendBuffer+usDataOffset,
22650 pRcvPktFilterCfg,
22651 usRcvPktFilterCfgSize);
22652
22653
22654 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
22655 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
22656
22657 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22658 "%s",__FUNCTION__);
22659 wpalMemoryFree(pRcvPktFilterCfg);
22660
22661 /*-------------------------------------------------------------------------
22662 Send Get STA Request to HAL
22663 -------------------------------------------------------------------------*/
22664 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22665 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
22666 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
22667}
22668
22669/**
22670 @brief Process Packet Filter Match Count Request function
22671
22672 @param pWDICtx: pointer to the WLAN DAL context
22673 pEventData: pointer to the event information structure
22674
22675 @see
22676 @return Result of the function call
22677*/
22678WDI_Status
22679WDI_ProcessFilterMatchCountReq
22680(
22681 WDI_ControlBlockType* pWDICtx,
22682 WDI_EventInfoType* pEventData
22683)
22684{
22685 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
22686 NULL;
22687 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
22688 NULL;
22689 wpt_uint8* pSendBuffer = NULL;
22690 wpt_uint16 usDataOffset = 0;
22691 wpt_uint16 usSendSize = 0;
22692
22693 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22694 "%s",__FUNCTION__);
22695
22696 /*-------------------------------------------------------------------------
22697 Sanity check
22698 -------------------------------------------------------------------------*/
22699 if (( NULL == pEventData ) ||
22700 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
22701 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
22702 ( NULL == (wdiFilterMatchCountCb =
22703 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
22704 {
22705 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22706 "%s: Invalid parameters", __FUNCTION__);
22707 WDI_ASSERT(0);
22708 return WDI_STATUS_E_FAILURE;
22709 }
22710
22711 /*-----------------------------------------------------------------------
22712 Get message buffer
22713 -----------------------------------------------------------------------*/
22714 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22715 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
22716 0,
22717 &pSendBuffer, &usDataOffset, &usSendSize))||
22718 ( usSendSize < usDataOffset))
22719 {
22720 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22721 "Unable to get send buffer in "
22722 "WDI_ProcessFilterMatchCountReq() %x %x %x",
22723 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
22724 wdiFilterMatchCountCb);
22725 WDI_ASSERT(0);
22726 return WDI_STATUS_E_FAILURE;
22727 }
22728
22729 //
22730 // Don't need to fill send buffer other than header
22731 //
22732 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
22733 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
22734
22735
22736 /*-------------------------------------------------------------------------
22737 Send Get STA Request to HAL
22738 -------------------------------------------------------------------------*/
22739 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22740 wdiFilterMatchCountCb,
22741 pEventData->pUserData,
22742 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
22743}
22744
22745/**
22746 @brief Process Receive Filter Clear Filter Request function
22747
22748 @param pWDICtx: pointer to the WLAN DAL context
22749 pEventData: pointer to the event information structure
22750
22751 @see
22752 @return Result of the function call
22753*/
22754WDI_Status
22755WDI_ProcessReceiveFilterClearFilterReq
22756(
22757 WDI_ControlBlockType* pWDICtx,
22758 WDI_EventInfoType* pEventData
22759)
22760{
22761 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
22762 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
22763 wpt_uint8* pSendBuffer = NULL;
22764 wpt_uint16 usDataOffset = 0;
22765 wpt_uint16 usSendSize = 0;
22766 tHalRcvFltPktClearParam rcvFltPktClearParam;
22767
22768 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22769 "%s",__FUNCTION__);
22770
22771 /*-------------------------------------------------------------------------
22772 Sanity check
22773 -------------------------------------------------------------------------*/
22774 if (( NULL == pEventData ) ||
22775 ( NULL == (pwdiRcvFltPktClearReqParamsType =
22776 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
22777 ( NULL == (wdiRcvFltPktClearFilterCb =
22778 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
22779 {
22780 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22781 "%s: Invalid parameters", __FUNCTION__);
22782 WDI_ASSERT(0);
22783 return WDI_STATUS_E_FAILURE;
22784 }
22785
22786 /*-----------------------------------------------------------------------
22787 Get message buffer
22788 -----------------------------------------------------------------------*/
22789 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22790 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
22791 sizeof(tHalRcvFltPktClearParam),
22792 &pSendBuffer, &usDataOffset, &usSendSize))||
22793 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
22794 {
22795 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22796 "Unable to get send buffer in "
22797 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
22798 pEventData, pwdiRcvFltPktClearReqParamsType,
22799 wdiRcvFltPktClearFilterCb);
22800 WDI_ASSERT(0);
22801 return WDI_STATUS_E_FAILURE;
22802 }
22803
22804
22805 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
22806 filterClearParam.status;
22807 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
22808 filterClearParam.filterId;
22809
22810 wpalMemoryCopy( pSendBuffer+usDataOffset,
22811 &rcvFltPktClearParam,
22812 sizeof(rcvFltPktClearParam));
22813
22814 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
22815 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
22816
22817
22818 /*-------------------------------------------------------------------------
22819 Send Get STA Request to HAL
22820 -------------------------------------------------------------------------*/
22821 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22822 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
22823 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
22824}
22825
22826/**
22827 @brief Process 8023 Multicast List Response function
22828
22829 @param pWDICtx: pointer to the WLAN DAL context
22830 pEventData: pointer to the event information structure
22831
22832 @see
22833 @return Result of the function call
22834*/
22835WDI_Status
22836WDI_Process8023MulticastListRsp
22837(
22838 WDI_ControlBlockType* pWDICtx,
22839 WDI_EventInfoType* pEventData
22840)
22841{
22842 WDI_Status wdiStatus;
22843 eHalStatus halStatus;
22844 WDI_8023MulticastListCb wdi8023MulticastListCb;
22845 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22846
22847 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22848 "%s",__FUNCTION__);
22849
22850 /*-------------------------------------------------------------------------
22851 Sanity check
22852 -------------------------------------------------------------------------*/
22853 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22854 ( NULL == pEventData->pEventData ))
22855 {
22856 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22857 "%s: Invalid parameters", __FUNCTION__);
22858 WDI_ASSERT(0);
22859 return WDI_STATUS_E_FAILURE;
22860 }
22861
22862 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
22863
22864 /*-------------------------------------------------------------------------
22865 Extract response and send it to UMAC
22866 -------------------------------------------------------------------------*/
22867 halStatus = *((eHalStatus*)pEventData->pEventData);
22868 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22869
22870 /*Notify UMAC*/
22871 wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData);
22872
22873 return WDI_STATUS_SUCCESS;
22874}
22875
22876/**
22877 @brief Process Set Rsp function (called when a
22878 response is being received over the bus from HAL)
22879
22880 @param pWDICtx: pointer to the WLAN DAL context
22881 pEventData: pointer to the event information structure
22882
22883 @see
22884 @return Result of the function call
22885*/
22886WDI_Status
22887WDI_ProcessReceiveFilterSetFilterRsp
22888(
22889 WDI_ControlBlockType* pWDICtx,
22890 WDI_EventInfoType* pEventData
22891)
22892{
22893 WDI_Status wdiStatus;
22894 eHalStatus halStatus;
22895 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
22896 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22897
22898 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22899 "%s",__FUNCTION__);
22900
22901 /*-------------------------------------------------------------------------
22902 Sanity check
22903 -------------------------------------------------------------------------*/
22904 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22905 ( NULL == pEventData->pEventData ))
22906 {
22907 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22908 "%s: Invalid parameters", __FUNCTION__);
22909 WDI_ASSERT(0);
22910 return WDI_STATUS_E_FAILURE;
22911 }
22912
22913 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
22914 pfncRspCB;
22915
22916 /*-------------------------------------------------------------------------
22917 Extract response and send it to UMAC
22918 -------------------------------------------------------------------------*/
22919 halStatus = *((eHalStatus*)pEventData->pEventData);
22920 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22921
22922 /*Notify UMAC*/
22923 wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22924
22925 return WDI_STATUS_SUCCESS;
22926}
22927
22928/**
22929 @brief Process Packet Filter Match Count Response function
22930
22931 @param pWDICtx: pointer to the WLAN DAL context
22932 pEventData: pointer to the event information structure
22933
22934 @see
22935 @return Result of the function call
22936*/
22937WDI_Status
22938WDI_ProcessFilterMatchCountRsp
22939(
22940 WDI_ControlBlockType* pWDICtx,
22941 WDI_EventInfoType* pEventData
22942)
22943{
22944 WDI_Status wdiStatus;
22945 eHalStatus halStatus;
22946
22947 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
22948
22949 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22950
22951 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22952 "%s",__FUNCTION__);
22953
22954 /*-------------------------------------------------------------------------
22955 Sanity check
22956 -------------------------------------------------------------------------*/
22957 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22958 ( NULL == pEventData->pEventData ))
22959 {
22960 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22961 "%s: Invalid parameters", __FUNCTION__);
22962 WDI_ASSERT(0);
22963 return WDI_STATUS_E_FAILURE;
22964 }
22965
22966 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
22967
22968 /*-------------------------------------------------------------------------
22969 Extract response and send it to UMAC
22970 -------------------------------------------------------------------------*/
22971 halStatus = *((eHalStatus*)pEventData->pEventData);
22972 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22973
22974 /*Notify UMAC*/
22975 wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData);
22976
22977 return WDI_STATUS_SUCCESS;
22978}
22979
22980/**
22981 @brief Process Receive Filter Clear Filter Response function
22982
22983 @param pWDICtx: pointer to the WLAN DAL context
22984 pEventData: pointer to the event information structure
22985
22986 @see
22987 @return Result of the function call
22988*/
22989WDI_Status
22990WDI_ProcessReceiveFilterClearFilterRsp
22991(
22992 WDI_ControlBlockType* pWDICtx,
22993 WDI_EventInfoType* pEventData
22994)
22995{
22996 WDI_Status wdiStatus;
22997 eHalStatus halStatus;
22998 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
22999 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23000
23001 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23002 "%s",__FUNCTION__);
23003
23004 /*-------------------------------------------------------------------------
23005 Sanity check
23006 -------------------------------------------------------------------------*/
23007 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23008 ( NULL == pEventData->pEventData ))
23009 {
23010 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23011 "%s: Invalid parameters", __FUNCTION__);
23012 WDI_ASSERT(0);
23013 return WDI_STATUS_E_FAILURE;
23014 }
23015
23016 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
23017 pfncRspCB;
23018
23019 /*-------------------------------------------------------------------------
23020 Extract response and send it to UMAC
23021 -------------------------------------------------------------------------*/
23022 halStatus = *((eHalStatus*)pEventData->pEventData);
23023 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23024
23025 /*Notify UMAC*/
23026 wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23027
23028 return WDI_STATUS_SUCCESS;
23029}
23030#endif // WLAN_FEATURE_PACKET_FILTERING
23031
23032/**
23033 @brief Process Shutdown Rsp function
23034 There is no shutdown response comming from HAL
23035 - function just kept for simmetry
23036
23037 @param pWDICtx: pointer to the WLAN DAL context
23038 pEventData: pointer to the event information structure
23039
23040 @see
23041 @return Result of the function call
23042*/
23043WDI_Status
23044WDI_ProcessShutdownRsp
23045(
23046 WDI_ControlBlockType* pWDICtx,
23047 WDI_EventInfoType* pEventData
23048)
23049{
23050 /*There is no shutdown response comming from HAL - function just kept for
23051 simmetry */
23052 WDI_ASSERT(0);
23053 return WDI_STATUS_SUCCESS;
23054}/*WDI_ProcessShutdownRsp*/
23055
23056/**
23057 @brief WDI_SetPowerParamsReq
23058
23059 @param pwdiPowerParamsReqParams: the Set Power Params as
23060 specified by the Device Interface
23061
23062 wdiPowerParamsCb: callback for passing back the response
23063 of the Set Power Params operation received from the
23064 device
23065
23066 pUserData: user data will be passed back with the
23067 callback
23068
23069 @return Result of the function call
23070*/
23071WDI_Status
23072WDI_SetPowerParamsReq
23073(
23074 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23075 WDI_SetPowerParamsCb wdiPowerParamsCb,
23076 void* pUserData
23077)
23078{
23079 WDI_EventInfoType wdiEventData;
23080 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23081
23082 /*------------------------------------------------------------------------
23083 Sanity Check
23084 ------------------------------------------------------------------------*/
23085 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23086 {
23087 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23088 "WDI API call before module is initialized - Fail request");
23089
23090 return WDI_STATUS_E_NOT_ALLOWED;
23091 }
23092
23093 /*------------------------------------------------------------------------
23094 Fill in Event data and post to the Main FSM
23095 ------------------------------------------------------------------------*/
23096 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
23097 wdiEventData.pEventData = pwdiPowerParamsReqParams;
23098 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
23099 wdiEventData.pCBfnc = wdiPowerParamsCb;
23100 wdiEventData.pUserData = pUserData;
23101
23102 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23103}/*WDI_SetPowerParamsReq*/
23104
23105/**
23106 @brief Process Set Power Params Request function
23107
23108 @param pWDICtx: pointer to the WLAN DAL context
23109 pEventData: pointer to the event information structure
23110
23111 @see
23112 @return Result of the function call
23113*/
23114WDI_Status
23115WDI_ProcessSetPowerParamsReq
23116(
23117 WDI_ControlBlockType* pWDICtx,
23118 WDI_EventInfoType* pEventData
23119)
23120{
23121 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
23122 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
23123 wpt_uint8* pSendBuffer = NULL;
23124 wpt_uint16 usDataOffset = 0;
23125 wpt_uint16 usSendSize = 0;
23126 tSetPowerParamsType powerParams;
23127
23128 /*-------------------------------------------------------------------------
23129 Sanity check
23130 -------------------------------------------------------------------------*/
23131 if (( NULL == pEventData ) ||
23132 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
23133 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
23134 {
23135 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23136 "%s: Invalid parameters", __FUNCTION__);
23137 WDI_ASSERT(0);
23138 return WDI_STATUS_E_FAILURE;
23139 }
23140
23141 /*-----------------------------------------------------------------------
23142 Get message buffer
23143 -----------------------------------------------------------------------*/
23144 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
23145 sizeof(powerParams),
23146 &pSendBuffer, &usDataOffset, &usSendSize))||
23147 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
23148 {
23149 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23150 "Unable to get send buffer in Set PNO req %x %x %x",
23151 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
23152 WDI_ASSERT(0);
23153 return WDI_STATUS_E_FAILURE;
23154 }
23155
23156 /* Ignore DTIM */
23157 powerParams.uIgnoreDTIM =
23158 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
23159
23160 /*DTIM Period*/
23161 powerParams.uDTIMPeriod =
23162 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
23163
23164 /* Listen Interval */
23165 powerParams.uListenInterval=
23166 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
23167
23168 /* Broadcast Multicas Filter */
23169 powerParams.uBcastMcastFilter =
23170 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
23171
23172 /* Beacon Early Termination */
23173 powerParams.uEnableBET =
23174 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
23175
23176 /* Beacon Early Termination Interval */
23177 powerParams.uBETInterval =
23178 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
23179
23180
23181 wpalMemoryCopy( pSendBuffer+usDataOffset,
23182 &powerParams,
23183 sizeof(powerParams));
23184
23185 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
23186 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
23187
23188 /*-------------------------------------------------------------------------
23189 Send Get STA Request to HAL
23190 -------------------------------------------------------------------------*/
23191 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23192 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
23193}
23194
23195/**
23196 @brief Process Power Params Rsp function (called when a
23197 response is being received over the bus from HAL)
23198
23199 @param pWDICtx: pointer to the WLAN DAL context
23200 pEventData: pointer to the event information structure
23201
23202 @see
23203 @return Result of the function call
23204*/
23205WDI_Status
23206WDI_ProcessSetPowerParamsRsp
23207(
23208 WDI_ControlBlockType* pWDICtx,
23209 WDI_EventInfoType* pEventData
23210)
23211{
23212 WDI_Status wdiStatus;
23213 eHalStatus halStatus;
23214 WDI_SetPowerParamsCb wdiPowerParamsCb;
23215 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23216
23217 /*-------------------------------------------------------------------------
23218 Sanity check
23219 -------------------------------------------------------------------------*/
23220 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23221 ( NULL == pEventData->pEventData ))
23222 {
23223 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23224 "%s: Invalid parameters", __FUNCTION__);
23225 WDI_ASSERT(0);
23226 return WDI_STATUS_E_FAILURE;
23227 }
23228
23229 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
23230
23231 /*-------------------------------------------------------------------------
23232 Extract response and send it to UMAC
23233 -------------------------------------------------------------------------*/
23234 halStatus = *((eHalStatus*)pEventData->pEventData);
23235 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23236
23237 /*Notify UMAC*/
23238 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23239
23240 return WDI_STATUS_SUCCESS;
23241}/*WDI_ProcessSetPowerParamsRsp*/
23242
23243#ifdef WLAN_FEATURE_GTK_OFFLOAD
23244/**
23245 @brief WDI_GTKOffloadReq will be called when the upper MAC
23246 wants to set GTK Rekey Counter while in power save. Upon
23247 the call of this API the WLAN DAL will pack and send a
23248 HAL GTK offload request message to the lower RIVA
23249 sub-system if DAL is in state STARTED.
23250
23251 In state BUSY this request will be queued. Request won't
23252 be allowed in any other state.
23253
23254 WDI_PostAssocReq must have been called.
23255
23256 @param pwdiGtkOffloadParams: the GTK offload as specified
23257 by the Device Interface
23258
23259 wdiGtkOffloadCb: callback for passing back the response
23260 of the GTK offload operation received from the device
23261
23262 pUserData: user data will be passed back with the
23263 callback
23264
23265 @see WDI_PostAssocReq
23266 @return Result of the function call
23267*/
23268WDI_Status
23269WDI_GTKOffloadReq
23270(
23271 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
23272 WDI_GtkOffloadCb wdiGtkOffloadCb,
23273 void* pUserData
23274)
23275{
23276 WDI_EventInfoType wdiEventData = {0};
23277 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23278
23279 /*------------------------------------------------------------------------
23280 Sanity Check
23281 ------------------------------------------------------------------------*/
23282 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23283 {
23284 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23285 "WDI API call before module is initialized - Fail request");
23286
23287 return WDI_STATUS_E_NOT_ALLOWED;
23288 }
23289
23290 /*------------------------------------------------------------------------
23291 Fill in Event data and post to the Main FSM
23292 ------------------------------------------------------------------------*/
23293 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
23294 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
23295 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
23296 wdiEventData.pCBfnc = wdiGtkOffloadCb;
23297 wdiEventData.pUserData = pUserData;
23298
23299 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23300}
23301
23302
23303/**
23304 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
23305 MAC wants to get GTK Rekey Counter while in power save.
23306 Upon the call of this API the WLAN DAL will pack and
23307 send a HAL GTK offload request message to the lower RIVA
23308 sub-system if DAL is in state STARTED.
23309
23310 In state BUSY this request will be queued. Request won't
23311 be allowed in any other state.
23312
23313 WDI_PostAssocReq must have been called.
23314
23315 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
23316 Information Message as specified by the
23317 Device Interface
23318
23319 wdiGtkOffloadGetInfoCb: callback for passing back the
23320 response of the GTK offload operation received from the
23321 device
23322
23323 pUserData: user data will be passed back with the
23324 callback
23325
23326 @see WDI_PostAssocReq
23327 @return Result of the function call
23328*/
23329WDI_Status
23330WDI_GTKOffloadGetInfoReq
23331(
23332 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
23333 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
23334 void* pUserData
23335)
23336{
23337 WDI_EventInfoType wdiEventData = {0};
23338 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23339
23340 /*------------------------------------------------------------------------
23341 Sanity Check
23342 ------------------------------------------------------------------------*/
23343 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23344 {
23345 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23346 "WDI API call before module is initialized - Fail request");
23347
23348 return WDI_STATUS_E_NOT_ALLOWED;
23349 }
23350
23351 /*------------------------------------------------------------------------
23352 Fill in Event data and post to the Main FSM
23353 ------------------------------------------------------------------------*/
23354 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
23355 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
23356 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
23357 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
23358 wdiEventData.pUserData = pUserData;
23359
23360 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23361}
23362
23363
23364/**
23365 @brief Process set GTK Offload Request function
23366
23367 @param pWDICtx: pointer to the WLAN DAL context
23368 pEventData: pointer to the event information structure
23369
23370 @see
23371 @return Result of the function call
23372*/
23373WDI_Status
23374WDI_ProcessGTKOffloadReq
23375(
23376 WDI_ControlBlockType* pWDICtx,
23377 WDI_EventInfoType* pEventData
23378)
23379{
23380 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
23381 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23382 wpt_uint8* pSendBuffer = NULL;
23383 wpt_uint16 usDataOffset = 0;
23384 wpt_uint16 usSendSize = 0;
23385 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
23386 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23387
23388 /*-------------------------------------------------------------------------
23389 Sanity check
23390 -------------------------------------------------------------------------*/
23391 if (( NULL == pEventData ) ||
23392 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
23393 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
23394 {
23395 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23396 "%s: Invalid parameters", __FUNCTION__);
23397 WDI_ASSERT(0);
23398 return WDI_STATUS_E_FAILURE;
23399 }
23400
23401 /*-----------------------------------------------------------------------
23402 Get message buffer
23403 -----------------------------------------------------------------------*/
23404 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
23405 sizeof(gtkOffloadReqParams),
23406 &pSendBuffer, &usDataOffset, &usSendSize))||
23407 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
23408 {
23409 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23410 "Unable to get send buffer in GTK offload req %x %x %x",
23411 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
23412 WDI_ASSERT(0);
23413 return WDI_STATUS_E_FAILURE;
23414 }
23415
23416 //
23417 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
23418 //
23419 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
23420 // Copy KCK
23421 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
23422 // Copy KEK
23423 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
23424 // Copy KeyReplayCounter
23425 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
23426
23427 wpalMemoryCopy( pSendBuffer+usDataOffset,
23428 &gtkOffloadReqParams,
23429 sizeof(gtkOffloadReqParams));
23430
23431 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
23432 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
23433
23434 /*-------------------------------------------------------------------------
23435 Send Get STA Request to HAL
23436 -------------------------------------------------------------------------*/
23437 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23438 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
23439}
23440
23441
23442/**
23443 @brief Process GTK Offload Get Information Request function
23444
23445 @param pWDICtx: pointer to the WLAN DAL context
23446 pEventData: pointer to the event information structure
23447
23448 @see
23449 @return Result of the function call
23450*/
23451WDI_Status
23452WDI_ProcessGTKOffloadGetInfoReq
23453(
23454 WDI_ControlBlockType* pWDICtx,
23455 WDI_EventInfoType* pEventData
23456)
23457{
23458 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
23459 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23460 wpt_uint8* pSendBuffer = NULL;
23461 wpt_uint16 usDataOffset = 0;
23462 wpt_uint16 usSendSize = 0;
23463
23464 /*-------------------------------------------------------------------------
23465 Sanity check
23466 -------------------------------------------------------------------------*/
23467 if (( NULL == pEventData ) ||
23468 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
23469 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
23470 {
23471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23472 "%s: Invalid parameters", __FUNCTION__);
23473 WDI_ASSERT(0);
23474 return WDI_STATUS_E_FAILURE;
23475 }
23476
23477 /*-----------------------------------------------------------------------
23478 Get message buffer
23479 -----------------------------------------------------------------------*/
23480 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
23481 0,
23482 &pSendBuffer, &usDataOffset, &usSendSize))||
23483 ( usSendSize < usDataOffset))
23484 {
23485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23486 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
23487 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
23488 WDI_ASSERT(0);
23489 return WDI_STATUS_E_FAILURE;
23490 }
23491
23492 //
23493 // Don't need to fill send buffer other than header
23494 //
23495
23496 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
23497 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
23498
23499 /*-------------------------------------------------------------------------
23500 Send Get STA Request to HAL
23501 -------------------------------------------------------------------------*/
23502 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23503 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
23504}
23505
23506/**
23507 @brief Process host offload Rsp function (called when a
23508 response is being received over the bus from HAL)
23509
23510 @param pWDICtx: pointer to the WLAN DAL context
23511 pEventData: pointer to the event information structure
23512
23513 @see
23514 @return Result of the function call
23515*/
23516WDI_Status
23517WDI_ProcessGtkOffloadRsp
23518(
23519 WDI_ControlBlockType* pWDICtx,
23520 WDI_EventInfoType* pEventData
23521)
23522{
23523 WDI_Status wdiStatus;
23524 eHalStatus halStatus;
23525 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23526 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23527
23528 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
23529
23530 /*-------------------------------------------------------------------------
23531 Sanity check
23532 -------------------------------------------------------------------------*/
23533 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23534 ( NULL == pEventData->pEventData))
23535 {
23536 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23537 "%s: Invalid parameters", __FUNCTION__);
23538 WDI_ASSERT(0);
23539 return WDI_STATUS_E_FAILURE;
23540 }
23541
23542 /*-------------------------------------------------------------------------
23543 Extract response and send it to UMAC
23544 -------------------------------------------------------------------------*/
23545 halStatus = *((eHalStatus*)pEventData->pEventData);
23546 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23547
23548 /*Notify UMAC*/
23549 wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
23550
23551 return WDI_STATUS_SUCCESS;
23552}
23553
23554/**
23555 @brief Process GTK Offload Get Information Response function
23556
23557 @param pWDICtx: pointer to the WLAN DAL context
23558 pEventData: pointer to the event information structure
23559
23560 @see
23561 @return Result of the function call
23562*/
23563WDI_Status
23564WDI_ProcessGTKOffloadGetInfoRsp
23565(
23566 WDI_ControlBlockType* pWDICtx,
23567 WDI_EventInfoType* pEventData
23568)
23569{
23570 WDI_Status wdiStatus;
23571 eHalStatus halStatus;
23572
23573 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23574
23575 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23576
23577 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
23578
23579 /*-------------------------------------------------------------------------
23580 Sanity check
23581 -------------------------------------------------------------------------*/
23582 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23583 ( NULL == pEventData->pEventData ))
23584 {
23585 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23586 "%s: Invalid parameters", __FUNCTION__);
23587 WDI_ASSERT(0);
23588 return WDI_STATUS_E_FAILURE;
23589 }
23590
23591 /*-------------------------------------------------------------------------
23592 Extract response and send it to UMAC
23593 -------------------------------------------------------------------------*/
23594 halStatus = *((eHalStatus*)pEventData->pEventData);
23595 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23596
23597 /*Notify UMAC*/
23598 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23599 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23600 wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData);
23601
23602 return WDI_STATUS_SUCCESS;
23603}
23604#endif // WLAN_FEATURE_GTK_OFFLOAD
23605
23606#ifdef WLAN_WAKEUP_EVENTS
23607WDI_Status
23608WDI_ProcessWakeReasonInd
23609(
23610 WDI_ControlBlockType* pWDICtx,
23611 WDI_EventInfoType* pEventData
23612)
23613{
23614 WDI_LowLevelIndType *pWdiInd;
23615 tpWakeReasonParams pWakeReasonParams;
23616 wpt_uint32 allocSize = 0;
23617
23618 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23619 "+%s", __FUNCTION__);
23620
23621 /*-------------------------------------------------------------------------
23622 Sanity check
23623 -------------------------------------------------------------------------*/
23624 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23625 ( NULL == pEventData->pEventData ))
23626 {
23627 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23628 "%s: Invalid parameters", __FUNCTION__);
23629 WDI_ASSERT( 0 );
23630 return WDI_STATUS_E_FAILURE;
23631 }
23632
23633 /*-------------------------------------------------------------------------
23634 Extract indication and send it to UMAC
23635 -------------------------------------------------------------------------*/
23636 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
23637
23638 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
23639
23640 //Allocate memory for WDI_WakeReasonIndType structure
23641 pWdiInd = wpalMemoryAllocate(allocSize) ;
23642
23643 if(NULL == pWdiInd)
23644 {
23645 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23646 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
23647 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23648 WDI_ASSERT(0);
23649 return WDI_STATUS_E_FAILURE;
23650 }
23651
23652 wpalMemoryZero(pWdiInd, allocSize);
23653
23654 /* Fill in the indication parameters*/
23655 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
23656 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
23657 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
23658 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
23659 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
23660 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
23661 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
23662 &(pWakeReasonParams->aDataStart[0]),
23663 pWakeReasonParams->ulStoredDataLen);
23664
23665 /*Notify UMAC*/
23666 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
23667
23668 //Free memory allocated for WDI_WakeReasonIndType structure
23669 wpalMemoryFree(pWdiInd);
23670
23671 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23672 "-%s", __FUNCTION__);
23673
23674 return WDI_STATUS_SUCCESS;
23675}
23676#endif // WLAN_WAKEUP_EVENTS
23677
23678void WDI_GetWcnssCompiledApiVersion
23679(
23680 WDI_WlanVersionType *pWcnssApiVersion
23681)
23682{
23683 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
23684 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
23685 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
23686 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
23687}
23688
23689/**
23690 @brief Process Set TM Level Rsp function (called when a
23691 response is being received over the bus from HAL)
23692
23693 @param pWDICtx: pointer to the WLAN DAL context
23694 pEventData: pointer to the event information structure
23695
23696 @see
23697 @return Result of the function call
23698*/
23699WDI_Status
23700WDI_ProcessSetTmLevelRsp
23701(
23702 WDI_ControlBlockType* pWDICtx,
23703 WDI_EventInfoType* pEventData
23704)
23705{
23706 WDI_Status wdiStatus;
23707 eHalStatus halStatus;
23708 WDI_SetTmLevelCb wdiSetTmLevelCb;
23709 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23710
23711 /*-------------------------------------------------------------------------
23712 Sanity check
23713 -------------------------------------------------------------------------*/
23714 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23715 ( NULL == pEventData->pEventData ))
23716 {
23717 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23718 "%s: Invalid parameters", __FUNCTION__);
23719 WDI_ASSERT(0);
23720 return WDI_STATUS_E_FAILURE;
23721 }
23722
23723 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
23724
23725 /*-------------------------------------------------------------------------
23726 Extract response and send it to UMAC
23727 -------------------------------------------------------------------------*/
23728 halStatus = *((eHalStatus*)pEventData->pEventData);
23729 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23730
23731 /*Notify UMAC*/
23732 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
23733
23734 return WDI_STATUS_SUCCESS;
23735}/*WDI_ProcessSetTmLevelRsp*/
23736
23737/**
23738 @brief Process Set Thermal Mitigation level Changed request
23739
23740 @param pWDICtx: pointer to the WLAN DAL context
23741 pEventData: pointer to the event information structure
23742
23743 @see
23744 @return Result of the function call
23745*/
23746WDI_Status
23747WDI_ProcessSetTmLevelReq
23748(
23749 WDI_ControlBlockType* pWDICtx,
23750 WDI_EventInfoType* pEventData
23751)
23752{
23753 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
23754 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
23755 wpt_uint8* pSendBuffer = NULL;
23756 wpt_uint16 usDataOffset = 0;
23757 wpt_uint16 usSendSize = 0;
23758 tSetThermalMitgationType halTmMsg;
23759
23760 /*-------------------------------------------------------------------------
23761 Sanity check
23762 -------------------------------------------------------------------------*/
23763 if (( NULL == pEventData ) ||
23764 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
23765 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
23766 {
23767 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23768 "%s: Invalid parameters", __FUNCTION__);
23769 WDI_ASSERT(0);
23770 return WDI_STATUS_E_FAILURE;
23771 }
23772
23773 /*-----------------------------------------------------------------------
23774 Get message buffer
23775 -----------------------------------------------------------------------*/
23776 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
23777 sizeof(halTmMsg),
23778 &pSendBuffer, &usDataOffset, &usSendSize))||
23779 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
23780 {
23781 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23782 "Unable to get send buffer in Set PNO req %x %x %x",
23783 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
23784 WDI_ASSERT(0);
23785 return WDI_STATUS_E_FAILURE;
23786 }
23787
23788 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
23789 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
23790
23791 wpalMemoryCopy( pSendBuffer+usDataOffset,
23792 &halTmMsg,
23793 sizeof(halTmMsg));
23794
23795 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
23796 pWDICtx->pfncRspCB = NULL;
23797 /*-------------------------------------------------------------------------
23798 Send Get STA Request to HAL
23799 -------------------------------------------------------------------------*/
23800 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23801 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
23802}
23803
23804/* Fill the value from the global features enabled array to the global capabilities
23805 * bitmap struct
23806 */
23807static void
23808FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
23809{
23810 wpt_int8 i;
23811 for (i=0; i<len; i++)
23812 {
23813 setFeatCaps(fCaps, enabledFeat[i]);
23814 }
23815}
23816
23817/**
23818 @brief WDI_featureCapsExchangeReq
23819 Post feature capability bitmap exchange event.
23820 Host will send its own capability to FW in this req and
23821 expect FW to send its capability back as a bitmap in Response
23822
23823 @param
23824
23825 wdiFeatureCapsExchangeCb: callback called on getting the response.
23826 It is kept to mantain similarity between WDI reqs and if needed, can
23827 be used in future. Currently, It is set to NULL
23828
23829 pUserData: user data will be passed back with the
23830 callback
23831
23832 @see
23833 @return Result of the function call
23834*/
23835WDI_Status
23836WDI_featureCapsExchangeReq
23837(
23838 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
23839 void* pUserData
23840)
23841{
23842 WDI_EventInfoType wdiEventData;
23843 wpt_int32 fCapsStructSize;
23844
23845 /*------------------------------------------------------------------------
23846 Sanity Check
23847 ------------------------------------------------------------------------*/
23848 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23849 {
23850 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23851 "WDI API call before module is initialized - Fail request");
23852
23853 return WDI_STATUS_E_NOT_ALLOWED;
23854 }
23855
23856 /* Allocate memory separately for global variable carrying FW caps */
23857 fCapsStructSize = sizeof(tWlanFeatCaps);
23858 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
23859 if ( NULL == gpHostWlanFeatCaps )
23860 {
23861 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23862 "Cannot allocate memory for host capability info\n");
23863 WDI_ASSERT(0);
23864 return WDI_STATUS_MEM_FAILURE;
23865 }
23866
23867 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
23868
23869 /*------------------------------------------------------------------------
23870 Fill in Event data and post to the Main FSM
23871 ------------------------------------------------------------------------*/
23872 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
23873 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
23874 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23875 "bit 0 - %x %x %x %x - bit 128\n",
23876 gpHostWlanFeatCaps->featCaps[0],
23877 gpHostWlanFeatCaps->featCaps[1],
23878 gpHostWlanFeatCaps->featCaps[2],
23879 gpHostWlanFeatCaps->featCaps[3]
23880 );
23881
23882 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
23883 wdiEventData.pEventData = gpHostWlanFeatCaps;
23884 wdiEventData.uEventDataSize = fCapsStructSize;
23885 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
23886 wdiEventData.pUserData = pUserData;
23887
23888 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23889}
23890
23891/**
23892 @brief Process Host-FW Capability Exchange Request function
23893
23894 @param pWDICtx: pointer to the WLAN DAL context
23895 pEventData: pointer to the event information structure
23896
23897 @see
23898 @return Result of the function call
23899*/
23900WDI_Status
23901WDI_ProcessFeatureCapsExchangeReq
23902(
23903 WDI_ControlBlockType* pWDICtx,
23904 WDI_EventInfoType* pEventData
23905)
23906{
23907 wpt_uint8* pSendBuffer = NULL;
23908 wpt_uint16 usDataOffset = 0;
23909 wpt_uint16 usSendSize = 0;
23910 wpt_uint16 usLen = 0;
23911
23912 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23913
23914 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23915 "%s", __FUNCTION__);
23916
23917 /*-------------------------------------------------------------------------
23918 Sanity check
23919 -------------------------------------------------------------------------*/
23920 /* Call back function is NULL since not required for cap exchange req */
23921 if (( NULL == pEventData ) ||
23922 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
23923 {
23924 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
23925 "%s: Invalid parameters", __FUNCTION__);
23926 WDI_ASSERT(0);
23927 return WDI_STATUS_E_FAILURE;
23928 }
23929
23930 /*-----------------------------------------------------------------------
23931 Get message buffer
23932 -----------------------------------------------------------------------*/
23933 usLen = sizeof(tWlanFeatCaps);
23934
23935 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23936 WDI_FEATURE_CAPS_EXCHANGE_REQ,
23937 usLen,
23938 &pSendBuffer, &usDataOffset, &usSendSize))||
23939 ( usSendSize < (usDataOffset + usLen )))
23940 {
23941 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
23942 "Unable to get send buffer in feat caps exchange req %x %x",
23943 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
23944 WDI_ASSERT(0);
23945 return WDI_STATUS_E_FAILURE;
23946 }
23947
23948 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23949 "bit 0 - %x %x %x %x - bit 128\n",
23950 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
23951 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
23952 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
23953 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
23954 );
23955
23956 /* Copy host caps after the offset in the send buffer */
23957 wpalMemoryCopy( pSendBuffer+usDataOffset,
23958 (tWlanFeatCaps *)pEventData->pEventData,
23959 usLen);
23960
23961 /*-------------------------------------------------------------------------
23962 Send Start Request to HAL
23963 -------------------------------------------------------------------------*/
23964 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23965 (WDI_StartRspCb)pEventData->pCBfnc,
23966 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
23967
23968}/*WDI_ProcessFeatureCapsExchangeReq*/
23969
23970/**
23971 @brief Process Host-FW Capability Exchange Response function
23972
23973 @param pWDICtx: pointer to the WLAN DAL context
23974 pEventData: pointer to the event information structure
23975
23976 @see
23977 @return Result of the function call
23978*/
23979WDI_Status
23980WDI_ProcessFeatureCapsExchangeRsp
23981(
23982 WDI_ControlBlockType* pWDICtx,
23983 WDI_EventInfoType* pEventData
23984)
23985{
23986 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
23987 wpt_int32 fCapsStructSize;
23988 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23989
23990 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23991 "%s", __FUNCTION__);
23992
23993 /*-------------------------------------------------------------------------
23994 Sanity check
23995 -------------------------------------------------------------------------*/
23996 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23997 ( NULL == pEventData->pEventData ))
23998 {
23999 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24000 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24001 "%s: Invalid parameters", __FUNCTION__);
24002 WDI_ASSERT(0);
24003 return WDI_STATUS_E_FAILURE;
24004 }
24005
24006 /* Allocate memory separately for global variable carrying FW caps */
24007 fCapsStructSize = sizeof(tWlanFeatCaps);
24008 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24009 if ( NULL == gpFwWlanFeatCaps )
24010 {
24011 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24012 "Cannot allocate memory for host capability info\n");
24013 WDI_ASSERT(0);
24014 return WDI_STATUS_MEM_FAILURE;
24015 }
24016
24017 /*-------------------------------------------------------------------------
24018 Unpack HAL Response Message - the header was already extracted by the
24019 main Response Handling procedure
24020 -------------------------------------------------------------------------*/
24021 /*-------------------------------------------------------------------------
24022 Extract response and send it to UMAC
24023 -------------------------------------------------------------------------*/
24024
24025 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24026 fCapsStructSize);
24027 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24028 "bit 0 - %x %x %x %x - bit 128\n",
24029 gpFwWlanFeatCaps->featCaps[0],
24030 gpFwWlanFeatCaps->featCaps[1],
24031 gpFwWlanFeatCaps->featCaps[2],
24032 gpFwWlanFeatCaps->featCaps[3]
24033 );
24034
24035 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24036
24037 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24038 if (wdiFeatureCapsExchangeCb != NULL)
24039 wdiFeatureCapsExchangeCb(NULL, NULL);
24040
24041 return WDI_STATUS_SUCCESS;
24042}
24043
24044/**
24045 @brief WDI_getHostWlanFeatCaps
24046 WDI API that returns whether the feature passed to it as enum value in
24047 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
24048 variable storing host capability bitmap to find this. This can be used by
24049 other moduels to decide certain things like call different APIs based on
24050 whether a particular feature is supported.
24051
24052 @param
24053
24054 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
24055
24056 @see
24057 @return
24058 0 - if the feature is NOT supported in host
24059 any non-zero value - if the feature is SUPPORTED in host.
24060*/
24061wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
24062{
24063 wpt_uint8 featSupported = 0;
24064 if (gpHostWlanFeatCaps != NULL)
24065 {
24066 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
24067 }
24068 else
24069 {
24070 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24071 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature\n", feat_enum_value);
24072 }
24073 return featSupported;
24074}
24075
24076/**
24077 @brief WDI_getFwWlanFeatCaps
24078 WDI API that returns whether the feature passed to it as enum value in
24079 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
24080 variable storing host capability bitmap to find this. This can be used by
24081 other moduels to decide certain things like call different APIs based on
24082 whether a particular feature is supported.
24083
24084 @param
24085
24086 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
24087 in wlan_hal_msg.h.
24088
24089 @see
24090 @return
24091 0 - if the feature is NOT supported in FW
24092 any non-zero value - if the feature is SUPPORTED in FW.
24093*/
24094wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
24095{
24096 wpt_uint8 featSupported = 0;
24097 if (gpFwWlanFeatCaps != NULL)
24098 {
24099 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
24100 }
24101 else
24102 {
24103 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24104 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature\n", feat_enum_value);
24105 }
24106 return featSupported;
24107}