blob: 7d10de1d51a2bf534bf7acd1094780eefdd75be5 [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;
Jeff Johnson43971f52012-07-17 12:26:56 -07001350 WDI_ControlBlockType* pWDICtx = &gWDICb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001351 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1352
1353 /*------------------------------------------------------------------------
1354 Sanity Check
1355 ------------------------------------------------------------------------*/
1356 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1357 {
1358 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1359 "WDI API call before module is initialized - Fail request");
1360
1361 return WDI_STATUS_E_NOT_ALLOWED;
1362 }
1363
Jeff Johnson43971f52012-07-17 12:26:56 -07001364 /*Access to the global state must be locked before cleaning */
1365 wpalMutexAcquire(&pWDICtx->wptMutex);
1366
1367 /*Clear all pending request*/
1368 WDI_ClearPendingRequests(pWDICtx);
1369
1370 /*We have completed cleaning unlock now*/
1371 wpalMutexRelease(&pWDICtx->wptMutex);
1372
Jeff Johnson295189b2012-06-20 16:38:30 -07001373 /* Free the global variables */
1374 wpalMemoryFree(gpHostWlanFeatCaps);
1375 wpalMemoryFree(gpFwWlanFeatCaps);
1376
1377 /*------------------------------------------------------------------------
1378 Fill in Event data and post to the Main FSM
1379 ------------------------------------------------------------------------*/
1380 wdiEventData.wdiRequest = WDI_STOP_REQ;
1381 wdiEventData.pEventData = pwdiStopParams;
1382 wdiEventData.uEventDataSize = sizeof(*pwdiStopParams);
1383 wdiEventData.pCBfnc = wdiStopRspCb;
1384 wdiEventData.pUserData = pUserData;
1385
1386 return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData);
1387
1388}/*WDI_Stop*/
1389
1390
1391
1392/**
1393 @brief WDI_Close will be called when the upper MAC no longer
1394 needs to interact with DAL. DAL will free its control
1395 block.
1396
1397 It is only accepted in state STOPPED.
1398
1399 WDI_Stop must have been called.
1400
1401 @param none
1402
1403 @see WDI_Stop
1404 @return Result of the function call
1405*/
1406WDI_Status
1407WDI_Close
1408(
1409 void
1410)
1411{
1412 wpt_uint8 i;
1413 WDI_EventInfoType wdiEventData;
1414 wpt_status wptStatus;
1415 wpt_status eventStatus;
1416 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1417
1418 /*------------------------------------------------------------------------
1419 Sanity Check
1420 ------------------------------------------------------------------------*/
1421 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1422 {
1423 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1424 "WDI API call before module is initialized - Fail request");
1425
1426 return WDI_STATUS_E_NOT_ALLOWED;
1427 }
1428
1429 /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ
1430 (the control transport will be closed by the FSM and we'll want
1431 to wait until that completes)*/
1432 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
1433 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1434 {
1435 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1436 "%s: Failed to reset WCTS action event", __FUNCTION__);
1437 /* fall through and try to finish closing via the FSM */
1438 }
1439
1440 /*------------------------------------------------------------------------
1441 Fill in Event data and post to the Main FSM
1442 ------------------------------------------------------------------------*/
1443 wdiEventData.wdiRequest = WDI_CLOSE_REQ;
1444 wdiEventData.pEventData = NULL;
1445 wdiEventData.uEventDataSize = 0;
1446 wdiEventData.pCBfnc = NULL;
1447 wdiEventData.pUserData = NULL;
1448
1449 gWDIInitialized = eWLAN_PAL_FALSE;
1450
1451 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData);
1452
1453 /*Wait for WCTS to close the control transport
1454 (but only if we were able to reset the event flag*/
1455 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1456 {
1457 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
1458 WDI_WCTS_ACTION_TIMEOUT);
1459 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1460 {
1461 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1462 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1463 }
1464 }
1465
1466 /* Destroy the WCTS action event */
1467 wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent);
1468 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1469 {
1470 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1471 "WDI Close failed to destroy an event");
1472 WDI_ASSERT(0);
1473 }
1474
1475 /* Destroy the Set Power State event */
1476 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1477 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1478 {
1479 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1480 "WDI Close failed to destroy an event");
1481
1482 WDI_ASSERT(0);
1483 }
1484
1485 /*------------------------------------------------------------------------
1486 Closes the Data Path Utility Module
1487 ------------------------------------------------------------------------*/
1488 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1489 {
1490 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1491 "WDI Init failed to close the DP Util Module");
1492
1493 WDI_ASSERT(0);
1494 }
1495
1496 /*destroy the BSS sessions pending Queue */
1497 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1498 {
1499 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1500 }
1501
1502 /* destroy the WDI Pending Assoc Id Request Queue*/
1503 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1504
1505 /* destroy the WDI Pending Request Queue*/
1506 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1507
1508 /*destroy the response timer */
1509 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1510
1511 /*invalidate the main synchro mutex */
1512 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1513 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1514 {
1515 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1516 "Failed to delete mutex %d", wptStatus);
1517 WDI_ASSERT(0);
1518 }
1519
1520 /*Clear control block. note that this will clear the "magic"
1521 which will inhibit all asynchronous callbacks*/
1522 WDI_CleanCB(&gWDICb);
1523
1524 return wptStatus;
1525
1526}/*WDI_Close*/
1527
1528/**
1529 @brief WDI_Shutdown will be called during 'SSR shutdown' operation.
1530 This will do most of the WDI stop & close
1531 operations without doing any handshake with Riva
1532
1533 This will also make sure that the control transport
1534 will NOT be closed.
1535
1536 This request will not be queued.
1537
1538
1539 WDI_Start must have been called.
1540
1541 @param closeTransport: Close control channel if this is set
1542
1543 @return Result of the function call
1544*/
1545WDI_Status
1546WDI_Shutdown
1547(
1548 wpt_boolean closeTransport
1549)
1550{
1551 WDI_EventInfoType wdiEventData;
1552 wpt_status wptStatus;
1553 int i = 0;
1554 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1555
1556 /*------------------------------------------------------------------------
1557 Sanity Check
1558 ------------------------------------------------------------------------*/
1559 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1560 {
1561 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1562 "WDI API call before module is initialized - Fail request");
1563
1564 return WDI_STATUS_E_NOT_ALLOWED;
1565 }
1566
1567 /*------------------------------------------------------------------------
1568 Fill in Event data and post to the Main FSM
1569 ------------------------------------------------------------------------*/
1570 wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ;
1571 wdiEventData.pEventData = NULL;
1572 wdiEventData.uEventDataSize = 0;
1573
1574 /* Shutdown will not be queued, if the state is busy timer will be
1575 * stopped & this message will be processed.*/
1576 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData);
1577 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1578 {
1579 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1580 "%s: Failed to process shutdown event", __FUNCTION__);
1581 }
1582 /* Destroy the Set Power State event */
1583 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1584 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1585 {
1586 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1587 "WDI Close failed to destroy an event");
1588
1589 WDI_ASSERT(0);
1590 }
1591 /*------------------------------------------------------------------------
1592 Closes the Data Path Utility Module
1593 ------------------------------------------------------------------------*/
1594 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1595 {
1596 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1597 "WDI Init failed to close the DP Util Module");
1598
1599 WDI_ASSERT(0);
1600 }
1601 if ( closeTransport )
1602 {
1603 /* Close control transport, called from module unload */
1604 WCTS_CloseTransport(gWDICb.wctsHandle);
1605 }
1606
1607 /*destroy the BSS sessions pending Queue */
1608 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1609 {
1610 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1611 }
1612
1613 /* destroy the WDI Pending Assoc Id Request Queue*/
1614 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1615 /* destroy the WDI Pending Request Queue*/
1616 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1617 /*destroy the response timer */
1618 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1619
1620 /*invalidate the main synchro mutex */
1621 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1622 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1623 {
1624 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1625 "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus);
1626 WDI_ASSERT(0);
1627 }
1628
1629 /*Clear control block. note that this will clear the "magic"
1630 which will inhibit all asynchronous callbacks*/
1631 WDI_CleanCB(&gWDICb);
1632 return wptStatus;
1633
1634}/*WDI_Shutdown*/
1635
1636
1637/*========================================================================
1638
1639 SCAN APIs
1640
1641==========================================================================*/
1642
1643/**
1644 @brief WDI_InitScanReq will be called when the upper MAC wants
1645 the WLAN Device to get ready for a scan procedure. Upon
1646 the call of this API the WLAN DAL will pack and send a
1647 HAL Init Scan request message to the lower RIVA
1648 sub-system if DAL is in state STARTED.
1649
1650 In state BUSY this request will be queued. Request won't
1651 be allowed in any other state.
1652
1653 WDI_Start must have been called.
1654
1655 @param wdiInitScanParams: the init scan parameters as specified
1656 by the Device Interface
1657
1658 wdiInitScanRspCb: callback for passing back the response
1659 of the init scan operation received from the device
1660
1661 pUserData: user data will be passed back with the
1662 callback
1663
1664 @see WDI_Start
1665 @return Result of the function call
1666*/
1667WDI_Status
1668WDI_InitScanReq
1669(
1670 WDI_InitScanReqParamsType* pwdiInitScanParams,
1671 WDI_InitScanRspCb wdiInitScanRspCb,
1672 void* pUserData
1673)
1674{
1675 WDI_EventInfoType wdiEventData;
1676 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1677
1678 /*------------------------------------------------------------------------
1679 Sanity Check
1680 ------------------------------------------------------------------------*/
1681 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1682 {
1683 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1684 "WDI API call before module is initialized - Fail request");
1685
1686 return WDI_STATUS_E_NOT_ALLOWED;
1687 }
1688
1689 /*------------------------------------------------------------------------
1690 Fill in Event data and post to the Main FSM
1691 ------------------------------------------------------------------------*/
1692 wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ;
1693 wdiEventData.pEventData = pwdiInitScanParams;
1694 wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams);
1695 wdiEventData.pCBfnc = wdiInitScanRspCb;
1696 wdiEventData.pUserData = pUserData;
1697
1698 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1699
1700}/*WDI_InitScanReq*/
1701
1702/**
1703 @brief WDI_StartScanReq will be called when the upper MAC
1704 wishes to change the Scan channel on the WLAN Device.
1705 Upon the call of this API the WLAN DAL will pack and
1706 send a HAL Start Scan request message to the lower RIVA
1707 sub-system if DAL is in state STARTED.
1708
1709 In state BUSY this request will be queued. Request won't
1710 be allowed in any other state.
1711
1712 WDI_InitScanReq must have been called.
1713
1714 @param wdiStartScanParams: the start scan parameters as
1715 specified by the Device Interface
1716
1717 wdiStartScanRspCb: callback for passing back the
1718 response of the start scan operation received from the
1719 device
1720
1721 pUserData: user data will be passed back with the
1722 callback
1723
1724 @see WDI_InitScanReq
1725 @return Result of the function call
1726*/
1727WDI_Status
1728WDI_StartScanReq
1729(
1730 WDI_StartScanReqParamsType* pwdiStartScanParams,
1731 WDI_StartScanRspCb wdiStartScanRspCb,
1732 void* pUserData
1733)
1734{
1735 WDI_EventInfoType wdiEventData;
1736 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1737
1738 /*------------------------------------------------------------------------
1739 Sanity Check
1740 ------------------------------------------------------------------------*/
1741 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1742 {
1743 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1744 "WDI API call before module is initialized - Fail request");
1745
1746 return WDI_STATUS_E_NOT_ALLOWED;
1747 }
1748
1749 /*------------------------------------------------------------------------
1750 Fill in Event data and post to the Main FSM
1751 ------------------------------------------------------------------------*/
1752 wdiEventData.wdiRequest = WDI_START_SCAN_REQ;
1753 wdiEventData.pEventData = pwdiStartScanParams;
1754 wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams);
1755 wdiEventData.pCBfnc = wdiStartScanRspCb;
1756 wdiEventData.pUserData = pUserData;
1757
1758 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1759
1760}/*WDI_StartScanReq*/
1761
1762
1763/**
1764 @brief WDI_EndScanReq will be called when the upper MAC is
1765 wants to end scanning for a particular channel that it
1766 had set before by calling Scan Start on the WLAN Device.
1767 Upon the call of this API the WLAN DAL will pack and
1768 send a HAL End Scan request message to the lower RIVA
1769 sub-system if DAL is in state STARTED.
1770
1771 In state BUSY this request will be queued. Request won't
1772 be allowed in any other state.
1773
1774 WDI_StartScanReq must have been called.
1775
1776 @param wdiEndScanParams: the end scan parameters as specified
1777 by the Device Interface
1778
1779 wdiEndScanRspCb: callback for passing back the response
1780 of the end scan operation received from the device
1781
1782 pUserData: user data will be passed back with the
1783 callback
1784
1785 @see WDI_StartScanReq
1786 @return Result of the function call
1787*/
1788WDI_Status
1789WDI_EndScanReq
1790(
1791 WDI_EndScanReqParamsType* pwdiEndScanParams,
1792 WDI_EndScanRspCb wdiEndScanRspCb,
1793 void* pUserData
1794)
1795{
1796 WDI_EventInfoType wdiEventData;
1797 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1798
1799 /*------------------------------------------------------------------------
1800 Sanity Check
1801 ------------------------------------------------------------------------*/
1802 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1803 {
1804 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1805 "WDI API call before module is initialized - Fail request");
1806
1807 return WDI_STATUS_E_NOT_ALLOWED;
1808 }
1809
1810 /*------------------------------------------------------------------------
1811 Fill in Event data and post to the Main FSM
1812 ------------------------------------------------------------------------*/
1813 wdiEventData.wdiRequest = WDI_END_SCAN_REQ;
1814 wdiEventData.pEventData = pwdiEndScanParams;
1815 wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams);
1816 wdiEventData.pCBfnc = wdiEndScanRspCb;
1817 wdiEventData.pUserData = pUserData;
1818
1819 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1820
1821}/*WDI_EndScanReq*/
1822
1823
1824/**
1825 @brief WDI_FinishScanReq will be called when the upper MAC has
1826 completed the scan process on the WLAN Device. Upon the
1827 call of this API the WLAN DAL will pack and send a HAL
1828 Finish Scan Request request message to the lower RIVA
1829 sub-system if DAL is in state STARTED.
1830
1831 In state BUSY this request will be queued. Request won't
1832 be allowed in any other state.
1833
1834 WDI_InitScanReq must have been called.
1835
1836 @param wdiFinishScanParams: the finish scan parameters as
1837 specified by the Device Interface
1838
1839 wdiFinishScanRspCb: callback for passing back the
1840 response of the finish scan operation received from the
1841 device
1842
1843 pUserData: user data will be passed back with the
1844 callback
1845
1846 @see WDI_InitScanReq
1847 @return Result of the function call
1848*/
1849WDI_Status
1850WDI_FinishScanReq
1851(
1852 WDI_FinishScanReqParamsType* pwdiFinishScanParams,
1853 WDI_FinishScanRspCb wdiFinishScanRspCb,
1854 void* pUserData
1855)
1856{
1857 WDI_EventInfoType wdiEventData;
1858 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1859
1860 /*------------------------------------------------------------------------
1861 Sanity Check
1862 ------------------------------------------------------------------------*/
1863 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1864 {
1865 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1866 "WDI API call before module is initialized - Fail request");
1867
1868 return WDI_STATUS_E_NOT_ALLOWED;
1869 }
1870
1871 /*------------------------------------------------------------------------
1872 Fill in Event data and post to the Main FSM
1873 ------------------------------------------------------------------------*/
1874 wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ;
1875 wdiEventData.pEventData = pwdiFinishScanParams;
1876 wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams);
1877 wdiEventData.pCBfnc = wdiFinishScanRspCb;
1878 wdiEventData.pUserData = pUserData;
1879
1880 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1881
1882}/*WDI_FinishScanReq*/
1883
1884/*========================================================================
1885
1886 ASSOCIATION APIs
1887
1888==========================================================================*/
1889
1890/**
1891 @brief WDI_JoinReq will be called when the upper MAC is ready
1892 to start an association procedure to a BSS. Upon the
1893 call of this API the WLAN DAL will pack and send a HAL
1894 Join request message to the lower RIVA sub-system if
1895 DAL is in state STARTED.
1896
1897 In state BUSY this request will be queued. Request won't
1898 be allowed in any other state.
1899
1900 WDI_Start must have been called.
1901
1902 @param wdiJoinParams: the join parameters as specified by
1903 the Device Interface
1904
1905 wdiJoinRspCb: callback for passing back the response of
1906 the join operation received from the device
1907
1908 pUserData: user data will be passed back with the
1909 callback
1910
1911 @see WDI_Start
1912 @return Result of the function call
1913*/
1914WDI_Status
1915WDI_JoinReq
1916(
1917 WDI_JoinReqParamsType* pwdiJoinParams,
1918 WDI_JoinRspCb wdiJoinRspCb,
1919 void* pUserData
1920)
1921{
1922 WDI_EventInfoType wdiEventData;
1923 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1924
1925 /*------------------------------------------------------------------------
1926 Sanity Check
1927 ------------------------------------------------------------------------*/
1928 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1929 {
1930 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1931 "WDI API call before module is initialized - Fail request");
1932
1933 return WDI_STATUS_E_NOT_ALLOWED;
1934 }
1935
1936 /*------------------------------------------------------------------------
1937 Fill in Event data and post to the Main FSM
1938 ------------------------------------------------------------------------*/
1939 wdiEventData.wdiRequest = WDI_JOIN_REQ;
1940 wdiEventData.pEventData = pwdiJoinParams;
1941 wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams);
1942 wdiEventData.pCBfnc = wdiJoinRspCb;
1943 wdiEventData.pUserData = pUserData;
1944
1945 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1946
1947}/*WDI_JoinReq*/
1948
1949/**
1950 @brief WDI_ConfigBSSReq will be called when the upper MAC
1951 wishes to configure the newly acquired or in process of
1952 being acquired BSS to the HW . Upon the call of this API
1953 the WLAN DAL will pack and send a HAL Config BSS request
1954 message to the lower RIVA sub-system if DAL is in state
1955 STARTED.
1956
1957 In state BUSY this request will be queued. Request won't
1958 be allowed in any other state.
1959
1960 WDI_JoinReq must have been called.
1961
1962 @param wdiConfigBSSParams: the config BSS parameters as
1963 specified by the Device Interface
1964
1965 wdiConfigBSSRspCb: callback for passing back the
1966 response of the config BSS operation received from the
1967 device
1968
1969 pUserData: user data will be passed back with the
1970 callback
1971
1972 @see WDI_JoinReq
1973 @return Result of the function call
1974*/
1975WDI_Status
1976WDI_ConfigBSSReq
1977(
1978 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams,
1979 WDI_ConfigBSSRspCb wdiConfigBSSRspCb,
1980 void* pUserData
1981)
1982{
1983 WDI_EventInfoType wdiEventData;
1984 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1985
1986 /*------------------------------------------------------------------------
1987 Sanity Check
1988 ------------------------------------------------------------------------*/
1989 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1990 {
1991 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1992 "WDI API call before module is initialized - Fail request");
1993
1994 return WDI_STATUS_E_NOT_ALLOWED;
1995 }
1996
1997 /*------------------------------------------------------------------------
1998 Fill in Event data and post to the Main FSM
1999 ------------------------------------------------------------------------*/
2000 wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ;
2001 wdiEventData.pEventData = pwdiConfigBSSParams;
2002 wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams);
2003 wdiEventData.pCBfnc = wdiConfigBSSRspCb;
2004 wdiEventData.pUserData = pUserData;
2005
2006 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2007
2008}/*WDI_ConfigBSSReq*/
2009
2010/**
2011 @brief WDI_DelBSSReq will be called when the upper MAC is
2012 disassociating from the BSS and wishes to notify HW.
2013 Upon the call of this API the WLAN DAL will pack and
2014 send a HAL Del BSS request message to the lower RIVA
2015 sub-system if DAL is in state STARTED.
2016
2017 In state BUSY this request will be queued. Request won't
2018 be allowed in any other state.
2019
2020 WDI_ConfigBSSReq or WDI_PostAssocReq must have been called.
2021
2022 @param wdiDelBSSParams: the del BSS parameters as specified by
2023 the Device Interface
2024
2025 wdiDelBSSRspCb: callback for passing back the response
2026 of the del bss operation received from the device
2027
2028 pUserData: user data will be passed back with the
2029 callback
2030
2031 @see WDI_ConfigBSSReq, WDI_PostAssocReq
2032 @return Result of the function call
2033*/
2034WDI_Status
2035WDI_DelBSSReq
2036(
2037 WDI_DelBSSReqParamsType* pwdiDelBSSParams,
2038 WDI_DelBSSRspCb wdiDelBSSRspCb,
2039 void* pUserData
2040)
2041{
2042 WDI_EventInfoType wdiEventData;
2043 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2044
2045 /*------------------------------------------------------------------------
2046 Sanity Check
2047 ------------------------------------------------------------------------*/
2048 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2049 {
2050 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2051 "WDI API call before module is initialized - Fail request");
2052
2053 return WDI_STATUS_E_NOT_ALLOWED;
2054 }
2055
2056 /*------------------------------------------------------------------------
2057 Fill in Event data and post to the Main FSM
2058 ------------------------------------------------------------------------*/
2059 wdiEventData.wdiRequest = WDI_DEL_BSS_REQ;
2060 wdiEventData.pEventData = pwdiDelBSSParams;
2061 wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams);
2062 wdiEventData.pCBfnc = wdiDelBSSRspCb;
2063 wdiEventData.pUserData = pUserData;
2064
2065 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2066
2067}/*WDI_DelBSSReq*/
2068
2069/**
2070 @brief WDI_PostAssocReq will be called when the upper MAC has
2071 associated to a BSS and wishes to configure HW for
2072 associated state. Upon the call of this API the WLAN DAL
2073 will pack and send a HAL Post Assoc request message to
2074 the lower RIVA sub-system if DAL is in state STARTED.
2075
2076 In state BUSY this request will be queued. Request won't
2077 be allowed in any other state.
2078
2079 WDI_JoinReq must have been called.
2080
2081 @param wdiPostAssocReqParams: the assoc parameters as specified
2082 by the Device Interface
2083
2084 wdiPostAssocRspCb: callback for passing back the
2085 response of the post assoc operation received from the
2086 device
2087
2088 pUserData: user data will be passed back with the
2089 callback
2090
2091 @see WDI_JoinReq
2092 @return Result of the function call
2093*/
2094WDI_Status
2095WDI_PostAssocReq
2096(
2097 WDI_PostAssocReqParamsType* pwdiPostAssocReqParams,
2098 WDI_PostAssocRspCb wdiPostAssocRspCb,
2099 void* pUserData
2100)
2101{
2102 WDI_EventInfoType wdiEventData;
2103 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2104
2105 /*------------------------------------------------------------------------
2106 Sanity Check
2107 ------------------------------------------------------------------------*/
2108 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2109 {
2110 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2111 "WDI API call before module is initialized - Fail request");
2112
2113 return WDI_STATUS_E_NOT_ALLOWED;
2114 }
2115
2116 /*------------------------------------------------------------------------
2117 Fill in Event data and post to the Main FSM
2118 ------------------------------------------------------------------------*/
2119 wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ;
2120 wdiEventData.pEventData = pwdiPostAssocReqParams;
2121 wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams);
2122 wdiEventData.pCBfnc = wdiPostAssocRspCb;
2123 wdiEventData.pUserData = pUserData;
2124
2125 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2126
2127}/*WDI_PostAssocReq*/
2128
2129/**
2130 @brief WDI_DelSTAReq will be called when the upper MAC when an
2131 association with another STA has ended and the station
2132 must be deleted from HW. Upon the call of this API the
2133 WLAN DAL will pack and send a HAL Del STA request
2134 message to the lower RIVA sub-system if DAL is in state
2135 STARTED.
2136
2137 In state BUSY this request will be queued. Request won't
2138 be allowed in any other state.
2139
2140 WDI_PostAssocReq must have been called.
2141
2142 @param wdiDelSTAParams: the Del STA parameters as specified by
2143 the Device Interface
2144
2145 wdiDelSTARspCb: callback for passing back the response
2146 of the del STA operation received from the device
2147
2148 pUserData: user data will be passed back with the
2149 callback
2150
2151 @see WDI_PostAssocReq
2152 @return Result of the function call
2153*/
2154WDI_Status
2155WDI_DelSTAReq
2156(
2157 WDI_DelSTAReqParamsType* pwdiDelSTAParams,
2158 WDI_DelSTARspCb wdiDelSTARspCb,
2159 void* pUserData
2160)
2161{
2162 WDI_EventInfoType wdiEventData;
2163 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2164
2165 /*------------------------------------------------------------------------
2166 Sanity Check
2167 ------------------------------------------------------------------------*/
2168 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2169 {
2170 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2171 "WDI API call before module is initialized - Fail request");
2172
2173 return WDI_STATUS_E_NOT_ALLOWED;
2174 }
2175
2176 /*------------------------------------------------------------------------
2177 Fill in Event data and post to the Main FSM
2178 ------------------------------------------------------------------------*/
2179 wdiEventData.wdiRequest = WDI_DEL_STA_REQ;
2180 wdiEventData.pEventData = pwdiDelSTAParams;
2181 wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams);
2182 wdiEventData.pCBfnc = wdiDelSTARspCb;
2183 wdiEventData.pUserData = pUserData;
2184
2185 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2186
2187}/*WDI_DelSTAReq*/
2188
2189/*========================================================================
2190
2191 SECURITY APIs
2192
2193==========================================================================*/
2194
2195/**
2196 @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to
2197 install a BSS encryption key on the HW. Upon the call of this
2198 API the WLAN DAL will pack and send a Set BSS Key request
2199 message to the lower RIVA sub-system if DAL is in state
2200 STARTED.
2201
2202 In state BUSY this request will be queued. Request won't
2203 be allowed in any other state.
2204
2205 WDI_PostAssocReq must have been called.
2206
2207 @param wdiSetBSSKeyParams: the BSS Key set parameters as
2208 specified by the Device Interface
2209
2210 wdiSetBSSKeyRspCb: callback for passing back the
2211 response of the set BSS Key operation received from the
2212 device
2213
2214 pUserData: user data will be passed back with the
2215 callback
2216
2217 @see WDI_PostAssocReq
2218 @return Result of the function call
2219*/
2220WDI_Status
2221WDI_SetBSSKeyReq
2222(
2223 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams,
2224 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb,
2225 void* pUserData
2226)
2227{
2228 WDI_EventInfoType wdiEventData;
2229 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2230
2231 /*------------------------------------------------------------------------
2232 Sanity Check
2233 ------------------------------------------------------------------------*/
2234 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2235 {
2236 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2237 "WDI API call before module is initialized - Fail request");
2238
2239 return WDI_STATUS_E_NOT_ALLOWED;
2240 }
2241
2242 /*------------------------------------------------------------------------
2243 Fill in Event data and post to the Main FSM
2244 ------------------------------------------------------------------------*/
2245 wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ;
2246 wdiEventData.pEventData = pwdiSetBSSKeyParams;
2247 wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams);
2248 wdiEventData.pCBfnc = wdiSetBSSKeyRspCb;
2249 wdiEventData.pUserData = pUserData;
2250
2251 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2252
2253}/*WDI_SetBSSKeyReq*/
2254
2255/**
2256 @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to
2257 uninstall a BSS key from HW. Upon the call of this API the
2258 WLAN DAL will pack and send a HAL Remove BSS Key request
2259 message to the lower RIVA sub-system if DAL is in state
2260 STARTED.
2261
2262 In state BUSY this request will be queued. Request won't
2263 be allowed in any other state.
2264
2265 WDI_SetBSSKeyReq must have been called.
2266
2267 @param wdiRemoveBSSKeyParams: the remove BSS key parameters as
2268 specified by the Device Interface
2269
2270 wdiRemoveBSSKeyRspCb: callback for passing back the
2271 response of the remove BSS key operation received from
2272 the device
2273
2274 pUserData: user data will be passed back with the
2275 callback
2276
2277 @see WDI_SetBSSKeyReq
2278 @return Result of the function call
2279*/
2280WDI_Status
2281WDI_RemoveBSSKeyReq
2282(
2283 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams,
2284 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb,
2285 void* pUserData
2286)
2287{
2288 WDI_EventInfoType wdiEventData;
2289 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2290
2291 /*------------------------------------------------------------------------
2292 Sanity Check
2293 ------------------------------------------------------------------------*/
2294 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2295 {
2296 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2297 "WDI API call before module is initialized - Fail request");
2298
2299 return WDI_STATUS_E_NOT_ALLOWED;
2300 }
2301
2302 /*------------------------------------------------------------------------
2303 Fill in Event data and post to the Main FSM
2304 ------------------------------------------------------------------------*/
2305 wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ;
2306 wdiEventData.pEventData = pwdiRemoveBSSKeyParams;
2307 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams);
2308 wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb;
2309 wdiEventData.pUserData = pUserData;
2310
2311 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2312
2313}/*WDI_RemoveBSSKeyReq*/
2314
2315
2316/**
2317 @brief WDI_SetSTAKeyReq will be called when the upper MAC is
2318 ready to install a STA(ast) encryption key in HW. Upon
2319 the call of this API the WLAN DAL will pack and send a
2320 HAL Set STA Key request message to the lower RIVA
2321 sub-system if DAL is in state STARTED.
2322
2323 In state BUSY this request will be queued. Request won't
2324 be allowed in any other state.
2325
2326 WDI_PostAssocReq must have been called.
2327
2328 @param wdiSetSTAKeyParams: the set STA key parameters as
2329 specified by the Device Interface
2330
2331 wdiSetSTAKeyRspCb: callback for passing back the
2332 response of the set STA key operation received from the
2333 device
2334
2335 pUserData: user data will be passed back with the
2336 callback
2337
2338 @see WDI_PostAssocReq
2339 @return Result of the function call
2340*/
2341WDI_Status
2342WDI_SetSTAKeyReq
2343(
2344 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams,
2345 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb,
2346 void* pUserData
2347)
2348{
2349 WDI_EventInfoType wdiEventData;
2350 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2351
2352 /*------------------------------------------------------------------------
2353 Sanity Check
2354 ------------------------------------------------------------------------*/
2355 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2356 {
2357 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2358 "WDI API call before module is initialized - Fail request");
2359
2360 return WDI_STATUS_E_NOT_ALLOWED;
2361 }
2362
2363 /*------------------------------------------------------------------------
2364 Fill in Event data and post to the Main FSM
2365 ------------------------------------------------------------------------*/
2366 wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ;
2367 wdiEventData.pEventData = pwdiSetSTAKeyParams;
2368 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams);
2369 wdiEventData.pCBfnc = wdiSetSTAKeyRspCb;
2370 wdiEventData.pUserData = pUserData;
2371
2372 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2373
2374}/*WDI_SetSTAKeyReq*/
2375
2376
2377/**
2378 @brief WDI_RemoveSTAKeyReq will be called when the upper MAC
2379 wants to uninstall a previously set STA key in HW. Upon
2380 the call of this API the WLAN DAL will pack and send a
2381 HAL Remove STA Key request message to the lower RIVA
2382 sub-system if DAL is in state STARTED.
2383
2384 In state BUSY this request will be queued. Request won't
2385 be allowed in any other state.
2386
2387 WDI_SetSTAKeyReq must have been called.
2388
2389 @param wdiRemoveSTAKeyParams: the remove STA key parameters as
2390 specified by the Device Interface
2391
2392 wdiRemoveSTAKeyRspCb: callback for passing back the
2393 response of the remove STA key operation received from
2394 the device
2395
2396 pUserData: user data will be passed back with the
2397 callback
2398
2399 @see WDI_SetSTAKeyReq
2400 @return Result of the function call
2401*/
2402WDI_Status
2403WDI_RemoveSTAKeyReq
2404(
2405 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams,
2406 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb,
2407 void* pUserData
2408)
2409{
2410 WDI_EventInfoType wdiEventData;
2411 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2412
2413 /*------------------------------------------------------------------------
2414 Sanity Check
2415 ------------------------------------------------------------------------*/
2416 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2417 {
2418 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2419 "WDI API call before module is initialized - Fail request");
2420
2421 return WDI_STATUS_E_NOT_ALLOWED;
2422 }
2423
2424 /*------------------------------------------------------------------------
2425 Fill in Event data and post to the Main FSM
2426 ------------------------------------------------------------------------*/
2427 wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ;
2428 wdiEventData.pEventData = pwdiRemoveSTAKeyParams;
2429 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams);
2430 wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb;
2431 wdiEventData.pUserData = pUserData;
2432
2433 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2434
2435}/*WDI_RemoveSTAKeyReq*/
2436
2437
2438/**
2439 @brief WDI_SetSTABcastKeyReq will be called when the upper MAC
2440 wants to install a STA Bcast encryption key on the HW.
2441 Upon the call of this API the WLAN DAL will pack and
2442 send a HAL Start request message to the lower RIVA
2443 sub-system if DAL is in state STARTED.
2444
2445 In state BUSY this request will be queued. Request won't
2446 be allowed in any other state.
2447
2448 WDI_PostAssocReq must have been called.
2449
2450 @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as
2451 specified by the Device Interface
2452
2453 wdiSetSTABcastKeyRspCb: callback for passing back the
2454 response of the set BSS Key operation received from the
2455 device
2456
2457 pUserData: user data will be passed back with the
2458 callback
2459
2460 @see WDI_PostAssocReq
2461 @return Result of the function call
2462*/
2463WDI_Status
2464WDI_SetSTABcastKeyReq
2465(
2466 WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams,
2467 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb,
2468 void* pUserData
2469)
2470
2471{
2472 WDI_EventInfoType wdiEventData;
2473 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2474
2475 /*------------------------------------------------------------------------
2476 Sanity Check
2477 ------------------------------------------------------------------------*/
2478 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2479 {
2480 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2481 "WDI API call before module is initialized - Fail request");
2482
2483 return WDI_STATUS_E_NOT_ALLOWED;
2484 }
2485
2486 /*------------------------------------------------------------------------
2487 Fill in Event data and post to the Main FSM
2488 ------------------------------------------------------------------------*/
2489 wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ;
2490 wdiEventData.pEventData = pwdiSetSTABcastKeyParams;
2491 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams);
2492 wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb;
2493 wdiEventData.pUserData = pUserData;
2494
2495 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2496
2497}/*WDI_SetSTABcastKeyReq*/
2498
2499/**
2500 @brief WDI_RemoveSTABcastKeyReq will be called when the upper
2501 MAC wants to uninstall a STA Bcast key from HW. Upon the
2502 call of this API the WLAN DAL will pack and send a HAL
2503 Remove STA Bcast Key request message to the lower RIVA
2504 sub-system if DAL is in state STARTED.
2505
2506 In state BUSY this request will be queued. Request won't
2507 be allowed in any other state.
2508
2509 WDI_SetSTABcastKeyReq must have been called.
2510
2511 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
2512 parameters as specified by the Device
2513 Interface
2514
2515 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2516 response of the remove STA Bcast key operation received
2517 from the device
2518
2519 pUserData: user data will be passed back with the
2520 callback
2521
2522 @see WDI_SetSTABcastKeyReq
2523 @return Result of the function call
2524*/
2525WDI_Status
2526WDI_RemoveSTABcastKeyReq
2527(
2528 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams,
2529 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb,
2530 void* pUserData
2531)
2532{
2533 WDI_EventInfoType wdiEventData;
2534 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2535
2536 /*------------------------------------------------------------------------
2537 Sanity Check
2538 ------------------------------------------------------------------------*/
2539 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2540 {
2541 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2542 "WDI API call before module is initialized - Fail request");
2543
2544 return WDI_STATUS_E_NOT_ALLOWED;
2545 }
2546
2547 /*------------------------------------------------------------------------
2548 Fill in Event data and post to the Main FSM
2549 ------------------------------------------------------------------------*/
2550 wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ;
2551 wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams;
2552 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams);
2553 wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb;
2554 wdiEventData.pUserData = pUserData;
2555
2556 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2557
2558}/*WDI_RemoveSTABcastKeyReq*/
2559
2560/**
2561 @brief WDI_SetMaxTxPowerReq will be called when the upper
2562 MAC wants to set Max Tx Power to HW. Upon the
2563 call of this API the WLAN DAL will pack and send a HAL
2564 Remove STA Bcast Key request message to the lower RIVA
2565 sub-system if DAL is in state STARTED.
2566
2567 In state BUSY this request will be queued. Request won't
2568 be allowed in any other state.
2569
2570 WDI_SetSTABcastKeyReq must have been called.
2571
2572 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
2573 parameters as specified by the Device
2574 Interface
2575
2576 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2577 response of the remove STA Bcast key operation received
2578 from the device
2579
2580 pUserData: user data will be passed back with the
2581 callback
2582
2583 @see WDI_SetMaxTxPowerReq
2584 @return Result of the function call
2585*/
2586WDI_Status
2587WDI_SetMaxTxPowerReq
2588(
2589 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams,
2590 WDA_SetMaxTxPowerRspCb wdiReqStatusCb,
2591 void* pUserData
2592)
2593{
2594 WDI_EventInfoType wdiEventData;
2595 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2596
2597 /*------------------------------------------------------------------------
2598 Sanity Check
2599 ------------------------------------------------------------------------*/
2600 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2601 {
2602 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2603 "WDI API call before module is initialized - Fail request");
2604
2605 return WDI_STATUS_E_NOT_ALLOWED;
2606 }
2607
2608 /*------------------------------------------------------------------------
2609 Fill in Event data and post to the Main FSM
2610 ------------------------------------------------------------------------*/
2611 wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ;
2612 wdiEventData.pEventData = pwdiSetMaxTxPowerParams;
2613 wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams);
2614 wdiEventData.pCBfnc = wdiReqStatusCb;
2615 wdiEventData.pUserData = pUserData;
2616
2617 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2618}
2619
2620#ifdef FEATURE_WLAN_CCX
2621WDI_Status
2622WDI_TSMStatsReq
2623(
2624 WDI_TSMStatsReqParamsType* pwdiTsmReqParams,
2625 WDI_TsmRspCb wdiReqStatusCb,
2626 void* pUserData
2627)
2628{
2629 WDI_EventInfoType wdiEventData;
2630 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2631
2632 /*------------------------------------------------------------------------
2633 Sanity Check
2634 ------------------------------------------------------------------------*/
2635 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2636 {
2637 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2638 "WDI API call before module is initialized - Fail request");
2639
2640 return WDI_STATUS_E_NOT_ALLOWED;
2641 }
2642
2643 /*------------------------------------------------------------------------
2644 Fill in Event data and post to the Main FSM
2645 ------------------------------------------------------------------------*/
2646 wdiEventData.wdiRequest = WDI_TSM_STATS_REQ;
2647 wdiEventData.pEventData = pwdiTsmReqParams;
2648 wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams);
2649 wdiEventData.pCBfnc = wdiReqStatusCb;
2650 wdiEventData.pUserData = pUserData;
2651
2652 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2653
2654}
2655#endif
2656
2657/*========================================================================
2658
2659 QoS and BA APIs
2660
2661==========================================================================*/
2662
2663/**
2664 @brief WDI_AddTSReq will be called when the upper MAC to inform
2665 the device of a successful add TSpec negotiation. HW
2666 needs to receive the TSpec Info from the UMAC in order
2667 to configure properly the QoS data traffic. Upon the
2668 call of this API the WLAN DAL will pack and send a HAL
2669 Add TS request message to the lower RIVA sub-system if
2670 DAL is in state STARTED.
2671
2672 In state BUSY this request will be queued. Request won't
2673 be allowed in any other state.
2674
2675 WDI_PostAssocReq must have been called.
2676
2677 @param wdiAddTsReqParams: the add TS parameters as specified by
2678 the Device Interface
2679
2680 wdiAddTsRspCb: callback for passing back the response of
2681 the add TS operation received from the device
2682
2683 pUserData: user data will be passed back with the
2684 callback
2685
2686 @see WDI_PostAssocReq
2687 @return Result of the function call
2688*/
2689WDI_Status
2690WDI_AddTSReq
2691(
2692 WDI_AddTSReqParamsType* pwdiAddTsReqParams,
2693 WDI_AddTsRspCb wdiAddTsRspCb,
2694 void* pUserData
2695)
2696{
2697 WDI_EventInfoType wdiEventData;
2698 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2699
2700 /*------------------------------------------------------------------------
2701 Sanity Check
2702 ------------------------------------------------------------------------*/
2703 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2704 {
2705 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2706 "WDI API call before module is initialized - Fail request");
2707
2708 return WDI_STATUS_E_NOT_ALLOWED;
2709 }
2710
2711 /*------------------------------------------------------------------------
2712 Fill in Event data and post to the Main FSM
2713 ------------------------------------------------------------------------*/
2714 wdiEventData.wdiRequest = WDI_ADD_TS_REQ;
2715 wdiEventData.pEventData = pwdiAddTsReqParams;
2716 wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams);
2717 wdiEventData.pCBfnc = wdiAddTsRspCb;
2718 wdiEventData.pUserData = pUserData;
2719
2720 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2721
2722}/*WDI_AddTSReq*/
2723
2724
2725
2726/**
2727 @brief WDI_DelTSReq will be called when the upper MAC has ended
2728 admission on a specific AC. This is to inform HW that
2729 QoS traffic parameters must be rest. Upon the call of
2730 this API the WLAN DAL will pack and send a HAL Del TS
2731 request message to the lower RIVA sub-system if DAL is
2732 in state STARTED.
2733
2734 In state BUSY this request will be queued. Request won't
2735 be allowed in any other state.
2736
2737 WDI_AddTSReq must have been called.
2738
2739 @param wdiDelTsReqParams: the del TS parameters as specified by
2740 the Device Interface
2741
2742 wdiDelTsRspCb: callback for passing back the response of
2743 the del TS operation received from the device
2744
2745 pUserData: user data will be passed back with the
2746 callback
2747
2748 @see WDI_AddTSReq
2749 @return Result of the function call
2750*/
2751WDI_Status
2752WDI_DelTSReq
2753(
2754 WDI_DelTSReqParamsType* pwdiDelTsReqParams,
2755 WDI_DelTsRspCb wdiDelTsRspCb,
2756 void* pUserData
2757)
2758{
2759 WDI_EventInfoType wdiEventData;
2760 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2761
2762 /*------------------------------------------------------------------------
2763 Sanity Check
2764 ------------------------------------------------------------------------*/
2765 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2766 {
2767 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2768 "WDI API call before module is initialized - Fail request");
2769
2770 return WDI_STATUS_E_NOT_ALLOWED;
2771 }
2772
2773 /*------------------------------------------------------------------------
2774 Fill in Event data and post to the Main FSM
2775 ------------------------------------------------------------------------*/
2776 wdiEventData.wdiRequest = WDI_DEL_TS_REQ;
2777 wdiEventData.pEventData = pwdiDelTsReqParams;
2778 wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams);
2779 wdiEventData.pCBfnc = wdiDelTsRspCb;
2780 wdiEventData.pUserData = pUserData;
2781
2782 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2783
2784}/*WDI_DelTSReq*/
2785
2786
2787
2788/**
2789 @brief WDI_UpdateEDCAParams will be called when the upper MAC
2790 wishes to update the EDCA parameters used by HW for QoS
2791 data traffic. Upon the call of this API the WLAN DAL
2792 will pack and send a HAL Update EDCA Params request
2793 message to the lower RIVA sub-system if DAL is in state
2794 STARTED.
2795
2796 In state BUSY this request will be queued. Request won't
2797 be allowed in any other state.
2798
2799 WDI_PostAssocReq must have been called.
2800
2801 @param wdiUpdateEDCAParams: the start parameters as specified
2802 by the Device Interface
2803
2804 wdiUpdateEDCAParamsRspCb: callback for passing back the
2805 response of the start operation received from the device
2806
2807 pUserData: user data will be passed back with the
2808 callback
2809
2810 @see WDI_PostAssocReq
2811 @return Result of the function call
2812*/
2813WDI_Status
2814WDI_UpdateEDCAParams
2815(
2816 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams,
2817 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb,
2818 void* pUserData
2819)
2820{
2821 WDI_EventInfoType wdiEventData;
2822 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2823
2824 /*------------------------------------------------------------------------
2825 Sanity Check
2826 ------------------------------------------------------------------------*/
2827 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2828 {
2829 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2830 "WDI API call before module is initialized - Fail request");
2831
2832 return WDI_STATUS_E_NOT_ALLOWED;
2833 }
2834
2835 /*------------------------------------------------------------------------
2836 Fill in Event data and post to the Main FSM
2837 ------------------------------------------------------------------------*/
2838 wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ;
2839 wdiEventData.pEventData = pwdiUpdateEDCAParams;
2840 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams);
2841 wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb;
2842 wdiEventData.pUserData = pUserData;
2843
2844 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2845
2846}/*WDI_UpdateEDCAParams*/
2847
2848
2849/**
2850 @brief WDI_AddBASessionReq will be called when the upper MAC has setup
2851 successfully a BA session and needs to notify the HW for
2852 the appropriate settings to take place. Upon the call of
2853 this API the WLAN DAL will pack and send a HAL Add BA
2854 request message to the lower RIVA sub-system if DAL is
2855 in state STARTED.
2856
2857 In state BUSY this request will be queued. Request won't
2858 be allowed in any other state.
2859
2860 WDI_PostAssocReq must have been called.
2861
2862 @param wdiAddBAReqParams: the add BA parameters as specified by
2863 the Device Interface
2864
2865 wdiAddBARspCb: callback for passing back the response of
2866 the add BA operation received from the device
2867
2868 pUserData: user data will be passed back with the
2869 callback
2870
2871 @see WDI_PostAssocReq
2872 @return Result of the function call
2873*/
2874WDI_Status
2875WDI_AddBASessionReq
2876(
2877 WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams,
2878 WDI_AddBASessionRspCb wdiAddBASessionRspCb,
2879 void* pUserData
2880)
2881{
2882 WDI_EventInfoType wdiEventData;
2883 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2884
2885 /*------------------------------------------------------------------------
2886 Sanity Check
2887 ------------------------------------------------------------------------*/
2888 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2889 {
2890 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2891 "WDI API call before module is initialized - Fail request");
2892
2893 return WDI_STATUS_E_NOT_ALLOWED;
2894 }
2895
2896 /*------------------------------------------------------------------------
2897 Fill in Event data and post to the Main FSM
2898 ------------------------------------------------------------------------*/
2899 wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ;
2900 wdiEventData.pEventData = pwdiAddBASessionReqParams;
2901 wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams);
2902 wdiEventData.pCBfnc = wdiAddBASessionRspCb;
2903 wdiEventData.pUserData = pUserData;
2904
2905 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2906
2907}/*WDI_AddBASessionReq*/
2908
2909/**
2910 @brief WDI_DelBAReq will be called when the upper MAC wants to
2911 inform HW that it has deleted a previously created BA
2912 session. Upon the call of this API the WLAN DAL will
2913 pack and send a HAL Del BA request message to the lower
2914 RIVA sub-system if DAL is in state STARTED.
2915
2916 In state BUSY this request will be queued. Request won't
2917 be allowed in any other state.
2918
2919 WDI_AddBAReq must have been called.
2920
2921 @param wdiDelBAReqParams: the del BA parameters as specified by
2922 the Device Interface
2923
2924 wdiDelBARspCb: callback for passing back the response of
2925 the del BA operation received from the device
2926
2927 pUserData: user data will be passed back with the
2928 callback
2929
2930 @see WDI_AddBAReq
2931 @return Result of the function call
2932*/
2933WDI_Status
2934WDI_DelBAReq
2935(
2936 WDI_DelBAReqParamsType* pwdiDelBAReqParams,
2937 WDI_DelBARspCb wdiDelBARspCb,
2938 void* pUserData
2939)
2940{
2941 WDI_EventInfoType wdiEventData;
2942 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2943
2944 /*------------------------------------------------------------------------
2945 Sanity Check
2946 ------------------------------------------------------------------------*/
2947 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2948 {
2949 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2950 "WDI API call before module is initialized - Fail request");
2951
2952 return WDI_STATUS_E_NOT_ALLOWED;
2953 }
2954
2955 /*------------------------------------------------------------------------
2956 Fill in Event data and post to the Main FSM
2957 ------------------------------------------------------------------------*/
2958 wdiEventData.wdiRequest = WDI_DEL_BA_REQ;
2959 wdiEventData.pEventData = pwdiDelBAReqParams;
2960 wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams);
2961 wdiEventData.pCBfnc = wdiDelBARspCb;
2962 wdiEventData.pUserData = pUserData;
2963
2964 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2965
2966}/*WDI_DelBAReq*/
2967
2968/*========================================================================
2969
2970 Power Save APIs
2971
2972==========================================================================*/
2973
2974/**
2975 @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC
2976 wants to set the power save related configurations of
2977 the WLAN Device. Upon the call of this API the WLAN DAL
2978 will pack and send a HAL Update CFG request message to
2979 the lower RIVA sub-system if DAL is in state STARTED.
2980
2981 In state BUSY this request will be queued. Request won't
2982 be allowed in any other state.
2983
2984 WDI_Start must have been called.
2985
2986 @param pwdiPowerSaveCfg: the power save cfg parameters as
2987 specified by the Device Interface
2988
2989 wdiSetPwrSaveCfgCb: callback for passing back the
2990 response of the set power save cfg operation received
2991 from the device
2992
2993 pUserData: user data will be passed back with the
2994 callback
2995
2996 @see WDI_Start
2997 @return Result of the function call
2998*/
2999WDI_Status
3000WDI_SetPwrSaveCfgReq
3001(
3002 WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg,
3003 WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb,
3004 void* pUserData
3005)
3006{
3007 WDI_EventInfoType wdiEventData;
3008 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3009
3010 /*------------------------------------------------------------------------
3011 Sanity Check
3012 ------------------------------------------------------------------------*/
3013 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3014 {
3015 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3016 "WDI API call before module is initialized - Fail request");
3017
3018 return WDI_STATUS_E_NOT_ALLOWED;
3019 }
3020
3021 /*------------------------------------------------------------------------
3022 Fill in Event data and post to the Main FSM
3023 ------------------------------------------------------------------------*/
3024 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
3025 wdiEventData.pEventData = pwdiPowerSaveCfg;
3026 wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg);
3027 wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb;
3028 wdiEventData.pUserData = pUserData;
3029
3030 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3031
3032}/*WDI_SetPwrSaveCfgReq*/
3033
3034/**
3035 @brief WDI_EnterImpsReq will be called when the upper MAC to
3036 request the device to get into IMPS power state. Upon
3037 the call of this API the WLAN DAL will send a HAL Enter
3038 IMPS request message to the lower RIVA sub-system if DAL
3039 is in state STARTED.
3040
3041 In state BUSY this request will be queued. Request won't
3042 be allowed in any other state.
3043
3044
3045 @param wdiEnterImpsRspCb: callback for passing back the
3046 response of the Enter IMPS operation received from the
3047 device
3048
3049 pUserData: user data will be passed back with the
3050 callback
3051
3052 @see WDI_Start
3053 @return Result of the function call
3054*/
3055WDI_Status
3056WDI_EnterImpsReq
3057(
3058 WDI_EnterImpsRspCb wdiEnterImpsRspCb,
3059 void* pUserData
3060)
3061{
3062 WDI_EventInfoType wdiEventData;
3063 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3064
3065 /*------------------------------------------------------------------------
3066 Sanity Check
3067 ------------------------------------------------------------------------*/
3068 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3069 {
3070 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3071 "WDI API call before module is initialized - Fail request");
3072
3073 return WDI_STATUS_E_NOT_ALLOWED;
3074 }
3075
3076 /*------------------------------------------------------------------------
3077 Fill in Event data and post to the Main FSM
3078 ------------------------------------------------------------------------*/
3079 wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ;
3080 wdiEventData.pEventData = NULL;
3081 wdiEventData.uEventDataSize = 0;
3082 wdiEventData.pCBfnc = wdiEnterImpsRspCb;
3083 wdiEventData.pUserData = pUserData;
3084
3085 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3086
3087}/*WDI_EnterImpsReq*/
3088
3089/**
3090 @brief WDI_ExitImpsReq will be called when the upper MAC to
3091 request the device to get out of IMPS power state. Upon
3092 the call of this API the WLAN DAL will send a HAL Exit
3093 IMPS request message to the lower RIVA sub-system if DAL
3094 is in state STARTED.
3095
3096 In state BUSY this request will be queued. Request won't
3097 be allowed in any other state.
3098
3099
3100
3101 @param wdiExitImpsRspCb: callback for passing back the response
3102 of the Exit IMPS operation received from the device
3103
3104 pUserData: user data will be passed back with the
3105 callback
3106
3107 @see WDI_Start
3108 @return Result of the function call
3109*/
3110WDI_Status
3111WDI_ExitImpsReq
3112(
3113 WDI_ExitImpsRspCb wdiExitImpsRspCb,
3114 void* pUserData
3115)
3116{
3117 WDI_EventInfoType wdiEventData;
3118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3119
3120 /*------------------------------------------------------------------------
3121 Sanity Check
3122 ------------------------------------------------------------------------*/
3123 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3124 {
3125 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3126 "WDI API call before module is initialized - Fail request");
3127
3128 return WDI_STATUS_E_NOT_ALLOWED;
3129 }
3130
3131 /*------------------------------------------------------------------------
3132 Fill in Event data and post to the Main FSM
3133 ------------------------------------------------------------------------*/
3134 wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ;
3135 wdiEventData.pEventData = NULL;
3136 wdiEventData.uEventDataSize = 0;
3137 wdiEventData.pCBfnc = wdiExitImpsRspCb;
3138 wdiEventData.pUserData = pUserData;
3139
3140 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3141
3142}/*WDI_ExitImpsReq*/
3143
3144/**
3145 @brief WDI_EnterBmpsReq will be called when the upper MAC to
3146 request the device to get into BMPS power state. Upon
3147 the call of this API the WLAN DAL will pack and send a
3148 HAL Enter BMPS request message to the lower RIVA
3149 sub-system if DAL is in state STARTED.
3150
3151 In state BUSY this request will be queued. Request won't
3152 be allowed in any other state.
3153
3154 WDI_PostAssocReq must have been called.
3155
3156 @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as
3157 specified by the Device Interface
3158
3159 wdiEnterBmpsRspCb: callback for passing back the
3160 response of the Enter BMPS operation received from the
3161 device
3162
3163 pUserData: user data will be passed back with the
3164 callback
3165
3166 @see WDI_PostAssocReq
3167 @return Result of the function call
3168*/
3169WDI_Status
3170WDI_EnterBmpsReq
3171(
3172 WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams,
3173 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb,
3174 void* pUserData
3175)
3176{
3177 WDI_EventInfoType wdiEventData;
3178 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3179
3180 /*------------------------------------------------------------------------
3181 Sanity Check
3182 ------------------------------------------------------------------------*/
3183 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3184 {
3185 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3186 "WDI API call before module is initialized - Fail request");
3187
3188 return WDI_STATUS_E_NOT_ALLOWED;
3189 }
3190
3191 /*------------------------------------------------------------------------
3192 Fill in Event data and post to the Main FSM
3193 ------------------------------------------------------------------------*/
3194 wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ;
3195 wdiEventData.pEventData = pwdiEnterBmpsReqParams;
3196 wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams);
3197 wdiEventData.pCBfnc = wdiEnterBmpsRspCb;
3198 wdiEventData.pUserData = pUserData;
3199
3200 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3201
3202}/*WDI_EnterBmpsReq*/
3203
3204/**
3205 @brief WDI_ExitBmpsReq will be called when the upper MAC to
3206 request the device to get out of BMPS power state. Upon
3207 the call of this API the WLAN DAL will pack and send a
3208 HAL Exit BMPS request message to the lower RIVA
3209 sub-system if DAL is in state STARTED.
3210
3211 In state BUSY this request will be queued. Request won't
3212 be allowed in any other state.
3213
3214 WDI_PostAssocReq must have been called.
3215
3216 @param pwdiExitBmpsReqParams: the Exit BMPS parameters as
3217 specified by the Device Interface
3218
3219 wdiExitBmpsRspCb: callback for passing back the response
3220 of the Exit BMPS operation received from the device
3221
3222 pUserData: user data will be passed back with the
3223 callback
3224
3225 @see WDI_PostAssocReq
3226 @return Result of the function call
3227*/
3228WDI_Status
3229WDI_ExitBmpsReq
3230(
3231 WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams,
3232 WDI_ExitBmpsRspCb wdiExitBmpsRspCb,
3233 void* pUserData
3234)
3235{
3236 WDI_EventInfoType wdiEventData;
3237 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3238
3239 /*------------------------------------------------------------------------
3240 Sanity Check
3241 ------------------------------------------------------------------------*/
3242 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3243 {
3244 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3245 "WDI API call before module is initialized - Fail request");
3246
3247 return WDI_STATUS_E_NOT_ALLOWED;
3248 }
3249
3250 /*------------------------------------------------------------------------
3251 Fill in Event data and post to the Main FSM
3252 ------------------------------------------------------------------------*/
3253 wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ;
3254 wdiEventData.pEventData = pwdiExitBmpsReqParams;
3255 wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams);
3256 wdiEventData.pCBfnc = wdiExitBmpsRspCb;
3257 wdiEventData.pUserData = pUserData;
3258
3259 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3260
3261}/*WDI_ExitBmpsReq*/
3262
3263/**
3264 @brief WDI_EnterUapsdReq will be called when the upper MAC to
3265 request the device to get into UAPSD power state. Upon
3266 the call of this API the WLAN DAL will pack and send a
3267 HAL Enter UAPSD request message to the lower RIVA
3268 sub-system if DAL is in state STARTED.
3269
3270 In state BUSY this request will be queued. Request won't
3271 be allowed in any other state.
3272
3273 WDI_PostAssocReq must have been called.
3274 WDI_SetUapsdAcParamsReq must have been called.
3275
3276 @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as
3277 specified by the Device Interface
3278
3279 wdiEnterUapsdRspCb: callback for passing back the
3280 response of the Enter UAPSD operation received from the
3281 device
3282
3283 pUserData: user data will be passed back with the
3284 callback
3285
3286 @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq
3287 @return Result of the function call
3288*/
3289WDI_Status
3290WDI_EnterUapsdReq
3291(
3292 WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams,
3293 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb,
3294 void* pUserData
3295)
3296{
3297 WDI_EventInfoType wdiEventData;
3298 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3299
3300 /*------------------------------------------------------------------------
3301 Sanity Check
3302 ------------------------------------------------------------------------*/
3303 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3304 {
3305 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3306 "WDI API call before module is initialized - Fail request");
3307
3308 return WDI_STATUS_E_NOT_ALLOWED;
3309 }
3310
3311 /*------------------------------------------------------------------------
3312 Fill in Event data and post to the Main FSM
3313 ------------------------------------------------------------------------*/
3314 wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ;
3315 wdiEventData.pEventData = pwdiEnterUapsdReqParams;
3316 wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams);
3317 wdiEventData.pCBfnc = wdiEnterUapsdRspCb;
3318 wdiEventData.pUserData = pUserData;
3319
3320 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3321
3322}/*WDI_EnterUapsdReq*/
3323
3324/**
3325 @brief WDI_ExitUapsdReq will be called when the upper MAC to
3326 request the device to get out of UAPSD power state. Upon
3327 the call of this API the WLAN DAL will send a HAL Exit
3328 UAPSD request message to the lower RIVA sub-system if
3329 DAL is in state STARTED.
3330
3331 In state BUSY this request will be queued. Request won't
3332 be allowed in any other state.
3333
3334 WDI_PostAssocReq must have been called.
3335
3336 @param wdiExitUapsdRspCb: callback for passing back the
3337 response of the Exit UAPSD operation received from the
3338 device
3339
3340 pUserData: user data will be passed back with the
3341 callback
3342
3343 @see WDI_PostAssocReq
3344 @return Result of the function call
3345*/
3346WDI_Status
3347WDI_ExitUapsdReq
3348(
3349 WDI_ExitUapsdRspCb wdiExitUapsdRspCb,
3350 void* pUserData
3351)
3352{
3353 WDI_EventInfoType wdiEventData;
3354 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3355
3356 /*------------------------------------------------------------------------
3357 Sanity Check
3358 ------------------------------------------------------------------------*/
3359 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3360 {
3361 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3362 "WDI API call before module is initialized - Fail request");
3363
3364 return WDI_STATUS_E_NOT_ALLOWED;
3365 }
3366
3367 /*------------------------------------------------------------------------
3368 Fill in Event data and post to the Main FSM
3369 ------------------------------------------------------------------------*/
3370 wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ;
3371 wdiEventData.pEventData = NULL;
3372 wdiEventData.uEventDataSize = 0;
3373 wdiEventData.pCBfnc = wdiExitUapsdRspCb;
3374 wdiEventData.pUserData = pUserData;
3375
3376 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3377
3378}/*WDI_ExitUapsdReq*/
3379
3380/**
3381 @brief WDI_UpdateUapsdParamsReq will be called when the upper
3382 MAC wants to set the UAPSD related configurations
3383 of an associated STA (while acting as an AP) to the WLAN
3384 Device. Upon the call of this API the WLAN DAL will pack
3385 and send a HAL Update UAPSD params request message to
3386 the lower RIVA sub-system if DAL is in state STARTED.
3387
3388 In state BUSY this request will be queued. Request won't
3389 be allowed in any other state.
3390
3391 WDI_ConfigBSSReq must have been called.
3392
3393 @param pwdiUpdateUapsdReqParams: the UAPSD parameters
3394 as specified by the Device Interface
3395
3396 wdiUpdateUapsdParamsCb: callback for passing back the
3397 response of the update UAPSD params operation received
3398 from the device
3399
3400 pUserData: user data will be passed back with the
3401 callback
3402
3403 @see WDI_ConfigBSSReq
3404 @return Result of the function call
3405*/
3406WDI_Status
3407WDI_UpdateUapsdParamsReq
3408(
3409 WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams,
3410 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb,
3411 void* pUserData
3412)
3413{
3414 WDI_EventInfoType wdiEventData;
3415 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3416
3417 /*------------------------------------------------------------------------
3418 Sanity Check
3419 ------------------------------------------------------------------------*/
3420 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3421 {
3422 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3423 "WDI API call before module is initialized - Fail request");
3424
3425 return WDI_STATUS_E_NOT_ALLOWED;
3426 }
3427
3428 /*------------------------------------------------------------------------
3429 Fill in Event data and post to the Main FSM
3430 ------------------------------------------------------------------------*/
3431 wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ;
3432 wdiEventData.pEventData = pwdiUpdateUapsdReqParams;
3433 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);;
3434 wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb;
3435 wdiEventData.pUserData = pUserData;
3436
3437 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3438
3439}/*WDI_UpdateUapsdParamsReq*/
3440
3441/**
3442 @brief WDI_SetUapsdAcParamsReq will be called when the upper
3443 MAC wants to set the UAPSD related configurations before
3444 requesting for enter UAPSD power state to the WLAN
3445 Device. Upon the call of this API the WLAN DAL will pack
3446 and send a HAL Set UAPSD params request message to
3447 the lower RIVA sub-system if DAL is in state STARTED.
3448
3449 In state BUSY this request will be queued. Request won't
3450 be allowed in any other state.
3451
3452 WDI_PostAssocReq must have been called.
3453
3454 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3455 the Device Interface
3456
3457 wdiSetUapsdAcParamsCb: callback for passing back the
3458 response of the set UAPSD params operation received from
3459 the device
3460
3461 pUserData: user data will be passed back with the
3462 callback
3463
3464 @see WDI_PostAssocReq
3465 @return Result of the function call
3466*/
3467WDI_Status
3468WDI_SetUapsdAcParamsReq
3469(
3470 WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo,
3471 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb,
3472 void* pUserData
3473)
3474{
3475 WDI_EventInfoType wdiEventData;
3476 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3477
3478 /*------------------------------------------------------------------------
3479 Sanity Check
3480 ------------------------------------------------------------------------*/
3481 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3482 {
3483 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3484 "WDI API call before module is initialized - Fail request");
3485
3486 return WDI_STATUS_E_NOT_ALLOWED;
3487 }
3488
3489 /*------------------------------------------------------------------------
3490 Fill in Event data and post to the Main FSM
3491 ------------------------------------------------------------------------*/
3492 wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ;
3493 wdiEventData.pEventData = pwdiUapsdInfo;
3494 wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo);
3495 wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb;
3496 wdiEventData.pUserData = pUserData;
3497
3498 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3499
3500}/*WDI_SetUapsdAcParamsReq*/
3501
3502/**
3503 @brief WDI_ConfigureRxpFilterReq will be called when the upper
3504 MAC wants to set/reset the RXP filters for received pkts
3505 (MC, BC etc.). Upon the call of this API the WLAN DAL will pack
3506 and send a HAL configure RXP filter request message to
3507 the lower RIVA sub-system.
3508
3509 In state BUSY this request will be queued. Request won't
3510 be allowed in any other state.
3511
3512
3513 @param pwdiConfigureRxpFilterReqParams: the RXP
3514 filter as specified by the Device
3515 Interface
3516
3517 wdiConfigureRxpFilterCb: callback for passing back the
3518 response of the configure RXP filter operation received
3519 from the device
3520
3521 pUserData: user data will be passed back with the
3522 callback
3523
3524 @return Result of the function call
3525*/
3526WDI_Status
3527WDI_ConfigureRxpFilterReq
3528(
3529 WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams,
3530 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb,
3531 void* pUserData
3532)
3533{
3534 WDI_EventInfoType wdiEventData;
3535 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3536
3537 /*------------------------------------------------------------------------
3538 Sanity Check
3539 ------------------------------------------------------------------------*/
3540 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3541 {
3542 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3543 "WDI API call before module is initialized - Fail request");
3544
3545 return WDI_STATUS_E_NOT_ALLOWED;
3546 }
3547
3548 /*------------------------------------------------------------------------
3549 Fill in Event data and post to the Main FSM
3550 ------------------------------------------------------------------------*/
3551 wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ;
3552 wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams;
3553 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams);
3554 wdiEventData.pCBfnc = wdiConfigureRxpFilterCb;
3555 wdiEventData.pUserData = pUserData;
3556
3557 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3558}/*WDI_ConfigureRxpFilterReq*/
3559
3560/**
3561 @brief WDI_SetBeaconFilterReq will be called when the upper MAC
3562 wants to set the beacon filters while in power save.
3563 Upon the call of this API the WLAN DAL will pack and
3564 send a Beacon filter request message to the
3565 lower RIVA sub-system.
3566
3567 In state BUSY this request will be queued. Request won't
3568 be allowed in any other state.
3569
3570
3571 @param pwdiBeaconFilterReqParams: the beacon
3572 filter as specified by the Device
3573 Interface
3574
3575 wdiBeaconFilterCb: callback for passing back the
3576 response of the set beacon filter operation received
3577 from the device
3578
3579 pUserData: user data will be passed back with the
3580 callback
3581
3582 @return Result of the function call
3583*/
3584WDI_Status
3585WDI_SetBeaconFilterReq
3586(
3587 WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3588 WDI_SetBeaconFilterCb wdiBeaconFilterCb,
3589 void* pUserData
3590)
3591{
3592 WDI_EventInfoType wdiEventData;
3593 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3594
3595 /*------------------------------------------------------------------------
3596 Sanity Check
3597 ------------------------------------------------------------------------*/
3598 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3599 {
3600 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3601 "WDI API call before module is initialized - Fail request");
3602
3603 return WDI_STATUS_E_NOT_ALLOWED;
3604 }
3605
3606 /*------------------------------------------------------------------------
3607 Fill in Event data and post to the Main FSM
3608 ------------------------------------------------------------------------*/
3609 wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ;
3610 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3611 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3612 wdiEventData.pCBfnc = wdiBeaconFilterCb;
3613 wdiEventData.pUserData = pUserData;
3614
3615 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3616}/*WDI_SetBeaconFilterReq*/
3617
3618/**
3619 @brief WDI_RemBeaconFilterReq will be called when the upper MAC
3620 wants to remove the beacon filter for particular IE
3621 while in power save. Upon the call of this API the WLAN
3622 DAL will pack and send a remove Beacon filter request
3623 message to the lower RIVA sub-system.
3624
3625 In state BUSY this request will be queued. Request won't
3626 be allowed in any other state.
3627
3628
3629 @param pwdiBeaconFilterReqParams: the beacon
3630 filter as specified by the Device
3631 Interface
3632
3633 wdiBeaconFilterCb: callback for passing back the
3634 response of the remove beacon filter operation received
3635 from the device
3636
3637 pUserData: user data will be passed back with the
3638 callback
3639
3640 @return Result of the function call
3641*/
3642WDI_Status
3643WDI_RemBeaconFilterReq
3644(
3645 WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3646 WDI_RemBeaconFilterCb wdiBeaconFilterCb,
3647 void* pUserData
3648)
3649{
3650 WDI_EventInfoType wdiEventData;
3651 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3652
3653 /*------------------------------------------------------------------------
3654 Sanity Check
3655 ------------------------------------------------------------------------*/
3656 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3657 {
3658 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3659 "WDI API call before module is initialized - Fail request");
3660
3661 return WDI_STATUS_E_NOT_ALLOWED;
3662 }
3663
3664 /*------------------------------------------------------------------------
3665 Fill in Event data and post to the Main FSM
3666 ------------------------------------------------------------------------*/
3667 wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ;
3668 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3669 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3670 wdiEventData.pCBfnc = wdiBeaconFilterCb;
3671 wdiEventData.pUserData = pUserData;
3672
3673 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3674}/*WDI_RemBeaconFilterReq*/
3675
3676/**
3677 @brief WDI_SetRSSIThresholdsReq will be called when the upper
3678 MAC wants to set the RSSI thresholds related
3679 configurations while in power save. Upon the call of
3680 this API the WLAN DAL will pack and send a HAL Set RSSI
3681 thresholds request message to the lower RIVA
3682 sub-system if DAL is in state STARTED.
3683
3684 In state BUSY this request will be queued. Request won't
3685 be allowed in any other state.
3686
3687 WDI_PostAssocReq must have been called.
3688
3689 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3690 the Device Interface
3691
3692 wdiSetUapsdAcParamsCb: callback for passing back the
3693 response of the set UAPSD params operation received from
3694 the device
3695
3696 pUserData: user data will be passed back with the
3697 callback
3698
3699 @see WDI_PostAssocReq
3700 @return Result of the function call
3701*/
3702WDI_Status
3703WDI_SetRSSIThresholdsReq
3704(
3705 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams,
3706 WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb,
3707 void* pUserData
3708)
3709{
3710 WDI_EventInfoType wdiEventData;
3711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3712
3713 /*------------------------------------------------------------------------
3714 Sanity Check
3715 ------------------------------------------------------------------------*/
3716 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3717 {
3718 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3719 "WDI API call before module is initialized - Fail request");
3720
3721 return WDI_STATUS_E_NOT_ALLOWED;
3722 }
3723
3724 /*------------------------------------------------------------------------
3725 Fill in Event data and post to the Main FSM
3726 ------------------------------------------------------------------------*/
3727 wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ;
3728 wdiEventData.pEventData = pwdiRSSIThresholdsParams;
3729 wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);;
3730 wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb;
3731 wdiEventData.pUserData = pUserData;
3732
3733 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3734}/* WDI_SetRSSIThresholdsReq*/
3735
3736/**
3737 @brief WDI_HostOffloadReq will be called when the upper MAC
3738 wants to set the filter to minimize unnecessary host
3739 wakeup due to broadcast traffic while in power save.
3740 Upon the call of this API the WLAN DAL will pack and
3741 send a HAL host offload request message to the
3742 lower RIVA sub-system if DAL is in state STARTED.
3743
3744 In state BUSY this request will be queued. Request won't
3745 be allowed in any other state.
3746
3747 WDI_PostAssocReq must have been called.
3748
3749 @param pwdiHostOffloadParams: the host offload as specified
3750 by the Device Interface
3751
3752 wdiHostOffloadCb: callback for passing back the response
3753 of the host offload operation received from the
3754 device
3755
3756 pUserData: user data will be passed back with the
3757 callback
3758
3759 @see WDI_PostAssocReq
3760 @return Result of the function call
3761*/
3762WDI_Status
3763WDI_HostOffloadReq
3764(
3765 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams,
3766 WDI_HostOffloadCb wdiHostOffloadCb,
3767 void* pUserData
3768)
3769{
3770 WDI_EventInfoType wdiEventData;
3771 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3772
3773 /*------------------------------------------------------------------------
3774 Sanity Check
3775 ------------------------------------------------------------------------*/
3776 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3777 {
3778 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3779 "WDI API call before module is initialized - Fail request");
3780
3781 return WDI_STATUS_E_NOT_ALLOWED;
3782 }
3783
3784 /*------------------------------------------------------------------------
3785 Fill in Event data and post to the Main FSM
3786 ------------------------------------------------------------------------*/
3787 wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ;
3788 wdiEventData.pEventData = pwdiHostOffloadParams;
3789 wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);;
3790 wdiEventData.pCBfnc = wdiHostOffloadCb;
3791 wdiEventData.pUserData = pUserData;
3792
3793 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3794}/*WDI_HostOffloadReq*/
3795
3796/**
3797 @brief WDI_KeepAliveReq will be called when the upper MAC
3798 wants to set the filter to send NULL or unsolicited ARP responses
3799 and minimize unnecessary host wakeups due to while in power save.
3800 Upon the call of this API the WLAN DAL will pack and
3801 send a HAL Keep Alive request message to the
3802 lower RIVA sub-system if DAL is in state STARTED.
3803
3804 In state BUSY this request will be queued. Request won't
3805 be allowed in any other state.
3806
3807 WDI_PostAssocReq must have been called.
3808
3809 @param pwdiKeepAliveParams: the Keep Alive as specified
3810 by the Device Interface
3811
3812 wdiKeepAliveCb: callback for passing back the response
3813 of the Keep Alive operation received from the
3814 device
3815
3816 pUserData: user data will be passed back with the
3817 callback
3818
3819 @see WDI_PostAssocReq
3820 @return Result of the function call
3821*/
3822WDI_Status
3823WDI_KeepAliveReq
3824(
3825 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams,
3826 WDI_KeepAliveCb wdiKeepAliveCb,
3827 void* pUserData
3828)
3829{
3830 WDI_EventInfoType wdiEventData;
3831 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3832
3833 /*------------------------------------------------------------------------
3834 Sanity Check
3835 ------------------------------------------------------------------------*/
3836 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3837 {
3838 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3839 "WDI_KeepAliveReq: WDI API call before module "
3840 "is initialized - Fail request");
3841
3842 return WDI_STATUS_E_NOT_ALLOWED;
3843 }
3844
3845 /*------------------------------------------------------------------------
3846 Fill in Event data and post to the Main FSM
3847 ------------------------------------------------------------------------*/
3848 wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ;
3849 wdiEventData.pEventData = pwdiKeepAliveParams;
3850 wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams);
3851 wdiEventData.pCBfnc = wdiKeepAliveCb;
3852 wdiEventData.pUserData = pUserData;
3853
3854 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3855}/*WDI_KeepAliveReq*/
3856
3857/**
3858 @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC
3859 wants to set the Wowl Bcast ptrn to minimize unnecessary
3860 host wakeup due to broadcast traffic while in power
3861 save. Upon the call of this API the WLAN DAL will pack
3862 and send a HAL Wowl Bcast ptrn request message to the
3863 lower RIVA sub-system if DAL is in state STARTED.
3864
3865 In state BUSY this request will be queued. Request won't
3866 be allowed in any other state.
3867
3868 WDI_PostAssocReq must have been called.
3869
3870 @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as
3871 specified by the Device Interface
3872
3873 wdiWowlAddBcPtrnCb: callback for passing back the
3874 response of the add Wowl bcast ptrn operation received
3875 from the device
3876
3877 pUserData: user data will be passed back with the
3878 callback
3879
3880 @see WDI_PostAssocReq
3881 @return Result of the function call
3882*/
3883WDI_Status
3884WDI_WowlAddBcPtrnReq
3885(
3886 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams,
3887 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb,
3888 void* pUserData
3889)
3890{
3891 WDI_EventInfoType wdiEventData;
3892 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3893
3894 /*------------------------------------------------------------------------
3895 Sanity Check
3896 ------------------------------------------------------------------------*/
3897 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3898 {
3899 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3900 "WDI API call before module is initialized - Fail request");
3901
3902 return WDI_STATUS_E_NOT_ALLOWED;
3903 }
3904
3905 /*------------------------------------------------------------------------
3906 Fill in Event data and post to the Main FSM
3907 ------------------------------------------------------------------------*/
3908 wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ;
3909 wdiEventData.pEventData = pwdiWowlAddBcPtrnParams;
3910 wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);;
3911 wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb;
3912 wdiEventData.pUserData = pUserData;
3913
3914 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3915}/*WDI_WowlAddBcPtrnReq*/
3916
3917/**
3918 @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC
3919 wants to clear the Wowl Bcast ptrn. Upon the call of
3920 this API the WLAN DAL will pack and send a HAL delete
3921 Wowl Bcast ptrn request message to the lower RIVA
3922 sub-system if DAL is in state STARTED.
3923
3924 In state BUSY this request will be queued. Request won't
3925 be allowed in any other state.
3926
3927 WDI_WowlAddBcPtrnReq must have been called.
3928
3929 @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as
3930 specified by the Device Interface
3931
3932 wdiWowlDelBcPtrnCb: callback for passing back the
3933 response of the del Wowl bcast ptrn operation received
3934 from the device
3935
3936 pUserData: user data will be passed back with the
3937 callback
3938
3939 @see WDI_WowlAddBcPtrnReq
3940 @return Result of the function call
3941*/
3942WDI_Status
3943WDI_WowlDelBcPtrnReq
3944(
3945 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams,
3946 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb,
3947 void* pUserData
3948)
3949{
3950 WDI_EventInfoType wdiEventData;
3951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3952
3953 /*------------------------------------------------------------------------
3954 Sanity Check
3955 ------------------------------------------------------------------------*/
3956 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3957 {
3958 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3959 "WDI API call before module is initialized - Fail request");
3960
3961 return WDI_STATUS_E_NOT_ALLOWED;
3962 }
3963
3964 /*------------------------------------------------------------------------
3965 Fill in Event data and post to the Main FSM
3966 ------------------------------------------------------------------------*/
3967 wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ;
3968 wdiEventData.pEventData = pwdiWowlDelBcPtrnParams;
3969 wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);;
3970 wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb;
3971 wdiEventData.pUserData = pUserData;
3972
3973 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3974}/*WDI_WowlDelBcPtrnReq*/
3975
3976/**
3977 @brief WDI_WowlEnterReq will be called when the upper MAC
3978 wants to enter the Wowl state to minimize unnecessary
3979 host wakeup while in power save. Upon the call of this
3980 API the WLAN DAL will pack and send a HAL Wowl enter
3981 request message to the lower RIVA sub-system if DAL is
3982 in state STARTED.
3983
3984 In state BUSY this request will be queued. Request won't
3985 be allowed in any other state.
3986
3987 WDI_PostAssocReq must have been called.
3988
3989 @param pwdiWowlEnterReqParams: the Wowl enter info as
3990 specified by the Device Interface
3991
3992 wdiWowlEnterReqCb: callback for passing back the
3993 response of the enter Wowl operation received from the
3994 device
3995
3996 pUserData: user data will be passed back with the
3997 callback
3998
3999 @see WDI_PostAssocReq
4000 @return Result of the function call
4001*/
4002WDI_Status
4003WDI_WowlEnterReq
4004(
4005 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams,
4006 WDI_WowlEnterReqCb wdiWowlEnterCb,
4007 void* pUserData
4008)
4009{
4010 WDI_EventInfoType wdiEventData;
4011 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4012
4013 /*------------------------------------------------------------------------
4014 Sanity Check
4015 ------------------------------------------------------------------------*/
4016 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4017 {
4018 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4019 "WDI API call before module is initialized - Fail request");
4020
4021 return WDI_STATUS_E_NOT_ALLOWED;
4022 }
4023
4024 /*------------------------------------------------------------------------
4025 Fill in Event data and post to the Main FSM
4026 ------------------------------------------------------------------------*/
4027 wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ;
4028 wdiEventData.pEventData = pwdiWowlEnterParams;
4029 wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);;
4030 wdiEventData.pCBfnc = wdiWowlEnterCb;
4031 wdiEventData.pUserData = pUserData;
4032
4033 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4034}/*WDI_WowlEnterReq*/
4035
4036/**
4037 @brief WDI_WowlExitReq will be called when the upper MAC
4038 wants to exit the Wowl state. Upon the call of this API
4039 the WLAN DAL will pack and send a HAL Wowl exit request
4040 message to the lower RIVA sub-system if DAL is in state
4041 STARTED.
4042
4043 In state BUSY this request will be queued. Request won't
4044 be allowed in any other state.
4045
4046 WDI_WowlEnterReq must have been called.
4047
4048 @param pwdiWowlExitReqParams: the Wowl exit info as
4049 specified by the Device Interface
4050
4051 wdiWowlExitReqCb: callback for passing back the response
4052 of the exit Wowl operation received from the device
4053
4054 pUserData: user data will be passed back with the
4055 callback
4056
4057 @see WDI_WowlEnterReq
4058 @return Result of the function call
4059*/
4060WDI_Status
4061WDI_WowlExitReq
4062(
4063 WDI_WowlExitReqCb wdiWowlExitCb,
4064 void* pUserData
4065)
4066{
4067 WDI_EventInfoType wdiEventData;
4068 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4069
4070 /*------------------------------------------------------------------------
4071 Sanity Check
4072 ------------------------------------------------------------------------*/
4073 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4074 {
4075 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4076 "WDI API call before module is initialized - Fail request");
4077
4078 return WDI_STATUS_E_NOT_ALLOWED;
4079 }
4080
4081 /*------------------------------------------------------------------------
4082 Fill in Event data and post to the Main FSM
4083 ------------------------------------------------------------------------*/
4084 wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ;
4085 wdiEventData.pEventData = NULL;
4086 wdiEventData.uEventDataSize = 0;
4087 wdiEventData.pCBfnc = wdiWowlExitCb;
4088 wdiEventData.pUserData = pUserData;
4089
4090 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4091}/*WDI_WowlExitReq*/
4092
4093/**
4094 @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when
4095 the upper MAC wants to dynamically adjusts the listen
4096 interval based on the WLAN/MSM activity. Upon the call
4097 of this API the WLAN DAL will pack and send a HAL
4098 configure Apps Cpu Wakeup State request message to the
4099 lower RIVA sub-system.
4100
4101 In state BUSY this request will be queued. Request won't
4102 be allowed in any other state.
4103
4104
4105 @param pwdiConfigureAppsCpuWakeupStateReqParams: the
4106 Apps Cpu Wakeup State as specified by the
4107 Device Interface
4108
4109 wdiConfigureAppsCpuWakeupStateCb: callback for passing
4110 back the response of the configure Apps Cpu Wakeup State
4111 operation received from the device
4112
4113 pUserData: user data will be passed back with the
4114 callback
4115
4116 @return Result of the function call
4117*/
4118WDI_Status
4119WDI_ConfigureAppsCpuWakeupStateReq
4120(
4121 WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams,
4122 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb,
4123 void* pUserData
4124)
4125{
4126 WDI_EventInfoType wdiEventData;
4127 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4128
4129 /*------------------------------------------------------------------------
4130 Sanity Check
4131 ------------------------------------------------------------------------*/
4132 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4133 {
4134 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4135 "WDI API call before module is initialized - Fail request");
4136
4137 return WDI_STATUS_E_NOT_ALLOWED;
4138 }
4139
4140 /*------------------------------------------------------------------------
4141 Fill in Event data and post to the Main FSM
4142 ------------------------------------------------------------------------*/
4143 wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
4144 wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams;
4145 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams);
4146 wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb;
4147 wdiEventData.pUserData = pUserData;
4148
4149 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4150}/*WDI_ConfigureAppsCpuWakeupStateReq*/
4151/**
4152 @brief WDI_FlushAcReq will be called when the upper MAC wants
4153 to to perform a flush operation on a given AC. Upon the
4154 call of this API the WLAN DAL will pack and send a HAL
4155 Flush AC request message to the lower RIVA sub-system if
4156 DAL is in state STARTED.
4157
4158 In state BUSY this request will be queued. Request won't
4159 be allowed in any other state.
4160
4161 WDI_AddBAReq must have been called.
4162
4163 @param pwdiFlushAcReqParams: the Flush AC parameters as
4164 specified by the Device Interface
4165
4166 wdiFlushAcRspCb: callback for passing back the response
4167 of the Flush AC operation received from the device
4168
4169 pUserData: user data will be passed back with the
4170 callback
4171
4172 @see WDI_AddBAReq
4173 @return Result of the function call
4174*/
4175WDI_Status
4176WDI_FlushAcReq
4177(
4178 WDI_FlushAcReqParamsType* pwdiFlushAcReqParams,
4179 WDI_FlushAcRspCb wdiFlushAcRspCb,
4180 void* pUserData
4181)
4182{
4183 WDI_EventInfoType wdiEventData;
4184 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4185
4186 /*------------------------------------------------------------------------
4187 Sanity Check
4188 ------------------------------------------------------------------------*/
4189 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4190 {
4191 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4192 "WDI API call before module is initialized - Fail request");
4193
4194 return WDI_STATUS_E_NOT_ALLOWED;
4195 }
4196
4197 /*------------------------------------------------------------------------
4198 Fill in Event data and post to the Main FSM
4199 ------------------------------------------------------------------------*/
4200 wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ;
4201 wdiEventData.pEventData = pwdiFlushAcReqParams;
4202 wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams);
4203 wdiEventData.pCBfnc = wdiFlushAcRspCb;
4204 wdiEventData.pUserData = pUserData;
4205
4206 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4207
4208}/*WDI_FlushAcReq*/
4209
4210/**
4211 @brief WDI_BtAmpEventReq will be called when the upper MAC
4212 wants to notify the lower mac on a BT AMP event. This is
4213 to inform BTC-SLM that some BT AMP event occurred. Upon
4214 the call of this API the WLAN DAL will pack and send a
4215 HAL BT AMP event request message to the lower RIVA
4216 sub-system if DAL is in state STARTED.
4217
4218 In state BUSY this request will be queued. Request won't
4219 be allowed in any other state.
4220
4221
4222 @param wdiBtAmpEventReqParams: the BT AMP event parameters as
4223 specified by the Device Interface
4224
4225 wdiBtAmpEventRspCb: callback for passing back the
4226 response of the BT AMP event operation received from the
4227 device
4228
4229 pUserData: user data will be passed back with the
4230 callback
4231
4232 @return Result of the function call
4233*/
4234WDI_Status
4235WDI_BtAmpEventReq
4236(
4237 WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams,
4238 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb,
4239 void* pUserData
4240)
4241{
4242 WDI_EventInfoType wdiEventData;
4243 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4244
4245 /*------------------------------------------------------------------------
4246 Sanity Check
4247 ------------------------------------------------------------------------*/
4248 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4249 {
4250 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4251 "WDI API call before module is initialized - Fail request");
4252
4253 return WDI_STATUS_E_NOT_ALLOWED;
4254 }
4255
4256 /*------------------------------------------------------------------------
4257 Fill in Event data and post to the Main FSM
4258 ------------------------------------------------------------------------*/
4259 wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ;
4260 wdiEventData.pEventData = pwdiBtAmpEventReqParams;
4261 wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams);
4262 wdiEventData.pCBfnc = wdiBtAmpEventRspCb;
4263 wdiEventData.pUserData = pUserData;
4264
4265 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4266
4267}/*WDI_BtAmpEventReq*/
4268
4269
4270
4271/*========================================================================
4272
4273 CONTROL APIs
4274
4275==========================================================================*/
4276/**
4277 @brief WDI_SwitchChReq will be called when the upper MAC wants
4278 the WLAN HW to change the current channel of operation.
4279 Upon the call of this API the WLAN DAL will pack and
4280 send a HAL Start request message to the lower RIVA
4281 sub-system if DAL is in state STARTED.
4282
4283 In state BUSY this request will be queued. Request won't
4284 be allowed in any other state.
4285
4286 WDI_Start must have been called.
4287
4288 @param wdiSwitchChReqParams: the switch ch parameters as
4289 specified by the Device Interface
4290
4291 wdiSwitchChRspCb: callback for passing back the response
4292 of the switch ch operation received from the device
4293
4294 pUserData: user data will be passed back with the
4295 callback
4296
4297 @see WDI_Start
4298 @return Result of the function call
4299*/
4300WDI_Status
4301WDI_SwitchChReq
4302(
4303 WDI_SwitchChReqParamsType* pwdiSwitchChReqParams,
4304 WDI_SwitchChRspCb wdiSwitchChRspCb,
4305 void* pUserData
4306)
4307{
4308 WDI_EventInfoType wdiEventData;
4309 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4310
4311 /*------------------------------------------------------------------------
4312 Sanity Check
4313 ------------------------------------------------------------------------*/
4314 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4315 {
4316 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4317 "WDI API call before module is initialized - Fail request");
4318
4319 return WDI_STATUS_E_NOT_ALLOWED;
4320 }
4321
4322 /*------------------------------------------------------------------------
4323 Fill in Event data and post to the Main FSM
4324 ------------------------------------------------------------------------*/
4325 wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ;
4326 wdiEventData.pEventData = pwdiSwitchChReqParams;
4327 wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams);
4328 wdiEventData.pCBfnc = wdiSwitchChRspCb;
4329 wdiEventData.pUserData = pUserData;
4330
4331 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4332
4333}/*WDI_SwitchChReq*/
4334
4335
4336/**
4337 @brief WDI_ConfigSTAReq will be called when the upper MAC
4338 wishes to add or update a STA in HW. Upon the call of
4339 this API the WLAN DAL will pack and send a HAL Start
4340 message request message to the lower RIVA sub-system if
4341 DAL is in state STARTED.
4342
4343 In state BUSY this request will be queued. Request won't
4344 be allowed in any other state.
4345
4346 WDI_Start must have been called.
4347
4348 @param wdiConfigSTAReqParams: the config STA parameters as
4349 specified by the Device Interface
4350
4351 wdiConfigSTARspCb: callback for passing back the
4352 response of the config STA operation received from the
4353 device
4354
4355 pUserData: user data will be passed back with the
4356 callback
4357
4358 @see WDI_Start
4359 @return Result of the function call
4360*/
4361WDI_Status
4362WDI_ConfigSTAReq
4363(
4364 WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams,
4365 WDI_ConfigSTARspCb wdiConfigSTARspCb,
4366 void* pUserData
4367)
4368{
4369 WDI_EventInfoType wdiEventData;
4370 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4371
4372 /*------------------------------------------------------------------------
4373 Sanity Check
4374 ------------------------------------------------------------------------*/
4375 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4376 {
4377 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4378 "WDI API call before module is initialized - Fail request");
4379
4380 return WDI_STATUS_E_NOT_ALLOWED;
4381 }
4382
4383 /*------------------------------------------------------------------------
4384 Fill in Event data and post to the Main FSM
4385 ------------------------------------------------------------------------*/
4386 wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ;
4387 wdiEventData.pEventData = pwdiConfigSTAReqParams;
4388 wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams);
4389 wdiEventData.pCBfnc = wdiConfigSTARspCb;
4390 wdiEventData.pUserData = pUserData;
4391
4392 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4393
4394}/*WDI_ConfigSTAReq*/
4395
4396/**
4397 @brief WDI_SetLinkStateReq will be called when the upper MAC
4398 wants to change the state of an ongoing link. Upon the
4399 call of this API the WLAN DAL will pack and send a HAL
4400 Start message request message to the lower RIVA
4401 sub-system if DAL is in state STARTED.
4402
4403 In state BUSY this request will be queued. Request won't
4404 be allowed in any other state.
4405
4406 WDI_JoinStartReq must have been called.
4407
4408 @param wdiSetLinkStateReqParams: the set link state parameters
4409 as specified by the Device Interface
4410
4411 wdiSetLinkStateRspCb: callback for passing back the
4412 response of the set link state operation received from
4413 the device
4414
4415 pUserData: user data will be passed back with the
4416 callback
4417
4418 @see WDI_JoinStartReq
4419 @return Result of the function call
4420*/
4421WDI_Status
4422WDI_SetLinkStateReq
4423(
4424 WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams,
4425 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb,
4426 void* pUserData
4427)
4428{
4429 WDI_EventInfoType wdiEventData;
4430 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4431
4432 /*------------------------------------------------------------------------
4433 Sanity Check
4434 ------------------------------------------------------------------------*/
4435 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4436 {
4437 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4438 "WDI API call before module is initialized - Fail request");
4439
4440 return WDI_STATUS_E_NOT_ALLOWED;
4441 }
4442
4443 /*------------------------------------------------------------------------
4444 Fill in Event data and post to the Main FSM
4445 ------------------------------------------------------------------------*/
4446 wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ;
4447 wdiEventData.pEventData = pwdiSetLinkStateReqParams;
4448 wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams);
4449 wdiEventData.pCBfnc = wdiSetLinkStateRspCb;
4450 wdiEventData.pUserData = pUserData;
4451
4452 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4453
4454}/*WDI_SetLinkStateReq*/
4455
4456
4457/**
4458 @brief WDI_GetStatsReq will be called when the upper MAC wants
4459 to get statistics (MIB counters) from the device. Upon
4460 the call of this API the WLAN DAL will pack and send a
4461 HAL Start request message to the lower RIVA sub-system
4462 if DAL is in state STARTED.
4463
4464 In state BUSY this request will be queued. Request won't
4465 be allowed in any other state.
4466
4467 WDI_Start must have been called.
4468
4469 @param wdiGetStatsReqParams: the stats parameters to get as
4470 specified by the Device Interface
4471
4472 wdiGetStatsRspCb: callback for passing back the response
4473 of the get stats operation received from the device
4474
4475 pUserData: user data will be passed back with the
4476 callback
4477
4478 @see WDI_Start
4479 @return Result of the function call
4480*/
4481WDI_Status
4482WDI_GetStatsReq
4483(
4484 WDI_GetStatsReqParamsType* pwdiGetStatsReqParams,
4485 WDI_GetStatsRspCb wdiGetStatsRspCb,
4486 void* pUserData
4487)
4488{
4489 WDI_EventInfoType wdiEventData;
4490 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4491
4492 /*------------------------------------------------------------------------
4493 Sanity Check
4494 ------------------------------------------------------------------------*/
4495 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4496 {
4497 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4498 "WDI API call before module is initialized - Fail request");
4499
4500 return WDI_STATUS_E_NOT_ALLOWED;
4501 }
4502
4503 /*------------------------------------------------------------------------
4504 Fill in Event data and post to the Main FSM
4505 ------------------------------------------------------------------------*/
4506 wdiEventData.wdiRequest = WDI_GET_STATS_REQ;
4507 wdiEventData.pEventData = pwdiGetStatsReqParams;
4508 wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams);
4509 wdiEventData.pCBfnc = wdiGetStatsRspCb;
4510 wdiEventData.pUserData = pUserData;
4511
4512 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4513
4514}/*WDI_GetStatsReq*/
4515
4516
4517/**
4518 @brief WDI_UpdateCfgReq will be called when the upper MAC when
4519 it wishes to change the configuration of the WLAN
4520 Device. Upon the call of this API the WLAN DAL will pack
4521 and send a HAL Update CFG request message to the lower
4522 RIVA sub-system if DAL is in state STARTED.
4523
4524 In state BUSY this request will be queued. Request won't
4525 be allowed in any other state.
4526
4527 WDI_Start must have been called.
4528
4529 @param wdiUpdateCfgReqParams: the update cfg parameters as
4530 specified by the Device Interface
4531
4532 wdiUpdateCfgsRspCb: callback for passing back the
4533 response of the update cfg operation received from the
4534 device
4535
4536 pUserData: user data will be passed back with the
4537 callback
4538
4539 @see WDI_Start
4540 @return Result of the function call
4541*/
4542WDI_Status
4543WDI_UpdateCfgReq
4544(
4545 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams,
4546 WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb,
4547 void* pUserData
4548)
4549{
4550 WDI_EventInfoType wdiEventData;
4551 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4552
4553 /*------------------------------------------------------------------------
4554 Sanity Check
4555 ------------------------------------------------------------------------*/
4556 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4557 {
4558 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4559 "WDI API call before module is initialized - Fail request");
4560
4561 return WDI_STATUS_E_NOT_ALLOWED;
4562 }
4563
4564 /*------------------------------------------------------------------------
4565 Fill in Event data and post to the Main FSM
4566 ------------------------------------------------------------------------*/
4567 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
4568 wdiEventData.pEventData = pwdiUpdateCfgReqParams;
4569 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams);
4570 wdiEventData.pCBfnc = wdiUpdateCfgsRspCb;
4571 wdiEventData.pUserData = pUserData;
4572
4573 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4574
4575}/*WDI_UpdateCfgReq*/
4576
4577
4578
4579/**
4580 @brief WDI_AddBAReq will be called when the upper MAC has setup
4581 successfully a BA session and needs to notify the HW for
4582 the appropriate settings to take place. Upon the call of
4583 this API the WLAN DAL will pack and send a HAL Add BA
4584 request message to the lower RIVA sub-system if DAL is
4585 in state STARTED.
4586
4587 In state BUSY this request will be queued. Request won't
4588 be allowed in any other state.
4589
4590 WDI_PostAssocReq must have been called.
4591
4592 @param wdiAddBAReqParams: the add BA parameters as specified by
4593 the Device Interface
4594
4595 wdiAddBARspCb: callback for passing back the response of
4596 the add BA operation received from the device
4597
4598 pUserData: user data will be passed back with the
4599 callback
4600
4601 @see WDI_PostAssocReq
4602 @return Result of the function call
4603*/
4604WDI_Status
4605WDI_AddBAReq
4606(
4607 WDI_AddBAReqParamsType* pwdiAddBAReqParams,
4608 WDI_AddBARspCb wdiAddBARspCb,
4609 void* pUserData
4610)
4611{
4612 WDI_EventInfoType wdiEventData;
4613 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4614
4615 /*------------------------------------------------------------------------
4616 Sanity Check
4617 ------------------------------------------------------------------------*/
4618 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4619 {
4620 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4621 "WDI API call before module is initialized - Fail request");
4622
4623 return WDI_STATUS_E_NOT_ALLOWED;
4624 }
4625
4626 /*------------------------------------------------------------------------
4627 Fill in Event data and post to the Main FSM
4628 ------------------------------------------------------------------------*/
4629 wdiEventData.wdiRequest = WDI_ADD_BA_REQ;
4630 wdiEventData.pEventData = pwdiAddBAReqParams;
4631 wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams);
4632 wdiEventData.pCBfnc = wdiAddBARspCb;
4633 wdiEventData.pUserData = pUserData;
4634
4635 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4636
4637}/*WDI_AddBAReq*/
4638
4639
4640/**
4641 @brief WDI_TriggerBAReq will be called when the upper MAC has setup
4642 successfully a BA session and needs to notify the HW for
4643 the appropriate settings to take place. Upon the call of
4644 this API the WLAN DAL will pack and send a HAL Add BA
4645 request message to the lower RIVA sub-system if DAL is
4646 in state STARTED.
4647
4648 In state BUSY this request will be queued. Request won't
4649 be allowed in any other state.
4650
4651 WDI_PostAssocReq must have been called.
4652
4653 @param wdiAddBAReqParams: the add BA parameters as specified by
4654 the Device Interface
4655
4656 wdiAddBARspCb: callback for passing back the response of
4657 the add BA operation received from the device
4658
4659 pUserData: user data will be passed back with the
4660 callback
4661
4662 @see WDI_PostAssocReq
4663 @return Result of the function call
4664*/
4665WDI_Status
4666WDI_TriggerBAReq
4667(
4668 WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams,
4669 WDI_TriggerBARspCb wdiTriggerBARspCb,
4670 void* pUserData
4671)
4672{
4673 WDI_EventInfoType wdiEventData;
4674 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4675
4676 /*------------------------------------------------------------------------
4677 Sanity Check
4678 ------------------------------------------------------------------------*/
4679 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4680 {
4681 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4682 "WDI API call before module is initialized - Fail request");
4683
4684 return WDI_STATUS_E_NOT_ALLOWED;
4685 }
4686
4687 /*------------------------------------------------------------------------
4688 Fill in Event data and post to the Main FSM
4689 ------------------------------------------------------------------------*/
4690 wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ;
4691 wdiEventData.pEventData = pwdiTriggerBAReqParams;
4692 wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams);
4693 wdiEventData.pCBfnc = wdiTriggerBARspCb;
4694 wdiEventData.pUserData = pUserData;
4695
4696 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4697
4698}/*WDI_AddBAReq*/
4699
4700/**
4701 @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC
4702 wishes to update any of the Beacon parameters used by HW.
4703 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request
4704 message to the lower RIVA sub-system if DAL is in state
4705 STARTED.
4706
4707 In state BUSY this request will be queued. Request won't
4708 be allowed in any other state.
4709
4710 WDI_PostAssocReq must have been called.
4711
4712 @param wdiUpdateBeaconParams: the Beacon parameters as specified
4713 by the Device Interface
4714
4715 wdiUpdateBeaconParamsRspCb: callback for passing back the
4716 response of the start operation received from the device
4717
4718 pUserData: user data will be passed back with the
4719 callback
4720
4721 @see WDI_PostAssocReq
4722 @return Result of the function call
4723*/
4724WDI_Status
4725WDI_UpdateBeaconParamsReq
4726(
4727 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams,
4728 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb,
4729 void* pUserData
4730)
4731{
4732 WDI_EventInfoType wdiEventData;
4733 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4734
4735 /*------------------------------------------------------------------------
4736 Sanity Check
4737 ------------------------------------------------------------------------*/
4738 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4739 {
4740 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4741 "WDI API call before module is initialized - Fail request");
4742
4743 return WDI_STATUS_E_NOT_ALLOWED;
4744 }
4745
4746 /*------------------------------------------------------------------------
4747 Fill in Event data and post to the Main FSM
4748 ------------------------------------------------------------------------*/
4749 wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ;
4750 wdiEventData.pEventData = pwdiUpdateBeaconParams;
4751 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams);
4752 wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb;
4753 wdiEventData.pUserData = pUserData;
4754
4755 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4756
4757}/*WDI_UpdateBeaconParamsReq*/
4758
4759/**
4760 @brief WDI_SendBeaconParamsReq will be called when the upper MAC
4761 wishes to update the Beacon template used by HW.
4762 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request
4763 message to the lower RIVA sub-system if DAL is in state
4764 STARTED.
4765
4766 In state BUSY this request will be queued. Request won't
4767 be allowed in any other state.
4768
4769 WDI_PostAssocReq must have been called.
4770
4771 @param wdiSendBeaconParams: the Beacon parameters as specified
4772 by the Device Interface
4773
4774 wdiSendBeaconParamsRspCb: callback for passing back the
4775 response of the start operation received from the device
4776
4777 pUserData: user data will be passed back with the
4778 callback
4779
4780 @see WDI_PostAssocReq
4781 @return Result of the function call
4782*/
4783WDI_Status
4784WDI_SendBeaconParamsReq
4785(
4786 WDI_SendBeaconParamsType* pwdiSendBeaconParams,
4787 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb,
4788 void* pUserData
4789)
4790{
4791 WDI_EventInfoType wdiEventData;
4792 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4793
4794 /*------------------------------------------------------------------------
4795 Sanity Check
4796 ------------------------------------------------------------------------*/
4797 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4798 {
4799 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4800 "WDI API call before module is initialized - Fail request");
4801
4802 return WDI_STATUS_E_NOT_ALLOWED;
4803 }
4804
4805 /*------------------------------------------------------------------------
4806 Fill in Event data and post to the Main FSM
4807 ------------------------------------------------------------------------*/
4808 wdiEventData.wdiRequest = WDI_SND_BCON_REQ;
4809 wdiEventData.pEventData = pwdiSendBeaconParams;
4810 wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams);
4811 wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb;
4812 wdiEventData.pUserData = pUserData;
4813
4814 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4815
4816}/*WDI_SendBeaconParamsReq*/
4817
4818/**
4819 @brief WDI_UpdateProbeRspTemplateReq will be called when the
4820 upper MAC wants to update the probe response template to
4821 be transmitted as Soft AP
4822 Upon the call of this API the WLAN DAL will
4823 pack and send the probe rsp template message to the
4824 lower RIVA sub-system if DAL is in state STARTED.
4825
4826 In state BUSY this request will be queued. Request won't
4827 be allowed in any other state.
4828
4829
4830 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
4831 specified by the Device Interface
4832
4833 wdiSendBeaconParamsRspCb: callback for passing back the
4834 response of the Send Beacon Params operation received
4835 from the device
4836
4837 pUserData: user data will be passed back with the
4838 callback
4839
4840 @see WDI_AddBAReq
4841 @return Result of the function call
4842*/
4843
4844WDI_Status
4845WDI_UpdateProbeRspTemplateReq
4846(
4847 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams,
4848 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb,
4849 void* pUserData
4850)
4851{
4852 WDI_EventInfoType wdiEventData;
4853 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4854
4855 /*------------------------------------------------------------------------
4856 Sanity Check
4857 ------------------------------------------------------------------------*/
4858 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4859 {
4860 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4861 "WDI API call before module is initialized - Fail request");
4862
4863 return WDI_STATUS_E_NOT_ALLOWED;
4864 }
4865
4866 /*------------------------------------------------------------------------
4867 Fill in Event data and post to the Main FSM
4868 ------------------------------------------------------------------------*/
4869 wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ;
4870 wdiEventData.pEventData = pwdiUpdateProbeRspParams;
4871 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams);
4872 wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb;
4873 wdiEventData.pUserData = pUserData;
4874
4875 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4876
4877}/*WDI_UpdateProbeRspTemplateReq*/
4878
4879/**
4880 @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob
4881 to the NV memory.
4882
4883
4884 @param wdiNvDownloadReqParams: the NV Download parameters as specified by
4885 the Device Interface
4886
4887 wdiNvDownloadRspCb: callback for passing back the response of
4888 the NV Download operation received from the device
4889
4890 pUserData: user data will be passed back with the
4891 callback
4892
4893 @see WDI_PostAssocReq
4894 @return Result of the function call
4895*/
4896WDI_Status
4897WDI_NvDownloadReq
4898(
4899 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams,
4900 WDI_NvDownloadRspCb wdiNvDownloadRspCb,
4901 void* pUserData
4902)
4903{
4904 WDI_EventInfoType wdiEventData;
4905
4906 /*------------------------------------------------------------------------
4907 Sanity Check
4908 ------------------------------------------------------------------------*/
4909 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4910 {
4911 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4912 "WDI API call before module is initialized - Fail request");
4913
4914 return WDI_STATUS_E_NOT_ALLOWED;
4915 }
4916
4917 /*------------------------------------------------------------------------
4918 Fill in Event data and post to the Main FSM
4919 ------------------------------------------------------------------------*/
4920 wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ;
4921 wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams;
4922 wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams);
4923 wdiEventData.pCBfnc = wdiNvDownloadRspCb;
4924 wdiEventData.pUserData = pUserData;
4925
4926 return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData);
4927
4928}/*WDI_NVDownloadReq*/
4929
4930#ifdef WLAN_FEATURE_P2P
4931/**
4932 @brief WDI_SetP2PGONOAReq will be called when the
4933 upper MAC wants to send Notice of Absence
4934 Upon the call of this API the WLAN DAL will
4935 pack and send the probe rsp template message to the
4936 lower RIVA sub-system if DAL is in state STARTED.
4937
4938 In state BUSY this request will be queued. Request won't
4939 be allowed in any other state.
4940
4941
4942 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
4943 specified by the Device Interface
4944
4945 wdiSendBeaconParamsRspCb: callback for passing back the
4946 response of the Send Beacon Params operation received
4947 from the device
4948
4949 pUserData: user data will be passed back with the
4950 callback
4951
4952 @see WDI_AddBAReq
4953 @return Result of the function call
4954*/
4955WDI_Status
4956WDI_SetP2PGONOAReq
4957(
4958 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams,
4959 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb,
4960 void* pUserData
4961)
4962{
4963 WDI_EventInfoType wdiEventData;
4964 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4965
4966 /*------------------------------------------------------------------------
4967 Sanity Check
4968 ------------------------------------------------------------------------*/
4969 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4970 {
4971 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4972 "WDI API call before module is initialized - Fail request");
4973
4974 return WDI_STATUS_E_NOT_ALLOWED;
4975 }
4976
4977 /*------------------------------------------------------------------------
4978 Fill in Event data and post to the Main FSM
4979 ------------------------------------------------------------------------*/
4980 wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ;
4981 wdiEventData.pEventData = pwdiP2PGONOAReqParams;
4982 wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams);
4983 wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb;
4984 wdiEventData.pUserData = pUserData;
4985
4986 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4987
4988}/*WDI_SetP2PGONOAReq*/
4989#endif
4990
4991/**
4992 @brief WDI_AddSTASelfReq will be called when the
4993 UMAC wanted to add STA self while opening any new session
4994 In state BUSY this request will be queued. Request won't
4995 be allowed in any other state.
4996
4997
4998 @param pwdiAddSTASelfParams: the add sta self parameters as
4999 specified by the Device Interface
5000
5001 pUserData: user data will be passed back with the
5002 callback
5003
5004 @see
5005 @return Result of the function call
5006*/
5007WDI_Status
5008WDI_AddSTASelfReq
5009(
5010 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams,
5011 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb,
5012 void* pUserData
5013)
5014{
5015 WDI_EventInfoType wdiEventData;
5016 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5017
5018 /*------------------------------------------------------------------------
5019 Sanity Check
5020 ------------------------------------------------------------------------*/
5021 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5022 {
5023 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5024 "WDI API call before module is initialized - Fail request");
5025
5026 return WDI_STATUS_E_NOT_ALLOWED;
5027 }
5028
5029 /*------------------------------------------------------------------------
5030 Fill in Event data and post to the Main FSM
5031 ------------------------------------------------------------------------*/
5032 wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ;
5033 wdiEventData.pEventData = pwdiAddSTASelfReqParams;
5034 wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams);
5035 wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb;
5036 wdiEventData.pUserData = pUserData;
5037
5038 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5039
5040}/*WDI_AddSTASelfReq*/
5041
5042
5043#ifdef WLAN_FEATURE_VOWIFI_11R
5044/**
5045 @brief WDI_AggrAddTSReq will be called when the upper MAC to inform
5046 the device of a successful add TSpec negotiation. HW
5047 needs to receive the TSpec Info from the UMAC in order
5048 to configure properly the QoS data traffic. Upon the
5049 call of this API the WLAN DAL will pack and send a HAL
5050 Add TS request message to the lower RIVA sub-system if
5051 DAL is in state STARTED.
5052
5053 In state BUSY this request will be queued. Request won't
5054 be allowed in any other state.
5055
5056 WDI_PostAssocReq must have been called.
5057
5058 @param wdiAddTsReqParams: the add TS parameters as specified by
5059 the Device Interface
5060
5061 wdiAddTsRspCb: callback for passing back the response of
5062 the add TS operation received from the device
5063
5064 pUserData: user data will be passed back with the
5065 callback
5066
5067 @see WDI_PostAssocReq
5068 @return Result of the function call
5069*/
5070WDI_Status
5071WDI_AggrAddTSReq
5072(
5073 WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams,
5074 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb,
5075 void* pUserData
5076)
5077{
5078 WDI_EventInfoType wdiEventData;
5079 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5080
5081 /*------------------------------------------------------------------------
5082 Sanity Check
5083 ------------------------------------------------------------------------*/
5084 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5085 {
5086 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5087 "WDI API call before module is initialized - Fail request");
5088
5089 return WDI_STATUS_E_NOT_ALLOWED;
5090 }
5091
5092 /*------------------------------------------------------------------------
5093 Fill in Event data and post to the Main FSM
5094 ------------------------------------------------------------------------*/
5095 wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ;
5096 wdiEventData.pEventData = pwdiAggrAddTsReqParams;
5097 wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams);
5098 wdiEventData.pCBfnc = wdiAggrAddTsRspCb;
5099 wdiEventData.pUserData = pUserData;
5100
5101 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5102
5103}/*WDI_AggrAddTSReq*/
5104
5105#endif /* WLAN_FEATURE_VOWIFI_11R */
5106
5107#ifdef ANI_MANF_DIAG
5108/**
5109 @brief WDI_FTMCommandReq
5110 Post FTM Command Event
5111
5112 @param ftmCommandReq: FTM Command Body
5113 @param ftmCommandRspCb: FTM Response from HAL CB
5114 @param pUserData: Client Data
5115
5116 @see
5117 @return Result of the function call
5118*/
5119WDI_Status
5120WDI_FTMCommandReq
5121(
5122 WDI_FTMCommandReqType *ftmCommandReq,
5123 WDI_FTMCommandRspCb ftmCommandRspCb,
5124 void *pUserData
5125)
5126{
5127 WDI_EventInfoType wdiEventData;
5128 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5129
5130 /*------------------------------------------------------------------------
5131 Sanity Check
5132 ------------------------------------------------------------------------*/
5133 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5134 {
5135 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5136 "WDI API call before module is initialized - Fail request");
5137
5138 return WDI_STATUS_E_NOT_ALLOWED;
5139 }
5140
5141 /*------------------------------------------------------------------------
5142 Fill in Event data and post to the Main FSM
5143 ------------------------------------------------------------------------*/
5144 wdiEventData.wdiRequest = WDI_FTM_CMD_REQ;
5145 wdiEventData.pEventData = (void *)ftmCommandReq;
5146 wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32);
5147 wdiEventData.pCBfnc = ftmCommandRspCb;
5148 wdiEventData.pUserData = pUserData;
5149
5150 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5151}
5152#endif /* ANI_MANF_DIAG */
5153/**
5154 @brief WDI_HostResumeReq will be called
5155
5156 In state BUSY this request will be queued. Request won't
5157 be allowed in any other state.
5158
5159
5160 @param pwdiResumeReqParams: as specified by
5161 the Device Interface
5162
5163 wdiResumeReqRspCb: callback for passing back the response of
5164 the Resume Req received from the device
5165
5166 pUserData: user data will be passed back with the
5167 callback
5168
5169 @see
5170 @return Result of the function call
5171*/
5172WDI_Status
5173WDI_HostResumeReq
5174(
5175 WDI_ResumeParamsType* pwdiResumeReqParams,
5176 WDI_HostResumeEventRspCb wdiResumeReqRspCb,
5177 void* pUserData
5178)
5179{
5180 WDI_EventInfoType wdiEventData;
5181 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5182
5183 /*------------------------------------------------------------------------
5184 Sanity Check
5185 ------------------------------------------------------------------------*/
5186 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5187 {
5188 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5189 "WDI API call before module is initialized - Fail request");
5190
5191 return WDI_STATUS_E_NOT_ALLOWED;
5192 }
5193
5194 /*------------------------------------------------------------------------
5195 Fill in Event data and post to the Main FSM
5196 ------------------------------------------------------------------------*/
5197 wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ;
5198 wdiEventData.pEventData = pwdiResumeReqParams;
5199 wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams);
5200 wdiEventData.pCBfnc = wdiResumeReqRspCb;
5201 wdiEventData.pUserData = pUserData;
5202
5203 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5204
5205}/*WDI_HostResumeReq*/
5206
5207/**
5208 @brief WDI_DelSTASelfReq will be called
5209
5210 In state BUSY this request will be queued. Request won't
5211 be allowed in any other state.
5212
5213
5214 @param pwdiDelStaSelfReqParams: as specified by
5215 the Device Interface
5216
5217 wdiDelStaSelfRspCb: callback for passing back the response of
5218 the add TS operation received from the device
5219
5220 pUserData: user data will be passed back with the
5221 callback
5222
5223 @see WDI_PostAssocReq
5224 @return Result of the function call
5225*/
5226WDI_Status
5227WDI_DelSTASelfReq
5228(
5229 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams,
5230 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb,
5231 void* pUserData
5232)
5233{
5234 WDI_EventInfoType wdiEventData;
5235 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5236
5237 /*------------------------------------------------------------------------
5238 Sanity Check
5239 ------------------------------------------------------------------------*/
5240 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5241 {
5242 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5243 "WDI API call before module is initialized - Fail request");
5244
5245 return WDI_STATUS_E_NOT_ALLOWED;
5246 }
5247
5248 /*------------------------------------------------------------------------
5249 Fill in Event data and post to the Main FSM
5250 ------------------------------------------------------------------------*/
5251 wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ;
5252 wdiEventData.pEventData = pwdiDelStaSelfReqParams;
5253 wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams);
5254 wdiEventData.pCBfnc = wdiDelStaSelfRspCb;
5255 wdiEventData.pUserData = pUserData;
5256
5257 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5258
5259}/*WDI_AggrAddTSReq*/
5260
5261/**
5262 @brief WDI_SetTxPerTrackingReq will be called when the upper MAC
5263 wants to set the Tx Per Tracking configurations.
5264 Upon the call of this API the WLAN DAL will pack
5265 and send a HAL Set Tx Per Tracking request message to the
5266 lower RIVA sub-system if DAL is in state STARTED.
5267
5268 In state BUSY this request will be queued. Request won't
5269 be allowed in any other state.
5270
5271 @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as
5272 specified by the Device Interface
5273
5274 pwdiSetTxPerTrackingRspCb: callback for passing back the
5275 response of the set Tx PER Tracking configurations operation received
5276 from the device
5277
5278 pUserData: user data will be passed back with the
5279 callback
5280
5281 @return Result of the function call
5282*/
5283WDI_Status
5284WDI_SetTxPerTrackingReq
5285(
5286 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams,
5287 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb,
5288 void* pUserData
5289)
5290{
5291 WDI_EventInfoType wdiEventData;
5292 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5293
5294 /*------------------------------------------------------------------------
5295 Sanity Check
5296 ------------------------------------------------------------------------*/
5297 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5298 {
5299 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5300 "WDI API call before module is initialized - Fail request");
5301
5302 return WDI_STATUS_E_NOT_ALLOWED;
5303 }
5304
5305 /*------------------------------------------------------------------------
5306 Fill in Event data and post to the Main FSM
5307 ------------------------------------------------------------------------*/
5308 wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ;
5309 wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams;
5310 wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams);
5311 wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb;
5312 wdiEventData.pUserData = pUserData;
5313
5314 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5315
5316}/*WDI_SetTxPerTrackingReq*/
5317
5318/**
5319 @brief WDI_SetTmLevelReq
5320 If HW Thermal condition changed, driver should react based on new
5321 HW thermal condition.
5322
5323 @param pwdiSetTmLevelReq: New thermal condition information
5324
5325 pwdiSetTmLevelRspCb: callback
5326
5327 usrData: user data will be passed back with the
5328 callback
5329
5330 @return Result of the function call
5331*/
5332WDI_Status
5333WDI_SetTmLevelReq
5334(
5335 WDI_SetTmLevelReqType *pwdiSetTmLevelReq,
5336 WDI_SetTmLevelCb pwdiSetTmLevelRspCb,
5337 void *usrData
5338)
5339{
5340 WDI_EventInfoType wdiEventData;
5341 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5342
5343 /*------------------------------------------------------------------------
5344 Sanity Check
5345 ------------------------------------------------------------------------*/
5346 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5347 {
5348 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5349 "WDI API call before module is initialized - Fail request");
5350
5351 return WDI_STATUS_E_NOT_ALLOWED;
5352 }
5353
5354 /*------------------------------------------------------------------------
5355 Fill in Event data and post to the Main FSM
5356 ------------------------------------------------------------------------*/
5357 wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ;
5358 wdiEventData.pEventData = pwdiSetTmLevelReq;
5359 wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq);
5360 wdiEventData.pCBfnc = pwdiSetTmLevelRspCb;
5361 wdiEventData.pUserData = usrData;
5362
5363 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5364}
5365
5366/**
5367 @brief WDI_HostSuspendInd
5368
5369 Suspend Indication from the upper layer will be sent
5370 down to HAL
5371
5372 @param WDI_SuspendResumeIndParamsType
5373
5374 @see
5375
5376 @return Status of the request
5377*/
5378WDI_Status
5379WDI_HostSuspendInd
5380(
5381 WDI_SuspendParamsType* pwdiSuspendIndParams
5382)
5383{
5384
5385 WDI_EventInfoType wdiEventData;
5386 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5387
5388 /*------------------------------------------------------------------------
5389 Sanity Check
5390 ------------------------------------------------------------------------*/
5391 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5392 {
5393 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5394 "WDI API call before module is initialized - Fail request");
5395
5396 return WDI_STATUS_E_NOT_ALLOWED;
5397 }
5398
5399 /*------------------------------------------------------------------------
5400 Fill in Event data and post to the Main FSM
5401 ------------------------------------------------------------------------*/
5402 wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND;
5403 wdiEventData.pEventData = pwdiSuspendIndParams;
5404 wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams);
5405 wdiEventData.pCBfnc = NULL;
5406 wdiEventData.pUserData = NULL;
5407
5408 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5409
5410}/*WDI_HostSuspendInd*/
5411
5412/**
5413 @brief WDI_HALDumpCmdReq
5414 Post HAL DUMP Command Event
5415
5416 @param halDumpCmdReqParams: Hal Dump Command Body
5417 @param halDumpCmdRspCb: HAL DUMP Response from HAL CB
5418 @param pUserData: Client Data
5419
5420 @see
5421 @return Result of the function call
5422*/
5423WDI_Status WDI_HALDumpCmdReq
5424(
5425 WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams,
5426 WDI_HALDumpCmdRspCb halDumpCmdRspCb,
5427 void *pUserData
5428)
5429{
5430 WDI_EventInfoType wdiEventData;
5431 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5432
5433 /*------------------------------------------------------------------------
5434 Sanity Check
5435 ------------------------------------------------------------------------*/
5436 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5437 {
5438 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5439 "WDI API call before module is initialized - Fail request");
5440
5441 return WDI_STATUS_E_NOT_ALLOWED;
5442 }
5443
5444 /*------------------------------------------------------------------------
5445 Fill in Event data and post to the Main FSM
5446 ------------------------------------------------------------------------*/
5447 wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ;
5448 wdiEventData.pEventData = (void *)halDumpCmdReqParams;
5449 wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType);
5450 wdiEventData.pCBfnc = halDumpCmdRspCb;
5451 wdiEventData.pUserData = pUserData;
5452
5453 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5454}
5455
5456/*============================================================================
5457
5458 DAL Control Path Main FSM Function Implementation
5459
5460 ============================================================================*/
5461
5462/**
5463 @brief Main FSM Start function for all states except BUSY
5464
5465
5466 @param pWDICtx: pointer to the WLAN DAL context
5467 wdiEV: event posted to the main DAL FSM
5468 pEventData: pointer to the event information
5469 structure
5470
5471 @see
5472 @return Result of the function call
5473*/
5474WDI_Status
5475WDI_PostMainEvent
5476(
5477 WDI_ControlBlockType* pWDICtx,
5478 WDI_MainEventType wdiEV,
5479 WDI_EventInfoType* pEventData
5480
5481)
5482{
5483 WDI_Status wdiStatus;
5484 WDI_MainFuncType pfnWDIMainEvHdlr;
5485 WDI_MainStateType wdiOldState;
5486 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5487
5488 /*-------------------------------------------------------------------------
5489 Sanity check
5490 -------------------------------------------------------------------------*/
5491 if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) ||
5492 ( wdiEV >= WDI_MAX_EVENT ))
5493 {
5494 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5495 "Invalid state or event in Post Main Ev function ST: %d EV: %d",
5496 pWDICtx->uGlobalState, wdiEV);
5497 return WDI_STATUS_E_NOT_ALLOWED;
5498 }
5499
5500 /*Access to the global state must be locked */
5501 wpalMutexAcquire(&pWDICtx->wptMutex);
5502
5503 /*Fetch event handler for state*/
5504 pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV];
5505
5506 wdiOldState = pWDICtx->uGlobalState;
5507
5508 /*
5509 --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a
5510 response comes from CCPU for the request sent by host:
5511 the WDI global state will be in WDI_BUSY_ST already, so do not set it to BUSY again.
5512 This state will be set to WDI_STARTED_ST in WDI_MainRsp, if it is a expected response.
5513 --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the
5514 CCPU:
5515 don't change the state */
5516 if ( WDI_RESPONSE_EVENT != wdiEV)
5517 {
5518 /*Transition to BUSY State - the request is now being processed by the FSM,
5519 if the request fails we shall transition back to the old state, if not
5520 the request will manage its own state transition*/
5521 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
5522 }
5523 /* If the state function associated with the EV is NULL it means that this
5524 event is not allowed in this state*/
5525 if ( NULL != pfnWDIMainEvHdlr )
5526 {
5527 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5528 "Posting event %d in state: %d to the Main FSM",
5529 wdiEV, wdiOldState);
5530 wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData);
5531 }
5532 else
5533 {
5534 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5535 "Unexpected event %d in state: %d",
5536 wdiEV, wdiOldState);
5537 wdiStatus = WDI_STATUS_E_NOT_ALLOWED;
5538 }
5539
5540 /* If a request handles itself well it will end up in a success or in a
5541 pending
5542 Success - means that the request was processed and the proper state
5543 transition already occurred or will occur when the resp is received
5544 - NO other state transition or dequeueing is required
5545
5546 Pending - means the request could not be processed at this moment in time
5547 because the FSM was already busy so no state transition or dequeueing
5548 is necessary anymore
5549
5550 Success for synchronous case means that the transition may occur and
5551 processing of pending requests may continue - so it should go through
5552 and restores the state and continue processing queued requests*/
5553 if (( WDI_STATUS_SUCCESS != wdiStatus )&&
5554 ( WDI_STATUS_PENDING != wdiStatus ))
5555 {
5556 if ( WDI_RESPONSE_EVENT != wdiEV)
5557 {
5558 /*The request has failed or could not be processed - transition back to
5559 the old state - check to see if anything was queued and try to execute
5560 The dequeue logic should post a message to a thread and return - no
5561 actual processing can occur */
5562 WDI_STATE_TRANSITION( pWDICtx, wdiOldState);
5563 }
5564 WDI_DequeuePendingReq(pWDICtx);
5565
5566 }
5567
5568 /* we have completed processing the event */
5569 wpalMutexRelease(&pWDICtx->wptMutex);
5570
5571 return wdiStatus;
5572
5573}/*WDI_PostMainEvent*/
5574
5575
5576/*--------------------------------------------------------------------------
5577 INIT State Functions
5578--------------------------------------------------------------------------*/
5579/**
5580 @brief Main FSM Start function for all states except BUSY
5581
5582
5583 @param pWDICtx: pointer to the WLAN DAL context
5584 pEventData: pointer to the event information structure
5585
5586 @see
5587 @return Result of the function call
5588*/
5589WDI_Status
5590WDI_MainStart
5591(
5592 WDI_ControlBlockType* pWDICtx,
5593 WDI_EventInfoType* pEventData
5594)
5595{
5596
5597 /*--------------------------------------------------------------------
5598 Sanity Check
5599 ----------------------------------------------------------------------*/
5600 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5601 {
5602 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5603 "Invalid parameters on Main Start %x %x",
5604 pWDICtx, pEventData);
5605 return WDI_STATUS_E_FAILURE;
5606 }
5607
5608 wpalMutexAcquire(&pWDICtx->wptMutex);
5609
5610 /*--------------------------------------------------------------------
5611 Check if the Control Transport has been opened
5612 ----------------------------------------------------------------------*/
5613 if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened )
5614 {
5615 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5616 "Control Transport not yet Open - queueing the request");
5617
5618 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
5619 WDI_QueuePendingReq( pWDICtx, pEventData);
5620
5621 wpalMutexRelease(&pWDICtx->wptMutex);
5622 return WDI_STATUS_PENDING;
5623 }
5624
5625 wpalMutexRelease(&pWDICtx->wptMutex);
5626
5627 /*Return Success*/
5628 return WDI_ProcessRequest( pWDICtx, pEventData );
5629
5630}/*WDI_MainStart*/
5631
5632/**
5633 @brief Main FSM Response function for state INIT
5634
5635
5636 @param pWDICtx: pointer to the WLAN DAL context
5637 pEventData: pointer to the event information structure
5638
5639 @see
5640 @return Result of the function call
5641*/
5642WDI_Status
5643WDI_MainRspInit
5644(
5645 WDI_ControlBlockType* pWDICtx,
5646 WDI_EventInfoType* pEventData
5647)
5648{
5649 /*------------------------------------------------------------------------
5650 Not expecting a response from the device before it is started
5651 ------------------------------------------------------------------------*/
5652 WDI_ASSERT(0);
5653
5654 /*Return Success*/
5655 return WDI_STATUS_E_NOT_ALLOWED;
5656}/* WDI_MainRspInit */
5657
5658/**
5659 @brief Main FSM Close function for all states except BUSY
5660
5661
5662 @param pWDICtx: pointer to the WLAN DAL context
5663 pEventData: pointer to the event information structure
5664
5665 @see
5666 @return Result of the function call
5667*/
5668WDI_Status
5669WDI_MainClose
5670(
5671 WDI_ControlBlockType* pWDICtx,
5672 WDI_EventInfoType* pEventData
5673)
5674{
5675
5676 /*--------------------------------------------------------------------
5677 Sanity Check
5678 ----------------------------------------------------------------------*/
5679 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5680 {
5681 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5682 "Invalid parameters on Main Close %x %x",
5683 pWDICtx, pEventData);
5684 return WDI_STATUS_E_FAILURE;
5685 }
5686
5687 /*Return Success*/
5688 return WDI_ProcessRequest( pWDICtx, pEventData );
5689
5690}/*WDI_MainClose*/
5691/*--------------------------------------------------------------------------
5692 STARTED State Functions
5693--------------------------------------------------------------------------*/
5694/**
5695 @brief Main FSM Start function for state STARTED
5696
5697
5698 @param pWDICtx: pointer to the WLAN DAL context
5699 pEventData: pointer to the event information structure
5700
5701 @see
5702 @return Result of the function call
5703*/
5704WDI_Status
5705WDI_MainStartStarted
5706(
5707 WDI_ControlBlockType* pWDICtx,
5708 WDI_EventInfoType* pEventData
5709)
5710{
5711 WDI_StartRspCb wdiStartRspCb = NULL;
5712 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5713
5714 /*--------------------------------------------------------------------
5715 Sanity Check
5716 ----------------------------------------------------------------------*/
5717 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5718 {
5719 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5720 "Invalid parameters on Main Start %x %x",
5721 pWDICtx, pEventData);
5722 return WDI_STATUS_E_FAILURE;
5723 }
5724
5725 /*--------------------------------------------------------------------
5726 Nothing to do transport was already started
5727 ----------------------------------------------------------------------*/
5728 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5729 "Received start while transport was already started - nothing to do");
5730
5731 wpalMutexAcquire(&pWDICtx->wptMutex);
5732
5733 /*Transition back to started because the post function transitioned us to
5734 busy*/
5735 WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST);
5736
5737 /*Check to see if any request is pending*/
5738 WDI_DequeuePendingReq(pWDICtx);
5739
5740 wpalMutexRelease(&pWDICtx->wptMutex);
5741
5742 /*Tell UMAC Success*/
5743 wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc;
5744
5745 /*Notify UMAC*/
5746 wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData);
5747
5748 /*Return Success*/
5749 return WDI_STATUS_SUCCESS;
5750
5751}/*WDI_MainStartStarted*/
5752
5753/**
5754 @brief Main FSM Stop function for state STARTED
5755
5756
5757 @param pWDICtx: pointer to the WLAN DAL context
5758 pEventData: pointer to the event information structure
5759
5760 @see
5761 @return Result of the function call
5762*/
5763WDI_Status
5764WDI_MainStopStarted
5765(
5766 WDI_ControlBlockType* pWDICtx,
5767 WDI_EventInfoType* pEventData
5768)
5769{
5770 /*--------------------------------------------------------------------
5771 Sanity Check
5772 ----------------------------------------------------------------------*/
5773 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5774 {
5775 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5776 "Invalid parameters on Main Start %x %x",
5777 pWDICtx, pEventData);
5778 return WDI_STATUS_E_FAILURE;
5779 }
5780
5781 /*State at this point is BUSY - because we enter this state before posting
5782 an event to the FSM in order to prevent potential race conditions*/
5783
5784 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
5785 "Processing stop request in FSM");
5786
5787 /*Return Success*/
5788 return WDI_ProcessRequest( pWDICtx, pEventData );
5789
5790}/*WDI_MainStopStarted*/
5791/**
5792 @brief Main FSM Request function for state started
5793
5794
5795 @param pWDICtx: pointer to the WLAN DAL context
5796 pEventData: pointer to the event information structure
5797
5798 @see
5799 @return Result of the function call
5800*/
5801WDI_Status
5802WDI_MainReqStarted
5803(
5804 WDI_ControlBlockType* pWDICtx,
5805 WDI_EventInfoType* pEventData
5806)
5807{
5808
5809 /*--------------------------------------------------------------------
5810 Sanity Check
5811 ----------------------------------------------------------------------*/
5812 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5813 {
5814 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5815 "Invalid parameters on Main Req Started %x %x",
5816 pWDICtx, pEventData);
5817 return WDI_STATUS_E_FAILURE;
5818 }
5819
5820 /*State at this point is BUSY - because we enter this state before posting
5821 an event to the FSM in order to prevent potential race conditions*/
5822
5823 /*Return Success*/
5824 return WDI_ProcessRequest( pWDICtx, pEventData );
5825
5826}/*WDI_MainReqStarted*/
5827
5828/**
5829 @brief Main FSM Response function for all states except INIT
5830
5831
5832 @param pWDICtx: pointer to the WLAN DAL context
5833 pEventData: pointer to the event information structure
5834
5835 @see
5836 @return Result of the function call
5837*/
5838WDI_Status
5839WDI_MainRsp
5840(
5841 WDI_ControlBlockType* pWDICtx,
5842 WDI_EventInfoType* pEventData
5843)
5844{
5845 WDI_Status wdiStatus;
5846 wpt_boolean expectedResponse;
5847
5848 /*--------------------------------------------------------------------
5849 Sanity Check
5850 ----------------------------------------------------------------------*/
5851 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5852 {
5853 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5854 "Invalid parameters on Main Response %x %x",
5855 pWDICtx, pEventData);
5856 return WDI_STATUS_E_FAILURE;
5857 }
5858
5859 if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse )
5860 {
5861 /* we received an expected response */
5862 expectedResponse = eWLAN_PAL_TRUE;
5863
5864 /*We expect that we will transition to started after this processing*/
5865 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
5866
5867 /* we are no longer expecting a response */
5868 pWDICtx->wdiExpectedResponse = WDI_MAX_RESP;
5869 }
5870 else
5871 {
5872 /* we received an indication or unexpected response */
5873 expectedResponse = eWLAN_PAL_FALSE;
5874 /* for indications no need to update state from what it is right
5875 now, unless it explicitly does it in the indication handler (say
5876 for device failure ind) */
5877 pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState;
5878 }
5879
5880 /*Process the response and indication */
5881 wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData );
5882
5883 /*Lock the CB as we are about to do a state transition*/
5884 wpalMutexAcquire(&pWDICtx->wptMutex);
5885
5886 /*Transition to the expected state after the response processing
5887 - this should always be started state with the following exceptions:
5888 1. processing of a failed start response
5889 2. device failure detected while processing response
5890 3. stop response received*/
5891 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
5892
5893 /*Dequeue request that may have been queued while we were waiting for the
5894 response */
5895 if ( expectedResponse )
5896 {
5897 WDI_DequeuePendingReq(pWDICtx);
5898 }
5899
5900 wpalMutexRelease(&pWDICtx->wptMutex);
5901
5902 /*Return Success - always */
5903 return WDI_STATUS_SUCCESS;
5904
5905}/*WDI_MainRsp*/
5906
5907/*--------------------------------------------------------------------------
5908 STOPPED State Functions
5909--------------------------------------------------------------------------*/
5910/**
5911 @brief Main FSM Stop function for state STOPPED
5912
5913
5914 @param pWDICtx: pointer to the WLAN DAL context
5915 pEventData: pointer to the event information structure
5916
5917 @see
5918 @return Result of the function call
5919*/
5920WDI_Status
5921WDI_MainStopStopped
5922(
5923 WDI_ControlBlockType* pWDICtx,
5924 WDI_EventInfoType* pEventData
5925)
5926{
5927 /*--------------------------------------------------------------------
5928 Sanity Check
5929 ----------------------------------------------------------------------*/
5930 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5931 {
5932 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5933 "Invalid parameters on Main Stop Stopped %x %x",
5934 pWDICtx, pEventData);
5935 return WDI_STATUS_E_FAILURE;
5936 }
5937
5938 /*We should normally not get a STOP request if we are already stopped
5939 since we should normally be stopped by the UMAC. However in some
5940 error situations we put ourselves in the stopped state without the
5941 UMAC knowing, so when we get a STOP request in this state we still
5942 process it since we need to clean up the underlying state */
5943 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5944 "Processing stop request while stopped in FSM");
5945
5946 /*Return Success*/
5947 return WDI_ProcessRequest( pWDICtx, pEventData );
5948
5949}/*WDI_MainStopStopped*/
5950
5951/*--------------------------------------------------------------------------
5952 BUSY State Functions
5953--------------------------------------------------------------------------*/
5954/**
5955 @brief Main FSM Start function for state BUSY
5956
5957
5958 @param pWDICtx: pointer to the WLAN DAL context
5959 pEventData: pointer to the event information structure
5960
5961 @see
5962 @return Result of the function call
5963*/
5964WDI_Status
5965WDI_MainStartBusy
5966(
5967 WDI_ControlBlockType* pWDICtx,
5968 WDI_EventInfoType* pEventData
5969)
5970{
5971 /*--------------------------------------------------------------------
5972 Sanity Check
5973 ----------------------------------------------------------------------*/
5974 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5975 {
5976 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5977 "Invalid parameters on Main Start in BUSY %x %x",
5978 pWDICtx, pEventData);
5979 return WDI_STATUS_E_FAILURE;
5980 }
5981
5982 /*--------------------------------------------------------------------
5983 Check if the Control Transport has been opened
5984 ----------------------------------------------------------------------*/
5985 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5986 "WDI Busy state - queue start request");
5987
5988 /*Queue the start request*/
5989 WDI_QueuePendingReq( pWDICtx, pEventData);
5990
5991 /*Return Success*/
5992 return WDI_STATUS_PENDING;
5993}/*WDI_MainStartBusy*/
5994
5995/**
5996 @brief Main FSM Stop function for state BUSY
5997
5998
5999 @param pWDICtx: pointer to the WLAN DAL context
6000 pEventData: pointer to the event information structure
6001
6002 @see
6003 @return Result of the function call
6004*/
6005WDI_Status
6006WDI_MainStopBusy
6007(
6008 WDI_ControlBlockType* pWDICtx,
6009 WDI_EventInfoType* pEventData
6010)
6011{
6012 /*--------------------------------------------------------------------
6013 Sanity Check
6014 ----------------------------------------------------------------------*/
6015 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6016 {
6017 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6018 "Invalid parameters on Main Stop in BUSY %x %x",
6019 pWDICtx, pEventData);
6020 return WDI_STATUS_E_FAILURE;
6021 }
6022
6023 /*--------------------------------------------------------------------
6024 Check if the Control Transport has been opened
6025 ----------------------------------------------------------------------*/
6026 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6027 "WDI Busy state - queue stop request");
6028
6029 WDI_QueuePendingReq( pWDICtx, pEventData);
6030 return WDI_STATUS_PENDING;
6031
6032}/*WDI_MainStopBusy*/
6033
6034/**
6035 @brief Main FSM Request function for state BUSY
6036
6037
6038 @param pWDICtx: pointer to the WLAN DAL context
6039 pEventData: pointer to the event information structure
6040
6041 @see
6042 @return Result of the function call
6043*/
6044WDI_Status
6045WDI_MainReqBusy
6046(
6047 WDI_ControlBlockType* pWDICtx,
6048 WDI_EventInfoType* pEventData
6049)
6050{
6051 /*--------------------------------------------------------------------
6052 Sanity Check
6053 ----------------------------------------------------------------------*/
6054 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6055 {
6056 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6057 "Invalid parameters on Main Request in BUSY %x %x",
6058 pWDICtx, pEventData);
6059 return WDI_STATUS_E_FAILURE;
6060 }
6061
6062 /*--------------------------------------------------------------------
6063 Check if the Control Transport has been opened
6064 ----------------------------------------------------------------------*/
6065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6066 "WDI Busy state - queue request %d because waiting for response %d",
6067 pEventData->wdiRequest, pWDICtx->wdiExpectedResponse);
6068
6069 WDI_QueuePendingReq( pWDICtx, pEventData);
6070 return WDI_STATUS_PENDING;
6071
6072}/*WDI_MainReqBusy*/
6073/**
6074 @brief Main FSM Close function for state BUSY
6075
6076
6077 @param pWDICtx: pointer to the WLAN DAL context
6078 pEventData: pointer to the event information structure
6079
6080 @see
6081 @return Result of the function call
6082*/
6083WDI_Status
6084WDI_MainCloseBusy
6085(
6086 WDI_ControlBlockType* pWDICtx,
6087 WDI_EventInfoType* pEventData
6088)
6089{
6090 /*--------------------------------------------------------------------
6091 Sanity Check
6092 ----------------------------------------------------------------------*/
6093 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6094 {
6095 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6096 "Invalid parameters on Main Close in BUSY %x %x",
6097 pWDICtx, pEventData);
6098 return WDI_STATUS_E_FAILURE;
6099 }
6100
6101 /*--------------------------------------------------------------------
6102 Check if the Control Transport has been opened
6103 ----------------------------------------------------------------------*/
6104 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6105 "WDI Busy state - queue close request");
6106
6107 WDI_QueuePendingReq( pWDICtx, pEventData);
6108 return WDI_STATUS_PENDING;
6109
6110}/*WDI_MainCloseBusy*/
6111
6112/**
6113 @brief Main FSM Shutdown function for INIT & STARTED states
6114
6115
6116 @param pWDICtx: pointer to the WLAN DAL context
6117 pEventData: pointer to the event information structure
6118
6119 @see
6120 @return Result of the function call
6121*/
6122WDI_Status
6123WDI_MainShutdown
6124(
6125 WDI_ControlBlockType* pWDICtx,
6126 WDI_EventInfoType* pEventData
6127)
6128{
6129 /*--------------------------------------------------------------------
6130 Sanity Check
6131 ----------------------------------------------------------------------*/
6132 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6133 {
6134 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6135 "Invalid parameters on Main Start %x %x",
6136 pWDICtx, pEventData);
6137 return WDI_STATUS_E_FAILURE;
6138 }
6139
6140 /*State at this point is BUSY - because we enter this state before posting
6141 an event to the FSM in order to prevent potential race conditions*/
6142
6143 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6144 "Processing shutdown request in FSM");
6145
6146 /*Return Success*/
6147 return WDI_ProcessRequest( pWDICtx, pEventData );
6148
6149}/*WDI_MainShutdown*/
6150
6151/**
6152 @brief Main FSM Shutdown function for BUSY state
6153
6154
6155 @param pWDICtx: pointer to the WLAN DAL context
6156 pEventData: pointer to the event information structure
6157
6158 @see
6159 @return Result of the function call
6160*/
6161WDI_Status
6162WDI_MainShutdownBusy
6163(
6164 WDI_ControlBlockType* pWDICtx,
6165 WDI_EventInfoType* pEventData
6166)
6167{
6168 /*--------------------------------------------------------------------
6169 Sanity Check
6170 ----------------------------------------------------------------------*/
6171 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6172 {
6173 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6174 "Invalid parameters on Main Start %x %x",
6175 pWDICtx, pEventData);
6176 return WDI_STATUS_E_FAILURE;
6177 }
6178
6179 /* If you are waiting for a HAL response at this stage, you are not
6180 * going to get it. Riva is already shutdown/crashed.
6181 */
6182 wpalTimerStop(&gWDICb.wptResponseTimer);
6183
6184 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6185 "Processing shutdown request in FSM: Busy state ");
6186
6187 return WDI_ProcessRequest( pWDICtx, pEventData );
6188
6189}/*WDI_MainShutdownBusy*/
6190
6191
6192/*=======================================================================
6193
6194 WLAN DAL Control Path Main Processing Functions
6195
6196*=======================================================================*/
6197
6198/*========================================================================
6199 Main DAL Control Path Request Processing API
6200========================================================================*/
6201/**
6202 @brief Process Start Request function (called when Main FSM
6203 allows it)
6204
6205 @param pWDICtx: pointer to the WLAN DAL context
6206 pEventData: pointer to the event information structure
6207
6208 @see
6209 @return Result of the function call
6210*/
6211WDI_Status
6212WDI_ProcessStartReq
6213(
6214 WDI_ControlBlockType* pWDICtx,
6215 WDI_EventInfoType* pEventData
6216)
6217{
6218 WDI_StartReqParamsType* pwdiStartParams = NULL;
6219 WDI_StartRspCb wdiStartRspCb = NULL;
6220 wpt_uint8* pSendBuffer = NULL;
6221 wpt_uint16 usDataOffset = 0;
6222 wpt_uint16 usSendSize = 0;
6223
6224 tHalMacStartReqMsg halStartReq;
6225 wpt_uint16 usLen = 0;
6226 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6227
6228 /*-------------------------------------------------------------------------
6229 Sanity check
6230 -------------------------------------------------------------------------*/
6231 if (( NULL == pEventData ) ||
6232 ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) ||
6233 ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc)))
6234 {
6235 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6236 "%s: Invalid parameters", __FUNCTION__);
6237 WDI_ASSERT(0);
6238 return WDI_STATUS_E_FAILURE;
6239 }
6240
6241 /*-----------------------------------------------------------------------
6242 Get message buffer
6243 -----------------------------------------------------------------------*/
6244 usLen = sizeof(halStartReq.startReqParams) +
6245 pwdiStartParams->usConfigBufferLen;
6246
6247 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ,
6248 usLen,
6249 &pSendBuffer, &usDataOffset, &usSendSize))||
6250 ( usSendSize < (usDataOffset + usLen )))
6251 {
6252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6253 "Unable to get send buffer in start req %x %x %x",
6254 pEventData, pwdiStartParams, wdiStartRspCb);
6255 WDI_ASSERT(0);
6256 return WDI_STATUS_E_FAILURE;
6257 }
6258
6259 /*-----------------------------------------------------------------------
6260 Fill in the message
6261 -----------------------------------------------------------------------*/
6262 halStartReq.startReqParams.driverType =
6263 WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType);
6264
6265 halStartReq.startReqParams.uConfigBufferLen =
6266 pwdiStartParams->usConfigBufferLen;
6267 wpalMemoryCopy( pSendBuffer+usDataOffset,
6268 &halStartReq.startReqParams,
6269 sizeof(halStartReq.startReqParams));
6270
6271 usDataOffset += sizeof(halStartReq.startReqParams);
6272 wpalMemoryCopy( pSendBuffer+usDataOffset,
6273 pwdiStartParams->pConfigBuffer,
6274 pwdiStartParams->usConfigBufferLen);
6275
6276 pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB;
6277 pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData;
6278
6279 /*Save Low Level Ind CB and associated user data - it will be used further
6280 on when an indication is coming from the lower MAC*/
6281 pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB;
6282 pWDICtx->pIndUserData = pwdiStartParams->pIndUserData;
6283
6284 pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled;
6285 /*-------------------------------------------------------------------------
6286 Send Start Request to HAL
6287 -------------------------------------------------------------------------*/
6288 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6289 wdiStartRspCb, pEventData->pUserData, WDI_START_RESP);
6290
6291
6292}/*WDI_ProcessStartReq*/
6293
6294/**
6295 @brief Process Stop Request function (called when Main FSM
6296 allows it)
6297
6298 @param pWDICtx: pointer to the WLAN DAL context
6299 pEventData: pointer to the event information structure
6300
6301 @see
6302 @return Result of the function call
6303*/
6304WDI_Status
6305WDI_ProcessStopReq
6306(
6307 WDI_ControlBlockType* pWDICtx,
6308 WDI_EventInfoType* pEventData
6309)
6310{
6311 WDI_StopReqParamsType* pwdiStopParams = NULL;
6312 WDI_StopRspCb wdiStopRspCb = NULL;
6313 wpt_uint8* pSendBuffer = NULL;
6314 wpt_uint16 usDataOffset = 0;
6315 wpt_uint16 usSendSize = 0;
Jeff Johnson43971f52012-07-17 12:26:56 -07006316 wpt_status status;
Jeff Johnson295189b2012-06-20 16:38:30 -07006317 tHalMacStopReqMsg halStopReq;
6318 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6319
6320 /*-------------------------------------------------------------------------
6321 Sanity check
6322 -------------------------------------------------------------------------*/
6323 if (( NULL == pEventData ) ||
6324 ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) ||
6325 ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc)))
6326 {
6327 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6328 "%s: Invalid parameters", __FUNCTION__);
6329 WDI_ASSERT(0);
6330 return WDI_STATUS_E_FAILURE;
6331 }
6332
6333 /*-----------------------------------------------------------------------
6334 Get message buffer
6335 -----------------------------------------------------------------------*/
6336 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ,
6337 sizeof(halStopReq.stopReqParams),
6338 &pSendBuffer, &usDataOffset, &usSendSize))||
6339 ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) )))
6340 {
6341 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6342 "Unable to get send buffer in stop req %x %x %x",
6343 pEventData, pwdiStopParams, wdiStopRspCb);
6344 WDI_ASSERT(0);
6345 return WDI_STATUS_E_FAILURE;
6346 }
6347
6348 /*-----------------------------------------------------------------------
6349 Fill in the message
6350 -----------------------------------------------------------------------*/
6351 halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON(
6352 pwdiStopParams->wdiStopReason);
6353
6354 wpalMemoryCopy( pSendBuffer+usDataOffset,
6355 &halStopReq.stopReqParams,
6356 sizeof(halStopReq.stopReqParams));
6357
6358 pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB;
6359 pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData;
6360
6361 /*! TO DO: stop the data services */
6362 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6363 {
6364 /*Stop the STA Table !UT- check this logic again
6365 It is safer to do it here than on the response - because a stop is imminent*/
6366 WDI_STATableStop(pWDICtx);
6367
6368 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -07006369 status = wpalEventReset(&pWDICtx->setPowerStateEvent);
6370 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006371 {
6372 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6373 "WDI Init failed to reset power state event");
6374
6375 WDI_ASSERT(0);
6376 return VOS_STATUS_E_FAILURE;
6377 }
6378 /* Stop Transport Driver, DXE */
6379 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb);
6380 /*
6381 * Wait for the event to be set once the ACK comes back from DXE
6382 */
Jeff Johnson43971f52012-07-17 12:26:56 -07006383 status = wpalEventWait(&pWDICtx->setPowerStateEvent,
6384 WDI_SET_POWER_STATE_TIMEOUT);
6385 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006386 {
6387 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6388 "WDI Init failed to wait on an event");
6389
6390 WDI_ASSERT(0);
6391 return VOS_STATUS_E_FAILURE;
6392 }
6393 }
6394
6395 /*-------------------------------------------------------------------------
6396 Send Stop Request to HAL
6397 -------------------------------------------------------------------------*/
6398 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6399 wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP);
6400
6401}/*WDI_ProcessStopReq*/
6402
6403/**
6404 @brief Process Close Request function (called when Main FSM
6405 allows it)
6406
6407 @param pWDICtx: pointer to the WLAN DAL context
6408 pEventData: pointer to the event information structure
6409
6410 @see
6411 @return Result of the function call
6412*/
6413WDI_Status
6414WDI_ProcessCloseReq
6415(
6416 WDI_ControlBlockType* pWDICtx,
6417 WDI_EventInfoType* pEventData
6418)
6419{
6420 wpt_status wptStatus;
6421 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6422
6423 /*Lock control block for cleanup*/
6424 wpalMutexAcquire(&pWDICtx->wptMutex);
6425
6426 /*Clear all pending request*/
6427 WDI_ClearPendingRequests(pWDICtx);
6428
6429 /* Close Control transport*/
6430 WCTS_CloseTransport(pWDICtx->wctsHandle);
6431
6432 /* Close Data transport*/
6433 /* FTM mode does not open Data Path */
6434 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6435 {
6436 WDTS_Close(pWDICtx);
6437 }
6438
6439 /*Close the STA Table !UT- check this logic again*/
6440 WDI_STATableClose(pWDICtx);
6441
6442 /*close the PAL */
6443 wptStatus = wpalClose(pWDICtx->pPALContext);
6444 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
6445 {
6446 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6447 "Failed to wpal Close %d", wptStatus);
6448 WDI_ASSERT(0);
6449 }
6450
6451 /*Transition back to init state*/
6452 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
6453
6454 wpalMutexRelease(&pWDICtx->wptMutex);
6455
6456 /*Make sure the expected state is properly defaulted to Init*/
6457 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
6458
6459 return WDI_STATUS_SUCCESS;
6460}/*WDI_ProcessCloseReq*/
6461
6462
6463/*===========================================================================
6464 SCANING REQUEST PROCESSING API
6465===========================================================================*/
6466
6467/**
6468 @brief Process Init Scan Request function (called when Main FSM
6469 allows it)
6470
6471 @param pWDICtx: pointer to the WLAN DAL context
6472 pEventData: pointer to the event information structure
6473
6474 @see
6475 @return Result of the function call
6476*/
6477WDI_Status
6478WDI_ProcessInitScanReq
6479(
6480 WDI_ControlBlockType* pWDICtx,
6481 WDI_EventInfoType* pEventData
6482)
6483{
6484 WDI_InitScanReqParamsType* pwdiInitScanParams = NULL;
6485 WDI_InitScanRspCb wdiInitScanRspCb = NULL;
6486 wpt_uint8* pSendBuffer = NULL;
6487 wpt_uint16 usDataOffset = 0;
6488 wpt_uint16 usSendSize = 0;
6489 wpt_uint8 i = 0;
6490
6491 tHalInitScanReqMsg halInitScanReqMsg;
6492
6493 /*This is temporary fix.
6494 * It shold be removed once host and riva changes are in sync*/
6495 tHalInitScanConReqMsg halInitScanConReqMsg;
6496
6497 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6498
6499 /*-------------------------------------------------------------------------
6500 Sanity check
6501 -------------------------------------------------------------------------*/
6502 if (( NULL == pEventData ) ||
6503 ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) ||
6504 ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc)))
6505 {
6506 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6507 "%s: Invalid parameters", __FUNCTION__);
6508 WDI_ASSERT(0);
6509 return WDI_STATUS_E_FAILURE;
6510 }
6511
6512#if 0
6513 wpalMutexAcquire(&pWDICtx->wptMutex);
6514 /*-----------------------------------------------------------------------
6515 Check to see if SCAN is already in progress - if so reject the req
6516 We only allow one scan at a time
6517 ! TO DO: - revisit this constraint
6518 -----------------------------------------------------------------------*/
6519 if ( pWDICtx->bScanInProgress )
6520 {
6521 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6522 "Scan is already in progress - subsequent scan is not allowed"
6523 " until the first scan completes");
6524
6525 wpalMutexRelease(&pWDICtx->wptMutex);
6526 return WDI_STATUS_E_NOT_ALLOWED;
6527 }
6528
6529 pWDICtx->bScanInProgress = eWLAN_PAL_TRUE;
6530 pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST;
6531
6532 wpalMutexRelease(&pWDICtx->wptMutex);
6533#endif
6534
6535 if (pwdiInitScanParams->wdiReqInfo.bUseNOA)
6536 {
6537 /*This is temporary fix.
6538 * It shold be removed once host and riva changes are in sync*/
6539 /*-----------------------------------------------------------------------
6540 Get message buffer
6541 -----------------------------------------------------------------------*/
6542 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ,
6543 sizeof(halInitScanConReqMsg.initScanParams),
6544 &pSendBuffer, &usDataOffset, &usSendSize))||
6545 ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) )))
6546 {
6547 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6548 "Unable to get send buffer in init scan req %x %x %x",
6549 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6550 WDI_ASSERT(0);
6551 return WDI_STATUS_E_FAILURE;
6552 }
6553
6554
6555 /*-----------------------------------------------------------------------
6556 Fill in the message
6557 -----------------------------------------------------------------------*/
6558 halInitScanConReqMsg.initScanParams.scanMode =
6559 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6560
6561 wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid,
6562 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6563
6564 halInitScanConReqMsg.initScanParams.notifyBss =
6565 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
6566 halInitScanConReqMsg.initScanParams.frameType =
6567 pwdiInitScanParams->wdiReqInfo.ucFrameType;
6568 halInitScanConReqMsg.initScanParams.frameLength =
6569 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6570
6571 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr,
6572 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6573
6574#ifdef WLAN_FEATURE_P2P
6575 halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA;
6576 halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration;
6577#endif
6578
6579 halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt =
6580 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6581
6582 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6583 {
6584 halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] =
6585 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6586 }
6587
6588 wpalMemoryCopy( pSendBuffer+usDataOffset,
6589 &halInitScanConReqMsg.initScanParams,
6590 sizeof(halInitScanConReqMsg.initScanParams));
6591 }
6592 else
6593 {
6594 /*-----------------------------------------------------------------------
6595 Get message buffer
6596 -----------------------------------------------------------------------*/
6597 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ,
6598 sizeof(halInitScanReqMsg.initScanParams),
6599 &pSendBuffer, &usDataOffset, &usSendSize))||
6600 ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) )))
6601 {
6602 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6603 "Unable to get send buffer in init scan req %x %x %x",
6604 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6605 WDI_ASSERT(0);
6606 return WDI_STATUS_E_FAILURE;
6607 }
6608
6609
6610 /*-----------------------------------------------------------------------
6611 Fill in the message
6612 -----------------------------------------------------------------------*/
6613 halInitScanReqMsg.initScanParams.scanMode =
6614 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6615
6616 wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid,
6617 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6618
6619 halInitScanReqMsg.initScanParams.notifyBss =
6620 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
6621 halInitScanReqMsg.initScanParams.frameType =
6622 pwdiInitScanParams->wdiReqInfo.ucFrameType;
6623 halInitScanReqMsg.initScanParams.frameLength =
6624 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6625
6626 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr,
6627 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6628
6629 halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt =
6630 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6631
6632 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6633 {
6634 halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] =
6635 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6636 }
6637
6638 wpalMemoryCopy( pSendBuffer+usDataOffset,
6639 &halInitScanReqMsg.initScanParams,
6640 sizeof(halInitScanReqMsg.initScanParams));
6641 }
6642
6643 pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB;
6644 pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData;
6645
6646 /*-------------------------------------------------------------------------
6647 Send Init Scan Request to HAL
6648 -------------------------------------------------------------------------*/
6649 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6650 wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP);
6651
6652}/*WDI_ProcessInitScanReq*/
6653
6654/**
6655 @brief Process Start Scan Request function (called when Main
6656 FSM allows it)
6657
6658 @param pWDICtx: pointer to the WLAN DAL context
6659 pEventData: pointer to the event information structure
6660
6661 @see
6662 @return Result of the function call
6663*/
6664WDI_Status
6665WDI_ProcessStartScanReq
6666(
6667 WDI_ControlBlockType* pWDICtx,
6668 WDI_EventInfoType* pEventData
6669)
6670{
6671 WDI_StartScanReqParamsType* pwdiStartScanParams = NULL;
6672 WDI_StartScanRspCb wdiStartScanRspCb = NULL;
6673 wpt_uint8* pSendBuffer = NULL;
6674 wpt_uint16 usDataOffset = 0;
6675 wpt_uint16 usSendSize = 0;
6676
6677 tHalStartScanReqMsg halStartScanReqMsg;
6678 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6679
6680 /*-------------------------------------------------------------------------
6681 Sanity check
6682 -------------------------------------------------------------------------*/
6683 if (( NULL == pEventData ) ||
6684 ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) ||
6685 ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc)))
6686 {
6687 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6688 "%s: Invalid parameters", __FUNCTION__);
6689 WDI_ASSERT(0);
6690 return WDI_STATUS_E_FAILURE;
6691 }
6692
6693#if 0
6694 wpalMutexAcquire(&pWDICtx->wptMutex);
6695 /*-----------------------------------------------------------------------
6696 Check to see if SCAN is already in progress - start scan is only
6697 allowed when a scan is ongoing and the state of the scan procedure
6698 is either init or end
6699 -----------------------------------------------------------------------*/
6700 if (( !pWDICtx->bScanInProgress ) ||
6701 (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) &&
6702 ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState )))
6703 {
6704 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6705 "Scan start not allowed in this state %d %d",
6706 pWDICtx->bScanInProgress, pWDICtx->uScanState);
6707
6708 wpalMutexRelease(&pWDICtx->wptMutex);
6709 return WDI_STATUS_E_NOT_ALLOWED;
6710 }
6711
6712 pWDICtx->uScanState = WDI_SCAN_STARTED_ST;
6713
6714 wpalMutexRelease(&pWDICtx->wptMutex);
6715#endif
6716
6717 /*-----------------------------------------------------------------------
6718 Get message buffer
6719 -----------------------------------------------------------------------*/
6720 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ,
6721 sizeof(halStartScanReqMsg.startScanParams),
6722 &pSendBuffer, &usDataOffset, &usSendSize))||
6723 ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) )))
6724 {
6725 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6726 "Unable to get send buffer in start scan req %x %x %x",
6727 pEventData, pwdiStartScanParams, wdiStartScanRspCb);
6728 WDI_ASSERT(0);
6729 return WDI_STATUS_E_FAILURE;
6730 }
6731
6732 halStartScanReqMsg.startScanParams.scanChannel =
6733 pwdiStartScanParams->ucChannel;
6734 wpalMemoryCopy( pSendBuffer+usDataOffset,
6735 &halStartScanReqMsg.startScanParams,
6736 sizeof(halStartScanReqMsg.startScanParams));
6737
6738 pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB;
6739 pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData;
6740
6741 /*-------------------------------------------------------------------------
6742 Send Start Scan Request to HAL
6743 -------------------------------------------------------------------------*/
6744 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6745 wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP);
6746}/*WDI_ProcessStartScanReq*/
6747
6748
6749/**
6750 @brief Process End Scan Request function (called when Main FSM
6751 allows it)
6752
6753 @param pWDICtx: pointer to the WLAN DAL context
6754 pEventData: pointer to the event information structure
6755
6756 @see
6757 @return Result of the function call
6758*/
6759WDI_Status
6760WDI_ProcessEndScanReq
6761(
6762 WDI_ControlBlockType* pWDICtx,
6763 WDI_EventInfoType* pEventData
6764)
6765{
6766 WDI_EndScanReqParamsType* pwdiEndScanParams = NULL;
6767 WDI_EndScanRspCb wdiEndScanRspCb = NULL;
6768 wpt_uint8* pSendBuffer = NULL;
6769 wpt_uint16 usDataOffset = 0;
6770 wpt_uint16 usSendSize = 0;
6771
6772 tHalEndScanReqMsg halEndScanReqMsg;
6773 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6774
6775 /*-------------------------------------------------------------------------
6776 Sanity check
6777 -------------------------------------------------------------------------*/
6778 if (( NULL == pEventData ) ||
6779 ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) ||
6780 ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc)))
6781 {
6782 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6783 "%s: Invalid parameters", __FUNCTION__);
6784 WDI_ASSERT(0);
6785 return WDI_STATUS_E_FAILURE;
6786 }
6787
6788 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6789 * sometimes because of this check the scan request is not being
6790 * forwarded to HAL and result in hang*/
6791#if 0
6792 wpalMutexAcquire(&pWDICtx->wptMutex);
6793 /*-----------------------------------------------------------------------
6794 Check to see if SCAN is already in progress - end scan is only
6795 allowed when a scan is ongoing and the state of the scan procedure
6796 is started
6797 -----------------------------------------------------------------------*/
6798 if (( !pWDICtx->bScanInProgress ) ||
6799 ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState ))
6800 {
6801 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6802 "End start not allowed in this state %d %d",
6803 pWDICtx->bScanInProgress, pWDICtx->uScanState);
6804
6805 wpalMutexRelease(&pWDICtx->wptMutex);
6806 return WDI_STATUS_E_NOT_ALLOWED;
6807 }
6808
6809 pWDICtx->uScanState = WDI_SCAN_ENDED_ST;
6810
6811 wpalMutexRelease(&pWDICtx->wptMutex);
6812#endif
6813
6814 /*-----------------------------------------------------------------------
6815 Get message buffer
6816 -----------------------------------------------------------------------*/
6817 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ,
6818 sizeof(halEndScanReqMsg.endScanParams),
6819 &pSendBuffer, &usDataOffset, &usSendSize))||
6820 ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) )))
6821 {
6822 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6823 "Unable to get send buffer in start scan req %x %x %x",
6824 pEventData, pwdiEndScanParams, wdiEndScanRspCb);
6825 WDI_ASSERT(0);
6826 return WDI_STATUS_E_FAILURE;
6827 }
6828
6829 halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel;
6830
6831 wpalMemoryCopy( pSendBuffer+usDataOffset,
6832 &halEndScanReqMsg.endScanParams,
6833 sizeof(halEndScanReqMsg.endScanParams));
6834
6835 pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB;
6836 pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData;
6837
6838 /*-------------------------------------------------------------------------
6839 Send End Scan Request to HAL
6840 -------------------------------------------------------------------------*/
6841 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6842 wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP);
6843}/*WDI_ProcessEndScanReq*/
6844
6845
6846/**
6847 @brief Process Finish Scan Request function (called when Main
6848 FSM allows it)
6849
6850 @param pWDICtx: pointer to the WLAN DAL context
6851 pEventData: pointer to the event information structure
6852
6853 @see
6854 @return Result of the function call
6855*/
6856WDI_Status
6857WDI_ProcessFinishScanReq
6858(
6859 WDI_ControlBlockType* pWDICtx,
6860 WDI_EventInfoType* pEventData
6861)
6862{
6863 WDI_FinishScanReqParamsType* pwdiFinishScanParams;
6864 WDI_FinishScanRspCb wdiFinishScanRspCb;
6865 wpt_uint8* pSendBuffer = NULL;
6866 wpt_uint16 usDataOffset = 0;
6867 wpt_uint16 usSendSize = 0;
6868 wpt_uint8 i = 0;
6869
6870 tHalFinishScanReqMsg halFinishScanReqMsg;
6871 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6872
6873 /*-------------------------------------------------------------------------
6874 Sanity check
6875 -------------------------------------------------------------------------*/
6876 if (( NULL == pEventData ) ||
6877 ( NULL == pEventData->pEventData) ||
6878 ( NULL == pEventData->pCBfnc))
6879 {
6880 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6881 "%s: Invalid parameters", __FUNCTION__);
6882 WDI_ASSERT(0);
6883 return WDI_STATUS_E_FAILURE;
6884 }
6885
6886 pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData;
6887 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc;
6888 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6889 * sometimes because of this check the scan request is not being
6890 * forwarded to HAL and result in hang*/
6891#if 0
6892 wpalMutexAcquire(&pWDICtx->wptMutex);
6893 /*-----------------------------------------------------------------------
6894 Check to see if SCAN is already in progress
6895 Finish scan gets invoked any scan states. ie. abort scan
6896 It should be allowed in any states.
6897 -----------------------------------------------------------------------*/
6898 if ( !pWDICtx->bScanInProgress )
6899 {
6900 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6901 "Finish start not allowed in this state %d",
6902 pWDICtx->bScanInProgress );
6903
6904 wpalMutexRelease(&pWDICtx->wptMutex);
6905 return WDI_STATUS_E_NOT_ALLOWED;
6906 }
6907
6908 /*-----------------------------------------------------------------------
6909 It is safe to reset the scan flags here because until the response comes
6910 back all subsequent requests will be blocked at BUSY state
6911 -----------------------------------------------------------------------*/
6912 pWDICtx->uScanState = WDI_SCAN_FINISHED_ST;
6913 pWDICtx->bScanInProgress = eWLAN_PAL_FALSE;
6914 wpalMutexRelease(&pWDICtx->wptMutex);
6915#endif
6916
6917 if ( pWDICtx->bInBmps )
6918 {
6919 // notify DTS that we are entering BMPS
6920 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL);
6921 }
6922
6923 /*-----------------------------------------------------------------------
6924 Get message buffer
6925 -----------------------------------------------------------------------*/
6926 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ,
6927 sizeof(halFinishScanReqMsg.finishScanParams),
6928 &pSendBuffer, &usDataOffset, &usSendSize))||
6929 ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) )))
6930 {
6931 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6932 "Unable to get send buffer in start scan req %x %x %x",
6933 pEventData, pwdiFinishScanParams, wdiFinishScanRspCb);
6934 WDI_ASSERT(0);
6935 return WDI_STATUS_E_FAILURE;
6936 }
6937
6938 halFinishScanReqMsg.finishScanParams.scanMode =
6939 WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode);
6940
6941 halFinishScanReqMsg.finishScanParams.currentOperChannel =
6942 pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel;
6943
6944 halFinishScanReqMsg.finishScanParams.cbState =
6945 WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState);
6946
6947 wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid,
6948 pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6949
6950 halFinishScanReqMsg.finishScanParams.notifyBss =
6951 pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ;
6952 halFinishScanReqMsg.finishScanParams.frameType =
6953 pwdiFinishScanParams->wdiReqInfo.ucFrameType ;
6954 halFinishScanReqMsg.finishScanParams.frameLength =
6955 pwdiFinishScanParams->wdiReqInfo.ucFrameLength ;
6956
6957 halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt =
6958 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ;
6959
6960 for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6961 {
6962 halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] =
6963 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ;
6964 }
6965
6966 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr,
6967 &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr);
6968
6969 wpalMemoryCopy( pSendBuffer+usDataOffset,
6970 &halFinishScanReqMsg.finishScanParams,
6971 sizeof(halFinishScanReqMsg.finishScanParams));
6972
6973 pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB;
6974 pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData;
6975
6976 /*-------------------------------------------------------------------------
6977 Send Finish Scan Request to HAL
6978 -------------------------------------------------------------------------*/
6979 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
6980 wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP);
6981}/*WDI_ProcessFinishScanReq*/
6982
6983
6984/*==========================================================================
6985 ASSOCIATION REQUEST API
6986==========================================================================*/
6987/**
6988 @brief Process BSS Join for a given Session
6989
6990 @param pWDICtx: pointer to the WLAN DAL context
6991 pEventData: pointer to the event information structure
6992
6993 @see
6994 @return Result of the function call
6995*/
6996WDI_Status
6997WDI_ProcessBSSSessionJoinReq
6998(
6999 WDI_ControlBlockType* pWDICtx,
7000 WDI_JoinReqParamsType* pwdiJoinParams,
7001 WDI_JoinRspCb wdiJoinRspCb,
7002 void* pUserData
7003)
7004{
7005 WDI_BSSSessionType* pBSSSes = NULL;
7006 wpt_uint8* pSendBuffer = NULL;
7007 wpt_uint16 usDataOffset = 0;
7008 wpt_uint16 usSendSize = 0;
7009 wpt_uint8 ucCurrentBSSSesIdx = 0;
7010
7011 tHalJoinReqMsg halJoinReqMsg;
7012 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7013
7014 /*------------------------------------------------------------------------
7015 Check to see if we have any session with this BSSID already stored, we
7016 should not
7017 ------------------------------------------------------------------------*/
7018 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7019 pwdiJoinParams->wdiReqInfo.macBSSID,
7020 &pBSSSes);
7021
7022 if ( NULL != pBSSSes )
7023 {
7024 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7025 "Association for this BSSID is already in place");
7026
7027 return WDI_STATUS_E_NOT_ALLOWED;
7028 }
7029
7030 wpalMutexAcquire(&pWDICtx->wptMutex);
7031 /*------------------------------------------------------------------------
7032 Fetch an empty session block
7033 ------------------------------------------------------------------------*/
7034 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7035 if ( NULL == pBSSSes )
7036 {
7037
7038 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7039 "DAL has no free sessions - cannot run another join");
7040
7041 wpalMutexRelease(&pWDICtx->wptMutex);
7042 return WDI_STATUS_RES_FAILURE;
7043 }
7044
7045 /*Save BSS Session Info*/
7046 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7047 wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID,
7048 WDI_MAC_ADDR_LEN);
7049
7050 /*Transition to state Joining*/
7051 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7052 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7053
7054 wpalMutexRelease(&pWDICtx->wptMutex);
7055
7056 /*-----------------------------------------------------------------------
7057 Get message buffer
7058 -----------------------------------------------------------------------*/
7059 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ,
7060 sizeof(halJoinReqMsg.joinReqParams),
7061 &pSendBuffer, &usDataOffset, &usSendSize))||
7062 ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) )))
7063 {
7064 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7065 "Unable to get send buffer in join req %x %x %x",
7066 pUserData, pwdiJoinParams, wdiJoinRspCb);
7067 WDI_ASSERT(0);
7068 return WDI_STATUS_E_FAILURE;
7069 }
7070
7071 wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId,
7072 pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
7073
7074 wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr,
7075 pwdiJoinParams->wdiReqInfo.macSTASelf,
7076 WDI_MAC_ADDR_LEN);
7077
7078 halJoinReqMsg.joinReqParams.ucChannel =
7079 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel;
7080
7081 halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState;
7082
7083#ifndef WLAN_FEATURE_VOWIFI
7084 halJoinReqMsg.joinReqParams.ucLocalPowerConstraint =
7085 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint;
7086#endif
7087
7088 halJoinReqMsg.joinReqParams.secondaryChannelOffset =
7089 WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo.
7090 wdiSecondaryChannelOffset);
7091
7092 wpalMemoryCopy( pSendBuffer+usDataOffset,
7093 &halJoinReqMsg.joinReqParams,
7094 sizeof(halJoinReqMsg.joinReqParams));
7095
7096 pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB;
7097 pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData;
7098
7099 /*-------------------------------------------------------------------------
7100 Send Join Request to HAL
7101 -------------------------------------------------------------------------*/
7102 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7103 wdiJoinRspCb, pUserData, WDI_JOIN_RESP);
7104
7105}/*WDI_ProcessBSSSessionJoinReq*/
7106
7107/**
7108 @brief Process Join Request function (called when Main FSM
7109 allows it)
7110
7111 @param pWDICtx: pointer to the WLAN DAL context
7112 pEventData: pointer to the event information structure
7113
7114 @see
7115 @return Result of the function call
7116*/
7117WDI_Status
7118WDI_ProcessJoinReq
7119(
7120 WDI_ControlBlockType* pWDICtx,
7121 WDI_EventInfoType* pEventData
7122)
7123{
7124 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7125 WDI_JoinReqParamsType* pwdiJoinParams = NULL;
7126 WDI_JoinRspCb wdiJoinRspCb = NULL;
7127 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7128
7129 /*-------------------------------------------------------------------------
7130 Sanity check
7131 -------------------------------------------------------------------------*/
7132 if (( NULL == pEventData ) ||
7133 ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) ||
7134 ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc)))
7135 {
7136 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7137 "%s: Invalid parameters", __FUNCTION__);
7138 WDI_ASSERT(0);
7139 return WDI_STATUS_E_FAILURE;
7140 }
7141
7142 /*-------------------------------------------------------------------------
7143 Check to see if we are in the middle of an association, if so queue, if
7144 not it means it is free to process request
7145 -------------------------------------------------------------------------*/
7146 wpalMutexAcquire(&pWDICtx->wptMutex);
7147
7148 if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress )
7149 {
7150 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7151 "Association is currently in progress, queueing new join req");
7152
7153 /*Association is in progress - queue current one*/
7154 wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData,
7155 pwdiJoinParams->wdiReqInfo.macBSSID);
7156
7157 wpalMutexRelease(&pWDICtx->wptMutex);
7158
7159 return wdiStatus;
7160 }
7161
7162 /*Starting a new association */
7163 pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE;
7164 wpalMutexRelease(&pWDICtx->wptMutex);
7165
7166 /*Process the Join Request*/
7167 return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams,
7168 wdiJoinRspCb,pEventData->pUserData);
7169
7170}/*WDI_ProcessJoinReq*/
7171
7172
7173/**
7174 @brief Process Config BSS Request function (called when Main
7175 FSM allows it)
7176
7177 @param pWDICtx: pointer to the WLAN DAL context
7178 pEventData: pointer to the event information structure
7179
7180 @see
7181 @return Result of the function call
7182*/
7183WDI_Status
7184WDI_ProcessConfigBSSReq
7185(
7186 WDI_ControlBlockType* pWDICtx,
7187 WDI_EventInfoType* pEventData
7188)
7189{
7190 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams;
7191 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
7192 wpt_uint8 ucCurrentBSSSesIdx = 0;
7193 WDI_BSSSessionType* pBSSSes = NULL;
7194 wpt_uint16 uMsgSize = 0;
7195 wpt_uint8* pSendBuffer = NULL;
7196 wpt_uint16 usDataOffset = 0;
7197 wpt_uint16 usSendSize = 0;
7198 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7199
7200 tConfigBssReqMsg halConfigBssReqMsg;
7201 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7202
7203 /*-------------------------------------------------------------------------
7204 Sanity check
7205 -------------------------------------------------------------------------*/
7206 if (( NULL == pEventData ) ||
7207 ( NULL == pEventData->pEventData ) ||
7208 ( NULL == pEventData->pCBfnc ))
7209 {
7210 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7211 "%s: Invalid parameters", __FUNCTION__);
7212 WDI_ASSERT(0);
7213 return WDI_STATUS_E_FAILURE;
7214 }
7215
7216 pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData;
7217 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc;
7218 /*-------------------------------------------------------------------------
7219 Check to see if we are in the middle of an association, if so queue, if
7220 not it means it is free to process request
7221 -------------------------------------------------------------------------*/
7222 wpalMutexAcquire(&pWDICtx->wptMutex);
7223
7224 /*------------------------------------------------------------------------
7225 Find the BSS for which the request is made
7226 ------------------------------------------------------------------------*/
7227 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7228 pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7229 &pBSSSes);
7230
7231 if ( NULL == pBSSSes )
7232 {
7233#ifdef WLAN_FEATURE_VOWIFI_11R
7234 /*------------------------------------------------------------------------
7235 Fetch an empty session block
7236 ------------------------------------------------------------------------*/
7237 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7238 if ( NULL == pBSSSes )
7239 {
7240
7241 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7242 "DAL has no free sessions - cannot run another join");
7243
7244 wpalMutexRelease(&pWDICtx->wptMutex);
7245 return WDI_STATUS_RES_FAILURE;
7246 }
7247
7248 /*Save BSS Session Info*/
7249 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7250 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7251 WDI_MAC_ADDR_LEN);
7252
7253 /*Transition to state Joining*/
7254 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7255 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7256#else
7257 /* If the BSS type is IBSS create the session here as there is no Join
7258 * Request in case of IBSS*/
7259 if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) ||
7260 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) ||
7261 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) ||
7262 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE))
7263 {
7264 /*------------------------------------------------------------------------
7265 Fetch an empty session block
7266 ------------------------------------------------------------------------*/
7267 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
7268 if ( NULL == pBSSSes )
7269 {
7270
7271 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7272 "DAL has no free sessions - cannot run another join");
7273
7274 wpalMutexRelease(&pWDICtx->wptMutex);
7275 return WDI_STATUS_RES_FAILURE;
7276 }
7277
7278 /*Save BSS Session Info*/
7279 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7280 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7281 WDI_MAC_ADDR_LEN);
7282
7283 /*Transition to state Joining*/
7284 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
7285 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7286 }
7287 else
7288 {
7289 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7290 "Association sequence for this BSS does not yet exist");
7291 /* for IBSS testing */
7292 wpalMutexRelease(&pWDICtx->wptMutex);
7293 return WDI_STATUS_E_NOT_ALLOWED;
7294 }
7295#endif
7296 }
7297
7298 /*------------------------------------------------------------------------
7299 Check if this BSS is being currently processed or queued,
7300 if queued - queue the new request as well
7301 ------------------------------------------------------------------------*/
7302 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7303 {
7304 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7305 "Association sequence for this BSS exists but currently queued");
7306
7307 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7308
7309 wpalMutexRelease(&pWDICtx->wptMutex);
7310
7311 return wdiStatus;
7312 }
7313
7314 /* Cache the request for response processing */
7315 wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq,
7316 pwdiConfigBSSParams,
7317 sizeof(pWDICtx->wdiCachedConfigBssReq));
7318
7319 wpalMutexRelease(&pWDICtx->wptMutex);
7320
7321 uMsgSize = sizeof(halConfigBssReqMsg.configBssParams);
7322
7323 /*-----------------------------------------------------------------------
7324 Get message buffer
7325 -----------------------------------------------------------------------*/
7326 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ,
7327 uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))||
7328 ( usSendSize < (usDataOffset + uMsgSize )))
7329 {
7330 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7331 "Unable to get send buffer in config bss req %x %x %x",
7332 pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb);
7333 WDI_ASSERT(0);
7334 return WDI_STATUS_E_FAILURE;
7335 }
7336
7337 /*Copy the BSS request */
7338 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.configBssParams,
7339 &pwdiConfigBSSParams->wdiReqInfo);
7340
7341 /* Need to fill in the STA Index to invalid, since at this point we have not
7342 yet received it from HAL */
7343 halConfigBssReqMsg.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
7344
7345 /* Need to fill in the BSS index */
7346 halConfigBssReqMsg.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7347
7348 wpalMemoryCopy( pSendBuffer+usDataOffset,
7349 &halConfigBssReqMsg.configBssParams,
7350 sizeof(halConfigBssReqMsg.configBssParams));
7351
7352 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
7353 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
7354
7355 /*-------------------------------------------------------------------------
7356 Send Config BSS Request to HAL
7357 -------------------------------------------------------------------------*/
7358 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7359 wdiConfigBSSRspCb, pEventData->pUserData,
7360 WDI_CONFIG_BSS_RESP);
7361
7362}/*WDI_ProcessConfigBSSReq*/
7363
7364
7365/**
7366 @brief Process Del BSS Request function (called when Main FSM
7367 allows it)
7368
7369 @param pWDICtx: pointer to the WLAN DAL context
7370 pEventData: pointer to the event information structure
7371
7372 @see
7373 @return Result of the function call
7374*/
7375WDI_Status
7376WDI_ProcessDelBSSReq
7377(
7378 WDI_ControlBlockType* pWDICtx,
7379 WDI_EventInfoType* pEventData
7380)
7381{
7382 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7383 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
7384 wpt_uint8 ucCurrentBSSSesIdx = 0;
7385 WDI_BSSSessionType* pBSSSes = NULL;
7386 wpt_uint8* pSendBuffer = NULL;
7387 wpt_uint16 usDataOffset = 0;
7388 wpt_uint16 usSendSize = 0;
7389 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7390
7391 tDeleteBssReqMsg halBssReqMsg;
7392 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7393
7394 /*-------------------------------------------------------------------------
7395 Sanity check
7396 -------------------------------------------------------------------------*/
7397 if (( NULL == pEventData ) ||
7398 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7399 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7400 {
7401 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7402 "%s: Invalid parameters", __FUNCTION__);
7403 WDI_ASSERT(0);
7404 return WDI_STATUS_E_FAILURE;
7405 }
7406
7407 /*-------------------------------------------------------------------------
7408 Check to see if we are in the middle of an association, if so queue, if
7409 not it means it is free to process request
7410 -------------------------------------------------------------------------*/
7411 wpalMutexAcquire(&pWDICtx->wptMutex);
7412
7413 /*------------------------------------------------------------------------
7414 Find the BSS for which the request is made
7415 ------------------------------------------------------------------------*/
7416 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7417 pwdiDelBSSParams->ucBssIdx,
7418 &pBSSSes);
7419
7420 if ( NULL == pBSSSes )
7421 {
7422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7423 "Association sequence for this BSS does not yet exist");
7424
7425 wpalMutexRelease(&pWDICtx->wptMutex);
7426
7427 return WDI_STATUS_E_NOT_ALLOWED;
7428 }
7429
7430 /*------------------------------------------------------------------------
7431 Check if this BSS is being currently processed or queued,
7432 if queued - queue the new request as well
7433 ------------------------------------------------------------------------*/
7434 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7435 {
7436 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7437 "Association sequence for this BSS exists but currently queued");
7438
7439 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7440
7441 wpalMutexRelease(&pWDICtx->wptMutex);
7442
7443 return wdiStatus;
7444 }
7445
7446 /*-----------------------------------------------------------------------
7447 If we receive a Del BSS request for an association that is already in
7448 progress, it indicates that the assoc has failed => we no longer have
7449 an association in progress => we must check for pending associations
7450 that were queued and start as soon as the Del BSS response is received
7451 -----------------------------------------------------------------------*/
7452 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7453 {
7454 /*We can switch to false here because even if a subsequent Join comes in
7455 it will only be processed when DAL transitions out of BUSY state which
7456 happens when the Del BSS request comes */
7457 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7458
7459 /*Former association is complete - prepare next pending assoc for
7460 processing */
7461 WDI_DequeueAssocRequest(pWDICtx);
7462 }
7463
7464 wpalMutexRelease(&pWDICtx->wptMutex);
7465 /*-----------------------------------------------------------------------
7466 Get message buffer
7467 -----------------------------------------------------------------------*/
7468 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
7469 sizeof(halBssReqMsg.deleteBssParams),
7470 &pSendBuffer, &usDataOffset, &usSendSize))||
7471 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7472 {
7473 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7474 "Unable to get send buffer in start req %x %x %x",
7475 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7476 WDI_ASSERT(0);
7477 return WDI_STATUS_E_FAILURE;
7478 }
7479
7480 /*Fill in the message request structure*/
7481
7482 /*BSS Index is saved on config BSS response and Post Assoc Response */
7483 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
7484
7485 wpalMemoryCopy( pSendBuffer+usDataOffset,
7486 &halBssReqMsg.deleteBssParams,
7487 sizeof(halBssReqMsg.deleteBssParams));
7488
7489 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
7490 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
7491
7492
7493 /*-------------------------------------------------------------------------
7494 Send Del BSS Request to HAL
7495 -------------------------------------------------------------------------*/
7496 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7497 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7498
7499
7500}/*WDI_ProcessDelBSSReq*/
7501
7502/**
7503 @brief Process Post Assoc Request function (called when Main
7504 FSM allows it)
7505
7506 @param pWDICtx: pointer to the WLAN DAL context
7507 pEventData: pointer to the event information structure
7508
7509 @see
7510 @return Result of the function call
7511*/
7512WDI_Status
7513WDI_ProcessPostAssocReq
7514(
7515 WDI_ControlBlockType* pWDICtx,
7516 WDI_EventInfoType* pEventData
7517)
7518{
7519 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7520 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
7521 wpt_uint8 ucCurrentBSSSesIdx = 0;
7522 WDI_BSSSessionType* pBSSSes = NULL;
7523 wpt_uint8* pSendBuffer = NULL;
7524 wpt_uint16 usDataOffset = 0;
7525 wpt_uint16 usSendSize = 0;
7526 wpt_uint16 uMsgSize = 0;
7527 wpt_uint16 uOffset = 0;
7528 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7529
7530 tPostAssocReqMsg halPostAssocReqMsg;
7531 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7532
7533 /*-------------------------------------------------------------------------
7534 Sanity check
7535 -------------------------------------------------------------------------*/
7536 if (( NULL == pEventData ) ||
7537 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7538 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7539 {
7540 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7541 "%s: Invalid parameters", __FUNCTION__);
7542 WDI_ASSERT(0);
7543 return WDI_STATUS_E_FAILURE;
7544 }
7545
7546 /*-------------------------------------------------------------------------
7547 Check to see if we are in the middle of an association, if so queue, if
7548 not it means it is free to process request
7549 -------------------------------------------------------------------------*/
7550 wpalMutexAcquire(&pWDICtx->wptMutex);
7551
7552 /*------------------------------------------------------------------------
7553 Find the BSS for which the request is made
7554 ------------------------------------------------------------------------*/
7555 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7556 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7557 &pBSSSes);
7558
7559 if ( NULL == pBSSSes )
7560 {
7561 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7562 "Association sequence for this BSS does not yet exist - "
7563 "operation not allowed");
7564
7565 wpalMutexRelease(&pWDICtx->wptMutex);
7566 return WDI_STATUS_E_NOT_ALLOWED;
7567 }
7568
7569 /*------------------------------------------------------------------------
7570 Check if this BSS is being currently processed or queued,
7571 if queued - queue the new request as well
7572 ------------------------------------------------------------------------*/
7573 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7574 {
7575 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7576 "Association sequence for this BSS exists but currently queued");
7577
7578 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7579
7580 wpalMutexRelease(&pWDICtx->wptMutex);
7581
7582 return wdiStatus;
7583 }
7584
7585 /*-----------------------------------------------------------------------
7586 If Post Assoc was not yet received - the current association must
7587 be in progress
7588 -----------------------------------------------------------------------*/
7589 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
7590 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7591 {
7592 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7593 "Association sequence for this BSS association no longer in "
7594 "progress - not allowed");
7595
7596 wpalMutexRelease(&pWDICtx->wptMutex);
7597 return WDI_STATUS_E_NOT_ALLOWED;
7598 }
7599
7600 /*-----------------------------------------------------------------------
7601 Post Assoc Request is only allowed in Joining state
7602 -----------------------------------------------------------------------*/
7603 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7604 {
7605 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7606 "Post Assoc not allowed before JOIN - failing request");
7607
7608 wpalMutexRelease(&pWDICtx->wptMutex);
7609 return WDI_STATUS_E_NOT_ALLOWED;
7610 }
7611
7612 wpalMutexRelease(&pWDICtx->wptMutex);
7613
7614 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7615 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7616 /*-----------------------------------------------------------------------
7617 Fill message for tx over the bus
7618 -----------------------------------------------------------------------*/
7619 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
7620 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7621 ( usSendSize < (usDataOffset + uMsgSize )))
7622 {
7623 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7624 "Unable to get send buffer in start req %x %x %x",
7625 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7626 WDI_ASSERT(0);
7627 return WDI_STATUS_E_FAILURE;
7628 }
7629
7630 /*Copy the STA parameters */
7631 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7632 &pwdiPostAssocParams->wdiSTAParams );
7633
7634 /* Need to fill in the self STA Index */
7635 if ( WDI_STATUS_SUCCESS !=
7636 WDI_STATableFindStaidByAddr(pWDICtx,
7637 pwdiPostAssocParams->wdiSTAParams.macSTA,
7638 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7639 {
7640 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7641 "This station does not exist in the WDI Station Table %d");
7642 wpalMutexRelease(&pWDICtx->wptMutex);
7643 return WDI_STATUS_E_FAILURE;
7644 }
7645
7646 /* Need to fill in the BSS index */
7647 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
7648 pBSSSes->ucBSSIdx;
7649
7650 /*Copy the BSS parameters */
7651 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7652 &pwdiPostAssocParams->wdiBSSParams);
7653
7654 /* Need to fill in the STA index of the peer */
7655 if ( WDI_STATUS_SUCCESS !=
7656 WDI_STATableFindStaidByAddr(pWDICtx,
7657 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
7658 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
7659 {
7660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7661 "This station does not exist in the WDI Station Table %d");
7662 wpalMutexRelease(&pWDICtx->wptMutex);
7663 return WDI_STATUS_E_FAILURE;
7664 }
7665
7666 /* Need to fill in the BSS index */
7667 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
7668 pBSSSes->ucBSSIdx;
7669
7670
7671 wpalMemoryCopy( pSendBuffer+usDataOffset,
7672 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7673 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
7674
7675 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7676
7677 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7678 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7679 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
7680
7681
7682 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
7683 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
7684
7685
7686 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
7687 pwdiPostAssocParams,
7688 sizeof(pWDICtx->wdiCachedPostAssocReq));
7689
7690 /*-------------------------------------------------------------------------
7691 Send Post Assoc Request to HAL
7692 -------------------------------------------------------------------------*/
7693 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7694 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7695
7696
7697}/*WDI_ProcessPostAssocReq*/
7698
7699/**
7700 @brief Process Del STA Request function (called when Main FSM
7701 allows it)
7702
7703 @param pWDICtx: pointer to the WLAN DAL context
7704 pEventData: pointer to the event information structure
7705
7706 @see
7707 @return Result of the function call
7708*/
7709WDI_Status
7710WDI_ProcessDelSTAReq
7711(
7712 WDI_ControlBlockType* pWDICtx,
7713 WDI_EventInfoType* pEventData
7714)
7715{
7716 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7717 WDI_DelSTARspCb wdiDelSTARspCb;
7718 wpt_uint8 ucCurrentBSSSesIdx = 0;
7719 WDI_BSSSessionType* pBSSSes = NULL;
7720 wpt_uint8* pSendBuffer = NULL;
7721 wpt_uint16 usDataOffset = 0;
7722 wpt_uint16 usSendSize = 0;
7723 wpt_macAddr macBSSID;
7724 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7725
7726 tDeleteStaReqMsg halDelStaReqMsg;
7727 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7728
7729 /*-------------------------------------------------------------------------
7730 Sanity check
7731 -------------------------------------------------------------------------*/
7732 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7733 ( NULL == pEventData->pCBfnc ))
7734 {
7735 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7736 "%s: Invalid parameters", __FUNCTION__);
7737 WDI_ASSERT(0);
7738 return WDI_STATUS_E_FAILURE;
7739 }
7740
7741 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7742 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7743 /*-------------------------------------------------------------------------
7744 Check to see if we are in the middle of an association, if so queue, if
7745 not it means it is free to process request
7746 -------------------------------------------------------------------------*/
7747 wpalMutexAcquire(&pWDICtx->wptMutex);
7748
7749 /*------------------------------------------------------------------------
7750 Find the BSS for which the request is made and identify WDI session
7751 ------------------------------------------------------------------------*/
7752 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7753 pwdiDelSTAParams->ucSTAIdx,
7754 &macBSSID))
7755 {
7756 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7757 "This station does not exist in the WDI Station Table %d");
7758 wpalMutexRelease(&pWDICtx->wptMutex);
7759 return WDI_STATUS_E_FAILURE;
7760 }
7761
7762 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7763 if ( NULL == pBSSSes )
7764 {
7765 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7766 "Association sequence for this BSS does not yet exist");
7767
7768 wpalMutexRelease(&pWDICtx->wptMutex);
7769 return WDI_STATUS_E_NOT_ALLOWED;
7770 }
7771
7772 /*------------------------------------------------------------------------
7773 Check if this BSS is being currently processed or queued,
7774 if queued - queue the new request as well
7775 ------------------------------------------------------------------------*/
7776 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7777 {
7778 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7779 "Association sequence for this BSS exists but currently queued");
7780
7781 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7782 wpalMutexRelease(&pWDICtx->wptMutex);
7783 return wdiStatus;
7784 }
7785
7786 wpalMutexRelease(&pWDICtx->wptMutex);
7787 /*-----------------------------------------------------------------------
7788 Get message buffer
7789 -----------------------------------------------------------------------*/
7790 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
7791 sizeof(halDelStaReqMsg.delStaParams),
7792 &pSendBuffer, &usDataOffset, &usSendSize))||
7793 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7794 {
7795 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7796 "Unable to get send buffer in start req %x %x %x",
7797 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7798 WDI_ASSERT(0);
7799 return WDI_STATUS_E_FAILURE;
7800 }
7801
7802 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7803 wpalMemoryCopy( pSendBuffer+usDataOffset,
7804 &halDelStaReqMsg.delStaParams,
7805 sizeof(halDelStaReqMsg.delStaParams));
7806
7807 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
7808 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
7809
7810 /*-------------------------------------------------------------------------
7811 Send Del STA Request to HAL
7812 -------------------------------------------------------------------------*/
7813 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7814 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7815
7816}/*WDI_ProcessDelSTAReq*/
7817
7818
7819/*==========================================================================
7820 SECURITY REQUEST PROCESSING API
7821==========================================================================*/
7822/**
7823 @brief Process Set BSS Key Request function (called when Main FSM
7824 allows it)
7825
7826 @param pWDICtx: pointer to the WLAN DAL context
7827 pEventData: pointer to the event information structure
7828
7829 @see
7830 @return Result of the function call
7831*/
7832WDI_Status
7833WDI_ProcessSetBssKeyReq
7834(
7835 WDI_ControlBlockType* pWDICtx,
7836 WDI_EventInfoType* pEventData
7837)
7838{
7839 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7840 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
7841 wpt_uint8 ucCurrentBSSSesIdx = 0;
7842 WDI_BSSSessionType* pBSSSes = NULL;
7843 wpt_uint8* pSendBuffer = NULL;
7844 wpt_uint16 usDataOffset = 0;
7845 wpt_uint16 usSendSize = 0;
7846 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7847 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7848 wpt_uint8 keyIndex = 0;
7849
7850 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7851
7852 /*-------------------------------------------------------------------------
7853 Sanity check
7854 -------------------------------------------------------------------------*/
7855 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7856 ( NULL == pEventData->pCBfnc ))
7857 {
7858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7859 "%s: Invalid parameters", __FUNCTION__);
7860 WDI_ASSERT(0);
7861 return WDI_STATUS_E_FAILURE;
7862 }
7863
7864 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7865 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7866 /*-------------------------------------------------------------------------
7867 Check to see if we are in the middle of an association, if so queue, if
7868 not it means it is free to process request
7869 -------------------------------------------------------------------------*/
7870 wpalMutexAcquire(&pWDICtx->wptMutex);
7871
7872 /*------------------------------------------------------------------------
7873 Find the BSS for which the request is made
7874 ------------------------------------------------------------------------*/
7875 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7876 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7877 &pBSSSes);
7878
7879 if ( NULL == pBSSSes )
7880 {
7881 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7882 "Association sequence for this BSS does not yet exist");
7883
7884 wpalMutexRelease(&pWDICtx->wptMutex);
7885 return WDI_STATUS_E_NOT_ALLOWED;
7886 }
7887
7888 /*------------------------------------------------------------------------
7889 Check if this BSS is being currently processed or queued,
7890 if queued - queue the new request as well
7891 ------------------------------------------------------------------------*/
7892 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7893 {
7894 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7895 "Association sequence for this BSS exists but currently queued");
7896
7897 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
7898 wpalMutexRelease(&pWDICtx->wptMutex);
7899 return wdiStatus;
7900 }
7901
7902
7903 wpalMutexRelease(&pWDICtx->wptMutex);
7904 /*-----------------------------------------------------------------------
7905 Get message buffer
7906 -----------------------------------------------------------------------*/
7907 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
7908 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
7909 &pSendBuffer, &usDataOffset, &usSendSize))||
7910 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
7911 {
7912 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7913 "Unable to get send buffer in set bss key req %x %x %x",
7914 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
7915 WDI_ASSERT(0);
7916 return WDI_STATUS_E_FAILURE;
7917 }
7918
7919 /*-----------------------------------------------------------------------
7920 Copy the Key parameters into the HAL message
7921 -----------------------------------------------------------------------*/
7922
7923 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
7924
7925 halSetBssKeyReqMsg.setBssKeyParams.encType =
7926 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
7927
7928 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
7929 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
7930
7931 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
7932 keyIndex++)
7933 {
7934 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
7935 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
7936 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
7937 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
7938 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
7939 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
7940 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
7941 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
7942 WDI_MAX_KEY_RSC_LEN);
7943 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
7944 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
7945 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
7946 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
7947 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
7948 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
7949 WDI_MAX_KEY_LENGTH);
7950 }
7951
7952 wpalMemoryCopy( pSendBuffer+usDataOffset,
7953 &halSetBssKeyReqMsg.setBssKeyParams,
7954 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
7955
7956 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
7957 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
7958
7959 /*-------------------------------------------------------------------------
7960 Send Set BSS Key Request to HAL
7961 -------------------------------------------------------------------------*/
7962 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7963 wdiSetBSSKeyRspCb, pEventData->pUserData,
7964 WDI_SET_BSS_KEY_RESP);
7965
7966}/*WDI_ProcessSetBssKeyReq*/
7967
7968/**
7969 @brief Process Remove BSS Key Request function (called when Main
7970 FSM allows it)
7971
7972 @param pWDICtx: pointer to the WLAN DAL context
7973 pEventData: pointer to the event information structure
7974
7975 @see
7976 @return Result of the function call
7977*/
7978WDI_Status
7979WDI_ProcessRemoveBssKeyReq
7980(
7981 WDI_ControlBlockType* pWDICtx,
7982 WDI_EventInfoType* pEventData
7983)
7984{
7985 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
7986 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
7987 wpt_uint8 ucCurrentBSSSesIdx = 0;
7988 WDI_BSSSessionType* pBSSSes = NULL;
7989 wpt_uint8* pSendBuffer = NULL;
7990 wpt_uint16 usDataOffset = 0;
7991 wpt_uint16 usSendSize = 0;
7992 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7993 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
7994 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7995
7996 /*-------------------------------------------------------------------------
7997 Sanity check
7998 -------------------------------------------------------------------------*/
7999 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8000 ( NULL == pEventData->pCBfnc ))
8001 {
8002 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8003 "%s: Invalid parameters", __FUNCTION__);
8004 WDI_ASSERT(0);
8005 return WDI_STATUS_E_FAILURE;
8006 }
8007
8008 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
8009 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
8010 /*-------------------------------------------------------------------------
8011 Check to see if we are in the middle of an association, if so queue, if
8012 not it means it is free to process request
8013 -------------------------------------------------------------------------*/
8014 wpalMutexAcquire(&pWDICtx->wptMutex);
8015
8016 /*------------------------------------------------------------------------
8017 Find the BSS for which the request is made
8018 ------------------------------------------------------------------------*/
8019 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8020 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8021 &pBSSSes);
8022
8023 if ( NULL == pBSSSes )
8024 {
8025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8026 "Association sequence for this BSS does not yet exist");
8027
8028 wpalMutexRelease(&pWDICtx->wptMutex);
8029 return WDI_STATUS_E_NOT_ALLOWED;
8030 }
8031
8032 /*------------------------------------------------------------------------
8033 Check if this BSS is being currently processed or queued,
8034 if queued - queue the new request as well
8035 ------------------------------------------------------------------------*/
8036 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8037 {
8038 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8039 "Association sequence for this BSS exists but currently queued");
8040
8041 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8042 wpalMutexRelease(&pWDICtx->wptMutex);
8043 return wdiStatus;
8044 }
8045
8046
8047 wpalMutexRelease(&pWDICtx->wptMutex);
8048
8049 /*-----------------------------------------------------------------------
8050 Get message buffer
8051 -----------------------------------------------------------------------*/
8052 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
8053 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8054 &pSendBuffer, &usDataOffset, &usSendSize))||
8055 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8056 {
8057 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8058 "Unable to get send buffer in set bss key req %x %x %x",
8059 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8060 WDI_ASSERT(0);
8061 return WDI_STATUS_E_FAILURE;
8062 }
8063 /*-----------------------------------------------------------------------
8064 Copy the Key parameters into the HAL message
8065 -----------------------------------------------------------------------*/
8066 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8067
8068 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
8069 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8070
8071 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8072
8073 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
8074 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8075
8076 wpalMemoryCopy( pSendBuffer+usDataOffset,
8077 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8078 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
8079
8080 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
8081 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
8082
8083 /*-------------------------------------------------------------------------
8084 Send Remove BSS Key Request to HAL
8085 -------------------------------------------------------------------------*/
8086 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8087 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
8088 WDI_RMV_BSS_KEY_RESP);
8089}/*WDI_ProcessRemoveBssKeyReq*/
8090
8091/**
8092 @brief Process Set STA KeyRequest function (called when Main FSM
8093 allows it)
8094
8095 @param pWDICtx: pointer to the WLAN DAL context
8096 pEventData: pointer to the event information structure
8097
8098 @see
8099 @return Result of the function call
8100*/
8101WDI_Status
8102WDI_ProcessSetStaKeyReq
8103(
8104 WDI_ControlBlockType* pWDICtx,
8105 WDI_EventInfoType* pEventData
8106)
8107{
8108 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8109 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8110 WDI_BSSSessionType* pBSSSes = NULL;
8111 wpt_uint8* pSendBuffer = NULL;
8112 wpt_uint16 usDataOffset = 0;
8113 wpt_uint16 usSendSize = 0;
8114 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8115 wpt_macAddr macBSSID;
8116 wpt_uint8 ucCurrentBSSSesIdx;
8117 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8118 wpt_uint8 keyIndex = 0;
8119
8120 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8121
8122 /*-------------------------------------------------------------------------
8123 Sanity check
8124 -------------------------------------------------------------------------*/
8125 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8126 ( NULL == pEventData->pCBfnc ))
8127 {
8128 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8129 "%s: Invalid parameters", __FUNCTION__);
8130 WDI_ASSERT(0);
8131 return WDI_STATUS_E_FAILURE;
8132 }
8133
8134 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8135 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8136 /*-------------------------------------------------------------------------
8137 Check to see if we are in the middle of an association, if so queue, if
8138 not it means it is free to process request
8139 -------------------------------------------------------------------------*/
8140 wpalMutexAcquire(&pWDICtx->wptMutex);
8141
8142 /*------------------------------------------------------------------------
8143 Find the BSS for which the request is made and identify WDI session
8144 ------------------------------------------------------------------------*/
8145 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8146 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8147 &macBSSID))
8148 {
8149 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8150 "This station does not exist in the WDI Station Table %d");
8151 wpalMutexRelease(&pWDICtx->wptMutex);
8152 return WDI_STATUS_E_FAILURE;
8153 }
8154
8155 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8156 if ( NULL == pBSSSes )
8157 {
8158 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8159 "Association sequence for this BSS does not yet exist");
8160
8161 wpalMutexRelease(&pWDICtx->wptMutex);
8162 return WDI_STATUS_E_NOT_ALLOWED;
8163 }
8164
8165 /*------------------------------------------------------------------------
8166 Check if this BSS is being currently processed or queued,
8167 if queued - queue the new request as well
8168 ------------------------------------------------------------------------*/
8169 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8170 {
8171 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8172 "Association sequence for this BSS exists but currently queued");
8173
8174 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8175 wpalMutexRelease(&pWDICtx->wptMutex);
8176 return wdiStatus;
8177 }
8178
8179
8180 wpalMutexRelease(&pWDICtx->wptMutex);
8181 /*-----------------------------------------------------------------------
8182 Get message buffer
8183 -----------------------------------------------------------------------*/
8184 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
8185 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8186 &pSendBuffer, &usDataOffset, &usSendSize))||
8187 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8188 {
8189 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8190 "Unable to get send buffer in set bss key req %x %x %x",
8191 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8192 WDI_ASSERT(0);
8193 return WDI_STATUS_E_FAILURE;
8194 }
8195 /*-----------------------------------------------------------------------
8196 Copy the STA Key parameters into the HAL message
8197 -----------------------------------------------------------------------*/
8198 halSetStaKeyReqMsg.setStaKeyParams.encType =
8199 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8200
8201 halSetStaKeyReqMsg.setStaKeyParams.wepType =
8202 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8203
8204 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8205
8206 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8207
8208 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8209
8210#ifdef WLAN_SOFTAP_FEATURE
8211 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8212 keyIndex++)
8213 {
8214 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
8215 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8216 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8217 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8218 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8219 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8220 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
8221 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
8222 WDI_MAX_KEY_RSC_LEN);
8223 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
8224 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
8225 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
8226 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8227 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
8228 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
8229 WDI_MAX_KEY_LENGTH);
8230 }
8231#else
8232 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
8233 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8234 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8235 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8236 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8237 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8238 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
8239 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
8240 WDI_MAX_KEY_RSC_LEN);
8241 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
8242 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
8243 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
8244 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8245 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
8246 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
8247 WDI_MAX_KEY_LENGTH);
8248#endif
8249
8250 wpalMemoryCopy( pSendBuffer+usDataOffset,
8251 &halSetStaKeyReqMsg.setStaKeyParams,
8252 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
8253
8254 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
8255 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
8256
8257 /*-------------------------------------------------------------------------
8258 Send Set STA Key Request to HAL
8259 -------------------------------------------------------------------------*/
8260 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8261 wdiSetSTAKeyRspCb, pEventData->pUserData,
8262 WDI_SET_STA_KEY_RESP);
8263
8264}/*WDI_ProcessSetSTAKeyReq*/
8265
8266/**
8267 @brief Process Remove STA Key Request function (called when
8268 Main FSM allows it)
8269
8270 @param pWDICtx: pointer to the WLAN DAL context
8271 pEventData: pointer to the event information structure
8272
8273 @see
8274 @return Result of the function call
8275*/
8276WDI_Status
8277WDI_ProcessRemoveStaKeyReq
8278(
8279 WDI_ControlBlockType* pWDICtx,
8280 WDI_EventInfoType* pEventData
8281)
8282{
8283 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8284 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8285 WDI_BSSSessionType* pBSSSes = NULL;
8286 wpt_uint8* pSendBuffer = NULL;
8287 wpt_uint16 usDataOffset = 0;
8288 wpt_uint16 usSendSize = 0;
8289 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8290 wpt_macAddr macBSSID;
8291 wpt_uint8 ucCurrentBSSSesIdx;
8292 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8293 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8294
8295 /*-------------------------------------------------------------------------
8296 Sanity check
8297 -------------------------------------------------------------------------*/
8298 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8299 ( NULL == pEventData->pCBfnc ))
8300 {
8301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8302 "%s: Invalid parameters", __FUNCTION__);
8303 WDI_ASSERT(0);
8304 return WDI_STATUS_E_FAILURE;
8305 }
8306
8307 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8308 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8309 /*-------------------------------------------------------------------------
8310 Check to see if we are in the middle of an association, if so queue, if
8311 not it means it is free to process request
8312 -------------------------------------------------------------------------*/
8313 wpalMutexAcquire(&pWDICtx->wptMutex);
8314
8315 /*------------------------------------------------------------------------
8316 Find the BSS for which the request is made and identify WDI session
8317 ------------------------------------------------------------------------*/
8318 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8319 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8320 &macBSSID))
8321 {
8322 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8323 "This station does not exist in the WDI Station Table %d");
8324 wpalMutexRelease(&pWDICtx->wptMutex);
8325 return WDI_STATUS_E_FAILURE;
8326 }
8327
8328 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8329 if ( NULL == pBSSSes )
8330 {
8331 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8332 "Association sequence for this BSS does not yet exist");
8333
8334 wpalMutexRelease(&pWDICtx->wptMutex);
8335 return WDI_STATUS_E_NOT_ALLOWED;
8336 }
8337
8338 /*------------------------------------------------------------------------
8339 Check if this BSS is being currently processed or queued,
8340 if queued - queue the new request as well
8341 ------------------------------------------------------------------------*/
8342 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8343 {
8344 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8345 "Association sequence for this BSS exists but currently queued");
8346
8347 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8348 wpalMutexRelease(&pWDICtx->wptMutex);
8349 return wdiStatus;
8350 }
8351
8352
8353
8354 wpalMutexRelease(&pWDICtx->wptMutex);
8355 /*-----------------------------------------------------------------------
8356 Get message buffer
8357 -----------------------------------------------------------------------*/
8358 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
8359 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8360 &pSendBuffer, &usDataOffset, &usSendSize))||
8361 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8362 {
8363 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8364 "Unable to get send buffer in set bss key req %x %x %x",
8365 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8366 WDI_ASSERT(0);
8367 return WDI_STATUS_E_FAILURE;
8368 }
8369
8370 /*-----------------------------------------------------------------------
8371 Copy the Key parameters into the HAL message
8372 -----------------------------------------------------------------------*/
8373
8374 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
8375 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8376
8377 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
8378 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8379
8380 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
8381 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8382
8383 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
8384 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8385
8386 wpalMemoryCopy( pSendBuffer+usDataOffset,
8387 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8388 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
8389
8390 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
8391 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
8392
8393 /*-------------------------------------------------------------------------
8394 Send Remove STA Key Request to HAL
8395 -------------------------------------------------------------------------*/
8396 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8397 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
8398 WDI_RMV_STA_KEY_RESP);
8399
8400}/*WDI_ProcessRemoveSTAKeyReq*/
8401
8402/**
8403 @brief Process Set STA KeyRequest function (called when Main FSM
8404 allows it)
8405
8406 @param pWDICtx: pointer to the WLAN DAL context
8407 pEventData: pointer to the event information structure
8408
8409 @see
8410 @return Result of the function call
8411*/
8412WDI_Status
8413WDI_ProcessSetStaBcastKeyReq
8414(
8415 WDI_ControlBlockType* pWDICtx,
8416 WDI_EventInfoType* pEventData
8417)
8418{
8419 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8420 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8421 WDI_BSSSessionType* pBSSSes = NULL;
8422 wpt_uint8* pSendBuffer = NULL;
8423 wpt_uint16 usDataOffset = 0;
8424 wpt_uint16 usSendSize = 0;
8425 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8426 wpt_macAddr macBSSID;
8427 wpt_uint8 ucCurrentBSSSesIdx;
8428 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8429 wpt_uint8 keyIndex = 0;
8430
8431 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8432
8433 /*-------------------------------------------------------------------------
8434 Sanity check
8435 -------------------------------------------------------------------------*/
8436 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8437 ( NULL == pEventData->pCBfnc ))
8438 {
8439 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8440 "%s: Invalid parameters", __FUNCTION__);
8441 WDI_ASSERT(0);
8442 return WDI_STATUS_E_FAILURE;
8443 }
8444
8445 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8446 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8447 /*-------------------------------------------------------------------------
8448 Check to see if we are in the middle of an association, if so queue, if
8449 not it means it is free to process request
8450 -------------------------------------------------------------------------*/
8451 wpalMutexAcquire(&pWDICtx->wptMutex);
8452
8453 /*------------------------------------------------------------------------
8454 Find the BSS for which the request is made and identify WDI session
8455 ------------------------------------------------------------------------*/
8456 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8457 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
8458 &macBSSID))
8459 {
8460 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8461 "This station does not exist in the WDI Station Table %d");
8462 wpalMutexRelease(&pWDICtx->wptMutex);
8463 return WDI_STATUS_E_FAILURE;
8464 }
8465
8466 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8467 if ( NULL == pBSSSes )
8468 {
8469 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8470 "Association sequence for this BSS does not yet exist");
8471
8472 wpalMutexRelease(&pWDICtx->wptMutex);
8473 return WDI_STATUS_E_NOT_ALLOWED;
8474 }
8475
8476 /*------------------------------------------------------------------------
8477 Check if this BSS is being currently processed or queued,
8478 if queued - queue the new request as well
8479 ------------------------------------------------------------------------*/
8480 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8481 {
8482 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8483 "Association sequence for this BSS exists but currently queued");
8484
8485 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8486 wpalMutexRelease(&pWDICtx->wptMutex);
8487 return wdiStatus;
8488 }
8489
8490
8491 wpalMutexRelease(&pWDICtx->wptMutex);
8492 /*-----------------------------------------------------------------------
8493 Get message buffer
8494 -----------------------------------------------------------------------*/
8495 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
8496 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8497 &pSendBuffer, &usDataOffset, &usSendSize))||
8498 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8499 {
8500 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8501 "Unable to get send buffer in set bss key req %x %x %x",
8502 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8503 WDI_ASSERT(0);
8504 return WDI_STATUS_E_FAILURE;
8505 }
8506 /*-----------------------------------------------------------------------
8507 Copy the STA Key parameters into the HAL message
8508 -----------------------------------------------------------------------*/
8509 halSetStaKeyReqMsg.setStaKeyParams.encType =
8510 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8511
8512 halSetStaKeyReqMsg.setStaKeyParams.wepType =
8513 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8514
8515 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8516
8517 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8518
8519 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8520
8521#ifdef WLAN_SOFTAP_FEATURE
8522 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8523 keyIndex++)
8524 {
8525 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
8526 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8527 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8528 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8529 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8530 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8531 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
8532 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
8533 WDI_MAX_KEY_RSC_LEN);
8534 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
8535 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
8536 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
8537 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8538 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
8539 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
8540 WDI_MAX_KEY_LENGTH);
8541 }
8542#else
8543 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
8544 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8545 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8546 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8547 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8548 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8549 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
8550 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
8551 WDI_MAX_KEY_RSC_LEN);
8552 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
8553 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
8554 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
8555 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8556 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
8557 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
8558 WDI_MAX_KEY_LENGTH);
8559#endif
8560
8561 wpalMemoryCopy( pSendBuffer+usDataOffset,
8562 &halSetStaKeyReqMsg.setStaKeyParams,
8563 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
8564
8565 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
8566 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
8567
8568 /*-------------------------------------------------------------------------
8569 Send Set STA Key Request to HAL
8570 -------------------------------------------------------------------------*/
8571 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8572 wdiSetSTAKeyRspCb, pEventData->pUserData,
8573 WDI_SET_STA_KEY_RESP);
8574
8575}/*WDI_ProcessSetSTABcastKeyReq*/
8576
8577/**
8578 @brief Process Remove STA Key Request function (called when
8579 Main FSM allows it)
8580
8581 @param pWDICtx: pointer to the WLAN DAL context
8582 pEventData: pointer to the event information structure
8583
8584 @see
8585 @return Result of the function call
8586*/
8587WDI_Status
8588WDI_ProcessRemoveStaBcastKeyReq
8589(
8590 WDI_ControlBlockType* pWDICtx,
8591 WDI_EventInfoType* pEventData
8592)
8593{
8594 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8595 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8596 WDI_BSSSessionType* pBSSSes = NULL;
8597 wpt_uint8* pSendBuffer = NULL;
8598 wpt_uint16 usDataOffset = 0;
8599 wpt_uint16 usSendSize = 0;
8600 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8601 wpt_macAddr macBSSID;
8602 wpt_uint8 ucCurrentBSSSesIdx;
8603 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8604 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8605
8606 /*-------------------------------------------------------------------------
8607 Sanity check
8608 -------------------------------------------------------------------------*/
8609 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8610 ( NULL == pEventData->pCBfnc ))
8611 {
8612 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8613 "%s: Invalid parameters", __FUNCTION__);
8614 WDI_ASSERT(0);
8615 return WDI_STATUS_E_FAILURE;
8616 }
8617
8618 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8619 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8620 /*-------------------------------------------------------------------------
8621 Check to see if we are in the middle of an association, if so queue, if
8622 not it means it is free to process request
8623 -------------------------------------------------------------------------*/
8624 wpalMutexAcquire(&pWDICtx->wptMutex);
8625
8626 /*------------------------------------------------------------------------
8627 Find the BSS for which the request is made and identify WDI session
8628 ------------------------------------------------------------------------*/
8629 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8630 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
8631 &macBSSID))
8632 {
8633 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8634 "This station does not exist in the WDI Station Table %d");
8635 wpalMutexRelease(&pWDICtx->wptMutex);
8636 return WDI_STATUS_E_FAILURE;
8637 }
8638
8639 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8640 if ( NULL == pBSSSes )
8641 {
8642 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8643 "Association sequence for this BSS does not yet exist");
8644
8645 wpalMutexRelease(&pWDICtx->wptMutex);
8646 return WDI_STATUS_E_NOT_ALLOWED;
8647 }
8648
8649 /*------------------------------------------------------------------------
8650 Check if this BSS is being currently processed or queued,
8651 if queued - queue the new request as well
8652 ------------------------------------------------------------------------*/
8653 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8654 {
8655 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8656 "Association sequence for this BSS exists but currently queued");
8657
8658 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8659 wpalMutexRelease(&pWDICtx->wptMutex);
8660 return wdiStatus;
8661 }
8662
8663
8664
8665 wpalMutexRelease(&pWDICtx->wptMutex);
8666 /*-----------------------------------------------------------------------
8667 Get message buffer
8668 -----------------------------------------------------------------------*/
8669 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
8670 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8671 &pSendBuffer, &usDataOffset, &usSendSize))||
8672 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8673 {
8674 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8675 "Unable to get send buffer in set bss key req %x %x %x",
8676 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8677 WDI_ASSERT(0);
8678 return WDI_STATUS_E_FAILURE;
8679 }
8680
8681 /*-----------------------------------------------------------------------
8682 Copy the Key parameters into the HAL message
8683 -----------------------------------------------------------------------*/
8684
8685 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
8686 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8687
8688 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
8689 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8690
8691 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
8692 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8693
8694 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
8695 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8696
8697 wpalMemoryCopy( pSendBuffer+usDataOffset,
8698 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8699 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
8700
8701 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
8702 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
8703
8704 /*-------------------------------------------------------------------------
8705 Send Remove STA Key Request to HAL
8706 -------------------------------------------------------------------------*/
8707 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8708 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
8709 WDI_RMV_STA_KEY_RESP);
8710
8711}/*WDI_ProcessRemoveSTABcastKeyReq*/
8712
8713/*==========================================================================
8714 QOS and BA PROCESSING REQUEST API
8715==========================================================================*/
8716/**
8717 @brief Process Add TSpec Request function (called when Main FSM
8718 allows it)
8719
8720 @param pWDICtx: pointer to the WLAN DAL context
8721 pEventData: pointer to the event information structure
8722
8723 @see
8724 @return Result of the function call
8725*/
8726WDI_Status
8727WDI_ProcessAddTSpecReq
8728(
8729 WDI_ControlBlockType* pWDICtx,
8730 WDI_EventInfoType* pEventData
8731)
8732{
8733 WDI_AddTSReqParamsType* pwdiAddTSParams;
8734 WDI_AddTsRspCb wdiAddTSRspCb;
8735 wpt_uint8 ucCurrentBSSSesIdx = 0;
8736 WDI_BSSSessionType* pBSSSes = NULL;
8737 wpt_uint8* pSendBuffer = NULL;
8738 wpt_uint16 usDataOffset = 0;
8739 wpt_uint16 usSendSize = 0;
8740 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8741 wpt_macAddr macBSSID;
8742 tAddTsParams halAddTsParams = {0};
8743
8744 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8745
8746 /*-------------------------------------------------------------------------
8747 Sanity check
8748 -------------------------------------------------------------------------*/
8749 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8750 ( NULL == pEventData->pCBfnc ))
8751 {
8752 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8753 "%s: Invalid parameters", __FUNCTION__);
8754 WDI_ASSERT(0);
8755 return WDI_STATUS_E_FAILURE;
8756 }
8757
8758 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8759 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8760 /*-------------------------------------------------------------------------
8761 Check to see if we are in the middle of an association, if so queue, if
8762 not it means it is free to process request
8763 -------------------------------------------------------------------------*/
8764 wpalMutexAcquire(&pWDICtx->wptMutex);
8765
8766 /*------------------------------------------------------------------------
8767 Find the BSS for which the request is made and identify WDI session
8768 ------------------------------------------------------------------------*/
8769 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8770 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
8771 &macBSSID))
8772 {
8773 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8774 "This station does not exist in the WDI Station Table %d");
8775 wpalMutexRelease(&pWDICtx->wptMutex);
8776 return WDI_STATUS_E_FAILURE;
8777 }
8778
8779 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8780 if ( NULL == pBSSSes )
8781 {
8782 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8783 "Association sequence for this BSS does not yet exist");
8784
8785 wpalMutexRelease(&pWDICtx->wptMutex);
8786 return WDI_STATUS_E_NOT_ALLOWED;
8787 }
8788
8789 /*------------------------------------------------------------------------
8790 Check if this BSS is being currently processed or queued,
8791 if queued - queue the new request as well
8792 ------------------------------------------------------------------------*/
8793 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8794 {
8795 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8796 "Association sequence for this BSS exists but currently queued");
8797
8798 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8799 wpalMutexRelease(&pWDICtx->wptMutex);
8800 return wdiStatus;
8801 }
8802
8803 wpalMutexRelease(&pWDICtx->wptMutex);
8804 /*-----------------------------------------------------------------------
8805 Get message buffer
8806 ! TO DO : proper conversion into the HAL Message Request Format
8807 -----------------------------------------------------------------------*/
8808 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8809 sizeof(halAddTsParams),
8810 &pSendBuffer, &usDataOffset,
8811 &usSendSize))||
8812 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8813 {
8814 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8815 "Unable to get send buffer in set bss key req %x %x %x",
8816 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8817 WDI_ASSERT(0);
8818 return WDI_STATUS_E_FAILURE;
8819 }
8820
8821 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8822 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8823
8824 //TSPEC IE
8825 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8826 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
8827 halAddTsParams.tspec.nomMsduSz =
8828 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
8829 halAddTsParams.tspec.maxMsduSz =
8830 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
8831 halAddTsParams.tspec.minSvcInterval =
8832 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
8833 halAddTsParams.tspec.maxSvcInterval =
8834 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
8835 halAddTsParams.tspec.inactInterval =
8836 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
8837 halAddTsParams.tspec.suspendInterval =
8838 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
8839 halAddTsParams.tspec.svcStartTime =
8840 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
8841 halAddTsParams.tspec.minDataRate =
8842 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
8843 halAddTsParams.tspec.meanDataRate =
8844 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
8845 halAddTsParams.tspec.peakDataRate =
8846 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
8847 halAddTsParams.tspec.maxBurstSz =
8848 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
8849 halAddTsParams.tspec.delayBound =
8850 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
8851 halAddTsParams.tspec.minPhyRate =
8852 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
8853 halAddTsParams.tspec.surplusBw =
8854 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
8855 halAddTsParams.tspec.mediumTime =
8856 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8857
8858 //TSPEC IE : TS INFO : TRAFFIC
8859 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
8860 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
8861 halAddTsParams.tspec.tsinfo.traffic.userPrio =
8862 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
8863 halAddTsParams.tspec.tsinfo.traffic.psb =
8864 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
8865 halAddTsParams.tspec.tsinfo.traffic.aggregation =
8866 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
8867 halAddTsParams.tspec.tsinfo.traffic.direction =
8868 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
8869 halAddTsParams.tspec.tsinfo.traffic.tsid =
8870 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
8871 halAddTsParams.tspec.tsinfo.traffic.trafficType =
8872 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
8873
8874 //TSPEC IE : TS INFO : SCHEDULE
8875 halAddTsParams.tspec.tsinfo.schedule.rsvd =
8876 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
8877 halAddTsParams.tspec.tsinfo.schedule.schedule =
8878 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
8879
8880 wpalMemoryCopy( pSendBuffer+usDataOffset,
8881 &halAddTsParams,
8882 sizeof(halAddTsParams));
8883
8884 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
8885 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
8886
8887 /*-------------------------------------------------------------------------
8888 Send Add TS Request to HAL
8889 -------------------------------------------------------------------------*/
8890 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8891 wdiAddTSRspCb, pEventData->pUserData,
8892 WDI_ADD_TS_RESP);
8893}/*WDI_ProcessAddTSpecReq*/
8894
8895
8896/**
8897 @brief Process Del TSpec Request function (called when Main FSM
8898 allows it)
8899
8900 @param pWDICtx: pointer to the WLAN DAL context
8901 pEventData: pointer to the event information structure
8902
8903 @see
8904 @return Result of the function call
8905*/
8906WDI_Status
8907WDI_ProcessDelTSpecReq
8908(
8909 WDI_ControlBlockType* pWDICtx,
8910 WDI_EventInfoType* pEventData
8911)
8912{
8913 WDI_DelTSReqParamsType* pwdiDelTSParams;
8914 WDI_DelTsRspCb wdiDelTSRspCb;
8915 wpt_uint8 ucCurrentBSSSesIdx = 0;
8916 WDI_BSSSessionType* pBSSSes = NULL;
8917 wpt_uint8* pSendBuffer = NULL;
8918 wpt_uint16 usDataOffset = 0;
8919 wpt_uint16 usSendSize = 0;
8920 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
8921 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8922
8923 /*-------------------------------------------------------------------------
8924 Sanity check
8925 -------------------------------------------------------------------------*/
8926 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8927 ( NULL == pEventData->pCBfnc ))
8928 {
8929 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8930 "%s: Invalid parameters", __FUNCTION__);
8931 WDI_ASSERT(0);
8932 return WDI_STATUS_E_FAILURE;
8933 }
8934
8935 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
8936 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
8937
8938 /*-------------------------------------------------------------------------
8939 Check to see if we are in the middle of an association, if so queue, if
8940 not it means it is free to process request
8941 -------------------------------------------------------------------------*/
8942 wpalMutexAcquire(&pWDICtx->wptMutex);
8943
8944 /*------------------------------------------------------------------------
8945 Find the BSS for which the request is made
8946 ------------------------------------------------------------------------*/
8947 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
8948 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
8949 &pBSSSes);
8950
8951 if ( NULL == pBSSSes )
8952 {
8953 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8954 "Association sequence for this BSS does not yet exist");
8955
8956 wpalMutexRelease(&pWDICtx->wptMutex);
8957 return WDI_STATUS_E_NOT_ALLOWED;
8958 }
8959
8960 /*------------------------------------------------------------------------
8961 Check if this BSS is being currently processed or queued,
8962 if queued - queue the new request as well
8963 ------------------------------------------------------------------------*/
8964 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8965 {
8966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8967 "Association sequence for this BSS exists but currently queued");
8968
8969 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
8970 wpalMutexRelease(&pWDICtx->wptMutex);
8971 return wdiStatus;
8972 }
8973
8974
8975 wpalMutexRelease(&pWDICtx->wptMutex);
8976 /*-----------------------------------------------------------------------
8977 Get message buffer
8978 ! TO DO : proper conversion into the HAL Message Request Format
8979 -----------------------------------------------------------------------*/
8980 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
8981 sizeof(pwdiDelTSParams->wdiDelTSInfo),
8982 &pSendBuffer, &usDataOffset, &usSendSize))||
8983 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
8984 {
8985 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8986 "Unable to get send buffer in set bss key req %x %x %x",
8987 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
8988 WDI_ASSERT(0);
8989 return WDI_STATUS_E_FAILURE;
8990 }
8991
8992 wpalMemoryCopy( pSendBuffer+usDataOffset,
8993 &pwdiDelTSParams->wdiDelTSInfo,
8994 sizeof(pwdiDelTSParams->wdiDelTSInfo));
8995
8996 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
8997 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
8998
8999 /*-------------------------------------------------------------------------
9000 Send Del TS Request to HAL
9001 -------------------------------------------------------------------------*/
9002 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9003 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
9004}/*WDI_ProcessDelTSpecReq*/
9005
9006/**
9007 @brief Process Update EDCA Params Request function (called when
9008 Main FSM allows it)
9009
9010 @param pWDICtx: pointer to the WLAN DAL context
9011 pEventData: pointer to the event information structure
9012
9013 @see
9014 @return Result of the function call
9015*/
9016WDI_Status
9017WDI_ProcessUpdateEDCAParamsReq
9018(
9019 WDI_ControlBlockType* pWDICtx,
9020 WDI_EventInfoType* pEventData
9021)
9022{
9023 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9024 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
9025 wpt_uint8 ucCurrentBSSSesIdx = 0;
9026 WDI_BSSSessionType* pBSSSes = NULL;
9027 wpt_uint8* pSendBuffer = NULL;
9028 wpt_uint16 usDataOffset = 0;
9029 wpt_uint16 usSendSize = 0;
9030 WDI_Status wdiStatus;
9031 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9032
9033 /*-------------------------------------------------------------------------
9034 Sanity check
9035 -------------------------------------------------------------------------*/
9036 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9037 ( NULL == pEventData->pCBfnc ))
9038 {
9039 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9040 "%s: Invalid parameters", __FUNCTION__);
9041 WDI_ASSERT(0);
9042 return WDI_STATUS_E_FAILURE;
9043 }
9044
9045 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9046 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9047 /*-------------------------------------------------------------------------
9048 Check to see if we are in the middle of an association, if so queue, if
9049 not it means it is free to process request
9050 -------------------------------------------------------------------------*/
9051 wpalMutexAcquire(&pWDICtx->wptMutex);
9052
9053 /*------------------------------------------------------------------------
9054 Find the BSS for which the request is made
9055 ------------------------------------------------------------------------*/
9056 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9057 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9058 &pBSSSes);
9059
9060 if ( NULL == pBSSSes )
9061 {
9062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9063 "Association sequence for this BSS does not yet exist");
9064
9065 wpalMutexRelease(&pWDICtx->wptMutex);
9066 return WDI_STATUS_E_NOT_ALLOWED;
9067 }
9068
9069 /*------------------------------------------------------------------------
9070 Check if this BSS is being currently processed or queued,
9071 if queued - queue the new request as well
9072 ------------------------------------------------------------------------*/
9073 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9074 {
9075 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9076 "Association sequence for this BSS exists but currently queued");
9077
9078 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9079 wpalMutexRelease(&pWDICtx->wptMutex);
9080 return wdiStatus;
9081 }
9082
9083
9084 wpalMutexRelease(&pWDICtx->wptMutex);
9085 /*-----------------------------------------------------------------------
9086 Get message buffer
9087 ! TO DO : proper conversion into the HAL Message Request Format
9088 -----------------------------------------------------------------------*/
9089 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
9090 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9091 &pSendBuffer, &usDataOffset, &usSendSize))||
9092 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9093 {
9094 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9095 "Unable to get send buffer in set bss key req %x %x %x",
9096 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9097 WDI_ASSERT(0);
9098 return WDI_STATUS_E_FAILURE;
9099 }
9100
9101 wpalMemoryCopy( pSendBuffer+usDataOffset,
9102 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9103 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
9104
9105 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
9106 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
9107
9108 /*-------------------------------------------------------------------------
9109 Send Update EDCA Params Request to HAL
9110 -------------------------------------------------------------------------*/
9111 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9112 wdiUpdateEDCARspCb, pEventData->pUserData,
9113 WDI_UPD_EDCA_PRMS_RESP);
9114}/*WDI_ProcessUpdateEDCAParamsReq*/
9115
9116/**
9117 @brief Process Add BA Request function (called when Main FSM
9118 allows it)
9119
9120 @param pWDICtx: pointer to the WLAN DAL context
9121 pEventData: pointer to the event information structure
9122
9123 @see
9124 @return Result of the function call
9125*/
9126WDI_Status
9127WDI_ProcessAddBASessionReq
9128(
9129 WDI_ControlBlockType* pWDICtx,
9130 WDI_EventInfoType* pEventData
9131)
9132{
9133 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9134 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
9135 wpt_uint8 ucCurrentBSSSesIdx = 0;
9136 WDI_BSSSessionType* pBSSSes = NULL;
9137 wpt_uint8* pSendBuffer = NULL;
9138 wpt_uint16 usDataOffset = 0;
9139 wpt_uint16 usSendSize = 0;
9140 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9141 wpt_macAddr macBSSID;
9142
9143 tAddBASessionReqMsg halAddBASessionReq;
9144 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9145
9146 /*-------------------------------------------------------------------------
9147 Sanity check
9148 -------------------------------------------------------------------------*/
9149 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9150 ( NULL == pEventData->pCBfnc ))
9151 {
9152 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9153 "%s: Invalid parameters", __FUNCTION__);
9154 WDI_ASSERT(0);
9155 return WDI_STATUS_E_FAILURE;
9156 }
9157
9158 pwdiAddBASessionParams =
9159 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
9160 wdiAddBASessionRspCb =
9161 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9162 /*-------------------------------------------------------------------------
9163 Check to see if we are in the middle of an association, if so queue, if
9164 not it means it is free to process request
9165 -------------------------------------------------------------------------*/
9166 wpalMutexAcquire(&pWDICtx->wptMutex);
9167
9168 /*------------------------------------------------------------------------
9169 Find the BSS for which the request is made
9170 ------------------------------------------------------------------------*/
9171 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9172 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
9173 &macBSSID))
9174 {
9175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9176 "This station does not exist in the WDI Station Table %d");
9177 wpalMutexRelease(&pWDICtx->wptMutex);
9178 return WDI_STATUS_E_FAILURE;
9179 }
9180
9181
9182 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
9183
9184 if ( NULL == pBSSSes )
9185 {
9186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9187 "Association sequence for this BSS does not yet exist");
9188
9189 wpalMutexRelease(&pWDICtx->wptMutex);
9190 return WDI_STATUS_E_NOT_ALLOWED;
9191 }
9192
9193 /*------------------------------------------------------------------------
9194 Check if this BSS is being currently processed or queued,
9195 if queued - queue the new request as well
9196 ------------------------------------------------------------------------*/
9197 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9198 {
9199 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9200 "Association sequence for this BSS exists but currently queued");
9201
9202 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9203 wpalMutexRelease(&pWDICtx->wptMutex);
9204 return wdiStatus;
9205 }
9206
9207
9208 wpalMutexRelease(&pWDICtx->wptMutex);
9209 /*-----------------------------------------------------------------------
9210 Get message buffer
9211 -----------------------------------------------------------------------*/
9212 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9213 WDI_ADD_BA_SESSION_REQ,
9214 sizeof(halAddBASessionReq.addBASessionParams),
9215 &pSendBuffer, &usDataOffset, &usSendSize))||
9216 ( usSendSize <
9217 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9218 {
9219 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9220 "Unable to get send buffer in Add BA session req %x %x %x",
9221 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9222 WDI_ASSERT(0);
9223 return WDI_STATUS_E_FAILURE;
9224 }
9225
9226 halAddBASessionReq.addBASessionParams.staIdx =
9227 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9228 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9229 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9230 WDI_MAC_ADDR_LEN);
9231 halAddBASessionReq.addBASessionParams.baTID =
9232 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9233 halAddBASessionReq.addBASessionParams.baPolicy =
9234 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9235 halAddBASessionReq.addBASessionParams.baBufferSize =
9236 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9237 halAddBASessionReq.addBASessionParams.baTimeout =
9238 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9239 halAddBASessionReq.addBASessionParams.baSSN =
9240 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9241 halAddBASessionReq.addBASessionParams.baDirection =
9242 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9243
9244 wpalMemoryCopy( pSendBuffer+usDataOffset,
9245 &halAddBASessionReq.addBASessionParams,
9246 sizeof(halAddBASessionReq.addBASessionParams));
9247
9248 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
9249 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
9250
9251 /*-------------------------------------------------------------------------
9252 Send Start Request to HAL
9253 -------------------------------------------------------------------------*/
9254 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9255 wdiAddBASessionRspCb, pEventData->pUserData,
9256 WDI_ADD_BA_SESSION_RESP);
9257}/*WDI_ProcessAddBASessionReq*/
9258
9259/**
9260 @brief Process Del BA Request function (called when Main FSM
9261 allows it)
9262
9263 @param pWDICtx: pointer to the WLAN DAL context
9264 pEventData: pointer to the event information structure
9265
9266 @see
9267 @return Result of the function call
9268*/
9269WDI_Status
9270WDI_ProcessDelBAReq
9271(
9272 WDI_ControlBlockType* pWDICtx,
9273 WDI_EventInfoType* pEventData
9274)
9275{
9276 WDI_DelBAReqParamsType* pwdiDelBAParams;
9277 WDI_DelBARspCb wdiDelBARspCb;
9278 wpt_uint8 ucCurrentBSSSesIdx = 0;
9279 WDI_BSSSessionType* pBSSSes = NULL;
9280 wpt_uint8* pSendBuffer = NULL;
9281 wpt_uint16 usDataOffset = 0;
9282 wpt_uint16 usSendSize = 0;
9283 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9284 wpt_macAddr macBSSID;
9285 tDelBAParams halDelBAparam;
9286 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9287
9288 /*-------------------------------------------------------------------------
9289 Sanity check
9290 -------------------------------------------------------------------------*/
9291 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9292 ( NULL == pEventData->pCBfnc ))
9293 {
9294 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9295 "%s: Invalid parameters", __FUNCTION__);
9296 WDI_ASSERT(0);
9297 return WDI_STATUS_E_FAILURE;
9298 }
9299
9300 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9301 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9302 /*-------------------------------------------------------------------------
9303 Check to see if we are in the middle of an association, if so queue, if
9304 not it means it is free to process request
9305 -------------------------------------------------------------------------*/
9306 wpalMutexAcquire(&pWDICtx->wptMutex);
9307
9308 /*------------------------------------------------------------------------
9309 Find the BSS for which the request is made
9310 ------------------------------------------------------------------------*/
9311 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9312 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
9313 &macBSSID))
9314 {
9315 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9316 "This station does not exist in the WDI Station Table %d");
9317 wpalMutexRelease(&pWDICtx->wptMutex);
9318 return WDI_STATUS_E_FAILURE;
9319 }
9320
9321 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
9322
9323 if ( NULL == pBSSSes )
9324 {
9325 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9326 "Association sequence for this BSS does not yet exist");
9327
9328 wpalMutexRelease(&pWDICtx->wptMutex);
9329 return WDI_STATUS_E_NOT_ALLOWED;
9330 }
9331
9332 /*------------------------------------------------------------------------
9333 Check if this BSS is being currently processed or queued,
9334 if queued - queue the new request as well
9335 ------------------------------------------------------------------------*/
9336 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9337 {
9338 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9339 "Association sequence for this BSS exists but currently queued");
9340
9341 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9342 wpalMutexRelease(&pWDICtx->wptMutex);
9343 return wdiStatus;
9344 }
9345
9346 wpalMutexRelease(&pWDICtx->wptMutex);
9347 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
9348 sizeof(halDelBAparam),
9349 &pSendBuffer, &usDataOffset, &usSendSize))||
9350 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9351 {
9352 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9353 "Unable to get send buffer for DEL BA req %x %x %x",
9354 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9355 WDI_ASSERT(0);
9356 return WDI_STATUS_E_FAILURE;
9357 }
9358
9359 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9360 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9361 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9362
9363 wpalMemoryCopy( pSendBuffer+usDataOffset,
9364 &halDelBAparam,
9365 sizeof(halDelBAparam));
9366
9367 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
9368 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
9369
9370 /*-------------------------------------------------------------------------
9371 Send Start Request to HAL
9372 -------------------------------------------------------------------------*/
9373 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9374 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
9375}/*WDI_ProcessDelBAReq*/
9376
9377#ifdef FEATURE_WLAN_CCX
9378
9379WDI_Status
9380WDI_ProcessTSMStatsReq
9381(
9382 WDI_ControlBlockType* pWDICtx,
9383 WDI_EventInfoType* pEventData
9384)
9385{
9386 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9387 WDI_TsmRspCb wdiTSMRspCb;
9388 wpt_uint8 ucCurrentBSSSesIdx = 0;
9389 WDI_BSSSessionType* pBSSSes = NULL;
9390 wpt_uint8* pSendBuffer = NULL;
9391 wpt_uint16 usDataOffset = 0;
9392 wpt_uint16 usSendSize = 0;
9393 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9394 tTsmStatsParams halTsmStatsReqParams = {0};
9395
9396 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9397
9398 /*-------------------------------------------------------------------------
9399 Sanity check
9400 -------------------------------------------------------------------------*/
9401 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9402 ( NULL == pEventData->pCBfnc ))
9403 {
9404 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9405 "%s: Invalid parameters", __FUNCTION__);
9406 WDI_ASSERT(0);
9407 return WDI_STATUS_E_FAILURE;
9408 }
9409
9410 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9411 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9412 /*-------------------------------------------------------------------------
9413 Check to see if we are in the middle of an association, if so queue, if
9414 not it means it is free to process request
9415 -------------------------------------------------------------------------*/
9416 wpalMutexAcquire(&pWDICtx->wptMutex);
9417
9418 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9419 if ( NULL == pBSSSes )
9420 {
9421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9422 "Association sequence for this BSS does not yet exist");
9423
9424 wpalMutexRelease(&pWDICtx->wptMutex);
9425 return WDI_STATUS_E_NOT_ALLOWED;
9426 }
9427
9428 /*------------------------------------------------------------------------
9429 Check if this BSS is being currently processed or queued,
9430 if queued - queue the new request as well
9431 ------------------------------------------------------------------------*/
9432 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9433 {
9434 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
9435 "Association sequence for this BSS exists but currently queued");
9436
9437 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9438 wpalMutexRelease(&pWDICtx->wptMutex);
9439 return wdiStatus;
9440 }
9441
9442 wpalMutexRelease(&pWDICtx->wptMutex);
9443 /*-----------------------------------------------------------------------
9444 Get message buffer
9445 ! TO DO : proper conversion into the HAL Message Request Format
9446 -----------------------------------------------------------------------*/
9447 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9448 sizeof(halTsmStatsReqParams),
9449 &pSendBuffer, &usDataOffset, &usSendSize))||
9450 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9451 {
9452 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9453 "Unable to get send buffer in set bss key req %x %x %x",
9454 pEventData, pwdiTSMParams, wdiTSMRspCb);
9455 WDI_ASSERT(0);
9456 return WDI_STATUS_E_FAILURE;
9457 }
9458
9459 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9460 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9461 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9462 WDI_MAC_ADDR_LEN);
9463 wpalMemoryCopy( pSendBuffer+usDataOffset,
9464 &halTsmStatsReqParams,
9465 sizeof(halTsmStatsReqParams));
9466
9467 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9468 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9469
9470 /*-------------------------------------------------------------------------
9471 Send TSM Stats Request to HAL
9472 -------------------------------------------------------------------------*/
9473 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9474 wdiTSMRspCb, pEventData->pUserData,
9475 WDI_TSM_STATS_RESP);
9476}/*WDI_ProcessTSMStatsReq*/
9477
9478#endif
9479
9480
9481/**
9482 @brief Process Flush AC Request function (called when Main FSM
9483 allows it)
9484
9485 @param pWDICtx: pointer to the WLAN DAL context
9486 pEventData: pointer to the event information structure
9487
9488 @see
9489 @return Result of the function call
9490*/
9491WDI_Status
9492WDI_ProcessFlushAcReq
9493(
9494 WDI_ControlBlockType* pWDICtx,
9495 WDI_EventInfoType* pEventData
9496)
9497{
9498 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9499 WDI_FlushAcRspCb wdiFlushAcRspCb;
9500 wpt_uint8* pSendBuffer = NULL;
9501 wpt_uint16 usDataOffset = 0;
9502 wpt_uint16 usSendSize = 0;
9503 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9504
9505 /*-------------------------------------------------------------------------
9506 Sanity check
9507 -------------------------------------------------------------------------*/
9508 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9509 ( NULL == pEventData->pCBfnc ))
9510 {
9511 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9512 "%s: Invalid parameters", __FUNCTION__);
9513 WDI_ASSERT(0);
9514 return WDI_STATUS_E_FAILURE;
9515 }
9516
9517 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9518 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9519 /*-----------------------------------------------------------------------
9520 Get message buffer
9521 ! TO DO : proper conversion into the HAL Message Request Format
9522 -----------------------------------------------------------------------*/
9523 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
9524 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9525 &pSendBuffer, &usDataOffset, &usSendSize))||
9526 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9527 {
9528 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9529 "Unable to get send buffer in set bss key req %x %x %x",
9530 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9531 WDI_ASSERT(0);
9532 return WDI_STATUS_E_FAILURE;
9533 }
9534
9535 wpalMemoryCopy( pSendBuffer+usDataOffset,
9536 &pwdiFlushAcParams->wdiFlushAcInfo,
9537 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
9538
9539 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
9540 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
9541
9542 /*-------------------------------------------------------------------------
9543 Send Start Request to HAL
9544 -------------------------------------------------------------------------*/
9545 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9546 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
9547}/*WDI_ProcessFlushAcReq*/
9548
9549/**
9550 @brief Process BT AMP event Request function (called when Main
9551 FSM allows it)
9552
9553 @param pWDICtx: pointer to the WLAN DAL context
9554 pEventData: pointer to the event information structure
9555
9556 @see
9557 @return Result of the function call
9558*/
9559WDI_Status
9560WDI_ProcessBtAmpEventReq
9561(
9562 WDI_ControlBlockType* pWDICtx,
9563 WDI_EventInfoType* pEventData
9564)
9565{
9566 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9567 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
9568 wpt_uint8* pSendBuffer = NULL;
9569 wpt_uint16 usDataOffset = 0;
9570 wpt_uint16 usSendSize = 0;
9571
9572 tBtAmpEventMsg haltBtAmpEventMsg;
9573 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9574
9575 /*-------------------------------------------------------------------------
9576 Sanity check
9577 -------------------------------------------------------------------------*/
9578 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9579 ( NULL == pEventData->pCBfnc ))
9580 {
9581 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9582 "%s: Invalid parameters", __FUNCTION__);
9583 WDI_ASSERT(0);
9584 return WDI_STATUS_E_FAILURE;
9585 }
9586
9587 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9588 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9589 /*-----------------------------------------------------------------------
9590 Get message buffer
9591 ! TO DO : proper conversion into the HAL Message Request Format
9592 -----------------------------------------------------------------------*/
9593 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
9594 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9595 &pSendBuffer, &usDataOffset, &usSendSize))||
9596 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9597 {
9598 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9599 "Unable to get send buffer in BT AMP event req %x %x %x",
9600 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9601 WDI_ASSERT(0);
9602 return WDI_STATUS_E_FAILURE;
9603 }
9604
9605 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
9606 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
9607 wpalMemoryCopy( pSendBuffer+usDataOffset,
9608 &haltBtAmpEventMsg.btAmpEventParams,
9609 sizeof(haltBtAmpEventMsg.btAmpEventParams));
9610
9611 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
9612 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
9613
9614 /*-------------------------------------------------------------------------
9615 Send Start Request to HAL
9616 -------------------------------------------------------------------------*/
9617 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9618 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
9619}/*WDI_ProcessBtAmpEventReq*/
9620
9621/**
9622 @brief Process Add STA self Request function (called when Main FSM
9623 allows it)
9624
9625 @param pWDICtx: pointer to the WLAN DAL context
9626 pEventData: pointer to the event information structure
9627
9628 @see
9629 @return Result of the function call
9630*/
9631WDI_Status
9632WDI_ProcessAddSTASelfReq
9633(
9634 WDI_ControlBlockType* pWDICtx,
9635 WDI_EventInfoType* pEventData
9636)
9637{
9638 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9639 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
9640 wpt_uint8* pSendBuffer = NULL;
9641 wpt_uint16 usDataOffset = 0;
9642 wpt_uint16 usSendSize = 0;
9643 tAddStaSelfParams halAddSTASelfParams;
9644 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9645
9646 /*-------------------------------------------------------------------------
9647 Sanity check
9648 -------------------------------------------------------------------------*/
9649 if (( NULL == pEventData ) ||
9650 ( NULL == pEventData->pEventData) ||
9651 ( NULL == pEventData->pCBfnc))
9652 {
9653 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9654 "%s: Invalid parameters", __FUNCTION__);
9655 WDI_ASSERT(0);
9656 return WDI_STATUS_E_FAILURE;
9657 }
9658
9659 pwdiAddSTASelfReqParams =
9660 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
9661 wdiAddSTASelfReqRspCb =
9662 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9663 /*-----------------------------------------------------------------------
9664 Get message buffer
9665 -----------------------------------------------------------------------*/
9666 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9667 WDI_ADD_STA_SELF_REQ,
9668 sizeof(tAddStaSelfParams),
9669 &pSendBuffer, &usDataOffset, &usSendSize))||
9670 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9671 {
9672 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9673 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9674 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9675 WDI_ASSERT(0);
9676 return WDI_STATUS_E_FAILURE;
9677 }
9678
9679 /* Cache the request for response processing */
9680 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
9681 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9682
9683 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
9684 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9685
9686 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9687 sizeof(tAddStaSelfParams));
9688
9689 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
9690 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
9691
9692 /*-------------------------------------------------------------------------
9693 Send Update Probe Resp Template Request to HAL
9694 -------------------------------------------------------------------------*/
9695 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9696 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9697 WDI_ADD_STA_SELF_RESP);
9698}/*WDI_ProcessAddSTASelfReq*/
9699
9700
9701
9702/**
9703 @brief Process Del Sta Self Request function (called when Main
9704 FSM allows it)
9705
9706 @param pWDICtx: pointer to the WLAN DAL context
9707 pEventData: pointer to the event information structure
9708
9709 @see
9710 @return Result of the function call
9711*/
9712WDI_Status
9713WDI_ProcessDelSTASelfReq
9714(
9715 WDI_ControlBlockType* pWDICtx,
9716 WDI_EventInfoType* pEventData
9717)
9718{
9719 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9720 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
9721 wpt_uint8* pSendBuffer = NULL;
9722 wpt_uint16 usDataOffset = 0;
9723 wpt_uint16 usSendSize = 0;
9724 tDelStaSelfParams halSetDelSelfSTAParams;
9725 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9726
9727 /*-------------------------------------------------------------------------
9728 Sanity check
9729 -------------------------------------------------------------------------*/
9730 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9731 ( NULL == pEventData->pCBfnc ))
9732 {
9733 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9734 "%s: Invalid parameters", __FUNCTION__);
9735 WDI_ASSERT(0);
9736 return WDI_STATUS_E_FAILURE;
9737 }
9738
9739 pwdiDelStaSelfReqParams =
9740 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9741 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9742
9743 /*-----------------------------------------------------------------------
9744 Get message buffer
9745 ! TO DO : proper conversion into the HAL Message Request Format
9746 -----------------------------------------------------------------------*/
9747 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
9748 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9749 &pSendBuffer, &usDataOffset, &usSendSize))||
9750 ( usSendSize <
9751 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9752 {
9753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9754 "Unable to get send buffer in Del Sta Self req %x %x %x",
9755 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9756 WDI_ASSERT(0);
9757 return WDI_STATUS_E_FAILURE;
9758 }
9759
9760 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
9761 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9762
9763 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9764 sizeof(tDelStaSelfParams));
9765
9766 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
9767 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
9768
9769 /*-------------------------------------------------------------------------
9770 Send Start Request to HAL
9771 -------------------------------------------------------------------------*/
9772 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9773 wdiDelStaSelfRspCb, pEventData->pUserData,
9774 WDI_DEL_STA_SELF_RESP);
9775
9776}
9777
9778
9779/**
9780 @brief Process Host Resume Request function (called when Main
9781 FSM allows it)
9782
9783 @param pWDICtx: pointer to the WLAN DAL context
9784 pEventData: pointer to the event information structure
9785
9786 @see
9787 @return Result of the function call
9788*/
9789WDI_Status
9790WDI_ProcessHostResumeReq
9791(
9792 WDI_ControlBlockType* pWDICtx,
9793 WDI_EventInfoType* pEventData
9794)
9795{
9796 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
9797 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
9798 wpt_uint8* pSendBuffer = NULL;
9799 wpt_uint16 usDataOffset = 0;
9800 wpt_uint16 usSendSize = 0;
9801 tHalWlanHostResumeReqParam halResumeReqParams;
9802
9803 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9804
9805 /*-------------------------------------------------------------------------
9806 Sanity check
9807 -------------------------------------------------------------------------*/
9808 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9809 ( NULL == pEventData->pCBfnc ))
9810 {
9811 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9812 "%s: Invalid parameters ",__FUNCTION__);
9813 WDI_ASSERT(0);
9814 return WDI_STATUS_E_FAILURE;
9815 }
9816
9817 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
9818 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
9819
9820 /*-----------------------------------------------------------------------
9821 Get message buffer
9822 -----------------------------------------------------------------------*/
9823 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9824 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
9825 &pSendBuffer, &usDataOffset, &usSendSize))||
9826 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
9827 {
9828 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9829 "Unable to get send buffer in Start In Nav Meas req %x %x %x",
9830 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
9831 WDI_ASSERT(0);
9832 return WDI_STATUS_E_FAILURE;
9833 }
9834
9835 halResumeReqParams.configuredMcstBcstFilterSetting =
9836 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
9837
9838 wpalMemoryCopy( pSendBuffer+usDataOffset,
9839 &halResumeReqParams,
9840 sizeof(halResumeReqParams));
9841
9842 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
9843 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
9844
9845 /*-------------------------------------------------------------------------
9846 Send Start Request to HAL
9847 -------------------------------------------------------------------------*/
9848 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9849 wdiHostResumeRspCb, pEventData->pUserData,
9850 WDI_HOST_RESUME_RESP);
9851}/*WDI_ProcessHostResumeReq*/
9852
9853/**
9854 @brief Process set Tx Per Tracking Parameters Request function (called
9855 when Main FSM allows it)
9856
9857 @param pWDICtx: pointer to the WLAN DAL context
9858 pEventData: pointer to the event information structure
9859
9860 @see
9861 @return Result of the function call
9862*/
9863WDI_Status
9864WDI_ProcessSetTxPerTrackingReq
9865(
9866 WDI_ControlBlockType* pWDICtx,
9867 WDI_EventInfoType* pEventData
9868)
9869{
9870 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
9871 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
9872 wpt_uint8* pSendBuffer = NULL;
9873 wpt_uint16 usDataOffset = 0;
9874 wpt_uint16 usSendSize = 0;
9875 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
9876 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9877
9878 /*-------------------------------------------------------------------------
9879 Sanity check
9880 -------------------------------------------------------------------------*/
9881 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9882 ( NULL == pEventData->pCBfnc ))
9883 {
9884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9885 "%s: Invalid parameters ",__FUNCTION__);
9886 WDI_ASSERT(0);
9887 return WDI_STATUS_E_FAILURE;
9888 }
9889
9890 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
9891 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
9892
9893 /*-----------------------------------------------------------------------
9894 Get message buffer
9895 ! TO DO : proper conversion into the HAL Message Request Format
9896 -----------------------------------------------------------------------*/
9897 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
9898 sizeof(halTxPerTrackingReqParam),
9899 &pSendBuffer, &usDataOffset, &usSendSize))||
9900 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
9901 {
9902 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9903 "Unable to get send buffer in set tx per tracking req %x %x %x",
9904 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
9905 WDI_ASSERT(0);
9906 return WDI_STATUS_E_FAILURE;
9907 }
9908
9909 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
9910 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
9911 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
9912 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
9913
9914 wpalMemoryCopy( pSendBuffer+usDataOffset,
9915 &halTxPerTrackingReqParam,
9916 sizeof(halTxPerTrackingReqParam));
9917
9918 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
9919 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
9920
9921 /*-------------------------------------------------------------------------
9922 Send Get STA Request to HAL
9923 -------------------------------------------------------------------------*/
9924 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9925 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
9926}/*WDI_ProcessSetTxPerTrackingReq*/
9927
9928/*=========================================================================
9929 Indications
9930=========================================================================*/
9931
9932/**
9933 @brief Process Suspend Indications function (called when Main FSM allows it)
9934
9935 @param pWDICtx: pointer to the WLAN DAL context
9936 pEventData: pointer to the event information structure
9937
9938 @see
9939 @return Result of the function call
9940*/
9941WDI_Status
9942WDI_ProcessHostSuspendInd
9943(
9944 WDI_ControlBlockType* pWDICtx,
9945 WDI_EventInfoType* pEventData
9946)
9947{
9948 WDI_SuspendParamsType *pSuspendIndParams;
9949 wpt_uint8* pSendBuffer = NULL;
9950 wpt_uint16 usDataOffset = 0;
9951 wpt_uint16 usSendSize = 0;
9952 WDI_Status wdiStatus;
9953 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
9954 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9955
9956 /*-------------------------------------------------------------------------
9957 Sanity check
9958 -------------------------------------------------------------------------*/
9959 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
9960 {
9961 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9962 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
9963 WDI_ASSERT(0);
9964 return WDI_STATUS_E_FAILURE;
9965 }
9966
9967 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
9968
9969 /*-----------------------------------------------------------------------
9970 Get message buffer
9971 -----------------------------------------------------------------------*/
9972 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9973 WDI_HOST_SUSPEND_IND,
9974 sizeof(halWlanSuspendIndparams),
9975 &pSendBuffer, &usDataOffset, &usSendSize))||
9976 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
9977 {
9978 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9979 "Unable to get send buffer in Suspend Ind ");
9980 WDI_ASSERT(0);
9981 return WDI_STATUS_E_FAILURE;
9982 }
9983
9984 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
9985 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
9986
9987 halWlanSuspendIndparams.activeSessionCount =
9988 WDI_GetActiveSessionsCount(pWDICtx);
9989
9990 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
9991 sizeof(tHalWlanHostSuspendIndParam));
9992
9993 /*-------------------------------------------------------------------------
9994 Send Suspend Request to HAL
9995 -------------------------------------------------------------------------*/
9996 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
9997 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
9998
9999 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
10000 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
10001}/*WDI_ProcessHostSuspendInd*/
10002
10003/*==========================================================================
10004 MISC CONTROL PROCESSING REQUEST API
10005==========================================================================*/
10006/**
10007 @brief Process Channel Switch Request function (called when
10008 Main FSM allows it)
10009
10010 @param pWDICtx: pointer to the WLAN DAL context
10011 pEventData: pointer to the event information structure
10012
10013 @see
10014 @return Result of the function call
10015*/
10016WDI_Status
10017WDI_ProcessChannelSwitchReq
10018(
10019 WDI_ControlBlockType* pWDICtx,
10020 WDI_EventInfoType* pEventData
10021)
10022{
10023 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10024 WDI_SwitchChRspCb wdiSwitchChRspCb;
10025 wpt_uint8* pSendBuffer = NULL;
10026 wpt_uint16 usDataOffset = 0;
10027 wpt_uint16 usSendSize = 0;
10028 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10029 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10030
10031 /*-------------------------------------------------------------------------
10032 Sanity check
10033 -------------------------------------------------------------------------*/
10034 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10035 ( NULL == pEventData->pCBfnc ))
10036 {
10037 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10038 "%s: Invalid parameters", __FUNCTION__);
10039 WDI_ASSERT(0);
10040 return WDI_STATUS_E_FAILURE;
10041 }
10042
10043 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10044 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10045 /*-----------------------------------------------------------------------
10046 Get message buffer
10047 ! TO DO : proper conversion into the HAL Message Request Format
10048 -----------------------------------------------------------------------*/
10049 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
10050 sizeof(halSwitchChannelReq.switchChannelParams),
10051 &pSendBuffer, &usDataOffset, &usSendSize))||
10052 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10053 {
10054 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10055 "Unable to get send buffer in channel switch req %x %x %x",
10056 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10057 WDI_ASSERT(0);
10058 return WDI_STATUS_E_FAILURE;
10059 }
10060
10061 halSwitchChannelReq.switchChannelParams.channelNumber =
10062 pwdiSwitchChParams->wdiChInfo.ucChannel;
10063#ifndef WLAN_FEATURE_VOWIFI
10064 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
10065 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10066#endif
10067 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
10068 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10069
10070#ifdef WLAN_FEATURE_VOWIFI
10071 halSwitchChannelReq.switchChannelParams.maxTxPower
10072 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
10073 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10074 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10075 WDI_MAC_ADDR_LEN);
10076 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10077 pwdiSwitchChParams->wdiChInfo.macBSSId,
10078 WDI_MAC_ADDR_LEN);
10079#endif
10080 wpalMemoryCopy( pSendBuffer+usDataOffset,
10081 &halSwitchChannelReq.switchChannelParams,
10082 sizeof(halSwitchChannelReq.switchChannelParams));
10083
10084 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
10085 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
10086
10087 /*-------------------------------------------------------------------------
10088 Send Switch Channel Request to HAL
10089 -------------------------------------------------------------------------*/
10090 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10091 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
10092}/*WDI_ProcessChannelSwitchReq*/
10093
10094/**
10095 @brief Process Config STA Request function (called when Main FSM
10096 allows it)
10097
10098 @param pWDICtx: pointer to the WLAN DAL context
10099 pEventData: pointer to the event information structure
10100
10101 @see
10102 @return Result of the function call
10103*/
10104WDI_Status
10105WDI_ProcessConfigStaReq
10106(
10107 WDI_ControlBlockType* pWDICtx,
10108 WDI_EventInfoType* pEventData
10109)
10110{
10111 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10112 WDI_ConfigSTARspCb wdiConfigSTARspCb;
10113 wpt_uint8 ucCurrentBSSSesIdx = 0;
10114 WDI_BSSSessionType* pBSSSes = NULL;
10115 wpt_uint8* pSendBuffer = NULL;
10116 wpt_uint16 usDataOffset = 0;
10117 wpt_uint16 usSendSize = 0;
10118 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10119
10120 tConfigStaReqMsg halConfigStaReqMsg;
10121 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10122
10123 /*-------------------------------------------------------------------------
10124 Sanity check
10125 -------------------------------------------------------------------------*/
10126 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10127 ( NULL == pEventData->pCBfnc ))
10128 {
10129 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10130 "%s: Invalid parameters", __FUNCTION__);
10131 WDI_ASSERT(0);
10132 return WDI_STATUS_E_FAILURE;
10133 }
10134
10135 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10136 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10137 /*-------------------------------------------------------------------------
10138 Check to see if we are in the middle of an association, if so queue, if
10139 not it means it is free to process request
10140 -------------------------------------------------------------------------*/
10141 wpalMutexAcquire(&pWDICtx->wptMutex);
10142
10143 /*------------------------------------------------------------------------
10144 Find the BSS for which the request is made
10145 ------------------------------------------------------------------------*/
10146 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10147 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10148 &pBSSSes);
10149
10150 if ( NULL == pBSSSes )
10151 {
10152 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10153 "Association sequence for this BSS does not yet exist");
10154
10155 wpalMutexRelease(&pWDICtx->wptMutex);
10156 return WDI_STATUS_E_NOT_ALLOWED;
10157 }
10158
10159 /*------------------------------------------------------------------------
10160 Check if this BSS is being currently processed or queued,
10161 if queued - queue the new request as well
10162 ------------------------------------------------------------------------*/
10163 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10164 {
10165 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10166 "Association sequence for this BSS exists but currently queued");
10167
10168 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10169 wpalMutexRelease(&pWDICtx->wptMutex);
10170 return wdiStatus;
10171 }
10172
10173 wpalMutexRelease(&pWDICtx->wptMutex);
10174 /*-----------------------------------------------------------------------
10175 Get message buffer
10176 -----------------------------------------------------------------------*/
10177 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10178 sizeof(halConfigStaReqMsg.configStaParams),
10179 &pSendBuffer, &usDataOffset, &usSendSize))||
10180 ( usSendSize < (usDataOffset + sizeof(halConfigStaReqMsg.configStaParams) )))
10181 {
10182 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10183 "Unable to get send buffer in config sta req %x %x %x",
10184 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10185 WDI_ASSERT(0);
10186 return WDI_STATUS_E_FAILURE;
10187 }
10188
10189 /*Copy the station context*/
10190 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.configStaParams,
10191 &pwdiConfigSTAParams->wdiReqInfo);
10192
10193 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10194 {
10195 /* Need to fill in the self STA Index */
10196 if ( WDI_STATUS_SUCCESS !=
10197 WDI_STATableFindStaidByAddr(pWDICtx,
10198 pwdiConfigSTAParams->wdiReqInfo.macSTA,
10199 (wpt_uint8*)&halConfigStaReqMsg.configStaParams.staIdx ))
10200 {
10201 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10202 "This station does not exist in the WDI Station Table %d");
10203 wpalMutexRelease(&pWDICtx->wptMutex);
10204 return WDI_STATUS_E_FAILURE;
10205 }
10206 }
10207 else
10208 {
10209 /* Need to fill in the STA Index to invalid, since at this point we have not
10210 yet received it from HAL */
10211 halConfigStaReqMsg.configStaParams.staIdx = WDI_STA_INVALID_IDX;
10212 }
10213
10214 /* Need to fill in the BSS index */
10215 halConfigStaReqMsg.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
10216
10217 wpalMemoryCopy( pSendBuffer+usDataOffset,
10218 &halConfigStaReqMsg.configStaParams,
10219 sizeof(halConfigStaReqMsg.configStaParams));
10220
10221 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
10222 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
10223
10224 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10225 pwdiConfigSTAParams,
10226 sizeof(pWDICtx->wdiCachedConfigStaReq));
10227
10228 /*-------------------------------------------------------------------------
10229 Send Config STA Request to HAL
10230 -------------------------------------------------------------------------*/
10231 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10232 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
10233}/*WDI_ProcessConfigStaReq*/
10234
10235
10236/**
10237 @brief Process Set Link State Request function (called when
10238 Main FSM allows it)
10239
10240 @param pWDICtx: pointer to the WLAN DAL context
10241 pEventData: pointer to the event information structure
10242
10243 @see
10244 @return Result of the function call
10245*/
10246WDI_Status
10247WDI_ProcessSetLinkStateReq
10248(
10249 WDI_ControlBlockType* pWDICtx,
10250 WDI_EventInfoType* pEventData
10251)
10252{
10253 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10254 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
10255 wpt_uint8 ucCurrentBSSSesIdx = 0;
10256 WDI_BSSSessionType* pBSSSes = NULL;
10257 wpt_uint8* pSendBuffer = NULL;
10258 wpt_uint16 usDataOffset = 0;
10259 wpt_uint16 usSendSize = 0;
10260 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10261 tLinkStateParams halLinkStateReqMsg;
10262 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10263
10264 /*-------------------------------------------------------------------------
10265 Sanity check
10266 -------------------------------------------------------------------------*/
10267 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10268 ( NULL == pEventData->pCBfnc ))
10269 {
10270 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10271 "%s: Invalid parameters", __FUNCTION__);
10272 WDI_ASSERT(0);
10273 return WDI_STATUS_E_FAILURE;
10274 }
10275
10276 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10277 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10278 /*-------------------------------------------------------------------------
10279 Check to see if we are in the middle of an association, if so queue, if
10280 not it means it is free to process request
10281 -------------------------------------------------------------------------*/
10282 wpalMutexAcquire(&pWDICtx->wptMutex);
10283
10284 /*------------------------------------------------------------------------
10285 Find the BSS for which the request is made
10286 ------------------------------------------------------------------------*/
10287 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10288 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10289 &pBSSSes);
10290
10291 if ( NULL == pBSSSes )
10292 {
10293 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
10294 "Set link request received outside association session");
10295 }
10296 else
10297 {
10298 /*------------------------------------------------------------------------
10299 Check if this BSS is being currently processed or queued,
10300 if queued - queue the new request as well
10301 ------------------------------------------------------------------------*/
10302 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10303 {
10304 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10305 "Association sequence for this BSS exists but currently queued");
10306
10307 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10308 wpalMutexRelease(&pWDICtx->wptMutex);
10309 return wdiStatus;
10310 }
10311 }
10312 /* If the link is set to enter IDLE - the Session allocated for this BSS
10313 will be deleted on the Set Link State response coming from HAL
10314 - cache the request for response processing */
10315 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
10316 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10317
10318 wpalMutexRelease(&pWDICtx->wptMutex);
10319 /*-----------------------------------------------------------------------
10320 Get message buffer
10321 ! TO DO : proper conversion into the HAL Message Request Format
10322 -----------------------------------------------------------------------*/
10323
10324 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
10325 sizeof(halLinkStateReqMsg),
10326 &pSendBuffer, &usDataOffset, &usSendSize))||
10327 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10328 {
10329 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10330 "Unable to get send buffer in set bss key req %x %x %x",
10331 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10332 WDI_ASSERT(0);
10333 return WDI_STATUS_E_FAILURE;
10334 }
10335
10336 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10337 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10338
10339 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10340 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10341
10342 halLinkStateReqMsg.state =
10343 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10344
10345 wpalMemoryCopy( pSendBuffer+usDataOffset,
10346 &halLinkStateReqMsg,
10347 sizeof(halLinkStateReqMsg));
10348
10349 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
10350 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
10351
10352 /*-------------------------------------------------------------------------
10353 Send Set Link State Request to HAL
10354 -------------------------------------------------------------------------*/
10355 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10356 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
10357}/*WDI_ProcessSetLinkStateReq*/
10358
10359
10360/**
10361 @brief Process Get Stats Request function (called when Main FSM
10362 allows it)
10363
10364 @param pWDICtx: pointer to the WLAN DAL context
10365 pEventData: pointer to the event information structure
10366
10367 @see
10368 @return Result of the function call
10369*/
10370WDI_Status
10371WDI_ProcessGetStatsReq
10372(
10373 WDI_ControlBlockType* pWDICtx,
10374 WDI_EventInfoType* pEventData
10375)
10376{
10377 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10378 WDI_GetStatsRspCb wdiGetStatsRspCb;
10379 wpt_uint8* pSendBuffer = NULL;
10380 wpt_uint16 usDataOffset = 0;
10381 wpt_uint16 usSendSize = 0;
10382 wpt_uint8 ucCurrentBSSSesIdx = 0;
10383 WDI_BSSSessionType* pBSSSes = NULL;
10384 wpt_macAddr macBSSID;
10385 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10386 tHalStatsReqMsg halStatsReqMsg;
10387 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10388
10389 /*-------------------------------------------------------------------------
10390 Sanity check
10391 -------------------------------------------------------------------------*/
10392 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10393 ( NULL == pEventData->pCBfnc ) )
10394 {
10395 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10396 "%s: Invalid parameters", __FUNCTION__);
10397 WDI_ASSERT(0);
10398 return WDI_STATUS_E_FAILURE;
10399 }
10400
10401 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10402 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10403
10404 /*-------------------------------------------------------------------------
10405 Check to see if we are in the middle of an association, if so queue, if
10406 not it means it is free to process request
10407 -------------------------------------------------------------------------*/
10408 wpalMutexAcquire(&pWDICtx->wptMutex);
10409
10410 /*------------------------------------------------------------------------
10411 Find the BSS for which the request is made
10412 ------------------------------------------------------------------------*/
10413 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10414 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
10415 &macBSSID))
10416 {
10417 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10418 "This station does not exist in the WDI Station Table %d");
10419 wpalMutexRelease(&pWDICtx->wptMutex);
10420 return WDI_STATUS_E_FAILURE;
10421 }
10422
10423 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10424 if ( NULL == pBSSSes )
10425 {
10426 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10427 "Association sequence for this BSS does not yet exist");
10428
10429 wpalMutexRelease(&pWDICtx->wptMutex);
10430 return WDI_STATUS_E_NOT_ALLOWED;
10431 }
10432
10433 /*------------------------------------------------------------------------
10434 Check if this BSS is being currently processed or queued,
10435 if queued - queue the new request as well
10436 ------------------------------------------------------------------------*/
10437 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10438 {
10439 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10440 "Association sequence for this BSS exists but currently queued");
10441
10442 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10443 wpalMutexRelease(&pWDICtx->wptMutex);
10444 return wdiStatus;
10445 }
10446
10447
10448 wpalMutexRelease(&pWDICtx->wptMutex);
10449
10450 /*-----------------------------------------------------------------------
10451 Get message buffer
10452 -----------------------------------------------------------------------*/
10453 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
10454 sizeof(halStatsReqMsg.statsReqParams),
10455 &pSendBuffer, &usDataOffset, &usSendSize))||
10456 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10457 {
10458 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10459 "Unable to get send buffer in set bss key req %x %x %x",
10460 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10461 WDI_ASSERT(0);
10462 return WDI_STATUS_E_FAILURE;
10463 }
10464
10465 halStatsReqMsg.statsReqParams.staId =
10466 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
10467 halStatsReqMsg.statsReqParams.statsMask =
10468 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
10469 wpalMemoryCopy( pSendBuffer+usDataOffset,
10470 &halStatsReqMsg.statsReqParams,
10471 sizeof(halStatsReqMsg.statsReqParams));
10472
10473 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
10474 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
10475
10476 /*-------------------------------------------------------------------------
10477 Send Get STA Request to HAL
10478 -------------------------------------------------------------------------*/
10479 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10480 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
10481}/*WDI_ProcessGetStatsReq*/
10482
10483/**
10484 @brief Process Update Cfg Request function (called when Main
10485 FSM allows it)
10486
10487 @param pWDICtx: pointer to the WLAN DAL context
10488 pEventData: pointer to the event information structure
10489
10490 @see
10491 @return Result of the function call
10492*/
10493WDI_Status
10494WDI_ProcessUpdateCfgReq
10495(
10496 WDI_ControlBlockType* pWDICtx,
10497 WDI_EventInfoType* pEventData
10498)
10499{
10500 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10501 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10502
10503 wpt_uint8* pSendBuffer = NULL;
10504 wpt_uint16 usDataOffset = 0;
10505 wpt_uint16 usSendSize = 0;
10506 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10507
10508 /*-------------------------------------------------------------------------
10509 Sanity check
10510 -------------------------------------------------------------------------*/
10511 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10512 ( NULL == pEventData->pCBfnc))
10513 {
10514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10515 "%s: Invalid parameters", __FUNCTION__);
10516 WDI_ASSERT(0);
10517 return WDI_STATUS_E_FAILURE;
10518 }
10519
10520 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10521 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10522
10523 /*-----------------------------------------------------------------------
10524 Get message buffer
10525 ! TO DO : proper conversion into the HAL Message Request Format
10526 -----------------------------------------------------------------------*/
10527
10528 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
10529 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10530 &pSendBuffer, &usDataOffset, &usSendSize))||
10531 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10532 {
10533 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10534 "Unable to get send buffer in set bss key req %x %x %x",
10535 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10536 WDI_ASSERT(0);
10537 return WDI_STATUS_E_FAILURE;
10538 }
10539
10540 wpalMemoryCopy( pSendBuffer+usDataOffset,
10541 &pwdiUpdateCfgParams->uConfigBufferLen,
10542 sizeof(wpt_uint32));
10543 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10544 pwdiUpdateCfgParams->pConfigBuffer,
10545 pwdiUpdateCfgParams->uConfigBufferLen);
10546
10547 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
10548 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
10549
10550 /*-------------------------------------------------------------------------
10551 Send Update Cfg Request to HAL
10552 -------------------------------------------------------------------------*/
10553
10554 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10555 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
10556
10557}/*WDI_ProcessUpdateCfgReq*/
10558
10559
10560/**
10561 @brief Process Add BA Request function (called when Main FSM
10562 allows it)
10563
10564 @param pWDICtx: pointer to the WLAN DAL context
10565 pEventData: pointer to the event information structure
10566
10567 @see
10568 @return Result of the function call
10569*/
10570WDI_Status
10571WDI_ProcessAddBAReq
10572(
10573 WDI_ControlBlockType* pWDICtx,
10574 WDI_EventInfoType* pEventData
10575)
10576{
10577 WDI_AddBAReqParamsType* pwdiAddBAParams;
10578 WDI_AddBARspCb wdiAddBARspCb;
10579 wpt_uint8 ucCurrentBSSSesIdx = 0;
10580 WDI_BSSSessionType* pBSSSes = NULL;
10581 wpt_uint8* pSendBuffer = NULL;
10582 wpt_uint16 usDataOffset = 0;
10583 wpt_uint16 usSendSize = 0;
10584 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10585 wpt_macAddr macBSSID;
10586
10587 tAddBAReqMsg halAddBAReq;
10588 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10589
10590 /*-------------------------------------------------------------------------
10591 Sanity check
10592 -------------------------------------------------------------------------*/
10593 if (( NULL == pEventData ) ||
10594 ( NULL == pEventData->pEventData) ||
10595 ( NULL == pEventData->pCBfnc ))
10596 {
10597 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10598 "%s: Invalid parameters", __FUNCTION__);
10599 WDI_ASSERT(0);
10600 return WDI_STATUS_E_FAILURE;
10601 }
10602
10603 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10604 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10605
10606 /*-------------------------------------------------------------------------
10607 Check to see if we are in the middle of an association, if so queue, if
10608 not it means it is free to process request
10609 -------------------------------------------------------------------------*/
10610 wpalMutexAcquire(&pWDICtx->wptMutex);
10611
10612 /*------------------------------------------------------------------------
10613 Find the BSS for which the request is made
10614 ------------------------------------------------------------------------*/
10615 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10616 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
10617 &macBSSID))
10618 {
10619 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10620 "This station does not exist in the WDI Station Table %d");
10621 wpalMutexRelease(&pWDICtx->wptMutex);
10622 return WDI_STATUS_E_FAILURE;
10623 }
10624
10625 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10626 if ( NULL == pBSSSes )
10627 {
10628 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10629 "Association sequence for this BSS does not yet exist");
10630
10631 wpalMutexRelease(&pWDICtx->wptMutex);
10632 return WDI_STATUS_E_NOT_ALLOWED;
10633 }
10634
10635 /*------------------------------------------------------------------------
10636 Check if this BSS is being currently processed or queued,
10637 if queued - queue the new request as well
10638 ------------------------------------------------------------------------*/
10639 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10640 {
10641 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10642 "Association sequence for this BSS exists but currently queued");
10643
10644 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10645 wpalMutexRelease(&pWDICtx->wptMutex);
10646 return wdiStatus;
10647 }
10648
10649
10650 wpalMutexRelease(&pWDICtx->wptMutex);
10651 /*-----------------------------------------------------------------------
10652 Get message buffer
10653 -----------------------------------------------------------------------*/
10654 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
10655 sizeof(halAddBAReq.addBAParams),
10656 &pSendBuffer, &usDataOffset, &usSendSize))||
10657 ( usSendSize <
10658 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10659 {
10660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10661 "Unable to get send buffer in Add BA req %x %x %x",
10662 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10663 WDI_ASSERT(0);
10664 return WDI_STATUS_E_FAILURE;
10665 }
10666
10667 halAddBAReq.addBAParams.baSessionID =
10668 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10669 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10670#ifdef FEATURE_ON_CHIP_REORDERING
10671 halAddBAReq.addBAParams.isReorderingDoneOnChip =
10672 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10673#endif
10674
10675 wpalMemoryCopy( pSendBuffer+usDataOffset,
10676 &halAddBAReq.addBAParams,
10677 sizeof(halAddBAReq.addBAParams));
10678
10679 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
10680 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
10681
10682 /*-------------------------------------------------------------------------
10683 Send Start Request to HAL
10684 -------------------------------------------------------------------------*/
10685 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10686 wdiAddBARspCb, pEventData->pUserData,
10687 WDI_ADD_BA_RESP);
10688}/*WDI_ProcessAddBAReq*/
10689
10690
10691
10692/**
10693 @brief Process Trigger BA Request function (called when Main FSM
10694 allows it)
10695
10696 @param pWDICtx: pointer to the WLAN DAL context
10697 pEventData: pointer to the event information structure
10698
10699 @see
10700 @return Result of the function call
10701*/
10702WDI_Status
10703WDI_ProcessTriggerBAReq
10704(
10705 WDI_ControlBlockType* pWDICtx,
10706 WDI_EventInfoType* pEventData
10707)
10708{
10709 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10710 WDI_TriggerBARspCb wdiTriggerBARspCb;
10711 wpt_uint8 ucCurrentBSSSesIdx = 0;
10712 WDI_BSSSessionType* pBSSSes = NULL;
10713 wpt_uint8* pSendBuffer = NULL;
10714 wpt_uint16 usDataOffset = 0;
10715 wpt_uint16 usSendSize = 0;
10716 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
10717 wpt_uint16 index;
10718 wpt_macAddr macBSSID;
10719
10720 tTriggerBAReqMsg halTriggerBAReq;
10721 tTriggerBaReqCandidate* halTriggerBACandidate;
10722 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10723 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10724
10725 /*-------------------------------------------------------------------------
10726 Sanity check
10727 -------------------------------------------------------------------------*/
10728 if (( NULL == pEventData ) ||
10729 ( NULL == pEventData->pEventData ) ||
10730 ( NULL == pEventData->pCBfnc ))
10731 {
10732 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10733 "%s: Invalid parameters", __FUNCTION__);
10734 WDI_ASSERT(0);
10735 return WDI_STATUS_E_FAILURE;
10736 }
10737
10738 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10739 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10740 /*-------------------------------------------------------------------------
10741 Check to see if we are in the middle of an association, if so queue, if
10742 not it means it is free to process request
10743 -------------------------------------------------------------------------*/
10744 wpalMutexAcquire(&pWDICtx->wptMutex);
10745
10746 /*------------------------------------------------------------------------
10747 Find the BSS for which the request is made
10748 ------------------------------------------------------------------------*/
10749 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10750 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
10751 &macBSSID))
10752 {
10753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10754 "This station does not exist in the WDI Station Table %d");
10755 wpalMutexRelease(&pWDICtx->wptMutex);
10756 return WDI_STATUS_E_FAILURE;
10757 }
10758
10759 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10760 if ( NULL == pBSSSes )
10761 {
10762 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10763 "Association sequence for this BSS does not yet exist");
10764
10765 wpalMutexRelease(&pWDICtx->wptMutex);
10766 return WDI_STATUS_E_NOT_ALLOWED;
10767 }
10768
10769 /*------------------------------------------------------------------------
10770 Check if this BSS is being currently processed or queued,
10771 if queued - queue the new request as well
10772 ------------------------------------------------------------------------*/
10773 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10774 {
10775 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10776 "Association sequence for this BSS exists but currently queued");
10777
10778 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
10779 wpalMutexRelease(&pWDICtx->wptMutex);
10780 return wdiStatus;
10781 }
10782
10783
10784 wpalMutexRelease(&pWDICtx->wptMutex);
10785 /*-----------------------------------------------------------------------
10786 Get message buffer
10787 -----------------------------------------------------------------------*/
10788 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10789 WDI_TRIGGER_BA_REQ,
10790 sizeof(halTriggerBAReq.triggerBAParams) +
10791 (sizeof(tTriggerBaReqCandidate) *
10792 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
10793 &pSendBuffer, &usDataOffset, &usSendSize))||
10794 ( usSendSize <
10795 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
10796 (sizeof(tTriggerBaReqCandidate) *
10797 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
10798 {
10799 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10800 "Unable to get send buffer in Trigger BA req %x %x %x",
10801 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
10802 WDI_ASSERT(0);
10803 return WDI_STATUS_E_FAILURE;
10804 }
10805
10806 halTriggerBAReq.triggerBAParams.baSessionID =
10807 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
10808 halTriggerBAReq.triggerBAParams.baCandidateCnt =
10809 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
10810
10811 wpalMemoryCopy( pSendBuffer+usDataOffset,
10812 &halTriggerBAReq.triggerBAParams,
10813 sizeof(halTriggerBAReq.triggerBAParams));
10814
10815 wdiTriggerBACandidate =
10816 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
10817 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
10818 sizeof(halTriggerBAReq.triggerBAParams));
10819
10820 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
10821 index++)
10822 {
10823 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
10824 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
10825 halTriggerBACandidate++;
10826 wdiTriggerBACandidate++;
10827 }
10828
10829 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
10830 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
10831
10832 /*-------------------------------------------------------------------------
10833 Send Start Request to HAL
10834 -------------------------------------------------------------------------*/
10835 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10836 wdiTriggerBARspCb, pEventData->pUserData,
10837 WDI_TRIGGER_BA_RESP);
10838}/*WDI_ProcessTriggerBAReq*/
10839
10840
10841
10842/**
10843 @brief Process Update Beacon Params Request function (called when Main FSM
10844 allows it)
10845
10846 @param pWDICtx: pointer to the WLAN DAL context
10847 pEventData: pointer to the event information structure
10848
10849 @see
10850 @return Result of the function call
10851*/
10852WDI_Status
10853WDI_ProcessUpdateBeaconParamsReq
10854(
10855 WDI_ControlBlockType* pWDICtx,
10856 WDI_EventInfoType* pEventData
10857)
10858{
10859 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
10860 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
10861 wpt_uint8* pSendBuffer = NULL;
10862 wpt_uint16 usDataOffset = 0;
10863 wpt_uint16 usSendSize = 0;
10864 tUpdateBeaconParams halUpdateBeaconParams;
10865 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10866
10867 /*-------------------------------------------------------------------------
10868 Sanity check
10869 -------------------------------------------------------------------------*/
10870 if (( NULL == pEventData ) ||
10871 ( NULL == pEventData->pEventData) ||
10872 ( NULL == pEventData->pCBfnc))
10873 {
10874 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10875 "%s: Invalid parameters", __FUNCTION__);
10876 WDI_ASSERT(0);
10877 return WDI_STATUS_E_FAILURE;
10878 }
10879
10880 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
10881 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
10882 /*-----------------------------------------------------------------------
10883 Get message buffer
10884 -----------------------------------------------------------------------*/
10885 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
10886 sizeof(halUpdateBeaconParams),
10887 &pSendBuffer, &usDataOffset, &usSendSize))||
10888 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
10889 {
10890 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10891 "Unable to get send buffer in set bss key req %x %x %x",
10892 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
10893 WDI_ASSERT(0);
10894 return WDI_STATUS_E_FAILURE;
10895 }
10896
10897 /*BSS Index of the BSS*/
10898 halUpdateBeaconParams.bssIdx =
10899 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
10900 /*shortPreamble mode. HAL should update all the STA rates when it
10901 receives this message*/
10902 halUpdateBeaconParams.fShortPreamble =
10903 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
10904 /* short Slot time.*/
10905 halUpdateBeaconParams.fShortSlotTime =
10906 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
10907 /* Beacon Interval */
10908 halUpdateBeaconParams.beaconInterval =
10909 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
10910
10911 /*Protection related */
10912 halUpdateBeaconParams.llaCoexist =
10913 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
10914 halUpdateBeaconParams.llbCoexist =
10915 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
10916 halUpdateBeaconParams.llgCoexist =
10917 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
10918 halUpdateBeaconParams.ht20MhzCoexist =
10919 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
10920 halUpdateBeaconParams.llnNonGFCoexist =
10921 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
10922 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
10923 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
10924 halUpdateBeaconParams.fRIFSMode =
10925 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
10926 halUpdateBeaconParams.paramChangeBitmap =
10927 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
10928
10929 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
10930 sizeof(halUpdateBeaconParams));
10931
10932 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
10933 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
10934
10935 /*-------------------------------------------------------------------------
10936 Send Del TS Request to HAL
10937 -------------------------------------------------------------------------*/
10938 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10939 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
10940}/*WDI_ProcessUpdateBeaconParamsReq*/
10941
10942
10943
10944/**
10945 @brief Process Send Beacon template Request function (called when Main FSM
10946 allows it)
10947
10948 @param pWDICtx: pointer to the WLAN DAL context
10949 pEventData: pointer to the event information structure
10950
10951 @see
10952 @return Result of the function call
10953*/
10954WDI_Status
10955WDI_ProcessSendBeaconParamsReq
10956(
10957 WDI_ControlBlockType* pWDICtx,
10958 WDI_EventInfoType* pEventData
10959)
10960{
10961 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
10962 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
10963 wpt_uint8* pSendBuffer = NULL;
10964 wpt_uint16 usDataOffset = 0;
10965 wpt_uint16 usSendSize = 0;
10966 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10967
10968 tSendBeaconReqMsg halSendBeaconReq;
10969 /*-------------------------------------------------------------------------
10970 Sanity check
10971 -------------------------------------------------------------------------*/
10972 if (( NULL == pEventData ) ||
10973 ( NULL == pEventData->pEventData ) ||
10974 ( NULL == pEventData->pCBfnc ))
10975 {
10976 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10977 "%s: Invalid parameters", __FUNCTION__);
10978 WDI_ASSERT(0);
10979 return WDI_STATUS_E_FAILURE;
10980 }
10981
10982 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
10983 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
10984 /*-----------------------------------------------------------------------
10985 Get message buffer
10986 -----------------------------------------------------------------------*/
10987 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
10988 sizeof(halSendBeaconReq.sendBeaconParam),
10989 &pSendBuffer, &usDataOffset, &usSendSize))||
10990 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
10991 {
10992 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10993 "Unable to get send buffer in send beacon req %x %x %x",
10994 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
10995 WDI_ASSERT(0);
10996 return WDI_STATUS_E_FAILURE;
10997 }
10998
10999 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
11000 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
11001 WDI_MAC_ADDR_LEN);
11002 halSendBeaconReq.sendBeaconParam.beaconLength =
11003 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
11004 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
11005 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
11006 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
11007#ifdef WLAN_SOFTAP_FEATURE
11008 halSendBeaconReq.sendBeaconParam.timIeOffset =
11009 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
11010#endif
11011#ifdef WLAN_FEATURE_P2P
11012 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
11013 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11014#endif
11015
11016 wpalMemoryCopy( pSendBuffer+usDataOffset,
11017 &halSendBeaconReq.sendBeaconParam,
11018 sizeof(halSendBeaconReq.sendBeaconParam));
11019
11020 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
11021 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
11022
11023 /*-------------------------------------------------------------------------
11024 Send Del TS Request to HAL
11025 -------------------------------------------------------------------------*/
11026 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11027 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
11028}/*WDI_ProcessSendBeaconParamsReq*/
11029
11030/**
11031 @brief Process Update Beacon Params Request function (called when Main FSM
11032 allows it)
11033
11034 @param pWDICtx: pointer to the WLAN DAL context
11035 pEventData: pointer to the event information structure
11036
11037 @see
11038 @return Result of the function call
11039*/
11040WDI_Status
11041WDI_ProcessUpdateProbeRspTemplateReq
11042(
11043 WDI_ControlBlockType* pWDICtx,
11044 WDI_EventInfoType* pEventData
11045)
11046{
11047 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11048 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
11049 wpt_uint8* pSendBuffer = NULL;
11050 wpt_uint16 usDataOffset = 0;
11051 wpt_uint16 usSendSize = 0;
11052 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
11053 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11054
11055 /*-------------------------------------------------------------------------
11056 Sanity check
11057 -------------------------------------------------------------------------*/
11058 if (( NULL == pEventData ) ||
11059 ( NULL == pEventData->pEventData) ||
11060 ( NULL == pEventData->pCBfnc))
11061 {
11062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11063 "%s: Invalid parameters", __FUNCTION__);
11064 WDI_ASSERT(0);
11065 return WDI_STATUS_E_FAILURE;
11066 }
11067
11068 pwdiUpdateProbeRespTmplParams =
11069 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
11070 wdiUpdateProbeRespTmplRspCb =
11071 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11072 /*-----------------------------------------------------------------------
11073 Get message buffer
11074 -----------------------------------------------------------------------*/
11075 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
11076 sizeof(halUpdateProbeRspTmplParams),
11077 &pSendBuffer, &usDataOffset, &usSendSize))||
11078 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11079 {
11080 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11081 "Unable to get send buffer in set bss key req %x %x %x",
11082 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11083 WDI_ASSERT(0);
11084 return WDI_STATUS_E_FAILURE;
11085 }
11086
11087 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
11088 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
11089 WDI_MAC_ADDR_LEN);
11090
11091 halUpdateProbeRspTmplParams.probeRespTemplateLen =
11092 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11093
11094 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11095 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
11096 BEACON_TEMPLATE_SIZE);
11097
11098
11099 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11100 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11101 WDI_PROBE_REQ_BITMAP_IE_LEN);
11102
11103 wpalMemoryCopy( pSendBuffer+usDataOffset,
11104 &halUpdateProbeRspTmplParams,
11105 sizeof(halUpdateProbeRspTmplParams));
11106
11107 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
11108 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
11109
11110 /*-------------------------------------------------------------------------
11111 Send Update Probe Resp Template Request to HAL
11112 -------------------------------------------------------------------------*/
11113 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11114 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11115 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
11116}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11117
11118/**
11119 @brief Process NV blob download function (called when Main FSM
11120 allows it)
11121
11122 @param pWDICtx: pointer to the WLAN DAL context
11123 pEventData: pointer to the event information structure
11124
11125 @see
11126 @return Result of the function call
11127*/
11128WDI_Status
11129WDI_ProcessNvDownloadReq
11130(
11131 WDI_ControlBlockType* pWDICtx,
11132 WDI_EventInfoType* pEventData
11133)
11134{
11135
11136 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11137 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11138
11139 /*-------------------------------------------------------------------------
11140 Sanity check
11141 -------------------------------------------------------------------------*/
11142 if (( NULL == pEventData ) ||
11143 ( NULL == (pwdiNvDownloadReqParams =
11144 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
11145 ( NULL == (wdiNvDownloadRspCb =
11146 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11147 {
11148 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11149 "%s: Invalid parameters", __FUNCTION__);
11150 WDI_ASSERT(0);
11151 return WDI_STATUS_E_FAILURE;
11152 }
11153
11154 /*Intialize the Nv Blob Info */
11155 pWDICtx->wdiNvBlobInfo.usTotalFragment =
11156 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11157
11158 /*cache the wdi nv request message here if the the first fragment
11159 * To issue the request to HAL for the next fragment */
11160 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11161 {
11162 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11163 pwdiNvDownloadReqParams,
11164 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11165
11166 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11167 pWDICtx->pRspCBUserData = pEventData->pUserData;
11168 }
11169
11170 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11171}
11172
11173/**
11174 @brief Process Set Max Tx Power Request function (called when Main
11175 FSM allows it)
11176
11177 @param pWDICtx: pointer to the WLAN DAL context
11178 pEventData: pointer to the event information structure
11179
11180 @see
11181 @return Result of the function call
11182*/
11183WDI_Status WDI_ProcessSetMaxTxPowerReq
11184(
11185 WDI_ControlBlockType* pWDICtx,
11186 WDI_EventInfoType* pEventData
11187)
11188{
11189 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11190 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
11191 wpt_uint8* pSendBuffer = NULL;
11192 wpt_uint16 usDataOffset = 0;
11193 wpt_uint16 usSendSize = 0;
11194 tSetMaxTxPwrReq halSetMaxTxPower;
11195 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11196
11197 /*-------------------------------------------------------------------------
11198 Sanity check
11199 -------------------------------------------------------------------------*/
11200 if (( NULL == pEventData ) ||
11201 ( NULL == pEventData->pEventData ) ||
11202 ( NULL == pEventData->pCBfnc ))
11203 {
11204 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11205 "%s: Invalid parameters", __FUNCTION__);
11206 WDI_ASSERT(0);
11207 return WDI_STATUS_E_FAILURE;
11208 }
11209 pwdiSetMaxTxPowerParams =
11210 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
11211 wdiSetMaxTxPowerRspCb =
11212 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11213
11214 /*-----------------------------------------------------------------------
11215 Get message buffer
11216 -----------------------------------------------------------------------*/
11217if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
11218 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11219 &pSendBuffer, &usDataOffset, &usSendSize))||
11220 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
11221)))
11222 {
11223 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11224 "Unable to get Set Max Tx Power req %x %x %x",
11225 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11226 WDI_ASSERT(0);
11227 return WDI_STATUS_E_FAILURE;
11228 }
11229
11230 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11231 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11232 WDI_MAC_ADDR_LEN);
11233
11234 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11235 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11236 WDI_MAC_ADDR_LEN);
11237 halSetMaxTxPower.setMaxTxPwrParams.power =
11238 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
11239
11240 wpalMemoryCopy( pSendBuffer+usDataOffset,
11241 &halSetMaxTxPower.setMaxTxPwrParams,
11242 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
11243
11244 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
11245 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
11246
11247 /*-------------------------------------------------------------------------
11248 Send Del TS Request to HAL
11249 -------------------------------------------------------------------------*/
11250 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11251 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11252 WDI_SET_MAX_TX_POWER_RESP);
11253
11254}
11255
11256#ifdef WLAN_FEATURE_P2P
11257
11258/**
11259 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11260 allows it)
11261
11262 @param pWDICtx: pointer to the WLAN DAL context
11263 pEventData: pointer to the event information structure
11264
11265 @see
11266 @return Result of the function call
11267*/
11268WDI_Status
11269WDI_ProcessP2PGONOAReq
11270(
11271 WDI_ControlBlockType* pWDICtx,
11272 WDI_EventInfoType* pEventData
11273)
11274{
11275 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11276 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
11277 wpt_uint8* pSendBuffer = NULL;
11278 wpt_uint16 usDataOffset = 0;
11279 wpt_uint16 usSendSize = 0;
11280 tSetP2PGONOAParams halSetP2PGONOAParams;
11281 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11282
11283 /*-------------------------------------------------------------------------
11284 Sanity check
11285 -------------------------------------------------------------------------*/
11286 if (( NULL == pEventData ) ||
11287 ( NULL == pEventData->pEventData) ||
11288 ( NULL == pEventData->pCBfnc))
11289 {
11290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11291 "%s: Invalid parameters", __FUNCTION__);
11292 WDI_ASSERT(0);
11293 return WDI_STATUS_E_FAILURE;
11294 }
11295
11296 pwdiP2PGONOAReqParams =
11297 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
11298 wdiP2PGONOAReqRspCb =
11299 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11300 /*-----------------------------------------------------------------------
11301 Get message buffer
11302 -----------------------------------------------------------------------*/
11303 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11304 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
11305 sizeof(halSetP2PGONOAParams),
11306 &pSendBuffer, &usDataOffset, &usSendSize))||
11307 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11308 {
11309 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11310 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11311 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11312 WDI_ASSERT(0);
11313 return WDI_STATUS_E_FAILURE;
11314 }
11315
11316 halSetP2PGONOAParams.opp_ps =
11317 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
11318 halSetP2PGONOAParams.ctWindow =
11319 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11320 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
11321 halSetP2PGONOAParams.duration =
11322 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
11323 halSetP2PGONOAParams.interval =
11324 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
11325 halSetP2PGONOAParams.single_noa_duration =
11326 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
11327 halSetP2PGONOAParams.psSelection =
11328 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11329
11330 wpalMemoryCopy( pSendBuffer+usDataOffset,
11331 &halSetP2PGONOAParams,
11332 sizeof(halSetP2PGONOAParams));
11333
11334 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
11335 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
11336
11337 /*-------------------------------------------------------------------------
11338 Send Update Probe Resp Template Request to HAL
11339 -------------------------------------------------------------------------*/
11340 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11341 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11342 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
11343}/*WDI_ProcessP2PGONOAReq*/
11344
11345#endif
11346
11347
11348/**
11349 @brief Function to handle the ack from DXE once the power
11350 state is set.
11351 @param None
11352
11353 @see
11354 @return void
11355*/
11356void
11357WDI_SetPowerStateCb
11358(
11359 wpt_status status,
11360 unsigned int dxePhyAddr,
11361 void *pContext
11362)
11363{
11364 wpt_status wptStatus;
11365 WDI_ControlBlockType *pCB = NULL;
11366 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11367 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11368 {
11369 //it shouldn't happen, put an error msg
11370 }
11371 /*
11372 * Trigger the event to bring the Enter BMPS req function to come
11373 * out of wait
11374*/
11375 if( NULL != pContext )
11376 {
11377 pCB = (WDI_ControlBlockType *)pContext;
11378 }
11379 else
11380 {
11381 //put an error msg
11382 pCB = &gWDICb;
11383 }
11384 pCB->dxePhyAddr = dxePhyAddr;
11385 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11386 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11387 {
11388 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11389 "Failed to set an event");
11390
11391 WDI_ASSERT(0);
11392 }
11393 return;
11394}
11395
11396
11397/**
11398 @brief Process Enter IMPS Request function (called when
11399 Main FSM allows it)
11400
11401 @param pWDICtx: pointer to the WLAN DAL context
11402 pEventData: pointer to the event information structure
11403
11404 @see
11405 @return Result of the function call
11406*/
11407WDI_Status
11408WDI_ProcessEnterImpsReq
11409(
11410 WDI_ControlBlockType* pWDICtx,
11411 WDI_EventInfoType* pEventData
11412)
11413{
Jeff Johnson43971f52012-07-17 12:26:56 -070011414 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011415 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
11416 wpt_uint8* pSendBuffer = NULL;
11417 wpt_uint16 usDataOffset = 0;
11418 wpt_uint16 usSendSize = 0;
11419 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11420
11421 /*-------------------------------------------------------------------------
11422 Sanity check
11423 -------------------------------------------------------------------------*/
11424 if (( NULL == pEventData ) ||
11425 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11426 {
11427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11428 "%s: Invalid parameters", __FUNCTION__);
11429 WDI_ASSERT(0);
11430 return WDI_STATUS_E_FAILURE;
11431 }
11432
11433 /*-----------------------------------------------------------------------
11434 Get message buffer
11435 ! TO DO : proper conversion into the HAL Message Request Format
11436 -----------------------------------------------------------------------*/
11437 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
11438 0,
11439 &pSendBuffer, &usDataOffset, &usSendSize))||
11440 ( usSendSize < (usDataOffset )))
11441 {
11442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11443 "Unable to get send buffer in Enter IMPS req %x %x",
11444 pEventData, wdiEnterImpsRspCb);
11445 WDI_ASSERT(0);
11446 return WDI_STATUS_E_FAILURE;
11447 }
11448
11449 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011450 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11451 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011452 {
11453 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11454 "WDI Init failed to reset an event");
11455
11456 WDI_ASSERT(0);
11457 return VOS_STATUS_E_FAILURE;
11458 }
11459
11460 // notify DTS that we are entering IMPS
11461 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11462
11463 /*
11464 * Wait for the event to be set once the ACK comes back from DXE
11465 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011466 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11467 WDI_SET_POWER_STATE_TIMEOUT);
11468 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011469 {
11470 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11471 "WDI Init failed to wait on an event");
11472
11473 WDI_ASSERT(0);
11474 return VOS_STATUS_E_FAILURE;
11475 }
11476
11477 /*-------------------------------------------------------------------------
11478 Send Get STA Request to HAL
11479 -------------------------------------------------------------------------*/
11480 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11481 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
11482}/*WDI_ProcessEnterImpsReq*/
11483
11484/**
11485 @brief Process Exit IMPS Request function (called when
11486 Main FSM allows it)
11487
11488 @param pWDICtx: pointer to the WLAN DAL context
11489 pEventData: pointer to the event information structure
11490
11491 @see
11492 @return Result of the function call
11493*/
11494WDI_Status
11495WDI_ProcessExitImpsReq
11496(
11497 WDI_ControlBlockType* pWDICtx,
11498 WDI_EventInfoType* pEventData
11499)
11500{
11501 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
11502 wpt_uint8* pSendBuffer = NULL;
11503 wpt_uint16 usDataOffset = 0;
11504 wpt_uint16 usSendSize = 0;
11505 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11506
11507 /*-------------------------------------------------------------------------
11508 Sanity check
11509 -------------------------------------------------------------------------*/
11510 if (( NULL == pEventData ) ||
11511 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11512 {
11513 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11514 "%s: Invalid parameters", __FUNCTION__);
11515 WDI_ASSERT(0);
11516 return WDI_STATUS_E_FAILURE;
11517 }
11518
11519 /*-----------------------------------------------------------------------
11520 Get message buffer
11521 ! TO DO : proper conversion into the HAL Message Request Format
11522 -----------------------------------------------------------------------*/
11523 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
11524 0,
11525 &pSendBuffer, &usDataOffset, &usSendSize))||
11526 ( usSendSize < (usDataOffset )))
11527 {
11528 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11529 "Unable to get send buffer in Exit IMPS req %x %x",
11530 pEventData, wdiExitImpsRspCb);
11531 WDI_ASSERT(0);
11532 return WDI_STATUS_E_FAILURE;
11533 }
11534
11535 /*-------------------------------------------------------------------------
11536 Send Get STA Request to HAL
11537 -------------------------------------------------------------------------*/
11538 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11539 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
11540}/*WDI_ProcessExitImpsReq*/
11541
11542/**
11543 @brief Process Enter BMPS Request function (called when Main
11544 FSM allows it)
11545
11546 @param pWDICtx: pointer to the WLAN DAL context
11547 pEventData: pointer to the event information structure
11548
11549 @see
11550 @return Result of the function call
11551*/
11552WDI_Status
11553WDI_ProcessEnterBmpsReq
11554(
11555 WDI_ControlBlockType* pWDICtx,
11556 WDI_EventInfoType* pEventData
11557)
11558{
11559 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11560 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
11561 wpt_uint8* pSendBuffer = NULL;
11562 wpt_uint16 usDataOffset = 0;
11563 wpt_uint16 usSendSize = 0;
11564 tHalEnterBmpsReqParams enterBmpsReq;
Jeff Johnson43971f52012-07-17 12:26:56 -070011565 wpt_status wptStatus;
11566
Jeff Johnson295189b2012-06-20 16:38:30 -070011567 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11568
11569 /*-------------------------------------------------------------------------
11570 Sanity check
11571 -------------------------------------------------------------------------*/
11572 if (( NULL == pEventData ) ||
11573 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11574 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11575 {
11576 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11577 "%s: Invalid parameters", __FUNCTION__);
11578 WDI_ASSERT(0);
11579 return WDI_STATUS_E_FAILURE;
11580 }
11581
11582 /*-----------------------------------------------------------------------
11583 Get message buffer
11584 ! TO DO : proper conversion into the HAL Message Request Format
11585 -----------------------------------------------------------------------*/
11586 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
11587 sizeof(enterBmpsReq),
11588 &pSendBuffer, &usDataOffset, &usSendSize))||
11589 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11590 {
11591 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11592 "Unable to get send buffer in Enter BMPS req %x %x %x",
11593 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11594 WDI_ASSERT(0);
11595 return WDI_STATUS_E_FAILURE;
11596 }
11597
11598 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011599 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11600 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011601 {
11602 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11603 "WDI Init failed to reset an event");
11604
11605 WDI_ASSERT(0);
11606 return VOS_STATUS_E_FAILURE;
11607 }
11608
11609 // notify DTS that we are entering BMPS
11610 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11611
11612/*
11613 * Wait for the event to be set once the ACK comes back from DXE
11614 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011615 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11616 WDI_SET_POWER_STATE_TIMEOUT);
11617 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011618 {
11619 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11620 "WDI Init failed to wait on an event");
11621
11622 WDI_ASSERT(0);
11623 return VOS_STATUS_E_FAILURE;
11624 }
11625
11626 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11627
11628 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11629 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11630 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11631 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11632
11633 // For CCX and 11R Roaming
11634 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11635 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11636 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11637
11638 wpalMemoryCopy( pSendBuffer+usDataOffset,
11639 &enterBmpsReq,
11640 sizeof(enterBmpsReq));
11641
11642 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
11643 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
11644
11645 /*-------------------------------------------------------------------------
11646 Send Get STA Request to HAL
11647 -------------------------------------------------------------------------*/
11648 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11649 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
11650}/*WDI_ProcessEnterBmpsReq*/
11651
11652/**
11653 @brief Process Exit BMPS Request function (called when Main FSM
11654 allows it)
11655
11656 @param pWDICtx: pointer to the WLAN DAL context
11657 pEventData: pointer to the event information structure
11658
11659 @see
11660 @return Result of the function call
11661*/
11662WDI_Status
11663WDI_ProcessExitBmpsReq
11664(
11665 WDI_ControlBlockType* pWDICtx,
11666 WDI_EventInfoType* pEventData
11667)
11668{
11669 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11670 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
11671 wpt_uint8* pSendBuffer = NULL;
11672 wpt_uint16 usDataOffset = 0;
11673 wpt_uint16 usSendSize = 0;
11674 tHalExitBmpsReqParams exitBmpsReq;
11675 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11676
11677 /*-------------------------------------------------------------------------
11678 Sanity check
11679 -------------------------------------------------------------------------*/
11680 if (( NULL == pEventData ) ||
11681 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11682 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11683 {
11684 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11685 "%s: Invalid parameters", __FUNCTION__);
11686 WDI_ASSERT(0);
11687 return WDI_STATUS_E_FAILURE;
11688 }
11689
11690 /*-----------------------------------------------------------------------
11691 Get message buffer
11692 ! TO DO : proper conversion into the HAL Message Request Format
11693 -----------------------------------------------------------------------*/
11694 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
11695 sizeof(exitBmpsReq),
11696 &pSendBuffer, &usDataOffset, &usSendSize))||
11697 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11698 {
11699 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11700 "Unable to get send buffer in Exit BMPS req %x %x %x",
11701 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11702 WDI_ASSERT(0);
11703 return WDI_STATUS_E_FAILURE;
11704 }
11705 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11706
11707 wpalMemoryCopy( pSendBuffer+usDataOffset,
11708 &exitBmpsReq,
11709 sizeof(exitBmpsReq));
11710
11711 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
11712 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
11713
11714 /*-------------------------------------------------------------------------
11715 Send Get STA Request to HAL
11716 -------------------------------------------------------------------------*/
11717 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11718 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
11719}/*WDI_ProcessExitBmpsReq*/
11720
11721/**
11722 @brief Process Enter UAPSD Request function (called when Main
11723 FSM allows it)
11724
11725 @param pWDICtx: pointer to the WLAN DAL context
11726 pEventData: pointer to the event information structure
11727
11728 @see
11729 @return Result of the function call
11730*/
11731WDI_Status
11732WDI_ProcessEnterUapsdReq
11733(
11734 WDI_ControlBlockType* pWDICtx,
11735 WDI_EventInfoType* pEventData
11736)
11737{
11738 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11739 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
11740 wpt_uint8* pSendBuffer = NULL;
11741 wpt_uint16 usDataOffset = 0;
11742 wpt_uint16 usSendSize = 0;
11743 tUapsdReqParams enterUapsdReq;
11744 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11745
11746 /*-------------------------------------------------------------------------
11747 Sanity check
11748 -------------------------------------------------------------------------*/
11749 if (( NULL == pEventData ) ||
11750 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11751 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11752 {
11753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11754 "%s: Invalid parameters", __FUNCTION__);
11755 WDI_ASSERT(0);
11756 return WDI_STATUS_E_FAILURE;
11757 }
11758
11759 /*-----------------------------------------------------------------------
11760 Get message buffer
11761 ! TO DO : proper conversion into the HAL Message Request Format
11762 -----------------------------------------------------------------------*/
11763 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
11764 sizeof(enterUapsdReq),
11765 &pSendBuffer, &usDataOffset, &usSendSize))||
11766 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
11767 {
11768 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11769 "Unable to get send buffer in Enter UAPSD req %x %x %x",
11770 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
11771 WDI_ASSERT(0);
11772 return WDI_STATUS_E_FAILURE;
11773 }
11774
11775 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
11776 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
11777 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
11778 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
11779 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
11780 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
11781 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
11782 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
11783
11784 wpalMemoryCopy( pSendBuffer+usDataOffset,
11785 &enterUapsdReq,
11786 sizeof(enterUapsdReq));
11787
11788 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
11789 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
11790
11791 /*-------------------------------------------------------------------------
11792 Send Get STA Request to HAL
11793 -------------------------------------------------------------------------*/
11794 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11795 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
11796}/*WDI_ProcessEnterUapsdReq*/
11797
11798/**
11799 @brief Process Exit UAPSD Request function (called when
11800 Main FSM allows it)
11801
11802 @param pWDICtx: pointer to the WLAN DAL context
11803 pEventData: pointer to the event information structure
11804
11805 @see
11806 @return Result of the function call
11807*/
11808WDI_Status
11809WDI_ProcessExitUapsdReq
11810(
11811 WDI_ControlBlockType* pWDICtx,
11812 WDI_EventInfoType* pEventData
11813)
11814{
11815 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
11816 wpt_uint8* pSendBuffer = NULL;
11817 wpt_uint16 usDataOffset = 0;
11818 wpt_uint16 usSendSize = 0;
11819 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11820
11821 /*-------------------------------------------------------------------------
11822 Sanity check
11823 -------------------------------------------------------------------------*/
11824 if (( NULL == pEventData ) ||
11825 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
11826 {
11827 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11828 "%s: Invalid parameters", __FUNCTION__);
11829 WDI_ASSERT(0);
11830 return WDI_STATUS_E_FAILURE;
11831 }
11832
11833 /*-----------------------------------------------------------------------
11834 Get message buffer
11835 ! TO DO : proper conversion into the HAL Message Request Format
11836 -----------------------------------------------------------------------*/
11837 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
11838 0,
11839 &pSendBuffer, &usDataOffset, &usSendSize))||
11840 ( usSendSize < (usDataOffset )))
11841 {
11842 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11843 "Unable to get send buffer in Exit UAPSD req %x %x",
11844 pEventData, wdiExitUapsdRspCb);
11845 WDI_ASSERT(0);
11846 return WDI_STATUS_E_FAILURE;
11847 }
11848
11849 /*-------------------------------------------------------------------------
11850 Send Get STA Request to HAL
11851 -------------------------------------------------------------------------*/
11852 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11853 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
11854}/*WDI_ProcessExitUapsdReq*/
11855
11856/**
11857 @brief Process Set UAPSD params Request function (called when
11858 Main FSM allows it)
11859
11860 @param pWDICtx: pointer to the WLAN DAL context
11861 pEventData: pointer to the event information structure
11862
11863 @see
11864 @return Result of the function call
11865*/
11866WDI_Status
11867WDI_ProcessSetUapsdAcParamsReq
11868(
11869 WDI_ControlBlockType* pWDICtx,
11870 WDI_EventInfoType* pEventData
11871)
11872{
11873 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
11874 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
11875 wpt_uint8* pSendBuffer = NULL;
11876 wpt_uint16 usDataOffset = 0;
11877 wpt_uint16 usSendSize = 0;
11878 tUapsdInfo uapsdAcParamsReq;
11879 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11880
11881 /*-------------------------------------------------------------------------
11882 Sanity check
11883 -------------------------------------------------------------------------*/
11884 if (( NULL == pEventData ) ||
11885 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
11886 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
11887 {
11888 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11889 "%s: Invalid parameters", __FUNCTION__);
11890 WDI_ASSERT(0);
11891 return WDI_STATUS_E_FAILURE;
11892 }
11893
11894 /*-----------------------------------------------------------------------
11895 Get message buffer
11896 ! TO DO : proper conversion into the HAL Message Request Format
11897 -----------------------------------------------------------------------*/
11898 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
11899 sizeof(uapsdAcParamsReq),
11900 &pSendBuffer, &usDataOffset, &usSendSize))||
11901 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
11902 {
11903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11904 "Unable to get send buffer in Set UAPSD params req %x %x %x",
11905 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
11906 WDI_ASSERT(0);
11907 return WDI_STATUS_E_FAILURE;
11908 }
11909
11910 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
11911 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
11912 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
11913 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
11914 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
11915 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
11916
11917 wpalMemoryCopy( pSendBuffer+usDataOffset,
11918 &uapsdAcParamsReq,
11919 sizeof(uapsdAcParamsReq));
11920
11921 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
11922 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
11923
11924 /*-------------------------------------------------------------------------
11925 Send Get STA Request to HAL
11926 -------------------------------------------------------------------------*/
11927 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11928 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
11929}/*WDI_ProcessSetUapsdAcParamsReq*/
11930
11931/**
11932 @brief Process update UAPSD params Request function (called
11933 when Main FSM allows it)
11934
11935 @param pWDICtx: pointer to the WLAN DAL context
11936 pEventData: pointer to the event information structure
11937
11938 @see
11939 @return Result of the function call
11940*/
11941WDI_Status
11942WDI_ProcessUpdateUapsdParamsReq
11943(
11944 WDI_ControlBlockType* pWDICtx,
11945 WDI_EventInfoType* pEventData
11946)
11947{
11948 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
11949 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
11950 wpt_uint8* pSendBuffer = NULL;
11951 wpt_uint16 usDataOffset = 0;
11952 wpt_uint16 usSendSize = 0;
11953 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11954
11955 /*-------------------------------------------------------------------------
11956 Sanity check
11957 -------------------------------------------------------------------------*/
11958 if (( NULL == pEventData ) ||
11959 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
11960 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
11961 {
11962 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11963 "%s: Invalid parameters", __FUNCTION__);
11964 WDI_ASSERT(0);
11965 return WDI_STATUS_E_FAILURE;
11966 }
11967
11968 /*-----------------------------------------------------------------------
11969 Get message buffer
11970 ! TO DO : proper conversion into the HAL Message Request Format
11971 -----------------------------------------------------------------------*/
11972 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
11973 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
11974 &pSendBuffer, &usDataOffset, &usSendSize))||
11975 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
11976 {
11977 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11978 "Unable to get send buffer in Update UAPSD params req %x %x %x",
11979 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
11980 WDI_ASSERT(0);
11981 return WDI_STATUS_E_FAILURE;
11982 }
11983
11984 wpalMemoryCopy( pSendBuffer+usDataOffset,
11985 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
11986 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
11987
11988 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
11989 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
11990
11991 /*-------------------------------------------------------------------------
11992 Send Get STA Request to HAL
11993 -------------------------------------------------------------------------*/
11994 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11995 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
11996}/*WDI_ProcessUpdateUapsdParamsReq*/
11997
11998/**
11999 @brief Process Configure RXP filter Request function (called
12000 when Main FSM allows it)
12001
12002 @param pWDICtx: pointer to the WLAN DAL context
12003 pEventData: pointer to the event information structure
12004
12005 @see
12006 @return Result of the function call
12007*/
12008WDI_Status
12009WDI_ProcessConfigureRxpFilterReq
12010(
12011 WDI_ControlBlockType* pWDICtx,
12012 WDI_EventInfoType* pEventData
12013)
12014{
12015 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
12016 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
12017 wpt_uint8* pSendBuffer = NULL;
12018 wpt_uint16 usDataOffset = 0;
12019 wpt_uint16 usSendSize = 0;
12020 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12021
12022 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12023
12024 /*-------------------------------------------------------------------------
12025 Sanity check
12026 -------------------------------------------------------------------------*/
12027 if (( NULL == pEventData ) ||
12028 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12029 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12030 {
12031 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12032 "%s: Invalid parameters", __FUNCTION__);
12033 WDI_ASSERT(0);
12034 return WDI_STATUS_E_FAILURE;
12035 }
12036
12037 /*-----------------------------------------------------------------------
12038 Get message buffer
12039 -----------------------------------------------------------------------*/
12040 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
12041 sizeof(halRxpFilterParams),
12042 &pSendBuffer, &usDataOffset, &usSendSize))||
12043 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12044 {
12045 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12046 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12047 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12048 WDI_ASSERT(0);
12049 return WDI_STATUS_E_FAILURE;
12050 }
12051
12052 halRxpFilterParams.setMcstBcstFilterSetting =
12053 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
12054 halRxpFilterParams.setMcstBcstFilter =
12055 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12056
12057 wpalMemoryCopy( pSendBuffer+usDataOffset,
12058 &halRxpFilterParams,
12059 sizeof(halRxpFilterParams));
12060
12061 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
12062 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
12063
12064 /*-------------------------------------------------------------------------
12065 Send Get STA Request to HAL
12066 -------------------------------------------------------------------------*/
12067 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12068 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
12069}/*WDI_ProcessConfigureRxpFilterReq*/
12070
12071/**
12072 @brief Process set beacon filter Request function (called
12073 when Main FSM allows it)
12074
12075 @param pWDICtx: pointer to the WLAN DAL context
12076 pEventData: pointer to the event information structure
12077
12078 @see
12079 @return Result of the function call
12080*/
12081WDI_Status
12082WDI_ProcessSetBeaconFilterReq
12083(
12084 WDI_ControlBlockType* pWDICtx,
12085 WDI_EventInfoType* pEventData
12086)
12087{
12088 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12089 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
12090 wpt_uint8* pSendBuffer = NULL;
12091 wpt_uint16 usDataOffset = 0;
12092 wpt_uint16 usSendSize = 0;
12093 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12094
12095 /*-------------------------------------------------------------------------
12096 Sanity check
12097 -------------------------------------------------------------------------*/
12098 if (( NULL == pEventData ) ||
12099 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12100 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12101 {
12102 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12103 "%s: Invalid parameters", __FUNCTION__);
12104 WDI_ASSERT(0);
12105 return WDI_STATUS_E_FAILURE;
12106 }
12107
12108 /*-----------------------------------------------------------------------
12109 Get message buffer
12110 ! TO DO : proper conversion into the HAL Message Request Format
12111 -----------------------------------------------------------------------*/
12112 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
12113 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12114 &pSendBuffer, &usDataOffset, &usSendSize))||
12115 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12116 {
12117 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12118 "Unable to get send buffer in Set beacon filter req %x %x %x",
12119 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12120 WDI_ASSERT(0);
12121 return WDI_STATUS_E_FAILURE;
12122 }
12123
12124 wpalMemoryCopy( pSendBuffer+usDataOffset,
12125 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12126 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12127 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12128 &pwdiBeaconFilterParams->aFilters[0],
12129 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
12130
12131 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
12132 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
12133
12134 /*-------------------------------------------------------------------------
12135 Send Get STA Request to HAL
12136 -------------------------------------------------------------------------*/
12137 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12138 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
12139}/*WDI_ProcessSetBeaconFilterReq*/
12140
12141/**
12142 @brief Process remove beacon filter Request function (called
12143 when Main FSM allows it)
12144
12145 @param pWDICtx: pointer to the WLAN DAL context
12146 pEventData: pointer to the event information structure
12147
12148 @see
12149 @return Result of the function call
12150*/
12151WDI_Status
12152WDI_ProcessRemBeaconFilterReq
12153(
12154 WDI_ControlBlockType* pWDICtx,
12155 WDI_EventInfoType* pEventData
12156)
12157{
12158 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12159 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
12160 wpt_uint8* pSendBuffer = NULL;
12161 wpt_uint16 usDataOffset = 0;
12162 wpt_uint16 usSendSize = 0;
12163 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12164
12165 /*-------------------------------------------------------------------------
12166 Sanity check
12167 -------------------------------------------------------------------------*/
12168 if (( NULL == pEventData ) ||
12169 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12170 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12171 {
12172 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12173 "%s: Invalid parameters", __FUNCTION__);
12174 WDI_ASSERT(0);
12175 return WDI_STATUS_E_FAILURE;
12176 }
12177
12178 /*-----------------------------------------------------------------------
12179 Get message buffer
12180 ! TO DO : proper conversion into the HAL Message Request Format
12181 -----------------------------------------------------------------------*/
12182 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
12183 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12184 &pSendBuffer, &usDataOffset, &usSendSize))||
12185 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12186 {
12187 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12188 "Unable to get send buffer in remove beacon filter req %x %x %x",
12189 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12190 WDI_ASSERT(0);
12191 return WDI_STATUS_E_FAILURE;
12192 }
12193
12194 wpalMemoryCopy( pSendBuffer+usDataOffset,
12195 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12196 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12197
12198 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
12199 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
12200
12201 /*-------------------------------------------------------------------------
12202 Send Get STA Request to HAL
12203 -------------------------------------------------------------------------*/
12204 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12205 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
12206}
12207
12208/**
12209 @brief Process set RSSI thresholds Request function (called
12210 when Main FSM allows it)
12211
12212 @param pWDICtx: pointer to the WLAN DAL context
12213 pEventData: pointer to the event information structure
12214
12215 @see
12216 @return Result of the function call
12217*/
12218WDI_Status
12219WDI_ProcessSetRSSIThresholdsReq
12220(
12221 WDI_ControlBlockType* pWDICtx,
12222 WDI_EventInfoType* pEventData
12223)
12224{
12225 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12226 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
12227 wpt_uint8* pSendBuffer = NULL;
12228 wpt_uint16 usDataOffset = 0;
12229 wpt_uint16 usSendSize = 0;
12230 tHalRSSIThresholds rssiThresholdsReq;
12231 WDI_Status ret_status = 0;
12232 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12233
12234 /*-------------------------------------------------------------------------
12235 Sanity check
12236 -------------------------------------------------------------------------*/
12237 if (( NULL == pEventData ) ||
12238 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12239 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12240 {
12241 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12242 "%s: Invalid parameters", __FUNCTION__);
12243 WDI_ASSERT(0);
12244 return WDI_STATUS_E_FAILURE;
12245 }
12246
12247 /*-----------------------------------------------------------------------
12248 Get message buffer
12249 ! TO DO : proper conversion into the HAL Message Request Format
12250 -----------------------------------------------------------------------*/
12251 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
12252 sizeof(rssiThresholdsReq),
12253 &pSendBuffer, &usDataOffset, &usSendSize))||
12254 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12255 {
12256 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12257 "Unable to get send buffer in remove beacon filter req %x %x %x",
12258 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12259 WDI_ASSERT(0);
12260 return WDI_STATUS_E_FAILURE;
12261 }
12262
12263 rssiThresholdsReq.bReserved10 =
12264 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
12265 rssiThresholdsReq.bRssiThres1NegNotify =
12266 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
12267 rssiThresholdsReq.bRssiThres1PosNotify =
12268 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
12269 rssiThresholdsReq.bRssiThres2NegNotify =
12270 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
12271 rssiThresholdsReq.bRssiThres2PosNotify =
12272 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
12273 rssiThresholdsReq.bRssiThres3NegNotify =
12274 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
12275 rssiThresholdsReq.bRssiThres3PosNotify =
12276 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
12277 rssiThresholdsReq.ucRssiThreshold1 =
12278 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
12279 rssiThresholdsReq.ucRssiThreshold2 =
12280 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
12281 rssiThresholdsReq.ucRssiThreshold3 =
12282 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12283
12284 wpalMemoryCopy( pSendBuffer+usDataOffset,
12285 &rssiThresholdsReq,
12286 sizeof(rssiThresholdsReq));
12287
12288 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
12289 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
12290
12291 /*-------------------------------------------------------------------------
12292 Send Set threshold req to HAL
12293 -------------------------------------------------------------------------*/
12294 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12295 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12296 {
12297 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12298 // req. Then as a result of processing the threshold cross ind, we trigger
12299 // a Set threshold req, then we need to indicate to WDI that it needs to
12300 // go to busy state as a result of the indication as we sent a req in the
12301 // same WDI context.
12302 // Hence expected state transition is to busy.
12303 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12304 }
12305
12306 return ret_status;
12307}
12308
12309/**
12310 @brief Process set RSSI thresholds Request function (called
12311 when Main FSM allows it)
12312
12313 @param pWDICtx: pointer to the WLAN DAL context
12314 pEventData: pointer to the event information structure
12315
12316 @see
12317 @return Result of the function call
12318*/
12319WDI_Status
12320WDI_ProcessHostOffloadReq
12321(
12322 WDI_ControlBlockType* pWDICtx,
12323 WDI_EventInfoType* pEventData
12324)
12325{
12326 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12327 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
12328 wpt_uint8* pSendBuffer = NULL;
12329 wpt_uint16 usDataOffset = 0;
12330 wpt_uint16 usSendSize = 0;
12331 tHalHostOffloadReq hostOffloadParams;
12332 tHalNSOffloadParams nsOffloadParams;
12333
12334 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12335
12336 /*-------------------------------------------------------------------------
12337 Sanity check
12338 -------------------------------------------------------------------------*/
12339 if (( NULL == pEventData ) ||
12340 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12341 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12342 {
12343 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12344 "%s: Invalid parameters", __FUNCTION__);
12345 WDI_ASSERT(0);
12346 return WDI_STATUS_E_FAILURE;
12347 }
12348
12349 /*-----------------------------------------------------------------------
12350 Get message buffer
12351 ! TO DO : proper conversion into the HAL Message Request Format
12352 -----------------------------------------------------------------------*/
12353 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
12354 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12355 &pSendBuffer, &usDataOffset, &usSendSize))||
12356 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12357 {
12358 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12359 "Unable to get send buffer in host offload req %x %x %x",
12360 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12361 WDI_ASSERT(0);
12362 return WDI_STATUS_E_FAILURE;
12363 }
12364
12365 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12366 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
12367 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12368 {
12369 // ARP Offload
12370 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12371 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12372 4);
12373 }
12374 else
12375 {
12376 // NS Offload
12377 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12378 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12379 16);
12380
12381#ifdef WLAN_NS_OFFLOAD
12382 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12383 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12384 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12385 16);
12386 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12387 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12388 16);
12389 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12390 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12391 16);
12392 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12393 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12394 16);
12395 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12396 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12397 6);
12398 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12399 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12400 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
12401#endif // WLAN_NS_OFFLOAD
12402 }
12403
12404 // copy hostOffloadParams into pSendBuffer
12405 wpalMemoryCopy( pSendBuffer+usDataOffset,
12406 &hostOffloadParams,
12407 sizeof(hostOffloadParams));
12408
12409#ifdef WLAN_NS_OFFLOAD
12410 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12411 {
12412 // copy nsOffloadParams into pSendBuffer
12413 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12414 &nsOffloadParams,
12415 sizeof(nsOffloadParams));
12416 }
12417#endif // WLAN_NS_OFFLOAD
12418
12419 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
12420 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
12421
12422 /*-------------------------------------------------------------------------
12423 Send Get STA Request to HAL
12424 -------------------------------------------------------------------------*/
12425 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12426 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
12427}/*WDI_ProcessHostOffloadReq*/
12428
12429/**
12430 @brief Process Keep Alive Request function (called
12431 when Main FSM allows it)
12432
12433 @param pWDICtx: pointer to the WLAN DAL context
12434 pEventData: pointer to the event information structure
12435
12436 @see
12437 @return Result of the function call
12438*/
12439WDI_Status
12440WDI_ProcessKeepAliveReq
12441(
12442 WDI_ControlBlockType* pWDICtx,
12443 WDI_EventInfoType* pEventData
12444)
12445{
12446 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12447 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
12448 wpt_uint8* pSendBuffer = NULL;
12449 wpt_uint16 usDataOffset = 0;
12450 wpt_uint16 usSendSize = 0;
12451 tHalKeepAliveReq keepAliveReq;
12452 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12453
12454 /*-------------------------------------------------------------------------
12455 Sanity check
12456 -------------------------------------------------------------------------*/
12457 if (( NULL == pEventData ) ||
12458 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12459 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12460 {
12461 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12462 "Invalid parameters in Keep Alive req");
12463 WDI_ASSERT(0);
12464 return WDI_STATUS_E_FAILURE;
12465 }
12466
12467 /*-----------------------------------------------------------------------
12468 Get message buffer
12469 ! TO DO : proper conversion into the HAL Message Request Format
12470 -----------------------------------------------------------------------*/
12471 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
12472 sizeof(keepAliveReq),
12473 &pSendBuffer, &usDataOffset, &usSendSize))||
12474 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12475 {
12476 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12477 "Unable to get send buffer in keep alive req %x %x %x",
12478 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12479 WDI_ASSERT(0);
12480 return WDI_STATUS_E_FAILURE;
12481 }
12482
12483 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12484 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12485
12486 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12487 {
12488 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12489 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12490 HAL_IPV4_ADDR_LEN);
12491 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12492 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
12493 HAL_IPV4_ADDR_LEN);
12494 wpalMemoryCopy(keepAliveReq.destMacAddr,
12495 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12496 HAL_MAC_ADDR_LEN);
12497 }
12498
12499 wpalMemoryCopy( pSendBuffer+usDataOffset,
12500 &keepAliveReq,
12501 sizeof(keepAliveReq));
12502
12503 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12504 "Process keep alive req %d",sizeof(keepAliveReq));
12505
12506 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12507 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12508
12509 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
12510 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
12511
12512 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12513 "Sending keep alive req to HAL");
12514
12515 /*-------------------------------------------------------------------------
12516 Send Get STA Request to HAL
12517 -------------------------------------------------------------------------*/
12518 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12519 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
12520}/*WDI_ProcessKeepAliveReq*/
12521
12522
12523/**
12524 @brief Process Wowl add bc ptrn Request function (called
12525 when Main FSM allows it)
12526
12527 @param pWDICtx: pointer to the WLAN DAL context
12528 pEventData: pointer to the event information structure
12529
12530 @see
12531 @return Result of the function call
12532*/
12533WDI_Status
12534WDI_ProcessWowlAddBcPtrnReq
12535(
12536 WDI_ControlBlockType* pWDICtx,
12537 WDI_EventInfoType* pEventData
12538)
12539{
12540 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12541 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
12542 wpt_uint8* pSendBuffer = NULL;
12543 wpt_uint16 usDataOffset = 0;
12544 wpt_uint16 usSendSize = 0;
12545 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
12546 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12547
12548 /*-------------------------------------------------------------------------
12549 Sanity check
12550 -------------------------------------------------------------------------*/
12551 if (( NULL == pEventData ) ||
12552 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12553 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12554 {
12555 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12556 "%s: Invalid parameters", __FUNCTION__);
12557 WDI_ASSERT(0);
12558 return WDI_STATUS_E_FAILURE;
12559 }
12560
12561 /*-----------------------------------------------------------------------
12562 Get message buffer
12563 ! TO DO : proper conversion into the HAL Message Request Format
12564 -----------------------------------------------------------------------*/
12565 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
12566 sizeof(wowlAddBcPtrnReq),
12567 &pSendBuffer, &usDataOffset, &usSendSize))||
12568 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12569 {
12570 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12571 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12572 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12573 WDI_ASSERT(0);
12574 return WDI_STATUS_E_FAILURE;
12575 }
12576
12577 wowlAddBcPtrnReq.ucPatternId =
12578 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
12579 wowlAddBcPtrnReq.ucPatternByteOffset =
12580 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
12581 wowlAddBcPtrnReq.ucPatternMaskSize =
12582 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
12583 wowlAddBcPtrnReq.ucPatternSize =
12584 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12585
12586 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12587 {
12588 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12589 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12590 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12591 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12592 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12593 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12594 }
12595 else
12596 {
12597 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12598 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12599 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12600 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12601 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12602 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12603
12604 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12605 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12606 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12607 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12608 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12609 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12610 }
12611
12612 wpalMemoryCopy( pSendBuffer+usDataOffset,
12613 &wowlAddBcPtrnReq,
12614 sizeof(wowlAddBcPtrnReq));
12615
12616 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
12617 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
12618
12619 /*-------------------------------------------------------------------------
12620 Send Get STA Request to HAL
12621 -------------------------------------------------------------------------*/
12622 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12623 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
12624}/*WDI_ProcessWowlAddBcPtrnReq*/
12625
12626/**
12627 @brief Process Wowl delete bc ptrn Request function (called
12628 when Main FSM allows it)
12629
12630 @param pWDICtx: pointer to the WLAN DAL context
12631 pEventData: pointer to the event information structure
12632
12633 @see
12634 @return Result of the function call
12635*/
12636WDI_Status
12637WDI_ProcessWowlDelBcPtrnReq
12638(
12639 WDI_ControlBlockType* pWDICtx,
12640 WDI_EventInfoType* pEventData
12641)
12642{
12643 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12644 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
12645 wpt_uint8* pSendBuffer = NULL;
12646 wpt_uint16 usDataOffset = 0;
12647 wpt_uint16 usSendSize = 0;
12648 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
12649 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12650
12651 /*-------------------------------------------------------------------------
12652 Sanity check
12653 -------------------------------------------------------------------------*/
12654 if (( NULL == pEventData ) ||
12655 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12656 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12657 {
12658 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12659 "%s: Invalid parameters", __FUNCTION__);
12660 WDI_ASSERT(0);
12661 return WDI_STATUS_E_FAILURE;
12662 }
12663
12664 /*-----------------------------------------------------------------------
12665 Get message buffer
12666 ! TO DO : proper conversion into the HAL Message Request Format
12667 -----------------------------------------------------------------------*/
12668 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
12669 sizeof(wowlDelBcPtrnReq),
12670 &pSendBuffer, &usDataOffset, &usSendSize))||
12671 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12672 {
12673 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12674 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12675 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12676 WDI_ASSERT(0);
12677 return WDI_STATUS_E_FAILURE;
12678 }
12679
12680 wowlDelBcPtrnReq.ucPatternId =
12681 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
12682 wpalMemoryCopy( pSendBuffer+usDataOffset,
12683 &wowlDelBcPtrnReq,
12684 sizeof(wowlDelBcPtrnReq));
12685
12686 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
12687 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
12688
12689 /*-------------------------------------------------------------------------
12690 Send Get STA Request to HAL
12691 -------------------------------------------------------------------------*/
12692 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12693 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
12694}/*WDI_ProcessWowlDelBcPtrnReq*/
12695
12696/**
12697 @brief Process Wowl enter Request function (called
12698 when Main FSM allows it)
12699
12700 @param pWDICtx: pointer to the WLAN DAL context
12701 pEventData: pointer to the event information structure
12702
12703 @see
12704 @return Result of the function call
12705*/
12706WDI_Status
12707WDI_ProcessWowlEnterReq
12708(
12709 WDI_ControlBlockType* pWDICtx,
12710 WDI_EventInfoType* pEventData
12711)
12712{
12713 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
12714 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
12715 wpt_uint8* pSendBuffer = NULL;
12716 wpt_uint16 usDataOffset = 0;
12717 wpt_uint16 usSendSize = 0;
12718 tHalWowlEnterParams wowlEnterReq;
12719 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12720
12721 /*-------------------------------------------------------------------------
12722 Sanity check
12723 -------------------------------------------------------------------------*/
12724 if (( NULL == pEventData ) ||
12725 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
12726 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
12727 {
12728 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12729 "%s: Invalid parameters", __FUNCTION__);
12730 WDI_ASSERT(0);
12731 return WDI_STATUS_E_FAILURE;
12732 }
12733
12734 /*-----------------------------------------------------------------------
12735 Get message buffer
12736 ! TO DO : proper conversion into the HAL Message Request Format
12737 -----------------------------------------------------------------------*/
12738 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
12739 sizeof(wowlEnterReq),
12740 &pSendBuffer, &usDataOffset, &usSendSize))||
12741 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
12742 {
12743 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12744 "Unable to get send buffer in Wowl enter req %x %x %x",
12745 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
12746 WDI_ASSERT(0);
12747 return WDI_STATUS_E_FAILURE;
12748 }
12749
12750 wowlEnterReq.ucMagicPktEnable =
12751 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
12752 wowlEnterReq.ucPatternFilteringEnable =
12753 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
12754 wowlEnterReq.ucUcastPatternFilteringEnable =
12755 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
12756 wowlEnterReq.ucWowChnlSwitchRcv =
12757 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
12758 wowlEnterReq.ucWowDeauthRcv =
12759 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
12760 wowlEnterReq.ucWowDisassocRcv =
12761 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
12762 wowlEnterReq.ucWowMaxMissedBeacons =
12763 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
12764 wowlEnterReq.ucWowMaxSleepUsec =
12765 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
12766
12767#ifdef WLAN_WAKEUP_EVENTS
12768 wowlEnterReq.ucWoWEAPIDRequestEnable =
12769 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
12770
12771 wowlEnterReq.ucWoWEAPOL4WayEnable =
12772 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
12773
12774 wowlEnterReq.ucWowNetScanOffloadMatch =
12775 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
12776
12777 wowlEnterReq.ucWowGTKRekeyError =
12778 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
12779
12780 wowlEnterReq.ucWoWBSSConnLoss =
12781 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
12782#endif // WLAN_WAKEUP_EVENTS
12783
12784 wpalMemoryCopy(wowlEnterReq.magicPtrn,
12785 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
12786 sizeof(tSirMacAddr));
12787
12788 wpalMemoryCopy( pSendBuffer+usDataOffset,
12789 &wowlEnterReq,
12790 sizeof(wowlEnterReq));
12791
12792 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
12793 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
12794
12795 /*-------------------------------------------------------------------------
12796 Send Get STA Request to HAL
12797 -------------------------------------------------------------------------*/
12798 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12799 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
12800}/*WDI_ProcessWowlEnterReq*/
12801
12802/**
12803 @brief Process Wowl exit Request function (called when Main FSM
12804 allows it)
12805
12806 @param pWDICtx: pointer to the WLAN DAL context
12807 pEventData: pointer to the event information structure
12808
12809 @see
12810 @return Result of the function call
12811*/
12812WDI_Status
12813WDI_ProcessWowlExitReq
12814(
12815 WDI_ControlBlockType* pWDICtx,
12816 WDI_EventInfoType* pEventData
12817)
12818{
12819 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
12820 wpt_uint8* pSendBuffer = NULL;
12821 wpt_uint16 usDataOffset = 0;
12822 wpt_uint16 usSendSize = 0;
12823 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12824
12825 /*-------------------------------------------------------------------------
12826 Sanity check
12827 -------------------------------------------------------------------------*/
12828 if (( NULL == pEventData ) ||
12829 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
12830 {
12831 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12832 "%s: Invalid parameters", __FUNCTION__);
12833 WDI_ASSERT(0);
12834 return WDI_STATUS_E_FAILURE;
12835 }
12836
12837 /*-----------------------------------------------------------------------
12838 Get message buffer
12839 ! TO DO : proper conversion into the HAL Message Request Format
12840 -----------------------------------------------------------------------*/
12841 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
12842 0,
12843 &pSendBuffer, &usDataOffset, &usSendSize))||
12844 ( usSendSize < (usDataOffset )))
12845 {
12846 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12847 "Unable to get send buffer in Wowl Exit req %x %x",
12848 pEventData, wdiWowlExitCb);
12849 WDI_ASSERT(0);
12850 return WDI_STATUS_E_FAILURE;
12851 }
12852
12853 /*-------------------------------------------------------------------------
12854 Send Get STA Request to HAL
12855 -------------------------------------------------------------------------*/
12856 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12857 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
12858}/*WDI_ProcessWowlExitReq*/
12859
12860/**
12861 @brief Process Configure Apps Cpu Wakeup State Request function
12862 (called when Main FSM allows it)
12863
12864 @param pWDICtx: pointer to the WLAN DAL context
12865 pEventData: pointer to the event information structure
12866
12867 @see
12868 @return Result of the function call
12869*/
12870WDI_Status
12871WDI_ProcessConfigureAppsCpuWakeupStateReq
12872(
12873 WDI_ControlBlockType* pWDICtx,
12874 WDI_EventInfoType* pEventData
12875)
12876{
12877 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
12878 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
12879 wpt_uint8* pSendBuffer = NULL;
12880 wpt_uint16 usDataOffset = 0;
12881 wpt_uint16 usSendSize = 0;
12882 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
12883 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12884
12885 /*-------------------------------------------------------------------------
12886 Sanity check
12887 -------------------------------------------------------------------------*/
12888 if (( NULL == pEventData ) ||
12889 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
12890 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
12891 {
12892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12893 "%s: Invalid parameters", __FUNCTION__);
12894 WDI_ASSERT(0);
12895 return WDI_STATUS_E_FAILURE;
12896 }
12897
12898 /*-----------------------------------------------------------------------
12899 Get message buffer
12900 -----------------------------------------------------------------------*/
12901 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
12902 sizeof(halCfgAppsCpuWakeupStateReqParams),
12903 &pSendBuffer, &usDataOffset, &usSendSize))||
12904 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
12905 {
12906 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12907 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
12908 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
12909 WDI_ASSERT(0);
12910 return WDI_STATUS_E_FAILURE;
12911 }
12912
12913 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
12914 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
12915
12916 wpalMemoryCopy( pSendBuffer+usDataOffset,
12917 &halCfgAppsCpuWakeupStateReqParams,
12918 sizeof(halCfgAppsCpuWakeupStateReqParams));
12919
12920 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
12921 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
12922
12923 /*-------------------------------------------------------------------------
12924 Send Get STA Request to HAL
12925 -------------------------------------------------------------------------*/
12926 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12927 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
12928 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
12929}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
12930
12931#ifdef WLAN_FEATURE_VOWIFI_11R
12932/**
12933 @brief Process Aggregated Add TSpec Request function (called when Main FSM
12934 allows it)
12935
12936 @param pWDICtx: pointer to the WLAN DAL context
12937 pEventData: pointer to the event information structure
12938
12939 @see
12940 @return Result of the function call
12941*/
12942WDI_Status
12943WDI_ProcessAggrAddTSpecReq
12944(
12945 WDI_ControlBlockType* pWDICtx,
12946 WDI_EventInfoType* pEventData
12947)
12948{
12949 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
12950 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
12951 wpt_uint8 ucCurrentBSSSesIdx = 0;
12952 WDI_BSSSessionType* pBSSSes = NULL;
12953 wpt_uint8* pSendBuffer = NULL;
12954 wpt_uint16 usDataOffset = 0;
12955 wpt_uint16 usSendSize = 0;
12956 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
12957 wpt_macAddr macBSSID;
12958 tAggrAddTsReq halAggrAddTsReq;
12959 int i;
12960 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12961
12962 /*-------------------------------------------------------------------------
12963 Sanity check
12964 -------------------------------------------------------------------------*/
12965 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
12966 ( NULL == pEventData->pCBfnc ))
12967 {
12968 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12969 "%s: Invalid parameters", __FUNCTION__);
12970 WDI_ASSERT(0);
12971 return WDI_STATUS_E_FAILURE;
12972 }
12973 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
12974 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
12975 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
12976 /*-------------------------------------------------------------------------
12977 Check to see if we are in the middle of an association, if so queue, if
12978 not it means it is free to process request
12979 -------------------------------------------------------------------------*/
12980 wpalMutexAcquire(&pWDICtx->wptMutex);
12981
12982 /*------------------------------------------------------------------------
12983 Find the BSS for which the request is made and identify WDI session
12984 ------------------------------------------------------------------------*/
12985 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
12986 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
12987 &macBSSID))
12988 {
12989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12990 "This station does not exist in the WDI Station Table %d");
12991 wpalMutexRelease(&pWDICtx->wptMutex);
12992 return WDI_STATUS_E_FAILURE;
12993 }
12994
12995 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
12996 if ( NULL == pBSSSes )
12997 {
12998 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12999 "Association sequence for this BSS does not yet exist");
13000
13001 wpalMutexRelease(&pWDICtx->wptMutex);
13002 return WDI_STATUS_E_NOT_ALLOWED;
13003 }
13004
13005 /*------------------------------------------------------------------------
13006 Check if this BSS is being currently processed or queued,
13007 if queued - queue the new request as well
13008 ------------------------------------------------------------------------*/
13009 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
13010 {
13011 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13012 "Association sequence for this BSS exists but currently queued");
13013
13014 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
13015 wpalMutexRelease(&pWDICtx->wptMutex);
13016 return wdiStatus;
13017 }
13018
13019 wpalMutexRelease(&pWDICtx->wptMutex);
13020 /*-----------------------------------------------------------------------
13021 Get message buffer
13022 ! TO DO : proper conversion into the HAL Message Request Format
13023 -----------------------------------------------------------------------*/
13024 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
13025 sizeof(tAggrAddTsParams),
13026 &pSendBuffer, &usDataOffset, &usSendSize))||
13027 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13028 {
13029 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13030 "Unable to get send buffer in set bss key req %x %x %x",
13031 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13032 WDI_ASSERT(0);
13033 return WDI_STATUS_E_FAILURE;
13034 }
13035
13036 halAggrAddTsReq.aggrAddTsParam.staIdx =
13037 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
13038 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
13039 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13040
13041 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13042 {
13043 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
13044 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
13045 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
13046 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
13047 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
13048 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13049 ackPolicy;
13050 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
13051 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13052 accessPolicy;
13053 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
13054 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13055 userPrio;
13056 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
13057 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13058 psb;
13059 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
13060 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13061 aggregation;
13062 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
13063 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13064 direction;
13065 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
13066 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13067 trafficType;
13068 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
13069 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13070 trafficType;
13071 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
13072 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
13073 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
13074 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
13075
13076
13077 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
13078 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
13079 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
13080 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
13081 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
13082 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
13083 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
13084 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
13085 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
13086 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
13087 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
13088 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
13089 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
13090 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
13091 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
13092 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
13093 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
13094 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
13095 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
13096 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
13097 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
13098 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
13099 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
13100 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
13101 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
13102 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
13103 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
13104 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
13105 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
13106 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13107 }
13108
13109 wpalMemoryCopy( pSendBuffer+usDataOffset,
13110 &halAggrAddTsReq,
13111 sizeof(halAggrAddTsReq));
13112
13113 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
13114 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
13115
13116 /*-------------------------------------------------------------------------
13117 Send Add TS Request to HAL
13118 -------------------------------------------------------------------------*/
13119 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13120 wdiAggrAddTSRspCb, pEventData->pUserData,
13121 WDI_AGGR_ADD_TS_RESP);
13122}/*WDI_ProcessAggrAddTSpecReq*/
13123#endif /* WLAN_FEATURE_VOWIFI_11R */
13124
13125/**
13126 @brief Process Shutdown Request function (called when Main FSM
13127 allows it)
13128
13129 @param pWDICtx: pointer to the WLAN DAL context
13130 pEventData: pointer to the event information structure
13131
13132 @see
13133 @return Result of the function call
13134*/
13135WDI_Status
13136WDI_ProcessShutdownReq
13137(
13138 WDI_ControlBlockType* pWDICtx,
13139 WDI_EventInfoType* pEventData
13140 )
13141{
13142 wpt_status wptStatus;
13143
13144
13145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13146
13147 /*-------------------------------------------------------------------------
13148 Sanity check
13149 -------------------------------------------------------------------------*/
13150 if ( NULL == pEventData )
13151 {
13152 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13153 "%s: Invalid parameters", __FUNCTION__);
13154 WDI_ASSERT(0);
13155 return WDI_STATUS_E_FAILURE;
13156 }
13157
13158 wpalMutexAcquire(&pWDICtx->wptMutex);
13159
13160
13161 gWDIInitialized = eWLAN_PAL_FALSE;
13162 /*! TO DO: stop the data services */
13163 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13164 {
13165 /*Stop the STA Table !UT- check this logic again
13166 It is safer to do it here than on the response - because a stop is imminent*/
13167 WDI_STATableStop(pWDICtx);
13168
13169 /* Stop Transport Driver, DXE */
13170 WDTS_Stop(pWDICtx);
13171 }
13172
13173 /*Clear all pending request*/
13174 WDI_ClearPendingRequests(pWDICtx);
13175 /* Close Data transport*/
13176 /* FTM mode does not open Data Path */
13177 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13178 {
13179 WDTS_Close(pWDICtx);
13180 }
13181 /*Close the STA Table !UT- check this logic again*/
13182 WDI_STATableClose(pWDICtx);
13183 /*close the PAL */
13184 wptStatus = wpalClose(pWDICtx->pPALContext);
13185 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13186 {
13187 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13188 "Failed to wpal Close %d", wptStatus);
13189 WDI_ASSERT(0);
13190 }
13191
13192 /*Transition back to init state*/
13193 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13194
13195 wpalMutexRelease(&pWDICtx->wptMutex);
13196
13197 /*Make sure the expected state is properly defaulted to Init*/
13198 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
13199
13200
13201 return WDI_STATUS_SUCCESS;
13202}/*WDI_ProcessShutdownReq*/
13203
13204/*========================================================================
13205 Main DAL Control Path Response Processing API
13206========================================================================*/
13207
13208/**
13209 @brief Process Start Response function (called when a response
13210 is being received over the bus from HAL)
13211
13212 @param pWDICtx: pointer to the WLAN DAL context
13213 pEventData: pointer to the event information structure
13214
13215 @see
13216 @return Result of the function call
13217*/
13218WDI_Status
13219WDI_ProcessStartRsp
13220(
13221 WDI_ControlBlockType* pWDICtx,
13222 WDI_EventInfoType* pEventData
13223)
13224{
13225 WDI_StartRspParamsType wdiRspParams;
13226 WDI_StartRspCb wdiStartRspCb = NULL;
13227
13228 tHalMacStartRspParams* startRspParams;
13229
13230#ifndef HAL_SELF_STA_PER_BSS
13231 WDI_AddStaParams wdiAddSTAParam = {0};
13232#endif
13233 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13234
13235 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
13236 /*-------------------------------------------------------------------------
13237 Sanity check
13238 -------------------------------------------------------------------------*/
13239 if (( NULL == pEventData ) ||
13240 ( NULL == pEventData->pEventData) ||
13241 ( NULL == wdiStartRspCb ))
13242 {
13243 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13244 "%s: Invalid parameters", __FUNCTION__);
13245 WDI_ASSERT(0);
13246 return WDI_STATUS_E_FAILURE;
13247 }
13248
13249 /*-------------------------------------------------------------------------
13250 Extract response and send it to UMAC
13251 -------------------------------------------------------------------------*/
13252 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13253 {
13254 // not enough data was received
13255 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13256 "Invalid response length in Start Resp Expect %x Rcvd %x",
13257 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13258 WDI_ASSERT(0);
13259 return WDI_STATUS_E_FAILURE;
13260 }
13261
13262 /*-------------------------------------------------------------------------
13263 Unpack HAL Response Message - the header was already extracted by the
13264 main Response Handling procedure
13265 -------------------------------------------------------------------------*/
13266 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13267
13268 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13269 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13270 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13271 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13272 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13273 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13274 wdiRspParams.wlanReportedVersion.major =
13275 startRspParams->wcnssWlanVersion.major;
13276 wdiRspParams.wlanReportedVersion.minor =
13277 startRspParams->wcnssWlanVersion.minor;
13278 wdiRspParams.wlanReportedVersion.version =
13279 startRspParams->wcnssWlanVersion.version;
13280 wdiRspParams.wlanReportedVersion.revision =
13281 startRspParams->wcnssWlanVersion.revision;
13282 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13283 startRspParams->wcnssCrmVersionString,
13284 sizeof(wdiRspParams.wcnssSoftwareVersion));
13285 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13286 startRspParams->wcnssWlanVersionString,
13287 sizeof(wdiRspParams.wcnssHardwareVersion));
13288 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13289
13290 wpalMutexAcquire(&pWDICtx->wptMutex);
13291 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13292 {
13293 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13294
13295 /*Cache the start response for further use*/
13296 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
13297 &wdiRspParams,
13298 sizeof(pWDICtx->wdiCachedStartRspParams));
13299
13300 }
13301 else
13302 {
13303 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13304 "Failed to start device with status %s(%d)",
13305 WDI_getHALStatusMsgString(startRspParams->status),
13306 startRspParams->status);
13307
13308 /*Set the expected state transition to stopped - because the start has
13309 failed*/
13310 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13311
13312 wpalMutexRelease(&pWDICtx->wptMutex);
13313
13314 /*Notify UMAC*/
13315 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13316
13317 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13318
13319 /*Although the response is an error - it was processed by our function
13320 so as far as the caller is concerned this is a succesful reponse processing*/
13321 return WDI_STATUS_SUCCESS;
13322 }
13323
13324 wpalMutexRelease(&pWDICtx->wptMutex);
13325
13326 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13327 {
13328 /* FTM mode does not need to execute below */
13329 /* Notify UMAC */
13330 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13331 return WDI_STATUS_SUCCESS;
13332 }
13333
13334 /* START the Data transport */
13335 WDTS_startTransport(pWDICtx);
13336
13337 /*Start the STA Table !- check this logic again*/
13338 WDI_STATableStart(pWDICtx);
13339
13340#ifndef HAL_SELF_STA_PER_BSS
13341 /* Store the Self STA Index */
13342 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13343
13344 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13345 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13346 WDI_MAC_ADDR_LEN);
13347
13348 /* At this point add the self-STA */
13349
13350 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13351 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13352 /*! TO DO: wdiAddSTAParam.dpuSig */
13353 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13354 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13355 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13356
13357 //all DPU indices are the same for self STA
13358 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13359 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13360 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13361 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13362 WDI_MAC_ADDR_LEN);
13363 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13364 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13365
13366 /* Note: Since we don't get an explicit config STA request for self STA, we
13367 add the self STA upon receiving the Start response message. But the
13368 self STA entry in the table is deleted when WDI gets an explicit delete STA
13369 request */
13370 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13371#endif
13372
13373 /*Notify UMAC*/
13374 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13375
13376 return WDI_STATUS_SUCCESS;
13377}/*WDI_ProcessStartRsp*/
13378
13379
13380/**
13381 @brief Process Stop Response function (called when a response
13382 is being received over the bus from HAL)
13383
13384 @param pWDICtx: pointer to the WLAN DAL context
13385 pEventData: pointer to the event information structure
13386
13387 @see
13388 @return Result of the function call
13389*/
13390WDI_Status
13391WDI_ProcessStopRsp
13392(
13393 WDI_ControlBlockType* pWDICtx,
13394 WDI_EventInfoType* pEventData
13395)
13396{
13397 WDI_Status wdiStatus;
13398 WDI_StopRspCb wdiStopRspCb = NULL;
13399
13400 tHalMacStopRspMsg halMacStopRspMsg;
13401 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13402
13403 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
13404 /*-------------------------------------------------------------------------
13405 Sanity check
13406 -------------------------------------------------------------------------*/
13407 if (( NULL == pEventData ) ||
13408 ( NULL == pEventData->pEventData) ||
13409 ( NULL == wdiStopRspCb ))
13410 {
13411 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13412 "%s: Invalid parameters", __FUNCTION__);
13413 WDI_ASSERT(0);
13414 return WDI_STATUS_E_FAILURE;
13415 }
13416
13417 /*-------------------------------------------------------------------------
13418 Extract response and send it to UMAC
13419 -------------------------------------------------------------------------*/
13420 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13421 {
13422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13423 "Invalid response length in Stop Resp %x %x",
13424 pEventData->uEventDataSize);
13425 WDI_ASSERT(0);
13426 return WDI_STATUS_E_FAILURE;
13427 }
13428
13429 /*-------------------------------------------------------------------------
13430 Unpack HAL Response Message - the header was already extracted by the
13431 main Response Handling procedure
13432 -------------------------------------------------------------------------*/
13433 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13434 pEventData->pEventData,
13435 sizeof(halMacStopRspMsg.stopRspParams));
13436
13437 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
13438
13439 wpalMutexAcquire(&pWDICtx->wptMutex);
13440
13441 /*--------------------------------------------------------------------------
13442 Check to see if the stop went OK
13443 --------------------------------------------------------------------------*/
13444 if ( WDI_STATUS_SUCCESS != wdiStatus )
13445 {
13446 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13447 "Failed to stop the device with status %s (%d)",
13448 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13449 halMacStopRspMsg.stopRspParams.status);
13450
13451 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13452
13453 wpalMutexRelease(&pWDICtx->wptMutex);
13454 return WDI_STATUS_E_FAILURE;
13455 }
13456
13457 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13458
13459 /*Transition now as WDI may get preempted imediately after it sends
13460 up the Stop Response and it will not get to process the state transition
13461 from Main Rsp function*/
13462 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13463 wpalMutexRelease(&pWDICtx->wptMutex);
13464
13465 /*! TO DO: - STOP the Data transport */
13466
13467 /*Notify UMAC*/
13468 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13469
13470 return WDI_STATUS_SUCCESS;
13471}/*WDI_ProcessStopRsp*/
13472
13473/**
13474 @brief Process Close Rsp function (called when a response
13475 is being received over the bus from HAL)
13476
13477 @param pWDICtx: pointer to the WLAN DAL context
13478 pEventData: pointer to the event information structure
13479
13480 @see
13481 @return Result of the function call
13482*/
13483WDI_Status
13484WDI_ProcessCloseRsp
13485(
13486 WDI_ControlBlockType* pWDICtx,
13487 WDI_EventInfoType* pEventData
13488)
13489{
13490 /*There is no close response comming from HAL - function just kept for
13491 simmetry */
13492 WDI_ASSERT(0);
13493 return WDI_STATUS_SUCCESS;
13494}/*WDI_ProcessCloseRsp*/
13495
13496
13497/*============================================================================
13498 SCAN RESPONSE PROCESSING API
13499============================================================================*/
13500
13501/**
13502 @brief Process Init Scan Rsp function (called when a response
13503 is being received over the bus from HAL)
13504
13505 @param pWDICtx: pointer to the WLAN DAL context
13506 pEventData: pointer to the event information structure
13507
13508 @see
13509 @return Result of the function call
13510*/
13511WDI_Status
13512WDI_ProcessInitScanRsp
13513(
13514 WDI_ControlBlockType* pWDICtx,
13515 WDI_EventInfoType* pEventData
13516)
13517{
13518 WDI_Status wdiStatus;
13519 WDI_InitScanRspCb wdiInitScanRspCb;
13520 tHalInitScanRspMsg halInitScanRspMsg;
13521 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13522
13523 /*-------------------------------------------------------------------------
13524 Sanity check
13525 -------------------------------------------------------------------------*/
13526 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13527 ( NULL == pEventData->pEventData))
13528 {
13529 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13530 "%s: Invalid parameters", __FUNCTION__);
13531 WDI_ASSERT(0);
13532 return WDI_STATUS_E_FAILURE;
13533 }
13534
13535 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13536 if( NULL == wdiInitScanRspCb)
13537 {
13538 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13539 "%s: call back function is NULL", __FUNCTION__);
13540 WDI_ASSERT(0);
13541 return WDI_STATUS_E_FAILURE;
13542 }
13543
13544 /*-------------------------------------------------------------------------
13545 Unpack HAL Response Message - the header was already extracted by the
13546 main Response Handling procedure
13547 -------------------------------------------------------------------------*/
13548 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13549 pEventData->pEventData,
13550 sizeof(halInitScanRspMsg.initScanRspParams));
13551
13552 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
13553
13554 if ( pWDICtx->bInBmps )
13555 {
13556 // notify DTS that we are entering Full power
13557 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13558 }
13559
13560 /*Notify UMAC*/
13561 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13562
13563 return WDI_STATUS_SUCCESS;
13564}/*WDI_ProcessInitScanRsp*/
13565
13566
13567/**
13568 @brief Process Start Scan Rsp function (called when a response
13569 is being received over the bus from HAL)
13570
13571 @param pWDICtx: pointer to the WLAN DAL context
13572 pEventData: pointer to the event information structure
13573
13574 @see
13575 @return Result of the function call
13576*/
13577WDI_Status
13578WDI_ProcessStartScanRsp
13579(
13580 WDI_ControlBlockType* pWDICtx,
13581 WDI_EventInfoType* pEventData
13582)
13583{
13584 WDI_StartScanRspParamsType wdiStartScanParams;
13585 WDI_StartScanRspCb wdiStartScanRspCb;
13586
13587 tHalStartScanRspMsg halStartScanRspMsg;
13588 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13589
13590 /*-------------------------------------------------------------------------
13591 Sanity check
13592 -------------------------------------------------------------------------*/
13593 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13594 ( NULL == pEventData->pEventData))
13595 {
13596 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13597 "%s: Invalid parameters", __FUNCTION__);
13598 WDI_ASSERT(0);
13599 return WDI_STATUS_E_FAILURE;
13600 }
13601
13602 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13603 if( NULL == wdiStartScanRspCb)
13604 {
13605 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13606 "%s: call back function is NULL", __FUNCTION__);
13607 WDI_ASSERT(0);
13608 return WDI_STATUS_E_FAILURE;
13609 }
13610
13611 /*-------------------------------------------------------------------------
13612 Extract response and send it to UMAC
13613 -------------------------------------------------------------------------*/
13614 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13615 pEventData->pEventData,
13616 sizeof(halStartScanRspMsg.startScanRspParams));
13617
13618 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13619 halStartScanRspMsg.startScanRspParams.status);
13620#ifdef WLAN_FEATURE_VOWIFI
13621 wdiStartScanParams.ucTxMgmtPower =
13622 halStartScanRspMsg.startScanRspParams.txMgmtPower;
13623 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
13624 halStartScanRspMsg.startScanRspParams.startTSF,
13625 2);
13626#endif
13627
13628 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13629 {
13630 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13631 "Start scan failed with status %s (%d)",
13632 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13633 halStartScanRspMsg.startScanRspParams.status);
13634 /* send the status to UMAC, don't return from here*/
13635 }
13636
13637 /*Notify UMAC*/
13638 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13639
13640 return WDI_STATUS_SUCCESS;
13641
13642}/*WDI_ProcessStartScanRsp*/
13643
13644
13645/**
13646 @brief Process End Scan Response function (called when a
13647 response is being received over the bus from HAL)
13648
13649 @param pWDICtx: pointer to the WLAN DAL context
13650 pEventData: pointer to the event information structure
13651
13652 @see
13653 @return Result of the function call
13654*/
13655WDI_Status
13656WDI_ProcessEndScanRsp
13657(
13658 WDI_ControlBlockType* pWDICtx,
13659 WDI_EventInfoType* pEventData
13660)
13661{
13662 WDI_Status wdiStatus;
13663 tHalEndScanRspMsg halEndScanRspMsg;
13664 WDI_EndScanRspCb wdiEndScanRspCb;
13665 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13666
13667 /*-------------------------------------------------------------------------
13668 Sanity check
13669 -------------------------------------------------------------------------*/
13670 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13671 ( NULL == pEventData->pEventData))
13672 {
13673 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13674 "%s: Invalid parameters", __FUNCTION__);
13675 WDI_ASSERT(0);
13676 return WDI_STATUS_E_FAILURE;
13677 }
13678
13679 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
13680
13681 /*-------------------------------------------------------------------------
13682 Extract response and send it to UMAC
13683 -------------------------------------------------------------------------*/
13684 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
13685 pEventData->pEventData,
13686 sizeof(halEndScanRspMsg.endScanRspParams));
13687
13688 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
13689
13690 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
13691 {
13692 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13693 "End Scan failed with status %s (%d )",
13694 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
13695 halEndScanRspMsg.endScanRspParams.status);
13696 /* send the status to UMAC, don't return from here*/
13697 }
13698
13699 /*Notify UMAC*/
13700 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13701
13702 return WDI_STATUS_SUCCESS;
13703}/*WDI_ProcessEndScanRsp*/
13704
13705
13706/**
13707 @brief Process Finish Scan Response function (called when a
13708 response is being received over the bus from HAL)
13709
13710 @param pWDICtx: pointer to the WLAN DAL context
13711 pEventData: pointer to the event information structure
13712
13713 @see
13714 @return Result of the function call
13715*/
13716WDI_Status
13717WDI_ProcessFinishScanRsp
13718(
13719 WDI_ControlBlockType* pWDICtx,
13720 WDI_EventInfoType* pEventData
13721)
13722{
13723 WDI_Status wdiStatus;
13724 WDI_FinishScanRspCb wdiFinishScanRspCb;
13725
13726 tHalFinishScanRspMsg halFinishScanRspMsg;
13727 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13728
13729 /*-------------------------------------------------------------------------
13730 Sanity check
13731 -------------------------------------------------------------------------*/
13732 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13733 ( NULL == pEventData->pEventData))
13734 {
13735 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13736 "%s: Invalid parameters", __FUNCTION__);
13737 WDI_ASSERT(0);
13738 return WDI_STATUS_E_FAILURE;
13739 }
13740
13741 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
13742
13743 /*-------------------------------------------------------------------------
13744 Extract response and send it to UMAC
13745 -------------------------------------------------------------------------*/
13746 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
13747 pEventData->pEventData,
13748 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
13749
13750 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
13751
13752 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
13753 "Finish scan response reported status: %d",
13754 halFinishScanRspMsg.finishScanRspParams.status);
13755
13756 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
13757 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
13758 {
13759 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13760 "Finish Scan failed with status %s (%d)",
13761 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
13762 halFinishScanRspMsg.finishScanRspParams.status);
13763 /* send the status to UMAC, don't return from here*/
13764 }
13765
13766 /*Notify UMAC*/
13767 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13768
13769 return WDI_STATUS_SUCCESS;
13770}/*WDI_ProcessFinishScanRsp*/
13771
13772/**
13773 @brief Process Join Response function (called when a response
13774 is being received over the bus from HAL)
13775
13776 @param pWDICtx: pointer to the WLAN DAL context
13777 pEventData: pointer to the event information structure
13778
13779 @see
13780 @return Result of the function call
13781*/
13782WDI_Status
13783WDI_ProcessJoinRsp
13784(
13785 WDI_ControlBlockType* pWDICtx,
13786 WDI_EventInfoType* pEventData
13787)
13788{
13789 WDI_Status wdiStatus;
13790 WDI_JoinRspCb wdiJoinRspCb;
13791 WDI_BSSSessionType* pBSSSes = NULL;
13792
13793 tHalJoinRspMsg halJoinRspMsg;
13794 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13795
13796 /*-------------------------------------------------------------------------
13797 Sanity check
13798 -------------------------------------------------------------------------*/
13799 if (( NULL == pWDICtx ) ||
13800 ( NULL == pWDICtx->pfncRspCB ) ||
13801 ( NULL == pEventData ) ||
13802 ( NULL == pEventData->pEventData))
13803 {
13804 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13805 "%s: Invalid parameters", __FUNCTION__);
13806 WDI_ASSERT(0);
13807 return WDI_STATUS_E_FAILURE;
13808 }
13809
13810 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
13811
13812 /*-------------------------------------------------------------------------
13813 Extract response and send it to UMAC
13814 -------------------------------------------------------------------------*/
13815 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
13816 pEventData->pEventData,
13817 sizeof(halJoinRspMsg.joinRspParams));
13818
13819 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
13820
13821 wpalMutexAcquire(&pWDICtx->wptMutex);
13822
13823 /*-----------------------------------------------------------------------
13824 Join response can only be received for an existing assoc that
13825 is current and in progress
13826 -----------------------------------------------------------------------*/
13827 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
13828 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
13829 {
13830 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13831 "Association sequence for this BSS does not yet exist or "
13832 "association no longer in progress - mysterious HAL response");
13833
13834 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13835 wpalMutexRelease(&pWDICtx->wptMutex);
13836 return WDI_STATUS_E_NOT_ALLOWED;
13837 }
13838
13839 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
13840
13841 /*-----------------------------------------------------------------------
13842 Join Response is only allowed in init state
13843 -----------------------------------------------------------------------*/
13844 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
13845 {
13846 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13847 "Join only allowed in Joining state - failure state is %d "
13848 "strange HAL response", pBSSSes->wdiAssocState);
13849
13850 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13851
13852 wpalMutexRelease(&pWDICtx->wptMutex);
13853 return WDI_STATUS_E_NOT_ALLOWED;
13854 }
13855
13856
13857 /*-----------------------------------------------------------------------
13858 If assoc has failed the current session will be deleted
13859 -----------------------------------------------------------------------*/
13860 if ( WDI_STATUS_SUCCESS != wdiStatus )
13861 {
13862 /*Association was failed by HAL - remove session*/
13863 WDI_DeleteSession(pWDICtx, pBSSSes);
13864
13865 /*Association no longer in progress */
13866 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
13867
13868 /*Association no longer in progress - prepare pending assoc for processing*/
13869 WDI_DequeueAssocRequest(pWDICtx);
13870
13871 }
13872 else
13873 {
13874 /*Transition to state Joining - this may be redundant as we are supposed
13875 to be in this state already - but just to be safe*/
13876 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
13877 }
13878
13879 wpalMutexRelease(&pWDICtx->wptMutex);
13880
13881 /*Notify UMAC*/
13882 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13883
13884 return WDI_STATUS_SUCCESS;
13885}/*WDI_ProcessJoinRsp*/
13886
13887
13888/**
13889 @brief Process Config BSS Response function (called when a
13890 response is being received over the bus from HAL)
13891
13892 @param pWDICtx: pointer to the WLAN DAL context
13893 pEventData: pointer to the event information structure
13894
13895 @see
13896 @return Result of the function call
13897*/
13898WDI_Status
13899WDI_ProcessConfigBSSRsp
13900(
13901 WDI_ControlBlockType* pWDICtx,
13902 WDI_EventInfoType* pEventData
13903)
13904{
13905 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
13906 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
13907 wpt_uint8 ucCurrentBSSSesIdx = 0;
13908 WDI_BSSSessionType* pBSSSes = NULL;
13909
13910 tConfigBssRspMsg halConfigBssRspMsg;
13911 WDI_AddStaParams wdiBcastAddSTAParam = {0};
13912 WDI_AddStaParams wdiAddSTAParam = {0};
13913
13914 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13915
13916 /*-------------------------------------------------------------------------
13917 Sanity check
13918 -------------------------------------------------------------------------*/
13919 if (( NULL == pEventData ) ||
13920 ( NULL == pEventData->pEventData))
13921 {
13922 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13923 "%s: Invalid parameters", __FUNCTION__);
13924 WDI_ASSERT(0);
13925 return WDI_STATUS_E_FAILURE;
13926 }
13927
13928 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
13929
13930 /*-------------------------------------------------------------------------
13931 Extract response and send it to UMAC
13932 -------------------------------------------------------------------------*/
13933 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
13934 pEventData->pEventData,
13935 sizeof(halConfigBssRspMsg.configBssRspParams));
13936
13937 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13938 halConfigBssRspMsg.configBssRspParams.status);
13939 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
13940 {
13941 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
13942 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
13943 WDI_MAC_ADDR_LEN);
13944
13945 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
13946
13947 wdiConfigBSSParams.ucBcastSig =
13948 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
13949
13950 wdiConfigBSSParams.ucUcastSig =
13951 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
13952
13953 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
13954
13955 #ifdef WLAN_FEATURE_VOWIFI
13956 wdiConfigBSSParams.ucTxMgmtPower =
13957 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
13958 #endif
13959 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
13960 halConfigBssRspMsg.configBssRspParams.staMac,
13961 WDI_MAC_ADDR_LEN );
13962
13963 wpalMutexAcquire(&pWDICtx->wptMutex);
13964 /*------------------------------------------------------------------------
13965 Find the BSS for which the request is made
13966 ------------------------------------------------------------------------*/
13967 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
13968 wdiConfigBSSParams.macBSSID,
13969 &pBSSSes);
13970
13971 /*-----------------------------------------------------------------------
13972 Config BSS response can only be received for an existing assoc that
13973 is current and in progress
13974 -----------------------------------------------------------------------*/
13975 if ( NULL == pBSSSes )
13976 {
13977 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13978 "Association sequence for this BSS does not yet exist "
13979 "- mysterious HAL response");
13980
13981 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13982
13983 wpalMutexRelease(&pWDICtx->wptMutex);
13984 return WDI_STATUS_E_NOT_ALLOWED;
13985 }
13986
13987 /*Save data for this BSS*/
13988 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
13989 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
13990 pBSSSes->bcastDpuIndex =
13991 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
13992 pBSSSes->bcastDpuSignature =
13993 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
13994 pBSSSes->bcastMgmtDpuIndex =
13995 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
13996 pBSSSes->bcastMgmtDpuSignature =
13997 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
13998 pBSSSes->ucRmfEnabled =
13999 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14000 pBSSSes->bcastStaIdx =
14001 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
14002
14003 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
14004
14005 /*-------------------------------------------------------------------------
14006 Add Peer STA
14007 -------------------------------------------------------------------------*/
14008 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
14009 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
14010 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
14011
14012 /*This info can be retrieved from the cached initial request*/
14013 wdiAddSTAParam.ucWmmEnabled =
14014 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
14015 wdiAddSTAParam.ucHTCapable =
14016 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
14017 wdiAddSTAParam.ucStaType =
14018 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14019
14020 /* MAC Address of STA */
14021 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14022 halConfigBssRspMsg.configBssRspParams.staMac,
14023 WDI_MAC_ADDR_LEN);
14024
14025 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14026 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14027 WDI_MAC_ADDR_LEN);
14028
14029 /*Add BSS specific parameters*/
14030 wdiAddSTAParam.bcastMgmtDpuIndex =
14031 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
14032 wdiAddSTAParam.bcastMgmtDpuSignature =
14033 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
14034 wdiAddSTAParam.bcastDpuIndex =
14035 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
14036 wdiAddSTAParam.bcastDpuSignature =
14037 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
14038 wdiAddSTAParam.ucRmfEnabled =
14039 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14040 wdiAddSTAParam.ucBSSIdx =
14041 halConfigBssRspMsg.configBssRspParams.bssIdx;
14042
14043 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14044 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
14045
14046 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14047 /*-------------------------------------------------------------------------
14048 Add Broadcast STA only in AP mode
14049 -------------------------------------------------------------------------*/
14050 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
14051 WDI_BSS_OPERATIONAL_MODE_AP )
14052 {
14053 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14054 "Add BCAST STA to table for index: %d",
14055 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14056
14057 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
14058 sizeof(WDI_AddStaParams) );
14059
14060 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14061 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14062 }
14063 wpalMutexRelease(&pWDICtx->wptMutex);
14064 }
14065 else
14066 {
14067 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14068 "Config BSS RSP failed with status : %s(%d)",
14069 WDI_getHALStatusMsgString(
14070 halConfigBssRspMsg.configBssRspParams.status),
14071 halConfigBssRspMsg.configBssRspParams.status);
14072
14073
14074 /*Association was failed by HAL - remove session*/
14075 WDI_DeleteSession(pWDICtx, pBSSSes);
14076
14077 /*Association no longer in progress */
14078 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14079
14080 /*Association no longer in progress - prepare pending assoc for processing*/
14081 WDI_DequeueAssocRequest(pWDICtx);
14082
14083 }
14084
14085 /*Notify UMAC*/
14086 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14087
14088 return WDI_STATUS_SUCCESS;
14089}/*WDI_ProcessConfigBSSRsp*/
14090
14091
14092/**
14093 @brief Process Del BSS Response function (called when a response
14094 is being received over the bus from HAL)
14095
14096 @param pWDICtx: pointer to the WLAN DAL context
14097 pEventData: pointer to the event information structure
14098
14099 @see
14100 @return Result of the function call
14101*/
14102WDI_Status
14103WDI_ProcessDelBSSRsp
14104(
14105 WDI_ControlBlockType* pWDICtx,
14106 WDI_EventInfoType* pEventData
14107)
14108{
14109 WDI_DelBSSRspParamsType wdiDelBSSParams;
14110 WDI_DelBSSRspCb wdiDelBSSRspCb;
14111 wpt_uint8 ucCurrentBSSSesIdx = 0;
14112 WDI_BSSSessionType* pBSSSes = NULL;
14113
14114 tDeleteBssRspMsg halDelBssRspMsg;
14115 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14116
14117 /*-------------------------------------------------------------------------
14118 Sanity check
14119 -------------------------------------------------------------------------*/
14120 if (( NULL == pEventData ) ||
14121 ( NULL == pEventData->pEventData))
14122 {
14123 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14124 "%s: Invalid parameters", __FUNCTION__);
14125 WDI_ASSERT(0);
14126 return WDI_STATUS_E_FAILURE;
14127 }
14128
14129 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14130
14131 /*-------------------------------------------------------------------------
14132 Extract response and send it to UMAC
14133 -------------------------------------------------------------------------*/
14134 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14135 pEventData->pEventData,
14136 sizeof(halDelBssRspMsg.deleteBssRspParams));
14137
14138
14139 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14140 halDelBssRspMsg.deleteBssRspParams.status);
14141
14142 wpalMutexAcquire(&pWDICtx->wptMutex);
14143
14144 /*------------------------------------------------------------------------
14145 Find the BSS for which the request is made
14146 ------------------------------------------------------------------------*/
14147 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14148 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14149 &pBSSSes);
14150
14151 /*-----------------------------------------------------------------------
14152 Del BSS response can only be received for an existing assoc that
14153 is current and in progress
14154 -----------------------------------------------------------------------*/
14155 if ( NULL == pBSSSes )
14156 {
14157 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14158 "Association sequence for this BSS does not yet exist or "
14159 "association no longer in progress - mysterious HAL response");
14160
14161 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14162
14163 wpalMutexRelease(&pWDICtx->wptMutex);
14164 return WDI_STATUS_E_NOT_ALLOWED;
14165 }
14166
14167 /*Extract BSSID for the response to UMAC*/
14168 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
14169 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14170
14171 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14172
14173 /*-----------------------------------------------------------------------
14174 The current session will be deleted
14175 -----------------------------------------------------------------------*/
14176 WDI_DeleteSession(pWDICtx, pBSSSes);
14177
14178 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14179 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14180 {
14181 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14182 }
14183
14184 /* Delete the STA's in this BSS */
14185 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
14186
14187 wpalMutexRelease(&pWDICtx->wptMutex);
14188
14189 /*Notify UMAC*/
14190 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14191
14192 return WDI_STATUS_SUCCESS;
14193}/*WDI_ProcessDelBSSRsp*/
14194
14195/**
14196 @brief Process Post Assoc Rsp function (called when a response
14197 is being received over the bus from HAL)
14198
14199 @param pWDICtx: pointer to the WLAN DAL context
14200 pEventData: pointer to the event information structure
14201
14202 @see
14203 @return Result of the function call
14204*/
14205WDI_Status
14206WDI_ProcessPostAssocRsp
14207(
14208 WDI_ControlBlockType* pWDICtx,
14209 WDI_EventInfoType* pEventData
14210)
14211{
14212 WDI_PostAssocRspParamsType wdiPostAssocParams;
14213 WDI_PostAssocRspCb wdiPostAssocRspCb;
14214 wpt_uint8 ucCurrentBSSSesIdx = 0;
14215 WDI_BSSSessionType* pBSSSes = NULL;
14216 tPostAssocRspMsg halPostAssocRspMsg;
14217 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14218
14219 /*-------------------------------------------------------------------------
14220 Sanity check
14221 -------------------------------------------------------------------------*/
14222 if (( NULL == pEventData ) ||
14223 ( NULL == pEventData->pEventData))
14224 {
14225 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14226 "%s: Invalid parameters", __FUNCTION__);
14227 WDI_ASSERT(0);
14228 return WDI_STATUS_E_FAILURE;
14229 }
14230
14231 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14232
14233 /*-------------------------------------------------------------------------
14234 Extract response and send it to UMAC
14235 -------------------------------------------------------------------------*/
14236 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14237 pEventData->pEventData,
14238 sizeof(halPostAssocRspMsg.postAssocRspParams));
14239
14240 /*Extract the Post Assoc STA Params */
14241
14242 wdiPostAssocParams.staParams.ucSTAIdx =
14243 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
14244 wdiPostAssocParams.staParams.ucUcastSig =
14245 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14246 wdiPostAssocParams.staParams.ucBcastSig =
14247 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14248
14249 wdiPostAssocParams.wdiStatus =
14250 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
14251
14252 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14253 included in the response */
14254 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14255 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
14256 WDI_MAC_ADDR_LEN);
14257
14258 /* Extract Post Assoc BSS Params */
14259
14260 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14261 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14262 WDI_MAC_ADDR_LEN);
14263
14264 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14265 included in the response */
14266 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
14267 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14268 .macSTA, WDI_MAC_ADDR_LEN);
14269
14270 wdiPostAssocParams.bssParams.ucBcastSig =
14271 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14272
14273 wdiPostAssocParams.bssParams.ucUcastSig =
14274 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14275
14276 wdiPostAssocParams.bssParams.ucBSSIdx =
14277 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14278
14279 wdiPostAssocParams.bssParams.ucSTAIdx =
14280 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14281
14282 wpalMutexAcquire(&pWDICtx->wptMutex);
14283
14284 /*------------------------------------------------------------------------
14285 Find the BSS for which the request is made
14286 ------------------------------------------------------------------------*/
14287 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14288 wdiPostAssocParams.bssParams.
14289 macBSSID, &pBSSSes);
14290
14291 /*-----------------------------------------------------------------------
14292 Post assoc response can only be received for an existing assoc that
14293 is current and in progress
14294 -----------------------------------------------------------------------*/
14295 if (( NULL == pBSSSes ) ||
14296 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
14297 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14298 {
14299 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14300 "Association sequence for this BSS does not yet exist or "
14301 "association no longer in progress - mysterious HAL response");
14302
14303 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14304
14305 wpalMutexRelease(&pWDICtx->wptMutex);
14306 return WDI_STATUS_E_NOT_ALLOWED;
14307 }
14308
14309 /*-----------------------------------------------------------------------
14310 Post Assoc Request is only allowed in Joining state
14311 -----------------------------------------------------------------------*/
14312 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14313 {
14314 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14315 "Post Assoc not allowed before JOIN - failing request "
14316 "strange HAL response");
14317
14318 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14319
14320 wpalMutexRelease(&pWDICtx->wptMutex);
14321 return WDI_STATUS_E_NOT_ALLOWED;
14322 }
14323
14324 /*-----------------------------------------------------------------------
14325 If assoc has failed the current session will be deleted
14326 -----------------------------------------------------------------------*/
14327 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14328 {
14329 /*Association was failed by HAL - remove session*/
14330 WDI_DeleteSession(pWDICtx, pBSSSes);
14331 }
14332 else
14333 {
14334 /*Transition to state POST Assoc*/
14335 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
14336
14337 /*Save DPU Info*/
14338 pBSSSes->bcastMgmtDpuIndex =
14339 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
14340 pBSSSes->bcastMgmtDpuSignature =
14341 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
14342 pBSSSes->bcastDpuIndex =
14343 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
14344 pBSSSes->bcastDpuSignature =
14345 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14346
14347 pBSSSes->ucBSSIdx =
14348 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14349 }
14350
14351 /*Association no longer in progress */
14352 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14353
14354 /*Association no longer in progress - prepare pending assoc for processing*/
14355 WDI_DequeueAssocRequest(pWDICtx);
14356
14357 wpalMutexRelease(&pWDICtx->wptMutex);
14358
14359 /*Notify UMAC*/
14360 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14361
14362 return WDI_STATUS_SUCCESS;
14363}/*WDI_ProcessPostAssocRsp*/
14364
14365/**
14366 @brief Process Del STA Rsp function (called when a response is
14367 being received over the bus from HAL)
14368
14369 @param pWDICtx: pointer to the WLAN DAL context
14370 pEventData: pointer to the event information structure
14371
14372 @see
14373 @return Result of the function call
14374*/
14375WDI_Status
14376WDI_ProcessDelSTARsp
14377(
14378 WDI_ControlBlockType* pWDICtx,
14379 WDI_EventInfoType* pEventData
14380)
14381{
14382 WDI_DelSTARspParamsType wdiDelSTARsp;
14383 WDI_DelSTARspCb wdiDelSTARspCb;
14384 wpt_uint8 staType;
14385 tDeleteStaRspMsg halDelStaRspMsg;
14386 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14387
14388 /*-------------------------------------------------------------------------
14389 Sanity check
14390 -------------------------------------------------------------------------*/
14391 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14392 ( NULL == pEventData->pEventData))
14393 {
14394 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14395 "%s: Invalid parameters", __FUNCTION__);
14396 WDI_ASSERT(0);
14397 return WDI_STATUS_E_FAILURE;
14398 }
14399
14400 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14401
14402 /*-------------------------------------------------------------------------
14403 Extract response and send it to UMAC
14404 -------------------------------------------------------------------------*/
14405 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
14406 pEventData->pEventData,
14407 sizeof(halDelStaRspMsg.delStaRspParams));
14408
14409 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
14410 wdiDelSTARsp.wdiStatus =
14411 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
14412
14413 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14414
14415 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14416 if(staType == WDI_STA_ENTRY_SELF)
14417 {
14418 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14419
14420 /* At this point add the self-STA */
14421
14422 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14423 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14424 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14425
14426#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14427#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14428
14429 //all DPU indices are the same for self STA
14430 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14431 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14432 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14433 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14434 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14435 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
14436 }
14437 else
14438 {
14439 //Delete the station in the table
14440 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14441 }
14442
14443 /*Notify UMAC*/
14444 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14445
14446 return WDI_STATUS_SUCCESS;
14447}/*WDI_ProcessDelSTARsp*/
14448
14449
14450/*==========================================================================
14451 Security Response Processing Functions
14452==========================================================================*/
14453
14454/**
14455 @brief Process Set BSS Key Rsp function (called when a response
14456 is being received over the bus from HAL)
14457
14458 @param pWDICtx: pointer to the WLAN DAL context
14459 pEventData: pointer to the event information structure
14460
14461 @see
14462 @return Result of the function call
14463*/
14464WDI_Status
14465WDI_ProcessSetBssKeyRsp
14466(
14467 WDI_ControlBlockType* pWDICtx,
14468 WDI_EventInfoType* pEventData
14469)
14470{
14471 WDI_Status wdiStatus;
14472 eHalStatus halStatus;
14473 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14474 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14475
14476 /*-------------------------------------------------------------------------
14477 Sanity check
14478 -------------------------------------------------------------------------*/
14479 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14480 ( NULL == pEventData->pEventData))
14481 {
14482 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14483 "%s: Invalid parameters", __FUNCTION__);
14484 WDI_ASSERT(0);
14485 return WDI_STATUS_E_FAILURE;
14486 }
14487
14488 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14489
14490 /*-------------------------------------------------------------------------
14491 Extract response and send it to UMAC
14492 -------------------------------------------------------------------------*/
14493 halStatus = *((eHalStatus*)pEventData->pEventData);
14494 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14495
14496 if ( eHAL_STATUS_SUCCESS != halStatus )
14497 {
14498 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14499 "Set BSS Key failed with status %s (%d)",
14500 WDI_getHALStatusMsgString(halStatus),
14501 halStatus);
14502 /* send the status to UMAC, don't return from here*/
14503 }
14504
14505 /*Notify UMAC*/
14506 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14507
14508 return WDI_STATUS_SUCCESS;
14509}/*WDI_ProcessSetBssKeyRsp*/
14510
14511/**
14512 @brief Process Remove BSS Key Rsp function (called when a response
14513 is being received over the bus from HAL)
14514
14515 @param pWDICtx: pointer to the WLAN DAL context
14516 pEventData: pointer to the event information structure
14517
14518 @see
14519 @return Result of the function call
14520*/
14521WDI_Status
14522WDI_ProcessRemoveBssKeyRsp
14523(
14524 WDI_ControlBlockType* pWDICtx,
14525 WDI_EventInfoType* pEventData
14526)
14527{
14528 WDI_Status wdiStatus;
14529 eHalStatus halStatus;
14530 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14531 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14532
14533 /*-------------------------------------------------------------------------
14534 Sanity check
14535 -------------------------------------------------------------------------*/
14536 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14537 ( NULL == pEventData->pEventData))
14538 {
14539 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14540 "%s: Invalid parameters", __FUNCTION__);
14541 WDI_ASSERT(0);
14542 return WDI_STATUS_E_FAILURE;
14543 }
14544
14545 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14546
14547 /*-------------------------------------------------------------------------
14548 Extract response and send it to UMAC
14549 -------------------------------------------------------------------------*/
14550 halStatus = *((eHalStatus*)pEventData->pEventData);
14551 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14552
14553 if ( eHAL_STATUS_SUCCESS != halStatus )
14554 {
14555 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14556 "Remove BSS Key failed with status %s (%d )",
14557 WDI_getHALStatusMsgString(halStatus),
14558 halStatus);
14559 /* send the status to UMAC, don't return from here*/
14560 }
14561
14562 /*Notify UMAC*/
14563 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14564
14565 return WDI_STATUS_SUCCESS;
14566}/*WDI_ProcessSetBssKeyRsp*/
14567
14568
14569/**
14570 @brief Process Set STA Key Rsp function (called when a response
14571 is being received over the bus from HAL)
14572
14573 @param pWDICtx: pointer to the WLAN DAL context
14574 pEventData: pointer to the event information structure
14575
14576 @see
14577 @return Result of the function call
14578*/
14579WDI_Status
14580WDI_ProcessSetStaKeyRsp
14581(
14582 WDI_ControlBlockType* pWDICtx,
14583 WDI_EventInfoType* pEventData
14584)
14585{
14586 WDI_Status wdiStatus;
14587 eHalStatus halStatus;
14588 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14589 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14590
14591 /*-------------------------------------------------------------------------
14592 Sanity check
14593 -------------------------------------------------------------------------*/
14594 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14595 ( NULL == pEventData->pEventData))
14596 {
14597 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14598 "%s: Invalid parameters", __FUNCTION__);
14599 WDI_ASSERT(0);
14600 return WDI_STATUS_E_FAILURE;
14601 }
14602
14603 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14604
14605 /*-------------------------------------------------------------------------
14606 Extract response and send it to UMAC
14607 -------------------------------------------------------------------------*/
14608 halStatus = *((eHalStatus*)pEventData->pEventData);
14609 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14610
14611 if ( eHAL_STATUS_SUCCESS != halStatus )
14612 {
14613 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14614 "Set STA Key failed with status %s (%d)",
14615 WDI_getHALStatusMsgString(halStatus),
14616 halStatus);
14617 /* send the status to UMAC, don't return from here*/
14618 }
14619
14620 /*Notify UMAC*/
14621 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14622
14623 return WDI_STATUS_SUCCESS;
14624}/*WDI_ProcessSetSTAKeyRsp*/
14625
14626/**
14627 @brief Process Remove STA Key Rsp function (called when a
14628 response is being received over the bus from HAL)
14629
14630 @param pWDICtx: pointer to the WLAN DAL context
14631 pEventData: pointer to the event information structure
14632
14633 @see
14634 @return Result of the function call
14635*/
14636WDI_Status
14637WDI_ProcessRemoveStaKeyRsp
14638(
14639 WDI_ControlBlockType* pWDICtx,
14640 WDI_EventInfoType* pEventData
14641)
14642{
14643 WDI_Status wdiStatus;
14644 eHalStatus halStatus;
14645 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14646 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14647
14648 /*-------------------------------------------------------------------------
14649 Sanity check
14650 -------------------------------------------------------------------------*/
14651 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14652 ( NULL == pEventData->pEventData))
14653 {
14654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14655 "%s: Invalid parameters", __FUNCTION__);
14656 WDI_ASSERT(0);
14657 return WDI_STATUS_E_FAILURE;
14658 }
14659
14660 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14661
14662 /*-------------------------------------------------------------------------
14663 Extract response and send it to UMAC
14664 -------------------------------------------------------------------------*/
14665 halStatus = *((eHalStatus*)pEventData->pEventData);
14666 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14667
14668 if ( eHAL_STATUS_SUCCESS != halStatus )
14669 {
14670 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14671 "Remove STA Key failed with status %s (%d)",
14672 WDI_getHALStatusMsgString(halStatus),
14673 halStatus);
14674 /* send the status to UMAC, don't return from here*/
14675 }
14676
14677 /*Notify UMAC*/
14678 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14679
14680 return WDI_STATUS_SUCCESS;
14681}/*WDI_ProcessRemoveStaKeyRsp*/
14682
14683/**
14684 @brief Process Set STA Bcast Key Rsp function (called when a
14685 response is being received over the bus from HAL)
14686
14687 @param pWDICtx: pointer to the WLAN DAL context
14688 pEventData: pointer to the event information structure
14689
14690 @see
14691 @return Result of the function call
14692*/
14693WDI_Status
14694WDI_ProcessSetStaBcastKeyRsp
14695(
14696 WDI_ControlBlockType* pWDICtx,
14697 WDI_EventInfoType* pEventData
14698)
14699{
14700 WDI_Status wdiStatus;
14701 eHalStatus halStatus;
14702 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
14703 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14704
14705 /*-------------------------------------------------------------------------
14706 Sanity check
14707 -------------------------------------------------------------------------*/
14708 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14709 ( NULL == pEventData->pEventData))
14710 {
14711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14712 "%s: Invalid parameters", __FUNCTION__);
14713 WDI_ASSERT(0);
14714 return WDI_STATUS_E_FAILURE;
14715 }
14716
14717 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14718
14719 /*-------------------------------------------------------------------------
14720 Extract response and send it to UMAC
14721 -------------------------------------------------------------------------*/
14722 wpalMemoryCopy( &halStatus,
14723 pEventData->pEventData,
14724 sizeof(halStatus));
14725
14726 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14727
14728 if ( eHAL_STATUS_SUCCESS != halStatus )
14729 {
14730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14731 "Set STA Key failed with status %s (%d)",
14732 WDI_getHALStatusMsgString(halStatus),
14733 halStatus);
14734 /* send the status to UMAC, don't return from here*/
14735 }
14736
14737 /*Notify UMAC*/
14738 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14739
14740 return WDI_STATUS_SUCCESS;
14741}/*WDI_ProcessSetSTABcastKeyRsp*/
14742
14743/**
14744 @brief Process Remove STA Bcast Key Rsp function (called when a
14745 response is being received over the bus from HAL)
14746
14747 @param pWDICtx: pointer to the WLAN DAL context
14748 pEventData: pointer to the event information structure
14749
14750 @see
14751 @return Result of the function call
14752*/
14753WDI_Status
14754WDI_ProcessRemoveStaBcastKeyRsp
14755(
14756 WDI_ControlBlockType* pWDICtx,
14757 WDI_EventInfoType* pEventData
14758)
14759{
14760 WDI_Status wdiStatus;
14761 eHalStatus halStatus;
14762 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
14763 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14764
14765 /*-------------------------------------------------------------------------
14766 Sanity check
14767 -------------------------------------------------------------------------*/
14768 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14769 ( NULL == pEventData->pEventData))
14770 {
14771 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14772 "%s: Invalid parameters", __FUNCTION__);
14773 WDI_ASSERT(0);
14774 return WDI_STATUS_E_FAILURE;
14775 }
14776
14777 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14778
14779 /*-------------------------------------------------------------------------
14780 Extract response and send it to UMAC
14781 -------------------------------------------------------------------------*/
14782 wpalMemoryCopy( &halStatus,
14783 pEventData->pEventData,
14784 sizeof(halStatus));
14785
14786 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14787
14788 if ( eHAL_STATUS_SUCCESS != halStatus )
14789 {
14790 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14791 "Remove STA Key failed with status %s (%d)",
14792 WDI_getHALStatusMsgString(halStatus),
14793 halStatus);
14794 /* send the status to UMAC, don't return from here*/
14795 }
14796
14797 /*Notify UMAC*/
14798 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14799
14800 return WDI_STATUS_SUCCESS;
14801}/*WDI_ProcessRemoveStaBcastKeyRsp*/
14802
14803
14804/*==========================================================================
14805 QoS and BA Response Processing Functions
14806==========================================================================*/
14807
14808/**
14809 @brief Process Add TSpec Rsp function (called when a response
14810 is being received over the bus from HAL)
14811
14812 @param pWDICtx: pointer to the WLAN DAL context
14813 pEventData: pointer to the event information structure
14814
14815 @see
14816 @return Result of the function call
14817*/
14818WDI_Status
14819WDI_ProcessAddTSpecRsp
14820(
14821 WDI_ControlBlockType* pWDICtx,
14822 WDI_EventInfoType* pEventData
14823)
14824{
14825 WDI_Status wdiStatus;
14826 eHalStatus halStatus;
14827 WDI_AddTsRspCb wdiAddTsRspCb;
14828 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14829
14830 /*-------------------------------------------------------------------------
14831 Sanity check
14832 -------------------------------------------------------------------------*/
14833 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14834 ( NULL == pEventData->pEventData))
14835 {
14836 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14837 "%s: Invalid parameters", __FUNCTION__);
14838 WDI_ASSERT(0);
14839 return WDI_STATUS_E_FAILURE;
14840 }
14841
14842 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
14843
14844 /*-------------------------------------------------------------------------
14845 Extract response and send it to UMAC
14846 -------------------------------------------------------------------------*/
14847 halStatus = *((eHalStatus*)pEventData->pEventData);
14848 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14849
14850 /*Notify UMAC*/
14851 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14852
14853 return WDI_STATUS_SUCCESS;
14854}/*WDI_ProcessAddTSpecRsp*/
14855
14856
14857/**
14858 @brief Process Del TSpec Rsp function (called when a response
14859 is being received over the bus from HAL)
14860
14861 @param pWDICtx: pointer to the WLAN DAL context
14862 pEventData: pointer to the event information structure
14863
14864 @see
14865 @return Result of the function call
14866*/
14867WDI_Status
14868WDI_ProcessDelTSpecRsp
14869(
14870 WDI_ControlBlockType* pWDICtx,
14871 WDI_EventInfoType* pEventData
14872)
14873{
14874 WDI_Status wdiStatus;
14875 eHalStatus halStatus;
14876 WDI_DelTsRspCb wdiDelTsRspCb;
14877 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14878
14879 /*-------------------------------------------------------------------------
14880 Sanity check
14881 -------------------------------------------------------------------------*/
14882 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14883 ( NULL == pEventData->pEventData))
14884 {
14885 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14886 "%s: Invalid parameters", __FUNCTION__);
14887 WDI_ASSERT(0);
14888 return WDI_STATUS_E_FAILURE;
14889 }
14890
14891 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
14892
14893 /*-------------------------------------------------------------------------
14894 Extract response and send it to UMAC
14895 -------------------------------------------------------------------------*/
14896 halStatus = *((eHalStatus*)pEventData->pEventData);
14897 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14898
14899 /*Notify UMAC*/
14900 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14901
14902 return WDI_STATUS_SUCCESS;
14903}/*WDI_ProcessDelTSpecRsp*/
14904
14905/**
14906 @brief Process Update EDCA Parameters Rsp function (called when a
14907 response is being received over the bus from HAL)
14908
14909 @param pWDICtx: pointer to the WLAN DAL context
14910 pEventData: pointer to the event information structure
14911
14912 @see
14913 @return Result of the function call
14914*/
14915WDI_Status
14916WDI_ProcessUpdateEDCAParamsRsp
14917(
14918 WDI_ControlBlockType* pWDICtx,
14919 WDI_EventInfoType* pEventData
14920)
14921{
14922 WDI_Status wdiStatus;
14923 eHalStatus halStatus;
14924 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
14925 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14926
14927 /*-------------------------------------------------------------------------
14928 Sanity check
14929 -------------------------------------------------------------------------*/
14930 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14931 ( NULL == pEventData->pEventData))
14932 {
14933 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14934 "%s: Invalid parameters", __FUNCTION__);
14935 WDI_ASSERT(0);
14936 return WDI_STATUS_E_FAILURE;
14937 }
14938
14939 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
14940
14941 /*-------------------------------------------------------------------------
14942 Extract response and send it to UMAC
14943 -------------------------------------------------------------------------*/
14944 halStatus = *((eHalStatus*)pEventData->pEventData);
14945 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
14946
14947 /*Notify UMAC*/
14948 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14949
14950 return WDI_STATUS_SUCCESS;
14951}/*WDI_ProcessUpdateEDCAParamsRsp*/
14952
14953
14954/**
14955 @brief Process Add BA Rsp function (called when a response
14956 is being received over the bus from HAL)
14957
14958 @param pWDICtx: pointer to the WLAN DAL context
14959 pEventData: pointer to the event information structure
14960
14961 @see
14962 @return Result of the function call
14963*/
14964WDI_Status
14965WDI_ProcessAddBASessionRsp
14966(
14967 WDI_ControlBlockType* pWDICtx,
14968 WDI_EventInfoType* pEventData
14969)
14970{
14971 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
14972
14973 tAddBASessionRspParams halBASessionRsp;
14974 WDI_AddBASessionRspParamsType wdiBASessionRsp;
14975
14976
14977 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14978
14979 /*-------------------------------------------------------------------------
14980 Sanity check
14981 -------------------------------------------------------------------------*/
14982 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14983 ( NULL == pEventData->pEventData))
14984 {
14985 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14986 "%s: Invalid parameters", __FUNCTION__);
14987 WDI_ASSERT(0);
14988 return WDI_STATUS_E_FAILURE;
14989 }
14990
14991 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
14992
14993 /*-------------------------------------------------------------------------
14994 Extract response and send it to UMAC
14995 -------------------------------------------------------------------------*/
14996 wpalMemoryCopy( &halBASessionRsp,
14997 pEventData->pEventData,
14998 sizeof(halBASessionRsp));
14999
15000 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15001
Jeff Johnson43971f52012-07-17 12:26:56 -070015002 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015003 {
15004 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15005 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15006 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15007 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15008 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15009 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15010 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15011 }
15012
15013 /*Notify UMAC*/
15014 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15015
15016 return WDI_STATUS_SUCCESS;
15017}/*WDI_ProcessAddSessionBARsp*/
15018
15019
15020/**
15021 @brief Process Del BA Rsp function (called when a response
15022 is being received over the bus from HAL)
15023
15024 @param pWDICtx: pointer to the WLAN DAL context
15025 pEventData: pointer to the event information structure
15026
15027 @see
15028 @return Result of the function call
15029*/
15030WDI_Status
15031WDI_ProcessDelBARsp
15032(
15033 WDI_ControlBlockType* pWDICtx,
15034 WDI_EventInfoType* pEventData
15035)
15036{
15037 WDI_Status wdiStatus;
15038 eHalStatus halStatus;
15039 WDI_DelBARspCb wdiDelBARspCb;
15040 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15041
15042 /*-------------------------------------------------------------------------
15043 Sanity check
15044 -------------------------------------------------------------------------*/
15045 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15046 ( NULL == pEventData->pEventData))
15047 {
15048 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15049 "%s: Invalid parameters", __FUNCTION__);
15050 WDI_ASSERT(0);
15051 return WDI_STATUS_E_FAILURE;
15052 }
15053
15054 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15055
15056 /*-------------------------------------------------------------------------
15057 Extract response and send it to UMAC
15058 -------------------------------------------------------------------------*/
15059 halStatus = *((eHalStatus*)pEventData->pEventData);
15060 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15061
15062 if ( eHAL_STATUS_SUCCESS == halStatus )
15063 {
15064 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15065 }
15066
15067 /*Notify UMAC*/
15068 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15069
15070 return WDI_STATUS_SUCCESS;
15071}/*WDI_ProcessDelBARsp*/
15072
15073#ifdef FEATURE_WLAN_CCX
15074/**
15075 @brief Process TSM Stats Rsp function (called when a response
15076 is being received over the bus from HAL)
15077
15078 @param pWDICtx: pointer to the WLAN DAL context
15079 pEventData: pointer to the event information structure
15080
15081 @see
15082 @return Result of the function call
15083*/
15084WDI_Status
15085WDI_ProcessTsmStatsRsp
15086(
15087 WDI_ControlBlockType* pWDICtx,
15088 WDI_EventInfoType* pEventData
15089)
15090{
15091 WDI_TsmRspCb wdiTsmStatsRspCb;
15092 tTsmStatsRspMsg halTsmStatsRspMsg;
15093 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15094 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15095
15096 /*-------------------------------------------------------------------------
15097 Sanity check
15098 -------------------------------------------------------------------------*/
15099 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15100 ( NULL == pEventData->pEventData))
15101 {
15102 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15103 "%s: Invalid parameters", __FUNCTION__);
15104 WDI_ASSERT(0);
15105 return WDI_STATUS_E_FAILURE;
15106 }
15107
15108 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15109
15110 /*-------------------------------------------------------------------------
15111 Unpack HAL Response Message - the header was already extracted by the
15112 main Response Handling procedure
15113 -------------------------------------------------------------------------*/
15114 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15115 pEventData->pEventData,
15116 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15117
15118 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15119 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15120 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15121 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15122 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15123 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15124 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15125 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15126 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15127 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15128 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15129 halTsmStatsRspMsg.tsmStatsRspParams.status);
15130
15131 /*Notify UMAC*/
15132 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15133
15134 return WDI_STATUS_SUCCESS;
15135}/*WDI_ProcessTsmStatsRsp*/
15136
15137#endif
15138
15139
15140
15141/**
15142 @brief Process Flush AC Rsp function (called when a response
15143 is being received over the bus from HAL)
15144
15145 @param pWDICtx: pointer to the WLAN DAL context
15146 pEventData: pointer to the event information structure
15147
15148 @see
15149 @return Result of the function call
15150*/
15151WDI_Status
15152WDI_ProcessFlushAcRsp
15153(
15154 WDI_ControlBlockType* pWDICtx,
15155 WDI_EventInfoType* pEventData
15156)
15157{
15158 WDI_Status wdiStatus;
15159 eHalStatus halStatus;
15160 WDI_FlushAcRspCb wdiFlushAcRspCb;
15161 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15162
15163 /*-------------------------------------------------------------------------
15164 Sanity check
15165 -------------------------------------------------------------------------*/
15166 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15167 ( NULL == pEventData->pEventData))
15168 {
15169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15170 "%s: Invalid parameters", __FUNCTION__);
15171 WDI_ASSERT(0);
15172 return WDI_STATUS_E_FAILURE;
15173 }
15174
15175 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15176
15177 /*-------------------------------------------------------------------------
15178 Extract response and send it to UMAC
15179 -------------------------------------------------------------------------*/
15180 wpalMemoryCopy( &halStatus,
15181 pEventData->pEventData,
15182 sizeof(halStatus));
15183
15184 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15185
15186 /*Notify UMAC*/
15187 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15188
15189 return WDI_STATUS_SUCCESS;
15190}/*WDI_ProcessFlushAcRsp*/
15191
15192/**
15193 @brief Process BT AMP event Rsp function (called when a
15194 response is being received over the bus from HAL)
15195
15196 @param pWDICtx: pointer to the WLAN DAL context
15197 pEventData: pointer to the event information structure
15198
15199 @see
15200 @return Result of the function call
15201*/
15202WDI_Status
15203WDI_ProcessBtAmpEventRsp
15204(
15205 WDI_ControlBlockType* pWDICtx,
15206 WDI_EventInfoType* pEventData
15207)
15208{
15209 WDI_Status wdiStatus;
15210 eHalStatus halStatus;
15211 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15212 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15213
15214 /*-------------------------------------------------------------------------
15215 Sanity check
15216 -------------------------------------------------------------------------*/
15217 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15218 ( NULL == pEventData->pEventData))
15219 {
15220 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15221 "%s: Invalid parameters", __FUNCTION__);
15222 WDI_ASSERT(0);
15223 return WDI_STATUS_E_FAILURE;
15224 }
15225
15226 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15227
15228 /*-------------------------------------------------------------------------
15229 Extract response and send it to UMAC
15230 -------------------------------------------------------------------------*/
15231 wpalMemoryCopy( &halStatus,
15232 pEventData->pEventData,
15233 sizeof(halStatus));
15234
15235 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15236
15237 /*Notify UMAC*/
15238 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15239
15240 return WDI_STATUS_SUCCESS;
15241}/*WDI_ProcessBtAmpEventRsp*/
15242
15243
15244/**
15245 @brief Process ADD STA SELF Rsp function (called
15246 when a response is being received over the bus from HAL)
15247
15248 @param pWDICtx: pointer to the WLAN DAL context
15249 pEventData: pointer to the event information structure
15250
15251 @see
15252 @return Result of the function call
15253*/
15254WDI_Status
15255WDI_ProcessAddSTASelfRsp
15256(
15257 WDI_ControlBlockType* pWDICtx,
15258 WDI_EventInfoType* pEventData
15259)
15260{
15261 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15262 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15263 tAddStaSelfRspMsg halAddStaSelfRsp;
15264 WDI_AddStaParams wdiAddSTAParam = {0};
15265 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15266
15267 /*-------------------------------------------------------------------------
15268 Sanity check
15269 -------------------------------------------------------------------------*/
15270 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15271 ( NULL == pEventData->pEventData))
15272 {
15273 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15274 "%s: Invalid parameters", __FUNCTION__);
15275 WDI_ASSERT(0);
15276 return WDI_STATUS_E_FAILURE;
15277 }
15278
15279 wdiAddSTASelfReqParamsRspCb =
15280 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15281
15282 /*-------------------------------------------------------------------------
15283 Extract response and send it to UMAC
15284 -------------------------------------------------------------------------*/
15285 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15286 pEventData->pEventData,
15287 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15288
15289
15290 wdiAddSTASelfParams.wdiStatus =
15291 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
15292
15293 wdiAddSTASelfParams.ucSTASelfIdx =
15294 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
15295 wdiAddSTASelfParams.dpuIdx =
15296 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
15297 wdiAddSTASelfParams.dpuSignature =
15298 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15299
15300 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15301 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15302 WDI_MAC_ADDR_LEN);
15303
15304
15305#ifdef HAL_SELF_STA_PER_BSS
15306
15307 /* At this point add the self-STA */
15308
15309 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15310 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15311 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15312
15313 //all DPU indices are the same for self STA
15314
15315 /*DPU Information*/
15316 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
15317 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15318 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15319 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15320 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15321 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15322
15323 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15324 WDI_MAC_ADDR_LEN);
15325
15326 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15327 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15328
15329 if(halAddStaSelfRsp.addStaSelfRspParams.status
15330 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15331 {
15332 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15333 }
15334#endif
15335
15336 /*Notify UMAC*/
15337 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15338
15339 return WDI_STATUS_SUCCESS;
15340}/*WDI_ProcessAddSTASelfRsp*/
15341
15342
15343
15344/**
15345 @brief WDI_ProcessDelSTASelfRsp function (called when a
15346 response is being received over the bus from HAL)
15347
15348 @param pWDICtx: pointer to the WLAN DAL context
15349 pEventData: pointer to the event information structure
15350
15351 @see
15352 @return Result of the function call
15353*/
15354WDI_Status
15355WDI_ProcessDelSTASelfRsp
15356(
15357 WDI_ControlBlockType* pWDICtx,
15358 WDI_EventInfoType* pEventData
15359)
15360{
15361 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15362 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15363 tDelStaSelfRspParams delStaSelfRspParams;
15364 wpt_uint8 ucStaIdx;
15365
15366 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15367
15368 /*-------------------------------------------------------------------------
15369 Sanity check
15370 -------------------------------------------------------------------------*/
15371 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15372 ( NULL == pEventData->pEventData))
15373 {
15374 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15375 "%s: Invalid parameters", __FUNCTION__);
15376 WDI_ASSERT(0);
15377 return WDI_STATUS_E_FAILURE;
15378 }
15379
15380 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15381
15382 /*-------------------------------------------------------------------------
15383 Extract response and send it to UMAC
15384 -------------------------------------------------------------------------*/
15385
15386 wpalMemoryCopy( &delStaSelfRspParams,
15387 (wpt_uint8*)pEventData->pEventData,
15388 sizeof(tDelStaSelfRspParams));
15389
15390 wdiDelStaSelfRspParams.wdiStatus =
15391 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
15392
15393 /* delStaSelfRspParams.status is not
15394 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15395 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15396 {
15397 WDI_Status wdiStatus;
15398 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
15399 delStaSelfRspParams.selfMacAddr,
15400 &ucStaIdx);
15401 if(WDI_STATUS_E_FAILURE == wdiStatus)
15402 {
15403 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15404 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15405 WDI_ASSERT(0);
15406 return WDI_STATUS_E_FAILURE;
15407 }
15408 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15409 }
15410
15411 /*Notify UMAC*/
15412 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15413
15414 return WDI_STATUS_SUCCESS;
15415}
15416
15417
15418
15419/*===========================================================================
15420 Miscellaneous Control Response Processing API
15421===========================================================================*/
15422
15423/**
15424 @brief Process Channel Switch Rsp function (called when a response
15425 is being received over the bus from HAL)
15426
15427 @param pWDICtx: pointer to the WLAN DAL context
15428 pEventData: pointer to the event information structure
15429
15430 @see
15431 @return Result of the function call
15432*/
15433WDI_Status
15434WDI_ProcessChannelSwitchRsp
15435(
15436 WDI_ControlBlockType* pWDICtx,
15437 WDI_EventInfoType* pEventData
15438)
15439{
15440 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15441 WDI_SwitchChRspCb wdiChSwitchRspCb;
15442 tSwitchChannelRspParams halSwitchChannelRsp;
15443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15444
15445 /*-------------------------------------------------------------------------
15446 Sanity check
15447 -------------------------------------------------------------------------*/
15448 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15449 ( NULL == pEventData->pEventData))
15450 {
15451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15452 "%s: Invalid parameters", __FUNCTION__);
15453 WDI_ASSERT(0);
15454 return WDI_STATUS_E_FAILURE;
15455 }
15456
15457 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15458
15459 /*-------------------------------------------------------------------------
15460 Extract response and send it to UMAC
15461 -------------------------------------------------------------------------*/
15462 wpalMemoryCopy( &halSwitchChannelRsp,
15463 (wpt_uint8*)pEventData->pEventData,
15464 sizeof(halSwitchChannelRsp));
15465
15466 wdiSwitchChRsp.wdiStatus =
15467 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
15468 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15469
15470#ifdef WLAN_FEATURE_VOWIFI
15471 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
15472#endif
15473
15474 /*Notify UMAC*/
15475 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15476
15477 return WDI_STATUS_SUCCESS;
15478}/*WDI_ProcessChannelSwitchRsp*/
15479
15480
15481/**
15482 @brief Process Config STA Rsp function (called when a response
15483 is being received over the bus from HAL)
15484
15485 @param pWDICtx: pointer to the WLAN DAL context
15486 pEventData: pointer to the event information structure
15487
15488 @see
15489 @return Result of the function call
15490*/
15491WDI_Status
15492WDI_ProcessConfigStaRsp
15493(
15494 WDI_ControlBlockType* pWDICtx,
15495 WDI_EventInfoType* pEventData
15496)
15497{
15498 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15499 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15500 WDI_AddStaParams wdiAddSTAParam;
15501
15502 WDI_BSSSessionType* pBSSSes = NULL;
15503 wpt_uint8 ucCurrentBSSSesIdx = 0;
15504
15505 tConfigStaRspMsg halConfigStaRsp;
15506 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15507
15508 /*-------------------------------------------------------------------------
15509 Sanity check
15510 -------------------------------------------------------------------------*/
15511 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15512 ( NULL == pEventData->pEventData))
15513 {
15514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15515 "%s: Invalid parameters", __FUNCTION__);
15516 WDI_ASSERT(0);
15517 return WDI_STATUS_E_FAILURE;
15518 }
15519
15520 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15521
15522 /*-------------------------------------------------------------------------
15523 Extract response and send it to UMAC
15524 -------------------------------------------------------------------------*/
15525 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15526 pEventData->pEventData,
15527 sizeof(halConfigStaRsp.configStaRspParams));
15528
15529
15530 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15531 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15532 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15533 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15534 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15535
15536 /* MAC Address of STA - take from cache as it does not come back in the
15537 response*/
15538 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
15539 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
15540 WDI_MAC_ADDR_LEN);
15541
15542 wdiCfgSTAParams.wdiStatus =
15543 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
15544
15545 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15546 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15547 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15548
15549 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15550 {
15551 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15552 {
15553 /* ADD STA to table */
15554 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15555 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15556 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15557
15558 /*This info can be retrieved from the cached initial request*/
15559 wdiAddSTAParam.ucWmmEnabled =
15560 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
15561 wdiAddSTAParam.ucHTCapable =
15562 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15563 wdiAddSTAParam.ucStaType =
15564 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15565
15566 /* MAC Address of STA */
15567 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15568 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
15569 WDI_MAC_ADDR_LEN);
15570
15571 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15572 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15573 WDI_MAC_ADDR_LEN);
15574
15575 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15576 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15577 &pBSSSes);
15578
15579 if ( NULL == pBSSSes )
15580 {
15581 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15582 "Association for this BSSID is not in place");
15583
15584 WDI_ASSERT(0);
15585 return WDI_STATUS_E_NOT_ALLOWED;
15586 }
15587
15588 /*Add BSS specific parameters*/
15589 wdiAddSTAParam.bcastMgmtDpuIndex =
15590 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15591 wdiAddSTAParam.bcastMgmtDpuSignature =
15592 halConfigStaRsp.configStaRspParams.ucMgmtSig;
15593 wdiAddSTAParam.bcastDpuIndex =
15594 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15595 wdiAddSTAParam.bcastDpuSignature =
15596 halConfigStaRsp.configStaRspParams.ucBcastSig;
15597 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15598 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
15599
15600 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15601 }
15602 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15603 {
15604 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
15605
15606 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
15607 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15608 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
15609 halConfigStaRsp.configStaRspParams.ucBcastSig;
15610 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
15611 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15612 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
15613 halConfigStaRsp.configStaRspParams.ucMgmtSig;
15614 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
15615 halConfigStaRsp.configStaRspParams.bssIdx;
15616 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
15617 halConfigStaRsp.configStaRspParams.dpuIndex;
15618 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
15619 halConfigStaRsp.configStaRspParams.ucUcastSig;
15620 }
15621 }
15622
15623 /*Notify UMAC*/
15624 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
15625
15626 return WDI_STATUS_SUCCESS;
15627}/*WDI_ProcessConfigStaRsp*/
15628
15629
15630/**
15631 @brief Process Set Link State Rsp function (called when a
15632 response is being received over the bus from HAL)
15633
15634 @param pWDICtx: pointer to the WLAN DAL context
15635 pEventData: pointer to the event information structure
15636
15637 @see
15638 @return Result of the function call
15639*/
15640WDI_Status
15641WDI_ProcessSetLinkStateRsp
15642(
15643 WDI_ControlBlockType* pWDICtx,
15644 WDI_EventInfoType* pEventData
15645)
15646{
15647 WDI_Status wdiStatus;
15648 eHalStatus halStatus;
15649 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
15650
15651 WDI_BSSSessionType* pBSSSes = NULL;
15652 wpt_uint8 ucCurrentBSSSesIdx = 0;
15653 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15654
15655 /*-------------------------------------------------------------------------
15656 Sanity check
15657 -------------------------------------------------------------------------*/
15658 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15659 ( NULL == pEventData->pEventData))
15660 {
15661 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15662 "%s: Invalid parameters", __FUNCTION__);
15663 WDI_ASSERT(0);
15664 return WDI_STATUS_E_FAILURE;
15665 }
15666
15667 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
15668
15669 wpalMutexAcquire(&pWDICtx->wptMutex);
15670
15671 /*If the link is being transitioned to idle - the BSS is to be deleted
15672 - this type of ending a session is possible when UMAC has failed an
15673 - association session during Join*/
15674 if ( WDI_LINK_IDLE_STATE ==
15675 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15676 {
15677 /*------------------------------------------------------------------------
15678 Find the BSS for which the request is made
15679 ------------------------------------------------------------------------*/
15680 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15681 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
15682 &pBSSSes);
15683
15684 /*-----------------------------------------------------------------------
15685 Del BSS response can only be received for an existing assoc that
15686 is current and in progress
15687 -----------------------------------------------------------------------*/
15688 if ( NULL == pBSSSes )
15689 {
15690 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
15691 "Set link response received outside association session");
15692 }
15693 else
15694 {
15695 /* For BT AMP roles no need to delete the sessions if assoc fails. There
15696 will be del BSS coming after this to stop the beaconing & cleaning up the
15697 sessions*/
15698 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
15699 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
15700 {
15701 /*-----------------------------------------------------------------------
15702 The current session will be deleted
15703 -----------------------------------------------------------------------*/
15704 WDI_DeleteSession(pWDICtx, pBSSSes);
15705
15706 /*-----------------------------------------------------------------------
15707 Check to see if this association is in progress - if so disable the
15708 flag as this has ended
15709 -----------------------------------------------------------------------*/
15710 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
15711 {
15712 /*Association no longer in progress */
15713 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
15714 /*Association no longer in progress - prepare pending assoc for processing*/
15715 WDI_DequeueAssocRequest(pWDICtx);
15716 }
15717 }
15718 }
15719 }
15720 /* If the link state has been set to POST ASSOC, reset the "association in
15721 progress" flag */
15722 if ( WDI_LINK_POSTASSOC_STATE ==
15723 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15724 {
15725 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
15726 WDI_DequeueAssocRequest(pWDICtx);
15727 }
15728
15729 wpalMutexRelease(&pWDICtx->wptMutex);
15730
15731 /*-------------------------------------------------------------------------
15732 Extract response and send it to UMAC
15733 -------------------------------------------------------------------------*/
15734 wpalMemoryCopy( &halStatus,
15735 pEventData->pEventData,
15736 sizeof(halStatus));
15737
15738 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15739
15740 /*Notify UMAC*/
15741 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15742
15743 return WDI_STATUS_SUCCESS;
15744}/*WDI_ProcessSetLinkStateRsp*/
15745
15746/**
15747 @brief Process Get Stats Rsp function (called when a response is
15748 being received over the bus from HAL)
15749
15750 @param pWDICtx: pointer to the WLAN DAL context
15751 pEventData: pointer to the event information structure
15752
15753 @see
15754 @return Result of the function call
15755*/
15756WDI_Status
15757WDI_ProcessGetStatsRsp
15758(
15759 WDI_ControlBlockType* pWDICtx,
15760 WDI_EventInfoType* pEventData
15761)
15762{
15763 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
15764 WDI_GetStatsRspCb wdiGetStatsRspCb;
15765 tHalStatsRspParams* pHalStatsRspParams;
15766
15767 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15768
15769 /*-------------------------------------------------------------------------
15770 Sanity check
15771 -------------------------------------------------------------------------*/
15772 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15773 ( NULL == pEventData->pEventData))
15774 {
15775 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15776 "%s: Invalid parameters", __FUNCTION__);
15777 WDI_ASSERT(0);
15778 return WDI_STATUS_E_FAILURE;
15779 }
15780
15781 /*-------------------------------------------------------------------------
15782 Extract response and send it to UMAC
15783 -------------------------------------------------------------------------*/
15784 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
15785
15786 /*allocate the stats response buffer */
15787 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
15788 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
15789 + sizeof(WDI_GetStatsRspParamsType));
15790
15791 if(NULL == wdiGetStatsRsp)
15792 {
15793 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15794 "Failed to allocate memory in Get Stats Response %x %x %x ",
15795 pWDICtx, pEventData, pEventData->pEventData);
15796 WDI_ASSERT(0);
15797 return WDI_STATUS_E_FAILURE;
15798 }
15799
15800 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
15801
15802 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
15803 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
15804 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
15805 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
15806 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
15807 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
15808
15809 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
15810 wpalMemoryCopy(wdiGetStatsRsp + 1,
15811 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
15812 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
15813
15814 /*Notify UMAC*/
15815 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
15816
15817 wpalMemoryFree(wdiGetStatsRsp);
15818
15819 return WDI_STATUS_SUCCESS;
15820}/*WDI_ProcessGetStatsRsp*/
15821
15822
15823/**
15824 @brief Process Update Cfg Rsp function (called when a response is
15825 being received over the bus from HAL)
15826
15827 @param pWDICtx: pointer to the WLAN DAL context
15828 pEventData: pointer to the event information structure
15829
15830 @see
15831 @return Result of the function call
15832*/
15833WDI_Status
15834WDI_ProcessUpdateCfgRsp
15835(
15836 WDI_ControlBlockType* pWDICtx,
15837 WDI_EventInfoType* pEventData
15838)
15839{
15840 WDI_Status wdiStatus;
15841 eHalStatus halStatus;
15842 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
15843 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15844
15845 /*-------------------------------------------------------------------------
15846 Sanity check
15847 -------------------------------------------------------------------------*/
15848 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15849 ( NULL == pEventData->pEventData))
15850 {
15851 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15852 "%s: Invalid parameters", __FUNCTION__);
15853 WDI_ASSERT(0);
15854 return WDI_STATUS_E_FAILURE;
15855 }
15856
15857 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
15858
15859 /*-------------------------------------------------------------------------
15860 Extract response and send it to UMAC
15861 -------------------------------------------------------------------------*/
15862 halStatus = *((eHalStatus*)pEventData->pEventData);
15863 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
15864
15865 /*Notify UMAC*/
15866 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15867
15868 return WDI_STATUS_SUCCESS;
15869}/*WDI_ProcessUpdateCfgRsp*/
15870
15871
15872
15873/**
15874 @brief Process Add BA Rsp function (called when a response
15875 is being received over the bus from HAL)
15876
15877 @param pWDICtx: pointer to the WLAN DAL context
15878 pEventData: pointer to the event information structure
15879
15880 @see
15881 @return Result of the function call
15882*/
15883WDI_Status
15884WDI_ProcessAddBARsp
15885(
15886 WDI_ControlBlockType* pWDICtx,
15887 WDI_EventInfoType* pEventData
15888)
15889{
15890 WDI_AddBARspCb wdiAddBARspCb;
15891
15892 tAddBARspParams halAddBARsp;
15893 WDI_AddBARspinfoType wdiAddBARsp;
15894
15895 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15896
15897 /*-------------------------------------------------------------------------
15898 Sanity check
15899 -------------------------------------------------------------------------*/
15900 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15901 ( NULL == pEventData->pEventData))
15902 {
15903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15904 "%s: Invalid parameters", __FUNCTION__);
15905 WDI_ASSERT(0);
15906 return WDI_STATUS_E_FAILURE;
15907 }
15908
15909 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
15910
15911 /*-------------------------------------------------------------------------
15912 Extract response and send it to UMAC
15913 -------------------------------------------------------------------------*/
15914 wpalMemoryCopy( &halAddBARsp,
15915 pEventData->pEventData,
15916 sizeof(halAddBARsp));
15917
15918 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
15919
Jeff Johnson43971f52012-07-17 12:26:56 -070015920 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015921 {
15922 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
15923 }
15924
15925 /*Notify UMAC*/
15926 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
15927
15928 return WDI_STATUS_SUCCESS;
15929}/*WDI_ProcessAddSessionBARsp*/
15930
15931/**
15932 @brief Process Add BA Rsp function (called when a response
15933 is being received over the bus from HAL)
15934
15935 @param pWDICtx: pointer to the WLAN DAL context
15936 pEventData: pointer to the event information structure
15937
15938 @see
15939 @return Result of the function call
15940*/
15941WDI_Status
15942WDI_ProcessTriggerBARsp
15943(
15944 WDI_ControlBlockType* pWDICtx,
15945 WDI_EventInfoType* pEventData
15946)
15947{
15948 WDI_TriggerBARspCb wdiTriggerBARspCb;
15949
15950 tTriggerBARspParams* halTriggerBARsp;
15951 tTriggerBaRspCandidate* halBaCandidate;
15952 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
15953 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
15954 wpt_uint16 index;
15955 wpt_uint16 TidIndex;
15956
15957 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15958
15959 /*-------------------------------------------------------------------------
15960 Sanity check
15961 -------------------------------------------------------------------------*/
15962 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15963 ( NULL == pEventData->pEventData))
15964 {
15965 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15966 "%s: Invalid parameters", __FUNCTION__);
15967 WDI_ASSERT(0);
15968 return WDI_STATUS_E_FAILURE;
15969 }
15970
15971 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
15972
15973 /*-------------------------------------------------------------------------
15974 Extract response and send it to UMAC
15975 -------------------------------------------------------------------------*/
15976 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
15977
15978 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
15979 halTriggerBARsp->baCandidateCnt *
15980 sizeof(WDI_TriggerBARspCandidateType));
15981 if(NULL == wdiTriggerBARsp)
15982 {
15983 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15984 "Failed to allocate memory in Trigger BA Response %x %x %x ",
15985 pWDICtx, pEventData, pEventData->pEventData);
15986 wpalMemoryFree(halTriggerBARsp);
15987 WDI_ASSERT(0);
15988 return WDI_STATUS_E_FAILURE;
15989 }
15990
15991 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
15992
15993 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
15994 {
15995 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
15996 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
15997 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
15998
15999 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16000 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16001
16002 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16003 {
16004 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
16005 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16006 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16007 {
16008 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
16009 halBaCandidate->baInfo[TidIndex].fBaEnable;
16010 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
16011 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16012 }
16013 wdiTriggerBARspCandidate++;
16014 halBaCandidate++;
16015 }
16016 }
16017
16018 /*Notify UMAC*/
16019 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16020
16021 wpalMemoryFree(wdiTriggerBARsp);
16022 return WDI_STATUS_SUCCESS;
16023}/*WDI_ProcessAddSessionBARsp*/
16024
16025/**
16026 @brief Process Update Beacon Params Rsp function (called when a response
16027 is being received over the bus from HAL)
16028
16029 @param pWDICtx: pointer to the WLAN DAL context
16030 pEventData: pointer to the event information structure
16031
16032 @see
16033 @return Result of the function call
16034*/
16035WDI_Status
16036WDI_ProcessUpdateBeaconParamsRsp
16037(
16038 WDI_ControlBlockType* pWDICtx,
16039 WDI_EventInfoType* pEventData
16040)
16041{
16042 WDI_Status wdiStatus;
16043 eHalStatus halStatus;
16044 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16045 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16046
16047 /*-------------------------------------------------------------------------
16048 Sanity check
16049 -------------------------------------------------------------------------*/
16050 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16051 ( NULL == pEventData->pEventData))
16052 {
16053 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16054 "%s: Invalid parameters", __FUNCTION__);
16055 WDI_ASSERT(0);
16056 return WDI_STATUS_E_FAILURE;
16057 }
16058
16059 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16060
16061 /*-------------------------------------------------------------------------
16062 Extract response and send it to UMAC
16063 -------------------------------------------------------------------------*/
16064 wpalMemoryCopy( &halStatus,
16065 pEventData->pEventData,
16066 sizeof(halStatus));
16067
16068 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16069
16070 /*Notify UMAC*/
16071 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16072
16073 return WDI_STATUS_SUCCESS;
16074}/*WDI_ProcessUpdateBeaconParamsRsp*/
16075
16076/**
16077 @brief Process Send Beacon template Rsp function (called when a response
16078 is being received over the bus from HAL)
16079
16080 @param pWDICtx: pointer to the WLAN DAL context
16081 pEventData: pointer to the event information structure
16082
16083 @see
16084 @return Result of the function call
16085*/
16086WDI_Status
16087WDI_ProcessSendBeaconParamsRsp
16088(
16089 WDI_ControlBlockType* pWDICtx,
16090 WDI_EventInfoType* pEventData
16091)
16092{
16093 WDI_Status wdiStatus;
16094 eHalStatus halStatus;
16095 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16096 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16097
16098 /*-------------------------------------------------------------------------
16099 Sanity check
16100 -------------------------------------------------------------------------*/
16101 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16102 ( NULL == pEventData->pEventData))
16103 {
16104 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16105 "%s: Invalid parameters", __FUNCTION__);
16106 WDI_ASSERT(0);
16107 return WDI_STATUS_E_FAILURE;
16108 }
16109
16110 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16111
16112 /*-------------------------------------------------------------------------
16113 Extract response and send it to UMAC
16114 -------------------------------------------------------------------------*/
16115 wpalMemoryCopy( &halStatus,
16116 pEventData->pEventData,
16117 sizeof(halStatus));
16118
16119 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16120
16121 /*Notify UMAC*/
16122 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16123
16124 return WDI_STATUS_SUCCESS;
16125}/*WDI_ProcessSendBeaconParamsRsp*/
16126
16127
16128/**
16129 @brief Process Update Probe Resp Template Rsp function (called
16130 when a response is being received over the bus from HAL)
16131
16132 @param pWDICtx: pointer to the WLAN DAL context
16133 pEventData: pointer to the event information structure
16134
16135 @see
16136 @return Result of the function call
16137*/
16138WDI_Status
16139WDI_ProcessUpdateProbeRspTemplateRsp
16140(
16141 WDI_ControlBlockType* pWDICtx,
16142 WDI_EventInfoType* pEventData
16143)
16144{
16145 WDI_Status wdiStatus;
16146 eHalStatus halStatus;
16147 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16148 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16149
16150 /*-------------------------------------------------------------------------
16151 Sanity check
16152 -------------------------------------------------------------------------*/
16153 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16154 ( NULL == pEventData->pEventData))
16155 {
16156 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16157 "%s: Invalid parameters", __FUNCTION__);
16158 WDI_ASSERT(0);
16159 return WDI_STATUS_E_FAILURE;
16160 }
16161
16162 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16163
16164 /*-------------------------------------------------------------------------
16165 Extract response and send it to UMAC
16166 -------------------------------------------------------------------------*/
16167 wpalMemoryCopy( &halStatus,
16168 pEventData->pEventData,
16169 sizeof(halStatus));
16170
16171 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16172
16173 /*Notify UMAC*/
16174 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16175
16176 return WDI_STATUS_SUCCESS;
16177}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16178
16179 /**
16180 @brief Process Set Max Tx Power Rsp function (called when a response
16181 is being received over the bus from HAL)
16182
16183 @param pWDICtx: pointer to the WLAN DAL context
16184 pEventData: pointer to the event information structure
16185
16186 @see
16187 @return Result of the function call
16188*/
16189WDI_Status
16190WDI_ProcessSetMaxTxPowerRsp
16191(
16192 WDI_ControlBlockType* pWDICtx,
16193 WDI_EventInfoType* pEventData
16194)
16195{
16196 tSetMaxTxPwrRspMsg halTxpowerrsp;
16197
16198 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
16199
16200 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16201 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16202
16203 /*-------------------------------------------------------------------------
16204 Sanity check
16205 -------------------------------------------------------------------------*/
16206 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16207 ( NULL == pEventData->pEventData))
16208 {
16209 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16210 "%s: Invalid parameters", __FUNCTION__);
16211 WDI_ASSERT(0);
16212 return WDI_STATUS_E_FAILURE;
16213 }
16214
16215 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16216
16217 /*-------------------------------------------------------------------------
16218 Extract response and send it to UMAC
16219 -------------------------------------------------------------------------*/
16220 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16221 pEventData->pEventData,
16222 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
16223
16224 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16225 {
16226 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16227 "Error status returned in Set Max Tx Power Response ");
16228 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16229 return WDI_STATUS_E_FAILURE;
16230 }
16231
16232 wdiSetMaxTxPowerRspMsg.wdiStatus =
16233 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
16234 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
16235
16236 /*Notify UMAC*/
16237 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16238
16239 return WDI_STATUS_SUCCESS;
16240}
16241
16242#ifdef WLAN_FEATURE_P2P
16243/**
16244 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
16245 when a response is being received over the bus from HAL)
16246
16247 @param pWDICtx: pointer to the WLAN DAL context
16248 pEventData: pointer to the event information structure
16249
16250 @see
16251 @return Result of the function call
16252*/
16253WDI_Status
16254WDI_ProcessP2PGONOARsp
16255(
16256 WDI_ControlBlockType* pWDICtx,
16257 WDI_EventInfoType* pEventData
16258)
16259{
16260 WDI_Status wdiStatus;
16261 eHalStatus halStatus;
16262 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16263 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16264
16265 /*-------------------------------------------------------------------------
16266 Sanity check
16267 -------------------------------------------------------------------------*/
16268 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16269 ( NULL == pEventData->pEventData))
16270 {
16271 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16272 "%s: Invalid parameters", __FUNCTION__);
16273 WDI_ASSERT(0);
16274 return WDI_STATUS_E_FAILURE;
16275 }
16276
16277 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16278
16279 /*-------------------------------------------------------------------------
16280 Extract response and send it to UMAC
16281 -------------------------------------------------------------------------*/
16282 wpalMemoryCopy( &halStatus,
16283 pEventData->pEventData,
16284 sizeof(halStatus));
16285
16286 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16287
16288 /*Notify UMAC*/
16289 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16290
16291 return WDI_STATUS_SUCCESS;
16292}/*WDI_ProcessP2PGONOARsp*/
16293#endif
16294/**
16295 @brief Process Enter IMPS Rsp function (called when a response
16296 is being received over the bus from HAL)
16297
16298 @param pWDICtx: pointer to the WLAN DAL context
16299 pEventData: pointer to the event information structure
16300
16301 @see
16302 @return Result of the function call
16303*/
16304WDI_Status
16305WDI_ProcessEnterImpsRsp
16306(
16307 WDI_ControlBlockType* pWDICtx,
16308 WDI_EventInfoType* pEventData
16309)
16310{
16311 WDI_Status wdiStatus;
16312 eHalStatus halStatus;
16313 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16314 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16315
16316 /*-------------------------------------------------------------------------
16317 Sanity check
16318 -------------------------------------------------------------------------*/
16319 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16320 ( NULL == pEventData->pEventData))
16321 {
16322 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16323 "%s: Invalid parameters", __FUNCTION__);
16324 WDI_ASSERT(0);
16325 return WDI_STATUS_E_FAILURE;
16326 }
16327
16328 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16329
16330 /*-------------------------------------------------------------------------
16331 Extract response and send it to UMAC
16332 -------------------------------------------------------------------------*/
16333 halStatus = *((eHalStatus*)pEventData->pEventData);
16334
16335 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16336
16337 /*Notify UMAC*/
16338 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16339
16340 return WDI_STATUS_SUCCESS;
16341}/*WDI_ProcessEnterImpsRsp*/
16342
16343/**
16344 @brief Process Exit IMPS Rsp function (called when a response
16345 is being received over the bus from HAL)
16346
16347 @param pWDICtx: pointer to the WLAN DAL context
16348 pEventData: pointer to the event information structure
16349
16350 @see
16351 @return Result of the function call
16352*/
16353WDI_Status
16354WDI_ProcessExitImpsRsp
16355(
16356 WDI_ControlBlockType* pWDICtx,
16357 WDI_EventInfoType* pEventData
16358)
16359{
16360 WDI_Status wdiStatus;
16361 eHalStatus halStatus;
16362 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16363 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16364
16365 /*-------------------------------------------------------------------------
16366 Sanity check
16367 -------------------------------------------------------------------------*/
16368 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16369 ( NULL == pEventData->pEventData))
16370 {
16371 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16372 "%s: Invalid parameters", __FUNCTION__);
16373 WDI_ASSERT(0);
16374 return WDI_STATUS_E_FAILURE;
16375 }
16376
16377 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16378
16379 /*-------------------------------------------------------------------------
16380 Extract response and send it to UMAC
16381 -------------------------------------------------------------------------*/
16382 halStatus = *((eHalStatus*)pEventData->pEventData);
16383 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16384
16385 // notify DTS that we are entering Full power
16386 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16387
16388 /*Notify UMAC*/
16389 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16390
16391 return WDI_STATUS_SUCCESS;
16392}/*WDI_ProcessExitImpsRsp*/
16393
16394/**
16395 @brief Process Enter BMPS Rsp function (called when a response
16396 is being received over the bus from HAL)
16397
16398 @param pWDICtx: pointer to the WLAN DAL context
16399 pEventData: pointer to the event information structure
16400
16401 @see
16402 @return Result of the function call
16403*/
16404WDI_Status
16405WDI_ProcessEnterBmpsRsp
16406(
16407 WDI_ControlBlockType* pWDICtx,
16408 WDI_EventInfoType* pEventData
16409)
16410{
16411 WDI_Status wdiStatus;
16412 eHalStatus halStatus;
16413 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16414 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16415
16416 /*-------------------------------------------------------------------------
16417 Sanity check
16418 -------------------------------------------------------------------------*/
16419 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16420 ( NULL == pEventData->pEventData))
16421 {
16422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16423 "%s: Invalid parameters", __FUNCTION__);
16424 WDI_ASSERT(0);
16425 return WDI_STATUS_E_FAILURE;
16426 }
16427
16428 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
16429
16430 /*-------------------------------------------------------------------------
16431 Extract response and send it to UMAC
16432 -------------------------------------------------------------------------*/
16433 halStatus = *((eHalStatus*)pEventData->pEventData);
16434 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16435
16436 /*Notify UMAC*/
16437 wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16438
16439 return WDI_STATUS_SUCCESS;
16440}/*WDI_ProcessEnterBmpsRsp*/
16441
16442/**
16443 @brief Process Exit BMPS Rsp function (called when a response
16444 is being received over the bus from HAL)
16445
16446 @param pWDICtx: pointer to the WLAN DAL context
16447 pEventData: pointer to the event information structure
16448
16449 @see
16450 @return Result of the function call
16451*/
16452WDI_Status
16453WDI_ProcessExitBmpsRsp
16454(
16455 WDI_ControlBlockType* pWDICtx,
16456 WDI_EventInfoType* pEventData
16457)
16458{
16459 WDI_Status wdiStatus;
16460 eHalStatus halStatus;
16461 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
16462 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16463
16464 /*-------------------------------------------------------------------------
16465 Sanity check
16466 -------------------------------------------------------------------------*/
16467 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16468 ( NULL == pEventData->pEventData))
16469 {
16470 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16471 "%s: Invalid parameters", __FUNCTION__);
16472 WDI_ASSERT(0);
16473 return WDI_STATUS_E_FAILURE;
16474 }
16475
16476 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16477
16478 /*-------------------------------------------------------------------------
16479 Extract response and send it to UMAC
16480 -------------------------------------------------------------------------*/
16481 halStatus = *((eHalStatus*)pEventData->pEventData);
16482 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16483
16484 // notify DTS that we are entering Full power
16485 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16486
16487 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16488
16489 /*Notify UMAC*/
16490 wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16491
16492 return WDI_STATUS_SUCCESS;
16493}/*WDI_ProcessExitBmpsRsp*/
16494
16495/**
16496 @brief Process Enter UAPSD Rsp function (called when a response
16497 is being received over the bus from HAL)
16498
16499 @param pWDICtx: pointer to the WLAN DAL context
16500 pEventData: pointer to the event information structure
16501
16502 @see
16503 @return Result of the function call
16504*/
16505WDI_Status
16506WDI_ProcessEnterUapsdRsp
16507(
16508 WDI_ControlBlockType* pWDICtx,
16509 WDI_EventInfoType* pEventData
16510)
16511{
16512 WDI_Status wdiStatus;
16513 eHalStatus halStatus;
16514 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
16515 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16516
16517 /*-------------------------------------------------------------------------
16518 Sanity check
16519 -------------------------------------------------------------------------*/
16520 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16521 ( NULL == pEventData->pEventData))
16522 {
16523 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16524 "%s: Invalid parameters", __FUNCTION__);
16525 WDI_ASSERT(0);
16526 return WDI_STATUS_E_FAILURE;
16527 }
16528
16529 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16530
16531 /*-------------------------------------------------------------------------
16532 Extract response and send it to UMAC
16533 -------------------------------------------------------------------------*/
16534 halStatus = *((eHalStatus*)pEventData->pEventData);
16535 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16536
16537 if(WDI_STATUS_SUCCESS == wdiStatus)
16538 {
16539 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
16540 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
16541 // the traffic to decide when to suspend the trigger frames when there is no traffic
16542 // activity on the trigger enabled ACs
16543 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
16544
16545#ifdef WLAN_PERF
16546 // Increment the BD signature to refresh the fast path BD utilization
16547 pWDICtx->uBdSigSerialNum++;
16548#endif
16549 }
16550
16551 /*Notify UMAC*/
16552 wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16553
16554 return WDI_STATUS_SUCCESS;
16555}/*WDI_ProcessEnterUapsdRsp*/
16556
16557/**
16558 @brief Process Exit UAPSD Rsp function (called when a response
16559 is being received over the bus from HAL)
16560
16561 @param pWDICtx: pointer to the WLAN DAL context
16562 pEventData: pointer to the event information structure
16563
16564 @see
16565 @return Result of the function call
16566*/
16567WDI_Status
16568WDI_ProcessExitUapsdRsp
16569(
16570 WDI_ControlBlockType* pWDICtx,
16571 WDI_EventInfoType* pEventData
16572)
16573{
16574 WDI_Status wdiStatus;
16575 eHalStatus halStatus;
16576 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
16577 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16578
16579 /*-------------------------------------------------------------------------
16580 Sanity check
16581 -------------------------------------------------------------------------*/
16582 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16583 ( NULL == pEventData->pEventData))
16584 {
16585 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16586 "%s: Invalid parameters", __FUNCTION__);
16587 WDI_ASSERT(0);
16588 return WDI_STATUS_E_FAILURE;
16589 }
16590
16591 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
16592
16593 /*-------------------------------------------------------------------------
16594 Extract response and send it to UMAC
16595 -------------------------------------------------------------------------*/
16596 halStatus = *((eHalStatus*)pEventData->pEventData);
16597 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16598
16599 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
16600 // directly instead of the FW WQ.
16601 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
16602
16603#ifdef WLAN_PERF
16604 // Increment the BD signature to refresh the fast path BD utilization
16605 pWDICtx->uBdSigSerialNum++;
16606#endif
16607
16608 /*Notify UMAC*/
16609 wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16610
16611 return WDI_STATUS_SUCCESS;
16612}/*WDI_ProcessExitUapsdRsp*/
16613
16614/**
16615 @brief Process set UAPSD params Rsp function (called when a
16616 response is being received over the bus from HAL)
16617
16618 @param pWDICtx: pointer to the WLAN DAL context
16619 pEventData: pointer to the event information structure
16620
16621 @see
16622 @return Result of the function call
16623*/
16624WDI_Status
16625WDI_ProcessSetUapsdAcParamsRsp
16626(
16627 WDI_ControlBlockType* pWDICtx,
16628 WDI_EventInfoType* pEventData
16629)
16630{
16631 WDI_Status wdiStatus;
16632 eHalStatus halStatus;
16633 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
16634 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16635
16636 /*-------------------------------------------------------------------------
16637 Sanity check
16638 -------------------------------------------------------------------------*/
16639 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16640 ( NULL == pEventData->pEventData))
16641 {
16642 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16643 "%s: Invalid parameters", __FUNCTION__);
16644 WDI_ASSERT(0);
16645 return WDI_STATUS_E_FAILURE;
16646 }
16647
16648 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
16649
16650 /*-------------------------------------------------------------------------
16651 Extract response and send it to UMAC
16652 -------------------------------------------------------------------------*/
16653 halStatus = *((eHalStatus*)pEventData->pEventData);
16654 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16655
16656 /*Notify UMAC*/
16657 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16658
16659 return WDI_STATUS_SUCCESS;
16660}/*WDI_ProcessSetUapsdAcParamsRsp*/
16661
16662/**
16663 @brief Process update UAPSD params Rsp function (called when a
16664 response is being received over the bus from HAL)
16665
16666 @param pWDICtx: pointer to the WLAN DAL context
16667 pEventData: pointer to the event information structure
16668
16669 @see
16670 @return Result of the function call
16671*/
16672WDI_Status
16673WDI_ProcessUpdateUapsdParamsRsp
16674(
16675 WDI_ControlBlockType* pWDICtx,
16676 WDI_EventInfoType* pEventData
16677)
16678{
16679 WDI_Status wdiStatus;
16680 eHalStatus halStatus;
16681 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
16682 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16683
16684 /*-------------------------------------------------------------------------
16685 Sanity check
16686 -------------------------------------------------------------------------*/
16687 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16688 ( NULL == pEventData->pEventData))
16689 {
16690 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16691 "%s: Invalid parameters", __FUNCTION__);
16692 WDI_ASSERT(0);
16693 return WDI_STATUS_E_FAILURE;
16694 }
16695
16696 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
16697
16698 /*-------------------------------------------------------------------------
16699 Extract response and send it to UMAC
16700 -------------------------------------------------------------------------*/
16701 halStatus = *((eHalStatus*)pEventData->pEventData);
16702 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16703
16704 /*Notify UMAC*/
16705 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16706
16707 return WDI_STATUS_SUCCESS;
16708}/*WDI_ProcessUpdateUapsdParamsRsp*/
16709
16710/**
16711 @brief Process Configure RXP filter Rsp function (called when a
16712 response is being received over the bus from HAL)
16713
16714 @param pWDICtx: pointer to the WLAN DAL context
16715 pEventData: pointer to the event information structure
16716
16717 @see
16718 @return Result of the function call
16719*/
16720WDI_Status
16721WDI_ProcessConfigureRxpFilterRsp
16722(
16723 WDI_ControlBlockType* pWDICtx,
16724 WDI_EventInfoType* pEventData
16725)
16726{
16727 WDI_Status wdiStatus;
16728 eHalStatus halStatus;
16729 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
16730 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16731
16732 /*-------------------------------------------------------------------------
16733 Sanity check
16734 -------------------------------------------------------------------------*/
16735 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16736 ( NULL == pEventData->pEventData))
16737 {
16738 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16739 "%s: Invalid parameters", __FUNCTION__);
16740 WDI_ASSERT(0);
16741 return WDI_STATUS_E_FAILURE;
16742 }
16743
16744 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
16745
16746 /*-------------------------------------------------------------------------
16747 Extract response and send it to UMAC
16748 -------------------------------------------------------------------------*/
16749 halStatus = *((eHalStatus*)pEventData->pEventData);
16750 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16751
16752 /*Notify UMAC*/
16753 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16754
16755 return WDI_STATUS_SUCCESS;
16756}/*WDI_ProcessConfigureRxpFilterRsp*/
16757
16758/**
16759 @brief Process Set beacon filter Rsp function (called when a
16760 response is being received over the bus from HAL)
16761
16762 @param pWDICtx: pointer to the WLAN DAL context
16763 pEventData: pointer to the event information structure
16764
16765 @see
16766 @return Result of the function call
16767*/
16768WDI_Status
16769WDI_ProcessSetBeaconFilterRsp
16770(
16771 WDI_ControlBlockType* pWDICtx,
16772 WDI_EventInfoType* pEventData
16773)
16774{
16775 WDI_Status wdiStatus;
16776 eHalStatus halStatus;
16777 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
16778 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16779
16780 /*-------------------------------------------------------------------------
16781 Sanity check
16782 -------------------------------------------------------------------------*/
16783 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16784 ( NULL == pEventData->pEventData))
16785 {
16786 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16787 "%s: Invalid parameters", __FUNCTION__);
16788 WDI_ASSERT(0);
16789 return WDI_STATUS_E_FAILURE;
16790 }
16791
16792 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
16793
16794 /*-------------------------------------------------------------------------
16795 Extract response and send it to UMAC
16796 -------------------------------------------------------------------------*/
16797 halStatus = *((eHalStatus*)pEventData->pEventData);
16798 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16799
16800 /*Notify UMAC*/
16801 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16802
16803 return WDI_STATUS_SUCCESS;
16804}/*WDI_ProcessSetBeaconFilterRsp*/
16805
16806/**
16807 @brief Process remove beacon filter Rsp function (called when a
16808 response is being received over the bus from HAL)
16809
16810 @param pWDICtx: pointer to the WLAN DAL context
16811 pEventData: pointer to the event information structure
16812
16813 @see
16814 @return Result of the function call
16815*/
16816WDI_Status
16817WDI_ProcessRemBeaconFilterRsp
16818(
16819 WDI_ControlBlockType* pWDICtx,
16820 WDI_EventInfoType* pEventData
16821)
16822{
16823 WDI_Status wdiStatus;
16824 eHalStatus halStatus;
16825 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
16826 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16827
16828 /*-------------------------------------------------------------------------
16829 Sanity check
16830 -------------------------------------------------------------------------*/
16831 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16832 ( NULL == pEventData->pEventData))
16833 {
16834 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16835 "%s: Invalid parameters", __FUNCTION__);
16836 WDI_ASSERT(0);
16837 return WDI_STATUS_E_FAILURE;
16838 }
16839
16840 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
16841
16842 /*-------------------------------------------------------------------------
16843 Extract response and send it to UMAC
16844 -------------------------------------------------------------------------*/
16845 halStatus = *((eHalStatus*)pEventData->pEventData);
16846 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16847
16848 /*Notify UMAC*/
16849 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
16850
16851 return WDI_STATUS_SUCCESS;
16852}/*WDI_ProcessRemBeaconFilterRsp*/
16853
16854/**
16855 @brief Process set RSSI thresholds Rsp function (called when a
16856 response is being received over the bus from HAL)
16857
16858 @param pWDICtx: pointer to the WLAN DAL context
16859 pEventData: pointer to the event information structure
16860
16861 @see
16862 @return Result of the function call
16863*/
16864WDI_Status
16865WDI_ProcessSetRSSIThresoldsRsp
16866(
16867 WDI_ControlBlockType* pWDICtx,
16868 WDI_EventInfoType* pEventData
16869)
16870{
16871 WDI_Status wdiStatus;
16872 eHalStatus halStatus;
16873 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
16874 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16875
16876 /*-------------------------------------------------------------------------
16877 Sanity check
16878 -------------------------------------------------------------------------*/
16879 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16880 ( NULL == pEventData->pEventData))
16881 {
16882 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16883 "%s: Invalid parameters", __FUNCTION__);
16884 WDI_ASSERT(0);
16885 return WDI_STATUS_E_FAILURE;
16886 }
16887
16888 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
16889
16890 /*-------------------------------------------------------------------------
16891 Extract response and send it to UMAC
16892 -------------------------------------------------------------------------*/
16893 halStatus = *((eHalStatus*)pEventData->pEventData);
16894 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16895
16896 /*Notify UMAC*/
16897 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
16898
16899 return WDI_STATUS_SUCCESS;
16900}/*WDI_ProcessSetRSSIThresoldsRsp*/
16901
16902/**
16903 @brief Process host offload Rsp function (called when a
16904 response is being received over the bus from HAL)
16905
16906 @param pWDICtx: pointer to the WLAN DAL context
16907 pEventData: pointer to the event information structure
16908
16909 @see
16910 @return Result of the function call
16911*/
16912WDI_Status
16913WDI_ProcessHostOffloadRsp
16914(
16915 WDI_ControlBlockType* pWDICtx,
16916 WDI_EventInfoType* pEventData
16917)
16918{
16919 WDI_Status wdiStatus;
16920 eHalStatus halStatus;
16921 WDI_HostOffloadCb wdiHostOffloadCb;
16922 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16923
16924 /*-------------------------------------------------------------------------
16925 Sanity check
16926 -------------------------------------------------------------------------*/
16927 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16928 ( NULL == pEventData->pEventData))
16929 {
16930 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16931 "%s: Invalid parameters", __FUNCTION__);
16932 WDI_ASSERT(0);
16933 return WDI_STATUS_E_FAILURE;
16934 }
16935
16936 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
16937
16938 /*-------------------------------------------------------------------------
16939 Extract response and send it to UMAC
16940 -------------------------------------------------------------------------*/
16941 halStatus = *((eHalStatus*)pEventData->pEventData);
16942 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16943
16944 /*Notify UMAC*/
16945 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
16946
16947 return WDI_STATUS_SUCCESS;
16948}/*WDI_ProcessHostOffloadRsp*/
16949
16950/**
16951 @brief Process keep alive Rsp function (called when a
16952 response is being received over the bus from HAL)
16953
16954 @param pWDICtx: pointer to the WLAN DAL context
16955 pEventData: pointer to the event information structure
16956
16957 @see
16958 @return Result of the function call
16959*/
16960WDI_Status
16961WDI_ProcessKeepAliveRsp
16962(
16963 WDI_ControlBlockType* pWDICtx,
16964 WDI_EventInfoType* pEventData
16965)
16966{
16967 WDI_Status wdiStatus;
16968 eHalStatus halStatus;
16969 WDI_KeepAliveCb wdiKeepAliveCb;
16970 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16971 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16972 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
16973
16974
16975 /*-------------------------------------------------------------------------
16976 Sanity check
16977 -------------------------------------------------------------------------*/
16978 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16979 ( NULL == pEventData->pEventData))
16980 {
16981 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16982 "%s: Invalid parameters", __FUNCTION__);
16983 WDI_ASSERT(0);
16984 return WDI_STATUS_E_FAILURE;
16985 }
16986
16987 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
16988
16989 /*-------------------------------------------------------------------------
16990 Extract response and send it to UMAC
16991 -------------------------------------------------------------------------*/
16992 halStatus = *((eHalStatus*)pEventData->pEventData);
16993 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16994
16995 /*Notify UMAC*/
16996 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
16997
16998 return WDI_STATUS_SUCCESS;
16999}/*WDI_ProcessKeepAliveRsp*/
17000
17001/**
17002 @brief Process wowl add ptrn Rsp function (called when a
17003 response is being received over the bus from HAL)
17004
17005 @param pWDICtx: pointer to the WLAN DAL context
17006 pEventData: pointer to the event information structure
17007
17008 @see
17009 @return Result of the function call
17010*/
17011WDI_Status
17012WDI_ProcessWowlAddBcPtrnRsp
17013(
17014 WDI_ControlBlockType* pWDICtx,
17015 WDI_EventInfoType* pEventData
17016)
17017{
17018 WDI_Status wdiStatus;
17019 eHalStatus halStatus;
17020 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
17021 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17022
17023 /*-------------------------------------------------------------------------
17024 Sanity check
17025 -------------------------------------------------------------------------*/
17026 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17027 ( NULL == pEventData->pEventData))
17028 {
17029 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17030 "%s: Invalid parameters", __FUNCTION__);
17031 WDI_ASSERT(0);
17032 return WDI_STATUS_E_FAILURE;
17033 }
17034
17035 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17036
17037 /*-------------------------------------------------------------------------
17038 Extract response and send it to UMAC
17039 -------------------------------------------------------------------------*/
17040 halStatus = *((eHalStatus*)pEventData->pEventData);
17041 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17042
17043 /*Notify UMAC*/
17044 wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17045
17046 return WDI_STATUS_SUCCESS;
17047}/*WDI_ProcessWowlAddBcPtrnRsp*/
17048
17049/**
17050 @brief Process wowl delete ptrn Rsp function (called when a
17051 response is being received over the bus from HAL)
17052
17053 @param pWDICtx: pointer to the WLAN DAL context
17054 pEventData: pointer to the event information structure
17055
17056 @see
17057 @return Result of the function call
17058*/
17059WDI_Status
17060WDI_ProcessWowlDelBcPtrnRsp
17061(
17062 WDI_ControlBlockType* pWDICtx,
17063 WDI_EventInfoType* pEventData
17064)
17065{
17066 WDI_Status wdiStatus;
17067 eHalStatus halStatus;
17068 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
17069 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17070
17071 /*-------------------------------------------------------------------------
17072 Sanity check
17073 -------------------------------------------------------------------------*/
17074 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17075 ( NULL == pEventData->pEventData))
17076 {
17077 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17078 "%s: Invalid parameters", __FUNCTION__);
17079 WDI_ASSERT(0);
17080 return WDI_STATUS_E_FAILURE;
17081 }
17082
17083 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17084
17085 /*-------------------------------------------------------------------------
17086 Extract response and send it to UMAC
17087 -------------------------------------------------------------------------*/
17088 halStatus = *((eHalStatus*)pEventData->pEventData);
17089 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17090
17091 /*Notify UMAC*/
17092 wdiWowlDelBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17093
17094 return WDI_STATUS_SUCCESS;
17095}/*WDI_ProcessWowlDelBcPtrnRsp*/
17096
17097/**
17098 @brief Process wowl enter Rsp function (called when a response
17099 is being received over the bus from HAL)
17100
17101 @param pWDICtx: pointer to the WLAN DAL context
17102 pEventData: pointer to the event information structure
17103
17104 @see
17105 @return Result of the function call
17106*/
17107WDI_Status
17108WDI_ProcessWowlEnterRsp
17109(
17110 WDI_ControlBlockType* pWDICtx,
17111 WDI_EventInfoType* pEventData
17112)
17113{
17114 WDI_Status wdiStatus;
17115 eHalStatus halStatus;
17116 WDI_WowlEnterReqCb wdiWowlEnterCb;
17117 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17118
17119 /*-------------------------------------------------------------------------
17120 Sanity check
17121 -------------------------------------------------------------------------*/
17122 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17123 ( NULL == pEventData->pEventData))
17124 {
17125 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17126 "%s: Invalid parameters", __FUNCTION__);
17127 WDI_ASSERT(0);
17128 return WDI_STATUS_E_FAILURE;
17129 }
17130
17131 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17132
17133 /*-------------------------------------------------------------------------
17134 Extract response and send it to UMAC
17135 -------------------------------------------------------------------------*/
17136 halStatus = *((eHalStatus*)pEventData->pEventData);
17137 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17138
17139 /*Notify UMAC*/
17140 wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData);
17141
17142 return WDI_STATUS_SUCCESS;
17143}/*WDI_ProcessWowlEnterRsp*/
17144
17145/**
17146 @brief Process wowl exit Rsp function (called when a response
17147 is being received over the bus from HAL)
17148
17149 @param pWDICtx: pointer to the WLAN DAL context
17150 pEventData: pointer to the event information structure
17151
17152 @see
17153 @return Result of the function call
17154*/
17155WDI_Status
17156WDI_ProcessWowlExitRsp
17157(
17158 WDI_ControlBlockType* pWDICtx,
17159 WDI_EventInfoType* pEventData
17160)
17161{
17162 WDI_Status wdiStatus;
17163 eHalStatus halStatus;
17164 WDI_WowlExitReqCb wdiWowlExitCb;
17165 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17166
17167 /*-------------------------------------------------------------------------
17168 Sanity check
17169 -------------------------------------------------------------------------*/
17170 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17171 ( NULL == pEventData->pEventData))
17172 {
17173 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17174 "%s: Invalid parameters", __FUNCTION__);
17175 WDI_ASSERT(0);
17176 return WDI_STATUS_E_FAILURE;
17177 }
17178
17179 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17180
17181 /*-------------------------------------------------------------------------
17182 Extract response and send it to UMAC
17183 -------------------------------------------------------------------------*/
17184 halStatus = *((eHalStatus*)pEventData->pEventData);
17185 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17186
17187 /*Notify UMAC*/
17188 wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData);
17189
17190 return WDI_STATUS_SUCCESS;
17191}/*WDI_ProcessWowlExitRsp*/
17192
17193/**
17194 @brief Process Configure Apps CPU wakeup State Rsp function
17195 (called when a response is being received over the bus
17196 from HAL)
17197
17198 @param pWDICtx: pointer to the WLAN DAL context
17199 pEventData: pointer to the event information structure
17200
17201 @see
17202 @return Result of the function call
17203*/
17204WDI_Status
17205WDI_ProcessConfigureAppsCpuWakeupStateRsp
17206(
17207 WDI_ControlBlockType* pWDICtx,
17208 WDI_EventInfoType* pEventData
17209)
17210{
17211 WDI_Status wdiStatus;
17212 eHalStatus halStatus;
17213 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17214 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17215
17216 /*-------------------------------------------------------------------------
17217 Sanity check
17218 -------------------------------------------------------------------------*/
17219 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17220 ( NULL == pEventData->pEventData))
17221 {
17222 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17223 "%s: Invalid parameters", __FUNCTION__);
17224 WDI_ASSERT(0);
17225 return WDI_STATUS_E_FAILURE;
17226 }
17227
17228 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17229
17230 /*-------------------------------------------------------------------------
17231 Extract response and send it to UMAC
17232 -------------------------------------------------------------------------*/
17233 halStatus = *((eHalStatus*)pEventData->pEventData);
17234 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17235
17236 /*Notify UMAC*/
17237 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17238
17239 return WDI_STATUS_SUCCESS;
17240}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17241
17242
17243/**
17244 @brief Process Nv download(called when a response
17245 is being received over the bus from HAL,will check if the responce is )
17246
17247 @param pWDICtx: pointer to the WLAN DAL context
17248 pEventData: pointer to the event information structure
17249
17250 @see
17251 @return Result of the function call
17252*/
17253WDI_Status
17254WDI_ProcessNvDownloadRsp
17255(
17256 WDI_ControlBlockType* pWDICtx,
17257 WDI_EventInfoType* pEventData
17258)
17259{
17260
17261 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17262 tHalNvImgDownloadRspParams halNvDownloadRsp;
17263 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17264
17265 /*-------------------------------------------------------------------------
17266 Sanity check
17267 -------------------------------------------------------------------------*/
17268 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17269 ( NULL == pEventData->pEventData))
17270 {
17271 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17272 "%s: Invalid parameters", __FUNCTION__);
17273 WDI_ASSERT(0);
17274 return WDI_STATUS_E_FAILURE;
17275 }
17276
17277 /*-------------------------------------------------------------------------
17278 Extract response and send it to UMAC
17279 -------------------------------------------------------------------------*/
17280 wpalMemoryCopy( &halNvDownloadRsp,
17281 pEventData->pEventData,
17282 sizeof(halNvDownloadRsp));
17283
17284 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17285
17286 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
17287 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17288 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
17289 {
17290 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
17291 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
17292 }
17293 else
17294 {
17295 /*Reset the Nv related global information in WDI context information */
17296 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17297 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17298 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17299 /*call WDA callback function for last fragment */
17300 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17301 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17302 }
17303
17304 return WDI_STATUS_SUCCESS;
17305}
17306#ifdef WLAN_FEATURE_VOWIFI_11R
17307/**
17308 @brief Process Add TSpec Rsp function (called when a response
17309 is being received over the bus from HAL)
17310
17311 @param pWDICtx: pointer to the WLAN DAL context
17312 pEventData: pointer to the event information structure
17313
17314 @see
17315 @return Result of the function call
17316*/
17317WDI_Status
17318WDI_ProcessAggrAddTSpecRsp
17319(
17320 WDI_ControlBlockType* pWDICtx,
17321 WDI_EventInfoType* pEventData
17322)
17323{
17324 WDI_Status wdiStatus;
17325 tAggrAddTsRspParams aggrAddTsRsp;
17326 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17327 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17328
17329 /*-------------------------------------------------------------------------
17330 Sanity check
17331 -------------------------------------------------------------------------*/
17332 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17333 ( NULL == pEventData->pEventData))
17334 {
17335 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17336 "%s: Invalid parameters", __FUNCTION__);
17337 WDI_ASSERT(0);
17338 return WDI_STATUS_E_FAILURE;
17339 }
17340
17341 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17342
17343 /*-------------------------------------------------------------------------
17344 Extract response and send it to UMAC
17345 -------------------------------------------------------------------------*/
17346 wpalMemoryCopy( &aggrAddTsRsp,
17347 pEventData->pEventData,
17348 sizeof(aggrAddTsRsp));
17349
17350 /* What is the difference between status0 and status1? */
17351 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
17352
17353 /*Notify UMAC*/
17354 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17355
17356 return WDI_STATUS_SUCCESS;
17357}/*WDI_ProcessAddTSpecRsp*/
17358#endif /* WLAN_FEATURE_VOWIFI_11R */
17359
17360/**
17361 @brief WDI_ProcessHostResumeRsp function (called when a
17362 response is being received over the bus from HAL)
17363
17364 @param pWDICtx: pointer to the WLAN DAL context
17365 pEventData: pointer to the event information structure
17366
17367 @see
17368 @return Result of the function call
17369*/
17370WDI_Status
17371WDI_ProcessHostResumeRsp
17372(
17373 WDI_ControlBlockType* pWDICtx,
17374 WDI_EventInfoType* pEventData
17375)
17376{
17377 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17378 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17379 tHalHostResumeRspParams hostResumeRspMsg;
17380 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17381
17382 /*-------------------------------------------------------------------------
17383 Sanity check
17384 -------------------------------------------------------------------------*/
17385 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17386 ( NULL == pEventData->pEventData))
17387 {
17388 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17389 "%s: Invalid parameters", __FUNCTION__);
17390 WDI_ASSERT(0);
17391 return WDI_STATUS_E_FAILURE;
17392 }
17393
17394 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17395
17396 /*-------------------------------------------------------------------------
17397 Extract response and send it to UMAC
17398 -------------------------------------------------------------------------*/
17399
17400 wpalMemoryCopy( &hostResumeRspMsg,
17401 (wpt_uint8*)pEventData->pEventData,
17402 sizeof(hostResumeRspMsg));
17403
17404 wdiResumeRspParams.wdiStatus =
17405 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
17406
17407 /*Notify UMAC*/
17408 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17409
17410 return WDI_STATUS_SUCCESS;
17411}
17412
17413/**
17414 @brief Process Set Tx PER Rsp function (called when a response
17415 is being received over the bus from HAL)
17416
17417 @param pWDICtx: pointer to the WLAN DAL context
17418 pEventData: pointer to the event information structure
17419
17420 @see
17421 @return Result of the function call
17422*/
17423WDI_Status
17424WDI_ProcessSetTxPerTrackingRsp
17425(
17426 WDI_ControlBlockType* pWDICtx,
17427 WDI_EventInfoType* pEventData
17428)
17429{
17430 WDI_Status wdiStatus;
17431 eHalStatus halStatus;
17432 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17433 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17434
17435 /*-------------------------------------------------------------------------
17436 Sanity check
17437 -------------------------------------------------------------------------*/
17438 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17439 ( NULL == pEventData->pEventData))
17440 {
17441 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17442 "%s: Invalid parameters", __FUNCTION__);
17443 WDI_ASSERT(0);
17444 return WDI_STATUS_E_FAILURE;
17445 }
17446
17447 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
17448
17449 /*-------------------------------------------------------------------------
17450 Extract response and send it to UMAC
17451 -------------------------------------------------------------------------*/
17452 halStatus = *((eHalStatus*)pEventData->pEventData);
17453 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17454
17455 /*Notify UMAC*/
17456 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17457
17458 return WDI_STATUS_SUCCESS;
17459}/*WDI_ProcessSetTxPerTrackingRsp*/
17460
17461/*==========================================================================
17462 Indications from HAL
17463 ==========================================================================*/
17464/**
17465 @brief Process Low RSSI Indication function (called when an
17466 indication of this kind is being received over the bus
17467 from HAL)
17468
17469 @param pWDICtx: pointer to the WLAN DAL context
17470 pEventData: pointer to the event information structure
17471
17472 @see
17473 @return Result of the function call
17474*/
17475WDI_Status
17476WDI_ProcessLowRSSIInd
17477(
17478 WDI_ControlBlockType* pWDICtx,
17479 WDI_EventInfoType* pEventData
17480)
17481{
17482 WDI_LowLevelIndType wdiInd;
17483 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
17484 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17485
17486 /*-------------------------------------------------------------------------
17487 Sanity check
17488 -------------------------------------------------------------------------*/
17489 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17490 ( NULL == pEventData->pEventData))
17491 {
17492 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17493 "%s: Invalid parameters", __FUNCTION__);
17494 WDI_ASSERT(0);
17495 return WDI_STATUS_E_FAILURE;
17496 }
17497
17498 /*-------------------------------------------------------------------------
17499 Extract indication and send it to UMAC
17500 -------------------------------------------------------------------------*/
17501 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
17502 pEventData->pEventData,
17503 sizeof(tHalRSSINotification));
17504
17505 /*Fill in the indication parameters*/
17506 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
17507 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
17508 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
17509 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
17510 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
17511 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
17512 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
17513 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
17514 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
17515 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
17516 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
17517 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
17518 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
17519
17520 /*Notify UMAC*/
17521 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17522
17523 return WDI_STATUS_SUCCESS;
17524}/*WDI_ProcessLowRSSIInd*/
17525
17526
17527/**
17528 @brief Process Missed Beacon Indication function (called when
17529 an indication of this kind is being received over the
17530 bus from HAL)
17531
17532 @param pWDICtx: pointer to the WLAN DAL context
17533 pEventData: pointer to the event information structure
17534
17535 @see
17536 @return Result of the function call
17537*/
17538WDI_Status
17539WDI_ProcessMissedBeaconInd
17540(
17541 WDI_ControlBlockType* pWDICtx,
17542 WDI_EventInfoType* pEventData
17543)
17544{
17545 WDI_Status wdiStatus;
17546 eHalStatus halStatus;
17547 WDI_LowLevelIndType wdiInd;
17548 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17549
17550 /*-------------------------------------------------------------------------
17551 Sanity check
17552 -------------------------------------------------------------------------*/
17553 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17554 ( NULL == pEventData->pEventData))
17555 {
17556 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17557 "%s: Invalid parameters", __FUNCTION__);
17558 WDI_ASSERT(0);
17559 return WDI_STATUS_E_FAILURE;
17560 }
17561
17562 /*-------------------------------------------------------------------------
17563 Extract indication and send it to UMAC
17564 -------------------------------------------------------------------------*/
17565 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17566 halStatus = *((eHalStatus*)pEventData->pEventData);
17567 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17568
17569 /*Fill in the indication parameters*/
17570 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
17571
17572 /*Notify UMAC*/
17573 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17574
17575 return WDI_STATUS_SUCCESS;
17576}/*WDI_ProcessMissedBeaconInd*/
17577
17578
17579/**
17580 @brief Process Unk Addr Frame Indication function (called when
17581 an indication of this kind is being received over the
17582 bus from HAL)
17583
17584 @param pWDICtx: pointer to the WLAN DAL context
17585 pEventData: pointer to the event information structure
17586
17587 @see
17588 @return Result of the function call
17589*/
17590WDI_Status
17591WDI_ProcessUnkAddrFrameInd
17592(
17593 WDI_ControlBlockType* pWDICtx,
17594 WDI_EventInfoType* pEventData
17595)
17596{
17597 WDI_Status wdiStatus;
17598 eHalStatus halStatus;
17599 WDI_LowLevelIndType wdiInd;
17600 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17601
17602 /*-------------------------------------------------------------------------
17603 Sanity check
17604 -------------------------------------------------------------------------*/
17605 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17606 ( NULL == pEventData->pEventData))
17607 {
17608 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17609 "%s: Invalid parameters", __FUNCTION__);
17610 WDI_ASSERT(0);
17611 return WDI_STATUS_E_FAILURE;
17612 }
17613
17614 /*-------------------------------------------------------------------------
17615 Extract indication and send it to UMAC
17616 -------------------------------------------------------------------------*/
17617 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17618 halStatus = *((eHalStatus*)pEventData->pEventData);
17619 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17620
17621 /*Fill in the indication parameters*/
17622 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
17623 /* ! TO DO - fill in from HAL struct:
17624 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
17625
17626 /*Notify UMAC*/
17627 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17628
17629 return WDI_STATUS_SUCCESS;
17630}/*WDI_ProcessUnkAddrFrameInd*/
17631
17632
17633/**
17634 @brief Process MIC Failure Indication function (called when an
17635 indication of this kind is being received over the bus
17636 from HAL)
17637
17638 @param pWDICtx: pointer to the WLAN DAL context
17639 pEventData: pointer to the event information structure
17640
17641 @see
17642 @return Result of the function call
17643*/
17644WDI_Status
17645WDI_ProcessMicFailureInd
17646(
17647 WDI_ControlBlockType* pWDICtx,
17648 WDI_EventInfoType* pEventData
17649)
17650{
17651 WDI_LowLevelIndType wdiInd;
17652 tpSirMicFailureInd pHalMicFailureInd;
17653
17654 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17655
17656 /*-------------------------------------------------------------------------
17657 Sanity check
17658 -------------------------------------------------------------------------*/
17659 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17660 ( NULL == pEventData->pEventData))
17661 {
17662 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17663 "%s: Invalid parameters", __FUNCTION__);
17664 WDI_ASSERT(0);
17665 return WDI_STATUS_E_FAILURE;
17666 }
17667
17668 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
17669 /*-------------------------------------------------------------------------
17670 Extract indication and send it to UMAC
17671 -------------------------------------------------------------------------*/
17672
17673 /*Fill in the indication parameters*/
17674 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
17675 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
17676 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
17677 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
17678 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
17679 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
17680 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
17681 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
17682 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
17683 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
17684 pHalMicFailureInd->info.multicast;
17685 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
17686 pHalMicFailureInd->info.IV1;
17687 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
17688 pHalMicFailureInd->info.keyId;
17689 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
17690 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
17691 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
17692 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
17693 /*Notify UMAC*/
17694 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17695
17696 return WDI_STATUS_SUCCESS;
17697}/*WDI_ProcessMicFailureInd*/
17698
17699
17700/**
17701 @brief Process Fatal Failure Indication function (called when
17702 an indication of this kind is being received over the
17703 bus from HAL)
17704
17705 @param pWDICtx: pointer to the WLAN DAL context
17706 pEventData: pointer to the event information structure
17707
17708 @see
17709 @return Result of the function call
17710*/
17711WDI_Status
17712WDI_ProcessFatalErrorInd
17713(
17714 WDI_ControlBlockType* pWDICtx,
17715 WDI_EventInfoType* pEventData
17716)
17717{
17718 WDI_Status wdiStatus;
17719 eHalStatus halStatus;
17720 WDI_LowLevelIndType wdiInd;
17721 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17722
17723 /*-------------------------------------------------------------------------
17724 Sanity check
17725 -------------------------------------------------------------------------*/
17726 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17727 ( NULL == pEventData->pEventData))
17728 {
17729 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17730 "%s: Invalid parameters", __FUNCTION__);
17731 WDI_ASSERT(0);
17732 return WDI_STATUS_E_FAILURE;
17733 }
17734
17735 /*-------------------------------------------------------------------------
17736 Extract indication and send it to UMAC
17737 -------------------------------------------------------------------------*/
17738
17739 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17740 halStatus = *((eHalStatus*)pEventData->pEventData);
17741 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17742
17743 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17744 "Fatal failure received from device %d ", halStatus );
17745
17746 /*Fill in the indication parameters*/
17747 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
17748 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
17749
17750 /*Notify UMAC*/
17751 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17752
17753 return WDI_STATUS_SUCCESS;
17754}/*WDI_ProcessFatalErrorInd*/
17755
17756/**
17757 @brief Process Delete STA Indication function (called when
17758 an indication of this kind is being received over the
17759 bus from HAL)
17760
17761 @param pWDICtx: pointer to the WLAN DAL context
17762 pEventData: pointer to the event information structure
17763
17764 @see
17765 @return Result of the function call
17766*/
17767WDI_Status
17768WDI_ProcessDelSTAInd
17769(
17770 WDI_ControlBlockType* pWDICtx,
17771 WDI_EventInfoType* pEventData
17772)
17773{
17774 tDeleteStaContextParams halDelSTACtx;
17775 WDI_LowLevelIndType wdiInd;
17776 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17777
17778 /*-------------------------------------------------------------------------
17779 Sanity check
17780 -------------------------------------------------------------------------*/
17781 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17782 ( NULL == pEventData->pEventData))
17783 {
17784 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17785 "%s: Invalid parameters", __FUNCTION__);
17786 WDI_ASSERT(0);
17787 return WDI_STATUS_E_FAILURE;
17788 }
17789
17790 /*-------------------------------------------------------------------------
17791 Extract indication and send it to UMAC
17792 -------------------------------------------------------------------------*/
17793
17794 /* Parameters need to be unpacked according to HAL struct*/
17795 wpalMemoryCopy( &halDelSTACtx,
17796 pEventData->pEventData,
17797 sizeof(halDelSTACtx));
17798
17799 /*Fill in the indication parameters*/
17800 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
17801
17802 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
17803 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
17804 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
17805 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
17806
17807 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
17808 halDelSTACtx.assocId;
17809 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
17810 halDelSTACtx.staId;
17811 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
17812 halDelSTACtx.reasonCode;
17813
17814 /*Notify UMAC*/
17815 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17816
17817 return WDI_STATUS_SUCCESS;
17818}/*WDI_ProcessDelSTAInd*/
17819
17820/**
17821*@brief Process Coex Indication function (called when
17822 an indication of this kind is being received over the
17823 bus from HAL)
17824
17825 @param pWDICtx: pointer to the WLAN DAL context
17826 pEventData: pointer to the event information structure
17827
17828 @see
17829 @return Result of the function call
17830*/
17831WDI_Status
17832WDI_ProcessCoexInd
17833(
17834 WDI_ControlBlockType* pWDICtx,
17835 WDI_EventInfoType* pEventData
17836)
17837{
17838 WDI_LowLevelIndType wdiInd;
17839 tCoexIndMsg halCoexIndMsg;
17840 wpt_uint32 index;
17841 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17842
17843 /*-------------------------------------------------------------------------
17844 Sanity check
17845 -------------------------------------------------------------------------*/
17846 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17847 ( NULL == pEventData->pEventData ))
17848 {
17849 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17850 "%s: Invalid parameters", __FUNCTION__);
17851 WDI_ASSERT( 0 );
17852 return WDI_STATUS_E_FAILURE;
17853 }
17854
17855 /*-------------------------------------------------------------------------
17856 Extract indication and send it to UMAC
17857 -------------------------------------------------------------------------*/
17858 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
17859 pEventData->pEventData,
17860 sizeof(halCoexIndMsg.coexIndParams) );
17861
17862 /*Fill in the indication parameters*/
17863 wdiInd.wdiIndicationType = WDI_COEX_IND;
17864 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
17865 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
17866 {
17867 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
17868 }
17869
17870 // DEBUG
17871 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
17872 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
17873 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
17874 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
17875 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
17876 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
17877 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
17878
17879 /*Notify UMAC*/
17880 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17881
17882 return WDI_STATUS_SUCCESS;
17883}/*WDI_ProcessCoexInd*/
17884
17885/**
17886*@brief Process Tx Complete Indication function (called when
17887 an indication of this kind is being received over the
17888 bus from HAL)
17889
17890 @param pWDICtx: pointer to the WLAN DAL context
17891 pEventData: pointer to the event information structure
17892
17893 @see
17894 @return Result of the function call
17895*/
17896WDI_Status
17897WDI_ProcessTxCompleteInd
17898(
17899 WDI_ControlBlockType* pWDICtx,
17900 WDI_EventInfoType* pEventData
17901)
17902{
17903 WDI_LowLevelIndType wdiInd;
17904 tTxComplIndMsg halTxComplIndMsg;
17905 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17906
17907 /*-------------------------------------------------------------------------
17908 Sanity check
17909 -------------------------------------------------------------------------*/
17910 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17911 ( NULL == pEventData->pEventData ))
17912 {
17913 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17914 "%s: Invalid parameters", __FUNCTION__);
17915 WDI_ASSERT( 0 );
17916 return WDI_STATUS_E_FAILURE;
17917 }
17918
17919 /*-------------------------------------------------------------------------
17920 Extract indication and send it to UMAC
17921 -------------------------------------------------------------------------*/
17922 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
17923 pEventData->pEventData,
17924 sizeof(halTxComplIndMsg.txComplParams) );
17925
17926 /*Fill in the indication parameters*/
17927 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
17928 wdiInd.wdiIndicationData.tx_complete_status
17929 = halTxComplIndMsg.txComplParams.status;
17930
17931 /*Notify UMAC*/
17932 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
17933
17934 return WDI_STATUS_SUCCESS;
17935}/*WDI_ProcessTxCompleteInd*/
17936
17937#ifdef WLAN_FEATURE_P2P
17938/**
17939*@brief Process Noa Attr Indication function (called when
17940 an indication of this kind is being received over the
17941 bus from HAL)
17942
17943 @param pWDICtx: pointer to the WLAN DAL context
17944 pEventData: pointer to the event information structure
17945
17946 @see
17947 @return Result of the function call
17948*/
17949WDI_Status
17950WDI_ProcessP2pNoaAttrInd
17951(
17952 WDI_ControlBlockType* pWDICtx,
17953 WDI_EventInfoType* pEventData
17954)
17955{
17956 WDI_LowLevelIndType wdiInd;
17957 tNoaAttrIndMsg halNoaAttrIndMsg;
17958 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17959
17960 /*-------------------------------------------------------------------------
17961 Sanity check
17962 -------------------------------------------------------------------------*/
17963 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17964 ( NULL == pEventData->pEventData ))
17965 {
17966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17967 "%s: Invalid parameters", __FUNCTION__);
17968 WDI_ASSERT( 0 );
17969 return WDI_STATUS_E_FAILURE;
17970 }
17971
17972 /*-------------------------------------------------------------------------
17973 Extract indication and send it to UMAC
17974 -------------------------------------------------------------------------*/
17975 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
17976 pEventData->pEventData,
17977 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
17978
17979 /*Fill in the indication parameters*/
17980 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
17981
17982 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
17983 = halNoaAttrIndMsg.noaAttrIndParams.status;
17984
17985 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
17986 = halNoaAttrIndMsg.noaAttrIndParams.index;
17987 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
17988 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
17989 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
17990 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
17991
17992 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
17993 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
17994 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
17995 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
17996 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
17997 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
17998 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
17999 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
18000
18001 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18002 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18003 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18004 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18005 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18006 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18007 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18008 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18009
18010 /*Notify UMAC*/
18011 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18012
18013 return WDI_STATUS_SUCCESS;
18014}/*WDI_ProcessNoaAttrInd*/
18015#endif
18016
18017/**
18018 @brief Process Tx PER Hit Indication function (called when
18019 an indication of this kind is being received over the
18020 bus from HAL)
18021
18022 @param pWDICtx: pointer to the WLAN DAL context
18023 pEventData: pointer to the event information structure
18024
18025 @see
18026 @return Result of the function call
18027*/
18028WDI_Status
18029WDI_ProcessTxPerHitInd
18030(
18031 WDI_ControlBlockType* pWDICtx,
18032 WDI_EventInfoType* pEventData
18033)
18034{
18035 WDI_LowLevelIndType wdiInd;
18036 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18037
18038 /*-------------------------------------------------------------------------
18039 Extract indication and send it to UMAC
18040 -------------------------------------------------------------------------*/
18041 /*Fill in the indication parameters*/
18042 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18043
18044 /*Notify UMAC*/
18045 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18046
18047 return WDI_STATUS_SUCCESS;
18048}/*WDI_ProcessTxPerHitInd*/
18049
18050#ifdef ANI_MANF_DIAG
18051/**
18052 @brief WDI_ProcessFTMCommandReq
18053 Process FTM Command, simply route to HAL
18054
18055 @param pWDICtx: pointer to the WLAN DAL context
18056 pEventData: pointer to the event information structure
18057
18058 @see
18059 @return Result of the function call
18060*/
18061WDI_Status
18062WDI_ProcessFTMCommandReq
18063(
18064 WDI_ControlBlockType* pWDICtx,
18065 WDI_EventInfoType* pEventData
18066)
18067{
18068 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18069 wpt_uint8 *ftmCommandBuffer = NULL;
18070 wpt_uint16 dataOffset;
18071 wpt_uint16 bufferSize;
18072 /*-------------------------------------------------------------------------
18073 Sanity check
18074 -------------------------------------------------------------------------*/
18075 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18076 ( NULL == pEventData->pEventData))
18077
18078 {
18079 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18080 "%s: Invalid parameters", __FUNCTION__);
18081 WDI_ASSERT(0);
18082 return WDI_STATUS_E_FAILURE;
18083 }
18084
18085 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18086
18087 /* Get MSG Buffer */
18088 WDI_GetMessageBuffer(pWDICtx,
18089 WDI_FTM_CMD_REQ,
18090 ftmCommandReq->bodyLength,
18091 &ftmCommandBuffer,
18092 &dataOffset,
18093 &bufferSize);
18094
18095 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18096 ftmCommandReq->FTMCommandBody,
18097 ftmCommandReq->bodyLength);
18098
18099 /* Send MSG */
18100 return WDI_SendMsg(pWDICtx,
18101 ftmCommandBuffer,
18102 bufferSize,
18103 pEventData->pCBfnc,
18104 pEventData->pUserData,
18105 WDI_FTM_CMD_RESP);
18106}
18107
18108/**
18109 @brief WDI_ProcessFTMCommandRsp
18110 Process FTM Command Response from HAL, simply route to HDD FTM
18111
18112 @param pWDICtx: pointer to the WLAN DAL context
18113 pEventData: pointer to the event information structure
18114
18115 @see
18116 @return Result of the function call
18117*/
18118WDI_Status
18119WDI_ProcessFTMCommandRsp
18120(
18121 WDI_ControlBlockType* pWDICtx,
18122 WDI_EventInfoType* pEventData
18123)
18124{
18125 WDI_FTMCommandRspCb ftmCMDRspCb;
18126 tProcessPttRspParams *ftmCMDRspData = NULL;
18127 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18128
18129 /*-------------------------------------------------------------------------
18130 Sanity check
18131 -------------------------------------------------------------------------*/
18132 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18133 ( NULL == pEventData->pEventData))
18134 {
18135 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18136 "%s: Invalid parameters", __FUNCTION__);
18137 WDI_ASSERT(0);
18138 return WDI_STATUS_E_FAILURE;
18139 }
18140
18141 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18142
18143 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18144
18145 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18146 (void *)&ftmCMDRspData->pttMsgBuffer,
18147 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18148
18149 /*Notify UMAC*/
18150 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18151
18152 return WDI_STATUS_SUCCESS;
18153}
18154#endif /* ANI_MANF_DIAG */
18155/**
18156 @brief WDI_ProcessHalDumpCmdReq
18157 Process hal dump Command, simply route to HAL
18158
18159 @param pWDICtx: pointer to the WLAN DAL context
18160 pEventData: pointer to the event information structure
18161
18162 @see
18163 @return Result of the function call
18164*/
18165WDI_Status
18166WDI_ProcessHALDumpCmdReq
18167(
18168 WDI_ControlBlockType* pWDICtx,
18169 WDI_EventInfoType* pEventData
18170)
18171{
18172 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18173 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18174 wpt_uint16 usDataOffset = 0;
18175 wpt_uint16 usSendSize = 0;
18176 tHalDumpCmdReqMsg halDumpCmdReqMsg;
18177 wpt_uint8* pSendBuffer = NULL;
18178
18179 /*-------------------------------------------------------------------------
18180 Sanity check
18181 -------------------------------------------------------------------------*/
18182 if (( NULL == pEventData ) ||
18183 ( NULL == pEventData->pEventData) ||
18184 ( NULL == pEventData->pCBfnc ))
18185 {
18186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18187 "%s: Invalid parameters", __FUNCTION__);
18188 WDI_ASSERT(0);
18189 return WDI_STATUS_E_FAILURE;
18190 }
18191
18192 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18193 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18194
18195 /* Copying the HAL DUMP Command Information HAL Structure*/
18196 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
18197 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
18198 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
18199 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
18200 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
18201 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
18202 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
18203 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
18204 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
18205 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
18206
18207 /*-----------------------------------------------------------------------
18208 Get message buffer
18209 -----------------------------------------------------------------------*/
18210 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
18211 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18212 &pSendBuffer, &usDataOffset, &usSendSize))||
18213 ( usSendSize <
18214 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18215 {
18216 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18217 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18218 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18219 WDI_ASSERT(0);
18220 return WDI_STATUS_E_FAILURE;
18221 }
18222
18223 wpalMemoryCopy( pSendBuffer+usDataOffset,
18224 &halDumpCmdReqMsg.dumpCmdReqParams,
18225 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
18226
18227 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
18228 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
18229
18230 /*-------------------------------------------------------------------------
18231 Send Start Request to HAL
18232 -------------------------------------------------------------------------*/
18233 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18234 wdiHALDumpCmdRspCb, pEventData->pUserData,
18235 WDI_HAL_DUMP_CMD_RESP);
18236}
18237
18238/**
18239 @brief WDI_ProcessHalDumpCmdRsp
18240 Process hal Dump Command Response from HAL, simply route to HDD
18241
18242 @param pWDICtx: pointer to the WLAN DAL context
18243 pEventData: pointer to the event information structure
18244
18245 @see
18246 @return Result of the function call
18247*/
18248WDI_Status
18249WDI_ProcessHALDumpCmdRsp
18250(
18251 WDI_ControlBlockType* pWDICtx,
18252 WDI_EventInfoType* pEventData
18253)
18254{
18255 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18256 tpHalDumpCmdRspParams halDumpCmdRspParams;
18257 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18258
18259 /*-------------------------------------------------------------------------
18260 Sanity check
18261 -------------------------------------------------------------------------*/
18262 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18263 ( NULL == pEventData->pEventData))
18264 {
18265 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18266 "%s: Invalid parameters", __FUNCTION__);
18267 WDI_ASSERT(0);
18268 return WDI_STATUS_E_FAILURE;
18269 }
18270
18271 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
18272
18273 /*Initialize the WDI Response structure */
18274 wdiHALDumpCmdRsp.usBufferLen = 0;
18275 wdiHALDumpCmdRsp.pBuffer = NULL;
18276
18277 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
18278
18279 wdiHALDumpCmdRsp.wdiStatus =
18280 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
18281
18282 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18283 (halDumpCmdRspParams->rspLength != 0))
18284 {
18285 /* Copy the response data */
18286 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18287 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
18288 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18289 wdiHALDumpCmdRsp.pBuffer,
18290 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18291 }
18292
18293 /*Notify UMAC*/
18294 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18295
18296 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18297 {
18298 /* Free the allocated buffer */
18299 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18300 }
18301 return WDI_STATUS_SUCCESS;
18302}
18303
18304/*==========================================================================
18305 CONTRL TRANSPORT INTERACTION
18306
18307 Callback function registered with the control transport - for receiving
18308 notifications and packets
18309==========================================================================*/
18310/**
18311 @brief This callback is invoked by the control transport
18312 when it wishes to send up a notification like the ones
18313 mentioned above.
18314
18315 @param
18316
18317 wctsHandle: handle to the control transport service
18318 wctsEvent: the event being notified
18319 wctsNotifyCBData: the callback data of the user
18320
18321 @see WCTS_OpenTransport
18322
18323 @return None
18324*/
18325void
18326WDI_NotifyMsgCTSCB
18327(
18328 WCTS_HandleType wctsHandle,
18329 WCTS_NotifyEventType wctsEvent,
18330 void* wctsNotifyCBData
18331)
18332{
18333 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
18334 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18335
18336 if (NULL == pWDICtx )
18337 {
18338 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18339 "%s: Invalid parameters", __FUNCTION__);
18340 WDI_ASSERT(0);
18341 return;
18342 }
18343
18344 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18345 {
18346 /* callback presumably occurred after close */
18347 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18348 "%s: Invalid control block", __FUNCTION__);
18349 return;
18350 }
18351
18352 if ( WCTS_EVENT_OPEN == wctsEvent )
18353 {
18354 /*Flag must be set atomically as it is checked from incoming request
18355 functions*/
18356 wpalMutexAcquire(&pWDICtx->wptMutex);
18357 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
18358
18359 /*Nothing to do - so try to dequeue any pending request that may have
18360 occurred while we were trying to establish this*/
18361 WDI_DequeuePendingReq(pWDICtx);
18362 wpalMutexRelease(&pWDICtx->wptMutex);
18363 }
18364 else if ( WCTS_EVENT_CLOSE == wctsEvent )
18365 {
18366 /*Flag must be set atomically as it is checked from incoming request
18367 functions*/
18368 wpalMutexAcquire(&pWDICtx->wptMutex);
18369 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
18370
18371 /*No other request will be processed from now on - fail all*/
18372 WDI_ClearPendingRequests(pWDICtx);
18373 wpalMutexRelease(&pWDICtx->wptMutex);
18374
18375 /*Notify that the Control Channel is closed */
18376 wpalEventSet(&pWDICtx->wctsActionEvent);
18377 }
18378
18379}/*WDI_NotifyMsgCTSCB*/
18380
18381
18382/**
18383 @brief This callback is invoked by the control transport
18384 when it wishes to send up a packet received over the
18385 bus.
18386
18387 @param
18388
18389 wctsHandle: handle to the control transport service
18390 pMsg: the packet
18391 uLen: the packet length
18392 wctsRxMsgCBData: the callback data of the user
18393
18394 @see WCTS_OpenTransport
18395
18396 @return None
18397*/
18398void
18399WDI_RXMsgCTSCB
18400(
18401 WCTS_HandleType wctsHandle,
18402 void* pMsg,
18403 wpt_uint32 uLen,
18404 void* wctsRxMsgCBData
18405)
18406{
18407 tHalMsgHeader *pHalMsgHeader;
18408 WDI_EventInfoType wdiEventData;
18409 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18410 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18411
18412 /*------------------------------------------------------------------------
18413 Sanity check
18414 ------------------------------------------------------------------------*/
18415 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
18416 ( uLen < sizeof(tHalMsgHeader)))
18417 {
18418 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18419 "%s: Invalid parameters", __FUNCTION__);
18420 WDI_ASSERT(0);
18421 return;
18422 }
18423
18424 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18425 {
18426 /* callback presumably occurred after close */
18427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18428 "%s: Invalid control block", __FUNCTION__);
18429 return;
18430 }
18431
18432 /*The RX Callback is expected to be serialized in the proper control thread
18433 context - so no serialization is necessary here
18434 ! - revisit this assumption */
18435
18436 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18437
18438 if ( uLen != pHalMsgHeader->msgLen )
18439 {
18440 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18441 "Invalid packet received from HAL - catastrophic failure");
18442 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18443 return;
18444 }
18445
18446 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18447
18448 /*The message itself starts after the header*/
18449 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18450 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18451 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18452 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18453
18454
18455 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18456 {
18457 /*Stop the timer as the response was received */
18458 /*!UT - check for potential race conditions between stop and response */
18459 wpalTimerStop(&pWDICtx->wptResponseTimer);
18460 }
18461 /* Check if we receive a response message which is not expected */
18462 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
18463 {
18464 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18465 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
18466 WDI_getRespMsgString(wdiEventData.wdiResponse),
18467 wdiEventData.wdiResponse,
18468 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18469 pWDICtx->wdiExpectedResponse);
18470 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
18471 return;
18472 }
18473
18474 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18475 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
18476
18477 /*Post response event to the state machine*/
18478 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
18479
18480}/*WDI_RXMsgCTSCB*/
18481
18482
18483/*========================================================================
18484 Internal Helper Routines
18485========================================================================*/
18486
18487/**
18488 @brief WDI_CleanCB - internal helper routine used to clean the
18489 WDI Main Control Block
18490
18491 @param pWDICtx - pointer to the control block
18492
18493 @return Result of the function call
18494*/
18495WPT_INLINE WDI_Status
18496WDI_CleanCB
18497(
18498 WDI_ControlBlockType* pWDICtx
18499)
18500{
18501 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18502
18503 /*Clean the WDI Control Block*/
18504 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
18505
18506 pWDICtx->uGlobalState = WDI_MAX_ST;
18507 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
18508 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
18509
18510 WDI_ResetAssocSessions( pWDICtx );
18511
18512 return WDI_STATUS_SUCCESS;
18513}/*WDI_CleanCB*/
18514
18515
18516/**
18517 @brief Process request helper function
18518
18519
18520 @param pWDICtx: pointer to the WLAN DAL context
18521 pEventData: pointer to the event information structure
18522
18523 @see
18524 @return Result of the function call
18525*/
18526WPT_INLINE WDI_Status
18527WDI_ProcessRequest
18528(
18529 WDI_ControlBlockType* pWDICtx,
18530 WDI_EventInfoType* pEventData
18531)
18532{
18533 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18534
18535 /*!! Skip sanity check as this is called from the FSM functionss which
18536 already checked these pointers*/
18537
18538 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
18539 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
18540 {
18541 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18542 "Calling request processing function for req %s (%d) %x",
18543 WDI_getReqMsgString(pEventData->wdiRequest),
18544 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
18545 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
18546 }
18547 else
18548 {
18549 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18550 "Operation %d is not yet implemented ",
18551 pEventData->wdiRequest);
18552 return WDI_STATUS_E_NOT_IMPLEMENT;
18553 }
18554}/*WDI_ProcessRequest*/
18555
18556
18557/**
18558 @brief Get message helper function - it allocates memory for a
18559 message that is to be sent to HAL accross the bus and
18560 prefixes it with a send message header
18561
18562 @param pWDICtx: pointer to the WLAN DAL context
18563 wdiReqType: type of the request being sent
18564 uBufferLen: message buffer len
18565 pMsgBuffer: resulting allocated buffer
18566 pusDataOffset: offset in the buffer where the caller
18567 can start copying its message data
18568 puBufferSize: the resulting buffer size (offset+buff
18569 len)
18570
18571 @see
18572 @return Result of the function call
18573*/
18574WDI_Status
18575WDI_GetMessageBuffer
18576(
18577 WDI_ControlBlockType* pWDICtx,
18578 WDI_RequestEnumType wdiReqType,
18579 wpt_uint16 usBufferLen,
18580 wpt_uint8** pMsgBuffer,
18581 wpt_uint16* pusDataOffset,
18582 wpt_uint16* pusBufferSize
18583)
18584{
18585 tHalMsgHeader halMsgHeader;
18586 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18587
18588 /*!! No sanity check here as we trust the called - ! check this assumption
18589 again*/
18590
18591 /*-------------------------------------------------------------------------
18592 Try to allocate message buffer from PAL
18593 -------------------------------------------------------------------------*/
18594 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
18595 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
18596 if ( NULL == *pMsgBuffer )
18597 {
18598 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18599 "Unable to allocate message buffer for req %s (%d)",
18600 WDI_getReqMsgString(wdiReqType),
18601 wdiReqType);
18602 WDI_ASSERT(0);
18603 return WDI_STATUS_MEM_FAILURE;
18604 }
18605
18606 /*-------------------------------------------------------------------------
18607 Fill in the message header
18608 -------------------------------------------------------------------------*/
18609 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
18610 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
18611 *pusDataOffset = sizeof(halMsgHeader);
18612 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
18613
18614 return WDI_STATUS_SUCCESS;
18615}/*WDI_GetMessageBuffer*/
18616
18617
18618/**
18619 @brief Send message helper function - sends a message over the
18620 bus using the control tranport and saves some info in
18621 the CB
18622
18623 @param pWDICtx: pointer to the WLAN DAL context
18624 pSendBuffer: buffer to be sent
18625
18626 usSendSize size of the buffer to be sent
18627 pRspCb: response callback - save in the WDI
18628 CB
18629 pUserData: user data associated with the
18630 callback
18631 wdiExpectedResponse: the code of the response that is
18632 expected to be rx-ed for this request
18633
18634 @see
18635 @return Result of the function call
18636*/
18637WDI_Status
18638WDI_SendMsg
18639(
18640 WDI_ControlBlockType* pWDICtx,
18641 wpt_uint8* pSendBuffer,
18642 wpt_uint32 usSendSize,
18643 void* pRspCb,
18644 void* pUserData,
18645 WDI_ResponseEnumType wdiExpectedResponse
18646)
18647{
Jeff Johnsond13512a2012-07-17 11:42:19 -070018648 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018649 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18650
18651 /*------------------------------------------------------------------------
18652 Save needed info in the CB
18653 ------------------------------------------------------------------------*/
18654 pWDICtx->pRspCBUserData = pUserData;
18655 pWDICtx->pfncRspCB = pRspCb;
18656 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
18657
18658 /*-----------------------------------------------------------------------
18659 Call the CTS to send this message over - free message afterwards
18660 - notify transport failure
18661 Note: CTS is reponsible for freeing the message buffer.
18662 -----------------------------------------------------------------------*/
18663 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
18664 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070018665 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070018666 "Failed to send message over the bus - catastrophic failure");
18667
Jeff Johnsond13512a2012-07-17 11:42:19 -070018668 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018669 }
18670
Jeff Johnsond13512a2012-07-17 11:42:19 -070018671 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070018672 if ( NULL != pWDICtx->wdiReqStatusCB )
18673 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070018674 /*Inform originator whether request went through or not*/
18675 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
18676 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018677 pWDICtx->wdiReqStatusCB = NULL;
18678 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070018679 callback(wdiStatus, callbackContext);
18680
18681 /*For WDI requests which have registered a request callback,
18682 inform the WDA caller of the same via setting the return value
18683 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
18684 end up repeating the functonality in the req callback for the
18685 WDI_STATUS_E_FAILURE case*/
18686 if (wdiStatus == WDI_STATUS_E_FAILURE)
18687 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070018688 }
18689
Jeff Johnsond13512a2012-07-17 11:42:19 -070018690 if ( wdiStatus == WDI_STATUS_SUCCESS )
18691 {
Jeff Johnson295189b2012-06-20 16:38:30 -070018692 /*Start timer for the expected response */
18693 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070018694 }
18695 else
18696 {
18697 /*Inform upper stack layers that a transport fatal error occured*/
18698 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
18699 }
Jeff Johnson295189b2012-06-20 16:38:30 -070018700
Jeff Johnsond13512a2012-07-17 11:42:19 -070018701 return wdiStatus;
18702
Jeff Johnson295189b2012-06-20 16:38:30 -070018703}/*WDI_SendMsg*/
18704
18705
18706
18707/**
18708 @brief Send indication helper function - sends a message over
18709 the bus using the control transport and saves some info
18710 in the CB
18711
18712 @param pWDICtx: pointer to the WLAN DAL context
18713 pSendBuffer: buffer to be sent
18714 usSendSize: size of the buffer to be sent
18715
18716 @see
18717 @return Result of the function call
18718*/
18719WDI_Status
18720WDI_SendIndication
18721(
18722 WDI_ControlBlockType* pWDICtx,
18723 wpt_uint8* pSendBuffer,
18724 wpt_uint32 usSendSize
18725)
18726{
18727 wpt_uint32 uStatus ;
18728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18729
18730 /*-----------------------------------------------------------------------
18731 Call the CTS to send this message over
18732 Note: CTS is reponsible for freeing the message buffer.
18733 -----------------------------------------------------------------------*/
18734 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
18735 (void*)pSendBuffer, usSendSize );
18736
18737 /*Inform Upper MAC about the outcome of the request*/
18738 if ( NULL != pWDICtx->wdiReqStatusCB )
18739 {
18740 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18741 "Send indication status : %d", uStatus);
18742
18743 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
18744 WDI_STATUS_SUCCESS,
18745 pWDICtx->pReqStatusUserData);
18746 }
18747
18748 /*If sending of the message failed - it is considered catastrophic and
18749 indicates an error with the device*/
18750 if ( 0 != uStatus)
18751 {
18752 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18753 "Failed to send indication over the bus - catastrophic failure");
18754
18755 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
18756 return WDI_STATUS_E_FAILURE;
18757 }
18758
18759 return WDI_STATUS_SUCCESS;
18760}/*WDI_SendIndication*/
18761
18762
18763/**
18764 @brief WDI_DetectedDeviceError - called internally by DAL when
18765 it has detected a failure in the device
18766
18767 @param pWDICtx: pointer to the WLAN DAL context
18768 usErrorCode: error code detected by WDI or received
18769 from HAL
18770
18771 @see
18772 @return None
18773*/
18774void
18775WDI_DetectedDeviceError
18776(
18777 WDI_ControlBlockType* pWDICtx,
18778 wpt_uint16 usErrorCode
18779)
18780{
18781 WDI_LowLevelIndType wdiInd;
18782 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18783
18784 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18785 "Device Error detected code: %d - transitioning to stopped state",
18786 usErrorCode);
18787
18788 wpalMutexAcquire(&pWDICtx->wptMutex);
18789
18790 WDI_STATableStop(pWDICtx);
18791
18792 WDI_ResetAssocSessions(pWDICtx);
18793
18794 /*Set the expected state transition to stopped - because the device
18795 experienced a failure*/
18796 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
18797
18798 /*Transition to stopped to fail all incomming requests from this point on*/
18799 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
18800
18801 WDI_ClearPendingRequests(pWDICtx);
18802
18803 /*TO DO: - there should be an attempt to reset the device here*/
18804
18805 wpalMutexRelease(&pWDICtx->wptMutex);
18806
18807 /*------------------------------------------------------------------------
18808 Notify UMAC if a handler is registered
18809 ------------------------------------------------------------------------*/
18810 if (pWDICtx->wdiLowLevelIndCB)
18811 {
18812 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18813 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
18814
18815 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
18816 }
18817}/*WDI_DetectedDeviceError*/
18818
18819/**
18820 @brief This callback is invoked by the wpt when a timer that
18821 we started on send message has expire - this should
18822 never happen - it means device is stuck and cannot
18823 reply - trigger catastrophic failure
18824 @param
18825
18826 pUserData: the callback data of the user (ptr to WDI CB)
18827
18828 @see
18829 @return None
18830*/
18831void
18832WDI_ResponseTimerCB
18833(
18834 void *pUserData
18835)
18836{
18837 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
18838 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18839
18840 if (NULL == pWDICtx )
18841 {
18842 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18843 "%s: Invalid parameters", __FUNCTION__);
18844 WDI_ASSERT(0);
18845 return;
18846 }
18847
18848 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
18849 {
18850
18851 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18852 "Timeout occurred while waiting for %s (%d) message from device "
18853 " - catastrophic failure",
18854 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18855 pWDICtx->wdiExpectedResponse);
18856 /* WDI timeout means Riva is not responding or SMD communication to Riva
18857 * is not happening. The only possible way to recover from this error
18858 * is to initiate SSR from APPS */
18859 wpalRivaSubystemRestart();
18860 }
18861 else
18862 {
18863 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18864 "Timeout occurred but not waiting for any response %d",
18865 pWDICtx->wdiExpectedResponse);
18866 }
18867
18868 return;
18869
18870}/*WDI_ResponseTimerCB*/
18871
18872
18873/**
18874 @brief Process response helper function
18875
18876
18877 @param pWDICtx: pointer to the WLAN DAL context
18878 pEventData: pointer to the event information structure
18879
18880 @see
18881 @return Result of the function call
18882*/
18883WPT_INLINE WDI_Status
18884WDI_ProcessResponse
18885(
18886 WDI_ControlBlockType* pWDICtx,
18887 WDI_EventInfoType* pEventData
18888)
18889{
18890 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18891
18892 /* Skip sanity check as this is called from the FSM functions which
18893 already checked these pointers
18894 ! - revisit this assumption */
18895 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
18896 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
18897 {
18898 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18899 "Calling response processing function for resp %s (%d) %x",
18900 WDI_getRespMsgString(pEventData->wdiResponse),
18901 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
18902 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
18903 }
18904 else
18905 {
18906 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18907 "Operation %d is not yet implemented ",
18908 pEventData->wdiResponse);
18909 return WDI_STATUS_E_NOT_IMPLEMENT;
18910 }
18911}/*WDI_ProcessResponse*/
18912
18913
18914/*=========================================================================
18915 QUEUE SUPPORT UTILITY FUNCTIONS
18916=========================================================================*/
18917
18918/**
18919 @brief Utility function used by the DAL Core to help queue a
18920 request that cannot be processed right away.
18921 @param
18922
18923 pWDICtx: - pointer to the WDI control block
18924 pEventData: - pointer to the evnt info that needs to be
18925 queued
18926
18927 @see
18928 @return Result of the operation
18929*/
18930WDI_Status
18931WDI_QueuePendingReq
18932(
18933 WDI_ControlBlockType* pWDICtx,
18934 WDI_EventInfoType* pEventData
18935)
18936{
18937 wpt_list_node* pNode;
18938 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
18939 void* pEventInfo = NULL;
18940 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18941
18942 if ( NULL == pEventDataQueue )
18943 {
18944 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18945 "Cannot allocate memory for queueing");
18946 WDI_ASSERT(0);
18947 return WDI_STATUS_MEM_FAILURE;
18948 }
18949
18950 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
18951 pEventDataQueue->pUserData = pEventData->pUserData;
18952 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
18953 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
18954 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
18955
18956 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
18957 {
18958 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
18959
18960 if ( NULL == pEventInfo )
18961 {
18962 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18963 "Cannot allocate memory for queueing event data info");
18964 WDI_ASSERT(0);
18965 wpalMemoryFree(pEventDataQueue);
18966 return WDI_STATUS_MEM_FAILURE;
18967 }
18968
18969 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
18970
18971 }
18972 pEventDataQueue->pEventData = pEventInfo;
18973
18974 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
18975 pNode = (wpt_list_node*)pEventDataQueue;
18976
18977 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
18978
18979 return WDI_STATUS_SUCCESS;
18980}/*WDI_QueuePendingReq*/
18981
18982/**
18983 @brief Callback function for serializing queued message
18984 processing in the control context
18985 @param
18986
18987 pMsg - pointer to the message
18988
18989 @see
18990 @return Result of the operation
18991*/
18992void
18993WDI_PALCtrlMsgCB
18994(
18995 wpt_msg *pMsg
18996)
18997{
18998 WDI_EventInfoType* pEventData = NULL;
18999 WDI_ControlBlockType* pWDICtx = NULL;
19000 WDI_Status wdiStatus;
19001 WDI_ReqStatusCb pfnReqStatusCB;
19002 void* pUserData;
19003 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19004
19005 if (( NULL == pMsg )||
19006 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19007 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19008 {
19009 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19010 "Invalid message received on serialize ctrl context API");
19011 WDI_ASSERT(0);
19012 return;
19013 }
19014
19015 /*Transition back to the state that we had before serialization
19016 - serialization transitions us to BUSY to stop any incomming requests
19017 ! TO DO L: possible race condition here if a request comes in between the
19018 state transition and the post function*/
19019
19020 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
19021
19022 /*-----------------------------------------------------------------------
19023 Check to see what type of event we are serializing
19024 - responses are never expected to come through here
19025 -----------------------------------------------------------------------*/
19026 switch ( pEventData->wdiRequest )
19027 {
19028
19029 case WDI_STOP_REQ:
19030
19031 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19032 break;
19033
19034
19035 case WDI_NV_DOWNLOAD_REQ:
19036 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19037 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19038 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19039 {
19040 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19041 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19042 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19043 }
19044 else
19045 {
19046 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19047 }
19048
19049 break;
19050
19051 default:
19052 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19053 break;
19054 }/*switch ( pEventData->wdiRequest )*/
19055
19056 if ( WDI_STATUS_SUCCESS != wdiStatus )
19057 {
19058 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19059
19060 if ( NULL != pfnReqStatusCB )
19061 {
19062 /*Fail the request*/
19063 pfnReqStatusCB( wdiStatus, pUserData);
19064 }
19065 }
19066
19067 /* Free data - that was allocated when queueing*/
19068 if( pEventData != NULL )
19069 {
19070 if( pEventData->pEventData != NULL )
19071 {
19072 wpalMemoryFree(pEventData->pEventData);
19073 }
19074 wpalMemoryFree(pEventData);
19075 }
19076
19077 if( pMsg != NULL )
19078 {
19079 wpalMemoryFree(pMsg);
19080 }
19081
19082}/*WDI_PALCtrlMsgCB*/
19083
19084/**
19085 @brief Utility function used by the DAL Core to help dequeue
19086 and schedule for execution a pending request
19087 @param
19088
19089 pWDICtx: - pointer to the WDI control block
19090 pEventData: - pointer to the evnt info that needs to be
19091 queued
19092
19093 @see
19094 @return Result of the operation
19095*/
19096WDI_Status
19097WDI_DequeuePendingReq
19098(
19099 WDI_ControlBlockType* pWDICtx
19100)
19101{
19102 wpt_list_node* pNode = NULL;
19103 WDI_EventInfoType* pEventData;
19104 wpt_msg* palMsg;
19105 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19106
19107 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
19108
19109 if ( NULL == pNode )
19110 {
19111 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19112 "List is empty - return");
19113 return WDI_STATUS_SUCCESS;
19114 }
19115
19116 /*The node actually points to the 1st element inside the Event Data struct -
19117 just cast it back to the struct*/
19118 pEventData = (WDI_EventInfoType*)pNode;
19119
19120 /*Serialize processing in the control thread
19121 !TO DO: - check to see if these are all the messages params that need
19122 to be filled in*/
19123 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19124
19125 if ( NULL == palMsg )
19126 {
19127 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19128 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
19129 WDI_ASSERT(0);
19130 return WDI_STATUS_MEM_FAILURE;
19131 }
19132 palMsg->pContext = pWDICtx;
19133 palMsg->callback = WDI_PALCtrlMsgCB;
19134 palMsg->ptr = pEventData;
19135
19136 /*Save the global state as we need it on the other side*/
19137 palMsg->val = pWDICtx->uGlobalState;
19138
19139 /*Transition back to BUSY as we need to handle a queued request*/
19140 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
19141
19142 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19143
19144 return WDI_STATUS_PENDING;
19145}/*WDI_DequeuePendingReq*/
19146
19147
19148/**
19149 @brief Utility function used by the DAL Core to help queue
19150 an association request that cannot be processed right
19151 away.- The assoc requests will be queued by BSSID
19152 @param
19153
19154 pWDICtx: - pointer to the WDI control block
19155 pEventData: pointer to the evnt info that needs to be queued
19156 macBSSID: bssid
19157
19158 @see
19159 @return Result of the operation
19160*/
19161WDI_Status
19162WDI_QueueNewAssocRequest
19163(
19164 WDI_ControlBlockType* pWDICtx,
19165 WDI_EventInfoType* pEventData,
19166 wpt_macAddr macBSSID
19167)
19168{
19169 wpt_uint8 i;
19170 WDI_BSSSessionType* pSession = NULL;
19171 wpt_list_node* pNode;
19172 WDI_EventInfoType* pEventDataQueue;
19173 void* pEventInfo;
19174 WDI_NextSessionIdType* pSessionIdElement;
19175 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19176
19177
19178 /*------------------------------------------------------------------------
19179 Search for a session that matches the BSSID
19180 ------------------------------------------------------------------------*/
19181 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19182 {
19183 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19184 {
19185 /*Found an empty session*/
19186 pSession = &pWDICtx->aBSSSessions[i];
19187 break;
19188 }
19189 }
19190
19191 if ( i >= WDI_MAX_BSS_SESSIONS )
19192 {
19193 /*Cannot find any empty sessions*/
19194 return WDI_STATUS_E_FAILURE;
19195 }
19196
19197 /*------------------------------------------------------------------------
19198 Fill in the BSSID for this session and set the usage flag
19199 ------------------------------------------------------------------------*/
19200 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
19201 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
19202
19203 /*------------------------------------------------------------------------
19204 Allocate memory for this and place it in the queue
19205 ------------------------------------------------------------------------*/
19206 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19207 if ( NULL == pEventDataQueue )
19208 {
19209 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19210 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19211 WDI_ASSERT(0);
19212 return WDI_STATUS_MEM_FAILURE;
19213 }
19214
19215 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19216 if ( NULL == pSessionIdElement )
19217 {
19218 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19219 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19220 WDI_ASSERT(0);
19221 wpalMemoryFree(pEventDataQueue);
19222 return WDI_STATUS_MEM_FAILURE;
19223 }
19224
19225 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19226 if ( NULL == pEventInfo )
19227 {
19228 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19229 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19230 WDI_ASSERT(0);
19231 wpalMemoryFree(pSessionIdElement);
19232 wpalMemoryFree(pEventDataQueue);
19233 return WDI_STATUS_MEM_FAILURE;
19234 }
19235
19236 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19237 pEventDataQueue->pUserData = pEventData->pUserData;
19238 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19239 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
19240 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
19241
19242 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19243 pEventDataQueue->pEventData = pEventInfo;
19244
19245 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
19246 pNode = (wpt_list_node*)pEventDataQueue;
19247
19248 /*This association is currently being queued*/
19249 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
19250
19251 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
19252
19253 /*We need to maintain a separate list that keeps track of the order in which
19254 the new assoc requests are being queued such that we can start processing
19255 them in the order that they had arrived*/
19256 pSessionIdElement->ucIndex = i;
19257 pNode = (wpt_list_node*)pSessionIdElement;
19258
19259 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19260 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
19261 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
19262
19263 /*Return pending as this is what the status of the request is since it has
19264 been queued*/
19265 return WDI_STATUS_PENDING;
19266}/*WDI_QueueNewAssocRequest*/
19267
19268/**
19269 @brief Utility function used by the DAL Core to help queue
19270 an association request that cannot be processed right
19271 away.- The assoc requests will be queued by BSSID
19272 @param
19273
19274 pWDICtx: - pointer to the WDI control block
19275 pSession: - session in which to queue
19276 pEventData: pointer to the event info that needs to be
19277 queued
19278
19279 @see
19280 @return Result of the operation
19281*/
19282WDI_Status
19283WDI_QueueAssocRequest
19284(
19285 WDI_ControlBlockType* pWDICtx,
19286 WDI_BSSSessionType* pSession,
19287 WDI_EventInfoType* pEventData
19288)
19289{
19290 wpt_list_node* pNode;
19291 WDI_EventInfoType* pEventDataQueue;
19292 void* pEventInfo;
19293 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19294
19295 /*------------------------------------------------------------------------
19296 Sanity check
19297 ------------------------------------------------------------------------*/
19298 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19299 {
19300 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19301 "%s: Invalid parameters", __FUNCTION__);
19302
19303 return WDI_STATUS_E_FAILURE;
19304 }
19305
19306 /*------------------------------------------------------------------------
19307 Allocate memory for this and place it in the queue
19308 ------------------------------------------------------------------------*/
19309 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19310 if ( NULL == pEventDataQueue )
19311 {
19312 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19313 "%s: Cannot allocate memory for queueing", __FUNCTION__);
19314 WDI_ASSERT(0);
19315 return WDI_STATUS_MEM_FAILURE;
19316 }
19317
19318 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19319 if ( NULL == pEventInfo )
19320 {
19321 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19322 "%s: Cannot allocate memory for queueing event data info",
19323 __FUNCTION__);
19324 WDI_ASSERT(0);
19325 wpalMemoryFree(pEventDataQueue);
19326 return WDI_STATUS_MEM_FAILURE;
19327 }
19328
19329 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19330 pEventDataQueue->pUserData = pEventData->pUserData;
19331 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19332 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
19333 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
19334 pEventDataQueue->pEventData = pEventInfo;
19335
19336 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19337
19338 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
19339 pNode = (wpt_list_node*)pEventDataQueue;
19340
19341 /*This association is currently being queued*/
19342 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
19343
19344 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
19345
19346 /*The result of this operation is pending because the request has been
19347 queued and it will be processed at a later moment in time */
19348 return WDI_STATUS_PENDING;
19349}/*WDI_QueueAssocRequest*/
19350
19351/**
19352 @brief Utility function used by the DAL Core to help dequeue
19353 an association request that was pending
19354 The request will be queued up in front of the main
19355 pending queue for imediate processing
19356 @param
19357
19358 pWDICtx: - pointer to the WDI control block
19359
19360
19361 @see
19362 @return Result of the operation
19363*/
19364WDI_Status
19365WDI_DequeueAssocRequest
19366(
19367 WDI_ControlBlockType* pWDICtx
19368)
19369{
19370 wpt_list_node* pNode = NULL;
19371 WDI_NextSessionIdType* pSessionIdElement;
19372 WDI_BSSSessionType* pSession;
19373 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19374
19375 /*------------------------------------------------------------------------
19376 Sanity check
19377 ------------------------------------------------------------------------*/
19378 if ( NULL == pWDICtx )
19379 {
19380 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19381 "%s: Invalid parameters", __FUNCTION__);
19382
19383 return WDI_STATUS_E_FAILURE;
19384 }
19385
19386 /*------------------------------------------------------------------------
19387 An association has been completed => a new association can occur
19388 Check to see if there are any pending associations ->
19389 If so , transfer all the pending requests into the busy queue for
19390 processing
19391 These requests have arrived prior to the requests in the busy queue
19392 (bc they needed to be processed in order to be placed in this queue)
19393 => they will be placed at the front of the busy queue
19394 ------------------------------------------------------------------------*/
19395 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
19396
19397 if ( NULL == pNode )
19398 {
19399 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19400 "List is empty - return");
19401 return WDI_STATUS_SUCCESS;
19402 }
19403
19404 /*The node actually points to the 1st element inside the Session Id struct -
19405 just cast it back to the struct*/
19406 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
19407
19408 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19409 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19410
19411 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19412 {
19413 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
19414
19415 /*Transfer all the pending requests in this assoc queue to
19416 the front of the main waiting queue for subsequent execution*/
19417 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
19418 while ( NULL != pNode )
19419 {
19420 /*Place it in front of the main pending list*/
19421 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19422 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
19423 }
19424 }
19425 else
19426 {
19427 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
19428 "Invalid session id queued up for assoc");
19429 WPAL_ASSERT(0);
19430 wpalMemoryFree(pSessionIdElement);
19431 return WDI_STATUS_E_FAILURE;
19432 }
19433
19434 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19435 wpalMemoryFree(pSessionIdElement);
19436 return WDI_STATUS_SUCCESS;
19437}/*WDI_DequeueAssocRequest*/
19438
19439/**
19440 @brief Utility function used by the DAL Core to clear any
19441 pending requests - all req cb will be called with
19442 failure and the queue will be emptied.
19443 @param
19444
19445 pWDICtx: - pointer to the WDI control block
19446
19447 @see
19448 @return Result of the operation
19449*/
19450WDI_Status
19451WDI_ClearPendingRequests
19452(
19453 WDI_ControlBlockType* pWDICtx
19454)
19455{
19456 wpt_list_node* pNode = NULL;
19457 WDI_EventInfoType* pEventDataQueue = NULL;
19458 WDI_ReqStatusCb pfnReqStatusCB;
19459 void* pUserData;
19460 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19461
19462 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
19463
19464 /*------------------------------------------------------------------------
19465 Go through all the requests and fail them - this will only be called
19466 when device is being stopped or an error was detected - either case the
19467 pending requests can no longer be sent down to HAL
19468 ------------------------------------------------------------------------*/
19469 while( pNode )
19470 {
19471 /*The node actually points to the 1st element inside the Event Data struct -
19472 just cast it back to the struct*/
19473 pEventDataQueue = (WDI_EventInfoType*)pNode;
19474
19475 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
19476 if ( NULL != pfnReqStatusCB )
19477 {
19478 /*Fail the request*/
19479 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
19480 }
19481 /* Free data - that was allocated when queueing */
19482 if ( pEventDataQueue->pEventData != NULL )
19483 {
19484 wpalMemoryFree(pEventDataQueue->pEventData);
19485 }
19486 wpalMemoryFree(pEventDataQueue);
19487
19488 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
19489 {
19490 break;
19491 }
19492 }
19493
19494 return WDI_STATUS_SUCCESS;
19495}/*WDI_ClearPendingRequests*/
19496
19497/**
19498 @brief Helper routine used to init the BSS Sessions in the WDI control block
19499
19500
19501 @param pWDICtx: pointer to the WLAN DAL context
19502
19503 @see
19504*/
19505void
19506WDI_ResetAssocSessions
19507(
19508 WDI_ControlBlockType* pWDICtx
19509)
19510{
19511 wpt_uint8 i;
19512 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19513
19514 /*-------------------------------------------------------------------------
19515 No Sanity check
19516 -------------------------------------------------------------------------*/
19517 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19518 {
19519 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
19520 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
19521 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
19522 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
19523 }
19524}/*WDI_ResetAssocSessions*/
19525
19526/**
19527 @brief Helper routine used to find a session based on the BSSID
19528
19529
19530 @param pWDICtx: pointer to the WLAN DAL context
19531 macBSSID: BSSID of the session
19532 pSession: pointer to the session (if found)
19533
19534 @see
19535 @return Index of the session in the array
19536*/
19537wpt_uint8
19538WDI_FindAssocSession
19539(
19540 WDI_ControlBlockType* pWDICtx,
19541 wpt_macAddr macBSSID,
19542 WDI_BSSSessionType** ppSession
19543)
19544{
19545 wpt_uint8 i;
19546 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19547
19548 /*-------------------------------------------------------------------------
19549 Sanity check
19550 -------------------------------------------------------------------------*/
19551 if ( NULL == ppSession )
19552 {
19553 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19554 "%s: Invalid parameters", __FUNCTION__);
19555 return WDI_MAX_BSS_SESSIONS;
19556 }
19557
19558 *ppSession = NULL;
19559
19560 /*------------------------------------------------------------------------
19561 Search for a session that matches the BSSID
19562 ------------------------------------------------------------------------*/
19563 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19564 {
19565 if ( eWLAN_PAL_TRUE ==
19566 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
19567 {
19568 /*Found the session*/
19569 *ppSession = &pWDICtx->aBSSSessions[i];
19570 return i;
19571 }
19572 }
19573
19574 return i;
19575}/*WDI_FindAssocSession*/
19576
19577/**
19578 @brief Helper routine used to find a session based on the BSSID
19579
19580
19581 @param pWDICtx: pointer to the WLAN DAL context
19582 ucBSSIdx: BSS Index of the session
19583 ppSession: out pointer to the session (if found)
19584
19585 @see
19586 @return Index of the session in the array
19587*/
19588wpt_uint8
19589WDI_FindAssocSessionByBSSIdx
19590(
19591 WDI_ControlBlockType* pWDICtx,
19592 wpt_uint16 ucBSSIdx,
19593 WDI_BSSSessionType** ppSession
19594)
19595{
19596 wpt_uint8 i;
19597 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19598
19599 /*-------------------------------------------------------------------------
19600 Sanity check
19601 -------------------------------------------------------------------------*/
19602 if ( NULL == ppSession )
19603 {
19604 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19605 "%s: Invalid parameters", __FUNCTION__);
19606 return WDI_MAX_BSS_SESSIONS;
19607 }
19608
19609 *ppSession = NULL;
19610
19611 /*------------------------------------------------------------------------
19612 Search for a session that matches the BSSID
19613 ------------------------------------------------------------------------*/
19614 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19615 {
19616 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
19617 {
19618 /*Found the session*/
19619 *ppSession = &pWDICtx->aBSSSessions[i];
19620 return i;
19621 }
19622 }
19623
19624 return i;
19625}/*WDI_FindAssocSessionByBSSIdx*/
19626
19627/**
19628 @brief Helper routine used to find a session based on the BSSID
19629
19630
19631 @param pWDICtx: pointer to the WLAN DAL context
19632 ucBSSIdx: BSS Index of the session
19633 ppSession: out pointer to the session (if found)
19634
19635 @see
19636 @return Index of the session in the array
19637*/
19638wpt_uint8
19639WDI_FindAssocSessionByIdx
19640(
19641 WDI_ControlBlockType* pWDICtx,
19642 wpt_uint16 usIdx,
19643 WDI_BSSSessionType** ppSession
19644)
19645{
19646 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19647
19648 /*-------------------------------------------------------------------------
19649 Sanity check
19650 -------------------------------------------------------------------------*/
19651 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
19652 {
19653 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19654 "%s: Invalid parameters", __FUNCTION__);
19655 return WDI_MAX_BSS_SESSIONS;
19656 }
19657
19658 /*Found the session*/
19659 *ppSession = &pWDICtx->aBSSSessions[usIdx];
19660
19661 return usIdx;
19662
19663}/*WDI_FindAssocSessionByBSSIdx*/
19664
19665/**
19666 @brief Helper routine used to find an empty session in the WDI
19667 CB
19668
19669
19670 @param pWDICtx: pointer to the WLAN DAL context
19671 pSession: pointer to the session (if found)
19672
19673 @see
19674 @return Index of the session in the array
19675*/
19676wpt_uint8
19677WDI_FindEmptySession
19678(
19679 WDI_ControlBlockType* pWDICtx,
19680 WDI_BSSSessionType** ppSession
19681)
19682{
19683 wpt_uint8 i;
19684 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19685 /*-------------------------------------------------------------------------
19686 Sanity check
19687 -------------------------------------------------------------------------*/
19688 if ( NULL == ppSession )
19689 {
19690 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19691 "%s: Invalid parameters", __FUNCTION__);
19692 return WDI_MAX_BSS_SESSIONS;
19693 }
19694
19695 *ppSession = NULL;
19696
19697 /*------------------------------------------------------------------------
19698 Search for a session that it is not in use
19699 ------------------------------------------------------------------------*/
19700 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19701 {
19702 if ( ! pWDICtx->aBSSSessions[i].bInUse )
19703 {
19704 /*Found a session*/
19705 *ppSession = &pWDICtx->aBSSSessions[i];
19706 return i;
19707 }
19708 }
19709
19710 return i;
19711}/*WDI_FindEmptySession*/
19712
19713
19714/**
19715 @brief Helper routine used to get the total count of active
19716 sessions
19717
19718
19719 @param pWDICtx: pointer to the WLAN DAL context
19720
19721 @see
19722 @return Number of sessions in use
19723*/
19724wpt_uint8
19725WDI_GetActiveSessionsCount
19726(
19727 WDI_ControlBlockType* pWDICtx
19728)
19729{
19730 wpt_uint8 i, ucCount = 0;
19731 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19732
19733 /*------------------------------------------------------------------------
19734 Count all sessions in use
19735 ------------------------------------------------------------------------*/
19736 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19737 {
19738 if ( pWDICtx->aBSSSessions[i].bInUse )
19739 {
19740 ucCount++;
19741 }
19742 }
19743
19744 return ucCount;
19745}/*WDI_GetActiveSessionsCount*/
19746
19747/**
19748 @brief Helper routine used to delete session in the WDI
19749 CB
19750
19751
19752 @param pWDICtx: pointer to the WLAN DAL context
19753 pSession: pointer to the session (if found)
19754
19755 @see
19756 @return Index of the session in the array
19757*/
19758void
19759WDI_DeleteSession
19760(
19761 WDI_ControlBlockType* pWDICtx,
19762 WDI_BSSSessionType* ppSession
19763)
19764{
19765 /*-------------------------------------------------------------------------
19766 Sanity check
19767 -------------------------------------------------------------------------*/
19768 if ( NULL == ppSession )
19769 {
19770 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19771 "%s: Invalid parameters", __FUNCTION__);
19772 return ;
19773 }
19774
19775 /*------------------------------------------------------------------------
19776 Reset the entries int session
19777 ------------------------------------------------------------------------*/
19778 wpal_list_destroy(&ppSession->wptPendingQueue);
19779 wpalMemoryZero(ppSession, sizeof(*ppSession));
19780 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
19781 ppSession->bInUse = eWLAN_PAL_FALSE;
19782 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
19783 wpal_list_init(&ppSession->wptPendingQueue);
19784
19785}/*WDI_DeleteSession*/
19786
19787/**
19788 @brief Utility function to add the broadcast STA to the the STA table.
19789 The bcast STA ID is assigned by HAL and must be valid.
19790 @param
19791
19792 WDI_AddStaParams: - pointer to the WDI Add STA params
19793 usBcastStaIdx: - Broadcast STA index passed by HAL
19794
19795 @see
19796 @return void
19797*/
19798void
19799WDI_AddBcastSTAtoSTATable
19800(
19801 WDI_ControlBlockType* pWDICtx,
19802 WDI_AddStaParams * staParams,
19803 wpt_uint16 usBcastStaIdx
19804)
19805{
19806 WDI_AddStaParams wdiAddSTAParam = {0};
19807 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
19808 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19809
19810 /*---------------------------------------------------------------------
19811 Sanity check
19812 ---------------------------------------------------------------------*/
19813 if ( NULL == staParams )
19814 {
19815 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19816 "%s: Invalid parameters", __FUNCTION__);
19817
19818 return;
19819 }
19820
19821 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
19822 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
19823 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
19824 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
19825 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
19826 wdiAddSTAParam.dpuSig = staParams->dpuSig;
19827 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
19828 WDI_MAC_ADDR_LEN );
19829 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
19830 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
19831 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
19832 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
19833 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
19834 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
19835 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
19836
19837 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
19838}
19839
19840/**
19841 @brief NV blob will be divided into fragments of size 4kb and
19842 Sent to HAL
19843
19844 @param pWDICtx: pointer to the WLAN DAL context
19845 pEventData: pointer to the event information structure
19846
19847 @see
19848 @return Result of the function call
19849 */
19850
19851WDI_Status WDI_SendNvBlobReq
19852(
19853 WDI_ControlBlockType* pWDICtx,
19854 WDI_EventInfoType* pEventData
19855)
19856{
19857
19858 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
19859 wpt_uint8* pSendBuffer = NULL;
19860 wpt_uint16 usDataOffset = 0;
19861 wpt_uint16 usSendSize = 0;
19862 wpt_uint16 usCurrentFragmentSize =0;
19863 wpt_uint8* pSrcBuffer = NULL;
19864 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
19865 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
19866
19867 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
19868 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
19869 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
19870
19871 /* Sanity Check is done by the caller */
19872 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
19873
19874 /* Update the current Fragment Number */
19875 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
19876
19877 /*Update the HAL REQ structure */
19878 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
19879 halNvImgDownloadParam.nvImageReqParams.fragNumber =
19880 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
19881
19882 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
19883 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
19884 image will be sent to HAL*/
19885
19886 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
19887 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
19888 {
19889 /* Taking care of boundry condition */
19890 if( !(usCurrentFragmentSize =
19891 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
19892 usCurrentFragmentSize = FRAGMENT_SIZE;
19893
19894 /*Update the HAL REQ structure */
19895 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
19896 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
19897
19898 }
19899 else
19900 {
19901 usCurrentFragmentSize = FRAGMENT_SIZE;
19902
19903 /*Update the HAL REQ structure */
19904 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
19905 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
19906 }
19907
19908 /*-----------------------------------------------------------------------
19909 Get message buffer
19910 -----------------------------------------------------------------------*/
19911 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
19912 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
19913 &pSendBuffer, &usDataOffset, &usSendSize))||
19914 ( usSendSize <
19915 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
19916 {
19917 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19918 "Unable to get send buffer in NV Download req %x %x ",
19919 pEventData, pwdiNvDownloadReqParams);
19920 WDI_ASSERT(0);
19921 return WDI_STATUS_E_FAILURE;
19922 }
19923
19924 /* Copying the Hal NV download REQ structure */
19925 wpalMemoryCopy(pSendBuffer + usDataOffset ,
19926 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
19927
19928 /* Appending the NV image fragment */
19929 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
19930 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
19931 usCurrentFragmentSize);
19932
19933 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
19934 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
19935
19936 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
19937 wdiNvDownloadRspCb, pEventData->pUserData,
19938 WDI_NV_DOWNLOAD_RESP);
19939
19940}
19941/*============================================================================
19942 Helper inline functions for
19943 ============================================================================*/
19944/**
19945 @brief Helper routine used to find a session based on the BSSID
19946 @param pContext: pointer to the WLAN DAL context
19947 @param pDPContext: pointer to the Datapath context
19948
19949 @see
19950 @return
19951*/
19952WPT_INLINE void
19953WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
19954{
19955 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19956
19957 pCB->pDPContext = pDPContext;
19958 return;
19959}
19960
19961/**
19962 @brief Helper routine used to find a session based on the BSSID
19963
19964
19965 @param pContext: pointer to the WLAN DAL context
19966
19967 @see
19968 @return pointer to Datapath context
19969*/
19970WPT_INLINE void *
19971WDI_DS_GetDatapathContext (void *pContext)
19972{
19973 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19974 return pCB->pDPContext;
19975}
19976/**
19977 @brief Helper routine used to find a session based on the BSSID
19978
19979
19980 @param pContext: pointer to the WLAN DAL context
19981 @param pDTDriverContext: pointer to the Transport Driver context
19982
19983 @see
19984 @return void
19985*/
19986WPT_INLINE void
19987WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
19988{
19989 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
19990
19991 pCB->pDTDriverContext = pDTDriverContext;
19992 return;
19993}
19994
19995/**
19996 @brief Helper routine used to find a session based on the BSSID
19997
19998
19999 @param pWDICtx: pointer to the WLAN DAL context
20000
20001 @see
20002 @return pointer to datapath context
20003*/
20004WPT_INLINE void *
20005WDT_GetTransportDriverContext (void *pContext)
20006{
20007 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20008 return(pCB->pDTDriverContext);
20009}
20010
20011/*============================================================================
20012 Helper inline converters
20013 ============================================================================*/
20014/*Convert WDI driver type into HAL driver type*/
20015WPT_STATIC WPT_INLINE WDI_Status
20016WDI_HAL_2_WDI_STATUS
20017(
20018 eHalStatus halStatus
20019)
20020{
20021 /*Lightweight function - no sanity checks and no unecessary code to increase
20022 the chances of getting inlined*/
20023 switch( halStatus )
20024 {
20025 case eHAL_STATUS_SUCCESS:
20026 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20027 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20028 return WDI_STATUS_SUCCESS;
20029 case eHAL_STATUS_FAILURE:
20030 return WDI_STATUS_E_FAILURE;
20031 case eHAL_STATUS_FAILED_ALLOC:
20032 return WDI_STATUS_MEM_FAILURE;
20033 /*The rest of the HAL error codes must be kept hidden from the UMAC as
20034 they refer to specific internal modules of our device*/
20035 default:
20036 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20037 }
20038
20039 return WDI_STATUS_E_FAILURE;
20040}/*WDI_HAL_2_WDI_STATUS*/
20041
20042/*Convert WDI request type into HAL request type*/
20043WPT_STATIC WPT_INLINE tHalHostMsgType
20044WDI_2_HAL_REQ_TYPE
20045(
20046 WDI_RequestEnumType wdiReqType
20047)
20048{
20049 /*Lightweight function - no sanity checks and no unecessary code to increase
20050 the chances of getting inlined*/
20051 switch( wdiReqType )
20052 {
20053 case WDI_START_REQ:
20054 return WLAN_HAL_START_REQ;
20055 case WDI_STOP_REQ:
20056 return WLAN_HAL_STOP_REQ;
20057 case WDI_INIT_SCAN_REQ:
20058 return WLAN_HAL_INIT_SCAN_REQ;
20059 case WDI_START_SCAN_REQ:
20060 return WLAN_HAL_START_SCAN_REQ;
20061 case WDI_END_SCAN_REQ:
20062 return WLAN_HAL_END_SCAN_REQ;
20063 case WDI_FINISH_SCAN_REQ:
20064 return WLAN_HAL_FINISH_SCAN_REQ;
20065 case WDI_JOIN_REQ:
20066 return WLAN_HAL_JOIN_REQ;
20067 case WDI_CONFIG_BSS_REQ:
20068 return WLAN_HAL_CONFIG_BSS_REQ;
20069 case WDI_DEL_BSS_REQ:
20070 return WLAN_HAL_DELETE_BSS_REQ;
20071 case WDI_POST_ASSOC_REQ:
20072 return WLAN_HAL_POST_ASSOC_REQ;
20073 case WDI_DEL_STA_REQ:
20074 return WLAN_HAL_DELETE_STA_REQ;
20075 case WDI_SET_BSS_KEY_REQ:
20076 return WLAN_HAL_SET_BSSKEY_REQ;
20077 case WDI_RMV_BSS_KEY_REQ:
20078 return WLAN_HAL_RMV_BSSKEY_REQ;
20079 case WDI_SET_STA_KEY_REQ:
20080 return WLAN_HAL_SET_STAKEY_REQ;
20081 case WDI_RMV_STA_KEY_REQ:
20082 return WLAN_HAL_RMV_STAKEY_REQ;
20083 case WDI_SET_STA_BCAST_KEY_REQ:
20084 return WLAN_HAL_SET_BCASTKEY_REQ;
20085 case WDI_RMV_STA_BCAST_KEY_REQ:
20086 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
20087 return WLAN_HAL_RMV_STAKEY_REQ;
20088 case WDI_ADD_TS_REQ:
20089 return WLAN_HAL_ADD_TS_REQ;
20090 case WDI_DEL_TS_REQ:
20091 return WLAN_HAL_DEL_TS_REQ;
20092 case WDI_UPD_EDCA_PRMS_REQ:
20093 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
20094 case WDI_ADD_BA_REQ:
20095 return WLAN_HAL_ADD_BA_REQ;
20096 case WDI_DEL_BA_REQ:
20097 return WLAN_HAL_DEL_BA_REQ;
20098#ifdef FEATURE_WLAN_CCX
20099 case WDI_TSM_STATS_REQ:
20100 return WLAN_HAL_TSM_STATS_REQ;
20101#endif
20102 case WDI_CH_SWITCH_REQ:
20103 return WLAN_HAL_CH_SWITCH_REQ;
20104 case WDI_CONFIG_STA_REQ:
20105 return WLAN_HAL_CONFIG_STA_REQ;
20106 case WDI_SET_LINK_ST_REQ:
20107 return WLAN_HAL_SET_LINK_ST_REQ;
20108 case WDI_GET_STATS_REQ:
20109 return WLAN_HAL_GET_STATS_REQ;
20110 case WDI_UPDATE_CFG_REQ:
20111 return WLAN_HAL_UPDATE_CFG_REQ;
20112 case WDI_ADD_BA_SESSION_REQ:
20113 return WLAN_HAL_ADD_BA_SESSION_REQ;
20114 case WDI_TRIGGER_BA_REQ:
20115 return WLAN_HAL_TRIGGER_BA_REQ;
20116 case WDI_UPD_BCON_PRMS_REQ:
20117 return WLAN_HAL_UPDATE_BEACON_REQ;
20118 case WDI_SND_BCON_REQ:
20119 return WLAN_HAL_SEND_BEACON_REQ;
20120 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20121 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20122 case WDI_SET_MAX_TX_POWER_REQ:
20123 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20124#ifdef WLAN_FEATURE_P2P
20125 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20126 return WLAN_HAL_SET_P2P_GONOA_REQ;
20127#endif
20128 case WDI_ENTER_IMPS_REQ:
20129 return WLAN_HAL_ENTER_IMPS_REQ;
20130 case WDI_EXIT_IMPS_REQ:
20131 return WLAN_HAL_EXIT_IMPS_REQ;
20132 case WDI_ENTER_BMPS_REQ:
20133 return WLAN_HAL_ENTER_BMPS_REQ;
20134 case WDI_EXIT_BMPS_REQ:
20135 return WLAN_HAL_EXIT_BMPS_REQ;
20136 case WDI_ENTER_UAPSD_REQ:
20137 return WLAN_HAL_ENTER_UAPSD_REQ;
20138 case WDI_EXIT_UAPSD_REQ:
20139 return WLAN_HAL_EXIT_UAPSD_REQ;
20140 case WDI_SET_UAPSD_PARAM_REQ:
20141 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
20142 case WDI_UPDATE_UAPSD_PARAM_REQ:
20143 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
20144 case WDI_CONFIGURE_RXP_FILTER_REQ:
20145 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
20146 case WDI_SET_BEACON_FILTER_REQ:
20147 return WLAN_HAL_ADD_BCN_FILTER_REQ;
20148 case WDI_REM_BEACON_FILTER_REQ:
20149 return WLAN_HAL_REM_BCN_FILTER_REQ;
20150 case WDI_SET_RSSI_THRESHOLDS_REQ:
20151 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20152 case WDI_HOST_OFFLOAD_REQ:
20153 return WLAN_HAL_HOST_OFFLOAD_REQ;
20154 case WDI_WOWL_ADD_BC_PTRN_REQ:
20155 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20156 case WDI_WOWL_DEL_BC_PTRN_REQ:
20157 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20158 case WDI_WOWL_ENTER_REQ:
20159 return WLAN_HAL_ENTER_WOWL_REQ;
20160 case WDI_WOWL_EXIT_REQ:
20161 return WLAN_HAL_EXIT_WOWL_REQ;
20162 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20163 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20164 case WDI_NV_DOWNLOAD_REQ:
20165 return WLAN_HAL_DOWNLOAD_NV_REQ;
20166 case WDI_FLUSH_AC_REQ:
20167 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20168 case WDI_BTAMP_EVENT_REQ:
20169 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20170#ifdef WLAN_FEATURE_VOWIFI_11R
20171 case WDI_AGGR_ADD_TS_REQ:
20172 return WLAN_HAL_AGGR_ADD_TS_REQ;
20173#endif /* WLAN_FEATURE_VOWIFI_11R */
20174#ifdef ANI_MANF_DIAG
20175 case WDI_FTM_CMD_REQ:
20176 return WLAN_HAL_PROCESS_PTT_REQ;
20177#endif /* ANI_MANF_DIAG */
20178 case WDI_ADD_STA_SELF_REQ:
20179 return WLAN_HAL_ADD_STA_SELF_REQ;
20180 case WDI_DEL_STA_SELF_REQ:
20181 return WLAN_HAL_DEL_STA_SELF_REQ;
20182 case WDI_HOST_RESUME_REQ:
20183 return WLAN_HAL_HOST_RESUME_REQ;
20184 case WDI_HOST_SUSPEND_IND:
20185 return WLAN_HAL_HOST_SUSPEND_IND;
20186 case WDI_KEEP_ALIVE_REQ:
20187 return WLAN_HAL_KEEP_ALIVE_REQ;
20188
20189#ifdef FEATURE_WLAN_SCAN_PNO
20190 case WDI_SET_PREF_NETWORK_REQ:
20191 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20192 case WDI_SET_RSSI_FILTER_REQ:
20193 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20194 case WDI_UPDATE_SCAN_PARAMS_REQ:
20195 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20196#endif // FEATURE_WLAN_SCAN_PNO
20197 case WDI_SET_TX_PER_TRACKING_REQ:
20198 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20199#ifdef WLAN_FEATURE_PACKET_FILTERING
20200 case WDI_8023_MULTICAST_LIST_REQ:
20201 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20202 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
20203 return WLAN_HAL_SET_PACKET_FILTER_REQ;
20204 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20205 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20206 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20207 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20208#endif // WLAN_FEATURE_PACKET_FILTERING
20209 case WDI_HAL_DUMP_CMD_REQ:
20210 return WLAN_HAL_DUMP_COMMAND_REQ;
20211#ifdef WLAN_FEATURE_GTK_OFFLOAD
20212 case WDI_GTK_OFFLOAD_REQ:
20213 return WLAN_HAL_GTK_OFFLOAD_REQ;
20214 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20215 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20216#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20217
20218 case WDI_INIT_SCAN_CON_REQ:
20219 return WLAN_HAL_INIT_SCAN_CON_REQ;
20220 case WDI_SET_POWER_PARAMS_REQ:
20221 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20222 case WDI_SET_TM_LEVEL_REQ:
20223 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20224 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20225 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
20226 default:
20227 return WLAN_HAL_MSG_MAX;
20228 }
20229
20230}/*WDI_2_HAL_REQ_TYPE*/
20231
20232/*Convert WDI response type into HAL response type*/
20233WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20234HAL_2_WDI_RSP_TYPE
20235(
20236 tHalHostMsgType halMsg
20237)
20238{
20239 /*Lightweight function - no sanity checks and no unecessary code to increase
20240 the chances of getting inlined*/
20241 switch( halMsg )
20242 {
20243 case WLAN_HAL_START_RSP:
20244 return WDI_START_RESP;
20245 case WLAN_HAL_STOP_RSP:
20246 return WDI_STOP_RESP;
20247 case WLAN_HAL_INIT_SCAN_RSP:
20248 return WDI_INIT_SCAN_RESP;
20249 case WLAN_HAL_START_SCAN_RSP:
20250 return WDI_START_SCAN_RESP;
20251 case WLAN_HAL_END_SCAN_RSP:
20252 return WDI_END_SCAN_RESP;
20253 case WLAN_HAL_FINISH_SCAN_RSP:
20254 return WDI_FINISH_SCAN_RESP;
20255 case WLAN_HAL_CONFIG_STA_RSP:
20256 return WDI_CONFIG_STA_RESP;
20257 case WLAN_HAL_DELETE_STA_RSP:
20258 return WDI_DEL_STA_RESP;
20259 case WLAN_HAL_CONFIG_BSS_RSP:
20260 return WDI_CONFIG_BSS_RESP;
20261 case WLAN_HAL_DELETE_BSS_RSP:
20262 return WDI_DEL_BSS_RESP;
20263 case WLAN_HAL_JOIN_RSP:
20264 return WDI_JOIN_RESP;
20265 case WLAN_HAL_POST_ASSOC_RSP:
20266 return WDI_POST_ASSOC_RESP;
20267 case WLAN_HAL_SET_BSSKEY_RSP:
20268 return WDI_SET_BSS_KEY_RESP;
20269 case WLAN_HAL_SET_STAKEY_RSP:
20270 return WDI_SET_STA_KEY_RESP;
20271 case WLAN_HAL_RMV_BSSKEY_RSP:
20272 return WDI_RMV_BSS_KEY_RESP;
20273 case WLAN_HAL_RMV_STAKEY_RSP:
20274 return WDI_RMV_STA_KEY_RESP;
20275 case WLAN_HAL_SET_BCASTKEY_RSP:
20276 return WDI_SET_STA_BCAST_KEY_RESP;
20277 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20278 // return WDI_RMV_STA_BCAST_KEY_RESP;
20279 case WLAN_HAL_ADD_TS_RSP:
20280 return WDI_ADD_TS_RESP;
20281 case WLAN_HAL_DEL_TS_RSP:
20282 return WDI_DEL_TS_RESP;
20283 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20284 return WDI_UPD_EDCA_PRMS_RESP;
20285 case WLAN_HAL_ADD_BA_RSP:
20286 return WDI_ADD_BA_RESP;
20287 case WLAN_HAL_DEL_BA_RSP:
20288 return WDI_DEL_BA_RESP;
20289#ifdef FEATURE_WLAN_CCX
20290 case WLAN_HAL_TSM_STATS_RSP:
20291 return WDI_TSM_STATS_RESP;
20292#endif
20293 case WLAN_HAL_CH_SWITCH_RSP:
20294 return WDI_CH_SWITCH_RESP;
20295 case WLAN_HAL_SET_LINK_ST_RSP:
20296 return WDI_SET_LINK_ST_RESP;
20297 case WLAN_HAL_GET_STATS_RSP:
20298 return WDI_GET_STATS_RESP;
20299 case WLAN_HAL_UPDATE_CFG_RSP:
20300 return WDI_UPDATE_CFG_RESP;
20301 case WLAN_HAL_ADD_BA_SESSION_RSP:
20302 return WDI_ADD_BA_SESSION_RESP;
20303 case WLAN_HAL_TRIGGER_BA_RSP:
20304 return WDI_TRIGGER_BA_RESP;
20305 case WLAN_HAL_UPDATE_BEACON_RSP:
20306 return WDI_UPD_BCON_PRMS_RESP;
20307 case WLAN_HAL_SEND_BEACON_RSP:
20308 return WDI_SND_BCON_RESP;
20309 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20310 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20311 /*Indications*/
20312 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20313 return WDI_HAL_RSSI_NOTIFICATION_IND;
20314 case WLAN_HAL_MISSED_BEACON_IND:
20315 return WDI_HAL_MISSED_BEACON_IND;
20316 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20317 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20318 case WLAN_HAL_MIC_FAILURE_IND:
20319 return WDI_HAL_MIC_FAILURE_IND;
20320 case WLAN_HAL_FATAL_ERROR_IND:
20321 return WDI_HAL_FATAL_ERROR_IND;
20322 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20323 return WDI_HAL_DEL_STA_IND;
20324 case WLAN_HAL_COEX_IND:
20325 return WDI_HAL_COEX_IND;
20326 case WLAN_HAL_OTA_TX_COMPL_IND:
20327 return WDI_HAL_TX_COMPLETE_IND;
20328#ifdef WLAN_FEATURE_P2P
20329 case WLAN_HAL_P2P_NOA_ATTR_IND:
20330 return WDI_HAL_P2P_NOA_ATTR_IND;
20331#endif
20332 case WLAN_HAL_TX_PER_HIT_IND:
20333 return WDI_HAL_TX_PER_HIT_IND;
20334 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20335 return WDI_SET_MAX_TX_POWER_RESP;
20336#ifdef WLAN_FEATURE_P2P
20337 case WLAN_HAL_SET_P2P_GONOA_RSP:
20338 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20339#endif
20340 case WLAN_HAL_ENTER_IMPS_RSP:
20341 return WDI_ENTER_IMPS_RESP;
20342 case WLAN_HAL_EXIT_IMPS_RSP:
20343 return WDI_EXIT_IMPS_RESP;
20344 case WLAN_HAL_ENTER_BMPS_RSP:
20345 return WDI_ENTER_BMPS_RESP;
20346 case WLAN_HAL_EXIT_BMPS_RSP:
20347 return WDI_EXIT_BMPS_RESP;
20348 case WLAN_HAL_ENTER_UAPSD_RSP:
20349 return WDI_ENTER_UAPSD_RESP;
20350 case WLAN_HAL_EXIT_UAPSD_RSP:
20351 return WDI_EXIT_UAPSD_RESP;
20352 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
20353 return WDI_SET_UAPSD_PARAM_RESP;
20354 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
20355 return WDI_UPDATE_UAPSD_PARAM_RESP;
20356 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
20357 return WDI_CONFIGURE_RXP_FILTER_RESP;
20358 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20359 return WDI_SET_BEACON_FILTER_RESP;
20360 case WLAN_HAL_REM_BCN_FILTER_RSP:
20361 return WDI_REM_BEACON_FILTER_RESP;
20362 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20363 return WDI_SET_RSSI_THRESHOLDS_RESP;
20364 case WLAN_HAL_HOST_OFFLOAD_RSP:
20365 return WDI_HOST_OFFLOAD_RESP;
20366 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20367 return WDI_WOWL_ADD_BC_PTRN_RESP;
20368 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20369 return WDI_WOWL_DEL_BC_PTRN_RESP;
20370 case WLAN_HAL_ENTER_WOWL_RSP:
20371 return WDI_WOWL_ENTER_RESP;
20372 case WLAN_HAL_EXIT_WOWL_RSP:
20373 return WDI_WOWL_EXIT_RESP;
20374 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20375 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20376 case WLAN_HAL_DOWNLOAD_NV_RSP:
20377 return WDI_NV_DOWNLOAD_RESP;
20378 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20379 return WDI_FLUSH_AC_RESP;
20380 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20381 return WDI_BTAMP_EVENT_RESP;
20382#ifdef ANI_MANF_DIAG
20383 case WLAN_HAL_PROCESS_PTT_RSP:
20384 return WDI_FTM_CMD_RESP;
20385#endif /* ANI_MANF_DIAG */
20386 case WLAN_HAL_ADD_STA_SELF_RSP:
20387 return WDI_ADD_STA_SELF_RESP;
20388case WLAN_HAL_DEL_STA_SELF_RSP:
20389 return WDI_DEL_STA_SELF_RESP;
20390 case WLAN_HAL_HOST_RESUME_RSP:
20391 return WDI_HOST_RESUME_RESP;
20392 case WLAN_HAL_KEEP_ALIVE_RSP:
20393 return WDI_KEEP_ALIVE_RESP;
20394#ifdef FEATURE_WLAN_SCAN_PNO
20395 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20396 return WDI_SET_PREF_NETWORK_RESP;
20397 case WLAN_HAL_SET_RSSI_FILTER_RSP:
20398 return WDI_SET_RSSI_FILTER_RESP;
20399 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20400 return WDI_UPDATE_SCAN_PARAMS_RESP;
20401 case WLAN_HAL_PREF_NETW_FOUND_IND:
20402 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20403#endif // FEATURE_WLAN_SCAN_PNO
20404 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20405 return WDI_SET_TX_PER_TRACKING_RESP;
20406#ifdef WLAN_FEATURE_PACKET_FILTERING
20407 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20408 return WDI_8023_MULTICAST_LIST_RESP;
20409 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20410 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20411 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20412 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20413 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20414 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20415#endif // WLAN_FEATURE_PACKET_FILTERING
20416
20417 case WLAN_HAL_DUMP_COMMAND_RSP:
20418 return WDI_HAL_DUMP_CMD_RESP;
20419 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20420 return WDI_SET_POWER_PARAMS_RESP;
20421#ifdef WLAN_FEATURE_VOWIFI_11R
20422 case WLAN_HAL_AGGR_ADD_TS_RSP:
20423 return WDI_AGGR_ADD_TS_RESP;
20424#endif
20425
20426#ifdef WLAN_FEATURE_GTK_OFFLOAD
20427 case WLAN_HAL_GTK_OFFLOAD_RSP:
20428 return WDI_GTK_OFFLOAD_RESP;
20429 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20430 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20431#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20432#ifdef WLAN_WAKEUP_EVENTS
20433 case WLAN_HAL_WAKE_REASON_IND:
20434 return WDI_HAL_WAKE_REASON_IND;
20435#endif // WLAN_WAKEUP_EVENTS
20436
20437 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20438 return WDI_SET_TM_LEVEL_RESP;
20439 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20440 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
20441 default:
20442 return eDRIVER_TYPE_MAX;
20443 }
20444
20445}/*HAL_2_WDI_RSP_TYPE*/
20446
20447
20448/*Convert WDI driver type into HAL driver type*/
20449WPT_STATIC WPT_INLINE tDriverType
20450WDI_2_HAL_DRV_TYPE
20451(
20452 WDI_DriverType wdiDriverType
20453)
20454{
20455 /*Lightweight function - no sanity checks and no unecessary code to increase
20456 the chances of getting inlined*/
20457 switch( wdiDriverType )
20458 {
20459 case WDI_DRIVER_TYPE_PRODUCTION:
20460 return eDRIVER_TYPE_PRODUCTION;
20461 case WDI_DRIVER_TYPE_MFG:
20462 return eDRIVER_TYPE_MFG;
20463 case WDI_DRIVER_TYPE_DVT:
20464 return eDRIVER_TYPE_DVT;
20465 }
20466
20467 return eDRIVER_TYPE_MAX;
20468}/*WDI_2_HAL_DRV_TYPE*/
20469
20470
20471/*Convert WDI stop reason into HAL stop reason*/
20472WPT_STATIC WPT_INLINE tHalStopType
20473WDI_2_HAL_STOP_REASON
20474(
20475 WDI_StopType wdiDriverType
20476)
20477{
20478 /*Lightweight function - no sanity checks and no unecessary code to increase
20479 the chances of getting inlined*/
20480 switch( wdiDriverType )
20481 {
20482 case WDI_STOP_TYPE_SYS_RESET:
20483 return HAL_STOP_TYPE_SYS_RESET;
20484 case WDI_DRIVER_TYPE_MFG:
20485 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
20486 case WDI_STOP_TYPE_RF_KILL:
20487 return HAL_STOP_TYPE_RF_KILL;
20488 }
20489
20490 return HAL_STOP_TYPE_MAX;
20491}/*WDI_2_HAL_STOP_REASON*/
20492
20493
20494/*Convert WDI scan mode type into HAL scan mode type*/
20495WPT_STATIC WPT_INLINE eHalSysMode
20496WDI_2_HAL_SCAN_MODE
20497(
20498 WDI_ScanMode wdiScanMode
20499)
20500{
20501 /*Lightweight function - no sanity checks and no unecessary code to increase
20502 the chances of getting inlined*/
20503 switch( wdiScanMode )
20504 {
20505 case WDI_SCAN_MODE_NORMAL:
20506 return eHAL_SYS_MODE_NORMAL;
20507 case WDI_SCAN_MODE_LEARN:
20508 return eHAL_SYS_MODE_LEARN;
20509 case WDI_SCAN_MODE_SCAN:
20510 return eHAL_SYS_MODE_SCAN;
20511 case WDI_SCAN_MODE_PROMISC:
20512 return eHAL_SYS_MODE_PROMISC;
20513 case WDI_SCAN_MODE_SUSPEND_LINK:
20514 return eHAL_SYS_MODE_SUSPEND_LINK;
20515 }
20516
20517 return eHAL_SYS_MODE_MAX;
20518}/*WDI_2_HAL_SCAN_MODE*/
20519
20520/*Convert WDI sec ch offset into HAL sec ch offset type*/
20521WPT_STATIC WPT_INLINE tSirMacHTSecondaryChannelOffset
20522WDI_2_HAL_SEC_CH_OFFSET
20523(
20524 WDI_HTSecondaryChannelOffset wdiSecChOffset
20525)
20526{
20527 /*Lightweight function - no sanity checks and no unecessary code to increase
20528 the chances of getting inlined*/
20529 switch( wdiSecChOffset )
20530 {
20531 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
20532 return eHT_SECONDARY_CHANNEL_OFFSET_NONE;
20533 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
20534 return eHT_SECONDARY_CHANNEL_OFFSET_UP;
20535 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
20536 return eHT_SECONDARY_CHANNEL_OFFSET_DOWN;
20537 }
20538
20539 return eHT_SECONDARY_CHANNEL_OFFSET_MAX;
20540}/*WDI_2_HAL_SEC_CH_OFFSET*/
20541
20542/*Convert WDI BSS type into HAL BSS type*/
20543WPT_STATIC WPT_INLINE tSirBssType
20544WDI_2_HAL_BSS_TYPE
20545(
20546 WDI_BssType wdiBSSType
20547)
20548{
20549 /*Lightweight function - no sanity checks and no unecessary code to increase
20550 the chances of getting inlined*/
20551 switch( wdiBSSType )
20552 {
20553 case WDI_INFRASTRUCTURE_MODE:
20554 return eSIR_INFRASTRUCTURE_MODE;
20555 case WDI_INFRA_AP_MODE:
20556 return eSIR_INFRA_AP_MODE;
20557 case WDI_IBSS_MODE:
20558 return eSIR_IBSS_MODE;
20559 case WDI_BTAMP_STA_MODE:
20560 return eSIR_BTAMP_STA_MODE;
20561 case WDI_BTAMP_AP_MODE:
20562 return eSIR_BTAMP_AP_MODE;
20563 case WDI_BSS_AUTO_MODE:
20564 return eSIR_AUTO_MODE;
20565 }
20566
20567 return eSIR_DONOT_USE_BSS_TYPE;
20568}/*WDI_2_HAL_BSS_TYPE*/
20569
20570/*Convert WDI NW type into HAL NW type*/
20571WPT_STATIC WPT_INLINE tSirNwType
20572WDI_2_HAL_NW_TYPE
20573(
20574 WDI_NwType wdiNWType
20575)
20576{
20577 /*Lightweight function - no sanity checks and no unecessary code to increase
20578 the chances of getting inlined*/
20579 switch( wdiNWType )
20580 {
20581 case WDI_11A_NW_TYPE:
20582 return eSIR_11A_NW_TYPE;
20583 case WDI_11B_NW_TYPE:
20584 return eSIR_11B_NW_TYPE;
20585 case WDI_11G_NW_TYPE:
20586 return eSIR_11G_NW_TYPE;
20587 case WDI_11N_NW_TYPE:
20588 return eSIR_11N_NW_TYPE;
20589 }
20590
20591 return eSIR_DONOT_USE_NW_TYPE;
20592}/*WDI_2_HAL_NW_TYPE*/
20593
20594/*Convert WDI chanel bonding type into HAL cb type*/
20595WPT_STATIC WPT_INLINE ePhyChanBondState
20596WDI_2_HAL_CB_STATE
20597(
20598 WDI_PhyChanBondState wdiCbState
20599)
20600{
20601 /*Lightweight function - no sanity checks and no unecessary code to increase
20602 the chances of getting inlined*/
20603 switch ( wdiCbState )
20604 {
20605 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
20606 return PHY_SINGLE_CHANNEL_CENTERED;
20607 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
20608 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
20609 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
20610 return PHY_DOUBLE_CHANNEL_CENTERED;
20611 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
20612 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
20613 }
20614
20615 return PHY_CHANNEL_BONDING_STATE_MAX;
20616}/*WDI_2_HAL_CB_STATE*/
20617
20618/*Convert WDI chanel bonding type into HAL cb type*/
20619WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
20620WDI_2_HAL_HT_OPER_MODE
20621(
20622 WDI_HTOperatingMode wdiHTOperMode
20623)
20624{
20625 /*Lightweight function - no sanity checks and no unecessary code to increase
20626 the chances of getting inlined*/
20627 switch ( wdiHTOperMode )
20628 {
20629 case WDI_HT_OP_MODE_PURE:
20630 return eSIR_HT_OP_MODE_PURE;
20631 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
20632 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
20633 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
20634 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
20635 case WDI_HT_OP_MODE_MIXED:
20636 return eSIR_HT_OP_MODE_MIXED;
20637 }
20638
20639 return eSIR_HT_OP_MODE_MAX;
20640}/*WDI_2_HAL_HT_OPER_MODE*/
20641
20642/*Convert WDI mimo PS type into HAL mimo PS type*/
20643WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
20644WDI_2_HAL_MIMO_PS
20645(
20646 WDI_HTMIMOPowerSaveState wdiHTOperMode
20647)
20648{
20649 /*Lightweight function - no sanity checks and no unecessary code to increase
20650 the chances of getting inlined*/
20651 switch ( wdiHTOperMode )
20652 {
20653 case WDI_HT_MIMO_PS_STATIC:
20654 return eSIR_HT_MIMO_PS_STATIC;
20655 case WDI_HT_MIMO_PS_DYNAMIC:
20656 return eSIR_HT_MIMO_PS_DYNAMIC;
20657 case WDI_HT_MIMO_PS_NA:
20658 return eSIR_HT_MIMO_PS_NA;
20659 case WDI_HT_MIMO_PS_NO_LIMIT:
20660 return eSIR_HT_MIMO_PS_NO_LIMIT;
20661 }
20662
20663 return eSIR_HT_MIMO_PS_MAX;
20664}/*WDI_2_HAL_MIMO_PS*/
20665
20666/*Convert WDI ENC type into HAL ENC type*/
20667WPT_STATIC WPT_INLINE tAniEdType
20668WDI_2_HAL_ENC_TYPE
20669(
20670 WDI_EncryptType wdiEncType
20671)
20672{
20673 /*Lightweight function - no sanity checks and no unecessary code to increase
20674 the chances of getting inlined*/
20675 switch ( wdiEncType )
20676 {
20677 case WDI_ENCR_NONE:
20678 return eSIR_ED_NONE;
20679
20680 case WDI_ENCR_WEP40:
20681 return eSIR_ED_WEP40;
20682
20683 case WDI_ENCR_WEP104:
20684 return eSIR_ED_WEP104;
20685
20686 case WDI_ENCR_TKIP:
20687 return eSIR_ED_TKIP;
20688
20689 case WDI_ENCR_CCMP:
20690 return eSIR_ED_CCMP;
20691
20692 case WDI_ENCR_AES_128_CMAC:
20693 return eSIR_ED_AES_128_CMAC;
20694#if defined(FEATURE_WLAN_WAPI)
20695 case WDI_ENCR_WPI:
20696 return eSIR_ED_WPI;
20697#endif
20698 default:
20699 return eSIR_ED_NOT_IMPLEMENTED;
20700 }
20701
20702}/*WDI_2_HAL_ENC_TYPE*/
20703
20704/*Convert WDI WEP type into HAL WEP type*/
20705WPT_STATIC WPT_INLINE tAniWepType
20706WDI_2_HAL_WEP_TYPE
20707(
20708 WDI_WepType wdiWEPType
20709)
20710{
20711 /*Lightweight function - no sanity checks and no unecessary code to increase
20712 the chances of getting inlined*/
20713 switch ( wdiWEPType )
20714 {
20715 case WDI_WEP_STATIC:
20716 return eSIR_WEP_STATIC;
20717
20718 case WDI_WEP_DYNAMIC:
20719 return eSIR_WEP_DYNAMIC;
20720 }
20721
20722 return eSIR_WEP_MAX;
20723}/*WDI_2_HAL_WEP_TYPE*/
20724
20725WPT_STATIC WPT_INLINE tSirLinkState
20726WDI_2_HAL_LINK_STATE
20727(
20728 WDI_LinkStateType wdiLinkState
20729)
20730{
20731 /*Lightweight function - no sanity checks and no unecessary code to increase
20732 the chances of getting inlined*/
20733 switch ( wdiLinkState )
20734 {
20735 case WDI_LINK_IDLE_STATE:
20736 return eSIR_LINK_IDLE_STATE;
20737
20738 case WDI_LINK_PREASSOC_STATE:
20739 return eSIR_LINK_PREASSOC_STATE;
20740
20741 case WDI_LINK_POSTASSOC_STATE:
20742 return eSIR_LINK_POSTASSOC_STATE;
20743
20744 case WDI_LINK_AP_STATE:
20745 return eSIR_LINK_AP_STATE;
20746
20747 case WDI_LINK_IBSS_STATE:
20748 return eSIR_LINK_IBSS_STATE;
20749
20750 case WDI_LINK_BTAMP_PREASSOC_STATE:
20751 return eSIR_LINK_BTAMP_PREASSOC_STATE;
20752
20753 case WDI_LINK_BTAMP_POSTASSOC_STATE:
20754 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
20755
20756 case WDI_LINK_BTAMP_AP_STATE:
20757 return eSIR_LINK_BTAMP_AP_STATE;
20758
20759 case WDI_LINK_BTAMP_STA_STATE:
20760 return eSIR_LINK_BTAMP_STA_STATE;
20761
20762 case WDI_LINK_LEARN_STATE:
20763 return eSIR_LINK_LEARN_STATE;
20764
20765 case WDI_LINK_SCAN_STATE:
20766 return eSIR_LINK_SCAN_STATE;
20767
20768 case WDI_LINK_FINISH_SCAN_STATE:
20769 return eSIR_LINK_FINISH_SCAN_STATE;
20770
20771 case WDI_LINK_INIT_CAL_STATE:
20772 return eSIR_LINK_INIT_CAL_STATE;
20773
20774 case WDI_LINK_FINISH_CAL_STATE:
20775 return eSIR_LINK_FINISH_CAL_STATE;
20776
20777#ifdef WLAN_FEATURE_P2P
20778 case WDI_LINK_LISTEN_STATE:
20779 return eSIR_LINK_LISTEN_STATE;
20780#endif
20781
20782 default:
20783 return eSIR_LINK_MAX;
20784 }
20785}
20786
20787/*Translate a STA Context from WDI into HAL*/
20788WPT_STATIC WPT_INLINE
20789void
20790WDI_CopyWDIStaCtxToHALStaCtx
20791(
20792 tConfigStaParams* phalConfigSta,
20793 WDI_ConfigStaReqInfoType* pwdiConfigSta
20794)
20795{
20796 wpt_uint8 i;
20797 /*Lightweight function - no sanity checks and no unecessary code to increase
20798 the chances of getting inlined*/
20799
20800 wpalMemoryCopy(phalConfigSta->bssId,
20801 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
20802
20803 wpalMemoryCopy(phalConfigSta->staMac,
20804 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
20805
20806 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
20807 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
20808 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
20809 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
20810 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
20811 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
20812 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
20813 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
20814 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
20815 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
20816 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
20817 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
20818 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
20819 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
20820 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
20821 phalConfigSta->action = pwdiConfigSta->wdiAction;
20822 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
20823 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
20824 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
20825 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
20826 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
20827 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
20828 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
20829
20830 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
20831
20832 phalConfigSta->supportedRates.opRateMode =
20833 pwdiConfigSta->wdiSupportedRates.opRateMode;
20834 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
20835 {
20836 phalConfigSta->supportedRates.llbRates[i] =
20837 pwdiConfigSta->wdiSupportedRates.llbRates[i];
20838 }
20839 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
20840 {
20841 phalConfigSta->supportedRates.llaRates[i] =
20842 pwdiConfigSta->wdiSupportedRates.llaRates[i];
20843 }
20844 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
20845 {
20846 phalConfigSta->supportedRates.aniLegacyRates[i] =
20847 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
20848 }
20849 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
20850 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
20851 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
20852 {
20853 phalConfigSta->supportedRates.supportedMCSSet[i] =
20854 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
20855 }
20856 phalConfigSta->supportedRates.rxHighestDataRate =
20857 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
20858
20859#ifdef WLAN_FEATURE_P2P
20860 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
20861#endif
20862
20863}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
20864
20865/*Translate a Rate set info from WDI into HAL*/
20866WPT_STATIC WPT_INLINE void
20867WDI_CopyWDIRateSetToHALRateSet
20868(
20869 tSirMacRateSet* pHalRateSet,
20870 WDI_RateSet* pwdiRateSet
20871)
20872{
20873 wpt_uint8 i;
20874 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
20875
20876 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
20877 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
20878
20879 for ( i = 0; i < pHalRateSet->numRates; i++ )
20880 {
20881 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
20882 }
20883
20884}/*WDI_CopyWDIRateSetToHALRateSet*/
20885
20886
20887/*Translate an EDCA Parameter Record from WDI into HAL*/
20888WPT_STATIC WPT_INLINE void
20889WDI_CopyWDIEDCAParamsToHALEDCAParams
20890(
20891 tSirMacEdcaParamRecord* phalEdcaParam,
20892 WDI_EdcaParamRecord* pWDIEdcaParam
20893)
20894{
20895 /*Lightweight function - no sanity checks and no unecessary code to increase
20896 the chances of getting inlined*/
20897
20898 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
20899 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
20900 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
20901 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
20902
20903 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
20904 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
20905 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
20906}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
20907
20908
20909/*Copy a management frame header from WDI fmt into HAL fmt*/
20910WPT_STATIC WPT_INLINE void
20911WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
20912(
20913 tSirMacMgmtHdr* pmacMgmtHdr,
20914 WDI_MacMgmtHdr* pwdiMacMgmtHdr
20915)
20916{
20917 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
20918 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
20919 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
20920 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
20921 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
20922 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
20923 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
20924 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
20925 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
20926 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
20927 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
20928
20929 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
20930 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
20931
20932 wpalMemoryCopy(pmacMgmtHdr->da,
20933 pwdiMacMgmtHdr->da, 6);
20934 wpalMemoryCopy(pmacMgmtHdr->sa,
20935 pwdiMacMgmtHdr->sa, 6);
20936 wpalMemoryCopy(pmacMgmtHdr->bssId,
20937 pwdiMacMgmtHdr->bssId, 6);
20938
20939 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
20940 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
20941 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
20942
20943}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
20944
20945
20946/*Copy config bss parameters from WDI fmt into HAL fmt*/
20947WPT_STATIC WPT_INLINE void
20948WDI_CopyWDIConfigBSSToHALConfigBSS
20949(
20950 tConfigBssParams* phalConfigBSS,
20951 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
20952)
20953{
20954
20955 wpt_uint8 keyIndex = 0;
20956 wpalMemoryCopy( phalConfigBSS->bssId,
20957 pwdiConfigBSS->macBSSID,
20958 WDI_MAC_ADDR_LEN);
20959
20960#ifdef HAL_SELF_STA_PER_BSS
20961 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
20962 pwdiConfigBSS->macSelfAddr,
20963 WDI_MAC_ADDR_LEN);
20964#endif
20965
20966 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
20967
20968 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
20969 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
20970
20971 phalConfigBSS->shortSlotTimeSupported =
20972 pwdiConfigBSS->ucShortSlotTimeSupported;
20973 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
20974 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
20975 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
20976 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
20977 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
20978 phalConfigBSS->fLsigTXOPProtectionFullSupport =
20979 pwdiConfigBSS->ucTXOPProtectionFullSupport;
20980 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
20981 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
20982 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
20983 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
20984 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
20985 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
20986 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
20987 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
20988 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
20989 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
20990
20991 phalConfigBSS->htOperMode =
20992 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
20993
20994 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
20995 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
20996 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
20997 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
20998
20999#ifdef WLAN_FEATURE_VOWIFI
21000 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21001#endif
21002
21003 /*! Used 32 as magic number because that is how the ssid is declared inside the
21004 hal header - hal needs a macro for it */
21005 phalConfigBSS->ssId.length =
21006 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21007 pwdiConfigBSS->wdiSSID.ucLength : 32;
21008 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
21009 pwdiConfigBSS->wdiSSID.sSSID,
21010 phalConfigBSS->ssId.length);
21011
21012 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21013 &pwdiConfigBSS->wdiSTAContext);
21014
21015 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21016 &pwdiConfigBSS->wdiRateSet);
21017
21018 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21019
21020 if(phalConfigBSS->edcaParamsValid)
21021 {
21022 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21023 &pwdiConfigBSS->wdiBEEDCAParams);
21024 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21025 &pwdiConfigBSS->wdiBKEDCAParams);
21026 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21027 &pwdiConfigBSS->wdiVIEDCAParams);
21028 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21029 &pwdiConfigBSS->wdiVOEDCAParams);
21030 }
21031
21032 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
21033
21034 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21035
21036#ifdef WLAN_FEATURE_VOWIFI_11R
21037
21038 phalConfigBSS->extSetStaKeyParamValid =
21039 pwdiConfigBSS->bExtSetStaKeyParamValid;
21040
21041 if( phalConfigBSS->extSetStaKeyParamValid )
21042 {
21043 /*-----------------------------------------------------------------------
21044 Copy the STA Key parameters into the HAL message
21045 -----------------------------------------------------------------------*/
21046 phalConfigBSS->extSetStaKeyParam.encType =
21047 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21048
21049 phalConfigBSS->extSetStaKeyParam.wepType =
21050 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21051
21052 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21053
21054 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21055
21056 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21057
21058#ifdef WLAN_SOFTAP_FEATURE
21059 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21060 keyIndex++)
21061 {
21062 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
21063 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21064 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21065 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21066 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21067 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21068 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
21069 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
21070 WDI_MAX_KEY_RSC_LEN);
21071 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
21072 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
21073 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
21074 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21075 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
21076 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
21077 WDI_MAX_KEY_LENGTH);
21078 }
21079#else
21080 phalConfigBSS->extSetStaKeyParam.key.keyId =
21081 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21082 phalConfigBSS->extSetStaKeyParam.key.unicast =
21083 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21084 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21085 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21086 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
21087 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
21088 WDI_MAX_KEY_RSC_LEN);
21089 phalConfigBSS->extSetStaKeyParam.key.paeRole =
21090 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
21091 phalConfigBSS->extSetStaKeyParam.key.keyLength =
21092 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21093 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
21094 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
21095 WDI_MAX_KEY_LENGTH);
21096#endif
21097 }
21098 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21099 {
21100 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
21101 sizeof(phalConfigBSS->extSetStaKeyParam) );
21102 }
21103
21104#endif /*WLAN_FEATURE_VOWIFI_11R*/
21105
21106}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21107
21108
21109/*Extract the request CB function and user data from a request structure
21110 pointed to by user data */
21111WPT_STATIC WPT_INLINE void
21112WDI_ExtractRequestCBFromEvent
21113(
21114 WDI_EventInfoType* pEvent,
21115 WDI_ReqStatusCb* ppfnReqCB,
21116 void** ppUserData
21117)
21118{
21119 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21120 switch ( pEvent->wdiRequest )
21121 {
21122 case WDI_START_REQ:
21123 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21124 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21125 break;
21126 case WDI_STOP_REQ:
21127 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21128 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21129 break;
21130 case WDI_INIT_SCAN_REQ:
21131 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21132 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21133 break;
21134 case WDI_START_SCAN_REQ:
21135 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21136 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21137 break;
21138 case WDI_END_SCAN_REQ:
21139 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21140 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21141 break;
21142 case WDI_FINISH_SCAN_REQ:
21143 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21144 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21145 break;
21146 case WDI_JOIN_REQ:
21147 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21148 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21149 break;
21150 case WDI_CONFIG_BSS_REQ:
21151 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21152 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21153 break;
21154 case WDI_DEL_BSS_REQ:
21155 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21156 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21157 break;
21158 case WDI_POST_ASSOC_REQ:
21159 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21160 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21161 break;
21162 case WDI_DEL_STA_REQ:
21163 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21164 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21165 break;
21166 case WDI_DEL_STA_SELF_REQ:
21167 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21168 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21169 break;
21170
21171 case WDI_SET_BSS_KEY_REQ:
21172 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21173 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21174 break;
21175 case WDI_RMV_BSS_KEY_REQ:
21176 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21177 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21178 break;
21179 case WDI_SET_STA_KEY_REQ:
21180 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21181 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21182 break;
21183 case WDI_RMV_STA_KEY_REQ:
21184 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21185 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21186 break;
21187 case WDI_ADD_TS_REQ:
21188 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21189 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21190 break;
21191 case WDI_DEL_TS_REQ:
21192 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21193 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21194 break;
21195 case WDI_UPD_EDCA_PRMS_REQ:
21196 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21197 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21198 break;
21199 case WDI_ADD_BA_SESSION_REQ:
21200 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21201 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21202 break;
21203 case WDI_DEL_BA_REQ:
21204 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21205 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21206 break;
21207#ifdef FEATURE_WLAN_CCX
21208 case WDI_TSM_STATS_REQ:
21209 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21210 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21211 break;
21212#endif
21213 case WDI_CH_SWITCH_REQ:
21214 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21215 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21216 break;
21217 case WDI_CONFIG_STA_REQ:
21218 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21219 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21220 break;
21221 case WDI_SET_LINK_ST_REQ:
21222 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21223 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21224 break;
21225 case WDI_GET_STATS_REQ:
21226 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21227 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21228 break;
21229 case WDI_UPDATE_CFG_REQ:
21230 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21231 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21232 break;
21233 case WDI_ADD_BA_REQ:
21234 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21235 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21236 break;
21237 case WDI_TRIGGER_BA_REQ:
21238 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21239 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21240 break;
21241 case WDI_UPD_BCON_PRMS_REQ:
21242 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21243 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21244 break;
21245 case WDI_SND_BCON_REQ:
21246 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21247 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21248 break;
21249 case WDI_ENTER_BMPS_REQ:
21250 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21251 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21252 break;
21253 case WDI_EXIT_BMPS_REQ:
21254 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21255 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21256 break;
21257 case WDI_ENTER_UAPSD_REQ:
21258 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21259 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21260 break;
21261 case WDI_UPDATE_UAPSD_PARAM_REQ:
21262 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21263 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21264 break;
21265 case WDI_CONFIGURE_RXP_FILTER_REQ:
21266 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21267 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21268 break;
21269 case WDI_SET_BEACON_FILTER_REQ:
21270 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21271 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21272 break;
21273 case WDI_REM_BEACON_FILTER_REQ:
21274 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21275 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21276 break;
21277 case WDI_SET_RSSI_THRESHOLDS_REQ:
21278 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21279 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21280 break;
21281 case WDI_HOST_OFFLOAD_REQ:
21282 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21283 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21284 break;
21285 case WDI_WOWL_ADD_BC_PTRN_REQ:
21286 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21287 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21288 break;
21289 case WDI_WOWL_DEL_BC_PTRN_REQ:
21290 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21291 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21292 break;
21293 case WDI_WOWL_ENTER_REQ:
21294 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21295 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21296 break;
21297 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21298 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21299 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21300 break;
21301 case WDI_FLUSH_AC_REQ:
21302 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21303 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21304 break;
21305 case WDI_BTAMP_EVENT_REQ:
21306 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21307 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21308 break;
21309 case WDI_KEEP_ALIVE_REQ:
21310 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21311 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21312 break;
21313 case WDI_SET_TX_PER_TRACKING_REQ:
21314 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21315 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21316 default:
21317 *ppfnReqCB = NULL;
21318 *ppUserData = NULL;
21319 break;
21320 }
21321}/*WDI_ExtractRequestCBFromEvent*/
21322
21323
21324/**
21325 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
21326 frame xtl is enabled for a particular STA.
21327
21328 WDI_PostAssocReq must have been called.
21329
21330 @param uSTAIdx: STA index
21331
21332 @see WDI_PostAssocReq
21333 @return Result of the function call
21334*/
21335wpt_boolean
21336WDI_IsHwFrameTxTranslationCapable
21337(
21338 wpt_uint8 uSTAIdx
21339)
21340{
21341 /*!! FIX ME - this must eventually be per station - for now just feedback
21342 uma value*/
21343 /*------------------------------------------------------------------------
21344 Sanity Check
21345 ------------------------------------------------------------------------*/
21346 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21347 {
21348 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21349 "WDI API call before module is initialized - Fail request");
21350
21351 return WDI_STATUS_E_NOT_ALLOWED;
21352 }
21353
21354
21355 return gWDICb.bFrameTransEnabled;
21356}/*WDI_IsHwFrameTxTranslationCapable*/
21357
21358#ifdef FEATURE_WLAN_SCAN_PNO
21359/**
21360 @brief WDI_SetPreferredNetworkList
21361
21362 @param pwdiPNOScanReqParams: the Set PNO as specified
21363 by the Device Interface
21364
21365 wdiPNOScanCb: callback for passing back the response
21366 of the Set PNO operation received from the
21367 device
21368
21369 pUserData: user data will be passed back with the
21370 callback
21371
21372 @return Result of the function call
21373*/
21374WDI_Status
21375WDI_SetPreferredNetworkReq
21376(
21377 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21378 WDI_PNOScanCb wdiPNOScanCb,
21379 void* pUserData
21380)
21381{
21382 WDI_EventInfoType wdiEventData = {{0}};
21383 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21384
21385 /*------------------------------------------------------------------------
21386 Sanity Check
21387 ------------------------------------------------------------------------*/
21388 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21389 {
21390 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21391 "WDI API call before module is initialized - Fail request");
21392
21393 return WDI_STATUS_E_NOT_ALLOWED;
21394 }
21395
21396 /*------------------------------------------------------------------------
21397 Fill in Event data and post to the Main FSM
21398 ------------------------------------------------------------------------*/
21399 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
21400 wdiEventData.pEventData = pwdiPNOScanReqParams;
21401 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
21402 wdiEventData.pCBfnc = wdiPNOScanCb;
21403 wdiEventData.pUserData = pUserData;
21404
21405 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21406}
21407
21408
21409/**
21410 @brief WDI_SetRssiFilterReq
21411
21412 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
21413 specified by the Device Interface
21414
21415 wdiRssiFilterCb: callback for passing back the response
21416 of the Set RSSI Filter operation received from the
21417 device
21418
21419 pUserData: user data will be passed back with the
21420 callback
21421
21422 @return Result of the function call
21423*/
21424WDI_Status
21425WDI_SetRssiFilterReq
21426(
21427 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
21428 WDI_RssiFilterCb wdiRssiFilterCb,
21429 void* pUserData
21430)
21431{
21432 WDI_EventInfoType wdiEventData = {{0}};
21433 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21434
21435 /*------------------------------------------------------------------------
21436 Sanity Check
21437 ------------------------------------------------------------------------*/
21438 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21439 {
21440 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21441 "WDI API call before module is initialized - Fail request");
21442
21443 return WDI_STATUS_E_NOT_ALLOWED;
21444 }
21445
21446 /*------------------------------------------------------------------------
21447 Fill in Event data and post to the Main FSM
21448 ------------------------------------------------------------------------*/
21449 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
21450 wdiEventData.pEventData = pwdiRssiFilterReqParams;
21451 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
21452 wdiEventData.pCBfnc = wdiRssiFilterCb;
21453 wdiEventData.pUserData = pUserData;
21454
21455 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21456}/*WDI_SetRssiFilterReq*/
21457
21458/**
21459 @brief WDI_UpdateScanParamsReq
21460
21461 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
21462 by the Device Interface
21463
21464 wdiUpdateScanParamsCb: callback for passing back the response
21465 of the Set PNO operation received from the
21466 device
21467
21468 pUserData: user data will be passed back with the
21469 callback
21470
21471 @return Result of the function call
21472*/
21473WDI_Status
21474WDI_UpdateScanParamsReq
21475(
21476 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
21477 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
21478 void* pUserData
21479)
21480{
21481 WDI_EventInfoType wdiEventData = {{0}};
21482 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21483
21484 /*------------------------------------------------------------------------
21485 Sanity Check
21486 ------------------------------------------------------------------------*/
21487 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21488 {
21489 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21490 "WDI API call before module is initialized - Fail request");
21491
21492 return WDI_STATUS_E_NOT_ALLOWED;
21493 }
21494
21495 /*------------------------------------------------------------------------
21496 Fill in Event data and post to the Main FSM
21497 ------------------------------------------------------------------------*/
21498 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
21499 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
21500 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
21501 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
21502 wdiEventData.pUserData = pUserData;
21503
21504 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21505}
21506
21507/**
21508 @brief Helper function to pack Set Preferred Network List
21509 Request parameters
21510
21511 @param pWDICtx: pointer to the WLAN DAL context
21512 pwdiPNOScanReqParams: pointer to the info received
21513 from upper layers
21514 ppSendBuffer, pSize - out pointers of the packed buffer
21515 and its size
21516
21517 @return Result of the function call
21518*/
21519
21520WDI_Status
21521WDI_PackPreferredNetworkList
21522(
21523 WDI_ControlBlockType* pWDICtx,
21524 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21525 wpt_uint8** ppSendBuffer,
21526 wpt_uint16* pSize
21527)
21528{
21529 wpt_uint8* pSendBuffer = NULL;
21530 wpt_uint16 usDataOffset = 0;
21531 wpt_uint16 usSendSize = 0;
21532 tPrefNetwListParams pPrefNetwListParams = {0};
21533 wpt_uint8 i;
21534 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21535
21536 /*-----------------------------------------------------------------------
21537 Get message buffer
21538 -----------------------------------------------------------------------*/
21539 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21540 sizeof(pPrefNetwListParams),
21541 &pSendBuffer, &usDataOffset, &usSendSize))||
21542 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21543 {
21544 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21545 "Unable to get send buffer in Set PNO req %x ",
21546 pwdiPNOScanReqParams);
21547 WDI_ASSERT(0);
21548 return WDI_STATUS_E_FAILURE;
21549 }
21550
21551 /*-------------------------------------------------------------------------
21552 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21553 -------------------------------------------------------------------------*/
21554 pPrefNetwListParams.enable =
21555 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
21556 pPrefNetwListParams.modePNO =
21557 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21558
21559 pPrefNetwListParams.ucNetworksCount =
21560 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
21561 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
21562 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
21563 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21564
21565 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21566 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
21567 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
21568 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
21569 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
21570
21571 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
21572 {
21573 /*SSID of the BSS*/
21574 pPrefNetwListParams.aNetworks[i].ssId.length
21575 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
21576
21577 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
21578 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
21579 pPrefNetwListParams.aNetworks[i].ssId.length);
21580
21581 /*Authentication type for the network*/
21582 pPrefNetwListParams.aNetworks[i].authentication =
21583 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
21584
21585 /*Encryption type for the network*/
21586 pPrefNetwListParams.aNetworks[i].encryption =
21587 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
21588
21589 /*Indicate the channel on which the Network can be found
21590 0 - if all channels */
21591 pPrefNetwListParams.aNetworks[i].ucChannelCount =
21592 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
21593
21594 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
21595 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
21596 pPrefNetwListParams.aNetworks[i].ucChannelCount);
21597
21598 /*Indicates the RSSI threshold for the network to be considered*/
21599 pPrefNetwListParams.aNetworks[i].rssiThreshold =
21600 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
21601
21602 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21603 "WDI SET PNO: SSID %d %s",
21604 pPrefNetwListParams.aNetworks[i].ssId.length,
21605 pPrefNetwListParams.aNetworks[i].ssId.ssId);
21606 }
21607
21608 pPrefNetwListParams.scanTimers.ucScanTimersCount =
21609 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
21610 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
21611 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
21612 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
21613
21614 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21615 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
21616 pPrefNetwListParams.scanTimers.ucScanTimersCount,
21617 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
21618 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
21619
21620 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
21621 {
21622 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
21623 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
21624 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
21625 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
21626 }
21627
21628 /*Copy the probe template*/
21629 pPrefNetwListParams.us24GProbeSize =
21630 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
21631 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21632 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
21633 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21634
21635 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
21636 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
21637 pPrefNetwListParams.us24GProbeSize);
21638
21639 pPrefNetwListParams.us5GProbeSize =
21640 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
21641 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21642 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
21643 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21644
21645 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
21646 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
21647 pPrefNetwListParams.us5GProbeSize);
21648
21649 /*Pack the buffer*/
21650 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
21651 sizeof(pPrefNetwListParams));
21652
21653 /*Set the output values*/
21654 *ppSendBuffer = pSendBuffer;
21655 *pSize = usSendSize;
21656
21657 return WDI_STATUS_SUCCESS;
21658}/*WDI_PackPreferredNetworkList*/
21659
21660/**
21661 @brief Helper function to pack Set Preferred Network List
21662 Request parameters
21663
21664 @param pWDICtx: pointer to the WLAN DAL context
21665 pwdiPNOScanReqParams: pointer to the info received
21666 from upper layers
21667 ppSendBuffer, pSize - out pointers of the packed buffer
21668 and its size
21669
21670 @return Result of the function call
21671*/
21672
21673WDI_Status
21674WDI_PackPreferredNetworkListNew
21675(
21676 WDI_ControlBlockType* pWDICtx,
21677 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21678 wpt_uint8** ppSendBuffer,
21679 wpt_uint16* pSize
21680)
21681{
21682 wpt_uint8* pSendBuffer = NULL;
21683 wpt_uint16 usDataOffset = 0;
21684 wpt_uint16 usSendSize = 0;
21685 tPrefNetwListParamsNew pPrefNetwListParams;
21686 wpt_uint8 i;
21687 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21688
21689 /*-----------------------------------------------------------------------
21690 Get message buffer
21691 -----------------------------------------------------------------------*/
21692 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21693 sizeof(pPrefNetwListParams),
21694 &pSendBuffer, &usDataOffset, &usSendSize))||
21695 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21696 {
21697 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21698 "Unable to get send buffer in Set PNO req %x ",
21699 pwdiPNOScanReqParams);
21700 WDI_ASSERT(0);
21701 return WDI_STATUS_E_FAILURE;
21702 }
21703
21704 /*-------------------------------------------------------------------------
21705 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21706 -------------------------------------------------------------------------*/
21707 pPrefNetwListParams.enable =
21708 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
21709 pPrefNetwListParams.modePNO =
21710 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21711
21712 pPrefNetwListParams.ucNetworksCount =
21713 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
21714 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
21715 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
21716 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21717
21718 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21719 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
21720 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
21721 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
21722 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
21723
21724 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
21725 {
21726 /*SSID of the BSS*/
21727 pPrefNetwListParams.aNetworks[i].ssId.length
21728 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
21729
21730 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
21731 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
21732 pPrefNetwListParams.aNetworks[i].ssId.length);
21733
21734 /*Authentication type for the network*/
21735 pPrefNetwListParams.aNetworks[i].authentication =
21736 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
21737
21738 /*Encryption type for the network*/
21739 pPrefNetwListParams.aNetworks[i].encryption =
21740 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
21741
21742 /*SSID bcast type for the network*/
21743 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
21744 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
21745
21746 /*Indicate the channel on which the Network can be found
21747 0 - if all channels */
21748 pPrefNetwListParams.aNetworks[i].ucChannelCount =
21749 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
21750
21751 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
21752 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
21753 pPrefNetwListParams.aNetworks[i].ucChannelCount);
21754
21755 /*Indicates the RSSI threshold for the network to be considered*/
21756 pPrefNetwListParams.aNetworks[i].rssiThreshold =
21757 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
21758
21759 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21760 "WDI SET PNO: SSID %d %s",
21761 pPrefNetwListParams.aNetworks[i].ssId.length,
21762 pPrefNetwListParams.aNetworks[i].ssId.ssId);
21763 }
21764
21765 pPrefNetwListParams.scanTimers.ucScanTimersCount =
21766 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
21767 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
21768 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
21769 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
21770
21771 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21772 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
21773 pPrefNetwListParams.scanTimers.ucScanTimersCount,
21774 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
21775 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
21776
21777 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
21778 {
21779 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
21780 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
21781 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
21782 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
21783 }
21784
21785 /*Copy the probe template*/
21786 pPrefNetwListParams.us24GProbeSize =
21787 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
21788 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21789 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
21790 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21791
21792 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
21793 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
21794 pPrefNetwListParams.us24GProbeSize);
21795
21796 pPrefNetwListParams.us5GProbeSize =
21797 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
21798 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
21799 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
21800 WLAN_HAL_PNO_MAX_PROBE_SIZE;
21801
21802 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
21803 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
21804 pPrefNetwListParams.us5GProbeSize);
21805
21806 /*Pack the buffer*/
21807 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
21808 sizeof(pPrefNetwListParams));
21809
21810 /*Set the output values*/
21811 *ppSendBuffer = pSendBuffer;
21812 *pSize = usSendSize;
21813
21814 return WDI_STATUS_SUCCESS;
21815}/*WDI_PackPreferredNetworkListNew*/
21816
21817/**
21818 @brief Process Set Preferred Network List Request function
21819
21820 @param pWDICtx: pointer to the WLAN DAL context
21821 pEventData: pointer to the event information structure
21822
21823 @return Result of the function call
21824*/
21825WDI_Status
21826WDI_ProcessSetPreferredNetworkReq
21827(
21828 WDI_ControlBlockType* pWDICtx,
21829 WDI_EventInfoType* pEventData
21830)
21831{
21832 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
21833 WDI_PNOScanCb wdiPNOScanCb = NULL;
21834 wpt_uint8* pSendBuffer = NULL;
21835 wpt_uint16 usSendSize = 0;
21836 WDI_Status wdiStatus;
21837
21838 /*-------------------------------------------------------------------------
21839 Sanity check
21840 -------------------------------------------------------------------------*/
21841 if (( NULL == pEventData ) ||
21842 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
21843 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
21844 {
21845 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21846 "%s: Invalid parameters", __FUNCTION__);
21847 WDI_ASSERT(0);
21848 return WDI_STATUS_E_FAILURE;
21849 }
21850
21851 /*-------------------------------------------------------------------------
21852 Pack the PNO request structure based on version
21853 -------------------------------------------------------------------------*/
21854 if ( pWDICtx->wdiPNOVersion > 0 )
21855 {
21856 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21857 "%s: PNO new version %d ", __FUNCTION__,
21858 pWDICtx->wdiPNOVersion);
21859
21860 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
21861 &pSendBuffer, &usSendSize);
21862 }
21863 else
21864 {
21865 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21866 "%s: PNO old version %d ", __FUNCTION__,
21867 pWDICtx->wdiPNOVersion);
21868
21869 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
21870 &pSendBuffer, &usSendSize);
21871 }
21872
21873 if (( WDI_STATUS_SUCCESS != wdiStatus )||
21874 ( NULL == pSendBuffer )||( 0 == usSendSize ))
21875 {
21876 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21877 "%s: failed to pack request parameters", __FUNCTION__);
21878 WDI_ASSERT(0);
21879 return wdiStatus;
21880 }
21881
21882 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
21883 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
21884
21885 /*-------------------------------------------------------------------------
21886 Send Get STA Request to HAL
21887 -------------------------------------------------------------------------*/
21888 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
21889 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
21890}
21891
21892/**
21893 @brief Process Set RSSI Filter Request function
21894
21895 @param pWDICtx: pointer to the WLAN DAL context
21896 pEventData: pointer to the event information structure
21897
21898 @see
21899 @return Result of the function call
21900*/
21901WDI_Status
21902WDI_ProcessSetRssiFilterReq
21903(
21904 WDI_ControlBlockType* pWDICtx,
21905 WDI_EventInfoType* pEventData
21906)
21907{
21908 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
21909 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
21910 wpt_uint8* pSendBuffer = NULL;
21911 wpt_uint16 usDataOffset = 0;
21912 wpt_uint16 usSendSize = 0;
21913 wpt_uint8 ucRssiThreshold;
21914
21915 /*-------------------------------------------------------------------------
21916 Sanity check
21917 -------------------------------------------------------------------------*/
21918 if (( NULL == pEventData ) ||
21919 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
21920 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
21921 {
21922 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21923 "%s: Invalid parameters", __FUNCTION__);
21924 WDI_ASSERT(0);
21925 return WDI_STATUS_E_FAILURE;
21926 }
21927
21928 /*-----------------------------------------------------------------------
21929 Get message buffer
21930 -----------------------------------------------------------------------*/
21931 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
21932 sizeof(ucRssiThreshold),
21933 &pSendBuffer, &usDataOffset, &usSendSize))||
21934 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
21935 {
21936 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21937 "Unable to get send buffer in Set PNO req %x %x %x",
21938 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
21939 WDI_ASSERT(0);
21940 return WDI_STATUS_E_FAILURE;
21941 }
21942
21943 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
21944
21945 wpalMemoryCopy( pSendBuffer+usDataOffset,
21946 &ucRssiThreshold,
21947 sizeof(ucRssiThreshold));
21948
21949 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
21950 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
21951
21952 /*-------------------------------------------------------------------------
21953 Send Get STA Request to HAL
21954 -------------------------------------------------------------------------*/
21955 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
21956 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
21957}
21958
21959
21960/**
21961 @brief Process Update Scan Params function
21962
21963 @param pWDICtx: pointer to the WLAN DAL context
21964 pEventData: pointer to the event information structure
21965
21966 @see
21967 @return Result of the function call
21968*/
21969WDI_Status
21970WDI_ProcessUpdateScanParamsReq
21971(
21972 WDI_ControlBlockType* pWDICtx,
21973 WDI_EventInfoType* pEventData
21974)
21975{
21976 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
21977 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
21978 wpt_uint8* pSendBuffer = NULL;
21979 wpt_uint16 usDataOffset = 0;
21980 wpt_uint16 usSendSize = 0;
21981 tUpdateScanParams updateScanParams = {0};
21982
21983
21984 /*-------------------------------------------------------------------------
21985 Sanity check
21986 -------------------------------------------------------------------------*/
21987 if (( NULL == pEventData ) ||
21988 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
21989 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
21990 {
21991 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21992 "%s: Invalid parameters", __FUNCTION__);
21993 WDI_ASSERT(0);
21994 return WDI_STATUS_E_FAILURE;
21995 }
21996
21997 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
21998 "Begin WDI Update Scan Parameters");
21999 /*-----------------------------------------------------------------------
22000 Get message buffer
22001 -----------------------------------------------------------------------*/
22002 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
22003 sizeof(updateScanParams),
22004 &pSendBuffer, &usDataOffset, &usSendSize))||
22005 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22006 {
22007 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22008 "Unable to get send buffer in Update Scan Params req %x %x %x",
22009 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22010 WDI_ASSERT(0);
22011 return WDI_STATUS_E_FAILURE;
22012 }
22013
22014 //
22015 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22016 //
22017
22018 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22019 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
22020 updateScanParams.ucChannelCount =
22021 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22022 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22023 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22024 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22025
22026 wpalMemoryCopy( updateScanParams.aChannels,
22027 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22028 updateScanParams.ucChannelCount);
22029
22030 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22031 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22032 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22033 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22034 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22035
22036 wpalMemoryCopy( pSendBuffer+usDataOffset,
22037 &updateScanParams,
22038 sizeof(updateScanParams));
22039
22040 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
22041 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
22042
22043 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22044 "End Update Scan Parameters");
22045 /*-------------------------------------------------------------------------
22046 Send Get STA Request to HAL
22047 -------------------------------------------------------------------------*/
22048 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22049 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
22050}
22051
22052/**
22053 @brief Process Preferred Network Found Indication function
22054
22055 @param pWDICtx: pointer to the WLAN DAL context
22056 pEventData: pointer to the event information structure
22057
22058 @see
22059 @return Result of the function call
22060*/
22061WDI_Status
22062WDI_ProcessPrefNetworkFoundInd
22063(
22064 WDI_ControlBlockType* pWDICtx,
22065 WDI_EventInfoType* pEventData
22066)
22067{
22068 WDI_LowLevelIndType wdiInd;
22069 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22070
22071
22072 /*-------------------------------------------------------------------------
22073 Sanity check
22074 -------------------------------------------------------------------------*/
22075 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22076 ( NULL == pEventData->pEventData ))
22077 {
22078 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22079 "%s: Invalid parameters", __FUNCTION__);
22080 WDI_ASSERT( 0 );
22081 return WDI_STATUS_E_FAILURE;
22082 }
22083
22084 /*-------------------------------------------------------------------------
22085 Extract indication and send it to UMAC
22086 -------------------------------------------------------------------------*/
22087 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22088 pEventData->pEventData,
22089 sizeof(tPrefNetwFoundParams));
22090
22091 /*Fill in the indication parameters*/
22092 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
22093
22094 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22095
22096 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
22097 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
22098 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
22099
22100 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22101 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
22102 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22103
22104 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22105 prefNetwFoundInd.prefNetwFoundParams.rssi;
22106
22107 // DEBUG
22108 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22109 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22110 wdiInd.wdiIndicationType,
22111 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22112 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22113
22114 /*Notify UMAC*/
22115 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
22116
22117 return WDI_STATUS_SUCCESS;
22118}
22119
22120/**
22121 @brief Process PNO Rsp function (called when a
22122 response is being received over the bus from HAL)
22123
22124 @param pWDICtx: pointer to the WLAN DAL context
22125 pEventData: pointer to the event information structure
22126
22127 @see
22128 @return Result of the function call
22129*/
22130WDI_Status
22131WDI_ProcessSetPreferredNetworkRsp
22132(
22133 WDI_ControlBlockType* pWDICtx,
22134 WDI_EventInfoType* pEventData
22135)
22136{
22137 WDI_Status wdiStatus;
22138 eHalStatus halStatus;
22139 WDI_PNOScanCb wdiPNOScanCb = NULL;
22140 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22141
22142 /*-------------------------------------------------------------------------
22143 Sanity check
22144 -------------------------------------------------------------------------*/
22145 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22146 ( NULL == pEventData->pEventData ))
22147 {
22148 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22149 "%s: Invalid parameters", __FUNCTION__);
22150 WDI_ASSERT(0);
22151 return WDI_STATUS_E_FAILURE;
22152 }
22153
22154
22155 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
22156
22157 /*-------------------------------------------------------------------------
22158 Extract response and send it to UMAC
22159 -------------------------------------------------------------------------*/
22160 halStatus = *((eHalStatus*)pEventData->pEventData);
22161 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22162
22163 /*Notify UMAC*/
22164 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22165
22166 return WDI_STATUS_SUCCESS;
22167}/*WDI_ProcessSetPreferredNetworkRsp*/
22168
22169/**
22170 @brief Process RSSI Filter Rsp function (called when a
22171 response is being received over the bus from HAL)
22172
22173 @param pWDICtx: pointer to the WLAN DAL context
22174 pEventData: pointer to the event information structure
22175
22176 @see
22177 @return Result of the function call
22178*/
22179WDI_Status
22180WDI_ProcessSetRssiFilterRsp
22181(
22182 WDI_ControlBlockType* pWDICtx,
22183 WDI_EventInfoType* pEventData
22184)
22185{
22186 WDI_Status wdiStatus;
22187 eHalStatus halStatus;
22188 WDI_RssiFilterCb wdiRssiFilterCb;
22189 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22190
22191 /*-------------------------------------------------------------------------
22192 Sanity check
22193 -------------------------------------------------------------------------*/
22194 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22195 ( NULL == pEventData->pEventData ))
22196 {
22197 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22198 "%s: Invalid parameters", __FUNCTION__);
22199 WDI_ASSERT(0);
22200 return WDI_STATUS_E_FAILURE;
22201 }
22202
22203 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
22204
22205 /*-------------------------------------------------------------------------
22206 Extract response and send it to UMAC
22207 -------------------------------------------------------------------------*/
22208 halStatus = *((eHalStatus*)pEventData->pEventData);
22209 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22210
22211 /*Notify UMAC*/
22212 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22213
22214 return WDI_STATUS_SUCCESS;
22215}/*WDI_ProcessSetRssiFilterRsp*/
22216
22217/**
22218 @brief Process Update Scan Params Rsp function (called when a
22219 response is being received over the bus from HAL)
22220
22221 @param pWDICtx: pointer to the WLAN DAL context
22222 pEventData: pointer to the event information structure
22223
22224 @see
22225 @return Result of the function call
22226*/
22227WDI_Status
22228WDI_ProcessUpdateScanParamsRsp
22229(
22230 WDI_ControlBlockType* pWDICtx,
22231 WDI_EventInfoType* pEventData
22232)
22233{
22234 WDI_Status wdiStatus;
22235 tUpdateScanParamsResp halUpdScanParams;
22236 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
22237 wpt_uint32 uStatus;
22238 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22239
22240 /*-------------------------------------------------------------------------
22241 Sanity check
22242 -------------------------------------------------------------------------*/
22243 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22244 ( NULL == pEventData->pEventData ))
22245 {
22246 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22247 "%s: Invalid parameters", __FUNCTION__);
22248 WDI_ASSERT(0);
22249 return WDI_STATUS_E_FAILURE;
22250 }
22251
22252 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22253 "Process UPD scan params ptr : %x", __FUNCTION__);
22254
22255 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
22256
22257 /*-------------------------------------------------------------------------
22258 Extract response and send it to UMAC
22259 -------------------------------------------------------------------------*/
22260 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22261 pEventData->pEventData,
22262 sizeof(halUpdScanParams.status));
22263
22264 uStatus = halUpdScanParams.status;
22265
22266 /*Extract PNO version - 1st bit of the status */
22267 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
22268
22269 /*Remove version bit*/
22270 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
22271
22272 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
22273
22274 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22275 "UPD Scan Parameters rsp with status: %d",
22276 halUpdScanParams.status);
22277
22278 /*Notify UMAC*/
22279 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22280
22281 return WDI_STATUS_SUCCESS;
22282}
22283#endif // FEATURE_WLAN_SCAN_PNO
22284
22285#ifdef WLAN_FEATURE_PACKET_FILTERING
22286WDI_Status
22287WDI_8023MulticastListReq
22288(
22289 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22290 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22291 void* pUserData
22292)
22293{
22294 WDI_EventInfoType wdiEventData;
22295 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22296
22297 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22298 "%s", __FUNCTION__);
22299
22300 /*------------------------------------------------------------------------
22301 Sanity Check
22302 ------------------------------------------------------------------------*/
22303 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22304 {
22305 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22306 "WDI API call before module is initialized - Fail request");
22307
22308 return WDI_STATUS_E_NOT_ALLOWED;
22309 }
22310
22311 /*------------------------------------------------------------------------
22312 Fill in Event data and post to the Main FSM
22313 ------------------------------------------------------------------------*/
22314 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
22315 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
22316 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
22317 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
22318 wdiEventData.pUserData = pUserData;
22319
22320 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22321}
22322
22323WDI_Status
22324WDI_ReceiveFilterSetFilterReq
22325(
22326 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22327 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22328 void* pUserData
22329)
22330{
22331 WDI_EventInfoType wdiEventData;
22332 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22333
22334 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22335 "%s",__FUNCTION__);
22336
22337 /*------------------------------------------------------------------------
22338 Sanity Check
22339 ------------------------------------------------------------------------*/
22340 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22341 {
22342 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22343 "WDI API call before module is initialized - Fail request");
22344
22345 return WDI_STATUS_E_NOT_ALLOWED;
22346 }
22347
22348 /*------------------------------------------------------------------------
22349 Fill in Event data and post to the Main FSM
22350 ------------------------------------------------------------------------*/
22351 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
22352 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22353 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22354 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
22355 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
22356 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
22357 wdiEventData.pUserData = pUserData;
22358
22359
22360 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22361}
22362
22363WDI_Status
22364WDI_FilterMatchCountReq
22365(
22366 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
22367 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
22368 void* pUserData
22369)
22370{
22371 WDI_EventInfoType wdiEventData;
22372 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22373
22374 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22375 "%s",__FUNCTION__);
22376
22377 /*------------------------------------------------------------------------
22378 Sanity Check
22379 ------------------------------------------------------------------------*/
22380 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22381 {
22382 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22383 "WDI API call before module is initialized - Fail request");
22384
22385 return WDI_STATUS_E_NOT_ALLOWED;
22386 }
22387
22388 /*------------------------------------------------------------------------
22389 Fill in Event data and post to the Main FSM
22390 ------------------------------------------------------------------------*/
22391 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
22392 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
22393 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
22394 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
22395 wdiEventData.pUserData = pUserData;
22396
22397
22398 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22399}
22400
22401WDI_Status
22402WDI_ReceiveFilterClearFilterReq
22403(
22404 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
22405 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
22406 void* pUserData
22407)
22408{
22409 WDI_EventInfoType wdiEventData;
22410 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22411
22412 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22413 "%s",__FUNCTION__);
22414
22415 /*------------------------------------------------------------------------
22416 Sanity Check
22417 ------------------------------------------------------------------------*/
22418 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22419 {
22420 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22421 "WDI API call before module is initialized - Fail request");
22422
22423 return WDI_STATUS_E_NOT_ALLOWED;
22424 }
22425
22426 /*------------------------------------------------------------------------
22427 Fill in Event data and post to the Main FSM
22428 ------------------------------------------------------------------------*/
22429 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
22430 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
22431 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
22432 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
22433 wdiEventData.pUserData = pUserData;
22434
22435
22436 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22437}
22438
22439/**
22440 @brief Process 8023 Multicast List Request function
22441
22442 @param pWDICtx: pointer to the WLAN DAL context
22443 pEventData: pointer to the event information structure
22444
22445 @see
22446 @return Result of the function call
22447*/
22448WDI_Status
22449WDI_Process8023MulticastListReq
22450(
22451 WDI_ControlBlockType* pWDICtx,
22452 WDI_EventInfoType* pEventData
22453)
22454{
22455 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
22456 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
22457 wpt_uint8* pSendBuffer = NULL;
22458 wpt_uint16 usDataOffset = 0;
22459 wpt_uint16 usSendSize = 0;
22460 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
22461 wpt_uint8 i;
22462
22463 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22464 "%s",__FUNCTION__);
22465
22466 /*-------------------------------------------------------------------------
22467 Sanity check
22468 -------------------------------------------------------------------------*/
22469 if (( NULL == pEventData ) ||
22470 ( NULL == (pwdiFltPktSetMcListReqParamsType =
22471 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
22472 ( NULL == (wdi8023MulticastListCb =
22473 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
22474 {
22475 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22476 "%s: Invalid parameters", __FUNCTION__);
22477 WDI_ASSERT(0);
22478 return WDI_STATUS_E_FAILURE;
22479 }
22480
22481 /*-----------------------------------------------------------------------
22482 Get message buffer
22483 -----------------------------------------------------------------------*/
22484 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22485 WDI_8023_MULTICAST_LIST_REQ,
22486 sizeof(tHalRcvFltMcAddrListType),
22487 &pSendBuffer, &usDataOffset, &usSendSize))||
22488 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
22489 {
22490 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22491 "Unable to get send buffer in "
22492 "WDI_Process8023MulticastListReq() %x %x %x",
22493 pEventData, pwdiFltPktSetMcListReqParamsType,
22494 wdi8023MulticastListCb);
22495 WDI_ASSERT(0);
22496 return WDI_STATUS_E_FAILURE;
22497 }
22498
22499 rcvFltMcAddrListType.cMulticastAddr =
22500 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
22501 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
22502 {
22503 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
22504 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
22505 sizeof(tSirMacAddr));
22506 }
22507
22508 wpalMemoryCopy( pSendBuffer+usDataOffset,
22509 &rcvFltMcAddrListType,
22510 sizeof(rcvFltMcAddrListType));
22511
22512 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
22513 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
22514
22515
22516 /*-------------------------------------------------------------------------
22517 Send Get STA Request to HAL
22518 -------------------------------------------------------------------------*/
22519 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22520 wdi8023MulticastListCb, pEventData->pUserData,
22521 WDI_8023_MULTICAST_LIST_RESP);
22522}
22523
22524/**
22525 @brief Process Receive Filter Set Filter Request function
22526
22527 @param pWDICtx: pointer to the WLAN DAL context
22528 pEventData: pointer to the event information structure
22529
22530 @see
22531 @return Result of the function call
22532*/
22533WDI_Status
22534WDI_ProcessReceiveFilterSetFilterReq
22535(
22536 WDI_ControlBlockType* pWDICtx,
22537 WDI_EventInfoType* pEventData
22538)
22539{
22540 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
22541 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
22542 wpt_uint8* pSendBuffer = NULL;
22543 wpt_uint16 usDataOffset = 0;
22544 wpt_uint16 usSendSize = 0;
22545 wpt_uint32 usRcvPktFilterCfgSize;
22546 tHalRcvPktFilterCfgType *pRcvPktFilterCfg;
22547 wpt_uint8 i;
22548
22549 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22550 "%s",__FUNCTION__);
22551
22552 /*-------------------------------------------------------------------------
22553 Sanity check
22554 -------------------------------------------------------------------------*/
22555 if (( NULL == pEventData ) ||
22556 ( NULL == (pwdiSetRcvPktFilterReqInfo =
22557 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
22558 ( NULL == (wdiReceiveFilterSetFilterCb =
22559 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
22560 {
22561 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22562 "%s: Invalid parameters", __FUNCTION__);
22563 WDI_ASSERT(0);
22564 return WDI_STATUS_E_FAILURE;
22565 }
22566
22567 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
22568 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
22569 * sizeof(tHalRcvPktFilterParams));
22570
22571 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
22572 usRcvPktFilterCfgSize);
22573
22574 if(NULL == pRcvPktFilterCfg)
22575 {
22576 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22577 "%s: Failed to allocate memory for "
22578 "tHalRcvPktFilterCfgType: %x %x %x ",
22579 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
22580 WDI_ASSERT(0);
22581 return WDI_STATUS_E_FAILURE;
22582 }
22583
22584 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
22585
22586 /*-----------------------------------------------------------------------
22587 Get message buffer
22588 -----------------------------------------------------------------------*/
22589 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
22590 usRcvPktFilterCfgSize,
22591 &pSendBuffer, &usDataOffset, &usSendSize))||
22592 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
22593 {
22594 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22595 "Unable to get send buffer in "
22596 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
22597 pEventData, pwdiSetRcvPktFilterReqInfo,
22598 wdiReceiveFilterSetFilterCb);
22599 WDI_ASSERT(0);
22600 wpalMemoryFree(pRcvPktFilterCfg);
22601 return WDI_STATUS_E_FAILURE;
22602 }
22603
22604 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22605 "UsData Off %d UsSend %d cfg %d",usDataOffset,
22606 usSendSize,usRcvPktFilterCfgSize);
22607
22608 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
22609 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
22610 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
22611 pRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
22612
22613
22614 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22615 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
22616 pRcvPktFilterCfg->filterType);
22617 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22618 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
22619 pRcvPktFilterCfg->coleasceTime);
22620
22621 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
22622 {
22623 pRcvPktFilterCfg->paramsData[i].protocolLayer =
22624 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
22625 pRcvPktFilterCfg->paramsData[i].cmpFlag =
22626 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
22627 pRcvPktFilterCfg->paramsData[i].dataOffset =
22628 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
22629 pRcvPktFilterCfg->paramsData[i].dataLength =
22630 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
22631
22632 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
22633 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
22634 8);
22635 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
22636 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
22637 8);
22638
22639 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22640 "Out:Proto %d Comp Flag %d \n",
22641 pRcvPktFilterCfg->paramsData[i].protocolLayer,
22642 pRcvPktFilterCfg->paramsData[i].cmpFlag);
22643
22644 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22645 "Data Offset %d Data Len %d\n",
22646 pRcvPktFilterCfg->paramsData[i].dataOffset,
22647 pRcvPktFilterCfg->paramsData[i].dataLength);
22648
22649 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22650 "CData: %d:%d:%d:%d:%d:%d\n",
22651 pRcvPktFilterCfg->paramsData[i].compareData[0],
22652 pRcvPktFilterCfg->paramsData[i].compareData[1],
22653 pRcvPktFilterCfg->paramsData[i].compareData[2],
22654 pRcvPktFilterCfg->paramsData[i].compareData[3],
22655 pRcvPktFilterCfg->paramsData[i].compareData[4],
22656 pRcvPktFilterCfg->paramsData[i].compareData[5]);
22657
22658 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22659 "MData: %d:%d:%d:%d:%d:%d\n",
22660 pRcvPktFilterCfg->paramsData[i].dataMask[0],
22661 pRcvPktFilterCfg->paramsData[i].dataMask[1],
22662 pRcvPktFilterCfg->paramsData[i].dataMask[2],
22663 pRcvPktFilterCfg->paramsData[i].dataMask[3],
22664 pRcvPktFilterCfg->paramsData[i].dataMask[4],
22665 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
22666 }
22667
22668 wpalMemoryCopy( pSendBuffer+usDataOffset,
22669 pRcvPktFilterCfg,
22670 usRcvPktFilterCfgSize);
22671
22672
22673 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
22674 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
22675
22676 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22677 "%s",__FUNCTION__);
22678 wpalMemoryFree(pRcvPktFilterCfg);
22679
22680 /*-------------------------------------------------------------------------
22681 Send Get STA Request to HAL
22682 -------------------------------------------------------------------------*/
22683 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22684 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
22685 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
22686}
22687
22688/**
22689 @brief Process Packet Filter Match Count Request function
22690
22691 @param pWDICtx: pointer to the WLAN DAL context
22692 pEventData: pointer to the event information structure
22693
22694 @see
22695 @return Result of the function call
22696*/
22697WDI_Status
22698WDI_ProcessFilterMatchCountReq
22699(
22700 WDI_ControlBlockType* pWDICtx,
22701 WDI_EventInfoType* pEventData
22702)
22703{
22704 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
22705 NULL;
22706 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
22707 NULL;
22708 wpt_uint8* pSendBuffer = NULL;
22709 wpt_uint16 usDataOffset = 0;
22710 wpt_uint16 usSendSize = 0;
22711
22712 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22713 "%s",__FUNCTION__);
22714
22715 /*-------------------------------------------------------------------------
22716 Sanity check
22717 -------------------------------------------------------------------------*/
22718 if (( NULL == pEventData ) ||
22719 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
22720 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
22721 ( NULL == (wdiFilterMatchCountCb =
22722 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
22723 {
22724 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22725 "%s: Invalid parameters", __FUNCTION__);
22726 WDI_ASSERT(0);
22727 return WDI_STATUS_E_FAILURE;
22728 }
22729
22730 /*-----------------------------------------------------------------------
22731 Get message buffer
22732 -----------------------------------------------------------------------*/
22733 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22734 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
22735 0,
22736 &pSendBuffer, &usDataOffset, &usSendSize))||
22737 ( usSendSize < usDataOffset))
22738 {
22739 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22740 "Unable to get send buffer in "
22741 "WDI_ProcessFilterMatchCountReq() %x %x %x",
22742 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
22743 wdiFilterMatchCountCb);
22744 WDI_ASSERT(0);
22745 return WDI_STATUS_E_FAILURE;
22746 }
22747
22748 //
22749 // Don't need to fill send buffer other than header
22750 //
22751 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
22752 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
22753
22754
22755 /*-------------------------------------------------------------------------
22756 Send Get STA Request to HAL
22757 -------------------------------------------------------------------------*/
22758 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22759 wdiFilterMatchCountCb,
22760 pEventData->pUserData,
22761 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
22762}
22763
22764/**
22765 @brief Process Receive Filter Clear Filter Request function
22766
22767 @param pWDICtx: pointer to the WLAN DAL context
22768 pEventData: pointer to the event information structure
22769
22770 @see
22771 @return Result of the function call
22772*/
22773WDI_Status
22774WDI_ProcessReceiveFilterClearFilterReq
22775(
22776 WDI_ControlBlockType* pWDICtx,
22777 WDI_EventInfoType* pEventData
22778)
22779{
22780 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
22781 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
22782 wpt_uint8* pSendBuffer = NULL;
22783 wpt_uint16 usDataOffset = 0;
22784 wpt_uint16 usSendSize = 0;
22785 tHalRcvFltPktClearParam rcvFltPktClearParam;
22786
22787 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22788 "%s",__FUNCTION__);
22789
22790 /*-------------------------------------------------------------------------
22791 Sanity check
22792 -------------------------------------------------------------------------*/
22793 if (( NULL == pEventData ) ||
22794 ( NULL == (pwdiRcvFltPktClearReqParamsType =
22795 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
22796 ( NULL == (wdiRcvFltPktClearFilterCb =
22797 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
22798 {
22799 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22800 "%s: Invalid parameters", __FUNCTION__);
22801 WDI_ASSERT(0);
22802 return WDI_STATUS_E_FAILURE;
22803 }
22804
22805 /*-----------------------------------------------------------------------
22806 Get message buffer
22807 -----------------------------------------------------------------------*/
22808 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22809 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
22810 sizeof(tHalRcvFltPktClearParam),
22811 &pSendBuffer, &usDataOffset, &usSendSize))||
22812 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
22813 {
22814 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22815 "Unable to get send buffer in "
22816 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
22817 pEventData, pwdiRcvFltPktClearReqParamsType,
22818 wdiRcvFltPktClearFilterCb);
22819 WDI_ASSERT(0);
22820 return WDI_STATUS_E_FAILURE;
22821 }
22822
22823
22824 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
22825 filterClearParam.status;
22826 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
22827 filterClearParam.filterId;
22828
22829 wpalMemoryCopy( pSendBuffer+usDataOffset,
22830 &rcvFltPktClearParam,
22831 sizeof(rcvFltPktClearParam));
22832
22833 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
22834 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
22835
22836
22837 /*-------------------------------------------------------------------------
22838 Send Get STA Request to HAL
22839 -------------------------------------------------------------------------*/
22840 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22841 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
22842 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
22843}
22844
22845/**
22846 @brief Process 8023 Multicast List Response function
22847
22848 @param pWDICtx: pointer to the WLAN DAL context
22849 pEventData: pointer to the event information structure
22850
22851 @see
22852 @return Result of the function call
22853*/
22854WDI_Status
22855WDI_Process8023MulticastListRsp
22856(
22857 WDI_ControlBlockType* pWDICtx,
22858 WDI_EventInfoType* pEventData
22859)
22860{
22861 WDI_Status wdiStatus;
22862 eHalStatus halStatus;
22863 WDI_8023MulticastListCb wdi8023MulticastListCb;
22864 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22865
22866 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22867 "%s",__FUNCTION__);
22868
22869 /*-------------------------------------------------------------------------
22870 Sanity check
22871 -------------------------------------------------------------------------*/
22872 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22873 ( NULL == pEventData->pEventData ))
22874 {
22875 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22876 "%s: Invalid parameters", __FUNCTION__);
22877 WDI_ASSERT(0);
22878 return WDI_STATUS_E_FAILURE;
22879 }
22880
22881 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
22882
22883 /*-------------------------------------------------------------------------
22884 Extract response and send it to UMAC
22885 -------------------------------------------------------------------------*/
22886 halStatus = *((eHalStatus*)pEventData->pEventData);
22887 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22888
22889 /*Notify UMAC*/
22890 wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData);
22891
22892 return WDI_STATUS_SUCCESS;
22893}
22894
22895/**
22896 @brief Process Set Rsp function (called when a
22897 response is being received over the bus from HAL)
22898
22899 @param pWDICtx: pointer to the WLAN DAL context
22900 pEventData: pointer to the event information structure
22901
22902 @see
22903 @return Result of the function call
22904*/
22905WDI_Status
22906WDI_ProcessReceiveFilterSetFilterRsp
22907(
22908 WDI_ControlBlockType* pWDICtx,
22909 WDI_EventInfoType* pEventData
22910)
22911{
22912 WDI_Status wdiStatus;
22913 eHalStatus halStatus;
22914 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
22915 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22916
22917 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22918 "%s",__FUNCTION__);
22919
22920 /*-------------------------------------------------------------------------
22921 Sanity check
22922 -------------------------------------------------------------------------*/
22923 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22924 ( NULL == pEventData->pEventData ))
22925 {
22926 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22927 "%s: Invalid parameters", __FUNCTION__);
22928 WDI_ASSERT(0);
22929 return WDI_STATUS_E_FAILURE;
22930 }
22931
22932 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
22933 pfncRspCB;
22934
22935 /*-------------------------------------------------------------------------
22936 Extract response and send it to UMAC
22937 -------------------------------------------------------------------------*/
22938 halStatus = *((eHalStatus*)pEventData->pEventData);
22939 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22940
22941 /*Notify UMAC*/
22942 wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22943
22944 return WDI_STATUS_SUCCESS;
22945}
22946
22947/**
22948 @brief Process Packet Filter Match Count Response function
22949
22950 @param pWDICtx: pointer to the WLAN DAL context
22951 pEventData: pointer to the event information structure
22952
22953 @see
22954 @return Result of the function call
22955*/
22956WDI_Status
22957WDI_ProcessFilterMatchCountRsp
22958(
22959 WDI_ControlBlockType* pWDICtx,
22960 WDI_EventInfoType* pEventData
22961)
22962{
22963 WDI_Status wdiStatus;
22964 eHalStatus halStatus;
22965
22966 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
22967
22968 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22969
22970 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22971 "%s",__FUNCTION__);
22972
22973 /*-------------------------------------------------------------------------
22974 Sanity check
22975 -------------------------------------------------------------------------*/
22976 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22977 ( NULL == pEventData->pEventData ))
22978 {
22979 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22980 "%s: Invalid parameters", __FUNCTION__);
22981 WDI_ASSERT(0);
22982 return WDI_STATUS_E_FAILURE;
22983 }
22984
22985 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
22986
22987 /*-------------------------------------------------------------------------
22988 Extract response and send it to UMAC
22989 -------------------------------------------------------------------------*/
22990 halStatus = *((eHalStatus*)pEventData->pEventData);
22991 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
22992
22993 /*Notify UMAC*/
22994 wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData);
22995
22996 return WDI_STATUS_SUCCESS;
22997}
22998
22999/**
23000 @brief Process Receive Filter Clear Filter Response function
23001
23002 @param pWDICtx: pointer to the WLAN DAL context
23003 pEventData: pointer to the event information structure
23004
23005 @see
23006 @return Result of the function call
23007*/
23008WDI_Status
23009WDI_ProcessReceiveFilterClearFilterRsp
23010(
23011 WDI_ControlBlockType* pWDICtx,
23012 WDI_EventInfoType* pEventData
23013)
23014{
23015 WDI_Status wdiStatus;
23016 eHalStatus halStatus;
23017 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
23018 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23019
23020 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23021 "%s",__FUNCTION__);
23022
23023 /*-------------------------------------------------------------------------
23024 Sanity check
23025 -------------------------------------------------------------------------*/
23026 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23027 ( NULL == pEventData->pEventData ))
23028 {
23029 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23030 "%s: Invalid parameters", __FUNCTION__);
23031 WDI_ASSERT(0);
23032 return WDI_STATUS_E_FAILURE;
23033 }
23034
23035 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
23036 pfncRspCB;
23037
23038 /*-------------------------------------------------------------------------
23039 Extract response and send it to UMAC
23040 -------------------------------------------------------------------------*/
23041 halStatus = *((eHalStatus*)pEventData->pEventData);
23042 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23043
23044 /*Notify UMAC*/
23045 wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23046
23047 return WDI_STATUS_SUCCESS;
23048}
23049#endif // WLAN_FEATURE_PACKET_FILTERING
23050
23051/**
23052 @brief Process Shutdown Rsp function
23053 There is no shutdown response comming from HAL
23054 - function just kept for simmetry
23055
23056 @param pWDICtx: pointer to the WLAN DAL context
23057 pEventData: pointer to the event information structure
23058
23059 @see
23060 @return Result of the function call
23061*/
23062WDI_Status
23063WDI_ProcessShutdownRsp
23064(
23065 WDI_ControlBlockType* pWDICtx,
23066 WDI_EventInfoType* pEventData
23067)
23068{
23069 /*There is no shutdown response comming from HAL - function just kept for
23070 simmetry */
23071 WDI_ASSERT(0);
23072 return WDI_STATUS_SUCCESS;
23073}/*WDI_ProcessShutdownRsp*/
23074
23075/**
23076 @brief WDI_SetPowerParamsReq
23077
23078 @param pwdiPowerParamsReqParams: the Set Power Params as
23079 specified by the Device Interface
23080
23081 wdiPowerParamsCb: callback for passing back the response
23082 of the Set Power Params operation received from the
23083 device
23084
23085 pUserData: user data will be passed back with the
23086 callback
23087
23088 @return Result of the function call
23089*/
23090WDI_Status
23091WDI_SetPowerParamsReq
23092(
23093 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23094 WDI_SetPowerParamsCb wdiPowerParamsCb,
23095 void* pUserData
23096)
23097{
23098 WDI_EventInfoType wdiEventData;
23099 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23100
23101 /*------------------------------------------------------------------------
23102 Sanity Check
23103 ------------------------------------------------------------------------*/
23104 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23105 {
23106 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23107 "WDI API call before module is initialized - Fail request");
23108
23109 return WDI_STATUS_E_NOT_ALLOWED;
23110 }
23111
23112 /*------------------------------------------------------------------------
23113 Fill in Event data and post to the Main FSM
23114 ------------------------------------------------------------------------*/
23115 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
23116 wdiEventData.pEventData = pwdiPowerParamsReqParams;
23117 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
23118 wdiEventData.pCBfnc = wdiPowerParamsCb;
23119 wdiEventData.pUserData = pUserData;
23120
23121 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23122}/*WDI_SetPowerParamsReq*/
23123
23124/**
23125 @brief Process Set Power Params Request function
23126
23127 @param pWDICtx: pointer to the WLAN DAL context
23128 pEventData: pointer to the event information structure
23129
23130 @see
23131 @return Result of the function call
23132*/
23133WDI_Status
23134WDI_ProcessSetPowerParamsReq
23135(
23136 WDI_ControlBlockType* pWDICtx,
23137 WDI_EventInfoType* pEventData
23138)
23139{
23140 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
23141 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
23142 wpt_uint8* pSendBuffer = NULL;
23143 wpt_uint16 usDataOffset = 0;
23144 wpt_uint16 usSendSize = 0;
23145 tSetPowerParamsType powerParams;
23146
23147 /*-------------------------------------------------------------------------
23148 Sanity check
23149 -------------------------------------------------------------------------*/
23150 if (( NULL == pEventData ) ||
23151 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
23152 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
23153 {
23154 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23155 "%s: Invalid parameters", __FUNCTION__);
23156 WDI_ASSERT(0);
23157 return WDI_STATUS_E_FAILURE;
23158 }
23159
23160 /*-----------------------------------------------------------------------
23161 Get message buffer
23162 -----------------------------------------------------------------------*/
23163 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
23164 sizeof(powerParams),
23165 &pSendBuffer, &usDataOffset, &usSendSize))||
23166 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
23167 {
23168 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23169 "Unable to get send buffer in Set PNO req %x %x %x",
23170 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
23171 WDI_ASSERT(0);
23172 return WDI_STATUS_E_FAILURE;
23173 }
23174
23175 /* Ignore DTIM */
23176 powerParams.uIgnoreDTIM =
23177 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
23178
23179 /*DTIM Period*/
23180 powerParams.uDTIMPeriod =
23181 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
23182
23183 /* Listen Interval */
23184 powerParams.uListenInterval=
23185 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
23186
23187 /* Broadcast Multicas Filter */
23188 powerParams.uBcastMcastFilter =
23189 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
23190
23191 /* Beacon Early Termination */
23192 powerParams.uEnableBET =
23193 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
23194
23195 /* Beacon Early Termination Interval */
23196 powerParams.uBETInterval =
23197 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
23198
23199
23200 wpalMemoryCopy( pSendBuffer+usDataOffset,
23201 &powerParams,
23202 sizeof(powerParams));
23203
23204 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
23205 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
23206
23207 /*-------------------------------------------------------------------------
23208 Send Get STA Request to HAL
23209 -------------------------------------------------------------------------*/
23210 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23211 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
23212}
23213
23214/**
23215 @brief Process Power Params Rsp function (called when a
23216 response is being received over the bus from HAL)
23217
23218 @param pWDICtx: pointer to the WLAN DAL context
23219 pEventData: pointer to the event information structure
23220
23221 @see
23222 @return Result of the function call
23223*/
23224WDI_Status
23225WDI_ProcessSetPowerParamsRsp
23226(
23227 WDI_ControlBlockType* pWDICtx,
23228 WDI_EventInfoType* pEventData
23229)
23230{
23231 WDI_Status wdiStatus;
23232 eHalStatus halStatus;
23233 WDI_SetPowerParamsCb wdiPowerParamsCb;
23234 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23235
23236 /*-------------------------------------------------------------------------
23237 Sanity check
23238 -------------------------------------------------------------------------*/
23239 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23240 ( NULL == pEventData->pEventData ))
23241 {
23242 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23243 "%s: Invalid parameters", __FUNCTION__);
23244 WDI_ASSERT(0);
23245 return WDI_STATUS_E_FAILURE;
23246 }
23247
23248 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
23249
23250 /*-------------------------------------------------------------------------
23251 Extract response and send it to UMAC
23252 -------------------------------------------------------------------------*/
23253 halStatus = *((eHalStatus*)pEventData->pEventData);
23254 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23255
23256 /*Notify UMAC*/
23257 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23258
23259 return WDI_STATUS_SUCCESS;
23260}/*WDI_ProcessSetPowerParamsRsp*/
23261
23262#ifdef WLAN_FEATURE_GTK_OFFLOAD
23263/**
23264 @brief WDI_GTKOffloadReq will be called when the upper MAC
23265 wants to set GTK Rekey Counter while in power save. Upon
23266 the call of this API the WLAN DAL will pack and send a
23267 HAL GTK offload request message to the lower RIVA
23268 sub-system if DAL is in state STARTED.
23269
23270 In state BUSY this request will be queued. Request won't
23271 be allowed in any other state.
23272
23273 WDI_PostAssocReq must have been called.
23274
23275 @param pwdiGtkOffloadParams: the GTK offload as specified
23276 by the Device Interface
23277
23278 wdiGtkOffloadCb: callback for passing back the response
23279 of the GTK offload operation received from the device
23280
23281 pUserData: user data will be passed back with the
23282 callback
23283
23284 @see WDI_PostAssocReq
23285 @return Result of the function call
23286*/
23287WDI_Status
23288WDI_GTKOffloadReq
23289(
23290 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
23291 WDI_GtkOffloadCb wdiGtkOffloadCb,
23292 void* pUserData
23293)
23294{
23295 WDI_EventInfoType wdiEventData = {0};
23296 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23297
23298 /*------------------------------------------------------------------------
23299 Sanity Check
23300 ------------------------------------------------------------------------*/
23301 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23302 {
23303 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23304 "WDI API call before module is initialized - Fail request");
23305
23306 return WDI_STATUS_E_NOT_ALLOWED;
23307 }
23308
23309 /*------------------------------------------------------------------------
23310 Fill in Event data and post to the Main FSM
23311 ------------------------------------------------------------------------*/
23312 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
23313 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
23314 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
23315 wdiEventData.pCBfnc = wdiGtkOffloadCb;
23316 wdiEventData.pUserData = pUserData;
23317
23318 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23319}
23320
23321
23322/**
23323 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
23324 MAC wants to get GTK Rekey Counter while in power save.
23325 Upon the call of this API the WLAN DAL will pack and
23326 send a HAL GTK offload request message to the lower RIVA
23327 sub-system if DAL is in state STARTED.
23328
23329 In state BUSY this request will be queued. Request won't
23330 be allowed in any other state.
23331
23332 WDI_PostAssocReq must have been called.
23333
23334 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
23335 Information Message as specified by the
23336 Device Interface
23337
23338 wdiGtkOffloadGetInfoCb: callback for passing back the
23339 response of the GTK offload operation received from the
23340 device
23341
23342 pUserData: user data will be passed back with the
23343 callback
23344
23345 @see WDI_PostAssocReq
23346 @return Result of the function call
23347*/
23348WDI_Status
23349WDI_GTKOffloadGetInfoReq
23350(
23351 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
23352 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
23353 void* pUserData
23354)
23355{
23356 WDI_EventInfoType wdiEventData = {0};
23357 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23358
23359 /*------------------------------------------------------------------------
23360 Sanity Check
23361 ------------------------------------------------------------------------*/
23362 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23363 {
23364 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23365 "WDI API call before module is initialized - Fail request");
23366
23367 return WDI_STATUS_E_NOT_ALLOWED;
23368 }
23369
23370 /*------------------------------------------------------------------------
23371 Fill in Event data and post to the Main FSM
23372 ------------------------------------------------------------------------*/
23373 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
23374 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
23375 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
23376 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
23377 wdiEventData.pUserData = pUserData;
23378
23379 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23380}
23381
23382
23383/**
23384 @brief Process set GTK Offload Request function
23385
23386 @param pWDICtx: pointer to the WLAN DAL context
23387 pEventData: pointer to the event information structure
23388
23389 @see
23390 @return Result of the function call
23391*/
23392WDI_Status
23393WDI_ProcessGTKOffloadReq
23394(
23395 WDI_ControlBlockType* pWDICtx,
23396 WDI_EventInfoType* pEventData
23397)
23398{
23399 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
23400 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23401 wpt_uint8* pSendBuffer = NULL;
23402 wpt_uint16 usDataOffset = 0;
23403 wpt_uint16 usSendSize = 0;
23404 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
23405 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23406
23407 /*-------------------------------------------------------------------------
23408 Sanity check
23409 -------------------------------------------------------------------------*/
23410 if (( NULL == pEventData ) ||
23411 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
23412 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
23413 {
23414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23415 "%s: Invalid parameters", __FUNCTION__);
23416 WDI_ASSERT(0);
23417 return WDI_STATUS_E_FAILURE;
23418 }
23419
23420 /*-----------------------------------------------------------------------
23421 Get message buffer
23422 -----------------------------------------------------------------------*/
23423 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
23424 sizeof(gtkOffloadReqParams),
23425 &pSendBuffer, &usDataOffset, &usSendSize))||
23426 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
23427 {
23428 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23429 "Unable to get send buffer in GTK offload req %x %x %x",
23430 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
23431 WDI_ASSERT(0);
23432 return WDI_STATUS_E_FAILURE;
23433 }
23434
23435 //
23436 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
23437 //
23438 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
23439 // Copy KCK
23440 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
23441 // Copy KEK
23442 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
23443 // Copy KeyReplayCounter
23444 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
23445
23446 wpalMemoryCopy( pSendBuffer+usDataOffset,
23447 &gtkOffloadReqParams,
23448 sizeof(gtkOffloadReqParams));
23449
23450 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
23451 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
23452
23453 /*-------------------------------------------------------------------------
23454 Send Get STA Request to HAL
23455 -------------------------------------------------------------------------*/
23456 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23457 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
23458}
23459
23460
23461/**
23462 @brief Process GTK Offload Get Information Request function
23463
23464 @param pWDICtx: pointer to the WLAN DAL context
23465 pEventData: pointer to the event information structure
23466
23467 @see
23468 @return Result of the function call
23469*/
23470WDI_Status
23471WDI_ProcessGTKOffloadGetInfoReq
23472(
23473 WDI_ControlBlockType* pWDICtx,
23474 WDI_EventInfoType* pEventData
23475)
23476{
23477 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
23478 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23479 wpt_uint8* pSendBuffer = NULL;
23480 wpt_uint16 usDataOffset = 0;
23481 wpt_uint16 usSendSize = 0;
23482
23483 /*-------------------------------------------------------------------------
23484 Sanity check
23485 -------------------------------------------------------------------------*/
23486 if (( NULL == pEventData ) ||
23487 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
23488 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
23489 {
23490 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23491 "%s: Invalid parameters", __FUNCTION__);
23492 WDI_ASSERT(0);
23493 return WDI_STATUS_E_FAILURE;
23494 }
23495
23496 /*-----------------------------------------------------------------------
23497 Get message buffer
23498 -----------------------------------------------------------------------*/
23499 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
23500 0,
23501 &pSendBuffer, &usDataOffset, &usSendSize))||
23502 ( usSendSize < usDataOffset))
23503 {
23504 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23505 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
23506 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
23507 WDI_ASSERT(0);
23508 return WDI_STATUS_E_FAILURE;
23509 }
23510
23511 //
23512 // Don't need to fill send buffer other than header
23513 //
23514
23515 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
23516 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
23517
23518 /*-------------------------------------------------------------------------
23519 Send Get STA Request to HAL
23520 -------------------------------------------------------------------------*/
23521 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23522 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
23523}
23524
23525/**
23526 @brief Process host offload Rsp function (called when a
23527 response is being received over the bus from HAL)
23528
23529 @param pWDICtx: pointer to the WLAN DAL context
23530 pEventData: pointer to the event information structure
23531
23532 @see
23533 @return Result of the function call
23534*/
23535WDI_Status
23536WDI_ProcessGtkOffloadRsp
23537(
23538 WDI_ControlBlockType* pWDICtx,
23539 WDI_EventInfoType* pEventData
23540)
23541{
23542 WDI_Status wdiStatus;
23543 eHalStatus halStatus;
23544 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23545 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23546
23547 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
23548
23549 /*-------------------------------------------------------------------------
23550 Sanity check
23551 -------------------------------------------------------------------------*/
23552 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23553 ( NULL == pEventData->pEventData))
23554 {
23555 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23556 "%s: Invalid parameters", __FUNCTION__);
23557 WDI_ASSERT(0);
23558 return WDI_STATUS_E_FAILURE;
23559 }
23560
23561 /*-------------------------------------------------------------------------
23562 Extract response and send it to UMAC
23563 -------------------------------------------------------------------------*/
23564 halStatus = *((eHalStatus*)pEventData->pEventData);
23565 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23566
23567 /*Notify UMAC*/
23568 wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
23569
23570 return WDI_STATUS_SUCCESS;
23571}
23572
23573/**
23574 @brief Process GTK Offload Get Information Response function
23575
23576 @param pWDICtx: pointer to the WLAN DAL context
23577 pEventData: pointer to the event information structure
23578
23579 @see
23580 @return Result of the function call
23581*/
23582WDI_Status
23583WDI_ProcessGTKOffloadGetInfoRsp
23584(
23585 WDI_ControlBlockType* pWDICtx,
23586 WDI_EventInfoType* pEventData
23587)
23588{
23589 WDI_Status wdiStatus;
23590 eHalStatus halStatus;
23591
23592 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23593
23594 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23595
23596 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
23597
23598 /*-------------------------------------------------------------------------
23599 Sanity check
23600 -------------------------------------------------------------------------*/
23601 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23602 ( NULL == pEventData->pEventData ))
23603 {
23604 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23605 "%s: Invalid parameters", __FUNCTION__);
23606 WDI_ASSERT(0);
23607 return WDI_STATUS_E_FAILURE;
23608 }
23609
23610 /*-------------------------------------------------------------------------
23611 Extract response and send it to UMAC
23612 -------------------------------------------------------------------------*/
23613 halStatus = *((eHalStatus*)pEventData->pEventData);
23614 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23615
23616 /*Notify UMAC*/
23617 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23618 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23619 wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData);
23620
23621 return WDI_STATUS_SUCCESS;
23622}
23623#endif // WLAN_FEATURE_GTK_OFFLOAD
23624
23625#ifdef WLAN_WAKEUP_EVENTS
23626WDI_Status
23627WDI_ProcessWakeReasonInd
23628(
23629 WDI_ControlBlockType* pWDICtx,
23630 WDI_EventInfoType* pEventData
23631)
23632{
23633 WDI_LowLevelIndType *pWdiInd;
23634 tpWakeReasonParams pWakeReasonParams;
23635 wpt_uint32 allocSize = 0;
23636
23637 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23638 "+%s", __FUNCTION__);
23639
23640 /*-------------------------------------------------------------------------
23641 Sanity check
23642 -------------------------------------------------------------------------*/
23643 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23644 ( NULL == pEventData->pEventData ))
23645 {
23646 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23647 "%s: Invalid parameters", __FUNCTION__);
23648 WDI_ASSERT( 0 );
23649 return WDI_STATUS_E_FAILURE;
23650 }
23651
23652 /*-------------------------------------------------------------------------
23653 Extract indication and send it to UMAC
23654 -------------------------------------------------------------------------*/
23655 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
23656
23657 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
23658
23659 //Allocate memory for WDI_WakeReasonIndType structure
23660 pWdiInd = wpalMemoryAllocate(allocSize) ;
23661
23662 if(NULL == pWdiInd)
23663 {
23664 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23665 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
23666 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23667 WDI_ASSERT(0);
23668 return WDI_STATUS_E_FAILURE;
23669 }
23670
23671 wpalMemoryZero(pWdiInd, allocSize);
23672
23673 /* Fill in the indication parameters*/
23674 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
23675 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
23676 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
23677 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
23678 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
23679 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
23680 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
23681 &(pWakeReasonParams->aDataStart[0]),
23682 pWakeReasonParams->ulStoredDataLen);
23683
23684 /*Notify UMAC*/
23685 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
23686
23687 //Free memory allocated for WDI_WakeReasonIndType structure
23688 wpalMemoryFree(pWdiInd);
23689
23690 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23691 "-%s", __FUNCTION__);
23692
23693 return WDI_STATUS_SUCCESS;
23694}
23695#endif // WLAN_WAKEUP_EVENTS
23696
23697void WDI_GetWcnssCompiledApiVersion
23698(
23699 WDI_WlanVersionType *pWcnssApiVersion
23700)
23701{
23702 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
23703 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
23704 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
23705 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
23706}
23707
23708/**
23709 @brief Process Set TM Level Rsp function (called when a
23710 response is being received over the bus from HAL)
23711
23712 @param pWDICtx: pointer to the WLAN DAL context
23713 pEventData: pointer to the event information structure
23714
23715 @see
23716 @return Result of the function call
23717*/
23718WDI_Status
23719WDI_ProcessSetTmLevelRsp
23720(
23721 WDI_ControlBlockType* pWDICtx,
23722 WDI_EventInfoType* pEventData
23723)
23724{
23725 WDI_Status wdiStatus;
23726 eHalStatus halStatus;
23727 WDI_SetTmLevelCb wdiSetTmLevelCb;
23728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23729
23730 /*-------------------------------------------------------------------------
23731 Sanity check
23732 -------------------------------------------------------------------------*/
23733 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23734 ( NULL == pEventData->pEventData ))
23735 {
23736 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23737 "%s: Invalid parameters", __FUNCTION__);
23738 WDI_ASSERT(0);
23739 return WDI_STATUS_E_FAILURE;
23740 }
23741
23742 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
23743
23744 /*-------------------------------------------------------------------------
23745 Extract response and send it to UMAC
23746 -------------------------------------------------------------------------*/
23747 halStatus = *((eHalStatus*)pEventData->pEventData);
23748 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23749
23750 /*Notify UMAC*/
23751 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
23752
23753 return WDI_STATUS_SUCCESS;
23754}/*WDI_ProcessSetTmLevelRsp*/
23755
23756/**
23757 @brief Process Set Thermal Mitigation level Changed request
23758
23759 @param pWDICtx: pointer to the WLAN DAL context
23760 pEventData: pointer to the event information structure
23761
23762 @see
23763 @return Result of the function call
23764*/
23765WDI_Status
23766WDI_ProcessSetTmLevelReq
23767(
23768 WDI_ControlBlockType* pWDICtx,
23769 WDI_EventInfoType* pEventData
23770)
23771{
23772 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
23773 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
23774 wpt_uint8* pSendBuffer = NULL;
23775 wpt_uint16 usDataOffset = 0;
23776 wpt_uint16 usSendSize = 0;
23777 tSetThermalMitgationType halTmMsg;
23778
23779 /*-------------------------------------------------------------------------
23780 Sanity check
23781 -------------------------------------------------------------------------*/
23782 if (( NULL == pEventData ) ||
23783 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
23784 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
23785 {
23786 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23787 "%s: Invalid parameters", __FUNCTION__);
23788 WDI_ASSERT(0);
23789 return WDI_STATUS_E_FAILURE;
23790 }
23791
23792 /*-----------------------------------------------------------------------
23793 Get message buffer
23794 -----------------------------------------------------------------------*/
23795 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
23796 sizeof(halTmMsg),
23797 &pSendBuffer, &usDataOffset, &usSendSize))||
23798 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
23799 {
23800 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23801 "Unable to get send buffer in Set PNO req %x %x %x",
23802 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
23803 WDI_ASSERT(0);
23804 return WDI_STATUS_E_FAILURE;
23805 }
23806
23807 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
23808 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
23809
23810 wpalMemoryCopy( pSendBuffer+usDataOffset,
23811 &halTmMsg,
23812 sizeof(halTmMsg));
23813
23814 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
23815 pWDICtx->pfncRspCB = NULL;
23816 /*-------------------------------------------------------------------------
23817 Send Get STA Request to HAL
23818 -------------------------------------------------------------------------*/
23819 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23820 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
23821}
23822
23823/* Fill the value from the global features enabled array to the global capabilities
23824 * bitmap struct
23825 */
23826static void
23827FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
23828{
23829 wpt_int8 i;
23830 for (i=0; i<len; i++)
23831 {
23832 setFeatCaps(fCaps, enabledFeat[i]);
23833 }
23834}
23835
23836/**
23837 @brief WDI_featureCapsExchangeReq
23838 Post feature capability bitmap exchange event.
23839 Host will send its own capability to FW in this req and
23840 expect FW to send its capability back as a bitmap in Response
23841
23842 @param
23843
23844 wdiFeatureCapsExchangeCb: callback called on getting the response.
23845 It is kept to mantain similarity between WDI reqs and if needed, can
23846 be used in future. Currently, It is set to NULL
23847
23848 pUserData: user data will be passed back with the
23849 callback
23850
23851 @see
23852 @return Result of the function call
23853*/
23854WDI_Status
23855WDI_featureCapsExchangeReq
23856(
23857 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
23858 void* pUserData
23859)
23860{
23861 WDI_EventInfoType wdiEventData;
23862 wpt_int32 fCapsStructSize;
23863
23864 /*------------------------------------------------------------------------
23865 Sanity Check
23866 ------------------------------------------------------------------------*/
23867 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23868 {
23869 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23870 "WDI API call before module is initialized - Fail request");
23871
23872 return WDI_STATUS_E_NOT_ALLOWED;
23873 }
23874
23875 /* Allocate memory separately for global variable carrying FW caps */
23876 fCapsStructSize = sizeof(tWlanFeatCaps);
23877 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
23878 if ( NULL == gpHostWlanFeatCaps )
23879 {
23880 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23881 "Cannot allocate memory for host capability info\n");
23882 WDI_ASSERT(0);
23883 return WDI_STATUS_MEM_FAILURE;
23884 }
23885
23886 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
23887
23888 /*------------------------------------------------------------------------
23889 Fill in Event data and post to the Main FSM
23890 ------------------------------------------------------------------------*/
23891 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
23892 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
23893 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23894 "bit 0 - %x %x %x %x - bit 128\n",
23895 gpHostWlanFeatCaps->featCaps[0],
23896 gpHostWlanFeatCaps->featCaps[1],
23897 gpHostWlanFeatCaps->featCaps[2],
23898 gpHostWlanFeatCaps->featCaps[3]
23899 );
23900
23901 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
23902 wdiEventData.pEventData = gpHostWlanFeatCaps;
23903 wdiEventData.uEventDataSize = fCapsStructSize;
23904 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
23905 wdiEventData.pUserData = pUserData;
23906
23907 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23908}
23909
23910/**
23911 @brief Process Host-FW Capability Exchange Request function
23912
23913 @param pWDICtx: pointer to the WLAN DAL context
23914 pEventData: pointer to the event information structure
23915
23916 @see
23917 @return Result of the function call
23918*/
23919WDI_Status
23920WDI_ProcessFeatureCapsExchangeReq
23921(
23922 WDI_ControlBlockType* pWDICtx,
23923 WDI_EventInfoType* pEventData
23924)
23925{
23926 wpt_uint8* pSendBuffer = NULL;
23927 wpt_uint16 usDataOffset = 0;
23928 wpt_uint16 usSendSize = 0;
23929 wpt_uint16 usLen = 0;
23930
23931 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23932
23933 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23934 "%s", __FUNCTION__);
23935
23936 /*-------------------------------------------------------------------------
23937 Sanity check
23938 -------------------------------------------------------------------------*/
23939 /* Call back function is NULL since not required for cap exchange req */
23940 if (( NULL == pEventData ) ||
23941 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
23942 {
23943 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
23944 "%s: Invalid parameters", __FUNCTION__);
23945 WDI_ASSERT(0);
23946 return WDI_STATUS_E_FAILURE;
23947 }
23948
23949 /*-----------------------------------------------------------------------
23950 Get message buffer
23951 -----------------------------------------------------------------------*/
23952 usLen = sizeof(tWlanFeatCaps);
23953
23954 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23955 WDI_FEATURE_CAPS_EXCHANGE_REQ,
23956 usLen,
23957 &pSendBuffer, &usDataOffset, &usSendSize))||
23958 ( usSendSize < (usDataOffset + usLen )))
23959 {
23960 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
23961 "Unable to get send buffer in feat caps exchange req %x %x",
23962 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
23963 WDI_ASSERT(0);
23964 return WDI_STATUS_E_FAILURE;
23965 }
23966
23967 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23968 "bit 0 - %x %x %x %x - bit 128\n",
23969 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
23970 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
23971 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
23972 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
23973 );
23974
23975 /* Copy host caps after the offset in the send buffer */
23976 wpalMemoryCopy( pSendBuffer+usDataOffset,
23977 (tWlanFeatCaps *)pEventData->pEventData,
23978 usLen);
23979
23980 /*-------------------------------------------------------------------------
23981 Send Start Request to HAL
23982 -------------------------------------------------------------------------*/
23983 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23984 (WDI_StartRspCb)pEventData->pCBfnc,
23985 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
23986
23987}/*WDI_ProcessFeatureCapsExchangeReq*/
23988
23989/**
23990 @brief Process Host-FW Capability Exchange Response function
23991
23992 @param pWDICtx: pointer to the WLAN DAL context
23993 pEventData: pointer to the event information structure
23994
23995 @see
23996 @return Result of the function call
23997*/
23998WDI_Status
23999WDI_ProcessFeatureCapsExchangeRsp
24000(
24001 WDI_ControlBlockType* pWDICtx,
24002 WDI_EventInfoType* pEventData
24003)
24004{
24005 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24006 wpt_int32 fCapsStructSize;
24007 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24008
24009 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24010 "%s", __FUNCTION__);
24011
24012 /*-------------------------------------------------------------------------
24013 Sanity check
24014 -------------------------------------------------------------------------*/
24015 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24016 ( NULL == pEventData->pEventData ))
24017 {
24018 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24019 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24020 "%s: Invalid parameters", __FUNCTION__);
24021 WDI_ASSERT(0);
24022 return WDI_STATUS_E_FAILURE;
24023 }
24024
24025 /* Allocate memory separately for global variable carrying FW caps */
24026 fCapsStructSize = sizeof(tWlanFeatCaps);
24027 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24028 if ( NULL == gpFwWlanFeatCaps )
24029 {
24030 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24031 "Cannot allocate memory for host capability info\n");
24032 WDI_ASSERT(0);
24033 return WDI_STATUS_MEM_FAILURE;
24034 }
24035
24036 /*-------------------------------------------------------------------------
24037 Unpack HAL Response Message - the header was already extracted by the
24038 main Response Handling procedure
24039 -------------------------------------------------------------------------*/
24040 /*-------------------------------------------------------------------------
24041 Extract response and send it to UMAC
24042 -------------------------------------------------------------------------*/
24043
24044 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24045 fCapsStructSize);
24046 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24047 "bit 0 - %x %x %x %x - bit 128\n",
24048 gpFwWlanFeatCaps->featCaps[0],
24049 gpFwWlanFeatCaps->featCaps[1],
24050 gpFwWlanFeatCaps->featCaps[2],
24051 gpFwWlanFeatCaps->featCaps[3]
24052 );
24053
24054 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24055
24056 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24057 if (wdiFeatureCapsExchangeCb != NULL)
24058 wdiFeatureCapsExchangeCb(NULL, NULL);
24059
24060 return WDI_STATUS_SUCCESS;
24061}
24062
24063/**
24064 @brief WDI_getHostWlanFeatCaps
24065 WDI API that returns whether the feature passed to it as enum value in
24066 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
24067 variable storing host capability bitmap to find this. This can be used by
24068 other moduels to decide certain things like call different APIs based on
24069 whether a particular feature is supported.
24070
24071 @param
24072
24073 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
24074
24075 @see
24076 @return
24077 0 - if the feature is NOT supported in host
24078 any non-zero value - if the feature is SUPPORTED in host.
24079*/
24080wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
24081{
24082 wpt_uint8 featSupported = 0;
24083 if (gpHostWlanFeatCaps != NULL)
24084 {
24085 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
24086 }
24087 else
24088 {
24089 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24090 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature\n", feat_enum_value);
24091 }
24092 return featSupported;
24093}
24094
24095/**
24096 @brief WDI_getFwWlanFeatCaps
24097 WDI API that returns whether the feature passed to it as enum value in
24098 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
24099 variable storing host capability bitmap to find this. This can be used by
24100 other moduels to decide certain things like call different APIs based on
24101 whether a particular feature is supported.
24102
24103 @param
24104
24105 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
24106 in wlan_hal_msg.h.
24107
24108 @see
24109 @return
24110 0 - if the feature is NOT supported in FW
24111 any non-zero value - if the feature is SUPPORTED in FW.
24112*/
24113wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
24114{
24115 wpt_uint8 featSupported = 0;
24116 if (gpFwWlanFeatCaps != NULL)
24117 {
24118 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
24119 }
24120 else
24121 {
24122 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24123 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature\n", feat_enum_value);
24124 }
24125 return featSupported;
24126}