blob: bbfd376bce76cd01c40ddc9360b6214afddfd3a5 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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
Jeff Johnsone7245742012-09-05 17:12:55 -070028 This software unit holds the implementation of the WLAN Device Abstraction
Jeff Johnson295189b2012-06-20 16:38:30 -070029 Layer Interface.
30
Jeff Johnsone7245742012-09-05 17:12:55 -070031 The functions externalized by this module are to be called by any upper
Jeff Johnson295189b2012-06-20 16:38:30 -070032 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 * -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070066#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"
Jeff Johnson295189b2012-06-20 16:38:30 -070070
Jeff Johnsone7245742012-09-05 17:12:55 -070071#include "wlan_qct_wdi_cts.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070072
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
Jeff Johnsone7245742012-09-05 17:12:55 -070081#include "wlan_qct_wdi_dts.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070082
83#include "wlan_hal_msg.h"
84
85#ifdef ANI_MANF_DIAG
86#include "pttMsgApi.h"
87#endif /* ANI_MANF_DIAG */
88
89/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070090 WLAN DAL Control Path Internal Data Definitions and Declarations
Jeff Johnson295189b2012-06-20 16:38:30 -070091 ===========================================================================*/
92#define WDI_WCTS_ACTION_TIMEOUT 2000 /* in msec a very high upper limit */
93
Jeff Johnsone7245742012-09-05 17:12:55 -070094#define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
95#define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x"
96
Jeff Johnson295189b2012-06-20 16:38:30 -070097
98#ifdef FEATURE_WLAN_SCAN_PNO
99#define WDI_PNO_VERSION_MASK 0x8000
100#endif
101
102/* host capability bitmap global */
103static tWlanFeatCaps *gpHostWlanFeatCaps = NULL;
104/* FW capability bitmap global */
105static tWlanFeatCaps *gpFwWlanFeatCaps = NULL;
106/* array of features supported. Need to add a new feature
107 * and other two places - wlan_hal_msg.h and halMsg.c (FW file)
108 */
109static placeHolderInCapBitmap supportEnabledFeatures[] =
Mohit Khanna4a70d262012-09-11 16:30:12 -0700110 {MCC, P2P, DOT11AC, SLM_SESSIONIZATION, DOT11AC_OPMODE};
Jeff Johnson295189b2012-06-20 16:38:30 -0700111
112/*--------------------------------------------------------------------------
113 WLAN DAL State Machine
114 --------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700115WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700116{
117 /*WDI_INIT_ST*/
118 {{
119 WDI_MainStart, /*WDI_START_EVENT*/
120 NULL, /*WDI_STOP_EVENT*/
121 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
122 WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/
123 WDI_MainClose, /*WDI_CLOSE_EVENT*/
124 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
125 }},
126
127 /*WDI_STARTED_ST*/
128 {{
129 WDI_MainStartStarted, /*WDI_START_EVENT*/
130 WDI_MainStopStarted, /*WDI_STOP_EVENT*/
131 WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/
132 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
133 NULL, /*WDI_CLOSE_EVENT*/
134 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
135 }},
136
137 /*WDI_STOPPED_ST*/
138 {{
139 WDI_MainStart, /*WDI_START_EVENT*/
140 WDI_MainStopStopped, /*WDI_STOP_EVENT*/
141 NULL, /*WDI_REQUEST_EVENT*/
142 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
143 WDI_MainClose, /*WDI_CLOSE_EVENT*/
144 NULL /*WDI_SHUTDOWN_EVENT*/
145 }},
146
147 /*WDI_BUSY_ST*/
148 {{
149 WDI_MainStartBusy, /*WDI_START_EVENT*/
150 WDI_MainStopBusy, /*WDI_STOP_EVENT*/
151 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
152 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
153 WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/
154 WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/
155 }}
156};
157
Jeff Johnsone7245742012-09-05 17:12:55 -0700158/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700159 DAL Request Processing Array - the functions in this table will only be
160 called when the processing of the specific request is allowed by the
Jeff Johnsone7245742012-09-05 17:12:55 -0700161 Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -0700162 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700163WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700164{
165 /*INIT*/
166 WDI_ProcessStartReq, /* WDI_START_REQ */
167 WDI_ProcessStopReq, /* WDI_STOP_REQ */
168 WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */
169
170 /*SCAN*/
171 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */
172 WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */
173 WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */
174 WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */
175
176 /*ASSOCIATION*/
177 WDI_ProcessJoinReq, /* WDI_JOIN_REQ */
178 WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */
179 WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */
180 WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */
181 WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */
182
183 /* Security */
184 WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */
185 WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */
186 WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */
187 WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */
188
189 /* QoS and BA APIs */
190 WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */
191 WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */
192 WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */
193 WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */
194 WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */
195
196 /* Miscellaneous Control APIs */
197 WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */
198 WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */
199 WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */
200 WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */
201 WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */
202
203 /*BA APIs*/
204 WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */
205 WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */
206
207 /*Beacon processing APIs*/
208 WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */
209 WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */
210
211 WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */
212 WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */
213 WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */
214 WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/
215#ifdef WLAN_FEATURE_P2P
216 WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */
217#else
218 NULL,
219#endif
220 /* PowerSave APIs */
221 WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */
222 WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */
223 WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */
224 WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */
225 WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */
226 WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */
227 WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */
228 WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */
229 WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */
230 WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */
231 WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */
232 WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */
233 WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */
234 WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */
235 WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */
236 WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */
237 WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */
238 WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */
239 /*NV Download APIs*/
240 WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/
241 WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */
242 WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */
243#ifdef WLAN_FEATURE_VOWIFI_11R
244 WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */
245#else
246 NULL,
247#endif /* WLAN_FEATURE_VOWIFI_11R */
248 WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */
249 WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */
250#ifdef ANI_MANF_DIAG
251 WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */
252#else
253 NULL,
254#endif /* ANI_MANF_DIAG */
Jeff Johnsone7245742012-09-05 17:12:55 -0700255
256#ifdef FEATURE_OEM_DATA_SUPPORT
257 WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/
258#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700259 NULL,
Jeff Johnsone7245742012-09-05 17:12:55 -0700260#endif /*FEATURE_OEM_DATA_SUPPORT*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700261 WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700262
263 WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */
Jeff Johnson295189b2012-06-20 16:38:30 -0700264
265#ifdef FEATURE_WLAN_SCAN_PNO
266 WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */
267 WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */
268 WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */
269#else
270 NULL,
271 NULL,
272 NULL,
273#endif /* FEATURE_WLAN_SCAN_PNO */
274
275 WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700276
Jeff Johnson295189b2012-06-20 16:38:30 -0700277#ifdef WLAN_FEATURE_PACKET_FILTERING
278 /* WDI_8023_MULTICAST_LIST_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700279 WDI_Process8023MulticastListReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700280 /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700281 WDI_ProcessReceiveFilterSetFilterReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700283 WDI_ProcessFilterMatchCountReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700284 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700285 WDI_ProcessReceiveFilterClearFilterReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700286#else
287 NULL,
288 NULL,
289 NULL,
290 NULL,
291#endif // WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -0700292 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */
Jeff Johnson295189b2012-06-20 16:38:30 -0700293 WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */
294 WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */
295
296 WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/
297#ifdef FEATURE_WLAN_CCX
298 WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */
299#else
300 NULL,
301#endif
302
303#ifdef WLAN_FEATURE_GTK_OFFLOAD
304 WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */
305 WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */
306#else
307 NULL,
308 NULL,
309#endif // WLAN_FEATURE_GTK_OFFLOAD
310
311 WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/
312 WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */
Mohit Khanna4a70d262012-09-11 16:30:12 -0700313#ifdef WLAN_FEATURE_11AC
314 WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */
315#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700316 /*-------------------------------------------------------------------------
317 Indications
318 -------------------------------------------------------------------------*/
319 WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/
320};
321
322
Jeff Johnsone7245742012-09-05 17:12:55 -0700323/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700324 DAL Request Processing Array - the functions in this table will only be
325 called when the processing of the specific request is allowed by the
Jeff Johnsone7245742012-09-05 17:12:55 -0700326 Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -0700327 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700328WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700329{
330 /*INIT*/
331 WDI_ProcessStartRsp, /* WDI_START_RESP */
332 WDI_ProcessStopRsp, /* WDI_STOP_RESP */
333 WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */
334
335 /*SCAN*/
336 WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */
337 WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */
338 WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */
339 WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */
340
341 /* ASSOCIATION*/
342 WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */
343 WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */
344 WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */
345 WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */
346 WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */
347
348 /* Security */
349 WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */
350 WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
351 WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */
352 WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
353
354 /* QoS and BA APIs */
355 WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */
356 WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */
357 WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */
358 WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */
359 WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */
360
361 /* Miscellaneous Control APIs */
362 WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */
363 WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */
364 WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */
365 WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */
366 WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */
367
368 /* BA APIs*/
369 WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */
370 WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700371
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 /* IBSS APIs*/
373 WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */
374 WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */
375
376 /*Soft AP APIs*/
377 WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */
378 WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */
379 WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */
380 WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */
381
382 /* PowerSave APIs */
383 WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */
384 WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */
385 WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */
386 WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */
387 WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */
388 WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */
389 WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */
390 WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */
391 WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */
392 WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */
393 WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */
394 WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */
395 WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */
396 WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */
397 WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */
398 WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */
399 WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */
400 WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700401
Jeff Johnson295189b2012-06-20 16:38:30 -0700402
403 WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/
404
405 WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */
406 WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */
407#ifdef WLAN_FEATURE_VOWIFI_11R
408 WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */
409#else
410 NULL,
411#endif /* WLAN_FEATURE_VOWIFI_11R */
412 WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */
413 WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700414#ifdef FEATURE_OEM_DATA_SUPPORT
415 WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/
416#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700417 NULL,
Jeff Johnsone7245742012-09-05 17:12:55 -0700418#endif /*FEATURE_OEM_DATA_SUPPORT*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700419 WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/
420
421#ifdef WLAN_FEATURE_P2P
422 WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */
423#else
424 NULL,
425#endif
426
427#ifdef ANI_MANF_DIAG
428 WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */
429#else
430 NULL,
431#endif /* ANI_MANF_DIAG */
432
Jeff Johnsone7245742012-09-05 17:12:55 -0700433 WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */
434
Jeff Johnson295189b2012-06-20 16:38:30 -0700435#ifdef FEATURE_WLAN_SCAN_PNO
436 WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */
437 WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */
438 WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */
439#else
440 NULL,
441 NULL,
442 NULL,
443#endif // FEATURE_WLAN_SCAN_PNO
444
445 WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */
446
447 /*---------------------------------------------------------------------
448 Indications
449 ---------------------------------------------------------------------*/
450#ifdef WLAN_FEATURE_PACKET_FILTERING
451 /* WDI_8023_MULTICAST_LIST_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700452 WDI_Process8023MulticastListRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700453 /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700454 WDI_ProcessReceiveFilterSetFilterRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700455 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700456 WDI_ProcessFilterMatchCountRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700457 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700458 WDI_ProcessReceiveFilterClearFilterRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700459#else
460 NULL,
461 NULL,
462 NULL,
463 NULL,
464#endif // WLAN_FEATURE_PACKET_FILTERING
465
466 WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */
467 WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */
468
469 WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/
470#ifdef FEATURE_WLAN_CCX
471 WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */
472#else
473 NULL,
474#endif
475
476#ifdef WLAN_FEATURE_GTK_OFFLOAD
Jeff Johnsone7245742012-09-05 17:12:55 -0700477 WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */
478 WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */
Jeff Johnson295189b2012-06-20 16:38:30 -0700479#else
480 NULL,
481 NULL,
482#endif // WLAN_FEATURE_GTK_OFFLOAD
Jeff Johnsone7245742012-09-05 17:12:55 -0700483 WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */
484 WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */
Mohit Khanna4a70d262012-09-11 16:30:12 -0700485#ifdef WLAN_FEATURE_11AC
486 WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */
487#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700488
489 /*---------------------------------------------------------------------
490 Indications
491 ---------------------------------------------------------------------*/
492 WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */
493 WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */
494 WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */
495 WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */
496 WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */
497 WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */
498
499 WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */
500
501 WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */
502
503#ifdef WLAN_FEATURE_P2P
504 WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/
505#else
506 NULL,
507#endif
508
509#ifdef FEATURE_WLAN_SCAN_PNO
510 WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */
511#else
512 NULL,
513#endif // FEATURE_WLAN_SCAN_PNO
514
515#ifdef WLAN_WAKEUP_EVENTS
516 WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */
517#else // WLAN_WAKEUP_EVENTS
518 NULL,
519#endif // WLAN_WAKEUP_EVENTS
520
521 WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */
522};
523
524
Jeff Johnsone7245742012-09-05 17:12:55 -0700525/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700526 WLAN DAL Global Control Block
527 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700528WDI_ControlBlockType gWDICb;
Jeff Johnson295189b2012-06-20 16:38:30 -0700529static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE;
530
Jeff Johnsone7245742012-09-05 17:12:55 -0700531const wpt_uint8 szTransportChName[] = "WLAN_CTRL";
Jeff Johnson295189b2012-06-20 16:38:30 -0700532
533/*Helper routine for retrieving the PAL Context from WDI*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700534WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -0700535void* WDI_GET_PAL_CTX( void )
536{
Jeff Johnsone7245742012-09-05 17:12:55 -0700537 return gWDICb.pPALContext;
Jeff Johnson295189b2012-06-20 16:38:30 -0700538}/*WDI_GET_PAL_CTX*/
539
Jeff Johnsone7245742012-09-05 17:12:55 -0700540/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 Helper inline converters
542 ============================================================================*/
543/*Convert WDI driver type into HAL driver type*/
544WPT_STATIC WPT_INLINE WDI_Status
545WDI_HAL_2_WDI_STATUS
546(
547 eHalStatus halStatus
548);
549
550/*Convert WDI request type into HAL request type*/
551WPT_STATIC WPT_INLINE tHalHostMsgType
552WDI_2_HAL_REQ_TYPE
553(
554 WDI_RequestEnumType wdiReqType
555);
556
557/*Convert WDI response type into HAL response type*/
558WPT_STATIC WPT_INLINE WDI_ResponseEnumType
559HAL_2_WDI_RSP_TYPE
560(
561 tHalHostMsgType halMsg
562);
563
564/*Convert WDI driver type into HAL driver type*/
565WPT_STATIC WPT_INLINE tDriverType
566WDI_2_HAL_DRV_TYPE
567(
568 WDI_DriverType wdiDriverType
569);
570
571/*Convert WDI stop reason into HAL stop reason*/
572WPT_STATIC WPT_INLINE tHalStopType
573WDI_2_HAL_STOP_REASON
574(
575 WDI_StopType wdiStopType
576);
577
578/*Convert WDI scan mode type into HAL scan mode type*/
579WPT_STATIC WPT_INLINE eHalSysMode
580WDI_2_HAL_SCAN_MODE
581(
582 WDI_ScanMode wdiScanMode
583);
584
585/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700586WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -0700587WDI_2_HAL_SEC_CH_OFFSET
588(
589 WDI_HTSecondaryChannelOffset wdiSecChOffset
590);
591
592/*Convert WDI BSS type into HAL BSS type*/
593WPT_STATIC WPT_INLINE tSirBssType
594WDI_2_HAL_BSS_TYPE
595(
596 WDI_BssType wdiBSSType
597);
598
599/*Convert WDI NW type into HAL NW type*/
600WPT_STATIC WPT_INLINE tSirNwType
601WDI_2_HAL_NW_TYPE
602(
603 WDI_NwType wdiNWType
604);
605
606/*Convert WDI chanel bonding type into HAL cb type*/
607WPT_STATIC WPT_INLINE ePhyChanBondState
608WDI_2_HAL_CB_STATE
609(
610 WDI_PhyChanBondState wdiCbState
611);
612
613/*Convert WDI chanel bonding type into HAL cb type*/
614WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
615WDI_2_HAL_HT_OPER_MODE
616(
617 WDI_HTOperatingMode wdiHTOperMode
618);
619
620/*Convert WDI mimo PS type into HAL mimo PS type*/
621WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
622WDI_2_HAL_MIMO_PS
623(
624 WDI_HTMIMOPowerSaveState wdiHTOperMode
625);
626
627/*Convert WDI ENC type into HAL ENC type*/
628WPT_STATIC WPT_INLINE tAniEdType
629WDI_2_HAL_ENC_TYPE
630(
631 WDI_EncryptType wdiEncType
632);
633
634/*Convert WDI WEP type into HAL WEP type*/
635WPT_STATIC WPT_INLINE tAniWepType
636WDI_2_HAL_WEP_TYPE
637(
638 WDI_WepType wdiWEPType
639);
640
641/*Convert WDI Link State into HAL Link State*/
642WPT_STATIC WPT_INLINE tSirLinkState
643WDI_2_HAL_LINK_STATE
644(
645 WDI_LinkStateType wdiLinkState
646);
647
Jeff Johnsone7245742012-09-05 17:12:55 -0700648/*Translate a STA Context from WDI into HAL*/
649WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -0700650void
651WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -0700652(
Jeff Johnson295189b2012-06-20 16:38:30 -0700653 tConfigStaParams* phalConfigSta,
654 WDI_ConfigStaReqInfoType* pwdiConfigSta
655);
Jeff Johnsone7245742012-09-05 17:12:55 -0700656
657/*Translate a Rate set info from WDI into HAL*/
658WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -0700659WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -0700660(
Jeff Johnson295189b2012-06-20 16:38:30 -0700661 tSirMacRateSet* pHalRateSet,
662 WDI_RateSet* pwdiRateSet
663);
664
665/*Translate an EDCA Parameter Record from WDI into HAL*/
666WPT_STATIC WPT_INLINE void
667WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -0700668(
Jeff Johnson295189b2012-06-20 16:38:30 -0700669 tSirMacEdcaParamRecord* phalEdcaParam,
670 WDI_EdcaParamRecord* pWDIEdcaParam
671);
672
673/*Copy a management frame header from WDI fmt into HAL fmt*/
674WPT_STATIC WPT_INLINE void
675WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
676(
677 tSirMacMgmtHdr* pmacMgmtHdr,
678 WDI_MacMgmtHdr* pwdiMacMgmtHdr
679);
680
681/*Copy config bss parameters from WDI fmt into HAL fmt*/
682WPT_STATIC WPT_INLINE void
683WDI_CopyWDIConfigBSSToHALConfigBSS
684(
685 tConfigBssParams* phalConfigBSS,
686 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
687);
688
Jeff Johnsone7245742012-09-05 17:12:55 -0700689/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 pointed to by user data */
691WPT_STATIC WPT_INLINE void
692WDI_ExtractRequestCBFromEvent
693(
694 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -0700695 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -0700696 void** ppUserData
697);
698
699wpt_uint8
700WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -0700701(
Jeff Johnson295189b2012-06-20 16:38:30 -0700702 WDI_ControlBlockType* pWDICtx,
703 WDI_BSSSessionType** ppSession
704);
705
706void
707WDI_AddBcastSTAtoSTATable
708(
709 WDI_ControlBlockType* pWDICtx,
710 WDI_AddStaParams * staParams,
711 wpt_uint16 usBcastStaIdx
712);
713
714WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -0700715(
Jeff Johnson295189b2012-06-20 16:38:30 -0700716 WDI_ControlBlockType* pWDICtx,
717 WDI_EventInfoType* pEventData
718);
719
720void
721WDI_SetPowerStateCb
722(
723 wpt_status status,
724 unsigned int dxePhyAddr,
725 void *pContext
726);
727
728#define CASE_RETURN_STRING( str ) \
729 case ( ( str ) ): return( #str ); break \
730
731/**
732 @brief WDI_getReqMsgString prints the WDI request message in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700733
734 @param wdiReqMsgId: WDI Message request Id
735
736 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700737 @return Result of the function call
738*/
739static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId)
740{
741 switch (wdiReqMsgId)
742 {
743 CASE_RETURN_STRING( WDI_START_REQ );
744 CASE_RETURN_STRING( WDI_STOP_REQ );
745 CASE_RETURN_STRING( WDI_CLOSE_REQ );
746 CASE_RETURN_STRING( WDI_INIT_SCAN_REQ );
747 CASE_RETURN_STRING( WDI_START_SCAN_REQ );
748 CASE_RETURN_STRING( WDI_END_SCAN_REQ );
749 CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ );
750 CASE_RETURN_STRING( WDI_JOIN_REQ );
751 CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ );
752 CASE_RETURN_STRING( WDI_DEL_BSS_REQ );
753 CASE_RETURN_STRING( WDI_POST_ASSOC_REQ );
754 CASE_RETURN_STRING( WDI_DEL_STA_REQ );
755 CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ );
756 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ );
757 CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ );
758 CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ );
759 CASE_RETURN_STRING( WDI_ADD_TS_REQ );
760 CASE_RETURN_STRING( WDI_DEL_TS_REQ );
761 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ );
762 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ );
763 CASE_RETURN_STRING( WDI_DEL_BA_REQ );
764 CASE_RETURN_STRING( WDI_CH_SWITCH_REQ );
765 CASE_RETURN_STRING( WDI_CONFIG_STA_REQ );
766 CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ );
767 CASE_RETURN_STRING( WDI_GET_STATS_REQ );
768 CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ );
769 CASE_RETURN_STRING( WDI_ADD_BA_REQ );
770 CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ );
771 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ );
772 CASE_RETURN_STRING( WDI_SND_BCON_REQ );
773 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ );
774 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ );
775 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ );
776 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ );
777 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ );
778 CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ );
779 CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ );
780 CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ );
781 CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ );
782 CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ );
783 CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ );
784 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ );
785 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ );
786 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ );
787 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ);
788 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ );
789 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ );
790 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ );
791 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ );
792 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ );
793 CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ );
794 CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ );
795 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ );
796 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ );
797 CASE_RETURN_STRING( WDI_FLUSH_AC_REQ );
798 CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ );
799 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ );
800 CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ );
801 CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ );
802 CASE_RETURN_STRING( WDI_FTM_CMD_REQ );
Jeff Johnsone7245742012-09-05 17:12:55 -0700803 CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ );
Jeff Johnson295189b2012-06-20 16:38:30 -0700804 CASE_RETURN_STRING( WDI_HOST_RESUME_REQ );
805 CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ);
806 #ifdef FEATURE_WLAN_SCAN_PNO
807 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ );
808 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ );
809 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ );
810 #endif
811 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ );
812 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ );
813 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ );
814 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ );
815 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ );
816 CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ );
817 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ );
818 CASE_RETURN_STRING( WDI_SHUTDOWN_REQ );
819 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ );
820 default:
821 return "Unknown WDI MessageId";
822 }
823}
824
825
826
827/**
828 @brief WDI_getRespMsgString prints the WDI resonse message in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700829
830 @param wdiRespMsgId: WDI Message response Id
831
832 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700833 @return Result of the function call
834*/
835static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId)
836{
837 switch (wdiRespMsgId)
838 {
839 CASE_RETURN_STRING( WDI_START_RESP );
840 CASE_RETURN_STRING( WDI_STOP_RESP );
841 CASE_RETURN_STRING( WDI_CLOSE_RESP );
842 CASE_RETURN_STRING( WDI_INIT_SCAN_RESP );
843 CASE_RETURN_STRING( WDI_START_SCAN_RESP );
844 CASE_RETURN_STRING( WDI_END_SCAN_RESP );
845 CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP );
846 CASE_RETURN_STRING( WDI_JOIN_RESP );
847 CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP );
848 CASE_RETURN_STRING( WDI_DEL_BSS_RESP );
849 CASE_RETURN_STRING( WDI_POST_ASSOC_RESP );
850 CASE_RETURN_STRING( WDI_DEL_STA_RESP );
851 CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP );
852 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP );
853 CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP );
854 CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP );
855 CASE_RETURN_STRING( WDI_ADD_TS_RESP );
856 CASE_RETURN_STRING( WDI_DEL_TS_RESP );
857 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP );
858 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP );
859 CASE_RETURN_STRING( WDI_DEL_BA_RESP );
860 CASE_RETURN_STRING( WDI_CH_SWITCH_RESP );
861 CASE_RETURN_STRING( WDI_CONFIG_STA_RESP );
862 CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP );
863 CASE_RETURN_STRING( WDI_GET_STATS_RESP );
864 CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP );
865 CASE_RETURN_STRING( WDI_ADD_BA_RESP );
866 CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP );
867 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP );
868 CASE_RETURN_STRING( WDI_SND_BCON_RESP );
869 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP );
870 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP );
871 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP );
872 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP );
873 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP );
874 CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP );
875 CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP );
876 CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP );
877 CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP );
878 CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP );
879 CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP );
880 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP );
881 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP );
882 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP );
883 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP);
884 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP );
885 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP );
886 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP );
887 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP );
888 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP );
889 CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP );
890 CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP );
891 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP );
892 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP );
893 CASE_RETURN_STRING( WDI_FLUSH_AC_RESP );
894 CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP );
895 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP );
896 CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP );
897 CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP );
898 CASE_RETURN_STRING( WDI_FTM_CMD_RESP );
Jeff Johnsone7245742012-09-05 17:12:55 -0700899 CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP );
Jeff Johnson295189b2012-06-20 16:38:30 -0700900 CASE_RETURN_STRING( WDI_HOST_RESUME_RESP );
901 CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP);
902 #ifdef FEATURE_WLAN_SCAN_PNO
903 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP );
904 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP );
905 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP );
906 #endif
907 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP );
908 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP );
909 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP );
910 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP );
911 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP );
912 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP );
913 CASE_RETURN_STRING( WDI_SHUTDOWN_RESP );
914 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP );
915 default:
916 return "Unknown WDI MessageId";
917 }
918}
919
920/**
921 @brief WDI_getHALStatusMsgString prints the HAL status in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700922
923 @param halStatusId: HAL status Id
924
925 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700926 @return Result of the function call
927*/
928static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId)
929{
930 switch (halStatusId)
931 {
932 CASE_RETURN_STRING( eHAL_STATUS_SUCCESS );
933 CASE_RETURN_STRING( PAL_STATUS_INVAL );
934 CASE_RETURN_STRING( PAL_STATUS_ALREADY );
935 CASE_RETURN_STRING( PAL_STATUS_EMPTY );
936 CASE_RETURN_STRING( PAL_STATUS_FAILURE );
937 CASE_RETURN_STRING( eHAL_STATUS_FAILURE );
938 CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER );
939 CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX );
940 CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL );
941 CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS );
942 CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT );
943 CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL );
944 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA );
945 CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID );
946 CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID );
947 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID );
948 CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX );
949 CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL );
950 CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE );
951 CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID );
952 CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN );
953 CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL );
954 CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL );
955 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL );
956 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED );
957 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID );
958 CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED );
959 CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED );
960 CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC );
961 CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL );
962 CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
963 CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
964 CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED );
965 default:
966 return "Unknown HAL status";
967 }
968}
969
Jeff Johnsone7245742012-09-05 17:12:55 -0700970/*========================================================================
971
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 INITIALIZATION APIs
Jeff Johnsone7245742012-09-05 17:12:55 -0700973
Jeff Johnson295189b2012-06-20 16:38:30 -0700974==========================================================================*/
975
976/**
977 @brief WDI_Init is used to initialize the DAL.
Jeff Johnsone7245742012-09-05 17:12:55 -0700978
Jeff Johnson295189b2012-06-20 16:38:30 -0700979 DAL will allocate all the resources it needs. It will open PAL, it will also
980 open both the data and the control transport which in their turn will open
Jeff Johnsone7245742012-09-05 17:12:55 -0700981 DXE/SMD or any other drivers that they need.
982
Jeff Johnson295189b2012-06-20 16:38:30 -0700983 @param pOSContext: pointer to the OS context provided by the UMAC
984 will be passed on to PAL on Open
985 ppWDIGlobalCtx: output pointer of Global Context
986 pWdiDevCapability: output pointer of device capability
987
988 @return Result of the function call
989*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700990WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -0700991WDI_Init
Jeff Johnsone7245742012-09-05 17:12:55 -0700992(
Jeff Johnson295189b2012-06-20 16:38:30 -0700993 void* pOSContext,
994 void** ppWDIGlobalCtx,
995 WDI_DeviceCapabilityType* pWdiDevCapability,
996 unsigned int driverType
997)
998{
999 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -07001000 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001001 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -07001002 WCTS_TransportCBsType wctsCBs;
Jeff Johnson295189b2012-06-20 16:38:30 -07001003 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1004
1005 /*---------------------------------------------------------------------
1006 Sanity check
1007 ---------------------------------------------------------------------*/
1008 if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability ))
1009 {
1010 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1011 "Invalid input parameters in WDI_Init");
1012
Jeff Johnsone7245742012-09-05 17:12:55 -07001013 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001014 }
1015
1016 /*---------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001017 Check to see if the module has already been initialized or not
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 ---------------------------------------------------------------------*/
1019 if ( eWLAN_PAL_FALSE != gWDIInitialized )
1020 {
1021 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1022 "WDI module already initialized - return");
1023
Jeff Johnsone7245742012-09-05 17:12:55 -07001024 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07001025 }
1026
1027 /*Module is now initialized - this flag is to ensure the fact that multiple
1028 init will not happen on WDI
1029 !! - potential race does exist because read and set are not atomic,
1030 however an atomic operation would be closely here - reanalyze if necessary*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001031 gWDIInitialized = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001032
1033 /*Setup the control block */
1034 WDI_CleanCB(&gWDICb);
Jeff Johnsone7245742012-09-05 17:12:55 -07001035 gWDICb.pOSContext = pOSContext;
Jeff Johnson295189b2012-06-20 16:38:30 -07001036
1037 /*Setup the STA Table*/
1038 wdiStatus = WDI_STATableInit(&gWDICb);
1039 if ( WDI_STATUS_SUCCESS != wdiStatus )
1040 {
1041 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1042 "%s: Failure while initializing STA Table, status %d",
1043 __FUNCTION__, wdiStatus);
1044 goto fail_STATableInit;
1045 }
1046
1047 /*------------------------------------------------------------------------
1048 Open the PAL
1049 ------------------------------------------------------------------------*/
1050 wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext);
1051 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1052 {
1053 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1054 "%s: Failed to open PAL, status %d",
1055 __FUNCTION__, wptStatus);
1056 goto fail_wpalOpen;
1057 }
1058
1059 /*Initialize main synchro mutex - it will be used to ensure integrity of
1060 the main WDI Control Block*/
1061 wptStatus = wpalMutexInit(&gWDICb.wptMutex);
1062 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1063 {
1064 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1065 "%s: Failed to init mutex, status %d",
1066 __FUNCTION__, wptStatus);
1067 goto fail_mutex;
1068 }
1069
1070 /*Initialize the response timer - it will be used to time all messages
1071 expected as response from device*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001072 wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer,
1073 WDI_ResponseTimerCB,
Jeff Johnson295189b2012-06-20 16:38:30 -07001074 &gWDICb);
1075 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1076 {
1077 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1078 "%s: Failed to init response timer, status %d",
1079 __FUNCTION__, wptStatus);
1080 goto fail_timer;
1081 }
1082
1083 /* Initialize the WDI Pending Request Queue*/
1084 wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue));
1085 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1086 {
1087 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1088 "%s: Failed to init pending request queue, status %d",
1089 __FUNCTION__, wptStatus);
1090 goto fail_pend_queue;
1091 }
1092
1093 /*Init WDI Pending Assoc Id Queue */
1094 wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue));
1095 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1096 {
1097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1098 "%s: Failed to init assoc session queue, status %d",
1099 __FUNCTION__, wptStatus);
1100 goto fail_assoc_queue;
1101 }
1102
1103 /*Initialize the BSS sessions pending Queue */
1104 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1105 {
1106 wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1107 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1108 {
1109 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1110 "%s: Failed to init BSS %d pending queue, status %d",
1111 __FUNCTION__, i, wptStatus);
1112 goto fail_bss_queue;
1113 }
1114 }
1115
1116 /*Indicate the control block is sufficiently initialized for callbacks*/
1117 gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC;
1118
1119 /*------------------------------------------------------------------------
1120 Initialize the Data Path Utility Module
1121 ------------------------------------------------------------------------*/
1122 wdiStatus = WDI_DP_UtilsInit(&gWDICb);
1123 if ( WDI_STATUS_SUCCESS != wdiStatus )
1124 {
1125 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1126 "%s: Failed to initialize the DP Util Module, status %d",
1127 __FUNCTION__, wdiStatus);
1128 goto fail_dp_util_init;
1129 }
1130
1131 /* Init Set power state event */
1132 wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001133 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001134 {
1135 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1136 "%s: Failed to initialize power state event, status %d",
1137 __FUNCTION__, wptStatus);
1138 goto fail_power_event;
1139 }
1140
1141 /* Init WCTS action event */
1142 wptStatus = wpalEventInit(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001143 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001144 {
1145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1146 "%s: Failed to initialize WCTS action event, status %d",
1147 __FUNCTION__, wptStatus);
1148 goto fail_wcts_event;
1149 }
1150
1151 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001152 Open the Transport Services for Control and Data
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 ------------------------------------------------------------------------*/
1154 wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB;
1155 wctsCBs.wctsNotifyCBData = &gWDICb;
Jeff Johnsone7245742012-09-05 17:12:55 -07001156 wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB;
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 wctsCBs.wctsRxMsgCBData = &gWDICb;
1158
Jeff Johnsone7245742012-09-05 17:12:55 -07001159 gWDICb.bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName ,
Jeff Johnsone7245742012-09-05 17:12:55 -07001161 WDI_CT_CHANNEL_SIZE,
1162 &wctsCBs );
Jeff Johnson295189b2012-06-20 16:38:30 -07001163
1164 if ( NULL == gWDICb.wctsHandle )
1165 {
1166 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1167 "%s: Failed to open WCTS transport", __FUNCTION__);
1168 goto fail_wcts_open;
1169 }
1170
1171 gWDICb.driverMode = (tDriverType)driverType;
1172 /* FTM mode not need to open Transport Driver */
1173 if(eDRIVER_TYPE_MFG != (tDriverType)driverType)
Jeff Johnsone7245742012-09-05 17:12:55 -07001174 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 /*------------------------------------------------------------------------
1176 Open the Data Transport
1177 ------------------------------------------------------------------------*/
1178 if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb))
1179 {
1180 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1181 "%s: Failed to open the DT Transport", __FUNCTION__);
1182 goto fail_wdts_open;
1183 }
1184 }
1185
1186 /*The WDI is initialized - set state to init */
Jeff Johnsone7245742012-09-05 17:12:55 -07001187 gWDICb.uGlobalState = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07001188
1189 /*Send the context as a ptr to the global WDI Control Block*/
1190 *ppWDIGlobalCtx = &gWDICb;
1191
1192 /*Fill in the device capabilities*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001193 pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001194 pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations;
1195 pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids;
1196 return WDI_STATUS_SUCCESS;
1197
1198 /* ERROR handlers
1199 Undo everything that completed successfully */
1200
1201 fail_wdts_open:
1202 {
1203 wpt_status eventStatus;
1204
1205 /* Closing WCTS in this scenario is tricky since it has to close
1206 the SMD channel and then we get notified asynchronously when
1207 the channel has been closed. So we take some of the logic from
1208 the "normal" close procedure in WDI_Close()
1209 */
1210
1211 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001212 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001213 {
1214 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1215 "%s: Failed to reset WCTS action event", __FUNCTION__);
1216 }
1217
1218 WCTS_CloseTransport(gWDICb.wctsHandle);
1219
1220 /* Wait for WCTS to close the control transport. If we were able
1221 to reset the event flag, then we'll wait for the event,
1222 otherwise we'll wait for a maximum amount of time required for
1223 the channel to be closed */
1224 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1225 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001226 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 WDI_WCTS_ACTION_TIMEOUT);
1228 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1229 {
1230 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1231 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1232 }
1233 }
1234 else
1235 {
1236 wpalSleep(WDI_WCTS_ACTION_TIMEOUT);
1237 }
1238 }
1239 fail_wcts_open:
1240 wpalEventDelete(&gWDICb.wctsActionEvent);
1241 fail_wcts_event:
1242 wpalEventDelete(&gWDICb.setPowerStateEvent);
1243 fail_power_event:
1244 WDI_DP_UtilsExit(&gWDICb);
1245 fail_dp_util_init:
1246 gWDICb.magic = 0;
1247 fail_bss_queue:
1248 /* entries 0 thru i-1 were successfully initialized */
1249 while (0 < i)
1250 {
1251 i--;
1252 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1253 }
1254 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1255 fail_assoc_queue:
1256 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1257 fail_pend_queue:
1258 wpalTimerDelete(&gWDICb.wptResponseTimer);
1259 fail_timer:
1260 wpalMutexDelete(&gWDICb.wptMutex);
1261 fail_mutex:
1262 wpalClose(gWDICb.pPALContext);
1263 fail_wpalOpen:
1264 WDI_STATableClose(&gWDICb);
1265 fail_STATableInit:
1266 gWDIInitialized = eWLAN_PAL_FALSE;
1267
1268 return WDI_STATUS_E_FAILURE;
1269
1270}/*WDI_Init*/;
1271
1272/**
1273 @brief WDI_Start will be called when the upper MAC is ready to
1274 commence operation with the WLAN Device. Upon the call
1275 of this API the WLAN DAL will pack and send a HAL Start
1276 message to the lower RIVA sub-system if the SMD channel
1277 has been fully opened and the RIVA subsystem is up.
1278
1279 If the RIVA sub-system is not yet up and running DAL
1280 will queue the request for Open and will wait for the
1281 SMD notification before attempting to send down the
Jeff Johnsone7245742012-09-05 17:12:55 -07001282 message to HAL.
Jeff Johnson295189b2012-06-20 16:38:30 -07001283
1284 WDI_Init must have been called.
1285
Jeff Johnsone7245742012-09-05 17:12:55 -07001286 @param wdiStartParams: the start parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001288
Jeff Johnson295189b2012-06-20 16:38:30 -07001289 wdiStartRspCb: callback for passing back the response of
1290 the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001291
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001293 callback
1294
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 @see WDI_Start
1296 @return Result of the function call
1297*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001298WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001299WDI_Start
1300(
1301 WDI_StartReqParamsType* pwdiStartParams,
1302 WDI_StartRspCb wdiStartRspCb,
1303 void* pUserData
1304)
1305{
1306 WDI_EventInfoType wdiEventData;
1307 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1308
1309 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001310 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001311 ------------------------------------------------------------------------*/
1312 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1313 {
1314 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1315 "WDI API call before module is initialized - Fail request");
1316
Jeff Johnsone7245742012-09-05 17:12:55 -07001317 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001318 }
1319
1320 /*------------------------------------------------------------------------
1321 Fill in Event data and post to the Main FSM
1322 ------------------------------------------------------------------------*/
1323 wdiEventData.wdiRequest = WDI_START_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001324 wdiEventData.pEventData = pwdiStartParams;
1325 wdiEventData.uEventDataSize = sizeof(*pwdiStartParams);
1326 wdiEventData.pCBfnc = wdiStartRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001327 wdiEventData.pUserData = pUserData;
1328
1329 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1330
1331}/*WDI_Start*/
1332
1333/**
1334 @brief WDI_Stop will be called when the upper MAC is ready to
1335 stop any operation with the WLAN Device. Upon the call
1336 of this API the WLAN DAL will pack and send a HAL Stop
1337 message to the lower RIVA sub-system if the DAL Core is
1338 in started state.
1339
1340 In state BUSY this request will be queued.
Jeff Johnsone7245742012-09-05 17:12:55 -07001341
1342 Request will not be accepted in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001343
1344 WDI_Start must have been called.
1345
Jeff Johnsone7245742012-09-05 17:12:55 -07001346 @param wdiStopParams: the stop parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001347 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001348
Jeff Johnson295189b2012-06-20 16:38:30 -07001349 wdiStopRspCb: callback for passing back the response of
1350 the stop operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001351
Jeff Johnson295189b2012-06-20 16:38:30 -07001352 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001353 callback
1354
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 @see WDI_Start
1356 @return Result of the function call
1357*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001358WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001359WDI_Stop
1360(
1361 WDI_StopReqParamsType* pwdiStopParams,
1362 WDI_StopRspCb wdiStopRspCb,
1363 void* pUserData
1364)
1365{
1366 WDI_EventInfoType wdiEventData;
Jeff Johnson43971f52012-07-17 12:26:56 -07001367 WDI_ControlBlockType* pWDICtx = &gWDICb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001368 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1369
1370 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001371 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001372 ------------------------------------------------------------------------*/
1373 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1374 {
1375 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1376 "WDI API call before module is initialized - Fail request");
1377
Jeff Johnsone7245742012-09-05 17:12:55 -07001378 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 }
1380
Jeff Johnson43971f52012-07-17 12:26:56 -07001381 /*Access to the global state must be locked before cleaning */
1382 wpalMutexAcquire(&pWDICtx->wptMutex);
1383
1384 /*Clear all pending request*/
1385 WDI_ClearPendingRequests(pWDICtx);
1386
1387 /*We have completed cleaning unlock now*/
1388 wpalMutexRelease(&pWDICtx->wptMutex);
1389
Jeff Johnson295189b2012-06-20 16:38:30 -07001390 /* Free the global variables */
1391 wpalMemoryFree(gpHostWlanFeatCaps);
1392 wpalMemoryFree(gpFwWlanFeatCaps);
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -07001393 gpHostWlanFeatCaps = NULL;
1394 gpFwWlanFeatCaps = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001395
1396 /*------------------------------------------------------------------------
1397 Fill in Event data and post to the Main FSM
1398 ------------------------------------------------------------------------*/
1399 wdiEventData.wdiRequest = WDI_STOP_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001400 wdiEventData.pEventData = pwdiStopParams;
1401 wdiEventData.uEventDataSize = sizeof(*pwdiStopParams);
1402 wdiEventData.pCBfnc = wdiStopRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 wdiEventData.pUserData = pUserData;
1404
1405 return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData);
1406
1407}/*WDI_Stop*/
1408
1409
1410
1411/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001412 @brief WDI_Close will be called when the upper MAC no longer
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 needs to interact with DAL. DAL will free its control
1414 block.
Jeff Johnsone7245742012-09-05 17:12:55 -07001415
1416 It is only accepted in state STOPPED.
Jeff Johnson295189b2012-06-20 16:38:30 -07001417
1418 WDI_Stop must have been called.
1419
1420 @param none
Jeff Johnsone7245742012-09-05 17:12:55 -07001421
Jeff Johnson295189b2012-06-20 16:38:30 -07001422 @see WDI_Stop
1423 @return Result of the function call
1424*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001425WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001426WDI_Close
1427(
1428 void
1429)
1430{
1431 wpt_uint8 i;
1432 WDI_EventInfoType wdiEventData;
1433 wpt_status wptStatus;
1434 wpt_status eventStatus;
1435 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1436
1437 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001438 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001439 ------------------------------------------------------------------------*/
1440 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1441 {
1442 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1443 "WDI API call before module is initialized - Fail request");
1444
Jeff Johnsone7245742012-09-05 17:12:55 -07001445 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001446 }
1447
1448 /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ
1449 (the control transport will be closed by the FSM and we'll want
1450 to wait until that completes)*/
1451 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001452 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 {
1454 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1455 "%s: Failed to reset WCTS action event", __FUNCTION__);
1456 /* fall through and try to finish closing via the FSM */
1457 }
1458
1459 /*------------------------------------------------------------------------
1460 Fill in Event data and post to the Main FSM
1461 ------------------------------------------------------------------------*/
1462 wdiEventData.wdiRequest = WDI_CLOSE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001463 wdiEventData.pEventData = NULL;
1464 wdiEventData.uEventDataSize = 0;
1465 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 wdiEventData.pUserData = NULL;
1467
1468 gWDIInitialized = eWLAN_PAL_FALSE;
1469
1470 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData);
1471
1472 /*Wait for WCTS to close the control transport
1473 (but only if we were able to reset the event flag*/
1474 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1475 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001476 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
Jeff Johnson295189b2012-06-20 16:38:30 -07001477 WDI_WCTS_ACTION_TIMEOUT);
1478 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1479 {
1480 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1481 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1482 }
1483 }
1484
1485 /* Destroy the WCTS action event */
1486 wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent);
1487 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1488 {
1489 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1490 "WDI Close failed to destroy an event");
Jeff Johnsone7245742012-09-05 17:12:55 -07001491 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001492 }
1493
1494 /* Destroy the Set Power State event */
1495 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1496 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1497 {
1498 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1499 "WDI Close failed to destroy an event");
1500
Jeff Johnsone7245742012-09-05 17:12:55 -07001501 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001502 }
1503
1504 /*------------------------------------------------------------------------
1505 Closes the Data Path Utility Module
1506 ------------------------------------------------------------------------*/
1507 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1508 {
1509 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1510 "WDI Init failed to close the DP Util Module");
1511
Jeff Johnsone7245742012-09-05 17:12:55 -07001512 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001513 }
1514
1515 /*destroy the BSS sessions pending Queue */
1516 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1517 {
1518 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1519 }
1520
1521 /* destroy the WDI Pending Assoc Id Request Queue*/
1522 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1523
1524 /* destroy the WDI Pending Request Queue*/
1525 wpal_list_destroy(&(gWDICb.wptPendingQueue));
Jeff Johnsone7245742012-09-05 17:12:55 -07001526
Jeff Johnson295189b2012-06-20 16:38:30 -07001527 /*destroy the response timer */
1528 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1529
1530 /*invalidate the main synchro mutex */
1531 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1532 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1533 {
1534 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1535 "Failed to delete mutex %d", wptStatus);
1536 WDI_ASSERT(0);
1537 }
1538
1539 /*Clear control block. note that this will clear the "magic"
1540 which will inhibit all asynchronous callbacks*/
1541 WDI_CleanCB(&gWDICb);
1542
1543 return wptStatus;
1544
1545}/*WDI_Close*/
1546
1547/**
1548 @brief WDI_Shutdown will be called during 'SSR shutdown' operation.
1549 This will do most of the WDI stop & close
1550 operations without doing any handshake with Riva
1551
1552 This will also make sure that the control transport
1553 will NOT be closed.
1554
1555 This request will not be queued.
1556
1557
1558 WDI_Start must have been called.
1559
1560 @param closeTransport: Close control channel if this is set
1561
1562 @return Result of the function call
1563*/
1564WDI_Status
1565WDI_Shutdown
1566(
1567 wpt_boolean closeTransport
1568)
1569{
1570 WDI_EventInfoType wdiEventData;
1571 wpt_status wptStatus;
1572 int i = 0;
1573 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1574
1575 /*------------------------------------------------------------------------
1576 Sanity Check
1577 ------------------------------------------------------------------------*/
1578 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1579 {
1580 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1581 "WDI API call before module is initialized - Fail request");
1582
1583 return WDI_STATUS_E_NOT_ALLOWED;
1584 }
1585
1586 /*------------------------------------------------------------------------
1587 Fill in Event data and post to the Main FSM
1588 ------------------------------------------------------------------------*/
1589 wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ;
1590 wdiEventData.pEventData = NULL;
1591 wdiEventData.uEventDataSize = 0;
1592
1593 /* Shutdown will not be queued, if the state is busy timer will be
1594 * stopped & this message will be processed.*/
1595 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData);
1596 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1597 {
1598 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1599 "%s: Failed to process shutdown event", __FUNCTION__);
1600 }
1601 /* Destroy the Set Power State event */
1602 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1603 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1604 {
1605 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1606 "WDI Close failed to destroy an event");
1607
1608 WDI_ASSERT(0);
1609 }
1610 /*------------------------------------------------------------------------
1611 Closes the Data Path Utility Module
1612 ------------------------------------------------------------------------*/
1613 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1614 {
1615 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1616 "WDI Init failed to close the DP Util Module");
1617
1618 WDI_ASSERT(0);
1619 }
1620 if ( closeTransport )
1621 {
1622 /* Close control transport, called from module unload */
1623 WCTS_CloseTransport(gWDICb.wctsHandle);
1624 }
Madan Mohan Koyyalamudifab2a7e2012-09-28 15:20:00 -07001625 else
1626 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -07001627 /* Riva is crashed then SMD is already closed so cleaning all
Madan Mohan Koyyalamudifab2a7e2012-09-28 15:20:00 -07001628 the pending messages in the transport queue */
1629 WCTS_ClearPendingQueue(gWDICb.wctsHandle);
1630 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001631 /*destroy the BSS sessions pending Queue */
1632 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1633 {
1634 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1635 }
1636
1637 /* destroy the WDI Pending Assoc Id Request Queue*/
1638 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1639 /* destroy the WDI Pending Request Queue*/
1640 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1641 /*destroy the response timer */
1642 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1643
1644 /*invalidate the main synchro mutex */
1645 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1646 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1647 {
1648 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1649 "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus);
1650 WDI_ASSERT(0);
1651 }
Madan Mohan Koyyalamudi3513bf52012-09-18 17:35:53 -07001652 /* Free the global variables */
1653 wpalMemoryFree(gpHostWlanFeatCaps);
1654 wpalMemoryFree(gpFwWlanFeatCaps);
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -07001655 gpHostWlanFeatCaps = NULL;
1656 gpFwWlanFeatCaps = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001657 /*Clear control block. note that this will clear the "magic"
1658 which will inhibit all asynchronous callbacks*/
1659 WDI_CleanCB(&gWDICb);
1660 return wptStatus;
1661
1662}/*WDI_Shutdown*/
1663
1664
Jeff Johnsone7245742012-09-05 17:12:55 -07001665/*========================================================================
1666
Jeff Johnson295189b2012-06-20 16:38:30 -07001667 SCAN APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001668
Jeff Johnson295189b2012-06-20 16:38:30 -07001669==========================================================================*/
1670
1671/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001672 @brief WDI_InitScanReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07001673 the WLAN Device to get ready for a scan procedure. Upon
1674 the call of this API the WLAN DAL will pack and send a
1675 HAL Init Scan request message to the lower RIVA
1676 sub-system if DAL is in state STARTED.
1677
1678 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001679 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001680
1681 WDI_Start must have been called.
1682
1683 @param wdiInitScanParams: the init scan parameters as specified
1684 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001685
Jeff Johnson295189b2012-06-20 16:38:30 -07001686 wdiInitScanRspCb: callback for passing back the response
1687 of the init scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001688
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001690 callback
1691
Jeff Johnson295189b2012-06-20 16:38:30 -07001692 @see WDI_Start
1693 @return Result of the function call
1694*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001695WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001696WDI_InitScanReq
1697(
1698 WDI_InitScanReqParamsType* pwdiInitScanParams,
1699 WDI_InitScanRspCb wdiInitScanRspCb,
1700 void* pUserData
1701)
1702{
1703 WDI_EventInfoType wdiEventData;
1704 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1705
1706 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001707 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001708 ------------------------------------------------------------------------*/
1709 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1710 {
1711 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1712 "WDI API call before module is initialized - Fail request");
1713
Jeff Johnsone7245742012-09-05 17:12:55 -07001714 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001715 }
1716
1717 /*------------------------------------------------------------------------
1718 Fill in Event data and post to the Main FSM
1719 ------------------------------------------------------------------------*/
1720 wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001721 wdiEventData.pEventData = pwdiInitScanParams;
1722 wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams);
1723 wdiEventData.pCBfnc = wdiInitScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001724 wdiEventData.pUserData = pUserData;
1725
1726 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1727
1728}/*WDI_InitScanReq*/
1729
1730/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001731 @brief WDI_StartScanReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001732 wishes to change the Scan channel on the WLAN Device.
1733 Upon the call of this API the WLAN DAL will pack and
1734 send a HAL Start Scan request message to the lower RIVA
1735 sub-system if DAL is in state STARTED.
1736
1737 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001738 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001739
1740 WDI_InitScanReq must have been called.
1741
Jeff Johnsone7245742012-09-05 17:12:55 -07001742 @param wdiStartScanParams: the start scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001743 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001744
Jeff Johnson295189b2012-06-20 16:38:30 -07001745 wdiStartScanRspCb: callback for passing back the
1746 response of the start scan operation received from the
1747 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001748
Jeff Johnson295189b2012-06-20 16:38:30 -07001749 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001750 callback
1751
Jeff Johnson295189b2012-06-20 16:38:30 -07001752 @see WDI_InitScanReq
1753 @return Result of the function call
1754*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001755WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001756WDI_StartScanReq
1757(
1758 WDI_StartScanReqParamsType* pwdiStartScanParams,
1759 WDI_StartScanRspCb wdiStartScanRspCb,
1760 void* pUserData
1761)
1762{
1763 WDI_EventInfoType wdiEventData;
1764 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1765
1766 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001767 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001768 ------------------------------------------------------------------------*/
1769 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1770 {
1771 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1772 "WDI API call before module is initialized - Fail request");
1773
Jeff Johnsone7245742012-09-05 17:12:55 -07001774 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001775 }
1776
1777 /*------------------------------------------------------------------------
1778 Fill in Event data and post to the Main FSM
1779 ------------------------------------------------------------------------*/
1780 wdiEventData.wdiRequest = WDI_START_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001781 wdiEventData.pEventData = pwdiStartScanParams;
1782 wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams);
1783 wdiEventData.pCBfnc = wdiStartScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001784 wdiEventData.pUserData = pUserData;
1785
1786 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1787
1788}/*WDI_StartScanReq*/
1789
1790
1791/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001792 @brief WDI_EndScanReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07001793 wants to end scanning for a particular channel that it
1794 had set before by calling Scan Start on the WLAN Device.
1795 Upon the call of this API the WLAN DAL will pack and
1796 send a HAL End Scan request message to the lower RIVA
1797 sub-system if DAL is in state STARTED.
1798
1799 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001800 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001801
1802 WDI_StartScanReq must have been called.
1803
Jeff Johnsone7245742012-09-05 17:12:55 -07001804 @param wdiEndScanParams: the end scan parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07001805 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001806
Jeff Johnson295189b2012-06-20 16:38:30 -07001807 wdiEndScanRspCb: callback for passing back the response
1808 of the end scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001809
Jeff Johnson295189b2012-06-20 16:38:30 -07001810 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001811 callback
1812
Jeff Johnson295189b2012-06-20 16:38:30 -07001813 @see WDI_StartScanReq
1814 @return Result of the function call
1815*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001816WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001817WDI_EndScanReq
1818(
1819 WDI_EndScanReqParamsType* pwdiEndScanParams,
1820 WDI_EndScanRspCb wdiEndScanRspCb,
1821 void* pUserData
1822)
1823{
1824 WDI_EventInfoType wdiEventData;
1825 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1826
1827 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001828 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001829 ------------------------------------------------------------------------*/
1830 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1831 {
1832 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1833 "WDI API call before module is initialized - Fail request");
1834
Jeff Johnsone7245742012-09-05 17:12:55 -07001835 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001836 }
1837
1838 /*------------------------------------------------------------------------
1839 Fill in Event data and post to the Main FSM
1840 ------------------------------------------------------------------------*/
1841 wdiEventData.wdiRequest = WDI_END_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001842 wdiEventData.pEventData = pwdiEndScanParams;
1843 wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams);
1844 wdiEventData.pCBfnc = wdiEndScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001845 wdiEventData.pUserData = pUserData;
1846
1847 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1848
1849}/*WDI_EndScanReq*/
1850
1851
1852/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001853 @brief WDI_FinishScanReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07001854 completed the scan process on the WLAN Device. Upon the
1855 call of this API the WLAN DAL will pack and send a HAL
1856 Finish Scan Request request message to the lower RIVA
1857 sub-system if DAL is in state STARTED.
1858
1859 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001860 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001861
1862 WDI_InitScanReq must have been called.
1863
Jeff Johnsone7245742012-09-05 17:12:55 -07001864 @param wdiFinishScanParams: the finish scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001865 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001866
Jeff Johnson295189b2012-06-20 16:38:30 -07001867 wdiFinishScanRspCb: callback for passing back the
1868 response of the finish scan operation received from the
1869 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001870
Jeff Johnson295189b2012-06-20 16:38:30 -07001871 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001872 callback
1873
Jeff Johnson295189b2012-06-20 16:38:30 -07001874 @see WDI_InitScanReq
1875 @return Result of the function call
1876*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001877WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001878WDI_FinishScanReq
1879(
1880 WDI_FinishScanReqParamsType* pwdiFinishScanParams,
1881 WDI_FinishScanRspCb wdiFinishScanRspCb,
1882 void* pUserData
1883)
1884{
1885 WDI_EventInfoType wdiEventData;
1886 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1887
1888 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001889 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 ------------------------------------------------------------------------*/
1891 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1892 {
1893 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1894 "WDI API call before module is initialized - Fail request");
1895
Jeff Johnsone7245742012-09-05 17:12:55 -07001896 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001897 }
1898
1899 /*------------------------------------------------------------------------
1900 Fill in Event data and post to the Main FSM
1901 ------------------------------------------------------------------------*/
1902 wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001903 wdiEventData.pEventData = pwdiFinishScanParams;
1904 wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams);
1905 wdiEventData.pCBfnc = wdiFinishScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001906 wdiEventData.pUserData = pUserData;
1907
1908 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1909
1910}/*WDI_FinishScanReq*/
1911
Jeff Johnsone7245742012-09-05 17:12:55 -07001912/*========================================================================
1913
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 ASSOCIATION APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001915
Jeff Johnson295189b2012-06-20 16:38:30 -07001916==========================================================================*/
1917
1918/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001919 @brief WDI_JoinReq will be called when the upper MAC is ready
Jeff Johnson295189b2012-06-20 16:38:30 -07001920 to start an association procedure to a BSS. Upon the
1921 call of this API the WLAN DAL will pack and send a HAL
1922 Join request message to the lower RIVA sub-system if
1923 DAL is in state STARTED.
1924
1925 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001926 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001927
1928 WDI_Start must have been called.
1929
Jeff Johnsone7245742012-09-05 17:12:55 -07001930 @param wdiJoinParams: the join parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001931 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001932
Jeff Johnson295189b2012-06-20 16:38:30 -07001933 wdiJoinRspCb: callback for passing back the response of
1934 the join operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001935
Jeff Johnson295189b2012-06-20 16:38:30 -07001936 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001937 callback
1938
Jeff Johnson295189b2012-06-20 16:38:30 -07001939 @see WDI_Start
1940 @return Result of the function call
1941*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001942WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001943WDI_JoinReq
1944(
1945 WDI_JoinReqParamsType* pwdiJoinParams,
1946 WDI_JoinRspCb wdiJoinRspCb,
1947 void* pUserData
1948)
1949{
1950 WDI_EventInfoType wdiEventData;
1951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1952
1953 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001954 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001955 ------------------------------------------------------------------------*/
1956 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1957 {
1958 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1959 "WDI API call before module is initialized - Fail request");
1960
Jeff Johnsone7245742012-09-05 17:12:55 -07001961 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001962 }
1963
1964 /*------------------------------------------------------------------------
1965 Fill in Event data and post to the Main FSM
1966 ------------------------------------------------------------------------*/
1967 wdiEventData.wdiRequest = WDI_JOIN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001968 wdiEventData.pEventData = pwdiJoinParams;
1969 wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams);
1970 wdiEventData.pCBfnc = wdiJoinRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001971 wdiEventData.pUserData = pUserData;
1972
1973 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1974
1975}/*WDI_JoinReq*/
1976
1977/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001978 @brief WDI_ConfigBSSReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001979 wishes to configure the newly acquired or in process of
1980 being acquired BSS to the HW . Upon the call of this API
1981 the WLAN DAL will pack and send a HAL Config BSS request
1982 message to the lower RIVA sub-system if DAL is in state
1983 STARTED.
1984
1985 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001986 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001987
1988 WDI_JoinReq must have been called.
1989
Jeff Johnsone7245742012-09-05 17:12:55 -07001990 @param wdiConfigBSSParams: the config BSS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001991 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001992
Jeff Johnson295189b2012-06-20 16:38:30 -07001993 wdiConfigBSSRspCb: callback for passing back the
1994 response of the config BSS operation received from the
1995 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001996
Jeff Johnson295189b2012-06-20 16:38:30 -07001997 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001998 callback
1999
Jeff Johnson295189b2012-06-20 16:38:30 -07002000 @see WDI_JoinReq
2001 @return Result of the function call
2002*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002003WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002004WDI_ConfigBSSReq
2005(
2006 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams,
2007 WDI_ConfigBSSRspCb wdiConfigBSSRspCb,
2008 void* pUserData
2009)
2010{
2011 WDI_EventInfoType wdiEventData;
2012 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2013
2014 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002015 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002016 ------------------------------------------------------------------------*/
2017 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2018 {
2019 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2020 "WDI API call before module is initialized - Fail request");
2021
Jeff Johnsone7245742012-09-05 17:12:55 -07002022 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002023 }
2024
2025 /*------------------------------------------------------------------------
2026 Fill in Event data and post to the Main FSM
2027 ------------------------------------------------------------------------*/
2028 wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002029 wdiEventData.pEventData = pwdiConfigBSSParams;
2030 wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams);
2031 wdiEventData.pCBfnc = wdiConfigBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002032 wdiEventData.pUserData = pUserData;
2033
2034 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2035
2036}/*WDI_ConfigBSSReq*/
2037
2038/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002039 @brief WDI_DelBSSReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002040 disassociating from the BSS and wishes to notify HW.
2041 Upon the call of this API the WLAN DAL will pack and
2042 send a HAL Del BSS request message to the lower RIVA
2043 sub-system if DAL is in state STARTED.
2044
2045 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002046 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002047
2048 WDI_ConfigBSSReq or WDI_PostAssocReq must have been called.
2049
Jeff Johnsone7245742012-09-05 17:12:55 -07002050 @param wdiDelBSSParams: the del BSS parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002052
Jeff Johnson295189b2012-06-20 16:38:30 -07002053 wdiDelBSSRspCb: callback for passing back the response
2054 of the del bss operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002055
Jeff Johnson295189b2012-06-20 16:38:30 -07002056 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002057 callback
2058
2059 @see WDI_ConfigBSSReq, WDI_PostAssocReq
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 @return Result of the function call
2061*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002062WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002063WDI_DelBSSReq
2064(
2065 WDI_DelBSSReqParamsType* pwdiDelBSSParams,
2066 WDI_DelBSSRspCb wdiDelBSSRspCb,
2067 void* pUserData
2068)
2069{
2070 WDI_EventInfoType wdiEventData;
2071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2072
2073 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002074 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002075 ------------------------------------------------------------------------*/
2076 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2077 {
2078 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2079 "WDI API call before module is initialized - Fail request");
2080
Jeff Johnsone7245742012-09-05 17:12:55 -07002081 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002082 }
2083
2084 /*------------------------------------------------------------------------
2085 Fill in Event data and post to the Main FSM
2086 ------------------------------------------------------------------------*/
2087 wdiEventData.wdiRequest = WDI_DEL_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002088 wdiEventData.pEventData = pwdiDelBSSParams;
2089 wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams);
2090 wdiEventData.pCBfnc = wdiDelBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002091 wdiEventData.pUserData = pUserData;
2092
2093 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2094
2095}/*WDI_DelBSSReq*/
2096
2097/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002098 @brief WDI_PostAssocReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07002099 associated to a BSS and wishes to configure HW for
2100 associated state. Upon the call of this API the WLAN DAL
2101 will pack and send a HAL Post Assoc request message to
2102 the lower RIVA sub-system if DAL is in state STARTED.
2103
2104 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002105 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002106
2107 WDI_JoinReq must have been called.
2108
2109 @param wdiPostAssocReqParams: the assoc parameters as specified
2110 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002111
Jeff Johnson295189b2012-06-20 16:38:30 -07002112 wdiPostAssocRspCb: callback for passing back the
2113 response of the post assoc operation received from the
2114 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002115
Jeff Johnson295189b2012-06-20 16:38:30 -07002116 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002117 callback
2118
Jeff Johnson295189b2012-06-20 16:38:30 -07002119 @see WDI_JoinReq
2120 @return Result of the function call
2121*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002122WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002123WDI_PostAssocReq
2124(
2125 WDI_PostAssocReqParamsType* pwdiPostAssocReqParams,
2126 WDI_PostAssocRspCb wdiPostAssocRspCb,
2127 void* pUserData
2128)
2129{
2130 WDI_EventInfoType wdiEventData;
2131 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2132
2133 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002134 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 ------------------------------------------------------------------------*/
2136 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2137 {
2138 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2139 "WDI API call before module is initialized - Fail request");
2140
Jeff Johnsone7245742012-09-05 17:12:55 -07002141 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002142 }
2143
2144 /*------------------------------------------------------------------------
2145 Fill in Event data and post to the Main FSM
2146 ------------------------------------------------------------------------*/
2147 wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002148 wdiEventData.pEventData = pwdiPostAssocReqParams;
2149 wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams);
2150 wdiEventData.pCBfnc = wdiPostAssocRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002151 wdiEventData.pUserData = pUserData;
2152
2153 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2154
2155}/*WDI_PostAssocReq*/
2156
2157/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002158 @brief WDI_DelSTAReq will be called when the upper MAC when an
Jeff Johnson295189b2012-06-20 16:38:30 -07002159 association with another STA has ended and the station
2160 must be deleted from HW. Upon the call of this API the
2161 WLAN DAL will pack and send a HAL Del STA request
2162 message to the lower RIVA sub-system if DAL is in state
2163 STARTED.
2164
2165 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002166 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002167
2168 WDI_PostAssocReq must have been called.
2169
Jeff Johnsone7245742012-09-05 17:12:55 -07002170 @param wdiDelSTAParams: the Del STA parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002171 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002172
Jeff Johnson295189b2012-06-20 16:38:30 -07002173 wdiDelSTARspCb: callback for passing back the response
2174 of the del STA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002175
Jeff Johnson295189b2012-06-20 16:38:30 -07002176 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002177 callback
2178
Jeff Johnson295189b2012-06-20 16:38:30 -07002179 @see WDI_PostAssocReq
2180 @return Result of the function call
2181*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002182WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002183WDI_DelSTAReq
2184(
2185 WDI_DelSTAReqParamsType* pwdiDelSTAParams,
2186 WDI_DelSTARspCb wdiDelSTARspCb,
2187 void* pUserData
2188)
2189{
2190 WDI_EventInfoType wdiEventData;
2191 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2192
2193 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002194 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 ------------------------------------------------------------------------*/
2196 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2197 {
2198 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2199 "WDI API call before module is initialized - Fail request");
2200
Jeff Johnsone7245742012-09-05 17:12:55 -07002201 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002202 }
2203
2204 /*------------------------------------------------------------------------
2205 Fill in Event data and post to the Main FSM
2206 ------------------------------------------------------------------------*/
2207 wdiEventData.wdiRequest = WDI_DEL_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002208 wdiEventData.pEventData = pwdiDelSTAParams;
2209 wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams);
2210 wdiEventData.pCBfnc = wdiDelSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002211 wdiEventData.pUserData = pUserData;
2212
2213 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2214
2215}/*WDI_DelSTAReq*/
2216
Jeff Johnsone7245742012-09-05 17:12:55 -07002217/*========================================================================
2218
Jeff Johnson295189b2012-06-20 16:38:30 -07002219 SECURITY APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002220
Jeff Johnson295189b2012-06-20 16:38:30 -07002221==========================================================================*/
2222
2223/**
2224 @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to
2225 install a BSS encryption key on the HW. Upon the call of this
2226 API the WLAN DAL will pack and send a Set BSS Key request
2227 message to the lower RIVA sub-system if DAL is in state
2228 STARTED.
2229
2230 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002231 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002232
2233 WDI_PostAssocReq must have been called.
2234
Jeff Johnsone7245742012-09-05 17:12:55 -07002235 @param wdiSetBSSKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002236 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002237
Jeff Johnson295189b2012-06-20 16:38:30 -07002238 wdiSetBSSKeyRspCb: callback for passing back the
2239 response of the set BSS Key operation received from the
2240 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002241
Jeff Johnson295189b2012-06-20 16:38:30 -07002242 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002243 callback
2244
Jeff Johnson295189b2012-06-20 16:38:30 -07002245 @see WDI_PostAssocReq
2246 @return Result of the function call
2247*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002248WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002249WDI_SetBSSKeyReq
2250(
2251 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams,
2252 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb,
2253 void* pUserData
2254)
2255{
2256 WDI_EventInfoType wdiEventData;
2257 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2258
2259 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002260 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002261 ------------------------------------------------------------------------*/
2262 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2263 {
2264 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2265 "WDI API call before module is initialized - Fail request");
2266
Jeff Johnsone7245742012-09-05 17:12:55 -07002267 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002268 }
2269
2270 /*------------------------------------------------------------------------
2271 Fill in Event data and post to the Main FSM
2272 ------------------------------------------------------------------------*/
2273 wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002274 wdiEventData.pEventData = pwdiSetBSSKeyParams;
2275 wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams);
2276 wdiEventData.pCBfnc = wdiSetBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002277 wdiEventData.pUserData = pUserData;
2278
2279 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2280
2281}/*WDI_SetBSSKeyReq*/
2282
2283/**
2284 @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to
2285 uninstall a BSS key from HW. Upon the call of this API the
2286 WLAN DAL will pack and send a HAL Remove BSS Key request
2287 message to the lower RIVA sub-system if DAL is in state
2288 STARTED.
2289
2290 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002291 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002292
2293 WDI_SetBSSKeyReq must have been called.
2294
Jeff Johnsone7245742012-09-05 17:12:55 -07002295 @param wdiRemoveBSSKeyParams: the remove BSS key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002296 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002297
Jeff Johnson295189b2012-06-20 16:38:30 -07002298 wdiRemoveBSSKeyRspCb: callback for passing back the
2299 response of the remove BSS key operation received from
2300 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002301
Jeff Johnson295189b2012-06-20 16:38:30 -07002302 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002303 callback
2304
Jeff Johnson295189b2012-06-20 16:38:30 -07002305 @see WDI_SetBSSKeyReq
2306 @return Result of the function call
2307*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002308WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002309WDI_RemoveBSSKeyReq
2310(
2311 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams,
2312 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb,
2313 void* pUserData
2314)
2315{
2316 WDI_EventInfoType wdiEventData;
2317 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2318
2319 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002320 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002321 ------------------------------------------------------------------------*/
2322 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2323 {
2324 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2325 "WDI API call before module is initialized - Fail request");
2326
Jeff Johnsone7245742012-09-05 17:12:55 -07002327 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002328 }
2329
2330 /*------------------------------------------------------------------------
2331 Fill in Event data and post to the Main FSM
2332 ------------------------------------------------------------------------*/
2333 wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002334 wdiEventData.pEventData = pwdiRemoveBSSKeyParams;
2335 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams);
2336 wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002337 wdiEventData.pUserData = pUserData;
2338
2339 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2340
2341}/*WDI_RemoveBSSKeyReq*/
2342
2343
2344/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002345 @brief WDI_SetSTAKeyReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002346 ready to install a STA(ast) encryption key in HW. Upon
2347 the call of this API the WLAN DAL will pack and send a
2348 HAL Set STA Key request message to the lower RIVA
2349 sub-system if DAL is in state STARTED.
2350
2351 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002352 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002353
2354 WDI_PostAssocReq must have been called.
2355
Jeff Johnsone7245742012-09-05 17:12:55 -07002356 @param wdiSetSTAKeyParams: the set STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002357 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002358
Jeff Johnson295189b2012-06-20 16:38:30 -07002359 wdiSetSTAKeyRspCb: callback for passing back the
2360 response of the set STA key operation received from the
2361 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002362
Jeff Johnson295189b2012-06-20 16:38:30 -07002363 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002364 callback
2365
Jeff Johnson295189b2012-06-20 16:38:30 -07002366 @see WDI_PostAssocReq
2367 @return Result of the function call
2368*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002369WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002370WDI_SetSTAKeyReq
2371(
2372 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams,
2373 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb,
2374 void* pUserData
2375)
2376{
2377 WDI_EventInfoType wdiEventData;
2378 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2379
2380 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002381 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002382 ------------------------------------------------------------------------*/
2383 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2384 {
2385 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2386 "WDI API call before module is initialized - Fail request");
2387
Jeff Johnsone7245742012-09-05 17:12:55 -07002388 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002389 }
2390
2391 /*------------------------------------------------------------------------
2392 Fill in Event data and post to the Main FSM
2393 ------------------------------------------------------------------------*/
2394 wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002395 wdiEventData.pEventData = pwdiSetSTAKeyParams;
2396 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams);
2397 wdiEventData.pCBfnc = wdiSetSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002398 wdiEventData.pUserData = pUserData;
2399
2400 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2401
2402}/*WDI_SetSTAKeyReq*/
2403
2404
2405/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002406 @brief WDI_RemoveSTAKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002407 wants to uninstall a previously set STA key in HW. Upon
2408 the call of this API the WLAN DAL will pack and send a
2409 HAL Remove STA Key request message to the lower RIVA
2410 sub-system if DAL is in state STARTED.
2411
2412 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002413 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002414
2415 WDI_SetSTAKeyReq must have been called.
2416
Jeff Johnsone7245742012-09-05 17:12:55 -07002417 @param wdiRemoveSTAKeyParams: the remove STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002418 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002419
Jeff Johnson295189b2012-06-20 16:38:30 -07002420 wdiRemoveSTAKeyRspCb: callback for passing back the
2421 response of the remove STA key operation received from
2422 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002423
Jeff Johnson295189b2012-06-20 16:38:30 -07002424 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002425 callback
2426
Jeff Johnson295189b2012-06-20 16:38:30 -07002427 @see WDI_SetSTAKeyReq
2428 @return Result of the function call
2429*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002430WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002431WDI_RemoveSTAKeyReq
2432(
2433 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams,
2434 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb,
2435 void* pUserData
2436)
2437{
2438 WDI_EventInfoType wdiEventData;
2439 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2440
2441 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002442 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002443 ------------------------------------------------------------------------*/
2444 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2445 {
2446 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2447 "WDI API call before module is initialized - Fail request");
2448
Jeff Johnsone7245742012-09-05 17:12:55 -07002449 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002450 }
2451
2452 /*------------------------------------------------------------------------
2453 Fill in Event data and post to the Main FSM
2454 ------------------------------------------------------------------------*/
2455 wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002456 wdiEventData.pEventData = pwdiRemoveSTAKeyParams;
2457 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams);
2458 wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002459 wdiEventData.pUserData = pUserData;
2460
2461 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2462
2463}/*WDI_RemoveSTAKeyReq*/
2464
2465
2466/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002467 @brief WDI_SetSTABcastKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002468 wants to install a STA Bcast encryption key on the HW.
2469 Upon the call of this API the WLAN DAL will pack and
2470 send a HAL Start request message to the lower RIVA
2471 sub-system if DAL is in state STARTED.
2472
2473 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002474 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002475
2476 WDI_PostAssocReq must have been called.
2477
Jeff Johnsone7245742012-09-05 17:12:55 -07002478 @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002479 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002480
Jeff Johnson295189b2012-06-20 16:38:30 -07002481 wdiSetSTABcastKeyRspCb: callback for passing back the
2482 response of the set BSS Key operation received from the
2483 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002484
Jeff Johnson295189b2012-06-20 16:38:30 -07002485 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002486 callback
2487
Jeff Johnson295189b2012-06-20 16:38:30 -07002488 @see WDI_PostAssocReq
2489 @return Result of the function call
2490*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002491WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002492WDI_SetSTABcastKeyReq
2493(
2494 WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams,
2495 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb,
2496 void* pUserData
2497)
2498
2499{
2500 WDI_EventInfoType wdiEventData;
2501 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2502
2503 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002504 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002505 ------------------------------------------------------------------------*/
2506 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2507 {
2508 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2509 "WDI API call before module is initialized - Fail request");
2510
Jeff Johnsone7245742012-09-05 17:12:55 -07002511 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002512 }
2513
2514 /*------------------------------------------------------------------------
2515 Fill in Event data and post to the Main FSM
2516 ------------------------------------------------------------------------*/
2517 wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002518 wdiEventData.pEventData = pwdiSetSTABcastKeyParams;
2519 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams);
2520 wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002521 wdiEventData.pUserData = pUserData;
2522
2523 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2524
2525}/*WDI_SetSTABcastKeyReq*/
2526
2527/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002528 @brief WDI_RemoveSTABcastKeyReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002529 MAC wants to uninstall a STA Bcast key from HW. Upon the
2530 call of this API the WLAN DAL will pack and send a HAL
2531 Remove STA Bcast Key request message to the lower RIVA
2532 sub-system if DAL is in state STARTED.
2533
2534 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002535 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002536
2537 WDI_SetSTABcastKeyReq must have been called.
2538
Jeff Johnsone7245742012-09-05 17:12:55 -07002539 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002540 parameters as specified by the Device
2541 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002542
Jeff Johnson295189b2012-06-20 16:38:30 -07002543 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2544 response of the remove STA Bcast key operation received
2545 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002546
Jeff Johnson295189b2012-06-20 16:38:30 -07002547 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002548 callback
2549
Jeff Johnson295189b2012-06-20 16:38:30 -07002550 @see WDI_SetSTABcastKeyReq
2551 @return Result of the function call
2552*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002553WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002554WDI_RemoveSTABcastKeyReq
2555(
2556 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams,
2557 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb,
2558 void* pUserData
2559)
2560{
2561 WDI_EventInfoType wdiEventData;
2562 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2563
2564 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002565 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002566 ------------------------------------------------------------------------*/
2567 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2568 {
2569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2570 "WDI API call before module is initialized - Fail request");
2571
Jeff Johnsone7245742012-09-05 17:12:55 -07002572 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002573 }
2574
2575 /*------------------------------------------------------------------------
2576 Fill in Event data and post to the Main FSM
2577 ------------------------------------------------------------------------*/
2578 wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002579 wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams;
2580 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams);
2581 wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002582 wdiEventData.pUserData = pUserData;
2583
2584 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2585
2586}/*WDI_RemoveSTABcastKeyReq*/
2587
2588/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002589 @brief WDI_SetMaxTxPowerReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002590 MAC wants to set Max Tx Power to HW. Upon the
2591 call of this API the WLAN DAL will pack and send a HAL
2592 Remove STA Bcast Key request message to the lower RIVA
2593 sub-system if DAL is in state STARTED.
2594
2595 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002596 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002597
2598 WDI_SetSTABcastKeyReq must have been called.
2599
Jeff Johnsone7245742012-09-05 17:12:55 -07002600 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002601 parameters as specified by the Device
2602 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002603
Jeff Johnson295189b2012-06-20 16:38:30 -07002604 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2605 response of the remove STA Bcast key operation received
2606 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002607
Jeff Johnson295189b2012-06-20 16:38:30 -07002608 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002609 callback
2610
Jeff Johnson295189b2012-06-20 16:38:30 -07002611 @see WDI_SetMaxTxPowerReq
2612 @return Result of the function call
2613*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002614WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002615WDI_SetMaxTxPowerReq
2616(
2617 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams,
2618 WDA_SetMaxTxPowerRspCb wdiReqStatusCb,
2619 void* pUserData
2620)
2621{
2622 WDI_EventInfoType wdiEventData;
2623 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2624
2625 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002626 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002627 ------------------------------------------------------------------------*/
2628 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2629 {
2630 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2631 "WDI API call before module is initialized - Fail request");
2632
Jeff Johnsone7245742012-09-05 17:12:55 -07002633 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002634 }
2635
2636 /*------------------------------------------------------------------------
2637 Fill in Event data and post to the Main FSM
2638 ------------------------------------------------------------------------*/
2639 wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002640 wdiEventData.pEventData = pwdiSetMaxTxPowerParams;
2641 wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams);
2642 wdiEventData.pCBfnc = wdiReqStatusCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002643 wdiEventData.pUserData = pUserData;
2644
2645 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2646}
2647
2648#ifdef FEATURE_WLAN_CCX
2649WDI_Status
2650WDI_TSMStatsReq
2651(
2652 WDI_TSMStatsReqParamsType* pwdiTsmReqParams,
2653 WDI_TsmRspCb wdiReqStatusCb,
2654 void* pUserData
2655)
2656{
2657 WDI_EventInfoType wdiEventData;
2658 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -07002659 /*------------------------------------------------------------------------
2660 Sanity Check
2661 ------------------------------------------------------------------------*/
2662 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2663 {
2664 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2665 "WDI API call before module is initialized - Fail request");
2666
2667 return WDI_STATUS_E_NOT_ALLOWED;
2668 }
2669
2670 /*------------------------------------------------------------------------
2671 Fill in Event data and post to the Main FSM
2672 ------------------------------------------------------------------------*/
2673 wdiEventData.wdiRequest = WDI_TSM_STATS_REQ;
2674 wdiEventData.pEventData = pwdiTsmReqParams;
2675 wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams);
2676 wdiEventData.pCBfnc = wdiReqStatusCb;
2677 wdiEventData.pUserData = pUserData;
2678
2679 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2680
2681}
2682#endif
2683
2684/*========================================================================
2685
2686 QoS and BA APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002687
Jeff Johnson295189b2012-06-20 16:38:30 -07002688==========================================================================*/
2689
2690/**
2691 @brief WDI_AddTSReq will be called when the upper MAC to inform
2692 the device of a successful add TSpec negotiation. HW
2693 needs to receive the TSpec Info from the UMAC in order
2694 to configure properly the QoS data traffic. Upon the
2695 call of this API the WLAN DAL will pack and send a HAL
2696 Add TS request message to the lower RIVA sub-system if
2697 DAL is in state STARTED.
2698
2699 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002700 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002701
2702 WDI_PostAssocReq must have been called.
2703
2704 @param wdiAddTsReqParams: the add TS parameters as specified by
2705 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002706
Jeff Johnson295189b2012-06-20 16:38:30 -07002707 wdiAddTsRspCb: callback for passing back the response of
2708 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002709
Jeff Johnson295189b2012-06-20 16:38:30 -07002710 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002711 callback
2712
Jeff Johnson295189b2012-06-20 16:38:30 -07002713 @see WDI_PostAssocReq
2714 @return Result of the function call
2715*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002716WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002717WDI_AddTSReq
2718(
2719 WDI_AddTSReqParamsType* pwdiAddTsReqParams,
2720 WDI_AddTsRspCb wdiAddTsRspCb,
2721 void* pUserData
2722)
2723{
2724 WDI_EventInfoType wdiEventData;
2725 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2726
2727 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002728 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002729 ------------------------------------------------------------------------*/
2730 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2731 {
2732 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2733 "WDI API call before module is initialized - Fail request");
2734
Jeff Johnsone7245742012-09-05 17:12:55 -07002735 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002736 }
2737
2738 /*------------------------------------------------------------------------
2739 Fill in Event data and post to the Main FSM
2740 ------------------------------------------------------------------------*/
2741 wdiEventData.wdiRequest = WDI_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002742 wdiEventData.pEventData = pwdiAddTsReqParams;
2743 wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams);
2744 wdiEventData.pCBfnc = wdiAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002745 wdiEventData.pUserData = pUserData;
2746
2747 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2748
2749}/*WDI_AddTSReq*/
2750
2751
2752
2753/**
2754 @brief WDI_DelTSReq will be called when the upper MAC has ended
2755 admission on a specific AC. This is to inform HW that
2756 QoS traffic parameters must be rest. Upon the call of
2757 this API the WLAN DAL will pack and send a HAL Del TS
2758 request message to the lower RIVA sub-system if DAL is
2759 in state STARTED.
2760
2761 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002762 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002763
2764 WDI_AddTSReq must have been called.
2765
2766 @param wdiDelTsReqParams: the del TS parameters as specified by
2767 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002768
Jeff Johnson295189b2012-06-20 16:38:30 -07002769 wdiDelTsRspCb: callback for passing back the response of
2770 the del TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002771
Jeff Johnson295189b2012-06-20 16:38:30 -07002772 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002773 callback
2774
Jeff Johnson295189b2012-06-20 16:38:30 -07002775 @see WDI_AddTSReq
2776 @return Result of the function call
2777*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002778WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002779WDI_DelTSReq
2780(
2781 WDI_DelTSReqParamsType* pwdiDelTsReqParams,
2782 WDI_DelTsRspCb wdiDelTsRspCb,
2783 void* pUserData
2784)
2785{
2786 WDI_EventInfoType wdiEventData;
2787 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2788
2789 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002790 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002791 ------------------------------------------------------------------------*/
2792 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2793 {
2794 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2795 "WDI API call before module is initialized - Fail request");
2796
Jeff Johnsone7245742012-09-05 17:12:55 -07002797 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002798 }
2799
2800 /*------------------------------------------------------------------------
2801 Fill in Event data and post to the Main FSM
2802 ------------------------------------------------------------------------*/
2803 wdiEventData.wdiRequest = WDI_DEL_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002804 wdiEventData.pEventData = pwdiDelTsReqParams;
2805 wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams);
2806 wdiEventData.pCBfnc = wdiDelTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002807 wdiEventData.pUserData = pUserData;
2808
2809 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2810
2811}/*WDI_DelTSReq*/
2812
2813
2814
2815/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002816 @brief WDI_UpdateEDCAParams will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002817 wishes to update the EDCA parameters used by HW for QoS
2818 data traffic. Upon the call of this API the WLAN DAL
2819 will pack and send a HAL Update EDCA Params request
2820 message to the lower RIVA sub-system if DAL is in state
2821 STARTED.
2822
2823 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002824 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002825
2826 WDI_PostAssocReq must have been called.
2827
Jeff Johnsone7245742012-09-05 17:12:55 -07002828 @param wdiUpdateEDCAParams: the start parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07002829 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002830
Jeff Johnson295189b2012-06-20 16:38:30 -07002831 wdiUpdateEDCAParamsRspCb: callback for passing back the
2832 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002833
Jeff Johnson295189b2012-06-20 16:38:30 -07002834 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002835 callback
2836
Jeff Johnson295189b2012-06-20 16:38:30 -07002837 @see WDI_PostAssocReq
2838 @return Result of the function call
2839*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002840WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002841WDI_UpdateEDCAParams
2842(
2843 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams,
2844 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb,
2845 void* pUserData
2846)
2847{
2848 WDI_EventInfoType wdiEventData;
2849 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2850
2851 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002852 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002853 ------------------------------------------------------------------------*/
2854 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2855 {
2856 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2857 "WDI API call before module is initialized - Fail request");
2858
Jeff Johnsone7245742012-09-05 17:12:55 -07002859 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002860 }
2861
2862 /*------------------------------------------------------------------------
2863 Fill in Event data and post to the Main FSM
2864 ------------------------------------------------------------------------*/
2865 wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002866 wdiEventData.pEventData = pwdiUpdateEDCAParams;
2867 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams);
2868 wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002869 wdiEventData.pUserData = pUserData;
2870
2871 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2872
2873}/*WDI_UpdateEDCAParams*/
2874
2875
2876/**
2877 @brief WDI_AddBASessionReq will be called when the upper MAC has setup
2878 successfully a BA session and needs to notify the HW for
2879 the appropriate settings to take place. Upon the call of
2880 this API the WLAN DAL will pack and send a HAL Add BA
2881 request message to the lower RIVA sub-system if DAL is
2882 in state STARTED.
2883
2884 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002885 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002886
2887 WDI_PostAssocReq must have been called.
2888
2889 @param wdiAddBAReqParams: the add BA parameters as specified by
2890 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002891
Jeff Johnson295189b2012-06-20 16:38:30 -07002892 wdiAddBARspCb: callback for passing back the response of
2893 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002894
Jeff Johnson295189b2012-06-20 16:38:30 -07002895 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002896 callback
2897
Jeff Johnson295189b2012-06-20 16:38:30 -07002898 @see WDI_PostAssocReq
2899 @return Result of the function call
2900*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002901WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002902WDI_AddBASessionReq
2903(
2904 WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams,
2905 WDI_AddBASessionRspCb wdiAddBASessionRspCb,
2906 void* pUserData
2907)
2908{
2909 WDI_EventInfoType wdiEventData;
2910 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2911
2912 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002913 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002914 ------------------------------------------------------------------------*/
2915 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2916 {
2917 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2918 "WDI API call before module is initialized - Fail request");
2919
Jeff Johnsone7245742012-09-05 17:12:55 -07002920 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002921 }
2922
2923 /*------------------------------------------------------------------------
2924 Fill in Event data and post to the Main FSM
2925 ------------------------------------------------------------------------*/
2926 wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002927 wdiEventData.pEventData = pwdiAddBASessionReqParams;
2928 wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams);
2929 wdiEventData.pCBfnc = wdiAddBASessionRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002930 wdiEventData.pUserData = pUserData;
2931
2932 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2933
2934}/*WDI_AddBASessionReq*/
2935
2936/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002937 @brief WDI_DelBAReq will be called when the upper MAC wants to
Jeff Johnson295189b2012-06-20 16:38:30 -07002938 inform HW that it has deleted a previously created BA
2939 session. Upon the call of this API the WLAN DAL will
2940 pack and send a HAL Del BA request message to the lower
2941 RIVA sub-system if DAL is in state STARTED.
2942
2943 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002944 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002945
2946 WDI_AddBAReq must have been called.
2947
2948 @param wdiDelBAReqParams: the del BA parameters as specified by
2949 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002950
Jeff Johnson295189b2012-06-20 16:38:30 -07002951 wdiDelBARspCb: callback for passing back the response of
2952 the del BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002953
Jeff Johnson295189b2012-06-20 16:38:30 -07002954 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002955 callback
2956
Jeff Johnson295189b2012-06-20 16:38:30 -07002957 @see WDI_AddBAReq
2958 @return Result of the function call
2959*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002960WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002961WDI_DelBAReq
2962(
2963 WDI_DelBAReqParamsType* pwdiDelBAReqParams,
2964 WDI_DelBARspCb wdiDelBARspCb,
2965 void* pUserData
2966)
2967{
2968 WDI_EventInfoType wdiEventData;
2969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2970
2971 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002972 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002973 ------------------------------------------------------------------------*/
2974 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2975 {
2976 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2977 "WDI API call before module is initialized - Fail request");
2978
Jeff Johnsone7245742012-09-05 17:12:55 -07002979 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002980 }
2981
2982 /*------------------------------------------------------------------------
2983 Fill in Event data and post to the Main FSM
2984 ------------------------------------------------------------------------*/
2985 wdiEventData.wdiRequest = WDI_DEL_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002986 wdiEventData.pEventData = pwdiDelBAReqParams;
2987 wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams);
2988 wdiEventData.pCBfnc = wdiDelBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002989 wdiEventData.pUserData = pUserData;
2990
2991 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2992
2993}/*WDI_DelBAReq*/
2994
Jeff Johnsone7245742012-09-05 17:12:55 -07002995/*========================================================================
2996
Jeff Johnson295189b2012-06-20 16:38:30 -07002997 Power Save APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002998
Jeff Johnson295189b2012-06-20 16:38:30 -07002999==========================================================================*/
3000
3001/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003002 @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003003 wants to set the power save related configurations of
3004 the WLAN Device. Upon the call of this API the WLAN DAL
3005 will pack and send a HAL Update CFG request message to
3006 the lower RIVA sub-system if DAL is in state STARTED.
3007
3008 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003009 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003010
3011 WDI_Start must have been called.
3012
Jeff Johnsone7245742012-09-05 17:12:55 -07003013 @param pwdiPowerSaveCfg: the power save cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003014 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003015
Jeff Johnson295189b2012-06-20 16:38:30 -07003016 wdiSetPwrSaveCfgCb: callback for passing back the
3017 response of the set power save cfg operation received
3018 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003019
Jeff Johnson295189b2012-06-20 16:38:30 -07003020 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003021 callback
3022
Jeff Johnson295189b2012-06-20 16:38:30 -07003023 @see WDI_Start
Jeff Johnsone7245742012-09-05 17:12:55 -07003024 @return Result of the function call
3025*/
3026WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003027WDI_SetPwrSaveCfgReq
3028(
3029 WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg,
3030 WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb,
3031 void* pUserData
3032)
3033{
3034 WDI_EventInfoType wdiEventData;
3035 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3036
3037 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003038 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003039 ------------------------------------------------------------------------*/
3040 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3041 {
3042 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3043 "WDI API call before module is initialized - Fail request");
3044
Jeff Johnsone7245742012-09-05 17:12:55 -07003045 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003046 }
3047
3048 /*------------------------------------------------------------------------
3049 Fill in Event data and post to the Main FSM
3050 ------------------------------------------------------------------------*/
3051 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003052 wdiEventData.pEventData = pwdiPowerSaveCfg;
3053 wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg);
3054 wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003055 wdiEventData.pUserData = pUserData;
3056
3057 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3058
3059}/*WDI_SetPwrSaveCfgReq*/
3060
3061/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003062 @brief WDI_EnterImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003063 request the device to get into IMPS power state. Upon
3064 the call of this API the WLAN DAL will send a HAL Enter
3065 IMPS request message to the lower RIVA sub-system if DAL
3066 is in state STARTED.
3067
3068 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003069 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003070
Jeff Johnsone7245742012-09-05 17:12:55 -07003071
3072 @param wdiEnterImpsRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003073 response of the Enter IMPS operation received from the
3074 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003075
Jeff Johnson295189b2012-06-20 16:38:30 -07003076 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003077 callback
3078
Jeff Johnson295189b2012-06-20 16:38:30 -07003079 @see WDI_Start
3080 @return Result of the function call
3081*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003082WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003083WDI_EnterImpsReq
3084(
3085 WDI_EnterImpsRspCb wdiEnterImpsRspCb,
3086 void* pUserData
3087)
3088{
3089 WDI_EventInfoType wdiEventData;
3090 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3091
3092 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003093 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003094 ------------------------------------------------------------------------*/
3095 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3096 {
3097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3098 "WDI API call before module is initialized - Fail request");
3099
Jeff Johnsone7245742012-09-05 17:12:55 -07003100 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003101 }
3102
3103 /*------------------------------------------------------------------------
3104 Fill in Event data and post to the Main FSM
3105 ------------------------------------------------------------------------*/
3106 wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003107 wdiEventData.pEventData = NULL;
3108 wdiEventData.uEventDataSize = 0;
3109 wdiEventData.pCBfnc = wdiEnterImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003110 wdiEventData.pUserData = pUserData;
3111
3112 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3113
3114}/*WDI_EnterImpsReq*/
3115
3116/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003117 @brief WDI_ExitImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003118 request the device to get out of IMPS power state. Upon
3119 the call of this API the WLAN DAL will send a HAL Exit
3120 IMPS request message to the lower RIVA sub-system if DAL
3121 is in state STARTED.
3122
3123 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003124 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003125
Jeff Johnson295189b2012-06-20 16:38:30 -07003126
Jeff Johnsone7245742012-09-05 17:12:55 -07003127
3128 @param wdiExitImpsRspCb: callback for passing back the response
Jeff Johnson295189b2012-06-20 16:38:30 -07003129 of the Exit IMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003130
Jeff Johnson295189b2012-06-20 16:38:30 -07003131 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003132 callback
3133
Jeff Johnson295189b2012-06-20 16:38:30 -07003134 @see WDI_Start
3135 @return Result of the function call
3136*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003137WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003138WDI_ExitImpsReq
3139(
3140 WDI_ExitImpsRspCb wdiExitImpsRspCb,
3141 void* pUserData
3142)
3143{
3144 WDI_EventInfoType wdiEventData;
3145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3146
3147 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003148 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003149 ------------------------------------------------------------------------*/
3150 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3151 {
3152 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3153 "WDI API call before module is initialized - Fail request");
3154
Jeff Johnsone7245742012-09-05 17:12:55 -07003155 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003156 }
3157
3158 /*------------------------------------------------------------------------
3159 Fill in Event data and post to the Main FSM
3160 ------------------------------------------------------------------------*/
3161 wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003162 wdiEventData.pEventData = NULL;
3163 wdiEventData.uEventDataSize = 0;
3164 wdiEventData.pCBfnc = wdiExitImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003165 wdiEventData.pUserData = pUserData;
3166
3167 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3168
3169}/*WDI_ExitImpsReq*/
3170
3171/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003172 @brief WDI_EnterBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003173 request the device to get into BMPS power state. Upon
3174 the call of this API the WLAN DAL will pack and send a
3175 HAL Enter BMPS request message to the lower RIVA
3176 sub-system if DAL is in state STARTED.
3177
3178 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003179 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003180
3181 WDI_PostAssocReq must have been called.
3182
Jeff Johnsone7245742012-09-05 17:12:55 -07003183 @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003184 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003185
Jeff Johnson295189b2012-06-20 16:38:30 -07003186 wdiEnterBmpsRspCb: callback for passing back the
3187 response of the Enter BMPS operation received from the
3188 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003189
Jeff Johnson295189b2012-06-20 16:38:30 -07003190 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003191 callback
3192
Jeff Johnson295189b2012-06-20 16:38:30 -07003193 @see WDI_PostAssocReq
3194 @return Result of the function call
3195*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003196WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003197WDI_EnterBmpsReq
3198(
3199 WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams,
3200 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb,
3201 void* pUserData
3202)
3203{
3204 WDI_EventInfoType wdiEventData;
3205 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3206
3207 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003208 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003209 ------------------------------------------------------------------------*/
3210 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3211 {
3212 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3213 "WDI API call before module is initialized - Fail request");
3214
Jeff Johnsone7245742012-09-05 17:12:55 -07003215 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003216 }
3217
3218 /*------------------------------------------------------------------------
3219 Fill in Event data and post to the Main FSM
3220 ------------------------------------------------------------------------*/
3221 wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003222 wdiEventData.pEventData = pwdiEnterBmpsReqParams;
3223 wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams);
3224 wdiEventData.pCBfnc = wdiEnterBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003225 wdiEventData.pUserData = pUserData;
3226
3227 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3228
3229}/*WDI_EnterBmpsReq*/
3230
3231/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003232 @brief WDI_ExitBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003233 request the device to get out of BMPS power state. Upon
3234 the call of this API the WLAN DAL will pack and send a
3235 HAL Exit BMPS request message to the lower RIVA
3236 sub-system if DAL is in state STARTED.
3237
3238 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003239 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003240
3241 WDI_PostAssocReq must have been called.
3242
Jeff Johnsone7245742012-09-05 17:12:55 -07003243 @param pwdiExitBmpsReqParams: the Exit BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003244 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003245
Jeff Johnson295189b2012-06-20 16:38:30 -07003246 wdiExitBmpsRspCb: callback for passing back the response
3247 of the Exit BMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003248
Jeff Johnson295189b2012-06-20 16:38:30 -07003249 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003250 callback
3251
Jeff Johnson295189b2012-06-20 16:38:30 -07003252 @see WDI_PostAssocReq
3253 @return Result of the function call
3254*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003255WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003256WDI_ExitBmpsReq
3257(
3258 WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams,
3259 WDI_ExitBmpsRspCb wdiExitBmpsRspCb,
3260 void* pUserData
3261)
3262{
3263 WDI_EventInfoType wdiEventData;
3264 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3265
3266 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003267 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003268 ------------------------------------------------------------------------*/
3269 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3270 {
3271 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3272 "WDI API call before module is initialized - Fail request");
3273
Jeff Johnsone7245742012-09-05 17:12:55 -07003274 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003275 }
3276
3277 /*------------------------------------------------------------------------
3278 Fill in Event data and post to the Main FSM
3279 ------------------------------------------------------------------------*/
3280 wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003281 wdiEventData.pEventData = pwdiExitBmpsReqParams;
3282 wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams);
3283 wdiEventData.pCBfnc = wdiExitBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003284 wdiEventData.pUserData = pUserData;
3285
3286 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3287
3288}/*WDI_ExitBmpsReq*/
3289
3290/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003291 @brief WDI_EnterUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003292 request the device to get into UAPSD power state. Upon
3293 the call of this API the WLAN DAL will pack and send a
3294 HAL Enter UAPSD request message to the lower RIVA
3295 sub-system if DAL is in state STARTED.
3296
3297 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003298 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003299
3300 WDI_PostAssocReq must have been called.
3301 WDI_SetUapsdAcParamsReq must have been called.
Jeff Johnsone7245742012-09-05 17:12:55 -07003302
3303 @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003304 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003305
Jeff Johnson295189b2012-06-20 16:38:30 -07003306 wdiEnterUapsdRspCb: callback for passing back the
3307 response of the Enter UAPSD operation received from the
3308 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003309
Jeff Johnson295189b2012-06-20 16:38:30 -07003310 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003311 callback
3312
Jeff Johnson295189b2012-06-20 16:38:30 -07003313 @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq
3314 @return Result of the function call
3315*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003316WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003317WDI_EnterUapsdReq
3318(
3319 WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams,
3320 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb,
3321 void* pUserData
3322)
3323{
3324 WDI_EventInfoType wdiEventData;
3325 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3326
3327 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003328 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003329 ------------------------------------------------------------------------*/
3330 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3331 {
3332 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3333 "WDI API call before module is initialized - Fail request");
3334
Jeff Johnsone7245742012-09-05 17:12:55 -07003335 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003336 }
3337
3338 /*------------------------------------------------------------------------
3339 Fill in Event data and post to the Main FSM
3340 ------------------------------------------------------------------------*/
3341 wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003342 wdiEventData.pEventData = pwdiEnterUapsdReqParams;
3343 wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams);
3344 wdiEventData.pCBfnc = wdiEnterUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003345 wdiEventData.pUserData = pUserData;
3346
3347 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3348
3349}/*WDI_EnterUapsdReq*/
3350
3351/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003352 @brief WDI_ExitUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003353 request the device to get out of UAPSD power state. Upon
3354 the call of this API the WLAN DAL will send a HAL Exit
3355 UAPSD request message to the lower RIVA sub-system if
3356 DAL is in state STARTED.
3357
3358 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003359 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003360
3361 WDI_PostAssocReq must have been called.
3362
Jeff Johnsone7245742012-09-05 17:12:55 -07003363 @param wdiExitUapsdRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003364 response of the Exit UAPSD operation received from the
3365 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003366
Jeff Johnson295189b2012-06-20 16:38:30 -07003367 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003368 callback
3369
Jeff Johnson295189b2012-06-20 16:38:30 -07003370 @see WDI_PostAssocReq
3371 @return Result of the function call
3372*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003373WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003374WDI_ExitUapsdReq
3375(
3376 WDI_ExitUapsdRspCb wdiExitUapsdRspCb,
3377 void* pUserData
3378)
3379{
3380 WDI_EventInfoType wdiEventData;
3381 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3382
3383 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003384 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003385 ------------------------------------------------------------------------*/
3386 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3387 {
3388 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3389 "WDI API call before module is initialized - Fail request");
3390
Jeff Johnsone7245742012-09-05 17:12:55 -07003391 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003392 }
3393
3394 /*------------------------------------------------------------------------
3395 Fill in Event data and post to the Main FSM
3396 ------------------------------------------------------------------------*/
3397 wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003398 wdiEventData.pEventData = NULL;
3399 wdiEventData.uEventDataSize = 0;
3400 wdiEventData.pCBfnc = wdiExitUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003401 wdiEventData.pUserData = pUserData;
3402
3403 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3404
3405}/*WDI_ExitUapsdReq*/
3406
3407/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003408 @brief WDI_UpdateUapsdParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003409 MAC wants to set the UAPSD related configurations
3410 of an associated STA (while acting as an AP) to the WLAN
3411 Device. Upon the call of this API the WLAN DAL will pack
3412 and send a HAL Update UAPSD params request message to
3413 the lower RIVA sub-system if DAL is in state STARTED.
3414
3415 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003416 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003417
3418 WDI_ConfigBSSReq must have been called.
3419
Jeff Johnsone7245742012-09-05 17:12:55 -07003420 @param pwdiUpdateUapsdReqParams: the UAPSD parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07003421 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003422
Jeff Johnson295189b2012-06-20 16:38:30 -07003423 wdiUpdateUapsdParamsCb: callback for passing back the
3424 response of the update UAPSD params operation received
3425 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003426
Jeff Johnson295189b2012-06-20 16:38:30 -07003427 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003428 callback
3429
Jeff Johnson295189b2012-06-20 16:38:30 -07003430 @see WDI_ConfigBSSReq
3431 @return Result of the function call
3432*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003433WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003434WDI_UpdateUapsdParamsReq
3435(
3436 WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams,
3437 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb,
3438 void* pUserData
3439)
3440{
3441 WDI_EventInfoType wdiEventData;
3442 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3443
3444 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003445 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003446 ------------------------------------------------------------------------*/
3447 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3448 {
3449 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3450 "WDI API call before module is initialized - Fail request");
3451
Jeff Johnsone7245742012-09-05 17:12:55 -07003452 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003453 }
3454
3455 /*------------------------------------------------------------------------
3456 Fill in Event data and post to the Main FSM
3457 ------------------------------------------------------------------------*/
3458 wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003459 wdiEventData.pEventData = pwdiUpdateUapsdReqParams;
3460 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);;
3461 wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003462 wdiEventData.pUserData = pUserData;
3463
3464 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3465
3466}/*WDI_UpdateUapsdParamsReq*/
3467
3468/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003469 @brief WDI_SetUapsdAcParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003470 MAC wants to set the UAPSD related configurations before
3471 requesting for enter UAPSD power state to the WLAN
3472 Device. Upon the call of this API the WLAN DAL will pack
3473 and send a HAL Set UAPSD params request message to
3474 the lower RIVA sub-system if DAL is in state STARTED.
3475
3476 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003477 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003478
3479 WDI_PostAssocReq must have been called.
3480
3481 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3482 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003483
Jeff Johnson295189b2012-06-20 16:38:30 -07003484 wdiSetUapsdAcParamsCb: callback for passing back the
3485 response of the set UAPSD params operation received from
3486 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003487
Jeff Johnson295189b2012-06-20 16:38:30 -07003488 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003489 callback
3490
Jeff Johnson295189b2012-06-20 16:38:30 -07003491 @see WDI_PostAssocReq
3492 @return Result of the function call
3493*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003494WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003495WDI_SetUapsdAcParamsReq
3496(
3497 WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo,
3498 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb,
3499 void* pUserData
3500)
3501{
3502 WDI_EventInfoType wdiEventData;
3503 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3504
3505 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003506 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003507 ------------------------------------------------------------------------*/
3508 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3509 {
3510 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3511 "WDI API call before module is initialized - Fail request");
3512
Jeff Johnsone7245742012-09-05 17:12:55 -07003513 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003514 }
3515
3516 /*------------------------------------------------------------------------
3517 Fill in Event data and post to the Main FSM
3518 ------------------------------------------------------------------------*/
3519 wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003520 wdiEventData.pEventData = pwdiUapsdInfo;
3521 wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo);
3522 wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003523 wdiEventData.pUserData = pUserData;
3524
3525 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3526
3527}/*WDI_SetUapsdAcParamsReq*/
3528
3529/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003530 @brief WDI_ConfigureRxpFilterReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003531 MAC wants to set/reset the RXP filters for received pkts
3532 (MC, BC etc.). Upon the call of this API the WLAN DAL will pack
3533 and send a HAL configure RXP filter request message to
3534 the lower RIVA sub-system.
3535
3536 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003537 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003538
Jeff Johnsone7245742012-09-05 17:12:55 -07003539
3540 @param pwdiConfigureRxpFilterReqParams: the RXP
Jeff Johnson295189b2012-06-20 16:38:30 -07003541 filter as specified by the Device
3542 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003543
Jeff Johnson295189b2012-06-20 16:38:30 -07003544 wdiConfigureRxpFilterCb: callback for passing back the
3545 response of the configure RXP filter operation received
3546 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003547
Jeff Johnson295189b2012-06-20 16:38:30 -07003548 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003549 callback
3550
Jeff Johnson295189b2012-06-20 16:38:30 -07003551 @return Result of the function call
3552*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003553WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003554WDI_ConfigureRxpFilterReq
3555(
3556 WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams,
3557 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb,
3558 void* pUserData
3559)
3560{
3561 WDI_EventInfoType wdiEventData;
3562 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3563
3564 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003565 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003566 ------------------------------------------------------------------------*/
3567 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3568 {
3569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3570 "WDI API call before module is initialized - Fail request");
3571
Jeff Johnsone7245742012-09-05 17:12:55 -07003572 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003573 }
3574
3575 /*------------------------------------------------------------------------
3576 Fill in Event data and post to the Main FSM
3577 ------------------------------------------------------------------------*/
3578 wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003579 wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams;
3580 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams);
3581 wdiEventData.pCBfnc = wdiConfigureRxpFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003582 wdiEventData.pUserData = pUserData;
3583
3584 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3585}/*WDI_ConfigureRxpFilterReq*/
3586
3587/**
3588 @brief WDI_SetBeaconFilterReq will be called when the upper MAC
3589 wants to set the beacon filters while in power save.
3590 Upon the call of this API the WLAN DAL will pack and
3591 send a Beacon filter request message to the
3592 lower RIVA sub-system.
3593
3594 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003595 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003596
Jeff Johnsone7245742012-09-05 17:12:55 -07003597
3598 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003599 filter as specified by the Device
3600 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003601
Jeff Johnson295189b2012-06-20 16:38:30 -07003602 wdiBeaconFilterCb: callback for passing back the
3603 response of the set beacon filter operation received
3604 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003605
Jeff Johnson295189b2012-06-20 16:38:30 -07003606 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003607 callback
3608
Jeff Johnson295189b2012-06-20 16:38:30 -07003609 @return Result of the function call
3610*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003611WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003612WDI_SetBeaconFilterReq
3613(
3614 WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3615 WDI_SetBeaconFilterCb wdiBeaconFilterCb,
3616 void* pUserData
3617)
3618{
3619 WDI_EventInfoType wdiEventData;
3620 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3621
3622 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003623 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003624 ------------------------------------------------------------------------*/
3625 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3626 {
3627 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3628 "WDI API call before module is initialized - Fail request");
3629
Jeff Johnsone7245742012-09-05 17:12:55 -07003630 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003631 }
3632
3633 /*------------------------------------------------------------------------
3634 Fill in Event data and post to the Main FSM
3635 ------------------------------------------------------------------------*/
3636 wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003637 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3638 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3639 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003640 wdiEventData.pUserData = pUserData;
3641
3642 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3643}/*WDI_SetBeaconFilterReq*/
3644
3645/**
3646 @brief WDI_RemBeaconFilterReq will be called when the upper MAC
3647 wants to remove the beacon filter for particular IE
3648 while in power save. Upon the call of this API the WLAN
3649 DAL will pack and send a remove Beacon filter request
3650 message to the lower RIVA sub-system.
3651
3652 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003653 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003654
Jeff Johnsone7245742012-09-05 17:12:55 -07003655
3656 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003657 filter as specified by the Device
3658 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003659
Jeff Johnson295189b2012-06-20 16:38:30 -07003660 wdiBeaconFilterCb: callback for passing back the
3661 response of the remove beacon filter operation received
3662 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003663
Jeff Johnson295189b2012-06-20 16:38:30 -07003664 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003665 callback
3666
Jeff Johnson295189b2012-06-20 16:38:30 -07003667 @return Result of the function call
3668*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003669WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003670WDI_RemBeaconFilterReq
3671(
3672 WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3673 WDI_RemBeaconFilterCb wdiBeaconFilterCb,
3674 void* pUserData
3675)
3676{
3677 WDI_EventInfoType wdiEventData;
3678 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3679
3680 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003681 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003682 ------------------------------------------------------------------------*/
3683 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3684 {
3685 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3686 "WDI API call before module is initialized - Fail request");
3687
Jeff Johnsone7245742012-09-05 17:12:55 -07003688 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003689 }
3690
3691 /*------------------------------------------------------------------------
3692 Fill in Event data and post to the Main FSM
3693 ------------------------------------------------------------------------*/
3694 wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003695 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3696 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3697 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003698 wdiEventData.pUserData = pUserData;
3699
3700 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3701}/*WDI_RemBeaconFilterReq*/
3702
3703/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003704 @brief WDI_SetRSSIThresholdsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003705 MAC wants to set the RSSI thresholds related
3706 configurations while in power save. Upon the call of
3707 this API the WLAN DAL will pack and send a HAL Set RSSI
3708 thresholds request message to the lower RIVA
3709 sub-system if DAL is in state STARTED.
3710
3711 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003712 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003713
3714 WDI_PostAssocReq must have been called.
3715
3716 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3717 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003718
Jeff Johnson295189b2012-06-20 16:38:30 -07003719 wdiSetUapsdAcParamsCb: callback for passing back the
3720 response of the set UAPSD params operation received from
3721 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003722
Jeff Johnson295189b2012-06-20 16:38:30 -07003723 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003724 callback
3725
Jeff Johnson295189b2012-06-20 16:38:30 -07003726 @see WDI_PostAssocReq
3727 @return Result of the function call
3728*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003729WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003730WDI_SetRSSIThresholdsReq
3731(
3732 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams,
3733 WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb,
3734 void* pUserData
3735)
3736{
3737 WDI_EventInfoType wdiEventData;
3738 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3739
3740 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003741 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003742 ------------------------------------------------------------------------*/
3743 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3744 {
3745 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3746 "WDI API call before module is initialized - Fail request");
3747
Jeff Johnsone7245742012-09-05 17:12:55 -07003748 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003749 }
3750
3751 /*------------------------------------------------------------------------
3752 Fill in Event data and post to the Main FSM
3753 ------------------------------------------------------------------------*/
3754 wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003755 wdiEventData.pEventData = pwdiRSSIThresholdsParams;
3756 wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);;
3757 wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003758 wdiEventData.pUserData = pUserData;
3759
3760 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3761}/* WDI_SetRSSIThresholdsReq*/
3762
3763/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003764 @brief WDI_HostOffloadReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003765 wants to set the filter to minimize unnecessary host
3766 wakeup due to broadcast traffic while in power save.
3767 Upon the call of this API the WLAN DAL will pack and
3768 send a HAL host offload request message to the
3769 lower RIVA sub-system if DAL is in state STARTED.
3770
3771 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003772 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003773
3774 WDI_PostAssocReq must have been called.
3775
Jeff Johnsone7245742012-09-05 17:12:55 -07003776 @param pwdiHostOffloadParams: the host offload as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003777 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003778
Jeff Johnson295189b2012-06-20 16:38:30 -07003779 wdiHostOffloadCb: callback for passing back the response
3780 of the host offload operation received from the
3781 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003782
Jeff Johnson295189b2012-06-20 16:38:30 -07003783 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003784 callback
3785
Jeff Johnson295189b2012-06-20 16:38:30 -07003786 @see WDI_PostAssocReq
3787 @return Result of the function call
3788*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003789WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003790WDI_HostOffloadReq
3791(
3792 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams,
3793 WDI_HostOffloadCb wdiHostOffloadCb,
3794 void* pUserData
3795)
3796{
3797 WDI_EventInfoType wdiEventData;
3798 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3799
3800 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003801 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003802 ------------------------------------------------------------------------*/
3803 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3804 {
3805 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3806 "WDI API call before module is initialized - Fail request");
3807
Jeff Johnsone7245742012-09-05 17:12:55 -07003808 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003809 }
3810
3811 /*------------------------------------------------------------------------
3812 Fill in Event data and post to the Main FSM
3813 ------------------------------------------------------------------------*/
3814 wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003815 wdiEventData.pEventData = pwdiHostOffloadParams;
3816 wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);;
3817 wdiEventData.pCBfnc = wdiHostOffloadCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003818 wdiEventData.pUserData = pUserData;
3819
3820 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3821}/*WDI_HostOffloadReq*/
3822
3823/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003824 @brief WDI_KeepAliveReq will be called when the upper MAC
3825 wants to set the filter to send NULL or unsolicited ARP responses
Jeff Johnson295189b2012-06-20 16:38:30 -07003826 and minimize unnecessary host wakeups due to while in power save.
3827 Upon the call of this API the WLAN DAL will pack and
3828 send a HAL Keep Alive request message to the
3829 lower RIVA sub-system if DAL is in state STARTED.
3830
3831 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003832 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003833
3834 WDI_PostAssocReq must have been called.
3835
Jeff Johnsone7245742012-09-05 17:12:55 -07003836 @param pwdiKeepAliveParams: the Keep Alive as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003837 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003838
Jeff Johnson295189b2012-06-20 16:38:30 -07003839 wdiKeepAliveCb: callback for passing back the response
3840 of the Keep Alive operation received from the
3841 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003842
Jeff Johnson295189b2012-06-20 16:38:30 -07003843 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003844 callback
3845
Jeff Johnson295189b2012-06-20 16:38:30 -07003846 @see WDI_PostAssocReq
3847 @return Result of the function call
3848*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003849WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003850WDI_KeepAliveReq
3851(
3852 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams,
3853 WDI_KeepAliveCb wdiKeepAliveCb,
3854 void* pUserData
3855)
3856{
3857 WDI_EventInfoType wdiEventData;
3858 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3859
3860 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003861 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003862 ------------------------------------------------------------------------*/
3863 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3864 {
3865 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3866 "WDI_KeepAliveReq: WDI API call before module "
3867 "is initialized - Fail request");
3868
Jeff Johnsone7245742012-09-05 17:12:55 -07003869 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003870 }
3871
3872 /*------------------------------------------------------------------------
3873 Fill in Event data and post to the Main FSM
3874 ------------------------------------------------------------------------*/
3875 wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003876 wdiEventData.pEventData = pwdiKeepAliveParams;
3877 wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams);
3878 wdiEventData.pCBfnc = wdiKeepAliveCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003879 wdiEventData.pUserData = pUserData;
3880
3881 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3882}/*WDI_KeepAliveReq*/
3883
3884/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003885 @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003886 wants to set the Wowl Bcast ptrn to minimize unnecessary
3887 host wakeup due to broadcast traffic while in power
3888 save. Upon the call of this API the WLAN DAL will pack
3889 and send a HAL Wowl Bcast ptrn request message to the
3890 lower RIVA sub-system if DAL is in state STARTED.
3891
3892 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003893 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003894
3895 WDI_PostAssocReq must have been called.
3896
Jeff Johnsone7245742012-09-05 17:12:55 -07003897 @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003898 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003899
Jeff Johnson295189b2012-06-20 16:38:30 -07003900 wdiWowlAddBcPtrnCb: callback for passing back the
3901 response of the add Wowl bcast ptrn operation received
3902 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003903
Jeff Johnson295189b2012-06-20 16:38:30 -07003904 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003905 callback
3906
Jeff Johnson295189b2012-06-20 16:38:30 -07003907 @see WDI_PostAssocReq
3908 @return Result of the function call
3909*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003910WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003911WDI_WowlAddBcPtrnReq
3912(
3913 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams,
3914 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb,
3915 void* pUserData
3916)
3917{
3918 WDI_EventInfoType wdiEventData;
3919 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3920
3921 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003922 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003923 ------------------------------------------------------------------------*/
3924 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3925 {
3926 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3927 "WDI API call before module is initialized - Fail request");
3928
Jeff Johnsone7245742012-09-05 17:12:55 -07003929 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003930 }
3931
3932 /*------------------------------------------------------------------------
3933 Fill in Event data and post to the Main FSM
3934 ------------------------------------------------------------------------*/
3935 wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003936 wdiEventData.pEventData = pwdiWowlAddBcPtrnParams;
3937 wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);;
3938 wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003939 wdiEventData.pUserData = pUserData;
3940
3941 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3942}/*WDI_WowlAddBcPtrnReq*/
3943
3944/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003945 @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003946 wants to clear the Wowl Bcast ptrn. Upon the call of
3947 this API the WLAN DAL will pack and send a HAL delete
3948 Wowl Bcast ptrn request message to the lower RIVA
3949 sub-system if DAL is in state STARTED.
3950
3951 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003952 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003953
3954 WDI_WowlAddBcPtrnReq must have been called.
3955
Jeff Johnsone7245742012-09-05 17:12:55 -07003956 @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003957 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003958
Jeff Johnson295189b2012-06-20 16:38:30 -07003959 wdiWowlDelBcPtrnCb: callback for passing back the
3960 response of the del Wowl bcast ptrn operation received
3961 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003962
Jeff Johnson295189b2012-06-20 16:38:30 -07003963 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003964 callback
3965
Jeff Johnson295189b2012-06-20 16:38:30 -07003966 @see WDI_WowlAddBcPtrnReq
3967 @return Result of the function call
3968*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003969WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003970WDI_WowlDelBcPtrnReq
3971(
3972 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams,
3973 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb,
3974 void* pUserData
3975)
3976{
3977 WDI_EventInfoType wdiEventData;
3978 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3979
3980 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003981 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003982 ------------------------------------------------------------------------*/
3983 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3984 {
3985 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3986 "WDI API call before module is initialized - Fail request");
3987
Jeff Johnsone7245742012-09-05 17:12:55 -07003988 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003989 }
3990
3991 /*------------------------------------------------------------------------
3992 Fill in Event data and post to the Main FSM
3993 ------------------------------------------------------------------------*/
3994 wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003995 wdiEventData.pEventData = pwdiWowlDelBcPtrnParams;
3996 wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);;
3997 wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003998 wdiEventData.pUserData = pUserData;
3999
4000 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4001}/*WDI_WowlDelBcPtrnReq*/
4002
4003/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004004 @brief WDI_WowlEnterReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004005 wants to enter the Wowl state to minimize unnecessary
4006 host wakeup while in power save. Upon the call of this
4007 API the WLAN DAL will pack and send a HAL Wowl enter
4008 request message to the lower RIVA sub-system if DAL is
4009 in state STARTED.
4010
4011 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004012 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004013
4014 WDI_PostAssocReq must have been called.
4015
Jeff Johnsone7245742012-09-05 17:12:55 -07004016 @param pwdiWowlEnterReqParams: the Wowl enter info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004017 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004018
Jeff Johnson295189b2012-06-20 16:38:30 -07004019 wdiWowlEnterReqCb: callback for passing back the
4020 response of the enter Wowl operation received from the
4021 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004022
Jeff Johnson295189b2012-06-20 16:38:30 -07004023 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004024 callback
4025
Jeff Johnson295189b2012-06-20 16:38:30 -07004026 @see WDI_PostAssocReq
4027 @return Result of the function call
4028*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004029WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004030WDI_WowlEnterReq
4031(
4032 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams,
4033 WDI_WowlEnterReqCb wdiWowlEnterCb,
4034 void* pUserData
4035)
4036{
4037 WDI_EventInfoType wdiEventData;
4038 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4039
4040 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004041 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004042 ------------------------------------------------------------------------*/
4043 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4044 {
4045 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4046 "WDI API call before module is initialized - Fail request");
4047
Jeff Johnsone7245742012-09-05 17:12:55 -07004048 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004049 }
4050
4051 /*------------------------------------------------------------------------
4052 Fill in Event data and post to the Main FSM
4053 ------------------------------------------------------------------------*/
4054 wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004055 wdiEventData.pEventData = pwdiWowlEnterParams;
4056 wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);;
4057 wdiEventData.pCBfnc = wdiWowlEnterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004058 wdiEventData.pUserData = pUserData;
4059
4060 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4061}/*WDI_WowlEnterReq*/
4062
4063/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004064 @brief WDI_WowlExitReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004065 wants to exit the Wowl state. Upon the call of this API
4066 the WLAN DAL will pack and send a HAL Wowl exit request
4067 message to the lower RIVA sub-system if DAL is in state
4068 STARTED.
4069
4070 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004071 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004072
4073 WDI_WowlEnterReq must have been called.
4074
Jeff Johnsone7245742012-09-05 17:12:55 -07004075 @param pwdiWowlExitReqParams: the Wowl exit info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004076 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004077
Jeff Johnson295189b2012-06-20 16:38:30 -07004078 wdiWowlExitReqCb: callback for passing back the response
4079 of the exit Wowl operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004080
Jeff Johnson295189b2012-06-20 16:38:30 -07004081 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004082 callback
4083
Jeff Johnson295189b2012-06-20 16:38:30 -07004084 @see WDI_WowlEnterReq
4085 @return Result of the function call
4086*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004087WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004088WDI_WowlExitReq
4089(
4090 WDI_WowlExitReqCb wdiWowlExitCb,
4091 void* pUserData
4092)
4093{
4094 WDI_EventInfoType wdiEventData;
4095 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4096
4097 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004098 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004099 ------------------------------------------------------------------------*/
4100 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4101 {
4102 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4103 "WDI API call before module is initialized - Fail request");
4104
Jeff Johnsone7245742012-09-05 17:12:55 -07004105 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004106 }
4107
4108 /*------------------------------------------------------------------------
4109 Fill in Event data and post to the Main FSM
4110 ------------------------------------------------------------------------*/
4111 wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004112 wdiEventData.pEventData = NULL;
4113 wdiEventData.uEventDataSize = 0;
4114 wdiEventData.pCBfnc = wdiWowlExitCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004115 wdiEventData.pUserData = pUserData;
4116
4117 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4118}/*WDI_WowlExitReq*/
4119
4120/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004121 @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when
Jeff Johnson295189b2012-06-20 16:38:30 -07004122 the upper MAC wants to dynamically adjusts the listen
4123 interval based on the WLAN/MSM activity. Upon the call
4124 of this API the WLAN DAL will pack and send a HAL
4125 configure Apps Cpu Wakeup State request message to the
4126 lower RIVA sub-system.
4127
4128 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004129 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004130
Jeff Johnsone7245742012-09-05 17:12:55 -07004131
4132 @param pwdiConfigureAppsCpuWakeupStateReqParams: the
Jeff Johnson295189b2012-06-20 16:38:30 -07004133 Apps Cpu Wakeup State as specified by the
4134 Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004135
Jeff Johnson295189b2012-06-20 16:38:30 -07004136 wdiConfigureAppsCpuWakeupStateCb: callback for passing
4137 back the response of the configure Apps Cpu Wakeup State
4138 operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004139
Jeff Johnson295189b2012-06-20 16:38:30 -07004140 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004141 callback
4142
Jeff Johnson295189b2012-06-20 16:38:30 -07004143 @return Result of the function call
4144*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004145WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004146WDI_ConfigureAppsCpuWakeupStateReq
4147(
4148 WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams,
4149 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb,
4150 void* pUserData
4151)
4152{
4153 WDI_EventInfoType wdiEventData;
4154 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4155
4156 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004157 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004158 ------------------------------------------------------------------------*/
4159 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4160 {
4161 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4162 "WDI API call before module is initialized - Fail request");
4163
Jeff Johnsone7245742012-09-05 17:12:55 -07004164 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004165 }
4166
4167 /*------------------------------------------------------------------------
4168 Fill in Event data and post to the Main FSM
4169 ------------------------------------------------------------------------*/
4170 wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004171 wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams;
4172 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams);
4173 wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004174 wdiEventData.pUserData = pUserData;
4175
4176 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4177}/*WDI_ConfigureAppsCpuWakeupStateReq*/
4178/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004179 @brief WDI_FlushAcReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004180 to to perform a flush operation on a given AC. Upon the
4181 call of this API the WLAN DAL will pack and send a HAL
4182 Flush AC request message to the lower RIVA sub-system if
4183 DAL is in state STARTED.
4184
4185 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004186 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004187
4188 WDI_AddBAReq must have been called.
4189
Jeff Johnsone7245742012-09-05 17:12:55 -07004190 @param pwdiFlushAcReqParams: the Flush AC parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004191 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004192
Jeff Johnson295189b2012-06-20 16:38:30 -07004193 wdiFlushAcRspCb: callback for passing back the response
4194 of the Flush AC operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004195
Jeff Johnson295189b2012-06-20 16:38:30 -07004196 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004197 callback
4198
Jeff Johnson295189b2012-06-20 16:38:30 -07004199 @see WDI_AddBAReq
4200 @return Result of the function call
4201*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004202WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004203WDI_FlushAcReq
4204(
4205 WDI_FlushAcReqParamsType* pwdiFlushAcReqParams,
4206 WDI_FlushAcRspCb wdiFlushAcRspCb,
4207 void* pUserData
4208)
4209{
4210 WDI_EventInfoType wdiEventData;
4211 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4212
4213 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004214 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004215 ------------------------------------------------------------------------*/
4216 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4217 {
4218 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4219 "WDI API call before module is initialized - Fail request");
4220
Jeff Johnsone7245742012-09-05 17:12:55 -07004221 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004222 }
4223
4224 /*------------------------------------------------------------------------
4225 Fill in Event data and post to the Main FSM
4226 ------------------------------------------------------------------------*/
4227 wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004228 wdiEventData.pEventData = pwdiFlushAcReqParams;
4229 wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams);
4230 wdiEventData.pCBfnc = wdiFlushAcRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004231 wdiEventData.pUserData = pUserData;
4232
4233 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4234
4235}/*WDI_FlushAcReq*/
4236
4237/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004238 @brief WDI_BtAmpEventReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004239 wants to notify the lower mac on a BT AMP event. This is
4240 to inform BTC-SLM that some BT AMP event occurred. Upon
4241 the call of this API the WLAN DAL will pack and send a
4242 HAL BT AMP event request message to the lower RIVA
4243 sub-system if DAL is in state STARTED.
4244
4245 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004246 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004247
Jeff Johnsone7245742012-09-05 17:12:55 -07004248
4249 @param wdiBtAmpEventReqParams: the BT AMP event parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004250 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004251
Jeff Johnson295189b2012-06-20 16:38:30 -07004252 wdiBtAmpEventRspCb: callback for passing back the
4253 response of the BT AMP event operation received from the
4254 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004255
Jeff Johnson295189b2012-06-20 16:38:30 -07004256 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004257 callback
4258
Jeff Johnson295189b2012-06-20 16:38:30 -07004259 @return Result of the function call
4260*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004261WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004262WDI_BtAmpEventReq
4263(
4264 WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams,
4265 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb,
4266 void* pUserData
4267)
4268{
4269 WDI_EventInfoType wdiEventData;
4270 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4271
4272 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004273 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004274 ------------------------------------------------------------------------*/
4275 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4276 {
4277 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4278 "WDI API call before module is initialized - Fail request");
4279
Jeff Johnsone7245742012-09-05 17:12:55 -07004280 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004281 }
4282
4283 /*------------------------------------------------------------------------
4284 Fill in Event data and post to the Main FSM
4285 ------------------------------------------------------------------------*/
4286 wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004287 wdiEventData.pEventData = pwdiBtAmpEventReqParams;
4288 wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams);
4289 wdiEventData.pCBfnc = wdiBtAmpEventRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004290 wdiEventData.pUserData = pUserData;
4291
4292 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4293
4294}/*WDI_BtAmpEventReq*/
4295
Jeff Johnsone7245742012-09-05 17:12:55 -07004296#ifdef FEATURE_OEM_DATA_SUPPORT
4297/**
4298 @brief WDI_Start Oem Data Req will be called when the upper MAC
4299 wants to notify the lower mac on a oem data Req event.Upon
4300 the call of this API the WLAN DAL will pack and send a
4301 HAL OEM Data Req event request message to the lower RIVA
4302 sub-system if DAL is in state STARTED.
4303
4304 In state BUSY this request will be queued. Request won't
4305 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004306
4307
Jeff Johnsone7245742012-09-05 17:12:55 -07004308
4309 @param pwdiOemDataReqParams: the Oem Data Req as
4310 specified by the Device Interface
4311
4312 wdiStartOemDataRspCb: callback for passing back the
4313 response of the Oem Data Req received from the
4314 device
4315
4316 pUserData: user data will be passed back with the
4317 callback
4318
4319 @return Result of the function call
4320*/
4321WDI_Status
4322WDI_StartOemDataReq
4323(
4324 WDI_oemDataReqParamsType* pwdiOemDataReqParams,
4325 WDI_oemDataRspCb wdiOemDataRspCb,
4326 void* pUserData
4327)
4328{
4329 WDI_EventInfoType wdiEventData;
4330 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4331
4332 /*------------------------------------------------------------------------
4333 Sanity Check
4334 ------------------------------------------------------------------------*/
4335 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4336 {
4337 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4338 "WDI API call before module is initialized - Fail request");
4339
4340 return WDI_STATUS_E_NOT_ALLOWED;
4341 }
4342
4343 /*------------------------------------------------------------------------
4344 Fill in Event data and post to the Main FSM
4345 ------------------------------------------------------------------------*/
4346 wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ;
4347 wdiEventData.pEventData = pwdiOemDataReqParams;
4348 wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams);
4349 wdiEventData.pCBfnc = wdiOemDataRspCb;
4350 wdiEventData.pUserData = pUserData;
4351
4352 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4353
4354
4355}
4356
4357#endif
4358
4359
4360/*========================================================================
4361
Jeff Johnson295189b2012-06-20 16:38:30 -07004362 CONTROL APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07004363
Jeff Johnson295189b2012-06-20 16:38:30 -07004364==========================================================================*/
4365/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004366 @brief WDI_SwitchChReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004367 the WLAN HW to change the current channel of operation.
4368 Upon the call of this API the WLAN DAL will pack and
4369 send a HAL Start request message to the lower RIVA
4370 sub-system if DAL is in state STARTED.
4371
4372 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004373 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004374
4375 WDI_Start must have been called.
4376
Jeff Johnsone7245742012-09-05 17:12:55 -07004377 @param wdiSwitchChReqParams: the switch ch parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004378 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004379
Jeff Johnson295189b2012-06-20 16:38:30 -07004380 wdiSwitchChRspCb: callback for passing back the response
4381 of the switch ch operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004382
Jeff Johnson295189b2012-06-20 16:38:30 -07004383 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004384 callback
4385
Jeff Johnson295189b2012-06-20 16:38:30 -07004386 @see WDI_Start
4387 @return Result of the function call
4388*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004389WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004390WDI_SwitchChReq
4391(
4392 WDI_SwitchChReqParamsType* pwdiSwitchChReqParams,
4393 WDI_SwitchChRspCb wdiSwitchChRspCb,
4394 void* pUserData
4395)
4396{
4397 WDI_EventInfoType wdiEventData;
4398 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4399
4400 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004401 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004402 ------------------------------------------------------------------------*/
4403 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4404 {
4405 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4406 "WDI API call before module is initialized - Fail request");
4407
Jeff Johnsone7245742012-09-05 17:12:55 -07004408 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004409 }
4410
4411 /*------------------------------------------------------------------------
4412 Fill in Event data and post to the Main FSM
4413 ------------------------------------------------------------------------*/
4414 wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004415 wdiEventData.pEventData = pwdiSwitchChReqParams;
4416 wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams);
4417 wdiEventData.pCBfnc = wdiSwitchChRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004418 wdiEventData.pUserData = pUserData;
4419
4420 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4421
4422}/*WDI_SwitchChReq*/
4423
4424
4425/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004426 @brief WDI_ConfigSTAReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004427 wishes to add or update a STA in HW. Upon the call of
4428 this API the WLAN DAL will pack and send a HAL Start
4429 message request message to the lower RIVA sub-system if
4430 DAL is in state STARTED.
4431
4432 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004433 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004434
4435 WDI_Start must have been called.
4436
Jeff Johnsone7245742012-09-05 17:12:55 -07004437 @param wdiConfigSTAReqParams: the config STA parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004438 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004439
Jeff Johnson295189b2012-06-20 16:38:30 -07004440 wdiConfigSTARspCb: callback for passing back the
4441 response of the config STA operation received from the
4442 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004443
Jeff Johnson295189b2012-06-20 16:38:30 -07004444 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004445 callback
4446
Jeff Johnson295189b2012-06-20 16:38:30 -07004447 @see WDI_Start
4448 @return Result of the function call
4449*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004450WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004451WDI_ConfigSTAReq
4452(
4453 WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams,
4454 WDI_ConfigSTARspCb wdiConfigSTARspCb,
4455 void* pUserData
4456)
4457{
4458 WDI_EventInfoType wdiEventData;
4459 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4460
4461 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004462 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004463 ------------------------------------------------------------------------*/
4464 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4465 {
4466 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4467 "WDI API call before module is initialized - Fail request");
4468
Jeff Johnsone7245742012-09-05 17:12:55 -07004469 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004470 }
4471
4472 /*------------------------------------------------------------------------
4473 Fill in Event data and post to the Main FSM
4474 ------------------------------------------------------------------------*/
4475 wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004476 wdiEventData.pEventData = pwdiConfigSTAReqParams;
4477 wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams);
4478 wdiEventData.pCBfnc = wdiConfigSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004479 wdiEventData.pUserData = pUserData;
4480
4481 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4482
4483}/*WDI_ConfigSTAReq*/
4484
4485/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004486 @brief WDI_SetLinkStateReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004487 wants to change the state of an ongoing link. Upon the
4488 call of this API the WLAN DAL will pack and send a HAL
4489 Start message request message to the lower RIVA
4490 sub-system if DAL is in state STARTED.
4491
4492 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004493 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004494
4495 WDI_JoinStartReq must have been called.
4496
Jeff Johnsone7245742012-09-05 17:12:55 -07004497 @param wdiSetLinkStateReqParams: the set link state parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07004498 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004499
Jeff Johnson295189b2012-06-20 16:38:30 -07004500 wdiSetLinkStateRspCb: callback for passing back the
4501 response of the set link state operation received from
4502 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004503
Jeff Johnson295189b2012-06-20 16:38:30 -07004504 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004505 callback
4506
Jeff Johnson295189b2012-06-20 16:38:30 -07004507 @see WDI_JoinStartReq
4508 @return Result of the function call
4509*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004510WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004511WDI_SetLinkStateReq
4512(
4513 WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams,
4514 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb,
4515 void* pUserData
4516)
4517{
4518 WDI_EventInfoType wdiEventData;
4519 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4520
4521 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004522 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004523 ------------------------------------------------------------------------*/
4524 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4525 {
4526 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4527 "WDI API call before module is initialized - Fail request");
4528
Jeff Johnsone7245742012-09-05 17:12:55 -07004529 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004530 }
4531
4532 /*------------------------------------------------------------------------
4533 Fill in Event data and post to the Main FSM
4534 ------------------------------------------------------------------------*/
4535 wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004536 wdiEventData.pEventData = pwdiSetLinkStateReqParams;
4537 wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams);
4538 wdiEventData.pCBfnc = wdiSetLinkStateRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004539 wdiEventData.pUserData = pUserData;
4540
4541 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4542
4543}/*WDI_SetLinkStateReq*/
4544
4545
4546/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004547 @brief WDI_GetStatsReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004548 to get statistics (MIB counters) from the device. Upon
4549 the call of this API the WLAN DAL will pack and send a
4550 HAL Start request message to the lower RIVA sub-system
4551 if DAL is in state STARTED.
4552
4553 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004554 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004555
4556 WDI_Start must have been called.
4557
Jeff Johnsone7245742012-09-05 17:12:55 -07004558 @param wdiGetStatsReqParams: the stats parameters to get as
Jeff Johnson295189b2012-06-20 16:38:30 -07004559 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004560
Jeff Johnson295189b2012-06-20 16:38:30 -07004561 wdiGetStatsRspCb: callback for passing back the response
4562 of the get stats operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004563
Jeff Johnson295189b2012-06-20 16:38:30 -07004564 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004565 callback
4566
Jeff Johnson295189b2012-06-20 16:38:30 -07004567 @see WDI_Start
4568 @return Result of the function call
4569*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004570WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004571WDI_GetStatsReq
4572(
4573 WDI_GetStatsReqParamsType* pwdiGetStatsReqParams,
4574 WDI_GetStatsRspCb wdiGetStatsRspCb,
4575 void* pUserData
4576)
4577{
4578 WDI_EventInfoType wdiEventData;
4579 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4580
4581 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004582 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004583 ------------------------------------------------------------------------*/
4584 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4585 {
4586 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4587 "WDI API call before module is initialized - Fail request");
4588
Jeff Johnsone7245742012-09-05 17:12:55 -07004589 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004590 }
4591
4592 /*------------------------------------------------------------------------
4593 Fill in Event data and post to the Main FSM
4594 ------------------------------------------------------------------------*/
4595 wdiEventData.wdiRequest = WDI_GET_STATS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004596 wdiEventData.pEventData = pwdiGetStatsReqParams;
4597 wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams);
4598 wdiEventData.pCBfnc = wdiGetStatsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004599 wdiEventData.pUserData = pUserData;
4600
4601 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4602
4603}/*WDI_GetStatsReq*/
4604
4605
4606/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004607 @brief WDI_UpdateCfgReq will be called when the upper MAC when
Jeff Johnson295189b2012-06-20 16:38:30 -07004608 it wishes to change the configuration of the WLAN
4609 Device. Upon the call of this API the WLAN DAL will pack
4610 and send a HAL Update CFG request message to the lower
4611 RIVA sub-system if DAL is in state STARTED.
4612
4613 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004614 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004615
4616 WDI_Start must have been called.
4617
Jeff Johnsone7245742012-09-05 17:12:55 -07004618 @param wdiUpdateCfgReqParams: the update cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004619 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004620
Jeff Johnson295189b2012-06-20 16:38:30 -07004621 wdiUpdateCfgsRspCb: callback for passing back the
4622 response of the update cfg operation received from the
4623 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004624
Jeff Johnson295189b2012-06-20 16:38:30 -07004625 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004626 callback
4627
Jeff Johnson295189b2012-06-20 16:38:30 -07004628 @see WDI_Start
4629 @return Result of the function call
4630*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004631WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004632WDI_UpdateCfgReq
4633(
4634 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams,
4635 WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb,
4636 void* pUserData
4637)
4638{
4639 WDI_EventInfoType wdiEventData;
4640 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4641
4642 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004643 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004644 ------------------------------------------------------------------------*/
4645 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4646 {
4647 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4648 "WDI API call before module is initialized - Fail request");
4649
Jeff Johnsone7245742012-09-05 17:12:55 -07004650 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004651 }
4652
4653 /*------------------------------------------------------------------------
4654 Fill in Event data and post to the Main FSM
4655 ------------------------------------------------------------------------*/
4656 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004657 wdiEventData.pEventData = pwdiUpdateCfgReqParams;
4658 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams);
4659 wdiEventData.pCBfnc = wdiUpdateCfgsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004660 wdiEventData.pUserData = pUserData;
4661
4662 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4663
4664}/*WDI_UpdateCfgReq*/
4665
4666
4667
4668/**
4669 @brief WDI_AddBAReq will be called when the upper MAC has setup
4670 successfully a BA session and needs to notify the HW for
4671 the appropriate settings to take place. Upon the call of
4672 this API the WLAN DAL will pack and send a HAL Add BA
4673 request message to the lower RIVA sub-system if DAL is
4674 in state STARTED.
4675
4676 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004677 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004678
4679 WDI_PostAssocReq must have been called.
4680
4681 @param wdiAddBAReqParams: the add BA parameters as specified by
4682 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004683
Jeff Johnson295189b2012-06-20 16:38:30 -07004684 wdiAddBARspCb: callback for passing back the response of
4685 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004686
Jeff Johnson295189b2012-06-20 16:38:30 -07004687 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004688 callback
4689
Jeff Johnson295189b2012-06-20 16:38:30 -07004690 @see WDI_PostAssocReq
4691 @return Result of the function call
4692*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004693WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004694WDI_AddBAReq
4695(
4696 WDI_AddBAReqParamsType* pwdiAddBAReqParams,
4697 WDI_AddBARspCb wdiAddBARspCb,
4698 void* pUserData
4699)
4700{
4701 WDI_EventInfoType wdiEventData;
4702 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4703
4704 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004705 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004706 ------------------------------------------------------------------------*/
4707 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4708 {
4709 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4710 "WDI API call before module is initialized - Fail request");
4711
Jeff Johnsone7245742012-09-05 17:12:55 -07004712 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004713 }
4714
4715 /*------------------------------------------------------------------------
4716 Fill in Event data and post to the Main FSM
4717 ------------------------------------------------------------------------*/
4718 wdiEventData.wdiRequest = WDI_ADD_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004719 wdiEventData.pEventData = pwdiAddBAReqParams;
4720 wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams);
4721 wdiEventData.pCBfnc = wdiAddBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004722 wdiEventData.pUserData = pUserData;
4723
4724 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4725
4726}/*WDI_AddBAReq*/
4727
4728
4729/**
4730 @brief WDI_TriggerBAReq will be called when the upper MAC has setup
4731 successfully a BA session and needs to notify the HW for
4732 the appropriate settings to take place. Upon the call of
4733 this API the WLAN DAL will pack and send a HAL Add BA
4734 request message to the lower RIVA sub-system if DAL is
4735 in state STARTED.
4736
4737 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004738 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004739
4740 WDI_PostAssocReq must have been called.
4741
4742 @param wdiAddBAReqParams: the add BA parameters as specified by
4743 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004744
Jeff Johnson295189b2012-06-20 16:38:30 -07004745 wdiAddBARspCb: callback for passing back the response of
4746 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004747
Jeff Johnson295189b2012-06-20 16:38:30 -07004748 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004749 callback
4750
Jeff Johnson295189b2012-06-20 16:38:30 -07004751 @see WDI_PostAssocReq
4752 @return Result of the function call
4753*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004754WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004755WDI_TriggerBAReq
4756(
4757 WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams,
4758 WDI_TriggerBARspCb wdiTriggerBARspCb,
4759 void* pUserData
4760)
4761{
4762 WDI_EventInfoType wdiEventData;
4763 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4764
4765 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004766 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004767 ------------------------------------------------------------------------*/
4768 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4769 {
4770 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4771 "WDI API call before module is initialized - Fail request");
4772
Jeff Johnsone7245742012-09-05 17:12:55 -07004773 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004774 }
4775
4776 /*------------------------------------------------------------------------
4777 Fill in Event data and post to the Main FSM
4778 ------------------------------------------------------------------------*/
4779 wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004780 wdiEventData.pEventData = pwdiTriggerBAReqParams;
4781 wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams);
4782 wdiEventData.pCBfnc = wdiTriggerBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004783 wdiEventData.pUserData = pUserData;
4784
4785 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4786
4787}/*WDI_AddBAReq*/
4788
4789/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004790 @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004791 wishes to update any of the Beacon parameters used by HW.
4792 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request
4793 message to the lower RIVA sub-system if DAL is in state
4794 STARTED.
4795
4796 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004797 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004798
4799 WDI_PostAssocReq must have been called.
4800
Jeff Johnsone7245742012-09-05 17:12:55 -07004801 @param wdiUpdateBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004802 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004803
Jeff Johnson295189b2012-06-20 16:38:30 -07004804 wdiUpdateBeaconParamsRspCb: callback for passing back the
4805 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004806
Jeff Johnson295189b2012-06-20 16:38:30 -07004807 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004808 callback
4809
Jeff Johnson295189b2012-06-20 16:38:30 -07004810 @see WDI_PostAssocReq
4811 @return Result of the function call
4812*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004813WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004814WDI_UpdateBeaconParamsReq
4815(
4816 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams,
4817 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb,
4818 void* pUserData
4819)
4820{
4821 WDI_EventInfoType wdiEventData;
4822 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4823
4824 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004825 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004826 ------------------------------------------------------------------------*/
4827 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4828 {
4829 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4830 "WDI API call before module is initialized - Fail request");
4831
Jeff Johnsone7245742012-09-05 17:12:55 -07004832 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004833 }
4834
4835 /*------------------------------------------------------------------------
4836 Fill in Event data and post to the Main FSM
4837 ------------------------------------------------------------------------*/
4838 wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004839 wdiEventData.pEventData = pwdiUpdateBeaconParams;
4840 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams);
4841 wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004842 wdiEventData.pUserData = pUserData;
4843
4844 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4845
4846}/*WDI_UpdateBeaconParamsReq*/
4847
4848/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004849 @brief WDI_SendBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004850 wishes to update the Beacon template used by HW.
4851 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request
4852 message to the lower RIVA sub-system if DAL is in state
4853 STARTED.
4854
4855 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004856 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004857
4858 WDI_PostAssocReq must have been called.
4859
Jeff Johnsone7245742012-09-05 17:12:55 -07004860 @param wdiSendBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004861 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004862
Jeff Johnson295189b2012-06-20 16:38:30 -07004863 wdiSendBeaconParamsRspCb: callback for passing back the
4864 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004865
Jeff Johnson295189b2012-06-20 16:38:30 -07004866 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004867 callback
4868
Jeff Johnson295189b2012-06-20 16:38:30 -07004869 @see WDI_PostAssocReq
4870 @return Result of the function call
4871*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004872WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004873WDI_SendBeaconParamsReq
4874(
4875 WDI_SendBeaconParamsType* pwdiSendBeaconParams,
4876 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb,
4877 void* pUserData
4878)
4879{
4880 WDI_EventInfoType wdiEventData;
4881 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4882
4883 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004884 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004885 ------------------------------------------------------------------------*/
4886 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4887 {
4888 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4889 "WDI API call before module is initialized - Fail request");
4890
Jeff Johnsone7245742012-09-05 17:12:55 -07004891 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004892 }
4893
4894 /*------------------------------------------------------------------------
4895 Fill in Event data and post to the Main FSM
4896 ------------------------------------------------------------------------*/
4897 wdiEventData.wdiRequest = WDI_SND_BCON_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004898 wdiEventData.pEventData = pwdiSendBeaconParams;
4899 wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams);
4900 wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004901 wdiEventData.pUserData = pUserData;
4902
4903 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4904
4905}/*WDI_SendBeaconParamsReq*/
4906
4907/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004908 @brief WDI_UpdateProbeRspTemplateReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07004909 upper MAC wants to update the probe response template to
4910 be transmitted as Soft AP
4911 Upon the call of this API the WLAN DAL will
4912 pack and send the probe rsp template message to the
4913 lower RIVA sub-system if DAL is in state STARTED.
4914
4915 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004916 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004917
4918
Jeff Johnsone7245742012-09-05 17:12:55 -07004919 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004920 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004921
Jeff Johnson295189b2012-06-20 16:38:30 -07004922 wdiSendBeaconParamsRspCb: callback for passing back the
4923 response of the Send Beacon Params operation received
4924 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004925
Jeff Johnson295189b2012-06-20 16:38:30 -07004926 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004927 callback
4928
Jeff Johnson295189b2012-06-20 16:38:30 -07004929 @see WDI_AddBAReq
4930 @return Result of the function call
4931*/
4932
Jeff Johnsone7245742012-09-05 17:12:55 -07004933WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004934WDI_UpdateProbeRspTemplateReq
4935(
4936 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams,
4937 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb,
4938 void* pUserData
4939)
4940{
4941 WDI_EventInfoType wdiEventData;
4942 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4943
4944 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004945 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004946 ------------------------------------------------------------------------*/
4947 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4948 {
4949 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4950 "WDI API call before module is initialized - Fail request");
4951
Jeff Johnsone7245742012-09-05 17:12:55 -07004952 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004953 }
4954
4955 /*------------------------------------------------------------------------
4956 Fill in Event data and post to the Main FSM
4957 ------------------------------------------------------------------------*/
4958 wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004959 wdiEventData.pEventData = pwdiUpdateProbeRspParams;
4960 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams);
4961 wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004962 wdiEventData.pUserData = pUserData;
4963
4964 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4965
4966}/*WDI_UpdateProbeRspTemplateReq*/
4967
4968/**
4969 @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob
4970 to the NV memory.
4971
4972
4973 @param wdiNvDownloadReqParams: the NV Download parameters as specified by
4974 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004975
Jeff Johnson295189b2012-06-20 16:38:30 -07004976 wdiNvDownloadRspCb: callback for passing back the response of
4977 the NV Download operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004978
Jeff Johnson295189b2012-06-20 16:38:30 -07004979 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004980 callback
4981
Jeff Johnson295189b2012-06-20 16:38:30 -07004982 @see WDI_PostAssocReq
4983 @return Result of the function call
4984*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004985WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004986WDI_NvDownloadReq
4987(
4988 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams,
4989 WDI_NvDownloadRspCb wdiNvDownloadRspCb,
4990 void* pUserData
4991)
4992{
4993 WDI_EventInfoType wdiEventData;
4994
4995 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004996 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004997 ------------------------------------------------------------------------*/
4998 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4999 {
5000 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5001 "WDI API call before module is initialized - Fail request");
5002
Jeff Johnsone7245742012-09-05 17:12:55 -07005003 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005004 }
5005
5006 /*------------------------------------------------------------------------
5007 Fill in Event data and post to the Main FSM
5008 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005009 wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ;
5010 wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams;
5011 wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams);
5012 wdiEventData.pCBfnc = wdiNvDownloadRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005013 wdiEventData.pUserData = pUserData;
5014
5015 return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData);
5016
5017}/*WDI_NVDownloadReq*/
5018
5019#ifdef WLAN_FEATURE_P2P
5020/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005021 @brief WDI_SetP2PGONOAReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005022 upper MAC wants to send Notice of Absence
5023 Upon the call of this API the WLAN DAL will
5024 pack and send the probe rsp template message to the
5025 lower RIVA sub-system if DAL is in state STARTED.
5026
5027 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005028 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005029
5030
Jeff Johnsone7245742012-09-05 17:12:55 -07005031 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005032 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005033
Jeff Johnson295189b2012-06-20 16:38:30 -07005034 wdiSendBeaconParamsRspCb: callback for passing back the
5035 response of the Send Beacon Params operation received
5036 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005037
Jeff Johnson295189b2012-06-20 16:38:30 -07005038 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005039 callback
5040
Jeff Johnson295189b2012-06-20 16:38:30 -07005041 @see WDI_AddBAReq
5042 @return Result of the function call
5043*/
5044WDI_Status
5045WDI_SetP2PGONOAReq
5046(
5047 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams,
5048 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb,
5049 void* pUserData
5050)
5051{
5052 WDI_EventInfoType wdiEventData;
5053 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5054
5055 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005056 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005057 ------------------------------------------------------------------------*/
5058 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5059 {
5060 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5061 "WDI API call before module is initialized - Fail request");
5062
Jeff Johnsone7245742012-09-05 17:12:55 -07005063 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005064 }
5065
5066 /*------------------------------------------------------------------------
5067 Fill in Event data and post to the Main FSM
5068 ------------------------------------------------------------------------*/
5069 wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005070 wdiEventData.pEventData = pwdiP2PGONOAReqParams;
5071 wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams);
5072 wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005073 wdiEventData.pUserData = pUserData;
5074
5075 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5076
5077}/*WDI_SetP2PGONOAReq*/
5078#endif
5079
5080/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005081 @brief WDI_AddSTASelfReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005082 UMAC wanted to add STA self while opening any new session
5083 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005084 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005085
5086
Jeff Johnsone7245742012-09-05 17:12:55 -07005087 @param pwdiAddSTASelfParams: the add sta self parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005088 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005089
Jeff Johnson295189b2012-06-20 16:38:30 -07005090 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005091 callback
5092
5093 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005094 @return Result of the function call
5095*/
5096WDI_Status
5097WDI_AddSTASelfReq
5098(
5099 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams,
5100 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb,
5101 void* pUserData
5102)
5103{
5104 WDI_EventInfoType wdiEventData;
5105 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5106
5107 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005108 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005109 ------------------------------------------------------------------------*/
5110 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5111 {
5112 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5113 "WDI API call before module is initialized - Fail request");
5114
Jeff Johnsone7245742012-09-05 17:12:55 -07005115 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005116 }
5117
5118 /*------------------------------------------------------------------------
5119 Fill in Event data and post to the Main FSM
5120 ------------------------------------------------------------------------*/
5121 wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005122 wdiEventData.pEventData = pwdiAddSTASelfReqParams;
5123 wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams);
5124 wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005125 wdiEventData.pUserData = pUserData;
5126
5127 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5128
5129}/*WDI_AddSTASelfReq*/
5130
5131
Jeff Johnsone7245742012-09-05 17:12:55 -07005132#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson295189b2012-06-20 16:38:30 -07005133/**
5134 @brief WDI_AggrAddTSReq will be called when the upper MAC to inform
5135 the device of a successful add TSpec negotiation. HW
5136 needs to receive the TSpec Info from the UMAC in order
5137 to configure properly the QoS data traffic. Upon the
5138 call of this API the WLAN DAL will pack and send a HAL
5139 Add TS request message to the lower RIVA sub-system if
5140 DAL is in state STARTED.
5141
5142 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005143 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005144
5145 WDI_PostAssocReq must have been called.
5146
5147 @param wdiAddTsReqParams: the add TS parameters as specified by
5148 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005149
Jeff Johnson295189b2012-06-20 16:38:30 -07005150 wdiAddTsRspCb: callback for passing back the response of
5151 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005152
Jeff Johnson295189b2012-06-20 16:38:30 -07005153 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005154 callback
5155
Jeff Johnson295189b2012-06-20 16:38:30 -07005156 @see WDI_PostAssocReq
5157 @return Result of the function call
5158*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005159WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005160WDI_AggrAddTSReq
5161(
5162 WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams,
5163 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb,
5164 void* pUserData
5165)
5166{
5167 WDI_EventInfoType wdiEventData;
5168 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5169
5170 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005171 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005172 ------------------------------------------------------------------------*/
5173 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5174 {
5175 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5176 "WDI API call before module is initialized - Fail request");
5177
Jeff Johnsone7245742012-09-05 17:12:55 -07005178 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005179 }
5180
5181 /*------------------------------------------------------------------------
5182 Fill in Event data and post to the Main FSM
5183 ------------------------------------------------------------------------*/
5184 wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005185 wdiEventData.pEventData = pwdiAggrAddTsReqParams;
5186 wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams);
5187 wdiEventData.pCBfnc = wdiAggrAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005188 wdiEventData.pUserData = pUserData;
5189
5190 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5191
5192}/*WDI_AggrAddTSReq*/
5193
5194#endif /* WLAN_FEATURE_VOWIFI_11R */
5195
5196#ifdef ANI_MANF_DIAG
5197/**
5198 @brief WDI_FTMCommandReq
5199 Post FTM Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005200
5201 @param ftmCommandReq: FTM Command Body
5202 @param ftmCommandRspCb: FTM Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005203 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005204
Jeff Johnson295189b2012-06-20 16:38:30 -07005205 @see
5206 @return Result of the function call
5207*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005208WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005209WDI_FTMCommandReq
5210(
5211 WDI_FTMCommandReqType *ftmCommandReq,
5212 WDI_FTMCommandRspCb ftmCommandRspCb,
5213 void *pUserData
5214)
5215{
5216 WDI_EventInfoType wdiEventData;
5217 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5218
5219 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005220 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005221 ------------------------------------------------------------------------*/
5222 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5223 {
5224 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5225 "WDI API call before module is initialized - Fail request");
5226
Jeff Johnsone7245742012-09-05 17:12:55 -07005227 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005228 }
5229
5230 /*------------------------------------------------------------------------
5231 Fill in Event data and post to the Main FSM
5232 ------------------------------------------------------------------------*/
5233 wdiEventData.wdiRequest = WDI_FTM_CMD_REQ;
5234 wdiEventData.pEventData = (void *)ftmCommandReq;
5235 wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32);
5236 wdiEventData.pCBfnc = ftmCommandRspCb;
5237 wdiEventData.pUserData = pUserData;
5238
5239 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5240}
Jeff Johnsone7245742012-09-05 17:12:55 -07005241#endif /* ANI_MANF_DIAG */
Jeff Johnson295189b2012-06-20 16:38:30 -07005242/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005243 @brief WDI_HostResumeReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005244
5245 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005246 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005247
5248
5249 @param pwdiResumeReqParams: as specified by
5250 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005251
Jeff Johnson295189b2012-06-20 16:38:30 -07005252 wdiResumeReqRspCb: callback for passing back the response of
5253 the Resume Req received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005254
Jeff Johnson295189b2012-06-20 16:38:30 -07005255 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005256 callback
5257
5258 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005259 @return Result of the function call
5260*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005261WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005262WDI_HostResumeReq
5263(
5264 WDI_ResumeParamsType* pwdiResumeReqParams,
5265 WDI_HostResumeEventRspCb wdiResumeReqRspCb,
5266 void* pUserData
5267)
5268{
5269 WDI_EventInfoType wdiEventData;
5270 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5271
5272 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005273 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005274 ------------------------------------------------------------------------*/
5275 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5276 {
5277 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5278 "WDI API call before module is initialized - Fail request");
5279
Jeff Johnsone7245742012-09-05 17:12:55 -07005280 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005281 }
5282
5283 /*------------------------------------------------------------------------
5284 Fill in Event data and post to the Main FSM
5285 ------------------------------------------------------------------------*/
5286 wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005287 wdiEventData.pEventData = pwdiResumeReqParams;
5288 wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams);
5289 wdiEventData.pCBfnc = wdiResumeReqRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005290 wdiEventData.pUserData = pUserData;
5291
5292 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5293
5294}/*WDI_HostResumeReq*/
5295
5296/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005297 @brief WDI_DelSTASelfReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005298
5299 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005300 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005301
5302
5303 @param pwdiDelStaSelfReqParams: as specified by
5304 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005305
Jeff Johnson295189b2012-06-20 16:38:30 -07005306 wdiDelStaSelfRspCb: callback for passing back the response of
5307 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005308
Jeff Johnson295189b2012-06-20 16:38:30 -07005309 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005310 callback
5311
Jeff Johnson295189b2012-06-20 16:38:30 -07005312 @see WDI_PostAssocReq
5313 @return Result of the function call
5314*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005315WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005316WDI_DelSTASelfReq
5317(
5318 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams,
5319 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb,
5320 void* pUserData
5321)
5322{
5323 WDI_EventInfoType wdiEventData;
5324 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5325
5326 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005327 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005328 ------------------------------------------------------------------------*/
5329 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5330 {
5331 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5332 "WDI API call before module is initialized - Fail request");
5333
Jeff Johnsone7245742012-09-05 17:12:55 -07005334 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005335 }
5336
5337 /*------------------------------------------------------------------------
5338 Fill in Event data and post to the Main FSM
5339 ------------------------------------------------------------------------*/
5340 wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005341 wdiEventData.pEventData = pwdiDelStaSelfReqParams;
5342 wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams);
5343 wdiEventData.pCBfnc = wdiDelStaSelfRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005344 wdiEventData.pUserData = pUserData;
5345
5346 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5347
5348}/*WDI_AggrAddTSReq*/
5349
5350/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005351 @brief WDI_SetTxPerTrackingReq will be called when the upper MAC
5352 wants to set the Tx Per Tracking configurations.
Jeff Johnson295189b2012-06-20 16:38:30 -07005353 Upon the call of this API the WLAN DAL will pack
5354 and send a HAL Set Tx Per Tracking request message to the
5355 lower RIVA sub-system if DAL is in state STARTED.
5356
5357 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005358 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005359
Jeff Johnsone7245742012-09-05 17:12:55 -07005360 @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as
Jeff Johnson295189b2012-06-20 16:38:30 -07005361 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005362
Jeff Johnson295189b2012-06-20 16:38:30 -07005363 pwdiSetTxPerTrackingRspCb: callback for passing back the
5364 response of the set Tx PER Tracking configurations operation received
5365 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005366
Jeff Johnson295189b2012-06-20 16:38:30 -07005367 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005368 callback
5369
Jeff Johnson295189b2012-06-20 16:38:30 -07005370 @return Result of the function call
5371*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005372WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005373WDI_SetTxPerTrackingReq
5374(
5375 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams,
5376 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb,
5377 void* pUserData
5378)
5379{
5380 WDI_EventInfoType wdiEventData;
5381 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5382
5383 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005384 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005385 ------------------------------------------------------------------------*/
5386 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5387 {
5388 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5389 "WDI API call before module is initialized - Fail request");
5390
Jeff Johnsone7245742012-09-05 17:12:55 -07005391 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005392 }
5393
5394 /*------------------------------------------------------------------------
5395 Fill in Event data and post to the Main FSM
5396 ------------------------------------------------------------------------*/
5397 wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005398 wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07005399 wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -07005400 wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005401 wdiEventData.pUserData = pUserData;
5402
5403 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5404
5405}/*WDI_SetTxPerTrackingReq*/
5406
5407/**
5408 @brief WDI_SetTmLevelReq
5409 If HW Thermal condition changed, driver should react based on new
5410 HW thermal condition.
5411
5412 @param pwdiSetTmLevelReq: New thermal condition information
5413
5414 pwdiSetTmLevelRspCb: callback
5415
5416 usrData: user data will be passed back with the
5417 callback
5418
5419 @return Result of the function call
5420*/
5421WDI_Status
5422WDI_SetTmLevelReq
5423(
5424 WDI_SetTmLevelReqType *pwdiSetTmLevelReq,
5425 WDI_SetTmLevelCb pwdiSetTmLevelRspCb,
5426 void *usrData
5427)
5428{
5429 WDI_EventInfoType wdiEventData;
5430 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5431
5432 /*------------------------------------------------------------------------
5433 Sanity Check
5434 ------------------------------------------------------------------------*/
5435 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5436 {
5437 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5438 "WDI API call before module is initialized - Fail request");
5439
5440 return WDI_STATUS_E_NOT_ALLOWED;
5441 }
5442
5443 /*------------------------------------------------------------------------
5444 Fill in Event data and post to the Main FSM
5445 ------------------------------------------------------------------------*/
5446 wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ;
5447 wdiEventData.pEventData = pwdiSetTmLevelReq;
5448 wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq);
5449 wdiEventData.pCBfnc = pwdiSetTmLevelRspCb;
5450 wdiEventData.pUserData = usrData;
5451
5452 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5453}
5454
5455/**
5456 @brief WDI_HostSuspendInd
5457
5458 Suspend Indication from the upper layer will be sent
5459 down to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -07005460
Jeff Johnson295189b2012-06-20 16:38:30 -07005461 @param WDI_SuspendResumeIndParamsType
Jeff Johnsone7245742012-09-05 17:12:55 -07005462
5463 @see
5464
Jeff Johnson295189b2012-06-20 16:38:30 -07005465 @return Status of the request
5466*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005467WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005468WDI_HostSuspendInd
5469(
5470 WDI_SuspendParamsType* pwdiSuspendIndParams
5471)
5472{
5473
5474 WDI_EventInfoType wdiEventData;
5475 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5476
5477 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005478 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005479 ------------------------------------------------------------------------*/
5480 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5481 {
5482 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5483 "WDI API call before module is initialized - Fail request");
5484
Jeff Johnsone7245742012-09-05 17:12:55 -07005485 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005486 }
5487
5488 /*------------------------------------------------------------------------
5489 Fill in Event data and post to the Main FSM
5490 ------------------------------------------------------------------------*/
5491 wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -07005492 wdiEventData.pEventData = pwdiSuspendIndParams;
5493 wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams);
5494 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07005495 wdiEventData.pUserData = NULL;
5496
5497 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5498
5499}/*WDI_HostSuspendInd*/
5500
5501/**
5502 @brief WDI_HALDumpCmdReq
5503 Post HAL DUMP Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005504
5505 @param halDumpCmdReqParams: Hal Dump Command Body
5506 @param halDumpCmdRspCb: HAL DUMP Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005507 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005508
Jeff Johnson295189b2012-06-20 16:38:30 -07005509 @see
5510 @return Result of the function call
5511*/
5512WDI_Status WDI_HALDumpCmdReq
5513(
5514 WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams,
5515 WDI_HALDumpCmdRspCb halDumpCmdRspCb,
5516 void *pUserData
5517)
5518{
5519 WDI_EventInfoType wdiEventData;
5520 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5521
5522 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005523 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005524 ------------------------------------------------------------------------*/
5525 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5526 {
5527 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5528 "WDI API call before module is initialized - Fail request");
5529
Jeff Johnsone7245742012-09-05 17:12:55 -07005530 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005531 }
5532
5533 /*------------------------------------------------------------------------
5534 Fill in Event data and post to the Main FSM
5535 ------------------------------------------------------------------------*/
5536 wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ;
5537 wdiEventData.pEventData = (void *)halDumpCmdReqParams;
5538 wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType);
5539 wdiEventData.pCBfnc = halDumpCmdRspCb;
5540 wdiEventData.pUserData = pUserData;
5541
5542 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5543}
5544
Jeff Johnsone7245742012-09-05 17:12:55 -07005545/*============================================================================
5546
Jeff Johnson295189b2012-06-20 16:38:30 -07005547 DAL Control Path Main FSM Function Implementation
Jeff Johnsone7245742012-09-05 17:12:55 -07005548
Jeff Johnson295189b2012-06-20 16:38:30 -07005549 ============================================================================*/
5550
5551/**
5552 @brief Main FSM Start function for all states except BUSY
5553
Jeff Johnsone7245742012-09-05 17:12:55 -07005554
5555 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005556 wdiEV: event posted to the main DAL FSM
5557 pEventData: pointer to the event information
Jeff Johnsone7245742012-09-05 17:12:55 -07005558 structure
5559
Jeff Johnson295189b2012-06-20 16:38:30 -07005560 @see
5561 @return Result of the function call
5562*/
5563WDI_Status
5564WDI_PostMainEvent
5565(
Jeff Johnsone7245742012-09-05 17:12:55 -07005566 WDI_ControlBlockType* pWDICtx,
5567 WDI_MainEventType wdiEV,
Jeff Johnson295189b2012-06-20 16:38:30 -07005568 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -07005569
Jeff Johnson295189b2012-06-20 16:38:30 -07005570)
5571{
Jeff Johnsone7245742012-09-05 17:12:55 -07005572 WDI_Status wdiStatus;
5573 WDI_MainFuncType pfnWDIMainEvHdlr;
5574 WDI_MainStateType wdiOldState;
Jeff Johnson295189b2012-06-20 16:38:30 -07005575 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5576
5577 /*-------------------------------------------------------------------------
5578 Sanity check
5579 -------------------------------------------------------------------------*/
5580 if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) ||
5581 ( wdiEV >= WDI_MAX_EVENT ))
5582 {
5583 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5584 "Invalid state or event in Post Main Ev function ST: %d EV: %d",
5585 pWDICtx->uGlobalState, wdiEV);
Jeff Johnsone7245742012-09-05 17:12:55 -07005586 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005587 }
5588
5589 /*Access to the global state must be locked */
5590 wpalMutexAcquire(&pWDICtx->wptMutex);
5591
5592 /*Fetch event handler for state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005593 pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV];
Jeff Johnson295189b2012-06-20 16:38:30 -07005594
5595 wdiOldState = pWDICtx->uGlobalState;
5596
5597 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07005598 --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a
5599 response comes from CCPU for the request sent by host:
5600 the WDI global state will be in WDI_BUSY_ST already, so do not set it to BUSY again.
Jeff Johnson295189b2012-06-20 16:38:30 -07005601 This state will be set to WDI_STARTED_ST in WDI_MainRsp, if it is a expected response.
Jeff Johnsone7245742012-09-05 17:12:55 -07005602 --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the
Jeff Johnson295189b2012-06-20 16:38:30 -07005603 CCPU:
5604 don't change the state */
5605 if ( WDI_RESPONSE_EVENT != wdiEV)
5606 {
5607 /*Transition to BUSY State - the request is now being processed by the FSM,
5608 if the request fails we shall transition back to the old state, if not
5609 the request will manage its own state transition*/
5610 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
5611 }
5612 /* If the state function associated with the EV is NULL it means that this
5613 event is not allowed in this state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005614 if ( NULL != pfnWDIMainEvHdlr )
Jeff Johnson295189b2012-06-20 16:38:30 -07005615 {
5616 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005617 "Posting event %d in state: %d to the Main FSM",
Jeff Johnson295189b2012-06-20 16:38:30 -07005618 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005619 wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005620 }
5621 else
5622 {
5623 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005624 "Unexpected event %d in state: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -07005625 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005626 wdiStatus = WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005627 }
5628
5629 /* If a request handles itself well it will end up in a success or in a
5630 pending
5631 Success - means that the request was processed and the proper state
5632 transition already occurred or will occur when the resp is received
5633 - NO other state transition or dequeueing is required
Jeff Johnsone7245742012-09-05 17:12:55 -07005634
Jeff Johnson295189b2012-06-20 16:38:30 -07005635 Pending - means the request could not be processed at this moment in time
5636 because the FSM was already busy so no state transition or dequeueing
5637 is necessary anymore
Jeff Johnsone7245742012-09-05 17:12:55 -07005638
Jeff Johnson295189b2012-06-20 16:38:30 -07005639 Success for synchronous case means that the transition may occur and
5640 processing of pending requests may continue - so it should go through
5641 and restores the state and continue processing queued requests*/
5642 if (( WDI_STATUS_SUCCESS != wdiStatus )&&
5643 ( WDI_STATUS_PENDING != wdiStatus ))
5644 {
5645 if ( WDI_RESPONSE_EVENT != wdiEV)
5646 {
5647 /*The request has failed or could not be processed - transition back to
5648 the old state - check to see if anything was queued and try to execute
5649 The dequeue logic should post a message to a thread and return - no
5650 actual processing can occur */
5651 WDI_STATE_TRANSITION( pWDICtx, wdiOldState);
5652 }
5653 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005654
Jeff Johnson295189b2012-06-20 16:38:30 -07005655 }
5656
5657 /* we have completed processing the event */
5658 wpalMutexRelease(&pWDICtx->wptMutex);
5659
Jeff Johnsone7245742012-09-05 17:12:55 -07005660 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005661
5662}/*WDI_PostMainEvent*/
5663
5664
5665/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005666 INIT State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005667--------------------------------------------------------------------------*/
5668/**
5669 @brief Main FSM Start function for all states except BUSY
5670
Jeff Johnsone7245742012-09-05 17:12:55 -07005671
5672 @param pWDICtx: pointer to the WLAN DAL context
5673 pEventData: pointer to the event information structure
5674
Jeff Johnson295189b2012-06-20 16:38:30 -07005675 @see
5676 @return Result of the function call
5677*/
5678WDI_Status
5679WDI_MainStart
Jeff Johnsone7245742012-09-05 17:12:55 -07005680(
Jeff Johnson295189b2012-06-20 16:38:30 -07005681 WDI_ControlBlockType* pWDICtx,
5682 WDI_EventInfoType* pEventData
5683)
5684{
5685
5686 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005687 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005688 ----------------------------------------------------------------------*/
5689 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5690 {
5691 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005692 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005693 pWDICtx, pEventData);
5694 return WDI_STATUS_E_FAILURE;
5695 }
5696
5697 wpalMutexAcquire(&pWDICtx->wptMutex);
5698
5699 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005700 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07005701 ----------------------------------------------------------------------*/
5702 if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened )
5703 {
5704 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5705 "Control Transport not yet Open - queueing the request");
5706
5707 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -07005708 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005709
5710 wpalMutexRelease(&pWDICtx->wptMutex);
5711 return WDI_STATUS_PENDING;
5712 }
Jeff Johnsone7245742012-09-05 17:12:55 -07005713
Jeff Johnson295189b2012-06-20 16:38:30 -07005714 wpalMutexRelease(&pWDICtx->wptMutex);
5715
5716 /*Return Success*/
5717 return WDI_ProcessRequest( pWDICtx, pEventData );
5718
5719}/*WDI_MainStart*/
5720
5721/**
5722 @brief Main FSM Response function for state INIT
5723
Jeff Johnsone7245742012-09-05 17:12:55 -07005724
5725 @param pWDICtx: pointer to the WLAN DAL context
5726 pEventData: pointer to the event information structure
5727
Jeff Johnson295189b2012-06-20 16:38:30 -07005728 @see
5729 @return Result of the function call
5730*/
5731WDI_Status
5732WDI_MainRspInit
Jeff Johnsone7245742012-09-05 17:12:55 -07005733(
Jeff Johnson295189b2012-06-20 16:38:30 -07005734 WDI_ControlBlockType* pWDICtx,
5735 WDI_EventInfoType* pEventData
5736)
5737{
5738 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005739 Not expecting a response from the device before it is started
Jeff Johnson295189b2012-06-20 16:38:30 -07005740 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005741 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07005742
5743 /*Return Success*/
5744 return WDI_STATUS_E_NOT_ALLOWED;
5745}/* WDI_MainRspInit */
5746
5747/**
5748 @brief Main FSM Close function for all states except BUSY
5749
Jeff Johnsone7245742012-09-05 17:12:55 -07005750
5751 @param pWDICtx: pointer to the WLAN DAL context
5752 pEventData: pointer to the event information structure
5753
Jeff Johnson295189b2012-06-20 16:38:30 -07005754 @see
5755 @return Result of the function call
5756*/
5757WDI_Status
5758WDI_MainClose
Jeff Johnsone7245742012-09-05 17:12:55 -07005759(
Jeff Johnson295189b2012-06-20 16:38:30 -07005760 WDI_ControlBlockType* pWDICtx,
5761 WDI_EventInfoType* pEventData
5762)
5763{
5764
5765 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005766 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005767 ----------------------------------------------------------------------*/
5768 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5769 {
5770 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005771 "Invalid parameters on Main Close %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005772 pWDICtx, pEventData);
5773 return WDI_STATUS_E_FAILURE;
5774 }
5775
5776 /*Return Success*/
5777 return WDI_ProcessRequest( pWDICtx, pEventData );
5778
5779}/*WDI_MainClose*/
5780/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005781 STARTED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005782--------------------------------------------------------------------------*/
5783/**
5784 @brief Main FSM Start function for state STARTED
5785
Jeff Johnsone7245742012-09-05 17:12:55 -07005786
5787 @param pWDICtx: pointer to the WLAN DAL context
5788 pEventData: pointer to the event information structure
5789
Jeff Johnson295189b2012-06-20 16:38:30 -07005790 @see
5791 @return Result of the function call
5792*/
5793WDI_Status
5794WDI_MainStartStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005795(
Jeff Johnson295189b2012-06-20 16:38:30 -07005796 WDI_ControlBlockType* pWDICtx,
5797 WDI_EventInfoType* pEventData
5798)
5799{
5800 WDI_StartRspCb wdiStartRspCb = NULL;
5801 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5802
5803 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005804 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005805 ----------------------------------------------------------------------*/
5806 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5807 {
5808 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005809 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005810 pWDICtx, pEventData);
5811 return WDI_STATUS_E_FAILURE;
5812 }
5813
5814 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005815 Nothing to do transport was already started
Jeff Johnson295189b2012-06-20 16:38:30 -07005816 ----------------------------------------------------------------------*/
5817 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005818 "Received start while transport was already started - nothing to do");
Jeff Johnson295189b2012-06-20 16:38:30 -07005819
5820 wpalMutexAcquire(&pWDICtx->wptMutex);
5821
5822 /*Transition back to started because the post function transitioned us to
5823 busy*/
5824 WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST);
5825
5826 /*Check to see if any request is pending*/
5827 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005828
Jeff Johnson295189b2012-06-20 16:38:30 -07005829 wpalMutexRelease(&pWDICtx->wptMutex);
5830
5831 /*Tell UMAC Success*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005832 wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc;
5833
Jeff Johnson295189b2012-06-20 16:38:30 -07005834 /*Notify UMAC*/
5835 wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData);
5836
5837 /*Return Success*/
5838 return WDI_STATUS_SUCCESS;
5839
5840}/*WDI_MainStartStarted*/
5841
5842/**
5843 @brief Main FSM Stop function for state STARTED
5844
Jeff Johnsone7245742012-09-05 17:12:55 -07005845
5846 @param pWDICtx: pointer to the WLAN DAL context
5847 pEventData: pointer to the event information structure
5848
Jeff Johnson295189b2012-06-20 16:38:30 -07005849 @see
5850 @return Result of the function call
5851*/
5852WDI_Status
5853WDI_MainStopStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005854(
Jeff Johnson295189b2012-06-20 16:38:30 -07005855 WDI_ControlBlockType* pWDICtx,
5856 WDI_EventInfoType* pEventData
5857)
5858{
5859 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005860 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005861 ----------------------------------------------------------------------*/
5862 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5863 {
5864 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005865 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005866 pWDICtx, pEventData);
5867 return WDI_STATUS_E_FAILURE;
5868 }
5869
5870 /*State at this point is BUSY - because we enter this state before posting
5871 an event to the FSM in order to prevent potential race conditions*/
5872
5873 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
5874 "Processing stop request in FSM");
5875
5876 /*Return Success*/
5877 return WDI_ProcessRequest( pWDICtx, pEventData );
5878
5879}/*WDI_MainStopStarted*/
5880/**
5881 @brief Main FSM Request function for state started
5882
Jeff Johnsone7245742012-09-05 17:12:55 -07005883
5884 @param pWDICtx: pointer to the WLAN DAL context
5885 pEventData: pointer to the event information structure
5886
Jeff Johnson295189b2012-06-20 16:38:30 -07005887 @see
5888 @return Result of the function call
5889*/
5890WDI_Status
5891WDI_MainReqStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005892(
Jeff Johnson295189b2012-06-20 16:38:30 -07005893 WDI_ControlBlockType* pWDICtx,
5894 WDI_EventInfoType* pEventData
5895)
5896{
5897
5898 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005899 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005900 ----------------------------------------------------------------------*/
5901 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5902 {
5903 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005904 "Invalid parameters on Main Req Started %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005905 pWDICtx, pEventData);
5906 return WDI_STATUS_E_FAILURE;
5907 }
5908
5909 /*State at this point is BUSY - because we enter this state before posting
5910 an event to the FSM in order to prevent potential race conditions*/
5911
5912 /*Return Success*/
5913 return WDI_ProcessRequest( pWDICtx, pEventData );
5914
5915}/*WDI_MainReqStarted*/
5916
5917/**
5918 @brief Main FSM Response function for all states except INIT
5919
Jeff Johnsone7245742012-09-05 17:12:55 -07005920
5921 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005922 pEventData: pointer to the event information structure
Jeff Johnsone7245742012-09-05 17:12:55 -07005923
Jeff Johnson295189b2012-06-20 16:38:30 -07005924 @see
5925 @return Result of the function call
5926*/
5927WDI_Status
5928WDI_MainRsp
Jeff Johnsone7245742012-09-05 17:12:55 -07005929(
Jeff Johnson295189b2012-06-20 16:38:30 -07005930 WDI_ControlBlockType* pWDICtx,
5931 WDI_EventInfoType* pEventData
5932)
5933{
Jeff Johnsone7245742012-09-05 17:12:55 -07005934 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005935 wpt_boolean expectedResponse;
5936
5937 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005938 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005939 ----------------------------------------------------------------------*/
5940 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5941 {
5942 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005943 "Invalid parameters on Main Response %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005944 pWDICtx, pEventData);
5945 return WDI_STATUS_E_FAILURE;
5946 }
5947
5948 if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse )
5949 {
5950 /* we received an expected response */
5951 expectedResponse = eWLAN_PAL_TRUE;
5952
5953 /*We expect that we will transition to started after this processing*/
5954 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
5955
5956 /* we are no longer expecting a response */
5957 pWDICtx->wdiExpectedResponse = WDI_MAX_RESP;
5958 }
5959 else
5960 {
5961 /* we received an indication or unexpected response */
5962 expectedResponse = eWLAN_PAL_FALSE;
5963 /* for indications no need to update state from what it is right
5964 now, unless it explicitly does it in the indication handler (say
5965 for device failure ind) */
5966 pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState;
5967 }
5968
5969 /*Process the response and indication */
5970 wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData );
5971
5972 /*Lock the CB as we are about to do a state transition*/
5973 wpalMutexAcquire(&pWDICtx->wptMutex);
5974
5975 /*Transition to the expected state after the response processing
5976 - this should always be started state with the following exceptions:
5977 1. processing of a failed start response
5978 2. device failure detected while processing response
5979 3. stop response received*/
5980 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
Jeff Johnsone7245742012-09-05 17:12:55 -07005981
Jeff Johnson295189b2012-06-20 16:38:30 -07005982 /*Dequeue request that may have been queued while we were waiting for the
5983 response */
5984 if ( expectedResponse )
5985 {
Jeff Johnsone7245742012-09-05 17:12:55 -07005986 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07005987 }
5988
5989 wpalMutexRelease(&pWDICtx->wptMutex);
5990
5991 /*Return Success - always */
Jeff Johnsone7245742012-09-05 17:12:55 -07005992 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07005993
5994}/*WDI_MainRsp*/
5995
5996/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005997 STOPPED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005998--------------------------------------------------------------------------*/
5999/**
6000 @brief Main FSM Stop function for state STOPPED
6001
Jeff Johnsone7245742012-09-05 17:12:55 -07006002
6003 @param pWDICtx: pointer to the WLAN DAL context
6004 pEventData: pointer to the event information structure
6005
Jeff Johnson295189b2012-06-20 16:38:30 -07006006 @see
6007 @return Result of the function call
6008*/
6009WDI_Status
6010WDI_MainStopStopped
Jeff Johnsone7245742012-09-05 17:12:55 -07006011(
Jeff Johnson295189b2012-06-20 16:38:30 -07006012 WDI_ControlBlockType* pWDICtx,
6013 WDI_EventInfoType* pEventData
6014)
6015{
6016 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006017 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006018 ----------------------------------------------------------------------*/
6019 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6020 {
6021 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07006022 "Invalid parameters on Main Stop Stopped %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006023 pWDICtx, pEventData);
6024 return WDI_STATUS_E_FAILURE;
6025 }
6026
6027 /*We should normally not get a STOP request if we are already stopped
6028 since we should normally be stopped by the UMAC. However in some
6029 error situations we put ourselves in the stopped state without the
6030 UMAC knowing, so when we get a STOP request in this state we still
6031 process it since we need to clean up the underlying state */
6032 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6033 "Processing stop request while stopped in FSM");
6034
6035 /*Return Success*/
6036 return WDI_ProcessRequest( pWDICtx, pEventData );
6037
6038}/*WDI_MainStopStopped*/
6039
6040/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006041 BUSY State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07006042--------------------------------------------------------------------------*/
6043/**
6044 @brief Main FSM Start function for state BUSY
6045
Jeff Johnsone7245742012-09-05 17:12:55 -07006046
6047 @param pWDICtx: pointer to the WLAN DAL context
6048 pEventData: pointer to the event information structure
6049
Jeff Johnson295189b2012-06-20 16:38:30 -07006050 @see
6051 @return Result of the function call
6052*/
6053WDI_Status
6054WDI_MainStartBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006055(
Jeff Johnson295189b2012-06-20 16:38:30 -07006056 WDI_ControlBlockType* pWDICtx,
6057 WDI_EventInfoType* pEventData
6058)
6059{
6060 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006061 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006062 ----------------------------------------------------------------------*/
6063 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6064 {
6065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006066 "Invalid parameters on Main Start in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006067 pWDICtx, pEventData);
6068 return WDI_STATUS_E_FAILURE;
6069 }
6070
6071 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006072 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006073 ----------------------------------------------------------------------*/
6074 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6075 "WDI Busy state - queue start request");
6076
6077 /*Queue the start request*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006078 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006079
6080 /*Return Success*/
6081 return WDI_STATUS_PENDING;
6082}/*WDI_MainStartBusy*/
6083
6084/**
6085 @brief Main FSM Stop function for state BUSY
6086
Jeff Johnsone7245742012-09-05 17:12:55 -07006087
6088 @param pWDICtx: pointer to the WLAN DAL context
6089 pEventData: pointer to the event information structure
6090
Jeff Johnson295189b2012-06-20 16:38:30 -07006091 @see
6092 @return Result of the function call
6093*/
6094WDI_Status
6095WDI_MainStopBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006096(
Jeff Johnson295189b2012-06-20 16:38:30 -07006097 WDI_ControlBlockType* pWDICtx,
6098 WDI_EventInfoType* pEventData
6099)
6100{
6101 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006102 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006103 ----------------------------------------------------------------------*/
6104 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6105 {
6106 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006107 "Invalid parameters on Main Stop in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006108 pWDICtx, pEventData);
6109 return WDI_STATUS_E_FAILURE;
6110 }
6111
6112 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006113 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006114 ----------------------------------------------------------------------*/
6115 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6116 "WDI Busy state - queue stop request");
6117
Jeff Johnsone7245742012-09-05 17:12:55 -07006118 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006119 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006120
Jeff Johnson295189b2012-06-20 16:38:30 -07006121}/*WDI_MainStopBusy*/
6122
6123/**
6124 @brief Main FSM Request function for state BUSY
6125
Jeff Johnsone7245742012-09-05 17:12:55 -07006126
6127 @param pWDICtx: pointer to the WLAN DAL context
6128 pEventData: pointer to the event information structure
6129
Jeff Johnson295189b2012-06-20 16:38:30 -07006130 @see
6131 @return Result of the function call
6132*/
6133WDI_Status
6134WDI_MainReqBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006135(
Jeff Johnson295189b2012-06-20 16:38:30 -07006136 WDI_ControlBlockType* pWDICtx,
6137 WDI_EventInfoType* pEventData
6138)
6139{
6140 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006141 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006142 ----------------------------------------------------------------------*/
6143 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6144 {
6145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006146 "Invalid parameters on Main Request in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006147 pWDICtx, pEventData);
6148 return WDI_STATUS_E_FAILURE;
6149 }
6150
6151 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006152 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006153 ----------------------------------------------------------------------*/
6154 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6155 "WDI Busy state - queue request %d because waiting for response %d",
6156 pEventData->wdiRequest, pWDICtx->wdiExpectedResponse);
6157
Jeff Johnsone7245742012-09-05 17:12:55 -07006158 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006159 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006160
Jeff Johnson295189b2012-06-20 16:38:30 -07006161}/*WDI_MainReqBusy*/
6162/**
6163 @brief Main FSM Close function for state BUSY
6164
Jeff Johnsone7245742012-09-05 17:12:55 -07006165
6166 @param pWDICtx: pointer to the WLAN DAL context
6167 pEventData: pointer to the event information structure
6168
Jeff Johnson295189b2012-06-20 16:38:30 -07006169 @see
6170 @return Result of the function call
6171*/
6172WDI_Status
6173WDI_MainCloseBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006174(
Jeff Johnson295189b2012-06-20 16:38:30 -07006175 WDI_ControlBlockType* pWDICtx,
6176 WDI_EventInfoType* pEventData
6177)
6178{
6179 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006180 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006181 ----------------------------------------------------------------------*/
6182 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6183 {
6184 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006185 "Invalid parameters on Main Close in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006186 pWDICtx, pEventData);
6187 return WDI_STATUS_E_FAILURE;
6188 }
6189
6190 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006191 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006192 ----------------------------------------------------------------------*/
6193 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6194 "WDI Busy state - queue close request");
6195
Jeff Johnsone7245742012-09-05 17:12:55 -07006196 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006197 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006198
Jeff Johnson295189b2012-06-20 16:38:30 -07006199}/*WDI_MainCloseBusy*/
6200
6201/**
6202 @brief Main FSM Shutdown function for INIT & STARTED states
6203
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_MainShutdown
6213(
6214 WDI_ControlBlockType* pWDICtx,
6215 WDI_EventInfoType* pEventData
6216)
6217{
6218 /*--------------------------------------------------------------------
6219 Sanity Check
6220 ----------------------------------------------------------------------*/
6221 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6222 {
6223 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6224 "Invalid parameters on Main Start %x %x",
6225 pWDICtx, pEventData);
6226 return WDI_STATUS_E_FAILURE;
6227 }
6228
6229 /*State at this point is BUSY - because we enter this state before posting
6230 an event to the FSM in order to prevent potential race conditions*/
6231
6232 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6233 "Processing shutdown request in FSM");
6234
6235 /*Return Success*/
6236 return WDI_ProcessRequest( pWDICtx, pEventData );
6237
6238}/*WDI_MainShutdown*/
6239
6240/**
6241 @brief Main FSM Shutdown function for BUSY state
6242
6243
6244 @param pWDICtx: pointer to the WLAN DAL context
6245 pEventData: pointer to the event information structure
6246
6247 @see
6248 @return Result of the function call
6249*/
6250WDI_Status
6251WDI_MainShutdownBusy
6252(
6253 WDI_ControlBlockType* pWDICtx,
6254 WDI_EventInfoType* pEventData
6255)
6256{
6257 /*--------------------------------------------------------------------
6258 Sanity Check
6259 ----------------------------------------------------------------------*/
6260 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6261 {
6262 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6263 "Invalid parameters on Main Start %x %x",
6264 pWDICtx, pEventData);
6265 return WDI_STATUS_E_FAILURE;
6266 }
6267
6268 /* If you are waiting for a HAL response at this stage, you are not
6269 * going to get it. Riva is already shutdown/crashed.
6270 */
6271 wpalTimerStop(&gWDICb.wptResponseTimer);
6272
6273 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6274 "Processing shutdown request in FSM: Busy state ");
6275
6276 return WDI_ProcessRequest( pWDICtx, pEventData );
6277
6278}/*WDI_MainShutdownBusy*/
6279
6280
Jeff Johnsone7245742012-09-05 17:12:55 -07006281/*=======================================================================
6282
Jeff Johnson295189b2012-06-20 16:38:30 -07006283 WLAN DAL Control Path Main Processing Functions
Jeff Johnsone7245742012-09-05 17:12:55 -07006284
Jeff Johnson295189b2012-06-20 16:38:30 -07006285*=======================================================================*/
6286
6287/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006288 Main DAL Control Path Request Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -07006289========================================================================*/
6290/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006291 @brief Process Start Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006292 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006293
6294 @param pWDICtx: pointer to the WLAN DAL context
6295 pEventData: pointer to the event information structure
6296
Jeff Johnson295189b2012-06-20 16:38:30 -07006297 @see
6298 @return Result of the function call
6299*/
6300WDI_Status
6301WDI_ProcessStartReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006302(
Jeff Johnson295189b2012-06-20 16:38:30 -07006303 WDI_ControlBlockType* pWDICtx,
6304 WDI_EventInfoType* pEventData
6305)
6306{
6307 WDI_StartReqParamsType* pwdiStartParams = NULL;
6308 WDI_StartRspCb wdiStartRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006309 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006310 wpt_uint16 usDataOffset = 0;
6311 wpt_uint16 usSendSize = 0;
6312
Jeff Johnsone7245742012-09-05 17:12:55 -07006313 tHalMacStartReqMsg halStartReq;
6314 wpt_uint16 usLen = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07006315 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6316
6317 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006318 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006319 -------------------------------------------------------------------------*/
6320 if (( NULL == pEventData ) ||
6321 ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) ||
6322 ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc)))
6323 {
6324 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6325 "%s: Invalid parameters", __FUNCTION__);
6326 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006327 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006328 }
6329
6330 /*-----------------------------------------------------------------------
6331 Get message buffer
6332 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006333 usLen = sizeof(halStartReq.startReqParams) +
Jeff Johnson295189b2012-06-20 16:38:30 -07006334 pwdiStartParams->usConfigBufferLen;
6335
Jeff Johnsone7245742012-09-05 17:12:55 -07006336 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006337 usLen,
6338 &pSendBuffer, &usDataOffset, &usSendSize))||
6339 ( usSendSize < (usDataOffset + usLen )))
6340 {
6341 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6342 "Unable to get send buffer in start req %x %x %x",
6343 pEventData, pwdiStartParams, wdiStartRspCb);
6344 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006345 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006346 }
6347
6348 /*-----------------------------------------------------------------------
6349 Fill in the message
6350 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006351 halStartReq.startReqParams.driverType =
6352 WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType);
Jeff Johnson295189b2012-06-20 16:38:30 -07006353
Jeff Johnsone7245742012-09-05 17:12:55 -07006354 halStartReq.startReqParams.uConfigBufferLen =
6355 pwdiStartParams->usConfigBufferLen;
6356 wpalMemoryCopy( pSendBuffer+usDataOffset,
6357 &halStartReq.startReqParams,
6358 sizeof(halStartReq.startReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006359
Jeff Johnsone7245742012-09-05 17:12:55 -07006360 usDataOffset += sizeof(halStartReq.startReqParams);
6361 wpalMemoryCopy( pSendBuffer+usDataOffset,
6362 pwdiStartParams->pConfigBuffer,
6363 pwdiStartParams->usConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07006364
6365 pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006366 pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006367
6368 /*Save Low Level Ind CB and associated user data - it will be used further
6369 on when an indication is coming from the lower MAC*/
6370 pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006371 pWDICtx->pIndUserData = pwdiStartParams->pIndUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006372
Jeff Johnsone7245742012-09-05 17:12:55 -07006373 pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -07006374 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006375 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006376 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006377 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006378 wdiStartRspCb, pEventData->pUserData, WDI_START_RESP);
6379
Jeff Johnsone7245742012-09-05 17:12:55 -07006380
Jeff Johnson295189b2012-06-20 16:38:30 -07006381}/*WDI_ProcessStartReq*/
6382
6383/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006384 @brief Process Stop Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006385 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006386
6387 @param pWDICtx: pointer to the WLAN DAL context
6388 pEventData: pointer to the event information structure
6389
Jeff Johnson295189b2012-06-20 16:38:30 -07006390 @see
6391 @return Result of the function call
6392*/
6393WDI_Status
6394WDI_ProcessStopReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006395(
Jeff Johnson295189b2012-06-20 16:38:30 -07006396 WDI_ControlBlockType* pWDICtx,
6397 WDI_EventInfoType* pEventData
6398)
6399{
6400 WDI_StopReqParamsType* pwdiStopParams = NULL;
6401 WDI_StopRspCb wdiStopRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006402 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006403 wpt_uint16 usDataOffset = 0;
6404 wpt_uint16 usSendSize = 0;
Jeff Johnson43971f52012-07-17 12:26:56 -07006405 wpt_status status;
Jeff Johnsone7245742012-09-05 17:12:55 -07006406 tHalMacStopReqMsg halStopReq;
Jeff Johnson295189b2012-06-20 16:38:30 -07006407 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6408
6409 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006410 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006411 -------------------------------------------------------------------------*/
6412 if (( NULL == pEventData ) ||
6413 ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) ||
6414 ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc)))
6415 {
6416 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6417 "%s: Invalid parameters", __FUNCTION__);
6418 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006419 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006420 }
6421
6422 /*-----------------------------------------------------------------------
6423 Get message buffer
6424 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006425 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006426 sizeof(halStopReq.stopReqParams),
6427 &pSendBuffer, &usDataOffset, &usSendSize))||
6428 ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) )))
6429 {
6430 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6431 "Unable to get send buffer in stop req %x %x %x",
6432 pEventData, pwdiStopParams, wdiStopRspCb);
6433 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006434 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006435 }
6436
6437 /*-----------------------------------------------------------------------
6438 Fill in the message
6439 -----------------------------------------------------------------------*/
6440 halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON(
6441 pwdiStopParams->wdiStopReason);
6442
Jeff Johnsone7245742012-09-05 17:12:55 -07006443 wpalMemoryCopy( pSendBuffer+usDataOffset,
6444 &halStopReq.stopReqParams,
6445 sizeof(halStopReq.stopReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006446
6447 pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006448 pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006449
6450 /*! TO DO: stop the data services */
6451 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6452 {
6453 /*Stop the STA Table !UT- check this logic again
6454 It is safer to do it here than on the response - because a stop is imminent*/
6455 WDI_STATableStop(pWDICtx);
6456
6457 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -07006458 status = wpalEventReset(&pWDICtx->setPowerStateEvent);
6459 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006460 {
6461 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6462 "WDI Init failed to reset power state event");
6463
Jeff Johnsone7245742012-09-05 17:12:55 -07006464 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006465 return VOS_STATUS_E_FAILURE;
6466 }
6467 /* Stop Transport Driver, DXE */
6468 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb);
6469 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07006470 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -07006471 */
Jeff Johnson43971f52012-07-17 12:26:56 -07006472 status = wpalEventWait(&pWDICtx->setPowerStateEvent,
6473 WDI_SET_POWER_STATE_TIMEOUT);
6474 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006475 {
6476 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6477 "WDI Init failed to wait on an event");
6478
Jeff Johnsone7245742012-09-05 17:12:55 -07006479 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006480 return VOS_STATUS_E_FAILURE;
6481 }
6482 }
6483
6484 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006485 Send Stop Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006486 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006487 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006488 wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP);
6489
6490}/*WDI_ProcessStopReq*/
6491
6492/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006493 @brief Process Close Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006494 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006495
6496 @param pWDICtx: pointer to the WLAN DAL context
6497 pEventData: pointer to the event information structure
6498
Jeff Johnson295189b2012-06-20 16:38:30 -07006499 @see
6500 @return Result of the function call
6501*/
6502WDI_Status
6503WDI_ProcessCloseReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006504(
Jeff Johnson295189b2012-06-20 16:38:30 -07006505 WDI_ControlBlockType* pWDICtx,
6506 WDI_EventInfoType* pEventData
6507)
6508{
Jeff Johnsone7245742012-09-05 17:12:55 -07006509 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07006510 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6511
6512 /*Lock control block for cleanup*/
6513 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006514
Jeff Johnson295189b2012-06-20 16:38:30 -07006515 /*Clear all pending request*/
6516 WDI_ClearPendingRequests(pWDICtx);
6517
6518 /* Close Control transport*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006519 WCTS_CloseTransport(pWDICtx->wctsHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07006520
6521 /* Close Data transport*/
6522 /* FTM mode does not open Data Path */
6523 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6524 {
6525 WDTS_Close(pWDICtx);
6526 }
6527
6528 /*Close the STA Table !UT- check this logic again*/
6529 WDI_STATableClose(pWDICtx);
6530
6531 /*close the PAL */
6532 wptStatus = wpalClose(pWDICtx->pPALContext);
6533 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
6534 {
6535 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6536 "Failed to wpal Close %d", wptStatus);
6537 WDI_ASSERT(0);
6538 }
6539
6540 /*Transition back to init state*/
6541 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
6542
6543 wpalMutexRelease(&pWDICtx->wptMutex);
6544
6545 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006546 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006547
Jeff Johnsone7245742012-09-05 17:12:55 -07006548 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07006549}/*WDI_ProcessCloseReq*/
6550
6551
6552/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006553 SCANING REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07006554===========================================================================*/
6555
6556/**
6557 @brief Process Init Scan Request function (called when Main FSM
6558 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006559
6560 @param pWDICtx: pointer to the WLAN DAL context
6561 pEventData: pointer to the event information structure
6562
Jeff Johnson295189b2012-06-20 16:38:30 -07006563 @see
6564 @return Result of the function call
6565*/
6566WDI_Status
6567WDI_ProcessInitScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006568(
Jeff Johnson295189b2012-06-20 16:38:30 -07006569 WDI_ControlBlockType* pWDICtx,
6570 WDI_EventInfoType* pEventData
6571)
6572{
6573 WDI_InitScanReqParamsType* pwdiInitScanParams = NULL;
6574 WDI_InitScanRspCb wdiInitScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006575 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006576 wpt_uint16 usDataOffset = 0;
6577 wpt_uint16 usSendSize = 0;
6578 wpt_uint8 i = 0;
6579
6580 tHalInitScanReqMsg halInitScanReqMsg;
6581
Jeff Johnsone7245742012-09-05 17:12:55 -07006582 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006583 * It shold be removed once host and riva changes are in sync*/
6584 tHalInitScanConReqMsg halInitScanConReqMsg;
6585
6586 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6587
6588 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006589 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006590 -------------------------------------------------------------------------*/
6591 if (( NULL == pEventData ) ||
6592 ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) ||
6593 ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc)))
6594 {
6595 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6596 "%s: Invalid parameters", __FUNCTION__);
6597 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006598 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006599 }
6600
6601#if 0
6602 wpalMutexAcquire(&pWDICtx->wptMutex);
6603 /*-----------------------------------------------------------------------
6604 Check to see if SCAN is already in progress - if so reject the req
6605 We only allow one scan at a time
Jeff Johnsone7245742012-09-05 17:12:55 -07006606 ! TO DO: - revisit this constraint
Jeff Johnson295189b2012-06-20 16:38:30 -07006607 -----------------------------------------------------------------------*/
6608 if ( pWDICtx->bScanInProgress )
6609 {
6610 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6611 "Scan is already in progress - subsequent scan is not allowed"
6612 " until the first scan completes");
6613
6614 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006615 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006616 }
6617
Jeff Johnsone7245742012-09-05 17:12:55 -07006618 pWDICtx->bScanInProgress = eWLAN_PAL_TRUE;
6619 pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006620
6621 wpalMutexRelease(&pWDICtx->wptMutex);
6622#endif
6623
6624 if (pwdiInitScanParams->wdiReqInfo.bUseNOA)
6625 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006626 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006627 * It shold be removed once host and riva changes are in sync*/
6628 /*-----------------------------------------------------------------------
6629 Get message buffer
6630 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006631 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006632 sizeof(halInitScanConReqMsg.initScanParams),
6633 &pSendBuffer, &usDataOffset, &usSendSize))||
6634 ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) )))
6635 {
6636 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6637 "Unable to get send buffer in init scan req %x %x %x",
6638 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6639 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006640 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006641 }
6642
6643
6644 /*-----------------------------------------------------------------------
6645 Fill in the message
6646 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006647 halInitScanConReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006648 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6649
6650 wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid,
6651 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6652
Jeff Johnsone7245742012-09-05 17:12:55 -07006653 halInitScanConReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006654 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006655 halInitScanConReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006656 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006657 halInitScanConReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006658 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6659
6660 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr,
6661 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6662
6663#ifdef WLAN_FEATURE_P2P
6664 halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA;
6665 halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration;
6666#endif
6667
Jeff Johnsone7245742012-09-05 17:12:55 -07006668 halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006669 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6670
6671 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6672 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006673 halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006674 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6675 }
6676
Jeff Johnsone7245742012-09-05 17:12:55 -07006677 wpalMemoryCopy( pSendBuffer+usDataOffset,
6678 &halInitScanConReqMsg.initScanParams,
6679 sizeof(halInitScanConReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006680 }
6681 else
6682 {
6683 /*-----------------------------------------------------------------------
6684 Get message buffer
6685 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006686 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006687 sizeof(halInitScanReqMsg.initScanParams),
6688 &pSendBuffer, &usDataOffset, &usSendSize))||
6689 ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) )))
6690 {
6691 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6692 "Unable to get send buffer in init scan req %x %x %x",
6693 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6694 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006695 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006696 }
6697
6698
6699 /*-----------------------------------------------------------------------
6700 Fill in the message
6701 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006702 halInitScanReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006703 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6704
6705 wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid,
6706 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6707
Jeff Johnsone7245742012-09-05 17:12:55 -07006708 halInitScanReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006709 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006710 halInitScanReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006711 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006712 halInitScanReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006713 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6714
6715 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr,
6716 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6717
Jeff Johnsone7245742012-09-05 17:12:55 -07006718 halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006719 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6720
6721 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6722 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006723 halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006724 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6725 }
6726
Jeff Johnsone7245742012-09-05 17:12:55 -07006727 wpalMemoryCopy( pSendBuffer+usDataOffset,
6728 &halInitScanReqMsg.initScanParams,
6729 sizeof(halInitScanReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006730 }
6731
6732 pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006733 pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006734
6735 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006736 Send Init Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006737 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006738 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006739 wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP);
6740
6741}/*WDI_ProcessInitScanReq*/
6742
6743/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006744 @brief Process Start Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006745 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006746
6747 @param pWDICtx: pointer to the WLAN DAL context
6748 pEventData: pointer to the event information structure
6749
Jeff Johnson295189b2012-06-20 16:38:30 -07006750 @see
6751 @return Result of the function call
6752*/
6753WDI_Status
6754WDI_ProcessStartScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006755(
Jeff Johnson295189b2012-06-20 16:38:30 -07006756 WDI_ControlBlockType* pWDICtx,
6757 WDI_EventInfoType* pEventData
6758)
6759{
6760 WDI_StartScanReqParamsType* pwdiStartScanParams = NULL;
6761 WDI_StartScanRspCb wdiStartScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006762 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006763 wpt_uint16 usDataOffset = 0;
6764 wpt_uint16 usSendSize = 0;
6765
Jeff Johnsone7245742012-09-05 17:12:55 -07006766 tHalStartScanReqMsg halStartScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006767 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6768
6769 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006770 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006771 -------------------------------------------------------------------------*/
6772 if (( NULL == pEventData ) ||
6773 ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) ||
6774 ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc)))
6775 {
6776 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6777 "%s: Invalid parameters", __FUNCTION__);
6778 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006779 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006780 }
6781
6782#if 0
6783 wpalMutexAcquire(&pWDICtx->wptMutex);
6784 /*-----------------------------------------------------------------------
6785 Check to see if SCAN is already in progress - start scan is only
6786 allowed when a scan is ongoing and the state of the scan procedure
Jeff Johnsone7245742012-09-05 17:12:55 -07006787 is either init or end
Jeff Johnson295189b2012-06-20 16:38:30 -07006788 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006789 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006790 (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) &&
6791 ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState )))
6792 {
6793 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6794 "Scan start not allowed in this state %d %d",
6795 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006796
Jeff Johnson295189b2012-06-20 16:38:30 -07006797 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006798 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006799 }
6800
Jeff Johnsone7245742012-09-05 17:12:55 -07006801 pWDICtx->uScanState = WDI_SCAN_STARTED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006802
6803 wpalMutexRelease(&pWDICtx->wptMutex);
6804#endif
6805
6806 /*-----------------------------------------------------------------------
6807 Get message buffer
6808 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006809 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006810 sizeof(halStartScanReqMsg.startScanParams),
6811 &pSendBuffer, &usDataOffset, &usSendSize))||
6812 ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) )))
6813 {
6814 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6815 "Unable to get send buffer in start scan req %x %x %x",
6816 pEventData, pwdiStartScanParams, wdiStartScanRspCb);
6817 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006818 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006819 }
6820
Jeff Johnsone7245742012-09-05 17:12:55 -07006821 halStartScanReqMsg.startScanParams.scanChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07006822 pwdiStartScanParams->ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -07006823 wpalMemoryCopy( pSendBuffer+usDataOffset,
6824 &halStartScanReqMsg.startScanParams,
6825 sizeof(halStartScanReqMsg.startScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006826
6827 pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006828 pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006829
6830 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006831 Send Start Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006832 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006833 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006834 wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP);
6835}/*WDI_ProcessStartScanReq*/
6836
6837
6838/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006839 @brief Process End Scan Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006840 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006841
6842 @param pWDICtx: pointer to the WLAN DAL context
6843 pEventData: pointer to the event information structure
6844
Jeff Johnson295189b2012-06-20 16:38:30 -07006845 @see
6846 @return Result of the function call
6847*/
6848WDI_Status
6849WDI_ProcessEndScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006850(
Jeff Johnson295189b2012-06-20 16:38:30 -07006851 WDI_ControlBlockType* pWDICtx,
6852 WDI_EventInfoType* pEventData
6853)
6854{
6855 WDI_EndScanReqParamsType* pwdiEndScanParams = NULL;
6856 WDI_EndScanRspCb wdiEndScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006857 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006858 wpt_uint16 usDataOffset = 0;
6859 wpt_uint16 usSendSize = 0;
6860
Jeff Johnsone7245742012-09-05 17:12:55 -07006861 tHalEndScanReqMsg halEndScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006862 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6863
6864 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006865 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006866 -------------------------------------------------------------------------*/
6867 if (( NULL == pEventData ) ||
6868 ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) ||
6869 ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc)))
6870 {
6871 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6872 "%s: Invalid parameters", __FUNCTION__);
6873 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006874 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006875 }
6876
Jeff Johnsone7245742012-09-05 17:12:55 -07006877 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6878 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006879 * forwarded to HAL and result in hang*/
6880#if 0
6881 wpalMutexAcquire(&pWDICtx->wptMutex);
6882 /*-----------------------------------------------------------------------
6883 Check to see if SCAN is already in progress - end scan is only
6884 allowed when a scan is ongoing and the state of the scan procedure
6885 is started
6886 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006887 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006888 ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState ))
6889 {
6890 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6891 "End start not allowed in this state %d %d",
6892 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006893
Jeff Johnson295189b2012-06-20 16:38:30 -07006894 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006895 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006896 }
6897
Jeff Johnsone7245742012-09-05 17:12:55 -07006898 pWDICtx->uScanState = WDI_SCAN_ENDED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006899
6900 wpalMutexRelease(&pWDICtx->wptMutex);
6901#endif
6902
6903 /*-----------------------------------------------------------------------
6904 Get message buffer
6905 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006906 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006907 sizeof(halEndScanReqMsg.endScanParams),
6908 &pSendBuffer, &usDataOffset, &usSendSize))||
6909 ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) )))
6910 {
6911 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6912 "Unable to get send buffer in start scan req %x %x %x",
6913 pEventData, pwdiEndScanParams, wdiEndScanRspCb);
6914 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006915 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006916 }
6917
6918 halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel;
6919
Jeff Johnsone7245742012-09-05 17:12:55 -07006920 wpalMemoryCopy( pSendBuffer+usDataOffset,
6921 &halEndScanReqMsg.endScanParams,
6922 sizeof(halEndScanReqMsg.endScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006923
6924 pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006925 pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006926
6927 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006928 Send End Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006929 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006930 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006931 wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP);
6932}/*WDI_ProcessEndScanReq*/
6933
6934
6935/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006936 @brief Process Finish Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006937 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006938
6939 @param pWDICtx: pointer to the WLAN DAL context
6940 pEventData: pointer to the event information structure
6941
Jeff Johnson295189b2012-06-20 16:38:30 -07006942 @see
6943 @return Result of the function call
6944*/
6945WDI_Status
6946WDI_ProcessFinishScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006947(
Jeff Johnson295189b2012-06-20 16:38:30 -07006948 WDI_ControlBlockType* pWDICtx,
6949 WDI_EventInfoType* pEventData
6950)
6951{
6952 WDI_FinishScanReqParamsType* pwdiFinishScanParams;
6953 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07006954 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006955 wpt_uint16 usDataOffset = 0;
6956 wpt_uint16 usSendSize = 0;
6957 wpt_uint8 i = 0;
6958
Jeff Johnsone7245742012-09-05 17:12:55 -07006959 tHalFinishScanReqMsg halFinishScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006960 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6961
6962 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006963 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006964 -------------------------------------------------------------------------*/
6965 if (( NULL == pEventData ) ||
6966 ( NULL == pEventData->pEventData) ||
6967 ( NULL == pEventData->pCBfnc))
6968 {
6969 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6970 "%s: Invalid parameters", __FUNCTION__);
6971 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006972 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006973 }
6974
6975 pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData;
6976 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -07006977 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6978 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006979 * forwarded to HAL and result in hang*/
6980#if 0
6981 wpalMutexAcquire(&pWDICtx->wptMutex);
6982 /*-----------------------------------------------------------------------
6983 Check to see if SCAN is already in progress
6984 Finish scan gets invoked any scan states. ie. abort scan
6985 It should be allowed in any states.
6986 -----------------------------------------------------------------------*/
6987 if ( !pWDICtx->bScanInProgress )
6988 {
6989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6990 "Finish start not allowed in this state %d",
6991 pWDICtx->bScanInProgress );
6992
6993 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006994 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006995 }
6996
6997 /*-----------------------------------------------------------------------
6998 It is safe to reset the scan flags here because until the response comes
Jeff Johnsone7245742012-09-05 17:12:55 -07006999 back all subsequent requests will be blocked at BUSY state
Jeff Johnson295189b2012-06-20 16:38:30 -07007000 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007001 pWDICtx->uScanState = WDI_SCAN_FINISHED_ST;
7002 pWDICtx->bScanInProgress = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007003 wpalMutexRelease(&pWDICtx->wptMutex);
7004#endif
7005
7006 if ( pWDICtx->bInBmps )
7007 {
7008 // notify DTS that we are entering BMPS
7009 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL);
7010 }
7011
7012 /*-----------------------------------------------------------------------
7013 Get message buffer
7014 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007015 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007016 sizeof(halFinishScanReqMsg.finishScanParams),
7017 &pSendBuffer, &usDataOffset, &usSendSize))||
7018 ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) )))
7019 {
7020 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7021 "Unable to get send buffer in start scan req %x %x %x",
7022 pEventData, pwdiFinishScanParams, wdiFinishScanRspCb);
7023 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007024 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007025 }
7026
Jeff Johnsone7245742012-09-05 17:12:55 -07007027 halFinishScanReqMsg.finishScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07007028 WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode);
7029
Jeff Johnsone7245742012-09-05 17:12:55 -07007030 halFinishScanReqMsg.finishScanParams.currentOperChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007031 pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel;
7032
Jeff Johnsone7245742012-09-05 17:12:55 -07007033 halFinishScanReqMsg.finishScanParams.cbState =
Jeff Johnson295189b2012-06-20 16:38:30 -07007034 WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState);
7035
7036 wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid,
7037 pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
7038
Jeff Johnsone7245742012-09-05 17:12:55 -07007039 halFinishScanReqMsg.finishScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07007040 pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007041 halFinishScanReqMsg.finishScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07007042 pwdiFinishScanParams->wdiReqInfo.ucFrameType ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007043 halFinishScanReqMsg.finishScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07007044 pwdiFinishScanParams->wdiReqInfo.ucFrameLength ;
7045
Jeff Johnsone7245742012-09-05 17:12:55 -07007046 halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07007047 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ;
7048
7049 for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
7050 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007051 halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07007052 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ;
7053 }
7054
7055 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr,
7056 &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr);
7057
Jeff Johnsone7245742012-09-05 17:12:55 -07007058 wpalMemoryCopy( pSendBuffer+usDataOffset,
7059 &halFinishScanReqMsg.finishScanParams,
7060 sizeof(halFinishScanReqMsg.finishScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007061
7062 pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007063 pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007064
7065 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007066 Send Finish Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007067 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007068 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007069 wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP);
7070}/*WDI_ProcessFinishScanReq*/
7071
7072
7073/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007074 ASSOCIATION REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07007075==========================================================================*/
7076/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007077 @brief Process BSS Join for a given Session
7078
7079 @param pWDICtx: pointer to the WLAN DAL context
7080 pEventData: pointer to the event information structure
7081
Jeff Johnson295189b2012-06-20 16:38:30 -07007082 @see
7083 @return Result of the function call
7084*/
7085WDI_Status
7086WDI_ProcessBSSSessionJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007087(
Jeff Johnson295189b2012-06-20 16:38:30 -07007088 WDI_ControlBlockType* pWDICtx,
7089 WDI_JoinReqParamsType* pwdiJoinParams,
7090 WDI_JoinRspCb wdiJoinRspCb,
7091 void* pUserData
7092)
7093{
7094 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007095 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007096 wpt_uint16 usDataOffset = 0;
7097 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007098 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007099
Jeff Johnsone7245742012-09-05 17:12:55 -07007100 tHalJoinReqMsg halJoinReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007101 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7102
7103 /*------------------------------------------------------------------------
7104 Check to see if we have any session with this BSSID already stored, we
7105 should not
7106 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007107 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7108 pwdiJoinParams->wdiReqInfo.macBSSID,
7109 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007110
7111 if ( NULL != pBSSSes )
7112 {
7113 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7114 "Association for this BSSID is already in place");
7115
Jeff Johnsone7245742012-09-05 17:12:55 -07007116 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007117 }
7118
7119 wpalMutexAcquire(&pWDICtx->wptMutex);
7120 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007121 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007122 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007123 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007124 if ( NULL == pBSSSes )
7125 {
7126
7127 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7128 "DAL has no free sessions - cannot run another join");
7129
7130 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007131 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007132 }
7133
7134 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007135 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7136 wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007137 WDI_MAC_ADDR_LEN);
7138
7139 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007140 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007141 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -07007142
Jeff Johnson295189b2012-06-20 16:38:30 -07007143 wpalMutexRelease(&pWDICtx->wptMutex);
7144
7145 /*-----------------------------------------------------------------------
7146 Get message buffer
7147 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007148 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007149 sizeof(halJoinReqMsg.joinReqParams),
7150 &pSendBuffer, &usDataOffset, &usSendSize))||
7151 ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) )))
7152 {
7153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7154 "Unable to get send buffer in join req %x %x %x",
7155 pUserData, pwdiJoinParams, wdiJoinRspCb);
7156 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007157 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007158 }
7159
7160 wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -07007161 pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007162
7163 wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr,
Jeff Johnsone7245742012-09-05 17:12:55 -07007164 pwdiJoinParams->wdiReqInfo.macSTASelf,
7165 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007166
Jeff Johnsone7245742012-09-05 17:12:55 -07007167 halJoinReqMsg.joinReqParams.ucChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007168 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel;
7169
7170 halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState;
7171
7172#ifndef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -07007173 halJoinReqMsg.joinReqParams.ucLocalPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -07007174 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint;
7175#endif
7176
Jeff Johnsone7245742012-09-05 17:12:55 -07007177 halJoinReqMsg.joinReqParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -07007178 WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo.
7179 wdiSecondaryChannelOffset);
7180
Jeff Johnsone7245742012-09-05 17:12:55 -07007181 wpalMemoryCopy( pSendBuffer+usDataOffset,
7182 &halJoinReqMsg.joinReqParams,
7183 sizeof(halJoinReqMsg.joinReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007184
7185 pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007186 pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007187
7188 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007189 Send Join Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007190 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007191 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7192 wdiJoinRspCb, pUserData, WDI_JOIN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07007193
7194}/*WDI_ProcessBSSSessionJoinReq*/
7195
7196/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007197 @brief Process Join Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007198 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007199
7200 @param pWDICtx: pointer to the WLAN DAL context
7201 pEventData: pointer to the event information structure
7202
Jeff Johnson295189b2012-06-20 16:38:30 -07007203 @see
7204 @return Result of the function call
7205*/
7206WDI_Status
7207WDI_ProcessJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007208(
Jeff Johnson295189b2012-06-20 16:38:30 -07007209 WDI_ControlBlockType* pWDICtx,
7210 WDI_EventInfoType* pEventData
7211)
7212{
7213 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7214 WDI_JoinReqParamsType* pwdiJoinParams = NULL;
7215 WDI_JoinRspCb wdiJoinRspCb = NULL;
7216 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7217
7218 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007219 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007220 -------------------------------------------------------------------------*/
7221 if (( NULL == pEventData ) ||
7222 ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) ||
7223 ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc)))
7224 {
7225 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7226 "%s: Invalid parameters", __FUNCTION__);
7227 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007228 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007229 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007230
Jeff Johnson295189b2012-06-20 16:38:30 -07007231 /*-------------------------------------------------------------------------
7232 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007233 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007234 -------------------------------------------------------------------------*/
7235 wpalMutexAcquire(&pWDICtx->wptMutex);
7236
7237 if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress )
7238 {
7239 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7240 "Association is currently in progress, queueing new join req");
7241
7242 /*Association is in progress - queue current one*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007243 wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007244 pwdiJoinParams->wdiReqInfo.macBSSID);
7245
7246 wpalMutexRelease(&pWDICtx->wptMutex);
7247
Jeff Johnsone7245742012-09-05 17:12:55 -07007248 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007249 }
7250
7251 /*Starting a new association */
7252 pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE;
7253 wpalMutexRelease(&pWDICtx->wptMutex);
7254
7255 /*Process the Join Request*/
7256 return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams,
7257 wdiJoinRspCb,pEventData->pUserData);
7258
7259}/*WDI_ProcessJoinReq*/
7260
7261
7262/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007263 @brief Process Config BSS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007264 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007265
7266 @param pWDICtx: pointer to the WLAN DAL context
7267 pEventData: pointer to the event information structure
7268
Jeff Johnson295189b2012-06-20 16:38:30 -07007269 @see
7270 @return Result of the function call
7271*/
7272WDI_Status
7273WDI_ProcessConfigBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007274(
Jeff Johnson295189b2012-06-20 16:38:30 -07007275 WDI_ControlBlockType* pWDICtx,
7276 WDI_EventInfoType* pEventData
7277)
7278{
7279 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams;
7280 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007281 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007282 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007283 wpt_uint16 uMsgSize = 0;
7284 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007285 wpt_uint16 usDataOffset = 0;
7286 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007287 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007288
Jeff Johnsone7245742012-09-05 17:12:55 -07007289 tConfigBssReqMsg halConfigBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007290 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7291
7292 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007293 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007294 -------------------------------------------------------------------------*/
7295 if (( NULL == pEventData ) ||
7296 ( NULL == pEventData->pEventData ) ||
7297 ( NULL == pEventData->pCBfnc ))
7298 {
7299 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7300 "%s: Invalid parameters", __FUNCTION__);
7301 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007302 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007303 }
7304
7305 pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData;
7306 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc;
7307 /*-------------------------------------------------------------------------
7308 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007309 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007310 -------------------------------------------------------------------------*/
7311 wpalMutexAcquire(&pWDICtx->wptMutex);
7312
7313 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007314 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007315 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007316 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7317 pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7318 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007319
Jeff Johnsone7245742012-09-05 17:12:55 -07007320 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007321 {
7322#ifdef WLAN_FEATURE_VOWIFI_11R
7323 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007324 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007325 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007326 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007327 if ( NULL == pBSSSes )
7328 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007329
Jeff Johnson295189b2012-06-20 16:38:30 -07007330 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7331 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007332
Jeff Johnson295189b2012-06-20 16:38:30 -07007333 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007334 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007335 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007336
Jeff Johnson295189b2012-06-20 16:38:30 -07007337 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007338 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7339 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007340 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007341
Jeff Johnson295189b2012-06-20 16:38:30 -07007342 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007343 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007344 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7345#else
Jeff Johnsone7245742012-09-05 17:12:55 -07007346 /* If the BSS type is IBSS create the session here as there is no Join
Jeff Johnson295189b2012-06-20 16:38:30 -07007347 * Request in case of IBSS*/
7348 if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) ||
7349 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) ||
7350 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) ||
7351 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE))
7352 {
7353 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007354 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007355 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007356 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007357 if ( NULL == pBSSSes )
7358 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007359
Jeff Johnson295189b2012-06-20 16:38:30 -07007360 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7361 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007362
Jeff Johnson295189b2012-06-20 16:38:30 -07007363 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007364 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007365 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007366
Jeff Johnson295189b2012-06-20 16:38:30 -07007367 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007368 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7369 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007370 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007371
Jeff Johnson295189b2012-06-20 16:38:30 -07007372 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007373 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007374 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7375 }
7376 else
7377 {
7378 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007379 "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d",
7380 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7381 pwdiConfigBSSParams->wdiReqInfo.wdiBSSType);
7382
Jeff Johnson295189b2012-06-20 16:38:30 -07007383 /* for IBSS testing */
7384 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007385 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007386 }
7387#endif
7388 }
7389
7390 /*------------------------------------------------------------------------
7391 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007392 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007393 ------------------------------------------------------------------------*/
7394 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7395 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007396 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7397 "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d",
7398 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7399 ucCurrentBSSSesIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007400
Jeff Johnsone7245742012-09-05 17:12:55 -07007401 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007402
7403 wpalMutexRelease(&pWDICtx->wptMutex);
7404
Jeff Johnsone7245742012-09-05 17:12:55 -07007405 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007406 }
7407
7408 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07007409 wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq,
7410 pwdiConfigBSSParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007411 sizeof(pWDICtx->wdiCachedConfigBssReq));
7412
7413 wpalMutexRelease(&pWDICtx->wptMutex);
7414
Jeff Johnsone7245742012-09-05 17:12:55 -07007415 /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */
7416#ifdef WLAN_FEATURE_11AC
7417 if (WDI_getFwWlanFeatCaps(DOT11AC))
7418 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC
7419 else
7420#endif
7421 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure
Jeff Johnson295189b2012-06-20 16:38:30 -07007422
7423 /*-----------------------------------------------------------------------
7424 Get message buffer
7425 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007426 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007427 uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))||
7428 ( usSendSize < (usDataOffset + uMsgSize )))
7429 {
7430 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7431 "Unable to get send buffer in config bss req %x %x %x",
7432 pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb);
7433 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007434 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007435 }
7436
7437 /*Copy the BSS request */
Jeff Johnsone7245742012-09-05 17:12:55 -07007438 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007439 &pwdiConfigBSSParams->wdiReqInfo);
7440
7441 /* Need to fill in the STA Index to invalid, since at this point we have not
7442 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -07007443 halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -07007444
7445 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007446 halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7447
7448 wpalMemoryCopy( pSendBuffer+usDataOffset,
7449 &halConfigBssReqMsg.uBssParams.configBssParams,
7450 uMsgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07007451
7452 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007453 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007454
7455 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007456 Send Config BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007457 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007458 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7459 wdiConfigBSSRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007460 WDI_CONFIG_BSS_RESP);
7461
7462}/*WDI_ProcessConfigBSSReq*/
7463
7464
7465/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007466 @brief Process Del BSS Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007467 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007468
7469 @param pWDICtx: pointer to the WLAN DAL context
7470 pEventData: pointer to the event information structure
7471
Jeff Johnson295189b2012-06-20 16:38:30 -07007472 @see
7473 @return Result of the function call
7474*/
7475WDI_Status
7476WDI_ProcessDelBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007477(
Jeff Johnson295189b2012-06-20 16:38:30 -07007478 WDI_ControlBlockType* pWDICtx,
7479 WDI_EventInfoType* pEventData
7480)
7481{
7482 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7483 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007484 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007485 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007486 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007487 wpt_uint16 usDataOffset = 0;
7488 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007489 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007490
Jeff Johnsone7245742012-09-05 17:12:55 -07007491 tDeleteBssReqMsg halBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007492 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7493
7494 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007495 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007496 -------------------------------------------------------------------------*/
7497 if (( NULL == pEventData ) ||
7498 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7499 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7500 {
7501 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7502 "%s: Invalid parameters", __FUNCTION__);
7503 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007504 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007505 }
7506
7507 /*-------------------------------------------------------------------------
7508 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007509 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007510 -------------------------------------------------------------------------*/
7511 wpalMutexAcquire(&pWDICtx->wptMutex);
7512
7513 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007514 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007515 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007516 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7517 pwdiDelBSSParams->ucBssIdx,
7518 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007519
Jeff Johnsone7245742012-09-05 17:12:55 -07007520 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007521 {
7522 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007523 "%s: BSS does not yet exist. ucBssIdx %d",
7524 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007525
7526 wpalMutexRelease(&pWDICtx->wptMutex);
7527
Jeff Johnsone7245742012-09-05 17:12:55 -07007528 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007529 }
7530
7531 /*------------------------------------------------------------------------
7532 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007533 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007534 ------------------------------------------------------------------------*/
7535 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7536 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007537 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7538 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
7539 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007540
Jeff Johnsone7245742012-09-05 17:12:55 -07007541 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007542
7543 wpalMutexRelease(&pWDICtx->wptMutex);
7544
Jeff Johnsone7245742012-09-05 17:12:55 -07007545 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007546 }
7547
7548 /*-----------------------------------------------------------------------
7549 If we receive a Del BSS request for an association that is already in
7550 progress, it indicates that the assoc has failed => we no longer have
7551 an association in progress => we must check for pending associations
Jeff Johnsone7245742012-09-05 17:12:55 -07007552 that were queued and start as soon as the Del BSS response is received
Jeff Johnson295189b2012-06-20 16:38:30 -07007553 -----------------------------------------------------------------------*/
7554 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7555 {
7556 /*We can switch to false here because even if a subsequent Join comes in
7557 it will only be processed when DAL transitions out of BUSY state which
7558 happens when the Del BSS request comes */
7559 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7560
7561 /*Former association is complete - prepare next pending assoc for
7562 processing */
7563 WDI_DequeueAssocRequest(pWDICtx);
7564 }
7565
7566 wpalMutexRelease(&pWDICtx->wptMutex);
7567 /*-----------------------------------------------------------------------
7568 Get message buffer
7569 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007570 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007571 sizeof(halBssReqMsg.deleteBssParams),
7572 &pSendBuffer, &usDataOffset, &usSendSize))||
7573 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7574 {
7575 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7576 "Unable to get send buffer in start req %x %x %x",
7577 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7578 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007579 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007580 }
7581
7582 /*Fill in the message request structure*/
7583
7584 /*BSS Index is saved on config BSS response and Post Assoc Response */
Jeff Johnsone7245742012-09-05 17:12:55 -07007585 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07007586
Jeff Johnsone7245742012-09-05 17:12:55 -07007587 wpalMemoryCopy( pSendBuffer+usDataOffset,
7588 &halBssReqMsg.deleteBssParams,
7589 sizeof(halBssReqMsg.deleteBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007590
7591 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007592 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007593
Jeff Johnsone7245742012-09-05 17:12:55 -07007594
Jeff Johnson295189b2012-06-20 16:38:30 -07007595 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007596 Send Del BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007597 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007598 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007599 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7600
Jeff Johnsone7245742012-09-05 17:12:55 -07007601
Jeff Johnson295189b2012-06-20 16:38:30 -07007602}/*WDI_ProcessDelBSSReq*/
7603
7604/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007605 @brief Process Post Assoc Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007606 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007607
7608 @param pWDICtx: pointer to the WLAN DAL context
7609 pEventData: pointer to the event information structure
7610
Jeff Johnson295189b2012-06-20 16:38:30 -07007611 @see
7612 @return Result of the function call
7613*/
7614WDI_Status
7615WDI_ProcessPostAssocReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007616(
Jeff Johnson295189b2012-06-20 16:38:30 -07007617 WDI_ControlBlockType* pWDICtx,
7618 WDI_EventInfoType* pEventData
7619)
7620{
7621 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7622 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007623 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007624 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007625 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007626 wpt_uint16 usDataOffset = 0;
7627 wpt_uint16 usSendSize = 0;
7628 wpt_uint16 uMsgSize = 0;
7629 wpt_uint16 uOffset = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007630 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007631
Jeff Johnsone7245742012-09-05 17:12:55 -07007632 tPostAssocReqMsg halPostAssocReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007633 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7634
7635 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007636 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007637 -------------------------------------------------------------------------*/
7638 if (( NULL == pEventData ) ||
7639 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7640 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7641 {
7642 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7643 "%s: Invalid parameters", __FUNCTION__);
7644 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007645 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007646 }
7647
7648 /*-------------------------------------------------------------------------
7649 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007650 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007651 -------------------------------------------------------------------------*/
7652 wpalMutexAcquire(&pWDICtx->wptMutex);
7653
7654 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007655 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007656 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007657 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7658 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7659 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007660
7661 if ( NULL == pBSSSes )
7662 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007663 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7664 "%s: Association sequence for this BSS does not yet exist - "
7665 "operation not allowed. macBSSID " MAC_ADDRESS_STR,
7666 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007667
7668 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007669 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007670 }
7671
7672 /*------------------------------------------------------------------------
7673 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007674 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007675 ------------------------------------------------------------------------*/
7676 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7677 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007678 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7679 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7680 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007681
Jeff Johnsone7245742012-09-05 17:12:55 -07007682 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007683
7684 wpalMutexRelease(&pWDICtx->wptMutex);
7685
Jeff Johnsone7245742012-09-05 17:12:55 -07007686 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007687 }
7688
7689 /*-----------------------------------------------------------------------
7690 If Post Assoc was not yet received - the current association must
7691 be in progress
7692 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007693 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07007694 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7695 {
7696 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7697 "Association sequence for this BSS association no longer in "
7698 "progress - not allowed");
7699
7700 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007701 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007702 }
7703
7704 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007705 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -07007706 -----------------------------------------------------------------------*/
7707 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7708 {
7709 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7710 "Post Assoc not allowed before JOIN - failing request");
7711
7712 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007713 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007714 }
7715
7716 wpalMutexRelease(&pWDICtx->wptMutex);
7717
7718 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7719 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7720 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007721 Fill message for tx over the bus
Jeff Johnson295189b2012-06-20 16:38:30 -07007722 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007723 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007724 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7725 ( usSendSize < (usDataOffset + uMsgSize )))
7726 {
7727 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7728 "Unable to get send buffer in start req %x %x %x",
7729 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7730 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007731 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007732 }
7733
7734 /*Copy the STA parameters */
7735 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7736 &pwdiPostAssocParams->wdiSTAParams );
7737
7738 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007739 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007740 WDI_STATableFindStaidByAddr(pWDICtx,
7741 pwdiPostAssocParams->wdiSTAParams.macSTA,
7742 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7743 {
7744 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7745 "This station does not exist in the WDI Station Table %d");
7746 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007747 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007748 }
7749
7750 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007751 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007752 pBSSSes->ucBSSIdx;
7753
7754 /*Copy the BSS parameters */
7755 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7756 &pwdiPostAssocParams->wdiBSSParams);
7757
7758 /* Need to fill in the STA index of the peer */
Jeff Johnsone7245742012-09-05 17:12:55 -07007759 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007760 WDI_STATableFindStaidByAddr(pWDICtx,
7761 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -07007762 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
Jeff Johnson295189b2012-06-20 16:38:30 -07007763 {
7764 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7765 "This station does not exist in the WDI Station Table %d");
7766 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007767 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007768 }
7769
7770 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007771 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007772 pBSSSes->ucBSSIdx;
7773
Jeff Johnsone7245742012-09-05 17:12:55 -07007774
7775 wpalMemoryCopy( pSendBuffer+usDataOffset,
7776 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7777 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007778
7779 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7780
Jeff Johnsone7245742012-09-05 17:12:55 -07007781 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7782 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7783 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007784
Jeff Johnsone7245742012-09-05 17:12:55 -07007785
Jeff Johnson295189b2012-06-20 16:38:30 -07007786 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007787 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007788
Jeff Johnsone7245742012-09-05 17:12:55 -07007789
7790 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
Jeff Johnson295189b2012-06-20 16:38:30 -07007791 pwdiPostAssocParams,
Jeff Johnsone7245742012-09-05 17:12:55 -07007792 sizeof(pWDICtx->wdiCachedPostAssocReq));
Jeff Johnson295189b2012-06-20 16:38:30 -07007793
7794 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007795 Send Post Assoc Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007796 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007797 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007798 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7799
Jeff Johnsone7245742012-09-05 17:12:55 -07007800
Jeff Johnson295189b2012-06-20 16:38:30 -07007801}/*WDI_ProcessPostAssocReq*/
7802
7803/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007804 @brief Process Del STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007805 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007806
7807 @param pWDICtx: pointer to the WLAN DAL context
7808 pEventData: pointer to the event information structure
7809
Jeff Johnson295189b2012-06-20 16:38:30 -07007810 @see
7811 @return Result of the function call
7812*/
7813WDI_Status
7814WDI_ProcessDelSTAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007815(
Jeff Johnson295189b2012-06-20 16:38:30 -07007816 WDI_ControlBlockType* pWDICtx,
7817 WDI_EventInfoType* pEventData
7818)
7819{
7820 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7821 WDI_DelSTARspCb wdiDelSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007822 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007823 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007824 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007825 wpt_uint16 usDataOffset = 0;
7826 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007827 wpt_macAddr macBSSID;
Jeff Johnson295189b2012-06-20 16:38:30 -07007828 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7829
Jeff Johnsone7245742012-09-05 17:12:55 -07007830 tDeleteStaReqMsg halDelStaReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007831 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7832
7833 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007834 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007835 -------------------------------------------------------------------------*/
7836 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7837 ( NULL == pEventData->pCBfnc ))
7838 {
7839 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7840 "%s: Invalid parameters", __FUNCTION__);
7841 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007842 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007843 }
7844
7845 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7846 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7847 /*-------------------------------------------------------------------------
7848 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007849 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007850 -------------------------------------------------------------------------*/
7851 wpalMutexAcquire(&pWDICtx->wptMutex);
7852
7853 /*------------------------------------------------------------------------
7854 Find the BSS for which the request is made and identify WDI session
7855 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007856 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7857 pwdiDelSTAParams->ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07007858 &macBSSID))
7859 {
7860 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7861 "This station does not exist in the WDI Station Table %d");
7862 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007863 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007864 }
7865
Jeff Johnsone7245742012-09-05 17:12:55 -07007866 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7867 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007868 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007869 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7870 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
7871 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007872
7873 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007874 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007875 }
7876
7877 /*------------------------------------------------------------------------
7878 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007879 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007880 ------------------------------------------------------------------------*/
7881 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7882 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007883 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7884 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7885 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007886
Jeff Johnsone7245742012-09-05 17:12:55 -07007887 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007888 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007889 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007890 }
7891
7892 wpalMutexRelease(&pWDICtx->wptMutex);
7893 /*-----------------------------------------------------------------------
7894 Get message buffer
7895 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007896 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007897 sizeof(halDelStaReqMsg.delStaParams),
7898 &pSendBuffer, &usDataOffset, &usSendSize))||
7899 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7900 {
7901 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7902 "Unable to get send buffer in start req %x %x %x",
7903 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7904 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007905 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007906 }
7907
Jeff Johnsone7245742012-09-05 17:12:55 -07007908 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7909 wpalMemoryCopy( pSendBuffer+usDataOffset,
7910 &halDelStaReqMsg.delStaParams,
7911 sizeof(halDelStaReqMsg.delStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007912
7913 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007914 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007915
7916 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007917 Send Del STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007918 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007919 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007920 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7921
7922}/*WDI_ProcessDelSTAReq*/
7923
7924
7925/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007926 SECURITY REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07007927==========================================================================*/
7928/**
7929 @brief Process Set BSS Key Request function (called when Main FSM
7930 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007931
7932 @param pWDICtx: pointer to the WLAN DAL context
7933 pEventData: pointer to the event information structure
7934
Jeff Johnson295189b2012-06-20 16:38:30 -07007935 @see
7936 @return Result of the function call
7937*/
7938WDI_Status
7939WDI_ProcessSetBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007940(
Jeff Johnson295189b2012-06-20 16:38:30 -07007941 WDI_ControlBlockType* pWDICtx,
7942 WDI_EventInfoType* pEventData
7943)
7944{
7945 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7946 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007947 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007948 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007949 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007950 wpt_uint16 usDataOffset = 0;
7951 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007952 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007953 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7954 wpt_uint8 keyIndex = 0;
7955
7956 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7957
7958 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007959 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007960 -------------------------------------------------------------------------*/
7961 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7962 ( NULL == pEventData->pCBfnc ))
7963 {
7964 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7965 "%s: Invalid parameters", __FUNCTION__);
7966 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007967 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007968 }
7969
7970 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7971 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7972 /*-------------------------------------------------------------------------
7973 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007974 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007975 -------------------------------------------------------------------------*/
7976 wpalMutexAcquire(&pWDICtx->wptMutex);
7977
7978 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007979 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007980 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007981 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7982 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7983 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007984
Jeff Johnsone7245742012-09-05 17:12:55 -07007985 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007986 {
7987 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007988 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
7989 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007990
7991 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007992 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007993 }
7994
7995 /*------------------------------------------------------------------------
7996 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007997 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007998 ------------------------------------------------------------------------*/
7999 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8000 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008001 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8002 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8003 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008004
Jeff Johnsone7245742012-09-05 17:12:55 -07008005 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008006 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008007 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008008 }
8009
8010
8011 wpalMutexRelease(&pWDICtx->wptMutex);
8012 /*-----------------------------------------------------------------------
8013 Get message buffer
8014 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008015 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008016 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
8017 &pSendBuffer, &usDataOffset, &usSendSize))||
8018 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
8019 {
8020 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8021 "Unable to get send buffer in set bss key req %x %x %x",
8022 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
8023 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008024 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008025 }
8026
8027 /*-----------------------------------------------------------------------
8028 Copy the Key parameters into the HAL message
8029 -----------------------------------------------------------------------*/
8030
Jeff Johnsone7245742012-09-05 17:12:55 -07008031 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008032
Jeff Johnsone7245742012-09-05 17:12:55 -07008033 halSetBssKeyReqMsg.setBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008034 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
8035
Jeff Johnsone7245742012-09-05 17:12:55 -07008036 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
Jeff Johnson295189b2012-06-20 16:38:30 -07008037 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
8038
8039 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
8040 keyIndex++)
8041 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008042 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008043 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
8044 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
8045 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
8046 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
8047 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
8048 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008049 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008050 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008051 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008052 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008053 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008054 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
8055 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008056 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008057 WDI_MAX_KEY_LENGTH);
8058 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008059
8060 wpalMemoryCopy( pSendBuffer+usDataOffset,
8061 &halSetBssKeyReqMsg.setBssKeyParams,
8062 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008063
8064 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008065 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008066
8067 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008068 Send Set BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008069 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008070 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8071 wdiSetBSSKeyRspCb, pEventData->pUserData,
8072 WDI_SET_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008073
8074}/*WDI_ProcessSetBssKeyReq*/
8075
8076/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008077 @brief Process Remove BSS Key Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07008078 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008079
8080 @param pWDICtx: pointer to the WLAN DAL context
8081 pEventData: pointer to the event information structure
8082
Jeff Johnson295189b2012-06-20 16:38:30 -07008083 @see
8084 @return Result of the function call
8085*/
8086WDI_Status
8087WDI_ProcessRemoveBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008088(
Jeff Johnson295189b2012-06-20 16:38:30 -07008089 WDI_ControlBlockType* pWDICtx,
8090 WDI_EventInfoType* pEventData
8091)
8092{
8093 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
8094 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008095 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008096 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008097 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008098 wpt_uint16 usDataOffset = 0;
8099 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008100 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008101 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
8102 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8103
8104 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008105 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008106 -------------------------------------------------------------------------*/
8107 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8108 ( NULL == pEventData->pCBfnc ))
8109 {
8110 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8111 "%s: Invalid parameters", __FUNCTION__);
8112 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008113 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008114 }
8115
8116 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
8117 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
8118 /*-------------------------------------------------------------------------
8119 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008120 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008121 -------------------------------------------------------------------------*/
8122 wpalMutexAcquire(&pWDICtx->wptMutex);
8123
8124 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008125 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07008126 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008127 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8128 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8129 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07008130
Jeff Johnsone7245742012-09-05 17:12:55 -07008131 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008132 {
8133 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008134 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
8135 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008136
8137 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008138 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008139 }
8140
8141 /*------------------------------------------------------------------------
8142 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008143 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008144 ------------------------------------------------------------------------*/
8145 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8146 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008147 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8148 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8149 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008150
Jeff Johnsone7245742012-09-05 17:12:55 -07008151 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008152 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008153 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008154 }
8155
8156
8157 wpalMutexRelease(&pWDICtx->wptMutex);
8158
8159 /*-----------------------------------------------------------------------
8160 Get message buffer
8161 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008162 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008163 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8164 &pSendBuffer, &usDataOffset, &usSendSize))||
8165 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8166 {
8167 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8168 "Unable to get send buffer in set bss key req %x %x %x",
8169 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8170 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008171 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008172 }
8173 /*-----------------------------------------------------------------------
8174 Copy the Key parameters into the HAL message
8175 -----------------------------------------------------------------------*/
8176 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8177
Jeff Johnsone7245742012-09-05 17:12:55 -07008178 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008179 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8180
8181 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8182
Jeff Johnsone7245742012-09-05 17:12:55 -07008183 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008184 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8185
Jeff Johnsone7245742012-09-05 17:12:55 -07008186 wpalMemoryCopy( pSendBuffer+usDataOffset,
8187 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8188 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008189
8190 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008191 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008192
8193 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008194 Send Remove BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008195 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008196 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008197 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008198 WDI_RMV_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008199}/*WDI_ProcessRemoveBssKeyReq*/
8200
8201/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008202 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008203 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008204
8205 @param pWDICtx: pointer to the WLAN DAL context
8206 pEventData: pointer to the event information structure
8207
Jeff Johnson295189b2012-06-20 16:38:30 -07008208 @see
8209 @return Result of the function call
8210*/
8211WDI_Status
8212WDI_ProcessSetStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008213(
Jeff Johnson295189b2012-06-20 16:38:30 -07008214 WDI_ControlBlockType* pWDICtx,
8215 WDI_EventInfoType* pEventData
8216)
8217{
8218 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8219 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8220 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008221 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008222 wpt_uint16 usDataOffset = 0;
8223 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008224 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008225 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008226 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008227 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8228 wpt_uint8 keyIndex = 0;
8229
8230 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8231
8232 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008233 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008234 -------------------------------------------------------------------------*/
8235 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8236 ( NULL == pEventData->pCBfnc ))
8237 {
8238 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8239 "%s: Invalid parameters", __FUNCTION__);
8240 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008241 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008242 }
8243
8244 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8245 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8246 /*-------------------------------------------------------------------------
8247 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008248 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008249 -------------------------------------------------------------------------*/
8250 wpalMutexAcquire(&pWDICtx->wptMutex);
8251
8252 /*------------------------------------------------------------------------
8253 Find the BSS for which the request is made and identify WDI session
8254 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008255 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8256 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008257 &macBSSID))
8258 {
8259 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8260 "This station does not exist in the WDI Station Table %d");
8261 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008262 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008263 }
8264
Jeff Johnsone7245742012-09-05 17:12:55 -07008265 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8266 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008267 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008268 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8269 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8270 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008271
8272 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008273 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008274 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008275
Jeff Johnson295189b2012-06-20 16:38:30 -07008276 /*------------------------------------------------------------------------
8277 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008278 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008279 ------------------------------------------------------------------------*/
8280 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8281 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008282 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8283 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8284 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008285
Jeff Johnsone7245742012-09-05 17:12:55 -07008286 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008287 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008288 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008289 }
8290
8291
8292 wpalMutexRelease(&pWDICtx->wptMutex);
8293 /*-----------------------------------------------------------------------
8294 Get message buffer
8295 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008296 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008297 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8298 &pSendBuffer, &usDataOffset, &usSendSize))||
8299 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8300 {
8301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8302 "Unable to get send buffer in set bss key req %x %x %x",
8303 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8304 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008305 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008306 }
8307 /*-----------------------------------------------------------------------
8308 Copy the STA Key parameters into the HAL message
8309 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008310 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008311 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8312
Jeff Johnsone7245742012-09-05 17:12:55 -07008313 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008314 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8315
8316 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8317
8318 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8319
8320 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8321
8322#ifdef WLAN_SOFTAP_FEATURE
8323 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8324 keyIndex++)
8325 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008326 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008327 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8328 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8329 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8330 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8331 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8332 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008333 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008334 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008335 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008336 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008337 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008338 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8339 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008340 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008341 WDI_MAX_KEY_LENGTH);
8342 }
8343#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008344 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008345 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8346 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8347 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8348 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8349 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8350 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008351 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008352 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008353 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008354 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008355 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008356 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8357 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008358 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008359 WDI_MAX_KEY_LENGTH);
8360#endif
8361
Jeff Johnsone7245742012-09-05 17:12:55 -07008362 wpalMemoryCopy( pSendBuffer+usDataOffset,
8363 &halSetStaKeyReqMsg.setStaKeyParams,
8364 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008365
8366 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008367 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008368
8369 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008370 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008371 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008372 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8373 wdiSetSTAKeyRspCb, pEventData->pUserData,
8374 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008375
8376}/*WDI_ProcessSetSTAKeyReq*/
8377
8378/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008379 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008380 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008381
8382 @param pWDICtx: pointer to the WLAN DAL context
8383 pEventData: pointer to the event information structure
8384
Jeff Johnson295189b2012-06-20 16:38:30 -07008385 @see
8386 @return Result of the function call
8387*/
8388WDI_Status
8389WDI_ProcessRemoveStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008390(
Jeff Johnson295189b2012-06-20 16:38:30 -07008391 WDI_ControlBlockType* pWDICtx,
8392 WDI_EventInfoType* pEventData
8393)
8394{
8395 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8396 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8397 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008398 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008399 wpt_uint16 usDataOffset = 0;
8400 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008401 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008402 wpt_macAddr macBSSID;
8403 wpt_uint8 ucCurrentBSSSesIdx;
8404 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8405 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8406
8407 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008408 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008409 -------------------------------------------------------------------------*/
8410 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8411 ( NULL == pEventData->pCBfnc ))
8412 {
8413 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8414 "%s: Invalid parameters", __FUNCTION__);
8415 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008416 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008417 }
8418
8419 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8420 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8421 /*-------------------------------------------------------------------------
8422 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008423 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008424 -------------------------------------------------------------------------*/
8425 wpalMutexAcquire(&pWDICtx->wptMutex);
8426
8427 /*------------------------------------------------------------------------
8428 Find the BSS for which the request is made and identify WDI session
8429 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008430 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8431 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008432 &macBSSID))
8433 {
8434 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8435 "This station does not exist in the WDI Station Table %d");
8436 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008437 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008438 }
8439
Jeff Johnsone7245742012-09-05 17:12:55 -07008440 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8441 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008442 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008443 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8444 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8445 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008446
8447 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008448 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008449 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008450
Jeff Johnson295189b2012-06-20 16:38:30 -07008451 /*------------------------------------------------------------------------
8452 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008453 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008454 ------------------------------------------------------------------------*/
8455 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8456 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8458 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8459 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008460
Jeff Johnsone7245742012-09-05 17:12:55 -07008461 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008462 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008463 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008464 }
8465
8466
8467
8468 wpalMutexRelease(&pWDICtx->wptMutex);
8469 /*-----------------------------------------------------------------------
8470 Get message buffer
8471 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008472 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008473 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8474 &pSendBuffer, &usDataOffset, &usSendSize))||
8475 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8476 {
8477 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8478 "Unable to get send buffer in set bss key req %x %x %x",
8479 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8480 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008481 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008482 }
8483
8484 /*-----------------------------------------------------------------------
8485 Copy the Key parameters into the HAL message
8486 -----------------------------------------------------------------------*/
8487
Jeff Johnsone7245742012-09-05 17:12:55 -07008488 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008489 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8490
Jeff Johnsone7245742012-09-05 17:12:55 -07008491 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008492 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8493
Jeff Johnsone7245742012-09-05 17:12:55 -07008494 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008495 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8496
Jeff Johnsone7245742012-09-05 17:12:55 -07008497 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008498 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8499
Jeff Johnsone7245742012-09-05 17:12:55 -07008500 wpalMemoryCopy( pSendBuffer+usDataOffset,
8501 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8502 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008503
8504 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008505 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008506
8507 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008508 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008509 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008510 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008511 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008512 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008513
8514}/*WDI_ProcessRemoveSTAKeyReq*/
8515
8516/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008517 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008518 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008519
8520 @param pWDICtx: pointer to the WLAN DAL context
8521 pEventData: pointer to the event information structure
8522
Jeff Johnson295189b2012-06-20 16:38:30 -07008523 @see
8524 @return Result of the function call
8525*/
8526WDI_Status
8527WDI_ProcessSetStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008528(
Jeff Johnson295189b2012-06-20 16:38:30 -07008529 WDI_ControlBlockType* pWDICtx,
8530 WDI_EventInfoType* pEventData
8531)
8532{
8533 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8534 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8535 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008536 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008537 wpt_uint16 usDataOffset = 0;
8538 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008539 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008540 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008541 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008542 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8543 wpt_uint8 keyIndex = 0;
8544
8545 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8546
8547 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008548 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008549 -------------------------------------------------------------------------*/
8550 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8551 ( NULL == pEventData->pCBfnc ))
8552 {
8553 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8554 "%s: Invalid parameters", __FUNCTION__);
8555 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008556 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008557 }
8558
8559 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8560 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8561 /*-------------------------------------------------------------------------
8562 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008563 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008564 -------------------------------------------------------------------------*/
8565 wpalMutexAcquire(&pWDICtx->wptMutex);
8566
8567 /*------------------------------------------------------------------------
8568 Find the BSS for which the request is made and identify WDI session
8569 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008570 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8571 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008572 &macBSSID))
8573 {
8574 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8575 "This station does not exist in the WDI Station Table %d");
8576 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008577 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008578 }
8579
Jeff Johnsone7245742012-09-05 17:12:55 -07008580 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8581 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008582 {
8583 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008584 "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8585 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008586
8587 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008588 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008589 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008590
Jeff Johnson295189b2012-06-20 16:38:30 -07008591 /*------------------------------------------------------------------------
8592 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008593 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008594 ------------------------------------------------------------------------*/
8595 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8596 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008597 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8598 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8599 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008600
Jeff Johnsone7245742012-09-05 17:12:55 -07008601 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008602 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008603 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008604 }
8605
8606
8607 wpalMutexRelease(&pWDICtx->wptMutex);
8608 /*-----------------------------------------------------------------------
8609 Get message buffer
8610 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008611 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008612 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8613 &pSendBuffer, &usDataOffset, &usSendSize))||
8614 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8615 {
8616 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8617 "Unable to get send buffer in set bss key req %x %x %x",
8618 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8619 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008620 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008621 }
8622 /*-----------------------------------------------------------------------
8623 Copy the STA Key parameters into the HAL message
8624 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008625 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008626 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8627
Jeff Johnsone7245742012-09-05 17:12:55 -07008628 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008629 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8630
8631 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8632
8633 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8634
8635 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8636
8637#ifdef WLAN_SOFTAP_FEATURE
8638 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8639 keyIndex++)
8640 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008641 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008642 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8643 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8644 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8645 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8646 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8647 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008648 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008649 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008650 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008651 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008652 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008653 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8654 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008655 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008656 WDI_MAX_KEY_LENGTH);
8657 }
8658#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008659 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008660 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8661 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8662 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8663 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8664 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8665 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008666 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008667 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008668 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008669 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008670 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008671 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8672 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008673 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008674 WDI_MAX_KEY_LENGTH);
8675#endif
8676
Jeff Johnsone7245742012-09-05 17:12:55 -07008677 wpalMemoryCopy( pSendBuffer+usDataOffset,
8678 &halSetStaKeyReqMsg.setStaKeyParams,
8679 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008680
8681 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008682 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008683
8684 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008685 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008686 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008687 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8688 wdiSetSTAKeyRspCb, pEventData->pUserData,
8689 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008690
8691}/*WDI_ProcessSetSTABcastKeyReq*/
8692
8693/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008694 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008695 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008696
8697 @param pWDICtx: pointer to the WLAN DAL context
8698 pEventData: pointer to the event information structure
8699
Jeff Johnson295189b2012-06-20 16:38:30 -07008700 @see
8701 @return Result of the function call
8702*/
8703WDI_Status
8704WDI_ProcessRemoveStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008705(
Jeff Johnson295189b2012-06-20 16:38:30 -07008706 WDI_ControlBlockType* pWDICtx,
8707 WDI_EventInfoType* pEventData
8708)
8709{
8710 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8711 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8712 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008713 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008714 wpt_uint16 usDataOffset = 0;
8715 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008716 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008717 wpt_macAddr macBSSID;
8718 wpt_uint8 ucCurrentBSSSesIdx;
8719 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8720 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8721
8722 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008723 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008724 -------------------------------------------------------------------------*/
8725 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8726 ( NULL == pEventData->pCBfnc ))
8727 {
8728 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8729 "%s: Invalid parameters", __FUNCTION__);
8730 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008731 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008732 }
8733
8734 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8735 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8736 /*-------------------------------------------------------------------------
8737 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008738 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008739 -------------------------------------------------------------------------*/
8740 wpalMutexAcquire(&pWDICtx->wptMutex);
8741
8742 /*------------------------------------------------------------------------
8743 Find the BSS for which the request is made and identify WDI session
8744 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008745 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8746 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008747 &macBSSID))
8748 {
8749 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8750 "This station does not exist in the WDI Station Table %d");
8751 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008752 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008753 }
8754
Jeff Johnsone7245742012-09-05 17:12:55 -07008755 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8756 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008757 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008758 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8759 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8760 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008761
8762 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008763 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008764 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008765
Jeff Johnson295189b2012-06-20 16:38:30 -07008766 /*------------------------------------------------------------------------
8767 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008768 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008769 ------------------------------------------------------------------------*/
8770 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8771 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008772 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8773 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8774 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008775
Jeff Johnsone7245742012-09-05 17:12:55 -07008776 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008777 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008778 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008779 }
8780
8781
8782
8783 wpalMutexRelease(&pWDICtx->wptMutex);
8784 /*-----------------------------------------------------------------------
8785 Get message buffer
8786 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008787 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008788 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8789 &pSendBuffer, &usDataOffset, &usSendSize))||
8790 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8791 {
8792 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8793 "Unable to get send buffer in set bss key req %x %x %x",
8794 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8795 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008796 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008797 }
8798
8799 /*-----------------------------------------------------------------------
8800 Copy the Key parameters into the HAL message
8801 -----------------------------------------------------------------------*/
8802
Jeff Johnsone7245742012-09-05 17:12:55 -07008803 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008804 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8805
Jeff Johnsone7245742012-09-05 17:12:55 -07008806 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008807 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8808
Jeff Johnsone7245742012-09-05 17:12:55 -07008809 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008810 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8811
Jeff Johnsone7245742012-09-05 17:12:55 -07008812 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008813 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8814
Jeff Johnsone7245742012-09-05 17:12:55 -07008815 wpalMemoryCopy( pSendBuffer+usDataOffset,
8816 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8817 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008818
8819 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008820 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008821
8822 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008823 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008824 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008825 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008826 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008827 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008828
8829}/*WDI_ProcessRemoveSTABcastKeyReq*/
8830
8831/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07008832 QOS and BA PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07008833==========================================================================*/
8834/**
8835 @brief Process Add TSpec Request function (called when Main FSM
8836 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008837
8838 @param pWDICtx: pointer to the WLAN DAL context
8839 pEventData: pointer to the event information structure
8840
Jeff Johnson295189b2012-06-20 16:38:30 -07008841 @see
8842 @return Result of the function call
8843*/
8844WDI_Status
8845WDI_ProcessAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008846(
Jeff Johnson295189b2012-06-20 16:38:30 -07008847 WDI_ControlBlockType* pWDICtx,
8848 WDI_EventInfoType* pEventData
8849)
8850{
8851 WDI_AddTSReqParamsType* pwdiAddTSParams;
8852 WDI_AddTsRspCb wdiAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008853 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008854 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008855 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008856 wpt_uint16 usDataOffset = 0;
8857 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008858 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008859 wpt_macAddr macBSSID;
8860 tAddTsParams halAddTsParams = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -07008861
Jeff Johnson295189b2012-06-20 16:38:30 -07008862 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8863
8864 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008865 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008866 -------------------------------------------------------------------------*/
8867 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8868 ( NULL == pEventData->pCBfnc ))
8869 {
8870 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8871 "%s: Invalid parameters", __FUNCTION__);
8872 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008873 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008874 }
8875
8876 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8877 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8878 /*-------------------------------------------------------------------------
8879 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008880 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008881 -------------------------------------------------------------------------*/
8882 wpalMutexAcquire(&pWDICtx->wptMutex);
8883
8884 /*------------------------------------------------------------------------
8885 Find the BSS for which the request is made and identify WDI session
8886 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008887 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8888 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008889 &macBSSID))
8890 {
8891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8892 "This station does not exist in the WDI Station Table %d");
8893 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008894 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008895 }
8896
Jeff Johnsone7245742012-09-05 17:12:55 -07008897 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8898 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008899 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008900 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8901 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8902 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008903
8904 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008905 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008906 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008907
Jeff Johnson295189b2012-06-20 16:38:30 -07008908 /*------------------------------------------------------------------------
8909 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008910 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008911 ------------------------------------------------------------------------*/
8912 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8913 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008914 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8915 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8916 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008917
Jeff Johnsone7245742012-09-05 17:12:55 -07008918 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008919 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008920 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008921 }
8922
8923 wpalMutexRelease(&pWDICtx->wptMutex);
8924 /*-----------------------------------------------------------------------
8925 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07008926 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07008927 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008928 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8929 sizeof(halAddTsParams),
8930 &pSendBuffer, &usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07008931 &usSendSize))||
8932 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8933 {
8934 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8935 "Unable to get send buffer in set bss key req %x %x %x",
8936 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8937 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008938 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008939 }
8940
8941 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8942 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8943
8944 //TSPEC IE
8945 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8946 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -07008947 halAddTsParams.tspec.nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008948 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008949 halAddTsParams.tspec.maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008950 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008951 halAddTsParams.tspec.minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008952 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008953 halAddTsParams.tspec.maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008954 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008955 halAddTsParams.tspec.inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008956 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008957 halAddTsParams.tspec.suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008958 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008959 halAddTsParams.tspec.svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008960 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -07008961 halAddTsParams.tspec.minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008962 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008963 halAddTsParams.tspec.meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008964 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008965 halAddTsParams.tspec.peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008966 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008967 halAddTsParams.tspec.maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008968 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008969 halAddTsParams.tspec.delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -07008970 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -07008971 halAddTsParams.tspec.minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008972 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008973 halAddTsParams.tspec.surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -07008974 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -07008975 halAddTsParams.tspec.mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008976 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8977
8978 //TSPEC IE : TS INFO : TRAFFIC
Jeff Johnsone7245742012-09-05 17:12:55 -07008979 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -07008980 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -07008981 halAddTsParams.tspec.tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -07008982 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -07008983 halAddTsParams.tspec.tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -07008984 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008985 halAddTsParams.tspec.tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -07008986 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -07008987 halAddTsParams.tspec.tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -07008988 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
Jeff Johnsone7245742012-09-05 17:12:55 -07008989 halAddTsParams.tspec.tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -07008990 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
Jeff Johnsone7245742012-09-05 17:12:55 -07008991 halAddTsParams.tspec.tsinfo.traffic.trafficType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008992 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
8993
8994 //TSPEC IE : TS INFO : SCHEDULE
Jeff Johnsone7245742012-09-05 17:12:55 -07008995 halAddTsParams.tspec.tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -07008996 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -07008997 halAddTsParams.tspec.tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -07008998 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
8999
Jeff Johnsone7245742012-09-05 17:12:55 -07009000 wpalMemoryCopy( pSendBuffer+usDataOffset,
9001 &halAddTsParams,
9002 sizeof(halAddTsParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009003
9004 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009005 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009006
9007 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009008 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009009 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009010 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07009011 wdiAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07009012 WDI_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009013}/*WDI_ProcessAddTSpecReq*/
9014
9015
9016/**
9017 @brief Process Del TSpec Request function (called when Main FSM
9018 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009019
9020 @param pWDICtx: pointer to the WLAN DAL context
9021 pEventData: pointer to the event information structure
9022
Jeff Johnson295189b2012-06-20 16:38:30 -07009023 @see
9024 @return Result of the function call
9025*/
9026WDI_Status
9027WDI_ProcessDelTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009028(
Jeff Johnson295189b2012-06-20 16:38:30 -07009029 WDI_ControlBlockType* pWDICtx,
9030 WDI_EventInfoType* pEventData
9031)
9032{
9033 WDI_DelTSReqParamsType* pwdiDelTSParams;
9034 WDI_DelTsRspCb wdiDelTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009035 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009036 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009037 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009038 wpt_uint16 usDataOffset = 0;
9039 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009040 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009041 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9042
9043 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009044 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009045 -------------------------------------------------------------------------*/
9046 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9047 ( NULL == pEventData->pCBfnc ))
9048 {
9049 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9050 "%s: Invalid parameters", __FUNCTION__);
9051 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009052 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009053 }
9054
9055 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
9056 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
9057
9058 /*-------------------------------------------------------------------------
9059 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009060 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009061 -------------------------------------------------------------------------*/
9062 wpalMutexAcquire(&pWDICtx->wptMutex);
9063
9064 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009065 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009066 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009067 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
9068 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
9069 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009070
Jeff Johnsone7245742012-09-05 17:12:55 -07009071 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009072 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009073 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9074 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9075 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
9076
Jeff Johnson295189b2012-06-20 16:38:30 -07009077 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009078 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009079 }
9080
9081 /*------------------------------------------------------------------------
9082 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009083 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009084 ------------------------------------------------------------------------*/
9085 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9086 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009087 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9088 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9089 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009090
Jeff Johnsone7245742012-09-05 17:12:55 -07009091 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009092 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009093 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009094 }
9095
9096
9097 wpalMutexRelease(&pWDICtx->wptMutex);
9098 /*-----------------------------------------------------------------------
9099 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009100 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009101 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009102 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009103 sizeof(pwdiDelTSParams->wdiDelTSInfo),
9104 &pSendBuffer, &usDataOffset, &usSendSize))||
9105 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
9106 {
9107 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9108 "Unable to get send buffer in set bss key req %x %x %x",
9109 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
9110 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009111 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009112 }
9113
Jeff Johnsone7245742012-09-05 17:12:55 -07009114 wpalMemoryCopy( pSendBuffer+usDataOffset,
9115 &pwdiDelTSParams->wdiDelTSInfo,
9116 sizeof(pwdiDelTSParams->wdiDelTSInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009117
9118 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009119 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009120
9121 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009122 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009123 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009124 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9125 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009126}/*WDI_ProcessDelTSpecReq*/
9127
9128/**
9129 @brief Process Update EDCA Params Request function (called when
9130 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009131
9132 @param pWDICtx: pointer to the WLAN DAL context
9133 pEventData: pointer to the event information structure
9134
Jeff Johnson295189b2012-06-20 16:38:30 -07009135 @see
9136 @return Result of the function call
9137*/
9138WDI_Status
9139WDI_ProcessUpdateEDCAParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009140(
Jeff Johnson295189b2012-06-20 16:38:30 -07009141 WDI_ControlBlockType* pWDICtx,
9142 WDI_EventInfoType* pEventData
9143)
9144{
9145 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9146 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009147 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009148 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009149 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009150 wpt_uint16 usDataOffset = 0;
9151 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009152 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009153 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9154
9155 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009156 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009157 -------------------------------------------------------------------------*/
9158 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9159 ( NULL == pEventData->pCBfnc ))
9160 {
9161 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9162 "%s: Invalid parameters", __FUNCTION__);
9163 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009164 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009165 }
9166
9167 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9168 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9169 /*-------------------------------------------------------------------------
9170 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009171 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009172 -------------------------------------------------------------------------*/
9173 wpalMutexAcquire(&pWDICtx->wptMutex);
9174
9175 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009176 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009177 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009178 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9179 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9180 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009181
Jeff Johnsone7245742012-09-05 17:12:55 -07009182 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009183 {
9184 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07009185 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
9186 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009187
9188 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009189 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009190 }
9191
9192 /*------------------------------------------------------------------------
9193 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009194 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009195 ------------------------------------------------------------------------*/
9196 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9197 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009198 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9199 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
9200 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009201
Jeff Johnsone7245742012-09-05 17:12:55 -07009202 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009203 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009204 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009205 }
9206
9207
9208 wpalMutexRelease(&pWDICtx->wptMutex);
9209 /*-----------------------------------------------------------------------
9210 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009211 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009212 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009213 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009214 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9215 &pSendBuffer, &usDataOffset, &usSendSize))||
9216 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9217 {
9218 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9219 "Unable to get send buffer in set bss key req %x %x %x",
9220 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9221 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009222 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009223 }
9224
Jeff Johnsone7245742012-09-05 17:12:55 -07009225 wpalMemoryCopy( pSendBuffer+usDataOffset,
9226 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9227 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009228
9229 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009230 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009231
9232 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009233 Send Update EDCA Params Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009234 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009235 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9236 wdiUpdateEDCARspCb, pEventData->pUserData,
9237 WDI_UPD_EDCA_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009238}/*WDI_ProcessUpdateEDCAParamsReq*/
9239
9240/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009241 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009242 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009243
9244 @param pWDICtx: pointer to the WLAN DAL context
9245 pEventData: pointer to the event information structure
9246
Jeff Johnson295189b2012-06-20 16:38:30 -07009247 @see
9248 @return Result of the function call
9249*/
9250WDI_Status
9251WDI_ProcessAddBASessionReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009252(
Jeff Johnson295189b2012-06-20 16:38:30 -07009253 WDI_ControlBlockType* pWDICtx,
9254 WDI_EventInfoType* pEventData
9255)
9256{
9257 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9258 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009259 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009260 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009261 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009262 wpt_uint16 usDataOffset = 0;
9263 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009264 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009265 wpt_macAddr macBSSID;
9266
9267 tAddBASessionReqMsg halAddBASessionReq;
9268 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9269
9270 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009271 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009272 -------------------------------------------------------------------------*/
9273 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9274 ( NULL == pEventData->pCBfnc ))
9275 {
9276 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9277 "%s: Invalid parameters", __FUNCTION__);
9278 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009279 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009280 }
9281
Jeff Johnsone7245742012-09-05 17:12:55 -07009282 pwdiAddBASessionParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009283 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009284 wdiAddBASessionRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009285 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9286 /*-------------------------------------------------------------------------
9287 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009288 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009289 -------------------------------------------------------------------------*/
9290 wpalMutexAcquire(&pWDICtx->wptMutex);
9291
9292 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009293 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009294 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009295 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9296 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009297 &macBSSID))
9298 {
9299 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9300 "This station does not exist in the WDI Station Table %d");
9301 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009302 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009303 }
9304
9305
Jeff Johnsone7245742012-09-05 17:12:55 -07009306 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009307
Jeff Johnsone7245742012-09-05 17:12:55 -07009308 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009309 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009310 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9311 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9312 __func__, MAC_ADDR_ARRAY(macBSSID));
9313
Jeff Johnson295189b2012-06-20 16:38:30 -07009314 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009315 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009316 }
9317
9318 /*------------------------------------------------------------------------
9319 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009320 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009321 ------------------------------------------------------------------------*/
9322 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9323 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009324 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9325 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9326 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009327
Jeff Johnsone7245742012-09-05 17:12:55 -07009328 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009329 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009330 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009331 }
9332
9333
9334 wpalMutexRelease(&pWDICtx->wptMutex);
9335 /*-----------------------------------------------------------------------
9336 Get message buffer
9337 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009338 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9339 WDI_ADD_BA_SESSION_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009340 sizeof(halAddBASessionReq.addBASessionParams),
9341 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009342 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009343 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9344 {
9345 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9346 "Unable to get send buffer in Add BA session req %x %x %x",
9347 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9348 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009349 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009350 }
9351
9352 halAddBASessionReq.addBASessionParams.staIdx =
9353 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9354 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9355 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9356 WDI_MAC_ADDR_LEN);
9357 halAddBASessionReq.addBASessionParams.baTID =
9358 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9359 halAddBASessionReq.addBASessionParams.baPolicy =
9360 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9361 halAddBASessionReq.addBASessionParams.baBufferSize =
9362 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9363 halAddBASessionReq.addBASessionParams.baTimeout =
9364 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9365 halAddBASessionReq.addBASessionParams.baSSN =
9366 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9367 halAddBASessionReq.addBASessionParams.baDirection =
9368 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9369
Jeff Johnsone7245742012-09-05 17:12:55 -07009370 wpalMemoryCopy( pSendBuffer+usDataOffset,
9371 &halAddBASessionReq.addBASessionParams,
9372 sizeof(halAddBASessionReq.addBASessionParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009373
9374 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009375 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009376
9377 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009378 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009379 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009380 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9381 wdiAddBASessionRspCb, pEventData->pUserData,
9382 WDI_ADD_BA_SESSION_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009383}/*WDI_ProcessAddBASessionReq*/
9384
9385/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009386 @brief Process Del BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009387 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009388
9389 @param pWDICtx: pointer to the WLAN DAL context
9390 pEventData: pointer to the event information structure
9391
Jeff Johnson295189b2012-06-20 16:38:30 -07009392 @see
9393 @return Result of the function call
9394*/
9395WDI_Status
9396WDI_ProcessDelBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009397(
Jeff Johnson295189b2012-06-20 16:38:30 -07009398 WDI_ControlBlockType* pWDICtx,
9399 WDI_EventInfoType* pEventData
9400)
9401{
9402 WDI_DelBAReqParamsType* pwdiDelBAParams;
9403 WDI_DelBARspCb wdiDelBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009404 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009405 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009406 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009407 wpt_uint16 usDataOffset = 0;
9408 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009409 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009410 wpt_macAddr macBSSID;
9411 tDelBAParams halDelBAparam;
9412 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9413
9414 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009415 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009416 -------------------------------------------------------------------------*/
9417 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9418 ( NULL == pEventData->pCBfnc ))
9419 {
9420 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9421 "%s: Invalid parameters", __FUNCTION__);
9422 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009423 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009424 }
9425
9426 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9427 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9428 /*-------------------------------------------------------------------------
9429 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009430 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009431 -------------------------------------------------------------------------*/
9432 wpalMutexAcquire(&pWDICtx->wptMutex);
9433
9434 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009435 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009436 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009437 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9438 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009439 &macBSSID))
9440 {
9441 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9442 "This station does not exist in the WDI Station Table %d");
9443 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009444 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009445 }
9446
Jeff Johnsone7245742012-09-05 17:12:55 -07009447 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009448
Jeff Johnsone7245742012-09-05 17:12:55 -07009449 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009450 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9452 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9453 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009454
9455 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009456 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009457 }
9458
9459 /*------------------------------------------------------------------------
9460 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009461 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009462 ------------------------------------------------------------------------*/
9463 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9464 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009465 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9466 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9467 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009468
Jeff Johnsone7245742012-09-05 17:12:55 -07009469 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009470 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009471 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009472 }
9473
9474 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009475 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009476 sizeof(halDelBAparam),
9477 &pSendBuffer, &usDataOffset, &usSendSize))||
9478 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9479 {
9480 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9481 "Unable to get send buffer for DEL BA req %x %x %x",
9482 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9483 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009484 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009485 }
9486
9487 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9488 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9489 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9490
Jeff Johnsone7245742012-09-05 17:12:55 -07009491 wpalMemoryCopy( pSendBuffer+usDataOffset,
9492 &halDelBAparam,
9493 sizeof(halDelBAparam));
Jeff Johnson295189b2012-06-20 16:38:30 -07009494
9495 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009496 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009497
9498 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009499 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009500 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009501 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9502 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009503}/*WDI_ProcessDelBAReq*/
9504
9505#ifdef FEATURE_WLAN_CCX
9506
9507WDI_Status
9508WDI_ProcessTSMStatsReq
9509(
9510 WDI_ControlBlockType* pWDICtx,
9511 WDI_EventInfoType* pEventData
9512)
9513{
9514 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9515 WDI_TsmRspCb wdiTSMRspCb;
9516 wpt_uint8 ucCurrentBSSSesIdx = 0;
9517 WDI_BSSSessionType* pBSSSes = NULL;
9518 wpt_uint8* pSendBuffer = NULL;
9519 wpt_uint16 usDataOffset = 0;
9520 wpt_uint16 usSendSize = 0;
9521 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9522 tTsmStatsParams halTsmStatsReqParams = {0};
9523
9524 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9525
9526 /*-------------------------------------------------------------------------
9527 Sanity check
9528 -------------------------------------------------------------------------*/
9529 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9530 ( NULL == pEventData->pCBfnc ))
9531 {
9532 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9533 "%s: Invalid parameters", __FUNCTION__);
9534 WDI_ASSERT(0);
9535 return WDI_STATUS_E_FAILURE;
9536 }
9537
9538 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9539 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9540 /*-------------------------------------------------------------------------
9541 Check to see if we are in the middle of an association, if so queue, if
9542 not it means it is free to process request
9543 -------------------------------------------------------------------------*/
9544 wpalMutexAcquire(&pWDICtx->wptMutex);
9545
9546 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9547 if ( NULL == pBSSSes )
9548 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009549 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9550 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9551 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009552
9553 wpalMutexRelease(&pWDICtx->wptMutex);
9554 return WDI_STATUS_E_NOT_ALLOWED;
9555 }
9556
9557 /*------------------------------------------------------------------------
9558 Check if this BSS is being currently processed or queued,
9559 if queued - queue the new request as well
9560 ------------------------------------------------------------------------*/
9561 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9562 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009563 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9564 "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9565 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009566
9567 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9568 wpalMutexRelease(&pWDICtx->wptMutex);
9569 return wdiStatus;
9570 }
9571
9572 wpalMutexRelease(&pWDICtx->wptMutex);
9573 /*-----------------------------------------------------------------------
9574 Get message buffer
9575 ! TO DO : proper conversion into the HAL Message Request Format
9576 -----------------------------------------------------------------------*/
9577 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9578 sizeof(halTsmStatsReqParams),
9579 &pSendBuffer, &usDataOffset, &usSendSize))||
9580 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9581 {
9582 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9583 "Unable to get send buffer in set bss key req %x %x %x",
9584 pEventData, pwdiTSMParams, wdiTSMRspCb);
9585 WDI_ASSERT(0);
9586 return WDI_STATUS_E_FAILURE;
9587 }
9588
9589 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9590 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9591 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9592 WDI_MAC_ADDR_LEN);
9593 wpalMemoryCopy( pSendBuffer+usDataOffset,
9594 &halTsmStatsReqParams,
9595 sizeof(halTsmStatsReqParams));
9596
9597 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9598 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9599
9600 /*-------------------------------------------------------------------------
9601 Send TSM Stats Request to HAL
9602 -------------------------------------------------------------------------*/
9603 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9604 wdiTSMRspCb, pEventData->pUserData,
9605 WDI_TSM_STATS_RESP);
9606}/*WDI_ProcessTSMStatsReq*/
9607
9608#endif
9609
9610
9611/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009612 @brief Process Flush AC Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009613 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009614
9615 @param pWDICtx: pointer to the WLAN DAL context
9616 pEventData: pointer to the event information structure
9617
Jeff Johnson295189b2012-06-20 16:38:30 -07009618 @see
9619 @return Result of the function call
9620*/
9621WDI_Status
9622WDI_ProcessFlushAcReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009623(
Jeff Johnson295189b2012-06-20 16:38:30 -07009624 WDI_ControlBlockType* pWDICtx,
9625 WDI_EventInfoType* pEventData
9626)
9627{
9628 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9629 WDI_FlushAcRspCb wdiFlushAcRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009630 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009631 wpt_uint16 usDataOffset = 0;
9632 wpt_uint16 usSendSize = 0;
9633 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9634
9635 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009636 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009637 -------------------------------------------------------------------------*/
9638 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9639 ( NULL == pEventData->pCBfnc ))
9640 {
9641 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9642 "%s: Invalid parameters", __FUNCTION__);
9643 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009644 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009645 }
9646
9647 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9648 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9649 /*-----------------------------------------------------------------------
9650 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009651 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009652 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009653 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009654 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9655 &pSendBuffer, &usDataOffset, &usSendSize))||
9656 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9657 {
9658 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9659 "Unable to get send buffer in set bss key req %x %x %x",
9660 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9661 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009662 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009663 }
9664
Jeff Johnsone7245742012-09-05 17:12:55 -07009665 wpalMemoryCopy( pSendBuffer+usDataOffset,
9666 &pwdiFlushAcParams->wdiFlushAcInfo,
9667 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009668
9669 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009670 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009671
9672 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009673 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009674 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009675 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9676 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009677}/*WDI_ProcessFlushAcReq*/
9678
9679/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009680 @brief Process BT AMP event Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009681 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009682
9683 @param pWDICtx: pointer to the WLAN DAL context
9684 pEventData: pointer to the event information structure
9685
Jeff Johnson295189b2012-06-20 16:38:30 -07009686 @see
9687 @return Result of the function call
9688*/
9689WDI_Status
9690WDI_ProcessBtAmpEventReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009691(
Jeff Johnson295189b2012-06-20 16:38:30 -07009692 WDI_ControlBlockType* pWDICtx,
9693 WDI_EventInfoType* pEventData
9694)
9695{
9696 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9697 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009698 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009699 wpt_uint16 usDataOffset = 0;
9700 wpt_uint16 usSendSize = 0;
9701
9702 tBtAmpEventMsg haltBtAmpEventMsg;
9703 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9704
9705 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009706 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009707 -------------------------------------------------------------------------*/
9708 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9709 ( NULL == pEventData->pCBfnc ))
9710 {
9711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9712 "%s: Invalid parameters", __FUNCTION__);
9713 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009714 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009715 }
9716
9717 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9718 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9719 /*-----------------------------------------------------------------------
9720 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009721 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009722 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009723 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009724 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9725 &pSendBuffer, &usDataOffset, &usSendSize))||
9726 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9727 {
9728 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9729 "Unable to get send buffer in BT AMP event req %x %x %x",
9730 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9731 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009732 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009733 }
9734
Jeff Johnsone7245742012-09-05 17:12:55 -07009735 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
Jeff Johnson295189b2012-06-20 16:38:30 -07009736 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
Jeff Johnsone7245742012-09-05 17:12:55 -07009737 wpalMemoryCopy( pSendBuffer+usDataOffset,
9738 &haltBtAmpEventMsg.btAmpEventParams,
9739 sizeof(haltBtAmpEventMsg.btAmpEventParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009740
9741 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009742 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009743
9744 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009745 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009746 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009747 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9748 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009749}/*WDI_ProcessBtAmpEventReq*/
9750
9751/**
9752 @brief Process Add STA self Request function (called when Main FSM
9753 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009754
9755 @param pWDICtx: pointer to the WLAN DAL context
9756 pEventData: pointer to the event information structure
9757
Jeff Johnson295189b2012-06-20 16:38:30 -07009758 @see
9759 @return Result of the function call
9760*/
9761WDI_Status
9762WDI_ProcessAddSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009763(
Jeff Johnson295189b2012-06-20 16:38:30 -07009764 WDI_ControlBlockType* pWDICtx,
9765 WDI_EventInfoType* pEventData
9766)
9767{
9768 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9769 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009770 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009771 wpt_uint16 usDataOffset = 0;
9772 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009773 tAddStaSelfParams halAddSTASelfParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07009774 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9775
9776 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009777 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009778 -------------------------------------------------------------------------*/
9779 if (( NULL == pEventData ) ||
9780 ( NULL == pEventData->pEventData) ||
9781 ( NULL == pEventData->pCBfnc))
9782 {
9783 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9784 "%s: Invalid parameters", __FUNCTION__);
9785 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009786 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009787 }
9788
Jeff Johnsone7245742012-09-05 17:12:55 -07009789 pwdiAddSTASelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009790 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009791 wdiAddSTASelfReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009792 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9793 /*-----------------------------------------------------------------------
9794 Get message buffer
9795 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009796 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9797 WDI_ADD_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009798 sizeof(tAddStaSelfParams),
9799 &pSendBuffer, &usDataOffset, &usSendSize))||
9800 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9801 {
9802 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9803 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9804 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9805 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009806 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009807 }
9808
9809 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07009810 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07009811 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9812
Jeff Johnsone7245742012-09-05 17:12:55 -07009813 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009814 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9815
Jeff Johnsone7245742012-09-05 17:12:55 -07009816 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9817 sizeof(tAddStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009818
9819 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009820 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009821
9822 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009823 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009824 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009825 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9826 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9827 WDI_ADD_STA_SELF_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009828}/*WDI_ProcessAddSTASelfReq*/
9829
9830
9831
9832/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009833 @brief Process Del Sta Self Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009834 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009835
9836 @param pWDICtx: pointer to the WLAN DAL context
9837 pEventData: pointer to the event information structure
9838
Jeff Johnson295189b2012-06-20 16:38:30 -07009839 @see
9840 @return Result of the function call
9841*/
9842WDI_Status
9843WDI_ProcessDelSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009844(
Jeff Johnson295189b2012-06-20 16:38:30 -07009845 WDI_ControlBlockType* pWDICtx,
9846 WDI_EventInfoType* pEventData
9847)
9848{
9849 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9850 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009851 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009852 wpt_uint16 usDataOffset = 0;
9853 wpt_uint16 usSendSize = 0;
9854 tDelStaSelfParams halSetDelSelfSTAParams;
9855 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9856
9857 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009858 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009859 -------------------------------------------------------------------------*/
9860 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9861 ( NULL == pEventData->pCBfnc ))
9862 {
9863 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9864 "%s: Invalid parameters", __FUNCTION__);
9865 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009866 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009867 }
9868
Jeff Johnsone7245742012-09-05 17:12:55 -07009869 pwdiDelStaSelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009870 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9871 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9872
9873 /*-----------------------------------------------------------------------
9874 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009875 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009876 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009877 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009878 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9879 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009880 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009881 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9882 {
9883 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9884 "Unable to get send buffer in Del Sta Self req %x %x %x",
9885 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009887 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009888 }
9889
Jeff Johnsone7245742012-09-05 17:12:55 -07009890 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009891 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9892
Jeff Johnsone7245742012-09-05 17:12:55 -07009893 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9894 sizeof(tDelStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009895
9896 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009897 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009898
9899 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009900 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009901 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009902 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9903 wdiDelStaSelfRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07009904 WDI_DEL_STA_SELF_RESP);
9905
9906}
9907
Jeff Johnsone7245742012-09-05 17:12:55 -07009908#ifdef FEATURE_OEM_DATA_SUPPORT
9909/**
9910 @brief Process Start Oem Data Request function (called when Main
9911 FSM allows it)
9912
9913 @param pWDICtx: pointer to the WLAN DAL context
9914 pEventData: pointer to the event information structure
9915
9916 @see
9917 @return Result of the function call
9918*/
9919WDI_Status
9920WDI_ProcessStartOemDataReq
9921(
9922 WDI_ControlBlockType* pWDICtx,
9923 WDI_EventInfoType* pEventData
9924)
9925{
9926 WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL;
9927 WDI_oemDataRspCb wdiOemDataRspCb;
9928 wpt_uint8* pSendBuffer = NULL;
9929 wpt_uint16 usDataOffset = 0;
9930 wpt_uint16 usSendSize = 0;
9931 wpt_uint16 reqLen;
9932 tStartOemDataReqParams* halStartOemDataReqParams;
9933
9934 /*-------------------------------------------------------------------------
9935 Sanity check
9936 -------------------------------------------------------------------------*/
9937 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9938 ( NULL == pEventData->pCBfnc ))
9939 {
9940 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9941 "%s: Invalid parameters", __FUNCTION__);
9942 WDI_ASSERT(0);
9943 return WDI_STATUS_E_FAILURE;
9944 }
9945
9946 pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData;
9947 wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc;
9948
9949 /*-----------------------------------------------------------------------
9950 Get message buffer
9951 -----------------------------------------------------------------------*/
9952
9953 reqLen = sizeof(tStartOemDataReqParams);
9954
9955 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9956 WDI_START_OEM_DATA_REQ, reqLen,
9957 &pSendBuffer, &usDataOffset, &usSendSize))||
9958 (usSendSize < (usDataOffset + reqLen)))
9959 {
9960 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9961 "Unable to get send buffer in Start Oem Data req %x %x %x",
9962 pEventData, pwdiOemDataReqParams, wdiOemDataRspCb);
9963 WDI_ASSERT(0);
9964 return WDI_STATUS_E_FAILURE;
9965 }
9966
9967 //copying WDI OEM DATA REQ PARAMS to shared memory
9968 halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset );
9969
9970 wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr));
9971 wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE);
9972
9973 pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB;
9974 pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData;
9975
9976 /*-------------------------------------------------------------------------
9977 Send Start Request to HAL
9978 -------------------------------------------------------------------------*/
9979 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9980 wdiOemDataRspCb, pEventData->pUserData,
9981 WDI_START_OEM_DATA_RESP);
9982}/*WDI_ProcessStartOemDataReq*/
9983#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07009984
9985/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009986 @brief Process Host Resume Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009987 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009988
9989 @param pWDICtx: pointer to the WLAN DAL context
9990 pEventData: pointer to the event information structure
9991
Jeff Johnson295189b2012-06-20 16:38:30 -07009992 @see
9993 @return Result of the function call
9994*/
9995WDI_Status
9996WDI_ProcessHostResumeReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009997(
Jeff Johnson295189b2012-06-20 16:38:30 -07009998 WDI_ControlBlockType* pWDICtx,
9999 WDI_EventInfoType* pEventData
10000)
10001{
10002 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
10003 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010004 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010005 wpt_uint16 usDataOffset = 0;
10006 wpt_uint16 usSendSize = 0;
10007 tHalWlanHostResumeReqParam halResumeReqParams;
10008
10009 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10010
10011 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010012 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010013 -------------------------------------------------------------------------*/
10014 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10015 ( NULL == pEventData->pCBfnc ))
10016 {
10017 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10018 "%s: Invalid parameters ",__FUNCTION__);
10019 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010020 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010021 }
10022
10023 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
10024 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
10025
10026 /*-----------------------------------------------------------------------
10027 Get message buffer
10028 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010029 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010030 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
10031 &pSendBuffer, &usDataOffset, &usSendSize))||
10032 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
10033 {
10034 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070010035 "Unable to get send buffer in Start Oem Data req %x %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070010036 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
10037 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010038 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010039 }
10040
Jeff Johnsone7245742012-09-05 17:12:55 -070010041 halResumeReqParams.configuredMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070010042 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070010043
10044 wpalMemoryCopy( pSendBuffer+usDataOffset,
10045 &halResumeReqParams,
10046 sizeof(halResumeReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010047
10048 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010049 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010050
10051 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010052 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010053 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010054 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10055 wdiHostResumeRspCb, pEventData->pUserData,
10056 WDI_HOST_RESUME_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010057}/*WDI_ProcessHostResumeReq*/
10058
10059/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010060 @brief Process set Tx Per Tracking Parameters Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070010061 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010062
10063 @param pWDICtx: pointer to the WLAN DAL context
10064 pEventData: pointer to the event information structure
10065
Jeff Johnson295189b2012-06-20 16:38:30 -070010066 @see
10067 @return Result of the function call
10068*/
10069WDI_Status
10070WDI_ProcessSetTxPerTrackingReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010071(
Jeff Johnson295189b2012-06-20 16:38:30 -070010072 WDI_ControlBlockType* pWDICtx,
10073 WDI_EventInfoType* pEventData
10074)
10075{
10076 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
10077 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010078 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010079 wpt_uint16 usDataOffset = 0;
10080 wpt_uint16 usSendSize = 0;
10081 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
10082 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10083
10084 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010085 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010086 -------------------------------------------------------------------------*/
10087 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10088 ( NULL == pEventData->pCBfnc ))
10089 {
10090 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10091 "%s: Invalid parameters ",__FUNCTION__);
10092 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010093 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010094 }
10095
10096 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
10097 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -070010098
Jeff Johnson295189b2012-06-20 16:38:30 -070010099 /*-----------------------------------------------------------------------
10100 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010101 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010102 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010103 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010104 sizeof(halTxPerTrackingReqParam),
10105 &pSendBuffer, &usDataOffset, &usSendSize))||
10106 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
10107 {
10108 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10109 "Unable to get send buffer in set tx per tracking req %x %x %x",
10110 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
10111 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010112 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010113 }
Jeff Johnsone7245742012-09-05 17:12:55 -070010114
Jeff Johnson295189b2012-06-20 16:38:30 -070010115 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
10116 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
10117 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
10118 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
Jeff Johnsone7245742012-09-05 17:12:55 -070010119
10120 wpalMemoryCopy( pSendBuffer+usDataOffset,
10121 &halTxPerTrackingReqParam,
10122 sizeof(halTxPerTrackingReqParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010123
10124 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010125 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010126
10127 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010128 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010129 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010130 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10131 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010132}/*WDI_ProcessSetTxPerTrackingReq*/
10133
10134/*=========================================================================
10135 Indications
10136=========================================================================*/
10137
10138/**
10139 @brief Process Suspend Indications function (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010140
10141 @param pWDICtx: pointer to the WLAN DAL context
10142 pEventData: pointer to the event information structure
10143
Jeff Johnson295189b2012-06-20 16:38:30 -070010144 @see
10145 @return Result of the function call
10146*/
10147WDI_Status
10148WDI_ProcessHostSuspendInd
Jeff Johnsone7245742012-09-05 17:12:55 -070010149(
Jeff Johnson295189b2012-06-20 16:38:30 -070010150 WDI_ControlBlockType* pWDICtx,
10151 WDI_EventInfoType* pEventData
10152)
10153{
10154 WDI_SuspendParamsType *pSuspendIndParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070010155 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010156 wpt_uint16 usDataOffset = 0;
10157 wpt_uint16 usSendSize = 0;
10158 WDI_Status wdiStatus;
10159 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
10160 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10161
10162 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010163 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010164 -------------------------------------------------------------------------*/
10165 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
10166 {
10167 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10168 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
10169 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010170 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010171 }
10172
10173 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
10174
10175 /*-----------------------------------------------------------------------
10176 Get message buffer
10177 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010178 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10179 WDI_HOST_SUSPEND_IND,
Jeff Johnson295189b2012-06-20 16:38:30 -070010180 sizeof(halWlanSuspendIndparams),
10181 &pSendBuffer, &usDataOffset, &usSendSize))||
10182 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
10183 {
10184 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10185 "Unable to get send buffer in Suspend Ind ");
10186 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010187 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010188 }
10189
10190 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
10191 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
10192
Jeff Johnsone7245742012-09-05 17:12:55 -070010193 halWlanSuspendIndparams.activeSessionCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070010194 WDI_GetActiveSessionsCount(pWDICtx);
10195
Jeff Johnsone7245742012-09-05 17:12:55 -070010196 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
10197 sizeof(tHalWlanHostSuspendIndParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010198
10199 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010200 Send Suspend Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010201 -------------------------------------------------------------------------*/
10202 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010203 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010204
Jeff Johnsone7245742012-09-05 17:12:55 -070010205 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070010206 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
10207}/*WDI_ProcessHostSuspendInd*/
10208
10209/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070010210 MISC CONTROL PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -070010211==========================================================================*/
10212/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010213 @brief Process Channel Switch Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010214 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010215
10216 @param pWDICtx: pointer to the WLAN DAL context
10217 pEventData: pointer to the event information structure
10218
Jeff Johnson295189b2012-06-20 16:38:30 -070010219 @see
10220 @return Result of the function call
10221*/
10222WDI_Status
10223WDI_ProcessChannelSwitchReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010224(
Jeff Johnson295189b2012-06-20 16:38:30 -070010225 WDI_ControlBlockType* pWDICtx,
10226 WDI_EventInfoType* pEventData
10227)
10228{
10229 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10230 WDI_SwitchChRspCb wdiSwitchChRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010231 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010232 wpt_uint16 usDataOffset = 0;
10233 wpt_uint16 usSendSize = 0;
10234 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10235 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10236
10237 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010238 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010239 -------------------------------------------------------------------------*/
10240 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10241 ( NULL == pEventData->pCBfnc ))
10242 {
10243 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10244 "%s: Invalid parameters", __FUNCTION__);
10245 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010246 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010247 }
10248
10249 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10250 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10251 /*-----------------------------------------------------------------------
10252 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010253 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010254 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010255 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010256 sizeof(halSwitchChannelReq.switchChannelParams),
10257 &pSendBuffer, &usDataOffset, &usSendSize))||
10258 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10259 {
10260 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10261 "Unable to get send buffer in channel switch req %x %x %x",
10262 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10263 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010264 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010265 }
10266
Jeff Johnsone7245742012-09-05 17:12:55 -070010267 halSwitchChannelReq.switchChannelParams.channelNumber =
Jeff Johnson295189b2012-06-20 16:38:30 -070010268 pwdiSwitchChParams->wdiChInfo.ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -070010269#ifndef WLAN_FEATURE_VOWIFI
10270 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -070010271 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10272#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010273 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070010274 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10275
10276#ifdef WLAN_FEATURE_VOWIFI
10277 halSwitchChannelReq.switchChannelParams.maxTxPower
Jeff Johnsone7245742012-09-05 17:12:55 -070010278 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070010279 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10280 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10281 WDI_MAC_ADDR_LEN);
10282 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10283 pwdiSwitchChParams->wdiChInfo.macBSSId,
10284 WDI_MAC_ADDR_LEN);
10285#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010286 wpalMemoryCopy( pSendBuffer+usDataOffset,
10287 &halSwitchChannelReq.switchChannelParams,
10288 sizeof(halSwitchChannelReq.switchChannelParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010289
10290 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010291 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010292
10293 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010294 Send Switch Channel Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010295 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010296 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10297 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010298}/*WDI_ProcessChannelSwitchReq*/
10299
10300/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010301 @brief Process Config STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010302 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010303
10304 @param pWDICtx: pointer to the WLAN DAL context
10305 pEventData: pointer to the event information structure
10306
Jeff Johnson295189b2012-06-20 16:38:30 -070010307 @see
10308 @return Result of the function call
10309*/
10310WDI_Status
10311WDI_ProcessConfigStaReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010312(
Jeff Johnson295189b2012-06-20 16:38:30 -070010313 WDI_ControlBlockType* pWDICtx,
10314 WDI_EventInfoType* pEventData
10315)
10316{
10317 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10318 WDI_ConfigSTARspCb wdiConfigSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010319 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010320 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010321 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010322 wpt_uint16 usDataOffset = 0;
10323 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010324 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010325
Jeff Johnsone7245742012-09-05 17:12:55 -070010326 tConfigStaReqMsg halConfigStaReqMsg;
10327 wpt_uint16 uMsgSize = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010328 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10329
10330 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010331 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010332 -------------------------------------------------------------------------*/
10333 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10334 ( NULL == pEventData->pCBfnc ))
10335 {
10336 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10337 "%s: Invalid parameters", __FUNCTION__);
10338 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010339 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010340 }
10341
10342 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10343 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10344 /*-------------------------------------------------------------------------
10345 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010346 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010347 -------------------------------------------------------------------------*/
10348 wpalMutexAcquire(&pWDICtx->wptMutex);
10349
10350 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010351 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010352 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010353 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10354 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10355 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010356
Jeff Johnsone7245742012-09-05 17:12:55 -070010357 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010358 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010359 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10360 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10361 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010362
10363 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010364 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010365 }
10366
10367 /*------------------------------------------------------------------------
10368 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010369 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010370 ------------------------------------------------------------------------*/
10371 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10372 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010373 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10374 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10375 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010376
Jeff Johnsone7245742012-09-05 17:12:55 -070010377 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010378 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010379 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010380 }
10381
10382 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010383
10384 /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */
10385#ifdef WLAN_FEATURE_11AC
10386 if (WDI_getFwWlanFeatCaps(DOT11AC))
10387 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC
10388 else
10389#endif
10390 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default
10391
Jeff Johnson295189b2012-06-20 16:38:30 -070010392 /*-----------------------------------------------------------------------
10393 Get message buffer
10394 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010395 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10396 uMsgSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070010397 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010398 ( usSendSize < (usDataOffset + uMsgSize )))
Jeff Johnson295189b2012-06-20 16:38:30 -070010399 {
10400 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10401 "Unable to get send buffer in config sta req %x %x %x",
10402 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10403 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010404 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010405 }
10406
10407 /*Copy the station context*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010408 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010409 &pwdiConfigSTAParams->wdiReqInfo);
10410
10411 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10412 {
10413 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010414 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -070010415 WDI_STATableFindStaidByAddr(pWDICtx,
10416 pwdiConfigSTAParams->wdiReqInfo.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070010417 (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx ))
Jeff Johnson295189b2012-06-20 16:38:30 -070010418 {
10419 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10420 "This station does not exist in the WDI Station Table %d");
10421 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010422 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010423 }
10424 }
10425 else
10426 {
10427 /* Need to fill in the STA Index to invalid, since at this point we have not
10428 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -070010429 halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070010430 }
10431
10432 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010433 halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070010434
Jeff Johnsone7245742012-09-05 17:12:55 -070010435 wpalMemoryCopy( pSendBuffer+usDataOffset,
10436 &halConfigStaReqMsg.uStaParams,
10437 sizeof(halConfigStaReqMsg.uStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010438
10439 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010440 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010441
Jeff Johnsone7245742012-09-05 17:12:55 -070010442 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10443 pwdiConfigSTAParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010444 sizeof(pWDICtx->wdiCachedConfigStaReq));
10445
10446 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010447 Send Config STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010448 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010449 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10450 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010451}/*WDI_ProcessConfigStaReq*/
10452
10453
10454/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010455 @brief Process Set Link State Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010456 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010457
10458 @param pWDICtx: pointer to the WLAN DAL context
10459 pEventData: pointer to the event information structure
10460
Jeff Johnson295189b2012-06-20 16:38:30 -070010461 @see
10462 @return Result of the function call
10463*/
10464WDI_Status
10465WDI_ProcessSetLinkStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010466(
Jeff Johnson295189b2012-06-20 16:38:30 -070010467 WDI_ControlBlockType* pWDICtx,
10468 WDI_EventInfoType* pEventData
10469)
10470{
10471 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10472 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010473 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010474 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010475 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010476 wpt_uint16 usDataOffset = 0;
10477 wpt_uint16 usSendSize = 0;
10478 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnsone7245742012-09-05 17:12:55 -070010479 tLinkStateParams halLinkStateReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070010480 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10481
10482 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010483 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010484 -------------------------------------------------------------------------*/
10485 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10486 ( NULL == pEventData->pCBfnc ))
10487 {
10488 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10489 "%s: Invalid parameters", __FUNCTION__);
10490 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010491 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010492 }
10493
10494 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10495 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10496 /*-------------------------------------------------------------------------
10497 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010498 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010499 -------------------------------------------------------------------------*/
10500 wpalMutexAcquire(&pWDICtx->wptMutex);
10501
10502 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010503 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010504 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010505 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10506 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10507 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010508
Jeff Johnsone7245742012-09-05 17:12:55 -070010509 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010510 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010511 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10512 "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR,
10513 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010514 }
10515 else
10516 {
10517 /*------------------------------------------------------------------------
10518 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010519 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010520 ------------------------------------------------------------------------*/
10521 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10522 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010523 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10524 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10525 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
10526
10527 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010528 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010529 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010530 }
10531 }
10532 /* If the link is set to enter IDLE - the Session allocated for this BSS
10533 will be deleted on the Set Link State response coming from HAL
10534 - cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -070010535 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010536 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10537
10538 wpalMutexRelease(&pWDICtx->wptMutex);
10539 /*-----------------------------------------------------------------------
10540 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010541 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010542 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010543
10544 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010545 sizeof(halLinkStateReqMsg),
10546 &pSendBuffer, &usDataOffset, &usSendSize))||
10547 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10548 {
10549 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10550 "Unable to get send buffer in set bss key req %x %x %x",
10551 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10552 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010553 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010554 }
10555
10556 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10557 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10558
10559 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10560 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10561
Jeff Johnsone7245742012-09-05 17:12:55 -070010562 halLinkStateReqMsg.state =
Jeff Johnson295189b2012-06-20 16:38:30 -070010563 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10564
Jeff Johnsone7245742012-09-05 17:12:55 -070010565 wpalMemoryCopy( pSendBuffer+usDataOffset,
10566 &halLinkStateReqMsg,
10567 sizeof(halLinkStateReqMsg));
Jeff Johnson295189b2012-06-20 16:38:30 -070010568
10569 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010570 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010571
10572 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010573 Send Set Link State Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010574 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010575 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10576 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010577}/*WDI_ProcessSetLinkStateReq*/
10578
10579
10580/**
10581 @brief Process Get Stats Request function (called when Main FSM
10582 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010583
10584 @param pWDICtx: pointer to the WLAN DAL context
10585 pEventData: pointer to the event information structure
10586
Jeff Johnson295189b2012-06-20 16:38:30 -070010587 @see
10588 @return Result of the function call
10589*/
10590WDI_Status
10591WDI_ProcessGetStatsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010592(
Jeff Johnson295189b2012-06-20 16:38:30 -070010593 WDI_ControlBlockType* pWDICtx,
10594 WDI_EventInfoType* pEventData
10595)
10596{
10597 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10598 WDI_GetStatsRspCb wdiGetStatsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010599 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010600 wpt_uint16 usDataOffset = 0;
10601 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010602 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010603 WDI_BSSSessionType* pBSSSes = NULL;
10604 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010605 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010606 tHalStatsReqMsg halStatsReqMsg;
10607 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10608
10609 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010610 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010611 -------------------------------------------------------------------------*/
10612 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10613 ( NULL == pEventData->pCBfnc ) )
10614 {
10615 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10616 "%s: Invalid parameters", __FUNCTION__);
10617 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010618 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010619 }
10620
10621 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10622 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10623
10624 /*-------------------------------------------------------------------------
10625 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010626 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010627 -------------------------------------------------------------------------*/
10628 wpalMutexAcquire(&pWDICtx->wptMutex);
10629
10630 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010631 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010632 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010633 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10634 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010635 &macBSSID))
10636 {
10637 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10638 "This station does not exist in the WDI Station Table %d");
10639 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010640 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010641 }
10642
Jeff Johnsone7245742012-09-05 17:12:55 -070010643 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10644 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010645 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010646 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10647 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10648 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010649
10650 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010651 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010652 }
10653
10654 /*------------------------------------------------------------------------
10655 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010656 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010657 ------------------------------------------------------------------------*/
10658 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10659 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10661 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10662 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010663
Jeff Johnsone7245742012-09-05 17:12:55 -070010664 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010665 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010666 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010667 }
10668
10669
10670 wpalMutexRelease(&pWDICtx->wptMutex);
10671
10672 /*-----------------------------------------------------------------------
10673 Get message buffer
10674 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010675 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010676 sizeof(halStatsReqMsg.statsReqParams),
10677 &pSendBuffer, &usDataOffset, &usSendSize))||
10678 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10679 {
10680 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10681 "Unable to get send buffer in set bss key req %x %x %x",
10682 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10683 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010684 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010685 }
10686
Jeff Johnsone7245742012-09-05 17:12:55 -070010687 halStatsReqMsg.statsReqParams.staId =
Jeff Johnson295189b2012-06-20 16:38:30 -070010688 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070010689 halStatsReqMsg.statsReqParams.statsMask =
Jeff Johnson295189b2012-06-20 16:38:30 -070010690 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
Jeff Johnsone7245742012-09-05 17:12:55 -070010691 wpalMemoryCopy( pSendBuffer+usDataOffset,
10692 &halStatsReqMsg.statsReqParams,
10693 sizeof(halStatsReqMsg.statsReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010694
10695 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010696 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010697
10698 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010699 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010700 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010701 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10702 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010703}/*WDI_ProcessGetStatsReq*/
10704
10705/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010706 @brief Process Update Cfg Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070010707 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010708
10709 @param pWDICtx: pointer to the WLAN DAL context
10710 pEventData: pointer to the event information structure
10711
Jeff Johnson295189b2012-06-20 16:38:30 -070010712 @see
10713 @return Result of the function call
10714*/
10715WDI_Status
10716WDI_ProcessUpdateCfgReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010717(
Jeff Johnson295189b2012-06-20 16:38:30 -070010718 WDI_ControlBlockType* pWDICtx,
10719 WDI_EventInfoType* pEventData
10720)
10721{
10722 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10723 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10724
Jeff Johnsone7245742012-09-05 17:12:55 -070010725 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010726 wpt_uint16 usDataOffset = 0;
10727 wpt_uint16 usSendSize = 0;
10728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10729
10730 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010731 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010732 -------------------------------------------------------------------------*/
10733 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10734 ( NULL == pEventData->pCBfnc))
10735 {
10736 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10737 "%s: Invalid parameters", __FUNCTION__);
10738 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010739 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010740 }
10741
10742 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10743 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10744
10745 /*-----------------------------------------------------------------------
10746 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010747 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010748 -----------------------------------------------------------------------*/
10749
Jeff Johnsone7245742012-09-05 17:12:55 -070010750 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010751 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10752 &pSendBuffer, &usDataOffset, &usSendSize))||
10753 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10754 {
10755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10756 "Unable to get send buffer in set bss key req %x %x %x",
10757 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10758 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010759 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010760 }
10761
Jeff Johnsone7245742012-09-05 17:12:55 -070010762 wpalMemoryCopy( pSendBuffer+usDataOffset,
10763 &pwdiUpdateCfgParams->uConfigBufferLen,
10764 sizeof(wpt_uint32));
10765 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10766 pwdiUpdateCfgParams->pConfigBuffer,
10767 pwdiUpdateCfgParams->uConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -070010768
10769 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010770 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010771
10772 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010773 Send Update Cfg Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010774 -------------------------------------------------------------------------*/
10775
Jeff Johnsone7245742012-09-05 17:12:55 -070010776 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10777 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010778
10779}/*WDI_ProcessUpdateCfgReq*/
10780
10781
10782/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010783 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010784 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010785
10786 @param pWDICtx: pointer to the WLAN DAL context
10787 pEventData: pointer to the event information structure
10788
Jeff Johnson295189b2012-06-20 16:38:30 -070010789 @see
10790 @return Result of the function call
10791*/
10792WDI_Status
10793WDI_ProcessAddBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010794(
Jeff Johnson295189b2012-06-20 16:38:30 -070010795 WDI_ControlBlockType* pWDICtx,
10796 WDI_EventInfoType* pEventData
10797)
10798{
10799 WDI_AddBAReqParamsType* pwdiAddBAParams;
10800 WDI_AddBARspCb wdiAddBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010801 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010802 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010803 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010804 wpt_uint16 usDataOffset = 0;
10805 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010806 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010807 wpt_macAddr macBSSID;
10808
10809 tAddBAReqMsg halAddBAReq;
10810 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10811
10812 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010813 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010814 -------------------------------------------------------------------------*/
10815 if (( NULL == pEventData ) ||
10816 ( NULL == pEventData->pEventData) ||
10817 ( NULL == pEventData->pCBfnc ))
10818 {
10819 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10820 "%s: Invalid parameters", __FUNCTION__);
10821 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010822 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010823 }
10824
10825 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10826 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10827
10828 /*-------------------------------------------------------------------------
10829 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010830 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010831 -------------------------------------------------------------------------*/
10832 wpalMutexAcquire(&pWDICtx->wptMutex);
10833
10834 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010835 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010836 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010837 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10838 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010839 &macBSSID))
10840 {
10841 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10842 "This station does not exist in the WDI Station Table %d");
10843 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010844 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010845 }
10846
Jeff Johnsone7245742012-09-05 17:12:55 -070010847 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10848 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010849 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010850 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10851 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10852 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010853
10854 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010855 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010856 }
10857
10858 /*------------------------------------------------------------------------
10859 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010860 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010861 ------------------------------------------------------------------------*/
10862 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10863 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010864 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10865 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10866 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010867
Jeff Johnsone7245742012-09-05 17:12:55 -070010868 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010869 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010870 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010871 }
10872
10873
10874 wpalMutexRelease(&pWDICtx->wptMutex);
10875 /*-----------------------------------------------------------------------
10876 Get message buffer
10877 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010878 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010879 sizeof(halAddBAReq.addBAParams),
10880 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010881 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070010882 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10883 {
10884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10885 "Unable to get send buffer in Add BA req %x %x %x",
10886 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10887 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010888 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010889 }
10890
Jeff Johnsone7245742012-09-05 17:12:55 -070010891 halAddBAReq.addBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070010892 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10893 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10894#ifdef FEATURE_ON_CHIP_REORDERING
Jeff Johnsone7245742012-09-05 17:12:55 -070010895 halAddBAReq.addBAParams.isReorderingDoneOnChip =
Jeff Johnson295189b2012-06-20 16:38:30 -070010896 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10897#endif
10898
Jeff Johnsone7245742012-09-05 17:12:55 -070010899 wpalMemoryCopy( pSendBuffer+usDataOffset,
10900 &halAddBAReq.addBAParams,
10901 sizeof(halAddBAReq.addBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010902
10903 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010904 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010905
10906 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010907 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010908 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010909 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10910 wdiAddBARspCb, pEventData->pUserData,
10911 WDI_ADD_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010912}/*WDI_ProcessAddBAReq*/
10913
10914
10915
10916/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010917 @brief Process Trigger BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010918 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010919
10920 @param pWDICtx: pointer to the WLAN DAL context
10921 pEventData: pointer to the event information structure
10922
Jeff Johnson295189b2012-06-20 16:38:30 -070010923 @see
10924 @return Result of the function call
10925*/
10926WDI_Status
10927WDI_ProcessTriggerBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010928(
Jeff Johnson295189b2012-06-20 16:38:30 -070010929 WDI_ControlBlockType* pWDICtx,
10930 WDI_EventInfoType* pEventData
10931)
10932{
10933 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10934 WDI_TriggerBARspCb wdiTriggerBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010935 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010936 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010937 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010938 wpt_uint16 usDataOffset = 0;
10939 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010940 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010941 wpt_uint16 index;
10942 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010943
Jeff Johnson295189b2012-06-20 16:38:30 -070010944 tTriggerBAReqMsg halTriggerBAReq;
10945 tTriggerBaReqCandidate* halTriggerBACandidate;
10946 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10947 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10948
10949 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010950 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010951 -------------------------------------------------------------------------*/
10952 if (( NULL == pEventData ) ||
10953 ( NULL == pEventData->pEventData ) ||
10954 ( NULL == pEventData->pCBfnc ))
10955 {
10956 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10957 "%s: Invalid parameters", __FUNCTION__);
10958 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010959 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010960 }
10961
10962 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10963 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10964 /*-------------------------------------------------------------------------
10965 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010966 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010967 -------------------------------------------------------------------------*/
10968 wpalMutexAcquire(&pWDICtx->wptMutex);
10969
10970 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010971 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010972 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010973 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10974 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010975 &macBSSID))
10976 {
10977 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10978 "This station does not exist in the WDI Station Table %d");
10979 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010980 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010981 }
10982
Jeff Johnsone7245742012-09-05 17:12:55 -070010983 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10984 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010985 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010986 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10987 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10988 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010989
10990 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010991 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010992 }
10993
10994 /*------------------------------------------------------------------------
10995 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010996 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010997 ------------------------------------------------------------------------*/
10998 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10999 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011000 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11001 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
11002 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070011003
Jeff Johnsone7245742012-09-05 17:12:55 -070011004 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070011005 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070011006 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011007 }
11008
11009
11010 wpalMutexRelease(&pWDICtx->wptMutex);
11011 /*-----------------------------------------------------------------------
11012 Get message buffer
11013 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011014 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11015 WDI_TRIGGER_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011016 sizeof(halTriggerBAReq.triggerBAParams) +
Jeff Johnsone7245742012-09-05 17:12:55 -070011017 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011018 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
11019 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011020 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070011021 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
Jeff Johnsone7245742012-09-05 17:12:55 -070011022 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011023 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
11024 {
11025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11026 "Unable to get send buffer in Trigger BA req %x %x %x",
11027 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
11028 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011029 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011030 }
11031
Jeff Johnsone7245742012-09-05 17:12:55 -070011032 halTriggerBAReq.triggerBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070011033 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
Jeff Johnsone7245742012-09-05 17:12:55 -070011034 halTriggerBAReq.triggerBAParams.baCandidateCnt =
Jeff Johnson295189b2012-06-20 16:38:30 -070011035 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
11036
Jeff Johnsone7245742012-09-05 17:12:55 -070011037 wpalMemoryCopy( pSendBuffer+usDataOffset,
11038 &halTriggerBAReq.triggerBAParams,
11039 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011040
Jeff Johnsone7245742012-09-05 17:12:55 -070011041 wdiTriggerBACandidate =
Jeff Johnson295189b2012-06-20 16:38:30 -070011042 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
11043 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
11044 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnsone7245742012-09-05 17:12:55 -070011045
11046 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
Jeff Johnson295189b2012-06-20 16:38:30 -070011047 index++)
11048 {
11049 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
11050 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
11051 halTriggerBACandidate++;
11052 wdiTriggerBACandidate++;
11053 }
11054
11055 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011056 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011057
11058 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011059 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011060 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011061 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11062 wdiTriggerBARspCb, pEventData->pUserData,
11063 WDI_TRIGGER_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011064}/*WDI_ProcessTriggerBAReq*/
11065
11066
11067
11068/**
11069 @brief Process Update Beacon Params Request function (called when Main FSM
11070 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011071
11072 @param pWDICtx: pointer to the WLAN DAL context
11073 pEventData: pointer to the event information structure
11074
Jeff Johnson295189b2012-06-20 16:38:30 -070011075 @see
11076 @return Result of the function call
11077*/
11078WDI_Status
11079WDI_ProcessUpdateBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011080(
Jeff Johnson295189b2012-06-20 16:38:30 -070011081 WDI_ControlBlockType* pWDICtx,
11082 WDI_EventInfoType* pEventData
11083)
11084{
11085 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
11086 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011087 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011088 wpt_uint16 usDataOffset = 0;
11089 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011090 tUpdateBeaconParams halUpdateBeaconParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011091 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11092
11093 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011094 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011095 -------------------------------------------------------------------------*/
11096 if (( NULL == pEventData ) ||
11097 ( NULL == pEventData->pEventData) ||
11098 ( NULL == pEventData->pCBfnc))
11099 {
11100 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11101 "%s: Invalid parameters", __FUNCTION__);
11102 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011103 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011104 }
11105
11106 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
11107 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
11108 /*-----------------------------------------------------------------------
11109 Get message buffer
11110 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011111 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011112 sizeof(halUpdateBeaconParams),
11113 &pSendBuffer, &usDataOffset, &usSendSize))||
11114 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
11115 {
11116 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11117 "Unable to get send buffer in set bss key req %x %x %x",
11118 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
11119 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011120 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011121 }
11122
11123 /*BSS Index of the BSS*/
11124 halUpdateBeaconParams.bssIdx =
11125 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
11126 /*shortPreamble mode. HAL should update all the STA rates when it
11127 receives this message*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011128 halUpdateBeaconParams.fShortPreamble =
Jeff Johnson295189b2012-06-20 16:38:30 -070011129 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
11130 /* short Slot time.*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011131 halUpdateBeaconParams.fShortSlotTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070011132 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
11133 /* Beacon Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070011134 halUpdateBeaconParams.beaconInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011135 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
11136
11137 /*Protection related */
Jeff Johnsone7245742012-09-05 17:12:55 -070011138 halUpdateBeaconParams.llaCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011139 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011140 halUpdateBeaconParams.llbCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011141 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011142 halUpdateBeaconParams.llgCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011143 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011144 halUpdateBeaconParams.ht20MhzCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011145 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011146 halUpdateBeaconParams.llnNonGFCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011147 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011148 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070011149 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
11150 halUpdateBeaconParams.fRIFSMode =
11151 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
Jeff Johnsone7245742012-09-05 17:12:55 -070011152 halUpdateBeaconParams.paramChangeBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070011153 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
11154
Jeff Johnsone7245742012-09-05 17:12:55 -070011155 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
11156 sizeof(halUpdateBeaconParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011157
11158 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011159 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011160
11161 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011162 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011163 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011164 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11165 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011166}/*WDI_ProcessUpdateBeaconParamsReq*/
11167
11168
11169
11170/**
11171 @brief Process Send Beacon template Request function (called when Main FSM
11172 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011173
11174 @param pWDICtx: pointer to the WLAN DAL context
11175 pEventData: pointer to the event information structure
11176
Jeff Johnson295189b2012-06-20 16:38:30 -070011177 @see
11178 @return Result of the function call
11179*/
11180WDI_Status
11181WDI_ProcessSendBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011182(
Jeff Johnson295189b2012-06-20 16:38:30 -070011183 WDI_ControlBlockType* pWDICtx,
11184 WDI_EventInfoType* pEventData
11185)
11186{
11187 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
11188 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011189 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011190 wpt_uint16 usDataOffset = 0;
11191 wpt_uint16 usSendSize = 0;
11192 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11193
11194 tSendBeaconReqMsg halSendBeaconReq;
11195 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011196 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011197 -------------------------------------------------------------------------*/
11198 if (( NULL == pEventData ) ||
11199 ( NULL == pEventData->pEventData ) ||
11200 ( NULL == pEventData->pCBfnc ))
11201 {
11202 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11203 "%s: Invalid parameters", __FUNCTION__);
11204 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011205 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011206 }
11207
11208 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
11209 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
11210 /*-----------------------------------------------------------------------
11211 Get message buffer
11212 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011213 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011214 sizeof(halSendBeaconReq.sendBeaconParam),
11215 &pSendBuffer, &usDataOffset, &usSendSize))||
11216 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
11217 {
11218 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11219 "Unable to get send buffer in send beacon req %x %x %x",
11220 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
11221 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011222 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011223 }
11224
11225 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
11226 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
11227 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011228 halSendBeaconReq.sendBeaconParam.beaconLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070011229 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
11230 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
11231 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
11232 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
11233#ifdef WLAN_SOFTAP_FEATURE
Jeff Johnsone7245742012-09-05 17:12:55 -070011234 halSendBeaconReq.sendBeaconParam.timIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011235 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
11236#endif
11237#ifdef WLAN_FEATURE_P2P
Jeff Johnsone7245742012-09-05 17:12:55 -070011238 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011239 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11240#endif
11241
Jeff Johnsone7245742012-09-05 17:12:55 -070011242 wpalMemoryCopy( pSendBuffer+usDataOffset,
11243 &halSendBeaconReq.sendBeaconParam,
11244 sizeof(halSendBeaconReq.sendBeaconParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070011245
11246 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011247 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011248
11249 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011250 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011251 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011252 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11253 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011254}/*WDI_ProcessSendBeaconParamsReq*/
11255
11256/**
11257 @brief Process Update Beacon Params Request function (called when Main FSM
11258 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011259
11260 @param pWDICtx: pointer to the WLAN DAL context
11261 pEventData: pointer to the event information structure
11262
Jeff Johnson295189b2012-06-20 16:38:30 -070011263 @see
11264 @return Result of the function call
11265*/
11266WDI_Status
11267WDI_ProcessUpdateProbeRspTemplateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011268(
Jeff Johnson295189b2012-06-20 16:38:30 -070011269 WDI_ControlBlockType* pWDICtx,
11270 WDI_EventInfoType* pEventData
11271)
11272{
11273 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11274 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011275 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011276 wpt_uint16 usDataOffset = 0;
11277 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011278 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011279 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11280
11281 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011282 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011283 -------------------------------------------------------------------------*/
11284 if (( NULL == pEventData ) ||
11285 ( NULL == pEventData->pEventData) ||
11286 ( NULL == pEventData->pCBfnc))
11287 {
11288 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11289 "%s: Invalid parameters", __FUNCTION__);
11290 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011291 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011292 }
11293
Jeff Johnsone7245742012-09-05 17:12:55 -070011294 pwdiUpdateProbeRespTmplParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011295 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011296 wdiUpdateProbeRespTmplRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011297 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11298 /*-----------------------------------------------------------------------
11299 Get message buffer
11300 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011301 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011302 sizeof(halUpdateProbeRspTmplParams),
11303 &pSendBuffer, &usDataOffset, &usSendSize))||
11304 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11305 {
11306 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11307 "Unable to get send buffer in set bss key req %x %x %x",
11308 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11309 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011310 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011311 }
11312
11313 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070011314 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070011315 WDI_MAC_ADDR_LEN);
11316
Jeff Johnsone7245742012-09-05 17:12:55 -070011317 halUpdateProbeRspTmplParams.probeRespTemplateLen =
Jeff Johnson295189b2012-06-20 16:38:30 -070011318 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11319
11320 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11321 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070011322 BEACON_TEMPLATE_SIZE);
Jeff Johnson295189b2012-06-20 16:38:30 -070011323
11324
11325 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11326 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11327 WDI_PROBE_REQ_BITMAP_IE_LEN);
11328
Jeff Johnsone7245742012-09-05 17:12:55 -070011329 wpalMemoryCopy( pSendBuffer+usDataOffset,
11330 &halUpdateProbeRspTmplParams,
11331 sizeof(halUpdateProbeRspTmplParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011332
11333 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011334 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011335
11336 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011337 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011338 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011339 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11340 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11341 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011342}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11343
11344/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011345 @brief Process NV blob download function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070011346 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011347
11348 @param pWDICtx: pointer to the WLAN DAL context
11349 pEventData: pointer to the event information structure
11350
Jeff Johnson295189b2012-06-20 16:38:30 -070011351 @see
11352 @return Result of the function call
11353*/
11354WDI_Status
11355WDI_ProcessNvDownloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011356(
Jeff Johnson295189b2012-06-20 16:38:30 -070011357 WDI_ControlBlockType* pWDICtx,
11358 WDI_EventInfoType* pEventData
11359)
11360{
11361
11362 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11363 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11364
11365 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011366 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011367 -------------------------------------------------------------------------*/
11368 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011369 ( NULL == (pwdiNvDownloadReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011370 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011371 ( NULL == (wdiNvDownloadRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011372 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11373 {
11374 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11375 "%s: Invalid parameters", __FUNCTION__);
11376 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011377 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011378 }
11379
11380 /*Intialize the Nv Blob Info */
Jeff Johnsone7245742012-09-05 17:12:55 -070011381 pWDICtx->wdiNvBlobInfo.usTotalFragment =
Jeff Johnson295189b2012-06-20 16:38:30 -070011382 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11383
11384 /*cache the wdi nv request message here if the the first fragment
11385 * To issue the request to HAL for the next fragment */
11386 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11387 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011388 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11389 pwdiNvDownloadReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070011390 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11391
11392 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11393 pWDICtx->pRspCBUserData = pEventData->pUserData;
11394 }
11395
11396 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11397}
11398
11399/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011400 @brief Process Set Max Tx Power Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011401 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011402
11403 @param pWDICtx: pointer to the WLAN DAL context
11404 pEventData: pointer to the event information structure
11405
Jeff Johnson295189b2012-06-20 16:38:30 -070011406 @see
11407 @return Result of the function call
11408*/
11409WDI_Status WDI_ProcessSetMaxTxPowerReq
11410(
11411 WDI_ControlBlockType* pWDICtx,
11412 WDI_EventInfoType* pEventData
11413)
11414{
11415 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11416 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011417 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011418 wpt_uint16 usDataOffset = 0;
11419 wpt_uint16 usSendSize = 0;
11420 tSetMaxTxPwrReq halSetMaxTxPower;
11421 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11422
11423 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011424 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011425 -------------------------------------------------------------------------*/
11426 if (( NULL == pEventData ) ||
11427 ( NULL == pEventData->pEventData ) ||
11428 ( NULL == pEventData->pCBfnc ))
11429 {
11430 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11431 "%s: Invalid parameters", __FUNCTION__);
11432 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011433 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011434 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011435 pwdiSetMaxTxPowerParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011436 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011437 wdiSetMaxTxPowerRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011438 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11439
11440 /*-----------------------------------------------------------------------
11441 Get message buffer
11442 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011443if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011444 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11445 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011446 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
Jeff Johnson295189b2012-06-20 16:38:30 -070011447)))
11448 {
11449 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11450 "Unable to get Set Max Tx Power req %x %x %x",
11451 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11452 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011453 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011454 }
11455
11456 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11457 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11458 WDI_MAC_ADDR_LEN);
11459
11460 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11461 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11462 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011463 halSetMaxTxPower.setMaxTxPwrParams.power =
Jeff Johnson295189b2012-06-20 16:38:30 -070011464 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070011465
11466 wpalMemoryCopy( pSendBuffer+usDataOffset,
11467 &halSetMaxTxPower.setMaxTxPwrParams,
11468 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011469
11470 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011471 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011472
11473 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011474 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011475 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011476 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11477 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11478 WDI_SET_MAX_TX_POWER_RESP);
11479
Jeff Johnson295189b2012-06-20 16:38:30 -070011480}
11481
11482#ifdef WLAN_FEATURE_P2P
11483
11484/**
11485 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11486 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011487
11488 @param pWDICtx: pointer to the WLAN DAL context
11489 pEventData: pointer to the event information structure
11490
Jeff Johnson295189b2012-06-20 16:38:30 -070011491 @see
11492 @return Result of the function call
11493*/
11494WDI_Status
11495WDI_ProcessP2PGONOAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011496(
Jeff Johnson295189b2012-06-20 16:38:30 -070011497 WDI_ControlBlockType* pWDICtx,
11498 WDI_EventInfoType* pEventData
11499)
11500{
11501 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11502 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011503 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011504 wpt_uint16 usDataOffset = 0;
11505 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011506 tSetP2PGONOAParams halSetP2PGONOAParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011507 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11508
11509 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011510 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011511 -------------------------------------------------------------------------*/
11512 if (( NULL == pEventData ) ||
11513 ( NULL == pEventData->pEventData) ||
11514 ( NULL == pEventData->pCBfnc))
11515 {
11516 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11517 "%s: Invalid parameters", __FUNCTION__);
11518 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011519 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011520 }
11521
Jeff Johnsone7245742012-09-05 17:12:55 -070011522 pwdiP2PGONOAReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011523 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011524 wdiP2PGONOAReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011525 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11526 /*-----------------------------------------------------------------------
11527 Get message buffer
11528 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011529 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11530 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011531 sizeof(halSetP2PGONOAParams),
11532 &pSendBuffer, &usDataOffset, &usSendSize))||
11533 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11534 {
11535 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11536 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11537 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11538 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011539 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011540 }
11541
Jeff Johnsone7245742012-09-05 17:12:55 -070011542 halSetP2PGONOAParams.opp_ps =
Jeff Johnson295189b2012-06-20 16:38:30 -070011543 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
Jeff Johnsone7245742012-09-05 17:12:55 -070011544 halSetP2PGONOAParams.ctWindow =
Jeff Johnson295189b2012-06-20 16:38:30 -070011545 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11546 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
Jeff Johnsone7245742012-09-05 17:12:55 -070011547 halSetP2PGONOAParams.duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011548 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011549 halSetP2PGONOAParams.interval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011550 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070011551 halSetP2PGONOAParams.single_noa_duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011552 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011553 halSetP2PGONOAParams.psSelection =
Jeff Johnson295189b2012-06-20 16:38:30 -070011554 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11555
Jeff Johnsone7245742012-09-05 17:12:55 -070011556 wpalMemoryCopy( pSendBuffer+usDataOffset,
11557 &halSetP2PGONOAParams,
11558 sizeof(halSetP2PGONOAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011559
11560 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011561 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011562
11563 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011564 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011565 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011566 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11567 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11568 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011569}/*WDI_ProcessP2PGONOAReq*/
11570
11571#endif
11572
11573
11574/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011575 @brief Function to handle the ack from DXE once the power
Jeff Johnson295189b2012-06-20 16:38:30 -070011576 state is set.
Jeff Johnsone7245742012-09-05 17:12:55 -070011577 @param None
11578
11579 @see
11580 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070011581*/
11582void
11583WDI_SetPowerStateCb
11584(
11585 wpt_status status,
11586 unsigned int dxePhyAddr,
11587 void *pContext
11588)
11589{
11590 wpt_status wptStatus;
11591 WDI_ControlBlockType *pCB = NULL;
11592 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11593 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11594 {
11595 //it shouldn't happen, put an error msg
11596 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011597 /*
11598 * Trigger the event to bring the Enter BMPS req function to come
11599 * out of wait
Jeff Johnson295189b2012-06-20 16:38:30 -070011600*/
11601 if( NULL != pContext )
11602 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011603 pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnson295189b2012-06-20 16:38:30 -070011604 }
11605 else
11606 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011607 //put an error msg
Jeff Johnson295189b2012-06-20 16:38:30 -070011608 pCB = &gWDICb;
11609 }
11610 pCB->dxePhyAddr = dxePhyAddr;
11611 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11612 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11613 {
11614 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11615 "Failed to set an event");
11616
Jeff Johnsone7245742012-09-05 17:12:55 -070011617 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011618 }
11619 return;
11620}
11621
11622
11623/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011624 @brief Process Enter IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011625 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011626
11627 @param pWDICtx: pointer to the WLAN DAL context
11628 pEventData: pointer to the event information structure
11629
Jeff Johnson295189b2012-06-20 16:38:30 -070011630 @see
11631 @return Result of the function call
11632*/
11633WDI_Status
11634WDI_ProcessEnterImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011635(
Jeff Johnson295189b2012-06-20 16:38:30 -070011636 WDI_ControlBlockType* pWDICtx,
11637 WDI_EventInfoType* pEventData
11638)
11639{
Jeff Johnson43971f52012-07-17 12:26:56 -070011640 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011641 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011642 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011643 wpt_uint16 usDataOffset = 0;
11644 wpt_uint16 usSendSize = 0;
11645 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11646
11647 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011648 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011649 -------------------------------------------------------------------------*/
11650 if (( NULL == pEventData ) ||
11651 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11652 {
11653 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11654 "%s: Invalid parameters", __FUNCTION__);
11655 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011656 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011657 }
11658
11659 /*-----------------------------------------------------------------------
11660 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011661 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011662 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011663 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011664 0,
11665 &pSendBuffer, &usDataOffset, &usSendSize))||
11666 ( usSendSize < (usDataOffset )))
11667 {
11668 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11669 "Unable to get send buffer in Enter IMPS req %x %x",
11670 pEventData, wdiEnterImpsRspCb);
11671 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011672 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011673 }
11674
11675 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011676 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11677 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011678 {
11679 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11680 "WDI Init failed to reset an event");
11681
Jeff Johnsone7245742012-09-05 17:12:55 -070011682 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011683 return VOS_STATUS_E_FAILURE;
11684 }
11685
11686 // notify DTS that we are entering IMPS
11687 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11688
11689 /*
Jeff Johnsone7245742012-09-05 17:12:55 -070011690 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011691 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011692 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11693 WDI_SET_POWER_STATE_TIMEOUT);
11694 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011695 {
11696 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11697 "WDI Init failed to wait on an event");
11698
Jeff Johnsone7245742012-09-05 17:12:55 -070011699 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011700 return VOS_STATUS_E_FAILURE;
11701 }
11702
11703 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011704 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011705 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011706 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11707 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011708}/*WDI_ProcessEnterImpsReq*/
11709
11710/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011711 @brief Process Exit IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011712 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011713
11714 @param pWDICtx: pointer to the WLAN DAL context
11715 pEventData: pointer to the event information structure
11716
Jeff Johnson295189b2012-06-20 16:38:30 -070011717 @see
11718 @return Result of the function call
11719*/
11720WDI_Status
11721WDI_ProcessExitImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011722(
Jeff Johnson295189b2012-06-20 16:38:30 -070011723 WDI_ControlBlockType* pWDICtx,
11724 WDI_EventInfoType* pEventData
11725)
11726{
11727 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011728 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011729 wpt_uint16 usDataOffset = 0;
11730 wpt_uint16 usSendSize = 0;
11731 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11732
11733 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011734 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011735 -------------------------------------------------------------------------*/
11736 if (( NULL == pEventData ) ||
11737 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11738 {
11739 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11740 "%s: Invalid parameters", __FUNCTION__);
11741 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011742 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011743 }
11744
11745 /*-----------------------------------------------------------------------
11746 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011747 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011748 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011749 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011750 0,
11751 &pSendBuffer, &usDataOffset, &usSendSize))||
11752 ( usSendSize < (usDataOffset )))
11753 {
11754 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11755 "Unable to get send buffer in Exit IMPS req %x %x",
11756 pEventData, wdiExitImpsRspCb);
11757 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011758 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011759 }
11760
11761 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011762 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011763 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011764 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11765 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011766}/*WDI_ProcessExitImpsReq*/
11767
11768/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011769 @brief Process Enter BMPS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011770 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011771
11772 @param pWDICtx: pointer to the WLAN DAL context
11773 pEventData: pointer to the event information structure
11774
Jeff Johnson295189b2012-06-20 16:38:30 -070011775 @see
11776 @return Result of the function call
11777*/
11778WDI_Status
11779WDI_ProcessEnterBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011780(
Jeff Johnson295189b2012-06-20 16:38:30 -070011781 WDI_ControlBlockType* pWDICtx,
11782 WDI_EventInfoType* pEventData
11783)
11784{
11785 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11786 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011787 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011788 wpt_uint16 usDataOffset = 0;
11789 wpt_uint16 usSendSize = 0;
11790 tHalEnterBmpsReqParams enterBmpsReq;
Jeff Johnson43971f52012-07-17 12:26:56 -070011791 wpt_status wptStatus;
11792
Jeff Johnson295189b2012-06-20 16:38:30 -070011793 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11794
11795 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011796 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011797 -------------------------------------------------------------------------*/
11798 if (( NULL == pEventData ) ||
11799 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11800 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11801 {
11802 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11803 "%s: Invalid parameters", __FUNCTION__);
11804 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011805 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011806 }
11807
11808 /*-----------------------------------------------------------------------
11809 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011810 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011811 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011812 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011813 sizeof(enterBmpsReq),
11814 &pSendBuffer, &usDataOffset, &usSendSize))||
11815 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11816 {
11817 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11818 "Unable to get send buffer in Enter BMPS req %x %x %x",
11819 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11820 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011821 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011822 }
11823
11824 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011825 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11826 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011827 {
11828 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11829 "WDI Init failed to reset an event");
11830
Jeff Johnsone7245742012-09-05 17:12:55 -070011831 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011832 return VOS_STATUS_E_FAILURE;
11833 }
11834
11835 // notify DTS that we are entering BMPS
11836 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11837
11838/*
Jeff Johnsone7245742012-09-05 17:12:55 -070011839 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011840 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011841 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11842 WDI_SET_POWER_STATE_TIMEOUT);
11843 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011844 {
11845 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11846 "WDI Init failed to wait on an event");
11847
Jeff Johnsone7245742012-09-05 17:12:55 -070011848 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011849 return VOS_STATUS_E_FAILURE;
11850 }
11851
11852 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11853
11854 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11855 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11856 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11857 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11858
11859 // For CCX and 11R Roaming
11860 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11861 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11862 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11863
11864 wpalMemoryCopy( pSendBuffer+usDataOffset,
11865 &enterBmpsReq,
11866 sizeof(enterBmpsReq));
11867
11868 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011869 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011870
11871 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011872 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011873 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011874 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11875 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011876}/*WDI_ProcessEnterBmpsReq*/
11877
11878/**
11879 @brief Process Exit BMPS Request function (called when Main FSM
11880 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011881
11882 @param pWDICtx: pointer to the WLAN DAL context
11883 pEventData: pointer to the event information structure
11884
Jeff Johnson295189b2012-06-20 16:38:30 -070011885 @see
11886 @return Result of the function call
11887*/
11888WDI_Status
11889WDI_ProcessExitBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011890(
Jeff Johnson295189b2012-06-20 16:38:30 -070011891 WDI_ControlBlockType* pWDICtx,
11892 WDI_EventInfoType* pEventData
11893)
11894{
11895 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11896 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011897 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011898 wpt_uint16 usDataOffset = 0;
11899 wpt_uint16 usSendSize = 0;
11900 tHalExitBmpsReqParams exitBmpsReq;
11901 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11902
11903 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011904 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011905 -------------------------------------------------------------------------*/
11906 if (( NULL == pEventData ) ||
11907 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11908 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11909 {
11910 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11911 "%s: Invalid parameters", __FUNCTION__);
11912 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011913 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011914 }
11915
11916 /*-----------------------------------------------------------------------
11917 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011918 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011919 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011920 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011921 sizeof(exitBmpsReq),
11922 &pSendBuffer, &usDataOffset, &usSendSize))||
11923 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11924 {
11925 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11926 "Unable to get send buffer in Exit BMPS req %x %x %x",
11927 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11928 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011929 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011930 }
11931 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11932
Jeff Johnsone7245742012-09-05 17:12:55 -070011933 exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx;
11934
Jeff Johnson295189b2012-06-20 16:38:30 -070011935 wpalMemoryCopy( pSendBuffer+usDataOffset,
11936 &exitBmpsReq,
11937 sizeof(exitBmpsReq));
11938
11939 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011940 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011941
11942 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011943 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011944 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011945 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11946 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011947}/*WDI_ProcessExitBmpsReq*/
11948
11949/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011950 @brief Process Enter UAPSD Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011951 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011952
11953 @param pWDICtx: pointer to the WLAN DAL context
11954 pEventData: pointer to the event information structure
11955
Jeff Johnson295189b2012-06-20 16:38:30 -070011956 @see
11957 @return Result of the function call
11958*/
11959WDI_Status
11960WDI_ProcessEnterUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011961(
Jeff Johnson295189b2012-06-20 16:38:30 -070011962 WDI_ControlBlockType* pWDICtx,
11963 WDI_EventInfoType* pEventData
11964)
11965{
11966 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11967 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011968 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011969 wpt_uint16 usDataOffset = 0;
11970 wpt_uint16 usSendSize = 0;
11971 tUapsdReqParams enterUapsdReq;
11972 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11973
11974 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011975 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011976 -------------------------------------------------------------------------*/
11977 if (( NULL == pEventData ) ||
11978 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11979 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11980 {
11981 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11982 "%s: Invalid parameters", __FUNCTION__);
11983 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011984 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011985 }
11986
11987 /*-----------------------------------------------------------------------
11988 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011989 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011990 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011991 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011992 sizeof(enterUapsdReq),
11993 &pSendBuffer, &usDataOffset, &usSendSize))||
11994 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
11995 {
11996 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11997 "Unable to get send buffer in Enter UAPSD req %x %x %x",
11998 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
11999 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012000 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012001 }
12002
12003 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
12004 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
12005 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
12006 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
12007 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
12008 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
12009 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
12010 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070012011 enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070012012
Jeff Johnsone7245742012-09-05 17:12:55 -070012013 wpalMemoryCopy( pSendBuffer+usDataOffset,
12014 &enterUapsdReq,
12015 sizeof(enterUapsdReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012016
12017 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012018 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012019
12020 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012021 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012022 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012023 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12024 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012025}/*WDI_ProcessEnterUapsdReq*/
12026
12027/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012028 @brief Process Exit UAPSD Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012029 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012030
12031 @param pWDICtx: pointer to the WLAN DAL context
12032 pEventData: pointer to the event information structure
12033
Jeff Johnson295189b2012-06-20 16:38:30 -070012034 @see
12035 @return Result of the function call
12036*/
12037WDI_Status
12038WDI_ProcessExitUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012039(
Jeff Johnson295189b2012-06-20 16:38:30 -070012040 WDI_ControlBlockType* pWDICtx,
12041 WDI_EventInfoType* pEventData
12042)
12043{
12044 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012045 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012046 wpt_uint16 usDataOffset = 0;
12047 wpt_uint16 usSendSize = 0;
12048 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12049
12050 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012051 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012052 -------------------------------------------------------------------------*/
12053 if (( NULL == pEventData ) ||
12054 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
12055 {
12056 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12057 "%s: Invalid parameters", __FUNCTION__);
12058 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012059 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012060 }
12061
12062 /*-----------------------------------------------------------------------
12063 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012064 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012065 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012066 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012067 0,
12068 &pSendBuffer, &usDataOffset, &usSendSize))||
12069 ( usSendSize < (usDataOffset )))
12070 {
12071 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12072 "Unable to get send buffer in Exit UAPSD req %x %x",
12073 pEventData, wdiExitUapsdRspCb);
12074 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012075 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012076 }
12077
12078 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012079 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012080 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012081 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12082 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012083}/*WDI_ProcessExitUapsdReq*/
12084
12085/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012086 @brief Process Set UAPSD params Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012087 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012088
12089 @param pWDICtx: pointer to the WLAN DAL context
12090 pEventData: pointer to the event information structure
12091
Jeff Johnson295189b2012-06-20 16:38:30 -070012092 @see
12093 @return Result of the function call
12094*/
12095WDI_Status
12096WDI_ProcessSetUapsdAcParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012097(
Jeff Johnson295189b2012-06-20 16:38:30 -070012098 WDI_ControlBlockType* pWDICtx,
12099 WDI_EventInfoType* pEventData
12100)
12101{
12102 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
12103 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012104 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012105 wpt_uint16 usDataOffset = 0;
12106 wpt_uint16 usSendSize = 0;
12107 tUapsdInfo uapsdAcParamsReq;
12108 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12109
12110 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012111 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012112 -------------------------------------------------------------------------*/
12113 if (( NULL == pEventData ) ||
12114 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
12115 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
12116 {
12117 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12118 "%s: Invalid parameters", __FUNCTION__);
12119 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012120 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012121 }
12122
12123 /*-----------------------------------------------------------------------
12124 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012125 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012126 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012127 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012128 sizeof(uapsdAcParamsReq),
12129 &pSendBuffer, &usDataOffset, &usSendSize))||
12130 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
12131 {
12132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12133 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12134 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
12135 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012136 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012137 }
12138
12139 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
12140 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
12141 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
12142 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
12143 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
12144 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
12145
Jeff Johnsone7245742012-09-05 17:12:55 -070012146 wpalMemoryCopy( pSendBuffer+usDataOffset,
12147 &uapsdAcParamsReq,
12148 sizeof(uapsdAcParamsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012149
12150 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012151 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012152
12153 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012154 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012155 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012156 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12157 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012158}/*WDI_ProcessSetUapsdAcParamsReq*/
12159
12160/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012161 @brief Process update UAPSD params Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012162 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012163
12164 @param pWDICtx: pointer to the WLAN DAL context
12165 pEventData: pointer to the event information structure
12166
Jeff Johnson295189b2012-06-20 16:38:30 -070012167 @see
12168 @return Result of the function call
12169*/
12170WDI_Status
12171WDI_ProcessUpdateUapsdParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012172(
Jeff Johnson295189b2012-06-20 16:38:30 -070012173 WDI_ControlBlockType* pWDICtx,
12174 WDI_EventInfoType* pEventData
12175)
12176{
12177 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
12178 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012179 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012180 wpt_uint16 usDataOffset = 0;
12181 wpt_uint16 usSendSize = 0;
12182 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12183
12184 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012185 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012186 -------------------------------------------------------------------------*/
12187 if (( NULL == pEventData ) ||
12188 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
12189 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
12190 {
12191 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12192 "%s: Invalid parameters", __FUNCTION__);
12193 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012194 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012195 }
12196
12197 /*-----------------------------------------------------------------------
12198 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012199 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012200 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012201 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012202 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
12203 &pSendBuffer, &usDataOffset, &usSendSize))||
12204 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
12205 {
12206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12207 "Unable to get send buffer in Update UAPSD params req %x %x %x",
12208 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
12209 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012210 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012211 }
12212
Jeff Johnsone7245742012-09-05 17:12:55 -070012213 wpalMemoryCopy( pSendBuffer+usDataOffset,
12214 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
12215 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012216
12217 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012218 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012219
12220 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012221 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012222 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012223 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12224 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012225}/*WDI_ProcessUpdateUapsdParamsReq*/
12226
12227/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012228 @brief Process Configure RXP filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012229 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012230
12231 @param pWDICtx: pointer to the WLAN DAL context
12232 pEventData: pointer to the event information structure
12233
Jeff Johnson295189b2012-06-20 16:38:30 -070012234 @see
12235 @return Result of the function call
12236*/
12237WDI_Status
12238WDI_ProcessConfigureRxpFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012239(
Jeff Johnson295189b2012-06-20 16:38:30 -070012240 WDI_ControlBlockType* pWDICtx,
12241 WDI_EventInfoType* pEventData
12242)
12243{
12244 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
12245 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012246 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012247 wpt_uint16 usDataOffset = 0;
12248 wpt_uint16 usSendSize = 0;
12249 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12250
12251 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12252
12253 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012254 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012255 -------------------------------------------------------------------------*/
12256 if (( NULL == pEventData ) ||
12257 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12258 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12259 {
12260 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12261 "%s: Invalid parameters", __FUNCTION__);
12262 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012263 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012264 }
12265
12266 /*-----------------------------------------------------------------------
12267 Get message buffer
12268 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012269 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012270 sizeof(halRxpFilterParams),
12271 &pSendBuffer, &usDataOffset, &usSendSize))||
12272 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12273 {
12274 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12275 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12276 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12277 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012278 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012279 }
12280
Jeff Johnsone7245742012-09-05 17:12:55 -070012281 halRxpFilterParams.setMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070012282 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070012283 halRxpFilterParams.setMcstBcstFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070012284 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12285
Jeff Johnsone7245742012-09-05 17:12:55 -070012286 wpalMemoryCopy( pSendBuffer+usDataOffset,
12287 &halRxpFilterParams,
12288 sizeof(halRxpFilterParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070012289
12290 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012291 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012292
12293 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012294 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012295 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012296 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12297 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012298}/*WDI_ProcessConfigureRxpFilterReq*/
12299
12300/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012301 @brief Process set beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012302 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012303
12304 @param pWDICtx: pointer to the WLAN DAL context
12305 pEventData: pointer to the event information structure
12306
Jeff Johnson295189b2012-06-20 16:38:30 -070012307 @see
12308 @return Result of the function call
12309*/
12310WDI_Status
12311WDI_ProcessSetBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012312(
Jeff Johnson295189b2012-06-20 16:38:30 -070012313 WDI_ControlBlockType* pWDICtx,
12314 WDI_EventInfoType* pEventData
12315)
12316{
12317 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12318 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012319 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012320 wpt_uint16 usDataOffset = 0;
12321 wpt_uint16 usSendSize = 0;
12322 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12323
12324 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012325 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012326 -------------------------------------------------------------------------*/
12327 if (( NULL == pEventData ) ||
12328 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12329 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12330 {
12331 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12332 "%s: Invalid parameters", __FUNCTION__);
12333 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012334 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012335 }
12336
12337 /*-----------------------------------------------------------------------
12338 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012339 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012340 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012341 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012342 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12343 &pSendBuffer, &usDataOffset, &usSendSize))||
12344 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12345 {
12346 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12347 "Unable to get send buffer in Set beacon filter req %x %x %x",
12348 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12349 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012350 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012351 }
12352
Jeff Johnsone7245742012-09-05 17:12:55 -070012353 wpalMemoryCopy( pSendBuffer+usDataOffset,
12354 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12355 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12356 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12357 &pwdiBeaconFilterParams->aFilters[0],
12358 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
Jeff Johnson295189b2012-06-20 16:38:30 -070012359
12360 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012361 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012362
12363 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012364 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012365 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012366 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12367 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012368}/*WDI_ProcessSetBeaconFilterReq*/
12369
12370/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012371 @brief Process remove beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012372 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012373
12374 @param pWDICtx: pointer to the WLAN DAL context
12375 pEventData: pointer to the event information structure
12376
Jeff Johnson295189b2012-06-20 16:38:30 -070012377 @see
12378 @return Result of the function call
12379*/
12380WDI_Status
12381WDI_ProcessRemBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012382(
Jeff Johnson295189b2012-06-20 16:38:30 -070012383 WDI_ControlBlockType* pWDICtx,
12384 WDI_EventInfoType* pEventData
12385)
12386{
12387 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12388 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012389 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012390 wpt_uint16 usDataOffset = 0;
12391 wpt_uint16 usSendSize = 0;
12392 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12393
12394 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012395 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012396 -------------------------------------------------------------------------*/
12397 if (( NULL == pEventData ) ||
12398 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12399 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12400 {
12401 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12402 "%s: Invalid parameters", __FUNCTION__);
12403 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012404 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012405 }
12406
12407 /*-----------------------------------------------------------------------
12408 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012409 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012410 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012411 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012412 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12413 &pSendBuffer, &usDataOffset, &usSendSize))||
12414 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12415 {
12416 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12417 "Unable to get send buffer in remove beacon filter req %x %x %x",
12418 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12419 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012420 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012421 }
12422
Jeff Johnsone7245742012-09-05 17:12:55 -070012423 wpalMemoryCopy( pSendBuffer+usDataOffset,
12424 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12425 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012426
12427 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012428 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012429
12430 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012431 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012432 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012433 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12434 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012435}
12436
12437/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012438 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012439 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012440
12441 @param pWDICtx: pointer to the WLAN DAL context
12442 pEventData: pointer to the event information structure
12443
Jeff Johnson295189b2012-06-20 16:38:30 -070012444 @see
12445 @return Result of the function call
12446*/
12447WDI_Status
12448WDI_ProcessSetRSSIThresholdsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012449(
Jeff Johnson295189b2012-06-20 16:38:30 -070012450 WDI_ControlBlockType* pWDICtx,
12451 WDI_EventInfoType* pEventData
12452)
12453{
12454 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12455 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012456 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012457 wpt_uint16 usDataOffset = 0;
12458 wpt_uint16 usSendSize = 0;
12459 tHalRSSIThresholds rssiThresholdsReq;
12460 WDI_Status ret_status = 0;
12461 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12462
12463 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012464 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012465 -------------------------------------------------------------------------*/
12466 if (( NULL == pEventData ) ||
12467 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12468 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12469 {
12470 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12471 "%s: Invalid parameters", __FUNCTION__);
12472 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012473 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012474 }
12475
12476 /*-----------------------------------------------------------------------
12477 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012478 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012479 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012480 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012481 sizeof(rssiThresholdsReq),
12482 &pSendBuffer, &usDataOffset, &usSendSize))||
12483 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12484 {
12485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12486 "Unable to get send buffer in remove beacon filter req %x %x %x",
12487 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12488 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012489 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012490 }
12491
Jeff Johnsone7245742012-09-05 17:12:55 -070012492 rssiThresholdsReq.bReserved10 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012493 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
Jeff Johnsone7245742012-09-05 17:12:55 -070012494 rssiThresholdsReq.bRssiThres1NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012495 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012496 rssiThresholdsReq.bRssiThres1PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012497 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012498 rssiThresholdsReq.bRssiThres2NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012499 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012500 rssiThresholdsReq.bRssiThres2PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012501 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012502 rssiThresholdsReq.bRssiThres3NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012503 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012504 rssiThresholdsReq.bRssiThres3PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012505 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012506 rssiThresholdsReq.ucRssiThreshold1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012507 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
Jeff Johnsone7245742012-09-05 17:12:55 -070012508 rssiThresholdsReq.ucRssiThreshold2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012509 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
Jeff Johnsone7245742012-09-05 17:12:55 -070012510 rssiThresholdsReq.ucRssiThreshold3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012511 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12512
Jeff Johnsone7245742012-09-05 17:12:55 -070012513 wpalMemoryCopy( pSendBuffer+usDataOffset,
12514 &rssiThresholdsReq,
12515 sizeof(rssiThresholdsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012516
12517 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012518 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012519
12520 /*-------------------------------------------------------------------------
12521 Send Set threshold req to HAL
12522 -------------------------------------------------------------------------*/
12523 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12524 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12525 {
12526 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12527 // req. Then as a result of processing the threshold cross ind, we trigger
12528 // a Set threshold req, then we need to indicate to WDI that it needs to
12529 // go to busy state as a result of the indication as we sent a req in the
12530 // same WDI context.
12531 // Hence expected state transition is to busy.
12532 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12533 }
12534
12535 return ret_status;
12536}
12537
12538/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012539 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012540 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012541
12542 @param pWDICtx: pointer to the WLAN DAL context
12543 pEventData: pointer to the event information structure
12544
Jeff Johnson295189b2012-06-20 16:38:30 -070012545 @see
12546 @return Result of the function call
12547*/
12548WDI_Status
12549WDI_ProcessHostOffloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012550(
Jeff Johnson295189b2012-06-20 16:38:30 -070012551 WDI_ControlBlockType* pWDICtx,
12552 WDI_EventInfoType* pEventData
12553)
12554{
12555 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12556 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012557 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012558 wpt_uint16 usDataOffset = 0;
12559 wpt_uint16 usSendSize = 0;
12560 tHalHostOffloadReq hostOffloadParams;
12561 tHalNSOffloadParams nsOffloadParams;
12562
12563 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12564
12565 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012566 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012567 -------------------------------------------------------------------------*/
12568 if (( NULL == pEventData ) ||
12569 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12570 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12571 {
12572 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12573 "%s: Invalid parameters", __FUNCTION__);
12574 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012575 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012576 }
12577
12578 /*-----------------------------------------------------------------------
12579 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012580 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012581 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012582 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012583 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12584 &pSendBuffer, &usDataOffset, &usSendSize))||
12585 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12586 {
12587 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12588 "Unable to get send buffer in host offload req %x %x %x",
12589 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12590 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012591 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012592 }
12593
12594 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12595 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012596
Jeff Johnson295189b2012-06-20 16:38:30 -070012597 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12598 {
12599 // ARP Offload
12600 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12601 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12602 4);
12603 }
12604 else
12605 {
12606 // NS Offload
12607 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12608 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12609 16);
12610
12611#ifdef WLAN_NS_OFFLOAD
12612 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12613 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12614 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12615 16);
12616 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12617 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12618 16);
12619 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12620 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12621 16);
12622 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12623 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12624 16);
12625 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12626 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12627 6);
12628 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12629 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12630 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
Jeff Johnsone7245742012-09-05 17:12:55 -070012631
12632 nsOffloadParams.bssIdx = pwdiHostOffloadParams->wdiNsOffloadParams.bssIdx;
12633
Jeff Johnson295189b2012-06-20 16:38:30 -070012634#endif // WLAN_NS_OFFLOAD
12635 }
12636
12637 // copy hostOffloadParams into pSendBuffer
12638 wpalMemoryCopy( pSendBuffer+usDataOffset,
12639 &hostOffloadParams,
12640 sizeof(hostOffloadParams));
12641
12642#ifdef WLAN_NS_OFFLOAD
12643 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12644 {
12645 // copy nsOffloadParams into pSendBuffer
12646 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12647 &nsOffloadParams,
12648 sizeof(nsOffloadParams));
12649 }
12650#endif // WLAN_NS_OFFLOAD
12651
12652 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012653 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012654
12655 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012656 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012657 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012658 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12659 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012660}/*WDI_ProcessHostOffloadReq*/
12661
12662/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012663 @brief Process Keep Alive Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012664 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012665
12666 @param pWDICtx: pointer to the WLAN DAL context
12667 pEventData: pointer to the event information structure
12668
Jeff Johnson295189b2012-06-20 16:38:30 -070012669 @see
12670 @return Result of the function call
12671*/
12672WDI_Status
12673WDI_ProcessKeepAliveReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012674(
Jeff Johnson295189b2012-06-20 16:38:30 -070012675 WDI_ControlBlockType* pWDICtx,
12676 WDI_EventInfoType* pEventData
12677)
12678{
12679 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12680 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012681 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012682 wpt_uint16 usDataOffset = 0;
12683 wpt_uint16 usSendSize = 0;
12684 tHalKeepAliveReq keepAliveReq;
12685 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12686
12687 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012688 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012689 -------------------------------------------------------------------------*/
12690 if (( NULL == pEventData ) ||
12691 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12692 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12693 {
12694 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12695 "Invalid parameters in Keep Alive req");
12696 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012697 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012698 }
12699
12700 /*-----------------------------------------------------------------------
12701 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012702 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012703 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012704 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012705 sizeof(keepAliveReq),
12706 &pSendBuffer, &usDataOffset, &usSendSize))||
12707 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12708 {
12709 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12710 "Unable to get send buffer in keep alive req %x %x %x",
12711 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12712 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012713 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012714 }
12715
12716 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12717 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12718
Jeff Johnsone7245742012-09-05 17:12:55 -070012719 keepAliveReq.bssIdx = pwdiKeepAliveParams->wdiKeepAliveInfo.bssIdx;
12720
Jeff Johnson295189b2012-06-20 16:38:30 -070012721 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12722 {
12723 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12724 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12725 HAL_IPV4_ADDR_LEN);
12726 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12727 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
Jeff Johnsone7245742012-09-05 17:12:55 -070012728 HAL_IPV4_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070012729 wpalMemoryCopy(keepAliveReq.destMacAddr,
12730 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12731 HAL_MAC_ADDR_LEN);
12732 }
Jeff Johnsone7245742012-09-05 17:12:55 -070012733
12734 wpalMemoryCopy( pSendBuffer+usDataOffset,
12735 &keepAliveReq,
12736 sizeof(keepAliveReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012737
12738 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12739 "Process keep alive req %d",sizeof(keepAliveReq));
12740
12741 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12742 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12743
12744 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012745 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012746
12747 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12748 "Sending keep alive req to HAL");
12749
12750 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012751 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012752 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012753 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12754 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012755}/*WDI_ProcessKeepAliveReq*/
12756
12757
12758/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012759 @brief Process Wowl add bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012760 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012761
12762 @param pWDICtx: pointer to the WLAN DAL context
12763 pEventData: pointer to the event information structure
12764
Jeff Johnson295189b2012-06-20 16:38:30 -070012765 @see
12766 @return Result of the function call
12767*/
12768WDI_Status
12769WDI_ProcessWowlAddBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012770(
Jeff Johnson295189b2012-06-20 16:38:30 -070012771 WDI_ControlBlockType* pWDICtx,
12772 WDI_EventInfoType* pEventData
12773)
12774{
12775 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12776 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012777 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012778 wpt_uint16 usDataOffset = 0;
12779 wpt_uint16 usSendSize = 0;
12780 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
12781 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12782
12783 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012784 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012785 -------------------------------------------------------------------------*/
12786 if (( NULL == pEventData ) ||
12787 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12788 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12789 {
12790 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12791 "%s: Invalid parameters", __FUNCTION__);
12792 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012793 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012794 }
12795
12796 /*-----------------------------------------------------------------------
12797 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012798 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012799 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012800 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012801 sizeof(wowlAddBcPtrnReq),
12802 &pSendBuffer, &usDataOffset, &usSendSize))||
12803 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12804 {
12805 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12806 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12807 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12808 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012809 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012810 }
12811
Jeff Johnsone7245742012-09-05 17:12:55 -070012812 wowlAddBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012813 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012814 wowlAddBcPtrnReq.ucPatternByteOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070012815 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070012816 wowlAddBcPtrnReq.ucPatternMaskSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012817 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
Jeff Johnsone7245742012-09-05 17:12:55 -070012818 wowlAddBcPtrnReq.ucPatternSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012819 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12820
12821 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12822 {
12823 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12824 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12825 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12826 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12827 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12828 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12829 }
12830 else
12831 {
12832 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12833 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12834 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12835 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12836 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12837 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12838
12839 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12840 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12841 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12842 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12843 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12844 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12845 }
12846
12847 wpalMemoryCopy( pSendBuffer+usDataOffset,
12848 &wowlAddBcPtrnReq,
12849 sizeof(wowlAddBcPtrnReq));
12850
12851 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012852 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012853
12854 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012855 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012856 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012857 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12858 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012859}/*WDI_ProcessWowlAddBcPtrnReq*/
12860
12861/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012862 @brief Process Wowl delete bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012863 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012864
12865 @param pWDICtx: pointer to the WLAN DAL context
12866 pEventData: pointer to the event information structure
12867
Jeff Johnson295189b2012-06-20 16:38:30 -070012868 @see
12869 @return Result of the function call
12870*/
12871WDI_Status
12872WDI_ProcessWowlDelBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012873(
Jeff Johnson295189b2012-06-20 16:38:30 -070012874 WDI_ControlBlockType* pWDICtx,
12875 WDI_EventInfoType* pEventData
12876)
12877{
12878 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12879 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012880 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012881 wpt_uint16 usDataOffset = 0;
12882 wpt_uint16 usSendSize = 0;
12883 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
12884 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12885
12886 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012887 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012888 -------------------------------------------------------------------------*/
12889 if (( NULL == pEventData ) ||
12890 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12891 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12892 {
12893 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12894 "%s: Invalid parameters", __FUNCTION__);
12895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012897 }
12898
12899 /*-----------------------------------------------------------------------
12900 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012901 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012902 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012903 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012904 sizeof(wowlDelBcPtrnReq),
12905 &pSendBuffer, &usDataOffset, &usSendSize))||
12906 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12907 {
12908 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12909 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12910 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12911 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012912 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012913 }
12914
Jeff Johnsone7245742012-09-05 17:12:55 -070012915 wowlDelBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012916 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012917 wpalMemoryCopy( pSendBuffer+usDataOffset,
12918 &wowlDelBcPtrnReq,
12919 sizeof(wowlDelBcPtrnReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012920
12921 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012922 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012923
12924 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012925 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012926 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012927 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12928 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012929}/*WDI_ProcessWowlDelBcPtrnReq*/
12930
12931/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012932 @brief Process Wowl enter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012933 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012934
12935 @param pWDICtx: pointer to the WLAN DAL context
12936 pEventData: pointer to the event information structure
12937
Jeff Johnson295189b2012-06-20 16:38:30 -070012938 @see
12939 @return Result of the function call
12940*/
12941WDI_Status
12942WDI_ProcessWowlEnterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012943(
Jeff Johnson295189b2012-06-20 16:38:30 -070012944 WDI_ControlBlockType* pWDICtx,
12945 WDI_EventInfoType* pEventData
12946)
12947{
12948 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
12949 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012950 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012951 wpt_uint16 usDataOffset = 0;
12952 wpt_uint16 usSendSize = 0;
12953 tHalWowlEnterParams wowlEnterReq;
12954 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12955
12956 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012957 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012958 -------------------------------------------------------------------------*/
12959 if (( NULL == pEventData ) ||
12960 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
12961 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
12962 {
12963 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12964 "%s: Invalid parameters", __FUNCTION__);
12965 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012966 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012967 }
12968
12969 /*-----------------------------------------------------------------------
12970 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012971 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012972 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012973 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012974 sizeof(wowlEnterReq),
12975 &pSendBuffer, &usDataOffset, &usSendSize))||
12976 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
12977 {
12978 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12979 "Unable to get send buffer in Wowl enter req %x %x %x",
12980 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
12981 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012982 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012983 }
12984
Jeff Johnsone7245742012-09-05 17:12:55 -070012985 wowlEnterReq.ucMagicPktEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012986 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012987 wowlEnterReq.ucPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012988 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012989 wowlEnterReq.ucUcastPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012990 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012991 wowlEnterReq.ucWowChnlSwitchRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012992 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012993 wowlEnterReq.ucWowDeauthRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012994 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012995 wowlEnterReq.ucWowDisassocRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012996 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012997 wowlEnterReq.ucWowMaxMissedBeacons =
Jeff Johnson295189b2012-06-20 16:38:30 -070012998 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
Jeff Johnsone7245742012-09-05 17:12:55 -070012999 wowlEnterReq.ucWowMaxSleepUsec =
Jeff Johnson295189b2012-06-20 16:38:30 -070013000 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
13001
13002#ifdef WLAN_WAKEUP_EVENTS
13003 wowlEnterReq.ucWoWEAPIDRequestEnable =
13004 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
13005
13006 wowlEnterReq.ucWoWEAPOL4WayEnable =
13007 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
13008
13009 wowlEnterReq.ucWowNetScanOffloadMatch =
13010 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
13011
13012 wowlEnterReq.ucWowGTKRekeyError =
13013 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
13014
13015 wowlEnterReq.ucWoWBSSConnLoss =
13016 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
13017#endif // WLAN_WAKEUP_EVENTS
13018
13019 wpalMemoryCopy(wowlEnterReq.magicPtrn,
13020 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
13021 sizeof(tSirMacAddr));
13022
Jeff Johnsone7245742012-09-05 17:12:55 -070013023 wpalMemoryCopy( pSendBuffer+usDataOffset,
13024 &wowlEnterReq,
13025 sizeof(wowlEnterReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013026
13027 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013028 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013029
13030 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013031 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013032 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013033 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13034 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013035}/*WDI_ProcessWowlEnterReq*/
13036
13037/**
13038 @brief Process Wowl exit Request function (called when Main FSM
13039 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013040
13041 @param pWDICtx: pointer to the WLAN DAL context
13042 pEventData: pointer to the event information structure
13043
Jeff Johnson295189b2012-06-20 16:38:30 -070013044 @see
13045 @return Result of the function call
13046*/
13047WDI_Status
13048WDI_ProcessWowlExitReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013049(
Jeff Johnson295189b2012-06-20 16:38:30 -070013050 WDI_ControlBlockType* pWDICtx,
13051 WDI_EventInfoType* pEventData
13052)
13053{
13054 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013055 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013056 wpt_uint16 usDataOffset = 0;
13057 wpt_uint16 usSendSize = 0;
13058 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13059
13060 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013061 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013062 -------------------------------------------------------------------------*/
13063 if (( NULL == pEventData ) ||
13064 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
13065 {
13066 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13067 "%s: Invalid parameters", __FUNCTION__);
13068 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013069 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013070 }
13071
13072 /*-----------------------------------------------------------------------
13073 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013074 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013075 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013076 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013077 0,
13078 &pSendBuffer, &usDataOffset, &usSendSize))||
13079 ( usSendSize < (usDataOffset )))
13080 {
13081 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13082 "Unable to get send buffer in Wowl Exit req %x %x",
13083 pEventData, wdiWowlExitCb);
13084 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013085 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013086 }
13087
13088 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013089 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013090 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013091 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13092 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013093}/*WDI_ProcessWowlExitReq*/
13094
13095/**
13096 @brief Process Configure Apps Cpu Wakeup State Request function
13097 (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013098
13099 @param pWDICtx: pointer to the WLAN DAL context
13100 pEventData: pointer to the event information structure
13101
Jeff Johnson295189b2012-06-20 16:38:30 -070013102 @see
13103 @return Result of the function call
13104*/
13105WDI_Status
13106WDI_ProcessConfigureAppsCpuWakeupStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013107(
Jeff Johnson295189b2012-06-20 16:38:30 -070013108 WDI_ControlBlockType* pWDICtx,
13109 WDI_EventInfoType* pEventData
13110)
13111{
13112 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
13113 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013114 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013115 wpt_uint16 usDataOffset = 0;
13116 wpt_uint16 usSendSize = 0;
13117 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
13118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13119
13120 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013121 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013122 -------------------------------------------------------------------------*/
13123 if (( NULL == pEventData ) ||
13124 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
13125 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
13126 {
13127 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13128 "%s: Invalid parameters", __FUNCTION__);
13129 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013130 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013131 }
13132
13133 /*-----------------------------------------------------------------------
13134 Get message buffer
13135 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013136 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013137 sizeof(halCfgAppsCpuWakeupStateReqParams),
13138 &pSendBuffer, &usDataOffset, &usSendSize))||
13139 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
13140 {
13141 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13142 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
13143 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
13144 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013145 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013146 }
13147
Jeff Johnsone7245742012-09-05 17:12:55 -070013148 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
Jeff Johnson295189b2012-06-20 16:38:30 -070013149 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
13150
Jeff Johnsone7245742012-09-05 17:12:55 -070013151 wpalMemoryCopy( pSendBuffer+usDataOffset,
13152 &halCfgAppsCpuWakeupStateReqParams,
13153 sizeof(halCfgAppsCpuWakeupStateReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013154
13155 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013156 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013157
13158 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013159 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013160 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013161 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13162 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
13163 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013164}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
13165
13166#ifdef WLAN_FEATURE_VOWIFI_11R
13167/**
13168 @brief Process Aggregated Add TSpec Request function (called when Main FSM
13169 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013170
13171 @param pWDICtx: pointer to the WLAN DAL context
13172 pEventData: pointer to the event information structure
13173
Jeff Johnson295189b2012-06-20 16:38:30 -070013174 @see
13175 @return Result of the function call
13176*/
13177WDI_Status
13178WDI_ProcessAggrAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013179(
Jeff Johnson295189b2012-06-20 16:38:30 -070013180 WDI_ControlBlockType* pWDICtx,
13181 WDI_EventInfoType* pEventData
13182)
13183{
13184 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
13185 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013186 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070013187 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013188 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013189 wpt_uint16 usDataOffset = 0;
13190 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070013191 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013192 wpt_macAddr macBSSID;
13193 tAggrAddTsReq halAggrAddTsReq;
13194 int i;
13195 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13196
13197 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013198 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013199 -------------------------------------------------------------------------*/
13200 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
13201 ( NULL == pEventData->pCBfnc ))
13202 {
13203 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13204 "%s: Invalid parameters", __FUNCTION__);
13205 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013206 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013207 }
13208 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
13209 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
13210 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
13211 /*-------------------------------------------------------------------------
13212 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070013213 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070013214 -------------------------------------------------------------------------*/
13215 wpalMutexAcquire(&pWDICtx->wptMutex);
13216
13217 /*------------------------------------------------------------------------
13218 Find the BSS for which the request is made and identify WDI session
13219 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013220 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
13221 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070013222 &macBSSID))
13223 {
13224 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13225 "This station does not exist in the WDI Station Table %d");
13226 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013227 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013228 }
13229
Jeff Johnsone7245742012-09-05 17:12:55 -070013230 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
13231 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070013232 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013233 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13234 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
13235 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013236
13237 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013238 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070013239 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013240
Jeff Johnson295189b2012-06-20 16:38:30 -070013241 /*------------------------------------------------------------------------
13242 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070013243 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070013244 ------------------------------------------------------------------------*/
13245 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
13246 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013247 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13248 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
13249 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013250
Jeff Johnsone7245742012-09-05 17:12:55 -070013251 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070013252 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013253 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070013254 }
13255
13256 wpalMutexRelease(&pWDICtx->wptMutex);
13257 /*-----------------------------------------------------------------------
13258 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013259 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013260 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013261 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013262 sizeof(tAggrAddTsParams),
13263 &pSendBuffer, &usDataOffset, &usSendSize))||
13264 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13265 {
13266 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13267 "Unable to get send buffer in set bss key req %x %x %x",
13268 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13269 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013271 }
13272
Jeff Johnsone7245742012-09-05 17:12:55 -070013273 halAggrAddTsReq.aggrAddTsParam.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013274 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070013275 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013276 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13277
13278 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13279 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013280 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
Jeff Johnson295189b2012-06-20 16:38:30 -070013281 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013282 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
Jeff Johnson295189b2012-06-20 16:38:30 -070013283 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -070013284 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013285 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13286 ackPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013287 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013288 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13289 accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013290 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -070013291 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13292 userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -070013293 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -070013294 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13295 psb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013296 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -070013297 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13298 aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -070013299 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -070013300 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13301 direction;
Jeff Johnsone7245742012-09-05 17:12:55 -070013302 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013303 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13304 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013305 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013306 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13307 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013308 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -070013309 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -070013310 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -070013311 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
Jeff Johnsone7245742012-09-05 17:12:55 -070013312
13313
13314 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013315 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013316 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013317 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013318 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013319 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013320 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013321 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013322 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013323 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013324 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013325 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013326 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013327 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070013328 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013329 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013330 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013331 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013332 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013333 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013334 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013335 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013336 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -070013337 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -070013338 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013339 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013340 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -070013341 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -070013342 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013343 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13344 }
13345
Jeff Johnsone7245742012-09-05 17:12:55 -070013346 wpalMemoryCopy( pSendBuffer+usDataOffset,
13347 &halAggrAddTsReq,
13348 sizeof(halAggrAddTsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013349
13350 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013351 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013352
13353 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013354 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013355 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013356 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070013357 wdiAggrAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070013358 WDI_AGGR_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013359}/*WDI_ProcessAggrAddTSpecReq*/
13360#endif /* WLAN_FEATURE_VOWIFI_11R */
13361
13362/**
13363 @brief Process Shutdown Request function (called when Main FSM
13364 allows it)
13365
13366 @param pWDICtx: pointer to the WLAN DAL context
13367 pEventData: pointer to the event information structure
13368
13369 @see
13370 @return Result of the function call
13371*/
13372WDI_Status
13373WDI_ProcessShutdownReq
13374(
13375 WDI_ControlBlockType* pWDICtx,
13376 WDI_EventInfoType* pEventData
13377 )
13378{
13379 wpt_status wptStatus;
13380
13381
13382 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13383
13384 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013385 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013386 -------------------------------------------------------------------------*/
13387 if ( NULL == pEventData )
13388 {
13389 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13390 "%s: Invalid parameters", __FUNCTION__);
13391 WDI_ASSERT(0);
13392 return WDI_STATUS_E_FAILURE;
13393 }
13394
13395 wpalMutexAcquire(&pWDICtx->wptMutex);
13396
13397
13398 gWDIInitialized = eWLAN_PAL_FALSE;
13399 /*! TO DO: stop the data services */
13400 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13401 {
13402 /*Stop the STA Table !UT- check this logic again
13403 It is safer to do it here than on the response - because a stop is imminent*/
13404 WDI_STATableStop(pWDICtx);
13405
13406 /* Stop Transport Driver, DXE */
13407 WDTS_Stop(pWDICtx);
13408 }
13409
13410 /*Clear all pending request*/
13411 WDI_ClearPendingRequests(pWDICtx);
13412 /* Close Data transport*/
13413 /* FTM mode does not open Data Path */
13414 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13415 {
13416 WDTS_Close(pWDICtx);
13417 }
13418 /*Close the STA Table !UT- check this logic again*/
13419 WDI_STATableClose(pWDICtx);
13420 /*close the PAL */
13421 wptStatus = wpalClose(pWDICtx->pPALContext);
13422 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13423 {
13424 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13425 "Failed to wpal Close %d", wptStatus);
13426 WDI_ASSERT(0);
13427 }
13428
13429 /*Transition back to init state*/
13430 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13431
13432 wpalMutexRelease(&pWDICtx->wptMutex);
13433
13434 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013435 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070013436
13437
Jeff Johnsone7245742012-09-05 17:12:55 -070013438 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013439}/*WDI_ProcessShutdownReq*/
13440
13441/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013442 Main DAL Control Path Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070013443========================================================================*/
13444
13445/**
13446 @brief Process Start Response function (called when a response
13447 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013448
13449 @param pWDICtx: pointer to the WLAN DAL context
13450 pEventData: pointer to the event information structure
13451
Jeff Johnson295189b2012-06-20 16:38:30 -070013452 @see
13453 @return Result of the function call
13454*/
13455WDI_Status
13456WDI_ProcessStartRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013457(
Jeff Johnson295189b2012-06-20 16:38:30 -070013458 WDI_ControlBlockType* pWDICtx,
13459 WDI_EventInfoType* pEventData
13460)
13461{
13462 WDI_StartRspParamsType wdiRspParams;
13463 WDI_StartRspCb wdiStartRspCb = NULL;
13464
13465 tHalMacStartRspParams* startRspParams;
13466
13467#ifndef HAL_SELF_STA_PER_BSS
13468 WDI_AddStaParams wdiAddSTAParam = {0};
13469#endif
13470 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13471
Jeff Johnsone7245742012-09-05 17:12:55 -070013472 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013473 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013474 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013475 -------------------------------------------------------------------------*/
13476 if (( NULL == pEventData ) ||
13477 ( NULL == pEventData->pEventData) ||
13478 ( NULL == wdiStartRspCb ))
13479 {
13480 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13481 "%s: Invalid parameters", __FUNCTION__);
13482 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013483 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013484 }
13485
13486 /*-------------------------------------------------------------------------
13487 Extract response and send it to UMAC
13488 -------------------------------------------------------------------------*/
13489 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13490 {
13491 // not enough data was received
13492 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13493 "Invalid response length in Start Resp Expect %x Rcvd %x",
13494 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13495 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013496 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013497 }
13498
13499 /*-------------------------------------------------------------------------
13500 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013501 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013502 -------------------------------------------------------------------------*/
13503 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13504
13505 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13506 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13507 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13508 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13509 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13510 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13511 wdiRspParams.wlanReportedVersion.major =
13512 startRspParams->wcnssWlanVersion.major;
13513 wdiRspParams.wlanReportedVersion.minor =
13514 startRspParams->wcnssWlanVersion.minor;
13515 wdiRspParams.wlanReportedVersion.version =
13516 startRspParams->wcnssWlanVersion.version;
13517 wdiRspParams.wlanReportedVersion.revision =
13518 startRspParams->wcnssWlanVersion.revision;
13519 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13520 startRspParams->wcnssCrmVersionString,
13521 sizeof(wdiRspParams.wcnssSoftwareVersion));
13522 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13523 startRspParams->wcnssWlanVersionString,
13524 sizeof(wdiRspParams.wcnssHardwareVersion));
13525 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13526
13527 wpalMutexAcquire(&pWDICtx->wptMutex);
13528 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13529 {
13530 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13531
13532 /*Cache the start response for further use*/
13533 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
Jeff Johnsone7245742012-09-05 17:12:55 -070013534 &wdiRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070013535 sizeof(pWDICtx->wdiCachedStartRspParams));
13536
13537 }
13538 else
13539 {
13540 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13541 "Failed to start device with status %s(%d)",
13542 WDI_getHALStatusMsgString(startRspParams->status),
13543 startRspParams->status);
13544
13545 /*Set the expected state transition to stopped - because the start has
13546 failed*/
13547 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13548
13549 wpalMutexRelease(&pWDICtx->wptMutex);
13550
13551 /*Notify UMAC*/
13552 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
Jeff Johnsone7245742012-09-05 17:12:55 -070013553
Jeff Johnson295189b2012-06-20 16:38:30 -070013554 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13555
13556 /*Although the response is an error - it was processed by our function
13557 so as far as the caller is concerned this is a succesful reponse processing*/
13558 return WDI_STATUS_SUCCESS;
13559 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013560
Jeff Johnson295189b2012-06-20 16:38:30 -070013561 wpalMutexRelease(&pWDICtx->wptMutex);
13562
13563 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13564 {
13565 /* FTM mode does not need to execute below */
13566 /* Notify UMAC */
13567 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13568 return WDI_STATUS_SUCCESS;
13569 }
13570
13571 /* START the Data transport */
13572 WDTS_startTransport(pWDICtx);
13573
13574 /*Start the STA Table !- check this logic again*/
13575 WDI_STATableStart(pWDICtx);
13576
13577#ifndef HAL_SELF_STA_PER_BSS
13578 /* Store the Self STA Index */
13579 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13580
13581 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13582 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13583 WDI_MAC_ADDR_LEN);
13584
13585 /* At this point add the self-STA */
13586
13587 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13588 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13589 /*! TO DO: wdiAddSTAParam.dpuSig */
13590 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13591 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13592 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13593
13594 //all DPU indices are the same for self STA
13595 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13596 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13597 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13598 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13599 WDI_MAC_ADDR_LEN);
13600 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13601 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13602
13603 /* Note: Since we don't get an explicit config STA request for self STA, we
13604 add the self STA upon receiving the Start response message. But the
13605 self STA entry in the table is deleted when WDI gets an explicit delete STA
13606 request */
13607 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13608#endif
13609
13610 /*Notify UMAC*/
13611 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13612
Jeff Johnsone7245742012-09-05 17:12:55 -070013613 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013614}/*WDI_ProcessStartRsp*/
13615
13616
13617/**
13618 @brief Process Stop Response function (called when a response
13619 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013620
13621 @param pWDICtx: pointer to the WLAN DAL context
13622 pEventData: pointer to the event information structure
13623
Jeff Johnson295189b2012-06-20 16:38:30 -070013624 @see
13625 @return Result of the function call
13626*/
13627WDI_Status
13628WDI_ProcessStopRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013629(
Jeff Johnson295189b2012-06-20 16:38:30 -070013630 WDI_ControlBlockType* pWDICtx,
13631 WDI_EventInfoType* pEventData
13632)
13633{
13634 WDI_Status wdiStatus;
13635 WDI_StopRspCb wdiStopRspCb = NULL;
13636
Jeff Johnsone7245742012-09-05 17:12:55 -070013637 tHalMacStopRspMsg halMacStopRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013638 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13639
Jeff Johnsone7245742012-09-05 17:12:55 -070013640 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013641 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013642 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013643 -------------------------------------------------------------------------*/
13644 if (( NULL == pEventData ) ||
13645 ( NULL == pEventData->pEventData) ||
13646 ( NULL == wdiStopRspCb ))
13647 {
13648 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13649 "%s: Invalid parameters", __FUNCTION__);
13650 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013651 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013652 }
13653
13654 /*-------------------------------------------------------------------------
13655 Extract response and send it to UMAC
13656 -------------------------------------------------------------------------*/
13657 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13658 {
13659 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13660 "Invalid response length in Stop Resp %x %x",
13661 pEventData->uEventDataSize);
13662 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013663 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013664 }
13665
13666 /*-------------------------------------------------------------------------
13667 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013668 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013669 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013670 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13671 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013672 sizeof(halMacStopRspMsg.stopRspParams));
13673
Jeff Johnsone7245742012-09-05 17:12:55 -070013674 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013675
13676 wpalMutexAcquire(&pWDICtx->wptMutex);
13677
13678 /*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013679 Check to see if the stop went OK
Jeff Johnson295189b2012-06-20 16:38:30 -070013680 --------------------------------------------------------------------------*/
13681 if ( WDI_STATUS_SUCCESS != wdiStatus )
13682 {
13683 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13684 "Failed to stop the device with status %s (%d)",
13685 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13686 halMacStopRspMsg.stopRspParams.status);
13687
Jeff Johnsone7245742012-09-05 17:12:55 -070013688 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13689
Jeff Johnson295189b2012-06-20 16:38:30 -070013690 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013691 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013692 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013693
Jeff Johnson295189b2012-06-20 16:38:30 -070013694 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13695
13696 /*Transition now as WDI may get preempted imediately after it sends
13697 up the Stop Response and it will not get to process the state transition
13698 from Main Rsp function*/
13699 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13700 wpalMutexRelease(&pWDICtx->wptMutex);
13701
13702 /*! TO DO: - STOP the Data transport */
13703
13704 /*Notify UMAC*/
13705 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13706
Jeff Johnsone7245742012-09-05 17:12:55 -070013707 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013708}/*WDI_ProcessStopRsp*/
13709
13710/**
13711 @brief Process Close Rsp function (called when a response
13712 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013713
13714 @param pWDICtx: pointer to the WLAN DAL context
13715 pEventData: pointer to the event information structure
13716
Jeff Johnson295189b2012-06-20 16:38:30 -070013717 @see
13718 @return Result of the function call
13719*/
13720WDI_Status
13721WDI_ProcessCloseRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013722(
Jeff Johnson295189b2012-06-20 16:38:30 -070013723 WDI_ControlBlockType* pWDICtx,
13724 WDI_EventInfoType* pEventData
13725)
13726{
13727 /*There is no close response comming from HAL - function just kept for
13728 simmetry */
13729 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013730 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013731}/*WDI_ProcessCloseRsp*/
13732
13733
13734/*============================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013735 SCAN RESPONSE PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -070013736============================================================================*/
13737
13738/**
13739 @brief Process Init Scan Rsp function (called when a response
13740 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013741
13742 @param pWDICtx: pointer to the WLAN DAL context
13743 pEventData: pointer to the event information structure
13744
Jeff Johnson295189b2012-06-20 16:38:30 -070013745 @see
13746 @return Result of the function call
13747*/
13748WDI_Status
13749WDI_ProcessInitScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013750(
Jeff Johnson295189b2012-06-20 16:38:30 -070013751 WDI_ControlBlockType* pWDICtx,
13752 WDI_EventInfoType* pEventData
13753)
13754{
13755 WDI_Status wdiStatus;
13756 WDI_InitScanRspCb wdiInitScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013757 tHalInitScanRspMsg halInitScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013758 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13759
13760 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013761 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013762 -------------------------------------------------------------------------*/
13763 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13764 ( NULL == pEventData->pEventData))
13765 {
13766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13767 "%s: Invalid parameters", __FUNCTION__);
13768 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013769 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013770 }
13771
13772 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13773 if( NULL == wdiInitScanRspCb)
13774 {
13775 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13776 "%s: call back function is NULL", __FUNCTION__);
13777 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013778 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013779 }
13780
13781 /*-------------------------------------------------------------------------
13782 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013783 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013784 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013785 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13786 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013787 sizeof(halInitScanRspMsg.initScanRspParams));
13788
Jeff Johnsone7245742012-09-05 17:12:55 -070013789 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013790
13791 if ( pWDICtx->bInBmps )
13792 {
13793 // notify DTS that we are entering Full power
13794 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13795 }
13796
13797 /*Notify UMAC*/
13798 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13799
Jeff Johnsone7245742012-09-05 17:12:55 -070013800 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013801}/*WDI_ProcessInitScanRsp*/
13802
13803
13804/**
13805 @brief Process Start Scan Rsp function (called when a response
13806 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013807
13808 @param pWDICtx: pointer to the WLAN DAL context
13809 pEventData: pointer to the event information structure
13810
Jeff Johnson295189b2012-06-20 16:38:30 -070013811 @see
13812 @return Result of the function call
13813*/
13814WDI_Status
13815WDI_ProcessStartScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013816(
Jeff Johnson295189b2012-06-20 16:38:30 -070013817 WDI_ControlBlockType* pWDICtx,
13818 WDI_EventInfoType* pEventData
13819)
13820{
13821 WDI_StartScanRspParamsType wdiStartScanParams;
13822 WDI_StartScanRspCb wdiStartScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013823
13824 tHalStartScanRspMsg halStartScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013825 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13826
13827 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013828 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013829 -------------------------------------------------------------------------*/
13830 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13831 ( NULL == pEventData->pEventData))
13832 {
13833 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13834 "%s: Invalid parameters", __FUNCTION__);
13835 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013836 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013837 }
13838
13839 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13840 if( NULL == wdiStartScanRspCb)
13841 {
13842 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13843 "%s: call back function is NULL", __FUNCTION__);
13844 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013845 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013846 }
13847
13848 /*-------------------------------------------------------------------------
13849 Extract response and send it to UMAC
13850 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013851 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13852 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013853 sizeof(halStartScanRspMsg.startScanRspParams));
13854
13855 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13856 halStartScanRspMsg.startScanRspParams.status);
13857#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070013858 wdiStartScanParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070013859 halStartScanRspMsg.startScanRspParams.txMgmtPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070013860 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
Jeff Johnson295189b2012-06-20 16:38:30 -070013861 halStartScanRspMsg.startScanRspParams.startTSF,
13862 2);
Jeff Johnsone7245742012-09-05 17:12:55 -070013863#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070013864
13865 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13866 {
13867 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13868 "Start scan failed with status %s (%d)",
13869 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13870 halStartScanRspMsg.startScanRspParams.status);
13871 /* send the status to UMAC, don't return from here*/
13872 }
13873
13874 /*Notify UMAC*/
13875 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13876
Jeff Johnsone7245742012-09-05 17:12:55 -070013877 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013878
13879}/*WDI_ProcessStartScanRsp*/
13880
13881
13882/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013883 @brief Process End Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013884 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013885
13886 @param pWDICtx: pointer to the WLAN DAL context
13887 pEventData: pointer to the event information structure
13888
Jeff Johnson295189b2012-06-20 16:38:30 -070013889 @see
13890 @return Result of the function call
13891*/
13892WDI_Status
13893WDI_ProcessEndScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013894(
Jeff Johnson295189b2012-06-20 16:38:30 -070013895 WDI_ControlBlockType* pWDICtx,
13896 WDI_EventInfoType* pEventData
13897)
13898{
13899 WDI_Status wdiStatus;
13900 tHalEndScanRspMsg halEndScanRspMsg;
13901 WDI_EndScanRspCb wdiEndScanRspCb;
13902 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13903
13904 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013905 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013906 -------------------------------------------------------------------------*/
13907 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13908 ( NULL == pEventData->pEventData))
13909 {
13910 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13911 "%s: Invalid parameters", __FUNCTION__);
13912 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013913 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013914 }
13915
13916 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
13917
13918 /*-------------------------------------------------------------------------
13919 Extract response and send it to UMAC
13920 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013921 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
13922 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013923 sizeof(halEndScanRspMsg.endScanRspParams));
13924
Jeff Johnsone7245742012-09-05 17:12:55 -070013925 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013926
13927 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
13928 {
13929 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13930 "End Scan failed with status %s (%d )",
13931 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
13932 halEndScanRspMsg.endScanRspParams.status);
13933 /* send the status to UMAC, don't return from here*/
13934 }
13935
13936 /*Notify UMAC*/
13937 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13938
Jeff Johnsone7245742012-09-05 17:12:55 -070013939 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013940}/*WDI_ProcessEndScanRsp*/
13941
13942
13943/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013944 @brief Process Finish Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013945 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013946
13947 @param pWDICtx: pointer to the WLAN DAL context
13948 pEventData: pointer to the event information structure
13949
Jeff Johnson295189b2012-06-20 16:38:30 -070013950 @see
13951 @return Result of the function call
13952*/
13953WDI_Status
13954WDI_ProcessFinishScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013955(
Jeff Johnson295189b2012-06-20 16:38:30 -070013956 WDI_ControlBlockType* pWDICtx,
13957 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -070013958)
Jeff Johnson295189b2012-06-20 16:38:30 -070013959{
13960 WDI_Status wdiStatus;
13961 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013962
13963 tHalFinishScanRspMsg halFinishScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013964 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13965
13966 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013967 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013968 -------------------------------------------------------------------------*/
13969 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13970 ( NULL == pEventData->pEventData))
13971 {
13972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13973 "%s: Invalid parameters", __FUNCTION__);
13974 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013975 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013976 }
13977
13978 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
13979
13980 /*-------------------------------------------------------------------------
13981 Extract response and send it to UMAC
13982 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013983 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
13984 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013985 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
13986
Jeff Johnsone7245742012-09-05 17:12:55 -070013987 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013988
13989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
Jeff Johnsone7245742012-09-05 17:12:55 -070013990 "Finish scan response reported status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070013991 halFinishScanRspMsg.finishScanRspParams.status);
13992
13993 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
13994 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
13995 {
13996 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13997 "Finish Scan failed with status %s (%d)",
13998 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
13999 halFinishScanRspMsg.finishScanRspParams.status);
14000 /* send the status to UMAC, don't return from here*/
14001 }
14002
14003 /*Notify UMAC*/
14004 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14005
Jeff Johnsone7245742012-09-05 17:12:55 -070014006 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014007}/*WDI_ProcessFinishScanRsp*/
14008
14009/**
14010 @brief Process Join Response function (called when a response
14011 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014012
14013 @param pWDICtx: pointer to the WLAN DAL context
14014 pEventData: pointer to the event information structure
14015
Jeff Johnson295189b2012-06-20 16:38:30 -070014016 @see
14017 @return Result of the function call
14018*/
14019WDI_Status
14020WDI_ProcessJoinRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014021(
Jeff Johnson295189b2012-06-20 16:38:30 -070014022 WDI_ControlBlockType* pWDICtx,
14023 WDI_EventInfoType* pEventData
14024)
14025{
14026 WDI_Status wdiStatus;
14027 WDI_JoinRspCb wdiJoinRspCb;
14028 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014029
14030 tHalJoinRspMsg halJoinRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014031 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14032
14033 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014034 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014035 -------------------------------------------------------------------------*/
14036 if (( NULL == pWDICtx ) ||
14037 ( NULL == pWDICtx->pfncRspCB ) ||
14038 ( NULL == pEventData ) ||
14039 ( NULL == pEventData->pEventData))
14040 {
14041 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14042 "%s: Invalid parameters", __FUNCTION__);
14043 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014044 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014045 }
14046
14047 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
14048
14049 /*-------------------------------------------------------------------------
14050 Extract response and send it to UMAC
14051 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014052 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
14053 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014054 sizeof(halJoinRspMsg.joinRspParams));
14055
Jeff Johnsone7245742012-09-05 17:12:55 -070014056 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014057
14058 wpalMutexAcquire(&pWDICtx->wptMutex);
14059
14060 /*-----------------------------------------------------------------------
14061 Join response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014062 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014063 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014064 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014065 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14066 {
14067 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070014068 "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or "
14069 "association no longer in progress %d - mysterious HAL response",
14070 __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress);
Jeff Johnson295189b2012-06-20 16:38:30 -070014071
Jeff Johnsone7245742012-09-05 17:12:55 -070014072 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
Jeff Johnson295189b2012-06-20 16:38:30 -070014073 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014074 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014075 }
14076
14077 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
14078
14079 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014080 Join Response is only allowed in init state
Jeff Johnson295189b2012-06-20 16:38:30 -070014081 -----------------------------------------------------------------------*/
14082 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14083 {
14084 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14085 "Join only allowed in Joining state - failure state is %d "
14086 "strange HAL response", pBSSSes->wdiAssocState);
14087
Jeff Johnsone7245742012-09-05 17:12:55 -070014088 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14089
Jeff Johnson295189b2012-06-20 16:38:30 -070014090 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014091 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014092 }
14093
14094
14095 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014096 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014097 -----------------------------------------------------------------------*/
14098 if ( WDI_STATUS_SUCCESS != wdiStatus )
14099 {
14100 /*Association was failed by HAL - remove session*/
14101 WDI_DeleteSession(pWDICtx, pBSSSes);
14102
14103 /*Association no longer in progress */
14104 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14105
14106 /*Association no longer in progress - prepare pending assoc for processing*/
14107 WDI_DequeueAssocRequest(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014108
Jeff Johnson295189b2012-06-20 16:38:30 -070014109 }
14110 else
14111 {
14112 /*Transition to state Joining - this may be redundant as we are supposed
14113 to be in this state already - but just to be safe*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014114 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014115 }
14116
14117 wpalMutexRelease(&pWDICtx->wptMutex);
14118
14119 /*Notify UMAC*/
14120 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14121
Jeff Johnsone7245742012-09-05 17:12:55 -070014122 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014123}/*WDI_ProcessJoinRsp*/
14124
14125
14126/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014127 @brief Process Config BSS Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014128 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014129
14130 @param pWDICtx: pointer to the WLAN DAL context
14131 pEventData: pointer to the event information structure
14132
Jeff Johnson295189b2012-06-20 16:38:30 -070014133 @see
14134 @return Result of the function call
14135*/
14136WDI_Status
14137WDI_ProcessConfigBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014138(
Jeff Johnson295189b2012-06-20 16:38:30 -070014139 WDI_ControlBlockType* pWDICtx,
14140 WDI_EventInfoType* pEventData
14141)
14142{
14143 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
14144 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014145 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014146 WDI_BSSSessionType* pBSSSes = NULL;
14147
Jeff Johnsone7245742012-09-05 17:12:55 -070014148 tConfigBssRspMsg halConfigBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014149 WDI_AddStaParams wdiBcastAddSTAParam = {0};
14150 WDI_AddStaParams wdiAddSTAParam = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -070014151
Jeff Johnson295189b2012-06-20 16:38:30 -070014152 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14153
14154 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014155 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014156 -------------------------------------------------------------------------*/
14157 if (( NULL == pEventData ) ||
14158 ( NULL == pEventData->pEventData))
14159 {
14160 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14161 "%s: Invalid parameters", __FUNCTION__);
14162 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014163 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014164 }
14165
14166 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
14167
14168 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014169 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014170 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014171 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
14172 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014173 sizeof(halConfigBssRspMsg.configBssRspParams));
14174
14175 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14176 halConfigBssRspMsg.configBssRspParams.status);
14177 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
14178 {
Jeff Johnsone7245742012-09-05 17:12:55 -070014179 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014180 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
14181 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014182
Jeff Johnson295189b2012-06-20 16:38:30 -070014183 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014184
14185 wdiConfigBSSParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014186 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014187
14188 wdiConfigBSSParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014189 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014190
Jeff Johnson295189b2012-06-20 16:38:30 -070014191 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014192
Jeff Johnson295189b2012-06-20 16:38:30 -070014193 #ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070014194 wdiConfigBSSParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070014195 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
14196 #endif
14197 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
14198 halConfigBssRspMsg.configBssRspParams.staMac,
14199 WDI_MAC_ADDR_LEN );
Jeff Johnsone7245742012-09-05 17:12:55 -070014200
Jeff Johnson295189b2012-06-20 16:38:30 -070014201 wpalMutexAcquire(&pWDICtx->wptMutex);
14202 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014203 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014204 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014205 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14206 wdiConfigBSSParams.macBSSID,
14207 &pBSSSes);
14208
Jeff Johnson295189b2012-06-20 16:38:30 -070014209 /*-----------------------------------------------------------------------
14210 Config BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014211 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014212 -----------------------------------------------------------------------*/
14213 if ( NULL == pBSSSes )
14214 {
14215 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14216 "Association sequence for this BSS does not yet exist "
14217 "- mysterious HAL response");
Jeff Johnsone7245742012-09-05 17:12:55 -070014218
14219 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14220
Jeff Johnson295189b2012-06-20 16:38:30 -070014221 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014222 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014223 }
Jeff Johnsone7245742012-09-05 17:12:55 -070014224
Jeff Johnson295189b2012-06-20 16:38:30 -070014225 /*Save data for this BSS*/
14226 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
14227 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014228 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014229 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014230 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014231 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014232 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014233 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014234 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014235 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014236 pBSSSes->ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014237 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14238 pBSSSes->bcastStaIdx =
14239 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014240
Jeff Johnson295189b2012-06-20 16:38:30 -070014241 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
Jeff Johnsone7245742012-09-05 17:12:55 -070014242
Jeff Johnson295189b2012-06-20 16:38:30 -070014243 /*-------------------------------------------------------------------------
14244 Add Peer STA
14245 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014246 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070014247 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
14248 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014249
Jeff Johnson295189b2012-06-20 16:38:30 -070014250 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014251 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014252 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014253 wdiAddSTAParam.ucHTCapable =
14254 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
14255 wdiAddSTAParam.ucStaType =
14256 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14257
Jeff Johnson295189b2012-06-20 16:38:30 -070014258 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070014259 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14260 halConfigBssRspMsg.configBssRspParams.staMac,
Jeff Johnson295189b2012-06-20 16:38:30 -070014261 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014262
14263 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14264 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14265 WDI_MAC_ADDR_LEN);
14266
Jeff Johnson295189b2012-06-20 16:38:30 -070014267 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014268 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014269 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014270 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014271 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014272 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014273 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014274 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014275 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014276 wdiAddSTAParam.ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014277 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014278 wdiAddSTAParam.ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014279 halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014280
Jeff Johnson295189b2012-06-20 16:38:30 -070014281 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14282 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014283
Jeff Johnson295189b2012-06-20 16:38:30 -070014284 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14285 /*-------------------------------------------------------------------------
14286 Add Broadcast STA only in AP mode
14287 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014288 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
Jeff Johnson295189b2012-06-20 16:38:30 -070014289 WDI_BSS_OPERATIONAL_MODE_AP )
14290 {
14291 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14292 "Add BCAST STA to table for index: %d",
14293 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014294
14295 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070014296 sizeof(WDI_AddStaParams) );
Jeff Johnsone7245742012-09-05 17:12:55 -070014297
Jeff Johnson295189b2012-06-20 16:38:30 -070014298 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14299 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14300 }
14301 wpalMutexRelease(&pWDICtx->wptMutex);
14302 }
14303 else
14304 {
14305 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14306 "Config BSS RSP failed with status : %s(%d)",
14307 WDI_getHALStatusMsgString(
Jeff Johnsone7245742012-09-05 17:12:55 -070014308 halConfigBssRspMsg.configBssRspParams.status),
Jeff Johnson295189b2012-06-20 16:38:30 -070014309 halConfigBssRspMsg.configBssRspParams.status);
14310
Jeff Johnsone7245742012-09-05 17:12:55 -070014311
Jeff Johnson295189b2012-06-20 16:38:30 -070014312 /*Association was failed by HAL - remove session*/
14313 WDI_DeleteSession(pWDICtx, pBSSSes);
14314
14315 /*Association no longer in progress */
14316 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14317
14318 /*Association no longer in progress - prepare pending assoc for processing*/
14319 WDI_DequeueAssocRequest(pWDICtx);
14320
14321 }
14322
14323 /*Notify UMAC*/
14324 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14325
Jeff Johnsone7245742012-09-05 17:12:55 -070014326 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014327}/*WDI_ProcessConfigBSSRsp*/
14328
14329
14330/**
14331 @brief Process Del BSS Response function (called when a response
14332 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014333
14334 @param pWDICtx: pointer to the WLAN DAL context
14335 pEventData: pointer to the event information structure
14336
Jeff Johnson295189b2012-06-20 16:38:30 -070014337 @see
14338 @return Result of the function call
14339*/
14340WDI_Status
14341WDI_ProcessDelBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014342(
Jeff Johnson295189b2012-06-20 16:38:30 -070014343 WDI_ControlBlockType* pWDICtx,
14344 WDI_EventInfoType* pEventData
14345)
14346{
14347 WDI_DelBSSRspParamsType wdiDelBSSParams;
14348 WDI_DelBSSRspCb wdiDelBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014349 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014350 WDI_BSSSessionType* pBSSSes = NULL;
14351
Jeff Johnsone7245742012-09-05 17:12:55 -070014352 tDeleteBssRspMsg halDelBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014353 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14354
14355 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014356 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014357 -------------------------------------------------------------------------*/
14358 if (( NULL == pEventData ) ||
14359 ( NULL == pEventData->pEventData))
14360 {
14361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14362 "%s: Invalid parameters", __FUNCTION__);
14363 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014364 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014365 }
14366
14367 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14368
14369 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014370 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014371 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014372 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14373 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014374 sizeof(halDelBssRspMsg.deleteBssRspParams));
14375
14376
14377 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
Jeff Johnsone7245742012-09-05 17:12:55 -070014378 halDelBssRspMsg.deleteBssRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014379
14380 wpalMutexAcquire(&pWDICtx->wptMutex);
14381
14382 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014383 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014384 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014385 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14386 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14387 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014388
14389 /*-----------------------------------------------------------------------
14390 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014391 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014392 -----------------------------------------------------------------------*/
14393 if ( NULL == pBSSSes )
14394 {
14395 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14396 "Association sequence for this BSS does not yet exist or "
14397 "association no longer in progress - mysterious HAL response");
14398
Jeff Johnsone7245742012-09-05 17:12:55 -070014399 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14400
Jeff Johnson295189b2012-06-20 16:38:30 -070014401 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014402 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014403 }
14404
14405 /*Extract BSSID for the response to UMAC*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014406 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014407 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14408
14409 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14410
14411 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014412 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014413 -----------------------------------------------------------------------*/
14414 WDI_DeleteSession(pWDICtx, pBSSSes);
14415
Jeff Johnsone7245742012-09-05 17:12:55 -070014416
Jeff Johnson295189b2012-06-20 16:38:30 -070014417 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14418 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14419 {
14420 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14421 }
14422
14423 /* Delete the STA's in this BSS */
14424 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014425
Jeff Johnson295189b2012-06-20 16:38:30 -070014426 wpalMutexRelease(&pWDICtx->wptMutex);
14427
14428 /*Notify UMAC*/
14429 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14430
Jeff Johnsone7245742012-09-05 17:12:55 -070014431 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014432}/*WDI_ProcessDelBSSRsp*/
14433
14434/**
14435 @brief Process Post Assoc Rsp function (called when a response
14436 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014437
14438 @param pWDICtx: pointer to the WLAN DAL context
14439 pEventData: pointer to the event information structure
14440
Jeff Johnson295189b2012-06-20 16:38:30 -070014441 @see
14442 @return Result of the function call
14443*/
14444WDI_Status
14445WDI_ProcessPostAssocRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014446(
Jeff Johnson295189b2012-06-20 16:38:30 -070014447 WDI_ControlBlockType* pWDICtx,
14448 WDI_EventInfoType* pEventData
14449)
14450{
14451 WDI_PostAssocRspParamsType wdiPostAssocParams;
14452 WDI_PostAssocRspCb wdiPostAssocRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014453 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014454 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014455 tPostAssocRspMsg halPostAssocRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014456 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14457
14458 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014459 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014460 -------------------------------------------------------------------------*/
14461 if (( NULL == pEventData ) ||
14462 ( NULL == pEventData->pEventData))
14463 {
14464 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14465 "%s: Invalid parameters", __FUNCTION__);
14466 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014467 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014468 }
14469
14470 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14471
14472 /*-------------------------------------------------------------------------
14473 Extract response and send it to UMAC
14474 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014475 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14476 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014477 sizeof(halPostAssocRspMsg.postAssocRspParams));
14478
14479 /*Extract the Post Assoc STA Params */
14480
Jeff Johnsone7245742012-09-05 17:12:55 -070014481 wdiPostAssocParams.staParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014482 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014483 wdiPostAssocParams.staParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014484 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070014485 wdiPostAssocParams.staParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014486 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14487
Jeff Johnsone7245742012-09-05 17:12:55 -070014488 wdiPostAssocParams.wdiStatus =
14489 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014490
14491 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14492 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014493 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14494 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014495 WDI_MAC_ADDR_LEN);
14496
14497 /* Extract Post Assoc BSS Params */
14498
Jeff Johnsone7245742012-09-05 17:12:55 -070014499 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14500 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14501 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070014502
14503 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14504 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014505 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014506 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14507 .macSTA, WDI_MAC_ADDR_LEN);
14508
Jeff Johnsone7245742012-09-05 17:12:55 -070014509 wdiPostAssocParams.bssParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014510 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14511
Jeff Johnsone7245742012-09-05 17:12:55 -070014512 wdiPostAssocParams.bssParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014513 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14514
14515 wdiPostAssocParams.bssParams.ucBSSIdx =
14516 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14517
Jeff Johnsone7245742012-09-05 17:12:55 -070014518 wdiPostAssocParams.bssParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014519 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14520
14521 wpalMutexAcquire(&pWDICtx->wptMutex);
14522
14523 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014524 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014525 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014526 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070014527 wdiPostAssocParams.bssParams.
Jeff Johnsone7245742012-09-05 17:12:55 -070014528 macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014529
14530 /*-----------------------------------------------------------------------
14531 Post assoc response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014532 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014533 -----------------------------------------------------------------------*/
14534 if (( NULL == pBSSSes ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070014535 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014536 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14537 {
14538 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14539 "Association sequence for this BSS does not yet exist or "
14540 "association no longer in progress - mysterious HAL response");
14541
Jeff Johnsone7245742012-09-05 17:12:55 -070014542 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14543
Jeff Johnson295189b2012-06-20 16:38:30 -070014544 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014545 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014546 }
14547
14548 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014549 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -070014550 -----------------------------------------------------------------------*/
14551 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14552 {
14553 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14554 "Post Assoc not allowed before JOIN - failing request "
14555 "strange HAL response");
14556
Jeff Johnsone7245742012-09-05 17:12:55 -070014557 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14558
Jeff Johnson295189b2012-06-20 16:38:30 -070014559 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014560 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014561 }
14562
14563 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014564 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014565 -----------------------------------------------------------------------*/
14566 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14567 {
14568 /*Association was failed by HAL - remove session*/
14569 WDI_DeleteSession(pWDICtx, pBSSSes);
14570 }
14571 else
14572 {
14573 /*Transition to state POST Assoc*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014574 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014575
14576 /*Save DPU Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014577 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014578 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014579 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014580 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014581 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014582 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014583 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014584 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14585
Jeff Johnsone7245742012-09-05 17:12:55 -070014586 pBSSSes->ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014587 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14588 }
14589
14590 /*Association no longer in progress */
14591 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14592
14593 /*Association no longer in progress - prepare pending assoc for processing*/
14594 WDI_DequeueAssocRequest(pWDICtx);
14595
14596 wpalMutexRelease(&pWDICtx->wptMutex);
14597
14598 /*Notify UMAC*/
14599 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14600
Jeff Johnsone7245742012-09-05 17:12:55 -070014601 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014602}/*WDI_ProcessPostAssocRsp*/
14603
14604/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014605 @brief Process Del STA Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070014606 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014607
14608 @param pWDICtx: pointer to the WLAN DAL context
14609 pEventData: pointer to the event information structure
14610
Jeff Johnson295189b2012-06-20 16:38:30 -070014611 @see
14612 @return Result of the function call
14613*/
14614WDI_Status
14615WDI_ProcessDelSTARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014616(
Jeff Johnson295189b2012-06-20 16:38:30 -070014617 WDI_ControlBlockType* pWDICtx,
14618 WDI_EventInfoType* pEventData
14619)
14620{
14621 WDI_DelSTARspParamsType wdiDelSTARsp;
14622 WDI_DelSTARspCb wdiDelSTARspCb;
14623 wpt_uint8 staType;
Jeff Johnsone7245742012-09-05 17:12:55 -070014624 tDeleteStaRspMsg halDelStaRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014625 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14626
14627 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014628 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014629 -------------------------------------------------------------------------*/
14630 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14631 ( NULL == pEventData->pEventData))
14632 {
14633 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14634 "%s: Invalid parameters", __FUNCTION__);
14635 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014636 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014637 }
14638
14639 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14640
14641 /*-------------------------------------------------------------------------
14642 Extract response and send it to UMAC
14643 -------------------------------------------------------------------------*/
14644 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070014645 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014646 sizeof(halDelStaRspMsg.delStaRspParams));
14647
14648 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070014649 wdiDelSTARsp.wdiStatus =
14650 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014651
14652 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14653
14654 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14655 if(staType == WDI_STA_ENTRY_SELF)
14656 {
14657 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14658
14659 /* At this point add the self-STA */
14660
14661 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14662 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14663 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14664
14665#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14666#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14667
14668 //all DPU indices are the same for self STA
14669 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14670 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14671 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14672 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14673 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14674 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
Madan Mohan Koyyalamudi15a48f02012-10-05 17:13:53 -070014675
14676 pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070014677 }
14678 else
14679 {
14680 //Delete the station in the table
14681 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14682 }
14683
14684 /*Notify UMAC*/
14685 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14686
Jeff Johnsone7245742012-09-05 17:12:55 -070014687 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014688}/*WDI_ProcessDelSTARsp*/
14689
14690
14691/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070014692 Security Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070014693==========================================================================*/
14694
14695/**
14696 @brief Process Set BSS Key Rsp function (called when a response
14697 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014698
14699 @param pWDICtx: pointer to the WLAN DAL context
14700 pEventData: pointer to the event information structure
14701
Jeff Johnson295189b2012-06-20 16:38:30 -070014702 @see
14703 @return Result of the function call
14704*/
14705WDI_Status
14706WDI_ProcessSetBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014707(
Jeff Johnson295189b2012-06-20 16:38:30 -070014708 WDI_ControlBlockType* pWDICtx,
14709 WDI_EventInfoType* pEventData
14710)
14711{
14712 WDI_Status wdiStatus;
14713 eHalStatus halStatus;
14714 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14715 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14716
14717 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014718 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014719 -------------------------------------------------------------------------*/
14720 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14721 ( NULL == pEventData->pEventData))
14722 {
14723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14724 "%s: Invalid parameters", __FUNCTION__);
14725 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014726 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014727 }
14728
14729 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14730
14731 /*-------------------------------------------------------------------------
14732 Extract response and send it to UMAC
14733 -------------------------------------------------------------------------*/
14734 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014735 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014736
14737 if ( eHAL_STATUS_SUCCESS != halStatus )
14738 {
14739 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14740 "Set BSS Key failed with status %s (%d)",
14741 WDI_getHALStatusMsgString(halStatus),
14742 halStatus);
14743 /* send the status to UMAC, don't return from here*/
14744 }
14745
14746 /*Notify UMAC*/
14747 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14748
Jeff Johnsone7245742012-09-05 17:12:55 -070014749 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014750}/*WDI_ProcessSetBssKeyRsp*/
14751
14752/**
14753 @brief Process Remove BSS Key Rsp function (called when a response
14754 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014755
14756 @param pWDICtx: pointer to the WLAN DAL context
14757 pEventData: pointer to the event information structure
14758
Jeff Johnson295189b2012-06-20 16:38:30 -070014759 @see
14760 @return Result of the function call
14761*/
14762WDI_Status
14763WDI_ProcessRemoveBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014764(
Jeff Johnson295189b2012-06-20 16:38:30 -070014765 WDI_ControlBlockType* pWDICtx,
14766 WDI_EventInfoType* pEventData
14767)
14768{
14769 WDI_Status wdiStatus;
14770 eHalStatus halStatus;
14771 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14772 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14773
14774 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014775 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014776 -------------------------------------------------------------------------*/
14777 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14778 ( NULL == pEventData->pEventData))
14779 {
14780 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14781 "%s: Invalid parameters", __FUNCTION__);
14782 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014783 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014784 }
14785
14786 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14787
14788 /*-------------------------------------------------------------------------
14789 Extract response and send it to UMAC
14790 -------------------------------------------------------------------------*/
14791 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014792 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014793
14794 if ( eHAL_STATUS_SUCCESS != halStatus )
14795 {
14796 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14797 "Remove BSS Key failed with status %s (%d )",
14798 WDI_getHALStatusMsgString(halStatus),
14799 halStatus);
14800 /* send the status to UMAC, don't return from here*/
14801 }
14802
14803 /*Notify UMAC*/
14804 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14805
Jeff Johnsone7245742012-09-05 17:12:55 -070014806 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014807}/*WDI_ProcessSetBssKeyRsp*/
14808
14809
14810/**
14811 @brief Process Set STA Key Rsp function (called when a response
14812 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014813
14814 @param pWDICtx: pointer to the WLAN DAL context
14815 pEventData: pointer to the event information structure
14816
Jeff Johnson295189b2012-06-20 16:38:30 -070014817 @see
14818 @return Result of the function call
14819*/
14820WDI_Status
14821WDI_ProcessSetStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014822(
Jeff Johnson295189b2012-06-20 16:38:30 -070014823 WDI_ControlBlockType* pWDICtx,
14824 WDI_EventInfoType* pEventData
14825)
14826{
14827 WDI_Status wdiStatus;
14828 eHalStatus halStatus;
14829 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14830 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14831
14832 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014833 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014834 -------------------------------------------------------------------------*/
14835 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14836 ( NULL == pEventData->pEventData))
14837 {
14838 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14839 "%s: Invalid parameters", __FUNCTION__);
14840 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014841 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014842 }
14843
14844 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14845
14846 /*-------------------------------------------------------------------------
14847 Extract response and send it to UMAC
14848 -------------------------------------------------------------------------*/
14849 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014850 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014851
14852 if ( eHAL_STATUS_SUCCESS != halStatus )
14853 {
14854 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14855 "Set STA Key failed with status %s (%d)",
14856 WDI_getHALStatusMsgString(halStatus),
14857 halStatus);
14858 /* send the status to UMAC, don't return from here*/
14859 }
14860
14861 /*Notify UMAC*/
14862 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14863
Jeff Johnsone7245742012-09-05 17:12:55 -070014864 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014865}/*WDI_ProcessSetSTAKeyRsp*/
14866
14867/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014868 @brief Process Remove STA Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014869 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014870
14871 @param pWDICtx: pointer to the WLAN DAL context
14872 pEventData: pointer to the event information structure
14873
Jeff Johnson295189b2012-06-20 16:38:30 -070014874 @see
14875 @return Result of the function call
14876*/
14877WDI_Status
14878WDI_ProcessRemoveStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014879(
Jeff Johnson295189b2012-06-20 16:38:30 -070014880 WDI_ControlBlockType* pWDICtx,
14881 WDI_EventInfoType* pEventData
14882)
14883{
14884 WDI_Status wdiStatus;
14885 eHalStatus halStatus;
14886 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14887 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14888
14889 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014890 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014891 -------------------------------------------------------------------------*/
14892 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14893 ( NULL == pEventData->pEventData))
14894 {
14895 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14896 "%s: Invalid parameters", __FUNCTION__);
14897 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014898 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014899 }
14900
14901 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14902
14903 /*-------------------------------------------------------------------------
14904 Extract response and send it to UMAC
14905 -------------------------------------------------------------------------*/
14906 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014907 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014908
14909 if ( eHAL_STATUS_SUCCESS != halStatus )
14910 {
14911 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14912 "Remove STA Key failed with status %s (%d)",
14913 WDI_getHALStatusMsgString(halStatus),
14914 halStatus);
14915 /* send the status to UMAC, don't return from here*/
14916 }
14917
14918 /*Notify UMAC*/
14919 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14920
Jeff Johnsone7245742012-09-05 17:12:55 -070014921 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014922}/*WDI_ProcessRemoveStaKeyRsp*/
14923
14924/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014925 @brief Process Set STA Bcast Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014926 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014927
14928 @param pWDICtx: pointer to the WLAN DAL context
14929 pEventData: pointer to the event information structure
14930
Jeff Johnson295189b2012-06-20 16:38:30 -070014931 @see
14932 @return Result of the function call
14933*/
14934WDI_Status
14935WDI_ProcessSetStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014936(
Jeff Johnson295189b2012-06-20 16:38:30 -070014937 WDI_ControlBlockType* pWDICtx,
14938 WDI_EventInfoType* pEventData
14939)
14940{
14941 WDI_Status wdiStatus;
14942 eHalStatus halStatus;
14943 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
14944 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14945
14946 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014947 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014948 -------------------------------------------------------------------------*/
14949 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14950 ( NULL == pEventData->pEventData))
14951 {
14952 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14953 "%s: Invalid parameters", __FUNCTION__);
14954 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014955 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014956 }
14957
14958 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14959
14960 /*-------------------------------------------------------------------------
14961 Extract response and send it to UMAC
14962 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014963 wpalMemoryCopy( &halStatus,
14964 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014965 sizeof(halStatus));
14966
Jeff Johnsone7245742012-09-05 17:12:55 -070014967 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014968
14969 if ( eHAL_STATUS_SUCCESS != halStatus )
14970 {
14971 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14972 "Set STA Key failed with status %s (%d)",
14973 WDI_getHALStatusMsgString(halStatus),
14974 halStatus);
14975 /* send the status to UMAC, don't return from here*/
14976 }
14977
14978 /*Notify UMAC*/
14979 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14980
Jeff Johnsone7245742012-09-05 17:12:55 -070014981 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014982}/*WDI_ProcessSetSTABcastKeyRsp*/
14983
14984/**
14985 @brief Process Remove STA Bcast Key Rsp function (called when a
14986 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014987
14988 @param pWDICtx: pointer to the WLAN DAL context
14989 pEventData: pointer to the event information structure
14990
Jeff Johnson295189b2012-06-20 16:38:30 -070014991 @see
14992 @return Result of the function call
14993*/
14994WDI_Status
14995WDI_ProcessRemoveStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014996(
Jeff Johnson295189b2012-06-20 16:38:30 -070014997 WDI_ControlBlockType* pWDICtx,
14998 WDI_EventInfoType* pEventData
14999)
15000{
15001 WDI_Status wdiStatus;
15002 eHalStatus halStatus;
15003 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
15004 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15005
15006 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015007 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015008 -------------------------------------------------------------------------*/
15009 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15010 ( NULL == pEventData->pEventData))
15011 {
15012 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15013 "%s: Invalid parameters", __FUNCTION__);
15014 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015015 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015016 }
15017
15018 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
15019
15020 /*-------------------------------------------------------------------------
15021 Extract response and send it to UMAC
15022 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015023 wpalMemoryCopy( &halStatus,
15024 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015025 sizeof(halStatus));
15026
Jeff Johnsone7245742012-09-05 17:12:55 -070015027 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015028
15029 if ( eHAL_STATUS_SUCCESS != halStatus )
15030 {
15031 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15032 "Remove STA Key failed with status %s (%d)",
15033 WDI_getHALStatusMsgString(halStatus),
15034 halStatus);
15035 /* send the status to UMAC, don't return from here*/
15036 }
15037
15038 /*Notify UMAC*/
15039 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15040
Jeff Johnsone7245742012-09-05 17:12:55 -070015041 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015042}/*WDI_ProcessRemoveStaBcastKeyRsp*/
15043
15044
15045/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015046 QoS and BA Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070015047==========================================================================*/
15048
15049/**
15050 @brief Process Add TSpec Rsp function (called when a response
15051 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015052
15053 @param pWDICtx: pointer to the WLAN DAL context
15054 pEventData: pointer to the event information structure
15055
Jeff Johnson295189b2012-06-20 16:38:30 -070015056 @see
15057 @return Result of the function call
15058*/
15059WDI_Status
15060WDI_ProcessAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015061(
Jeff Johnson295189b2012-06-20 16:38:30 -070015062 WDI_ControlBlockType* pWDICtx,
15063 WDI_EventInfoType* pEventData
15064)
15065{
15066 WDI_Status wdiStatus;
15067 eHalStatus halStatus;
15068 WDI_AddTsRspCb wdiAddTsRspCb;
15069 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15070
15071 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015072 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015073 -------------------------------------------------------------------------*/
15074 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15075 ( NULL == pEventData->pEventData))
15076 {
15077 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15078 "%s: Invalid parameters", __FUNCTION__);
15079 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015080 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015081 }
15082
15083 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
15084
15085 /*-------------------------------------------------------------------------
15086 Extract response and send it to UMAC
15087 -------------------------------------------------------------------------*/
15088 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015089 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015090
15091 /*Notify UMAC*/
15092 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15093
Jeff Johnsone7245742012-09-05 17:12:55 -070015094 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015095}/*WDI_ProcessAddTSpecRsp*/
15096
15097
15098/**
15099 @brief Process Del TSpec Rsp function (called when a response
15100 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015101
15102 @param pWDICtx: pointer to the WLAN DAL context
15103 pEventData: pointer to the event information structure
15104
Jeff Johnson295189b2012-06-20 16:38:30 -070015105 @see
15106 @return Result of the function call
15107*/
15108WDI_Status
15109WDI_ProcessDelTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015110(
Jeff Johnson295189b2012-06-20 16:38:30 -070015111 WDI_ControlBlockType* pWDICtx,
15112 WDI_EventInfoType* pEventData
15113)
15114{
15115 WDI_Status wdiStatus;
15116 eHalStatus halStatus;
15117 WDI_DelTsRspCb wdiDelTsRspCb;
15118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15119
15120 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015121 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015122 -------------------------------------------------------------------------*/
15123 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15124 ( NULL == pEventData->pEventData))
15125 {
15126 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15127 "%s: Invalid parameters", __FUNCTION__);
15128 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015129 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015130 }
15131
15132 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
15133
15134 /*-------------------------------------------------------------------------
15135 Extract response and send it to UMAC
15136 -------------------------------------------------------------------------*/
15137 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015138 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015139
15140 /*Notify UMAC*/
15141 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15142
Jeff Johnsone7245742012-09-05 17:12:55 -070015143 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015144}/*WDI_ProcessDelTSpecRsp*/
15145
15146/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015147 @brief Process Update EDCA Parameters Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015148 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015149
15150 @param pWDICtx: pointer to the WLAN DAL context
15151 pEventData: pointer to the event information structure
15152
Jeff Johnson295189b2012-06-20 16:38:30 -070015153 @see
15154 @return Result of the function call
15155*/
15156WDI_Status
15157WDI_ProcessUpdateEDCAParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015158(
Jeff Johnson295189b2012-06-20 16:38:30 -070015159 WDI_ControlBlockType* pWDICtx,
15160 WDI_EventInfoType* pEventData
15161)
15162{
15163 WDI_Status wdiStatus;
15164 eHalStatus halStatus;
15165 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
15166 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15167
15168 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015169 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015170 -------------------------------------------------------------------------*/
15171 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15172 ( NULL == pEventData->pEventData))
15173 {
15174 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15175 "%s: Invalid parameters", __FUNCTION__);
15176 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015177 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015178 }
15179
15180 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
15181
15182 /*-------------------------------------------------------------------------
15183 Extract response and send it to UMAC
15184 -------------------------------------------------------------------------*/
15185 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015186 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015187
15188 /*Notify UMAC*/
15189 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15190
Jeff Johnsone7245742012-09-05 17:12:55 -070015191 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015192}/*WDI_ProcessUpdateEDCAParamsRsp*/
15193
15194
15195/**
15196 @brief Process Add BA Rsp function (called when a response
15197 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015198
15199 @param pWDICtx: pointer to the WLAN DAL context
15200 pEventData: pointer to the event information structure
15201
Jeff Johnson295189b2012-06-20 16:38:30 -070015202 @see
15203 @return Result of the function call
15204*/
15205WDI_Status
15206WDI_ProcessAddBASessionRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015207(
Jeff Johnson295189b2012-06-20 16:38:30 -070015208 WDI_ControlBlockType* pWDICtx,
15209 WDI_EventInfoType* pEventData
15210)
15211{
15212 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
15213
15214 tAddBASessionRspParams halBASessionRsp;
15215 WDI_AddBASessionRspParamsType wdiBASessionRsp;
15216
Jeff Johnsone7245742012-09-05 17:12:55 -070015217
Jeff Johnson295189b2012-06-20 16:38:30 -070015218 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15219
15220 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015221 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015222 -------------------------------------------------------------------------*/
15223 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15224 ( NULL == pEventData->pEventData))
15225 {
15226 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15227 "%s: Invalid parameters", __FUNCTION__);
15228 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015229 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015230 }
15231
15232 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
15233
15234 /*-------------------------------------------------------------------------
15235 Extract response and send it to UMAC
15236 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015237 wpalMemoryCopy( &halBASessionRsp,
15238 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015239 sizeof(halBASessionRsp));
15240
15241 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15242
Jeff Johnson43971f52012-07-17 12:26:56 -070015243 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015244 {
15245 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15246 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15247 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15248 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15249 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15250 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15251 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15252 }
15253
15254 /*Notify UMAC*/
15255 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15256
Jeff Johnsone7245742012-09-05 17:12:55 -070015257 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015258}/*WDI_ProcessAddSessionBARsp*/
15259
15260
15261/**
15262 @brief Process Del BA Rsp function (called when a response
15263 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015264
15265 @param pWDICtx: pointer to the WLAN DAL context
15266 pEventData: pointer to the event information structure
15267
Jeff Johnson295189b2012-06-20 16:38:30 -070015268 @see
15269 @return Result of the function call
15270*/
15271WDI_Status
15272WDI_ProcessDelBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015273(
Jeff Johnson295189b2012-06-20 16:38:30 -070015274 WDI_ControlBlockType* pWDICtx,
15275 WDI_EventInfoType* pEventData
15276)
15277{
15278 WDI_Status wdiStatus;
15279 eHalStatus halStatus;
15280 WDI_DelBARspCb wdiDelBARspCb;
15281 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15282
15283 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015284 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015285 -------------------------------------------------------------------------*/
15286 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15287 ( NULL == pEventData->pEventData))
15288 {
15289 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15290 "%s: Invalid parameters", __FUNCTION__);
15291 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015292 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015293 }
15294
15295 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15296
15297 /*-------------------------------------------------------------------------
15298 Extract response and send it to UMAC
15299 -------------------------------------------------------------------------*/
15300 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015301 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015302
15303 if ( eHAL_STATUS_SUCCESS == halStatus )
15304 {
15305 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15306 }
15307
15308 /*Notify UMAC*/
15309 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15310
Jeff Johnsone7245742012-09-05 17:12:55 -070015311 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015312}/*WDI_ProcessDelBARsp*/
15313
15314#ifdef FEATURE_WLAN_CCX
15315/**
15316 @brief Process TSM Stats Rsp function (called when a response
15317 is being received over the bus from HAL)
15318
15319 @param pWDICtx: pointer to the WLAN DAL context
15320 pEventData: pointer to the event information structure
15321
15322 @see
15323 @return Result of the function call
15324*/
15325WDI_Status
15326WDI_ProcessTsmStatsRsp
15327(
15328 WDI_ControlBlockType* pWDICtx,
15329 WDI_EventInfoType* pEventData
15330)
15331{
15332 WDI_TsmRspCb wdiTsmStatsRspCb;
15333 tTsmStatsRspMsg halTsmStatsRspMsg;
15334 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15335 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15336
15337 /*-------------------------------------------------------------------------
15338 Sanity check
15339 -------------------------------------------------------------------------*/
15340 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15341 ( NULL == pEventData->pEventData))
15342 {
15343 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15344 "%s: Invalid parameters", __FUNCTION__);
15345 WDI_ASSERT(0);
15346 return WDI_STATUS_E_FAILURE;
15347 }
15348
15349 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15350
15351 /*-------------------------------------------------------------------------
15352 Unpack HAL Response Message - the header was already extracted by the
15353 main Response Handling procedure
15354 -------------------------------------------------------------------------*/
15355 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15356 pEventData->pEventData,
15357 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15358
15359 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15360 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15361 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15362 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15363 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15364 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15365 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15366 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15367 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15368 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15369 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15370 halTsmStatsRspMsg.tsmStatsRspParams.status);
15371
15372 /*Notify UMAC*/
15373 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15374
15375 return WDI_STATUS_SUCCESS;
15376}/*WDI_ProcessTsmStatsRsp*/
15377
15378#endif
15379
15380
15381
15382/**
15383 @brief Process Flush AC Rsp function (called when a response
15384 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015385
15386 @param pWDICtx: pointer to the WLAN DAL context
15387 pEventData: pointer to the event information structure
15388
Jeff Johnson295189b2012-06-20 16:38:30 -070015389 @see
15390 @return Result of the function call
15391*/
15392WDI_Status
15393WDI_ProcessFlushAcRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015394(
Jeff Johnson295189b2012-06-20 16:38:30 -070015395 WDI_ControlBlockType* pWDICtx,
15396 WDI_EventInfoType* pEventData
15397)
15398{
15399 WDI_Status wdiStatus;
15400 eHalStatus halStatus;
15401 WDI_FlushAcRspCb wdiFlushAcRspCb;
15402 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15403
15404 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015405 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015406 -------------------------------------------------------------------------*/
15407 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15408 ( NULL == pEventData->pEventData))
15409 {
15410 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15411 "%s: Invalid parameters", __FUNCTION__);
15412 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015413 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015414 }
15415
15416 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15417
15418 /*-------------------------------------------------------------------------
15419 Extract response and send it to UMAC
15420 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015421 wpalMemoryCopy( &halStatus,
15422 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015423 sizeof(halStatus));
15424
Jeff Johnsone7245742012-09-05 17:12:55 -070015425 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015426
15427 /*Notify UMAC*/
15428 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15429
Jeff Johnsone7245742012-09-05 17:12:55 -070015430 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015431}/*WDI_ProcessFlushAcRsp*/
15432
15433/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015434 @brief Process BT AMP event Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015435 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015436
15437 @param pWDICtx: pointer to the WLAN DAL context
15438 pEventData: pointer to the event information structure
15439
Jeff Johnson295189b2012-06-20 16:38:30 -070015440 @see
15441 @return Result of the function call
15442*/
15443WDI_Status
15444WDI_ProcessBtAmpEventRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015445(
Jeff Johnson295189b2012-06-20 16:38:30 -070015446 WDI_ControlBlockType* pWDICtx,
15447 WDI_EventInfoType* pEventData
15448)
15449{
15450 WDI_Status wdiStatus;
15451 eHalStatus halStatus;
15452 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15453 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15454
15455 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015456 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015457 -------------------------------------------------------------------------*/
15458 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15459 ( NULL == pEventData->pEventData))
15460 {
15461 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15462 "%s: Invalid parameters", __FUNCTION__);
15463 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015464 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015465 }
15466
15467 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15468
15469 /*-------------------------------------------------------------------------
15470 Extract response and send it to UMAC
15471 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015472 wpalMemoryCopy( &halStatus,
15473 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015474 sizeof(halStatus));
15475
Jeff Johnsone7245742012-09-05 17:12:55 -070015476 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015477
15478 /*Notify UMAC*/
15479 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15480
Jeff Johnsone7245742012-09-05 17:12:55 -070015481 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015482}/*WDI_ProcessBtAmpEventRsp*/
15483
15484
15485/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015486 @brief Process ADD STA SELF Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070015487 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015488
15489 @param pWDICtx: pointer to the WLAN DAL context
15490 pEventData: pointer to the event information structure
15491
Jeff Johnson295189b2012-06-20 16:38:30 -070015492 @see
15493 @return Result of the function call
15494*/
15495WDI_Status
15496WDI_ProcessAddSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015497(
Jeff Johnson295189b2012-06-20 16:38:30 -070015498 WDI_ControlBlockType* pWDICtx,
15499 WDI_EventInfoType* pEventData
15500)
15501{
15502 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15503 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15504 tAddStaSelfRspMsg halAddStaSelfRsp;
15505 WDI_AddStaParams wdiAddSTAParam = {0};
15506 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15507
15508 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015509 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015510 -------------------------------------------------------------------------*/
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);
Jeff Johnsone7245742012-09-05 17:12:55 -070015517 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015518 }
15519
Jeff Johnsone7245742012-09-05 17:12:55 -070015520 wdiAddSTASelfReqParamsRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070015521 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15522
15523 /*-------------------------------------------------------------------------
15524 Extract response and send it to UMAC
15525 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015526 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15527 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015528 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15529
15530
Jeff Johnsone7245742012-09-05 17:12:55 -070015531 wdiAddSTASelfParams.wdiStatus =
15532 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015533
Jeff Johnsone7245742012-09-05 17:12:55 -070015534 wdiAddSTASelfParams.ucSTASelfIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015535 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015536 wdiAddSTASelfParams.dpuIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015537 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015538 wdiAddSTASelfParams.dpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015539 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15540
15541 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15542 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15543 WDI_MAC_ADDR_LEN);
15544
15545
15546#ifdef HAL_SELF_STA_PER_BSS
15547
15548 /* At this point add the self-STA */
15549
15550 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15551 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15552 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15553
15554 //all DPU indices are the same for self STA
15555
15556 /*DPU Information*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015557 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015558 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15559 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15560 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15561 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15562 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15563
15564 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15565 WDI_MAC_ADDR_LEN);
15566
15567 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15568 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15569
Jeff Johnsone7245742012-09-05 17:12:55 -070015570 if(halAddStaSelfRsp.addStaSelfRspParams.status
Jeff Johnson295189b2012-06-20 16:38:30 -070015571 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15572 {
15573 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15574 }
15575#endif
15576
15577 /*Notify UMAC*/
15578 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15579
Jeff Johnsone7245742012-09-05 17:12:55 -070015580 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015581}/*WDI_ProcessAddSTASelfRsp*/
15582
15583
15584
15585/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015586 @brief WDI_ProcessDelSTASelfRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015587 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015588
15589 @param pWDICtx: pointer to the WLAN DAL context
15590 pEventData: pointer to the event information structure
15591
Jeff Johnson295189b2012-06-20 16:38:30 -070015592 @see
15593 @return Result of the function call
15594*/
15595WDI_Status
15596WDI_ProcessDelSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015597(
Jeff Johnson295189b2012-06-20 16:38:30 -070015598 WDI_ControlBlockType* pWDICtx,
15599 WDI_EventInfoType* pEventData
15600)
15601{
15602 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15603 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15604 tDelStaSelfRspParams delStaSelfRspParams;
15605 wpt_uint8 ucStaIdx;
15606
15607 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15608
15609 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015610 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015611 -------------------------------------------------------------------------*/
15612 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15613 ( NULL == pEventData->pEventData))
15614 {
15615 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15616 "%s: Invalid parameters", __FUNCTION__);
15617 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015618 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015619 }
15620
15621 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15622
15623 /*-------------------------------------------------------------------------
15624 Extract response and send it to UMAC
15625 -------------------------------------------------------------------------*/
15626
Jeff Johnsone7245742012-09-05 17:12:55 -070015627 wpalMemoryCopy( &delStaSelfRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070015628 (wpt_uint8*)pEventData->pEventData,
15629 sizeof(tDelStaSelfRspParams));
15630
Jeff Johnsone7245742012-09-05 17:12:55 -070015631 wdiDelStaSelfRspParams.wdiStatus =
15632 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015633
Jeff Johnsone7245742012-09-05 17:12:55 -070015634 /* delStaSelfRspParams.status is not
Jeff Johnson295189b2012-06-20 16:38:30 -070015635 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15636 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15637 {
15638 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070015639 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070015640 delStaSelfRspParams.selfMacAddr,
15641 &ucStaIdx);
15642 if(WDI_STATUS_E_FAILURE == wdiStatus)
15643 {
15644 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15645 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15646 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015647 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015648 }
15649 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15650 }
15651
15652 /*Notify UMAC*/
15653 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15654
15655 return WDI_STATUS_SUCCESS;
15656}
15657
Jeff Johnsone7245742012-09-05 17:12:55 -070015658#ifdef FEATURE_OEM_DATA_SUPPORT
15659/**
15660 @brief Start Oem Data Rsp function (called when a
15661 response is being received over the bus from HAL)
Jeff Johnson295189b2012-06-20 16:38:30 -070015662
Jeff Johnsone7245742012-09-05 17:12:55 -070015663 @param pWDICtx: pointer to the WLAN DAL context
15664 pEventData: pointer to the event information structure
15665
15666 @see
15667 @return Result of the function call
15668*/
15669#define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName)
15670
15671WDI_Status
15672WDI_ProcessStartOemDataRsp
15673(
15674 WDI_ControlBlockType* pWDICtx,
15675 WDI_EventInfoType* pEventData
15676)
15677{
15678 WDI_oemDataRspCb wdiOemDataRspCb;
15679 WDI_oemDataRspParamsType* wdiOemDataRspParams;
15680 tStartOemDataRspParams* halStartOemDataRspParams;
15681
15682 /*-------------------------------------------------------------------------
15683 Sanity check
15684 -------------------------------------------------------------------------*/
15685 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15686 ( NULL == pEventData->pEventData))
15687 {
15688 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15689 "%s: Invalid parameters", __FUNCTION__);
15690 WDI_ASSERT(0);
15691 return WDI_STATUS_E_FAILURE;
15692 }
15693
15694 wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB;
15695
15696 /*-------------------------------------------------------------------------
15697 Extract response and send it to UMAC
15698 -------------------------------------------------------------------------*/
15699 halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData;
15700
15701
15702 //It is the responsibility of the application code to check for failure
15703 //conditions!
15704
15705 //Allocate memory for WDI OEM DATA RSP structure
15706 wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ;
15707
15708 if(NULL == wdiOemDataRspParams)
15709 {
15710 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15711 "Failed to allocate memory in OEM DATA Response %x %x %x ",
15712 pWDICtx, pEventData, pEventData->pEventData);
15713 WDI_ASSERT(0);
15714 return WDI_STATUS_E_FAILURE;
15715 }
15716
15717 /* Populate WDI structure members */
15718 wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE);
15719
15720 /*Notify UMAC*/
15721 wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData);
15722
15723 //Free memory allocated for WDI OEM_DATA MEAS RSP structure
15724 wpalMemoryFree(wdiOemDataRspParams);
15725
15726 return WDI_STATUS_SUCCESS;
15727}/*WDI_PrcoessStartOemDataRsp*/
15728#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070015729
15730/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015731 Miscellaneous Control Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070015732===========================================================================*/
15733
15734/**
15735 @brief Process Channel Switch Rsp function (called when a response
15736 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015737
15738 @param pWDICtx: pointer to the WLAN DAL context
15739 pEventData: pointer to the event information structure
15740
Jeff Johnson295189b2012-06-20 16:38:30 -070015741 @see
15742 @return Result of the function call
15743*/
15744WDI_Status
15745WDI_ProcessChannelSwitchRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015746(
Jeff Johnson295189b2012-06-20 16:38:30 -070015747 WDI_ControlBlockType* pWDICtx,
15748 WDI_EventInfoType* pEventData
15749)
15750{
15751 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15752 WDI_SwitchChRspCb wdiChSwitchRspCb;
15753 tSwitchChannelRspParams halSwitchChannelRsp;
15754 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15755
15756 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015757 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015758 -------------------------------------------------------------------------*/
15759 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15760 ( NULL == pEventData->pEventData))
15761 {
15762 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15763 "%s: Invalid parameters", __FUNCTION__);
15764 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015765 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015766 }
15767
15768 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15769
15770 /*-------------------------------------------------------------------------
15771 Extract response and send it to UMAC
15772 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015773 wpalMemoryCopy( &halSwitchChannelRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -070015774 (wpt_uint8*)pEventData->pEventData,
15775 sizeof(halSwitchChannelRsp));
15776
Jeff Johnsone7245742012-09-05 17:12:55 -070015777 wdiSwitchChRsp.wdiStatus =
15778 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015779 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15780
15781#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070015782 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070015783#endif
15784
15785 /*Notify UMAC*/
15786 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15787
Jeff Johnsone7245742012-09-05 17:12:55 -070015788 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015789}/*WDI_ProcessChannelSwitchRsp*/
15790
15791
15792/**
15793 @brief Process Config STA Rsp function (called when a response
15794 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015795
15796 @param pWDICtx: pointer to the WLAN DAL context
15797 pEventData: pointer to the event information structure
15798
Jeff Johnson295189b2012-06-20 16:38:30 -070015799 @see
15800 @return Result of the function call
15801*/
15802WDI_Status
15803WDI_ProcessConfigStaRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015804(
Jeff Johnson295189b2012-06-20 16:38:30 -070015805 WDI_ControlBlockType* pWDICtx,
15806 WDI_EventInfoType* pEventData
15807)
15808{
15809 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15810 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15811 WDI_AddStaParams wdiAddSTAParam;
15812
15813 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015814 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015815
Jeff Johnsone7245742012-09-05 17:12:55 -070015816 tConfigStaRspMsg halConfigStaRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070015817 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15818
15819 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015820 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015821 -------------------------------------------------------------------------*/
15822 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15823 ( NULL == pEventData->pEventData))
15824 {
15825 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15826 "%s: Invalid parameters", __FUNCTION__);
15827 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015828 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015829 }
15830
15831 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15832
15833 /*-------------------------------------------------------------------------
15834 Extract response and send it to UMAC
15835 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015836 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15837 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015838 sizeof(halConfigStaRsp.configStaRspParams));
15839
15840
15841 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15842 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15843 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15844 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15845 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15846
15847 /* MAC Address of STA - take from cache as it does not come back in the
15848 response*/
15849 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070015850 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015851 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015852
15853 wdiCfgSTAParams.wdiStatus =
15854 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015855
15856 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15857 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15858 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15859
15860 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15861 {
15862 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15863 {
15864 /* ADD STA to table */
Jeff Johnsone7245742012-09-05 17:12:55 -070015865 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015866 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15867 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015868
Jeff Johnson295189b2012-06-20 16:38:30 -070015869 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015870 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070015871 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070015872 wdiAddSTAParam.ucHTCapable =
15873 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15874 wdiAddSTAParam.ucStaType =
15875 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15876
Jeff Johnson295189b2012-06-20 16:38:30 -070015877 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070015878 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15879 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015880 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015881
15882 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15883 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15884 WDI_MAC_ADDR_LEN);
15885
15886 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15887 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15888 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070015889
15890 if ( NULL == pBSSSes )
15891 {
15892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15893 "Association for this BSSID is not in place");
Jeff Johnsone7245742012-09-05 17:12:55 -070015894
Jeff Johnson295189b2012-06-20 16:38:30 -070015895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015896 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070015897 }
15898
15899 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015900 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015901 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015902 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015903 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015904 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015905 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015906 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015907 halConfigStaRsp.configStaRspParams.ucBcastSig;
15908 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15909 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015910
Jeff Johnson295189b2012-06-20 16:38:30 -070015911 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15912 }
15913 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15914 {
15915 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
15916
Jeff Johnsone7245742012-09-05 17:12:55 -070015917 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015918 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015919 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015920 halConfigStaRsp.configStaRspParams.ucBcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015921 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015922 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015923 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015924 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015925 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015926 halConfigStaRsp.configStaRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015927 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015928 halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015929 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070015930 halConfigStaRsp.configStaRspParams.ucUcastSig;
15931 }
15932 }
15933
15934 /*Notify UMAC*/
15935 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
15936
Jeff Johnsone7245742012-09-05 17:12:55 -070015937 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015938}/*WDI_ProcessConfigStaRsp*/
15939
15940
15941/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015942 @brief Process Set Link State Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015943 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015944
15945 @param pWDICtx: pointer to the WLAN DAL context
15946 pEventData: pointer to the event information structure
15947
Jeff Johnson295189b2012-06-20 16:38:30 -070015948 @see
15949 @return Result of the function call
15950*/
15951WDI_Status
15952WDI_ProcessSetLinkStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015953(
Jeff Johnson295189b2012-06-20 16:38:30 -070015954 WDI_ControlBlockType* pWDICtx,
15955 WDI_EventInfoType* pEventData
15956)
15957{
15958 WDI_Status wdiStatus;
15959 eHalStatus halStatus;
15960 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
15961
15962 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015963 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015964 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15965
15966 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015967 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015968 -------------------------------------------------------------------------*/
15969 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15970 ( NULL == pEventData->pEventData))
15971 {
15972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15973 "%s: Invalid parameters", __FUNCTION__);
15974 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015975 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015976 }
15977
15978 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
15979
15980 wpalMutexAcquire(&pWDICtx->wptMutex);
15981
15982 /*If the link is being transitioned to idle - the BSS is to be deleted
15983 - this type of ending a session is possible when UMAC has failed an
15984 - association session during Join*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015985 if ( WDI_LINK_IDLE_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070015986 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15987 {
15988 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015989 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070015990 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015991 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15992 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
15993 &pBSSSes);
15994
Jeff Johnson295189b2012-06-20 16:38:30 -070015995 /*-----------------------------------------------------------------------
15996 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070015997 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070015998 -----------------------------------------------------------------------*/
15999 if ( NULL == pBSSSes )
16000 {
16001 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
16002 "Set link response received outside association session");
16003 }
16004 else
16005 {
16006 /* For BT AMP roles no need to delete the sessions if assoc fails. There
16007 will be del BSS coming after this to stop the beaconing & cleaning up the
16008 sessions*/
16009 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
16010 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
16011 {
16012 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016013 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070016014 -----------------------------------------------------------------------*/
16015 WDI_DeleteSession(pWDICtx, pBSSSes);
16016
16017 /*-----------------------------------------------------------------------
16018 Check to see if this association is in progress - if so disable the
16019 flag as this has ended
16020 -----------------------------------------------------------------------*/
16021 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
Jeff Johnsone7245742012-09-05 17:12:55 -070016022 {
Jeff Johnson295189b2012-06-20 16:38:30 -070016023 /*Association no longer in progress */
16024 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16025 /*Association no longer in progress - prepare pending assoc for processing*/
16026 WDI_DequeueAssocRequest(pWDICtx);
16027 }
16028 }
16029 }
16030 }
16031 /* If the link state has been set to POST ASSOC, reset the "association in
16032 progress" flag */
Jeff Johnsone7245742012-09-05 17:12:55 -070016033 if ( WDI_LINK_POSTASSOC_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016034 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16035 {
16036 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16037 WDI_DequeueAssocRequest(pWDICtx);
16038 }
16039
16040 wpalMutexRelease(&pWDICtx->wptMutex);
16041
16042 /*-------------------------------------------------------------------------
16043 Extract response and send it to UMAC
16044 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016045 wpalMemoryCopy( &halStatus,
16046 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016047 sizeof(halStatus));
16048
Jeff Johnsone7245742012-09-05 17:12:55 -070016049 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016050
16051 /*Notify UMAC*/
16052 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16053
Jeff Johnsone7245742012-09-05 17:12:55 -070016054 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016055}/*WDI_ProcessSetLinkStateRsp*/
16056
16057/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016058 @brief Process Get Stats Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016059 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016060
16061 @param pWDICtx: pointer to the WLAN DAL context
16062 pEventData: pointer to the event information structure
16063
Jeff Johnson295189b2012-06-20 16:38:30 -070016064 @see
16065 @return Result of the function call
16066*/
16067WDI_Status
16068WDI_ProcessGetStatsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016069(
Jeff Johnson295189b2012-06-20 16:38:30 -070016070 WDI_ControlBlockType* pWDICtx,
16071 WDI_EventInfoType* pEventData
16072)
16073{
16074 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
16075 WDI_GetStatsRspCb wdiGetStatsRspCb;
16076 tHalStatsRspParams* pHalStatsRspParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070016077
Jeff Johnson295189b2012-06-20 16:38:30 -070016078 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16079
16080 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016081 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016082 -------------------------------------------------------------------------*/
16083 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16084 ( NULL == pEventData->pEventData))
16085 {
16086 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16087 "%s: Invalid parameters", __FUNCTION__);
16088 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016089 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016090 }
16091
16092 /*-------------------------------------------------------------------------
16093 Extract response and send it to UMAC
16094 -------------------------------------------------------------------------*/
16095 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
16096
16097 /*allocate the stats response buffer */
16098 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
16099 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
16100 + sizeof(WDI_GetStatsRspParamsType));
16101
16102 if(NULL == wdiGetStatsRsp)
16103 {
16104 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16105 "Failed to allocate memory in Get Stats Response %x %x %x ",
16106 pWDICtx, pEventData, pEventData->pEventData);
16107 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016108 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016109 }
16110
16111 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
16112
16113 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
16114 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
16115 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
16116 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
16117 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
16118 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
16119
16120 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
16121 wpalMemoryCopy(wdiGetStatsRsp + 1,
16122 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
16123 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
16124
16125 /*Notify UMAC*/
16126 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
16127
16128 wpalMemoryFree(wdiGetStatsRsp);
16129
Jeff Johnsone7245742012-09-05 17:12:55 -070016130 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016131}/*WDI_ProcessGetStatsRsp*/
16132
16133
16134/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016135 @brief Process Update Cfg Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016136 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016137
16138 @param pWDICtx: pointer to the WLAN DAL context
16139 pEventData: pointer to the event information structure
16140
Jeff Johnson295189b2012-06-20 16:38:30 -070016141 @see
16142 @return Result of the function call
16143*/
16144WDI_Status
16145WDI_ProcessUpdateCfgRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016146(
Jeff Johnson295189b2012-06-20 16:38:30 -070016147 WDI_ControlBlockType* pWDICtx,
16148 WDI_EventInfoType* pEventData
16149)
16150{
16151 WDI_Status wdiStatus;
16152 eHalStatus halStatus;
16153 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
16154 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16155
16156 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016157 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016158 -------------------------------------------------------------------------*/
16159 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16160 ( NULL == pEventData->pEventData))
16161 {
16162 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16163 "%s: Invalid parameters", __FUNCTION__);
16164 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016165 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016166 }
16167
16168 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
16169
16170 /*-------------------------------------------------------------------------
16171 Extract response and send it to UMAC
16172 -------------------------------------------------------------------------*/
16173 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016174 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016175
16176 /*Notify UMAC*/
16177 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16178
Jeff Johnsone7245742012-09-05 17:12:55 -070016179 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016180}/*WDI_ProcessUpdateCfgRsp*/
16181
16182
16183
16184/**
16185 @brief Process Add BA Rsp function (called when a response
16186 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016187
16188 @param pWDICtx: pointer to the WLAN DAL context
16189 pEventData: pointer to the event information structure
16190
Jeff Johnson295189b2012-06-20 16:38:30 -070016191 @see
16192 @return Result of the function call
16193*/
16194WDI_Status
16195WDI_ProcessAddBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016196(
Jeff Johnson295189b2012-06-20 16:38:30 -070016197 WDI_ControlBlockType* pWDICtx,
16198 WDI_EventInfoType* pEventData
16199)
16200{
16201 WDI_AddBARspCb wdiAddBARspCb;
16202
16203 tAddBARspParams halAddBARsp;
16204 WDI_AddBARspinfoType wdiAddBARsp;
16205
16206 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16207
16208 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016209 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016210 -------------------------------------------------------------------------*/
16211 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16212 ( NULL == pEventData->pEventData))
16213 {
16214 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16215 "%s: Invalid parameters", __FUNCTION__);
16216 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016217 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016218 }
16219
16220 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
16221
16222 /*-------------------------------------------------------------------------
16223 Extract response and send it to UMAC
16224 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016225 wpalMemoryCopy( &halAddBARsp,
16226 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016227 sizeof(halAddBARsp));
16228
16229 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
16230
Jeff Johnson43971f52012-07-17 12:26:56 -070016231 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070016232 {
16233 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
16234 }
16235
16236 /*Notify UMAC*/
16237 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
16238
Jeff Johnsone7245742012-09-05 17:12:55 -070016239 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016240}/*WDI_ProcessAddSessionBARsp*/
16241
16242/**
16243 @brief Process Add BA Rsp function (called when a response
16244 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016245
16246 @param pWDICtx: pointer to the WLAN DAL context
16247 pEventData: pointer to the event information structure
16248
Jeff Johnson295189b2012-06-20 16:38:30 -070016249 @see
16250 @return Result of the function call
16251*/
16252WDI_Status
16253WDI_ProcessTriggerBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016254(
Jeff Johnson295189b2012-06-20 16:38:30 -070016255 WDI_ControlBlockType* pWDICtx,
16256 WDI_EventInfoType* pEventData
16257)
16258{
16259 WDI_TriggerBARspCb wdiTriggerBARspCb;
16260
16261 tTriggerBARspParams* halTriggerBARsp;
16262 tTriggerBaRspCandidate* halBaCandidate;
16263 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
16264 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
16265 wpt_uint16 index;
16266 wpt_uint16 TidIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016267
Jeff Johnson295189b2012-06-20 16:38:30 -070016268 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16269
16270 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016271 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016272 -------------------------------------------------------------------------*/
16273 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16274 ( NULL == pEventData->pEventData))
16275 {
16276 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16277 "%s: Invalid parameters", __FUNCTION__);
16278 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016279 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016280 }
16281
16282 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
16283
16284 /*-------------------------------------------------------------------------
16285 Extract response and send it to UMAC
16286 -------------------------------------------------------------------------*/
16287 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
16288
Jeff Johnsone7245742012-09-05 17:12:55 -070016289 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
16290 halTriggerBARsp->baCandidateCnt *
Jeff Johnson295189b2012-06-20 16:38:30 -070016291 sizeof(WDI_TriggerBARspCandidateType));
16292 if(NULL == wdiTriggerBARsp)
16293 {
16294 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16295 "Failed to allocate memory in Trigger BA Response %x %x %x ",
16296 pWDICtx, pEventData, pEventData->pEventData);
16297 wpalMemoryFree(halTriggerBARsp);
16298 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016299 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016300 }
16301
16302 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
16303
16304 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
16305 {
16306 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
Jeff Johnsone7245742012-09-05 17:12:55 -070016307 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070016308 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
16309
16310 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16311 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16312
16313 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16314 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016315 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070016316 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16317 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16318 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016319 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070016320 halBaCandidate->baInfo[TidIndex].fBaEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070016321 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
Jeff Johnson295189b2012-06-20 16:38:30 -070016322 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16323 }
16324 wdiTriggerBARspCandidate++;
16325 halBaCandidate++;
16326 }
16327 }
16328
16329 /*Notify UMAC*/
16330 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16331
16332 wpalMemoryFree(wdiTriggerBARsp);
Jeff Johnsone7245742012-09-05 17:12:55 -070016333 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016334}/*WDI_ProcessAddSessionBARsp*/
16335
16336/**
16337 @brief Process Update Beacon Params Rsp function (called when a response
16338 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016339
16340 @param pWDICtx: pointer to the WLAN DAL context
16341 pEventData: pointer to the event information structure
16342
Jeff Johnson295189b2012-06-20 16:38:30 -070016343 @see
16344 @return Result of the function call
16345*/
16346WDI_Status
16347WDI_ProcessUpdateBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016348(
Jeff Johnson295189b2012-06-20 16:38:30 -070016349 WDI_ControlBlockType* pWDICtx,
16350 WDI_EventInfoType* pEventData
16351)
16352{
16353 WDI_Status wdiStatus;
16354 eHalStatus halStatus;
16355 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16356 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16357
16358 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016359 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016360 -------------------------------------------------------------------------*/
16361 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16362 ( NULL == pEventData->pEventData))
16363 {
16364 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16365 "%s: Invalid parameters", __FUNCTION__);
16366 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016367 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016368 }
16369
16370 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16371
16372 /*-------------------------------------------------------------------------
16373 Extract response and send it to UMAC
16374 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016375 wpalMemoryCopy( &halStatus,
16376 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016377 sizeof(halStatus));
16378
Jeff Johnsone7245742012-09-05 17:12:55 -070016379 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016380
16381 /*Notify UMAC*/
16382 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16383
Jeff Johnsone7245742012-09-05 17:12:55 -070016384 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016385}/*WDI_ProcessUpdateBeaconParamsRsp*/
16386
16387/**
16388 @brief Process Send Beacon template Rsp function (called when a response
16389 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016390
16391 @param pWDICtx: pointer to the WLAN DAL context
16392 pEventData: pointer to the event information structure
16393
Jeff Johnson295189b2012-06-20 16:38:30 -070016394 @see
16395 @return Result of the function call
16396*/
16397WDI_Status
16398WDI_ProcessSendBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016399(
Jeff Johnson295189b2012-06-20 16:38:30 -070016400 WDI_ControlBlockType* pWDICtx,
16401 WDI_EventInfoType* pEventData
16402)
16403{
16404 WDI_Status wdiStatus;
16405 eHalStatus halStatus;
16406 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16407 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16408
16409 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016410 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016411 -------------------------------------------------------------------------*/
16412 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16413 ( NULL == pEventData->pEventData))
16414 {
16415 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16416 "%s: Invalid parameters", __FUNCTION__);
16417 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016418 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016419 }
16420
16421 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16422
16423 /*-------------------------------------------------------------------------
16424 Extract response and send it to UMAC
16425 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016426 wpalMemoryCopy( &halStatus,
16427 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016428 sizeof(halStatus));
16429
Jeff Johnsone7245742012-09-05 17:12:55 -070016430 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016431
16432 /*Notify UMAC*/
16433 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16434
Jeff Johnsone7245742012-09-05 17:12:55 -070016435 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016436}/*WDI_ProcessSendBeaconParamsRsp*/
16437
Jeff Johnsone7245742012-09-05 17:12:55 -070016438
Jeff Johnson295189b2012-06-20 16:38:30 -070016439/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016440 @brief Process Update Probe Resp Template Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016441 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016442
16443 @param pWDICtx: pointer to the WLAN DAL context
16444 pEventData: pointer to the event information structure
16445
Jeff Johnson295189b2012-06-20 16:38:30 -070016446 @see
16447 @return Result of the function call
16448*/
16449WDI_Status
16450WDI_ProcessUpdateProbeRspTemplateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016451(
Jeff Johnson295189b2012-06-20 16:38:30 -070016452 WDI_ControlBlockType* pWDICtx,
16453 WDI_EventInfoType* pEventData
16454)
16455{
16456 WDI_Status wdiStatus;
16457 eHalStatus halStatus;
16458 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16459 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16460
16461 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016462 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016463 -------------------------------------------------------------------------*/
16464 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16465 ( NULL == pEventData->pEventData))
16466 {
16467 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16468 "%s: Invalid parameters", __FUNCTION__);
16469 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016470 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016471 }
16472
16473 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16474
16475 /*-------------------------------------------------------------------------
16476 Extract response and send it to UMAC
16477 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016478 wpalMemoryCopy( &halStatus,
16479 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016480 sizeof(halStatus));
16481
Jeff Johnsone7245742012-09-05 17:12:55 -070016482 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016483
16484 /*Notify UMAC*/
16485 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16486
Jeff Johnsone7245742012-09-05 17:12:55 -070016487 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016488}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16489
16490 /**
16491 @brief Process Set Max Tx Power Rsp function (called when a response
16492 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016493
16494 @param pWDICtx: pointer to the WLAN DAL context
16495 pEventData: pointer to the event information structure
16496
Jeff Johnson295189b2012-06-20 16:38:30 -070016497 @see
16498 @return Result of the function call
16499*/
16500WDI_Status
16501WDI_ProcessSetMaxTxPowerRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016502(
Jeff Johnson295189b2012-06-20 16:38:30 -070016503 WDI_ControlBlockType* pWDICtx,
16504 WDI_EventInfoType* pEventData
16505)
16506{
16507 tSetMaxTxPwrRspMsg halTxpowerrsp;
Jeff Johnsone7245742012-09-05 17:12:55 -070016508
Jeff Johnson295189b2012-06-20 16:38:30 -070016509 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070016510
Jeff Johnson295189b2012-06-20 16:38:30 -070016511 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16512 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16513
16514 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016515 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016516 -------------------------------------------------------------------------*/
16517 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16518 ( NULL == pEventData->pEventData))
16519 {
16520 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16521 "%s: Invalid parameters", __FUNCTION__);
16522 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016523 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016524 }
16525
16526 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16527
16528 /*-------------------------------------------------------------------------
16529 Extract response and send it to UMAC
16530 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016531 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16532 pEventData->pEventData,
16533 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070016534
16535 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16536 {
16537 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16538 "Error status returned in Set Max Tx Power Response ");
Jeff Johnsone7245742012-09-05 17:12:55 -070016539 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16540 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016541 }
16542
Jeff Johnsone7245742012-09-05 17:12:55 -070016543 wdiSetMaxTxPowerRspMsg.wdiStatus =
Jeff Johnson295189b2012-06-20 16:38:30 -070016544 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
Jeff Johnsone7245742012-09-05 17:12:55 -070016545 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
Jeff Johnson295189b2012-06-20 16:38:30 -070016546
16547 /*Notify UMAC*/
16548 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16549
Jeff Johnsone7245742012-09-05 17:12:55 -070016550 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016551}
16552
16553#ifdef WLAN_FEATURE_P2P
16554/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016555 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016556 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016557
16558 @param pWDICtx: pointer to the WLAN DAL context
16559 pEventData: pointer to the event information structure
16560
Jeff Johnson295189b2012-06-20 16:38:30 -070016561 @see
16562 @return Result of the function call
16563*/
16564WDI_Status
16565WDI_ProcessP2PGONOARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016566(
Jeff Johnson295189b2012-06-20 16:38:30 -070016567 WDI_ControlBlockType* pWDICtx,
16568 WDI_EventInfoType* pEventData
16569)
16570{
16571 WDI_Status wdiStatus;
16572 eHalStatus halStatus;
16573 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16574 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16575
16576 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016577 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016578 -------------------------------------------------------------------------*/
16579 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16580 ( NULL == pEventData->pEventData))
16581 {
16582 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16583 "%s: Invalid parameters", __FUNCTION__);
16584 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016585 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016586 }
16587
16588 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16589
16590 /*-------------------------------------------------------------------------
16591 Extract response and send it to UMAC
16592 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016593 wpalMemoryCopy( &halStatus,
16594 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016595 sizeof(halStatus));
16596
Jeff Johnsone7245742012-09-05 17:12:55 -070016597 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016598
16599 /*Notify UMAC*/
16600 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16601
Jeff Johnsone7245742012-09-05 17:12:55 -070016602 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016603}/*WDI_ProcessP2PGONOARsp*/
16604#endif
16605/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016606 @brief Process Enter IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016607 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016608
16609 @param pWDICtx: pointer to the WLAN DAL context
16610 pEventData: pointer to the event information structure
16611
Jeff Johnson295189b2012-06-20 16:38:30 -070016612 @see
16613 @return Result of the function call
16614*/
16615WDI_Status
16616WDI_ProcessEnterImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016617(
Jeff Johnson295189b2012-06-20 16:38:30 -070016618 WDI_ControlBlockType* pWDICtx,
16619 WDI_EventInfoType* pEventData
16620)
16621{
16622 WDI_Status wdiStatus;
16623 eHalStatus halStatus;
16624 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16625 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16626
16627 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016628 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016629 -------------------------------------------------------------------------*/
16630 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16631 ( NULL == pEventData->pEventData))
16632 {
16633 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16634 "%s: Invalid parameters", __FUNCTION__);
16635 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016636 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016637 }
16638
16639 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16640
16641 /*-------------------------------------------------------------------------
16642 Extract response and send it to UMAC
16643 -------------------------------------------------------------------------*/
16644 halStatus = *((eHalStatus*)pEventData->pEventData);
16645
Jeff Johnsone7245742012-09-05 17:12:55 -070016646 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016647
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016648 /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state.
16649 * Other module states are taken care by PMC.
16650 * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails??
16651 */
16652 if (wdiStatus != WDI_STATUS_SUCCESS) {
16653
16654 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16655 "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus);
16656 /* Call Back is not required as we are putting the DXE in FULL
16657 * and riva is already in full (IMPS RSP Failed)*/
16658 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16659 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016660 /*Notify UMAC*/
16661 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16662
Jeff Johnsone7245742012-09-05 17:12:55 -070016663 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016664}/*WDI_ProcessEnterImpsRsp*/
16665
16666/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016667 @brief Process Exit IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016668 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016669
16670 @param pWDICtx: pointer to the WLAN DAL context
16671 pEventData: pointer to the event information structure
16672
Jeff Johnson295189b2012-06-20 16:38:30 -070016673 @see
16674 @return Result of the function call
16675*/
16676WDI_Status
16677WDI_ProcessExitImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016678(
Jeff Johnson295189b2012-06-20 16:38:30 -070016679 WDI_ControlBlockType* pWDICtx,
16680 WDI_EventInfoType* pEventData
16681)
16682{
16683 WDI_Status wdiStatus;
16684 eHalStatus halStatus;
16685 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16686 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16687
16688 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016689 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016690 -------------------------------------------------------------------------*/
16691 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16692 ( NULL == pEventData->pEventData))
16693 {
16694 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16695 "%s: Invalid parameters", __FUNCTION__);
16696 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016697 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016698 }
16699
16700 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16701
16702 /*-------------------------------------------------------------------------
16703 Extract response and send it to UMAC
16704 -------------------------------------------------------------------------*/
16705 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016706 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016707
16708 // notify DTS that we are entering Full power
16709 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16710
16711 /*Notify UMAC*/
16712 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16713
Jeff Johnsone7245742012-09-05 17:12:55 -070016714 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016715}/*WDI_ProcessExitImpsRsp*/
16716
16717/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016718 @brief Process Enter BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016719 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016720
16721 @param pWDICtx: pointer to the WLAN DAL context
16722 pEventData: pointer to the event information structure
16723
Jeff Johnson295189b2012-06-20 16:38:30 -070016724 @see
16725 @return Result of the function call
16726*/
16727WDI_Status
16728WDI_ProcessEnterBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016729(
Jeff Johnson295189b2012-06-20 16:38:30 -070016730 WDI_ControlBlockType* pWDICtx,
16731 WDI_EventInfoType* pEventData
16732)
16733{
16734 WDI_Status wdiStatus;
16735 eHalStatus halStatus;
16736 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16737 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16738
16739 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016740 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016741 -------------------------------------------------------------------------*/
16742 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16743 ( NULL == pEventData->pEventData))
16744 {
16745 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16746 "%s: Invalid parameters", __FUNCTION__);
16747 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016748 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016749 }
16750
16751 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
16752
16753 /*-------------------------------------------------------------------------
16754 Extract response and send it to UMAC
16755 -------------------------------------------------------------------------*/
16756 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016757 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016758
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016759 /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state.
16760 * Other module states are taken care by PMC.
16761 * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails??
16762 */
16763 if (wdiStatus != WDI_STATUS_SUCCESS) {
16764
16765 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16766 "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus);
16767 /* Call Back is not required as we are putting the DXE in FULL
16768 * and riva is already in FULL (BMPS RSP Failed)*/
16769 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16770 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16771 }
16772
Jeff Johnson295189b2012-06-20 16:38:30 -070016773 /*Notify UMAC*/
16774 wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16775
Jeff Johnsone7245742012-09-05 17:12:55 -070016776 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016777}/*WDI_ProcessEnterBmpsRsp*/
16778
16779/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016780 @brief Process Exit BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016781 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016782
16783 @param pWDICtx: pointer to the WLAN DAL context
16784 pEventData: pointer to the event information structure
16785
Jeff Johnson295189b2012-06-20 16:38:30 -070016786 @see
16787 @return Result of the function call
16788*/
16789WDI_Status
16790WDI_ProcessExitBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016791(
Jeff Johnson295189b2012-06-20 16:38:30 -070016792 WDI_ControlBlockType* pWDICtx,
16793 WDI_EventInfoType* pEventData
16794)
16795{
16796 WDI_Status wdiStatus;
16797 eHalStatus halStatus;
16798 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
16799 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16800
16801 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016802 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016803 -------------------------------------------------------------------------*/
16804 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16805 ( NULL == pEventData->pEventData))
16806 {
16807 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16808 "%s: Invalid parameters", __FUNCTION__);
16809 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016810 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016811 }
16812
16813 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16814
16815 /*-------------------------------------------------------------------------
16816 Extract response and send it to UMAC
16817 -------------------------------------------------------------------------*/
16818 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016819 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016820
16821 // notify DTS that we are entering Full power
16822 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16823
16824 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16825
16826 /*Notify UMAC*/
16827 wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16828
Jeff Johnsone7245742012-09-05 17:12:55 -070016829 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016830}/*WDI_ProcessExitBmpsRsp*/
16831
16832/**
16833 @brief Process Enter UAPSD Rsp function (called when a response
16834 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016835
16836 @param pWDICtx: pointer to the WLAN DAL context
16837 pEventData: pointer to the event information structure
16838
Jeff Johnson295189b2012-06-20 16:38:30 -070016839 @see
16840 @return Result of the function call
16841*/
16842WDI_Status
16843WDI_ProcessEnterUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016844(
Jeff Johnson295189b2012-06-20 16:38:30 -070016845 WDI_ControlBlockType* pWDICtx,
16846 WDI_EventInfoType* pEventData
16847)
16848{
16849 WDI_Status wdiStatus;
16850 eHalStatus halStatus;
16851 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
16852 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16853
16854 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016855 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016856 -------------------------------------------------------------------------*/
16857 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16858 ( NULL == pEventData->pEventData))
16859 {
16860 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16861 "%s: Invalid parameters", __FUNCTION__);
16862 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016863 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016864 }
16865
16866 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16867
16868 /*-------------------------------------------------------------------------
16869 Extract response and send it to UMAC
16870 -------------------------------------------------------------------------*/
16871 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016872 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016873
16874 if(WDI_STATUS_SUCCESS == wdiStatus)
16875 {
16876 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
16877 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
16878 // the traffic to decide when to suspend the trigger frames when there is no traffic
16879 // activity on the trigger enabled ACs
16880 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
16881
16882#ifdef WLAN_PERF
16883 // Increment the BD signature to refresh the fast path BD utilization
16884 pWDICtx->uBdSigSerialNum++;
16885#endif
16886 }
16887
16888 /*Notify UMAC*/
16889 wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16890
Jeff Johnsone7245742012-09-05 17:12:55 -070016891 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016892}/*WDI_ProcessEnterUapsdRsp*/
16893
16894/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016895 @brief Process Exit UAPSD Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016896 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016897
16898 @param pWDICtx: pointer to the WLAN DAL context
16899 pEventData: pointer to the event information structure
16900
Jeff Johnson295189b2012-06-20 16:38:30 -070016901 @see
16902 @return Result of the function call
16903*/
16904WDI_Status
16905WDI_ProcessExitUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016906(
Jeff Johnson295189b2012-06-20 16:38:30 -070016907 WDI_ControlBlockType* pWDICtx,
16908 WDI_EventInfoType* pEventData
16909)
16910{
16911 WDI_Status wdiStatus;
16912 eHalStatus halStatus;
16913 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
16914 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16915
16916 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016917 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016918 -------------------------------------------------------------------------*/
16919 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16920 ( NULL == pEventData->pEventData))
16921 {
16922 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16923 "%s: Invalid parameters", __FUNCTION__);
16924 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016925 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016926 }
16927
16928 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
16929
16930 /*-------------------------------------------------------------------------
16931 Extract response and send it to UMAC
16932 -------------------------------------------------------------------------*/
16933 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016934 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016935
16936 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
16937 // directly instead of the FW WQ.
16938 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
16939
16940#ifdef WLAN_PERF
16941 // Increment the BD signature to refresh the fast path BD utilization
16942 pWDICtx->uBdSigSerialNum++;
16943#endif
16944
16945 /*Notify UMAC*/
16946 wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16947
Jeff Johnsone7245742012-09-05 17:12:55 -070016948 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016949}/*WDI_ProcessExitUapsdRsp*/
16950
16951/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016952 @brief Process set UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016953 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016954
16955 @param pWDICtx: pointer to the WLAN DAL context
16956 pEventData: pointer to the event information structure
16957
Jeff Johnson295189b2012-06-20 16:38:30 -070016958 @see
16959 @return Result of the function call
16960*/
16961WDI_Status
16962WDI_ProcessSetUapsdAcParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016963(
Jeff Johnson295189b2012-06-20 16:38:30 -070016964 WDI_ControlBlockType* pWDICtx,
16965 WDI_EventInfoType* pEventData
16966)
16967{
16968 WDI_Status wdiStatus;
16969 eHalStatus halStatus;
16970 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
16971 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16972
16973 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016974 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016975 -------------------------------------------------------------------------*/
16976 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16977 ( NULL == pEventData->pEventData))
16978 {
16979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16980 "%s: Invalid parameters", __FUNCTION__);
16981 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016982 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016983 }
16984
16985 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
16986
16987 /*-------------------------------------------------------------------------
16988 Extract response and send it to UMAC
16989 -------------------------------------------------------------------------*/
16990 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016991 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016992
16993 /*Notify UMAC*/
16994 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16995
Jeff Johnsone7245742012-09-05 17:12:55 -070016996 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016997}/*WDI_ProcessSetUapsdAcParamsRsp*/
16998
16999/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017000 @brief Process update UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017001 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017002
17003 @param pWDICtx: pointer to the WLAN DAL context
17004 pEventData: pointer to the event information structure
17005
Jeff Johnson295189b2012-06-20 16:38:30 -070017006 @see
17007 @return Result of the function call
17008*/
17009WDI_Status
17010WDI_ProcessUpdateUapsdParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017011(
Jeff Johnson295189b2012-06-20 16:38:30 -070017012 WDI_ControlBlockType* pWDICtx,
17013 WDI_EventInfoType* pEventData
17014)
17015{
17016 WDI_Status wdiStatus;
17017 eHalStatus halStatus;
17018 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
17019 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17020
17021 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017022 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017023 -------------------------------------------------------------------------*/
17024 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17025 ( NULL == pEventData->pEventData))
17026 {
17027 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17028 "%s: Invalid parameters", __FUNCTION__);
17029 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017030 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017031 }
17032
17033 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
17034
17035 /*-------------------------------------------------------------------------
17036 Extract response and send it to UMAC
17037 -------------------------------------------------------------------------*/
17038 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017039 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017040
17041 /*Notify UMAC*/
17042 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17043
Jeff Johnsone7245742012-09-05 17:12:55 -070017044 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017045}/*WDI_ProcessUpdateUapsdParamsRsp*/
17046
17047/**
17048 @brief Process Configure RXP filter Rsp function (called when a
17049 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017050
17051 @param pWDICtx: pointer to the WLAN DAL context
17052 pEventData: pointer to the event information structure
17053
Jeff Johnson295189b2012-06-20 16:38:30 -070017054 @see
17055 @return Result of the function call
17056*/
17057WDI_Status
17058WDI_ProcessConfigureRxpFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017059(
Jeff Johnson295189b2012-06-20 16:38:30 -070017060 WDI_ControlBlockType* pWDICtx,
17061 WDI_EventInfoType* pEventData
17062)
17063{
17064 WDI_Status wdiStatus;
17065 eHalStatus halStatus;
17066 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
17067 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17068
17069 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017070 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017071 -------------------------------------------------------------------------*/
17072 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17073 ( NULL == pEventData->pEventData))
17074 {
17075 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17076 "%s: Invalid parameters", __FUNCTION__);
17077 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017078 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017079 }
17080
17081 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
17082
17083 /*-------------------------------------------------------------------------
17084 Extract response and send it to UMAC
17085 -------------------------------------------------------------------------*/
17086 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017087 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017088
17089 /*Notify UMAC*/
17090 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17091
Jeff Johnsone7245742012-09-05 17:12:55 -070017092 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017093}/*WDI_ProcessConfigureRxpFilterRsp*/
17094
17095/**
17096 @brief Process Set beacon filter Rsp function (called when a
17097 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017098
17099 @param pWDICtx: pointer to the WLAN DAL context
17100 pEventData: pointer to the event information structure
17101
Jeff Johnson295189b2012-06-20 16:38:30 -070017102 @see
17103 @return Result of the function call
17104*/
17105WDI_Status
17106WDI_ProcessSetBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017107(
Jeff Johnson295189b2012-06-20 16:38:30 -070017108 WDI_ControlBlockType* pWDICtx,
17109 WDI_EventInfoType* pEventData
17110)
17111{
17112 WDI_Status wdiStatus;
17113 eHalStatus halStatus;
17114 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
17115 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17116
17117 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017118 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017119 -------------------------------------------------------------------------*/
17120 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17121 ( NULL == pEventData->pEventData))
17122 {
17123 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17124 "%s: Invalid parameters", __FUNCTION__);
17125 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017126 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017127 }
17128
17129 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
17130
17131 /*-------------------------------------------------------------------------
17132 Extract response and send it to UMAC
17133 -------------------------------------------------------------------------*/
17134 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017135 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017136
17137 /*Notify UMAC*/
17138 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17139
Jeff Johnsone7245742012-09-05 17:12:55 -070017140 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017141}/*WDI_ProcessSetBeaconFilterRsp*/
17142
17143/**
17144 @brief Process remove beacon filter Rsp function (called when a
17145 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017146
17147 @param pWDICtx: pointer to the WLAN DAL context
17148 pEventData: pointer to the event information structure
17149
Jeff Johnson295189b2012-06-20 16:38:30 -070017150 @see
17151 @return Result of the function call
17152*/
17153WDI_Status
17154WDI_ProcessRemBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017155(
Jeff Johnson295189b2012-06-20 16:38:30 -070017156 WDI_ControlBlockType* pWDICtx,
17157 WDI_EventInfoType* pEventData
17158)
17159{
17160 WDI_Status wdiStatus;
17161 eHalStatus halStatus;
17162 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
17163 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17164
17165 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017166 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017167 -------------------------------------------------------------------------*/
17168 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17169 ( NULL == pEventData->pEventData))
17170 {
17171 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17172 "%s: Invalid parameters", __FUNCTION__);
17173 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017174 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017175 }
17176
17177 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
17178
17179 /*-------------------------------------------------------------------------
17180 Extract response and send it to UMAC
17181 -------------------------------------------------------------------------*/
17182 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017183 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017184
17185 /*Notify UMAC*/
17186 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17187
Jeff Johnsone7245742012-09-05 17:12:55 -070017188 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017189}/*WDI_ProcessRemBeaconFilterRsp*/
17190
17191/**
17192 @brief Process set RSSI thresholds Rsp function (called when a
17193 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017194
17195 @param pWDICtx: pointer to the WLAN DAL context
17196 pEventData: pointer to the event information structure
17197
Jeff Johnson295189b2012-06-20 16:38:30 -070017198 @see
17199 @return Result of the function call
17200*/
17201WDI_Status
17202WDI_ProcessSetRSSIThresoldsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017203(
Jeff Johnson295189b2012-06-20 16:38:30 -070017204 WDI_ControlBlockType* pWDICtx,
17205 WDI_EventInfoType* pEventData
17206)
17207{
17208 WDI_Status wdiStatus;
17209 eHalStatus halStatus;
17210 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
17211 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17212
17213 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017214 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017215 -------------------------------------------------------------------------*/
17216 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17217 ( NULL == pEventData->pEventData))
17218 {
17219 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17220 "%s: Invalid parameters", __FUNCTION__);
17221 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017222 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017223 }
17224
17225 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
17226
17227 /*-------------------------------------------------------------------------
17228 Extract response and send it to UMAC
17229 -------------------------------------------------------------------------*/
17230 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017231 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017232
17233 /*Notify UMAC*/
17234 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
17235
Jeff Johnsone7245742012-09-05 17:12:55 -070017236 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017237}/*WDI_ProcessSetRSSIThresoldsRsp*/
17238
17239/**
17240 @brief Process host offload Rsp function (called when a
17241 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017242
17243 @param pWDICtx: pointer to the WLAN DAL context
17244 pEventData: pointer to the event information structure
17245
Jeff Johnson295189b2012-06-20 16:38:30 -070017246 @see
17247 @return Result of the function call
17248*/
17249WDI_Status
17250WDI_ProcessHostOffloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017251(
Jeff Johnson295189b2012-06-20 16:38:30 -070017252 WDI_ControlBlockType* pWDICtx,
17253 WDI_EventInfoType* pEventData
17254)
17255{
17256 WDI_Status wdiStatus;
17257 eHalStatus halStatus;
17258 WDI_HostOffloadCb wdiHostOffloadCb;
17259 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17260
17261 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017262 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017263 -------------------------------------------------------------------------*/
17264 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17265 ( NULL == pEventData->pEventData))
17266 {
17267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17268 "%s: Invalid parameters", __FUNCTION__);
17269 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017271 }
17272
17273 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
17274
17275 /*-------------------------------------------------------------------------
17276 Extract response and send it to UMAC
17277 -------------------------------------------------------------------------*/
17278 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017279 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017280
17281 /*Notify UMAC*/
17282 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
17283
Jeff Johnsone7245742012-09-05 17:12:55 -070017284 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017285}/*WDI_ProcessHostOffloadRsp*/
17286
17287/**
17288 @brief Process keep alive Rsp function (called when a
17289 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017290
17291 @param pWDICtx: pointer to the WLAN DAL context
17292 pEventData: pointer to the event information structure
17293
Jeff Johnson295189b2012-06-20 16:38:30 -070017294 @see
17295 @return Result of the function call
17296*/
17297WDI_Status
17298WDI_ProcessKeepAliveRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017299(
Jeff Johnson295189b2012-06-20 16:38:30 -070017300 WDI_ControlBlockType* pWDICtx,
17301 WDI_EventInfoType* pEventData
17302)
17303{
17304 WDI_Status wdiStatus;
17305 eHalStatus halStatus;
17306 WDI_KeepAliveCb wdiKeepAliveCb;
17307 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17308 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17309 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
17310
17311
17312 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017313 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017314 -------------------------------------------------------------------------*/
17315 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17316 ( NULL == pEventData->pEventData))
17317 {
17318 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17319 "%s: Invalid parameters", __FUNCTION__);
17320 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017321 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017322 }
17323
Jeff Johnsone7245742012-09-05 17:12:55 -070017324 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
17325
Jeff Johnson295189b2012-06-20 16:38:30 -070017326 /*-------------------------------------------------------------------------
17327 Extract response and send it to UMAC
17328 -------------------------------------------------------------------------*/
17329 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017330 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017331
17332 /*Notify UMAC*/
17333 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
17334
Jeff Johnsone7245742012-09-05 17:12:55 -070017335 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017336}/*WDI_ProcessKeepAliveRsp*/
17337
17338/**
17339 @brief Process wowl add ptrn Rsp function (called when a
17340 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017341
17342 @param pWDICtx: pointer to the WLAN DAL context
17343 pEventData: pointer to the event information structure
17344
Jeff Johnson295189b2012-06-20 16:38:30 -070017345 @see
17346 @return Result of the function call
17347*/
17348WDI_Status
17349WDI_ProcessWowlAddBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017350(
Jeff Johnson295189b2012-06-20 16:38:30 -070017351 WDI_ControlBlockType* pWDICtx,
17352 WDI_EventInfoType* pEventData
17353)
17354{
17355 WDI_Status wdiStatus;
17356 eHalStatus halStatus;
17357 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
17358 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17359
17360 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017361 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017362 -------------------------------------------------------------------------*/
17363 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17364 ( NULL == pEventData->pEventData))
17365 {
17366 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17367 "%s: Invalid parameters", __FUNCTION__);
17368 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017369 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017370 }
17371
17372 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17373
17374 /*-------------------------------------------------------------------------
17375 Extract response and send it to UMAC
17376 -------------------------------------------------------------------------*/
17377 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017378 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017379
17380 /*Notify UMAC*/
17381 wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17382
Jeff Johnsone7245742012-09-05 17:12:55 -070017383 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017384}/*WDI_ProcessWowlAddBcPtrnRsp*/
17385
17386/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017387 @brief Process wowl delete ptrn Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017388 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017389
17390 @param pWDICtx: pointer to the WLAN DAL context
17391 pEventData: pointer to the event information structure
17392
Jeff Johnson295189b2012-06-20 16:38:30 -070017393 @see
17394 @return Result of the function call
17395*/
17396WDI_Status
17397WDI_ProcessWowlDelBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017398(
Jeff Johnson295189b2012-06-20 16:38:30 -070017399 WDI_ControlBlockType* pWDICtx,
17400 WDI_EventInfoType* pEventData
17401)
17402{
17403 WDI_Status wdiStatus;
17404 eHalStatus halStatus;
17405 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
17406 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17407
17408 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017409 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017410 -------------------------------------------------------------------------*/
17411 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17412 ( NULL == pEventData->pEventData))
17413 {
17414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17415 "%s: Invalid parameters", __FUNCTION__);
17416 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017417 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017418 }
17419
17420 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17421
17422 /*-------------------------------------------------------------------------
17423 Extract response and send it to UMAC
17424 -------------------------------------------------------------------------*/
17425 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017426 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017427
17428 /*Notify UMAC*/
17429 wdiWowlDelBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17430
Jeff Johnsone7245742012-09-05 17:12:55 -070017431 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017432}/*WDI_ProcessWowlDelBcPtrnRsp*/
17433
17434/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017435 @brief Process wowl enter Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017436 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017437
17438 @param pWDICtx: pointer to the WLAN DAL context
17439 pEventData: pointer to the event information structure
17440
Jeff Johnson295189b2012-06-20 16:38:30 -070017441 @see
17442 @return Result of the function call
17443*/
17444WDI_Status
17445WDI_ProcessWowlEnterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017446(
Jeff Johnson295189b2012-06-20 16:38:30 -070017447 WDI_ControlBlockType* pWDICtx,
17448 WDI_EventInfoType* pEventData
17449)
17450{
17451 WDI_Status wdiStatus;
17452 eHalStatus halStatus;
17453 WDI_WowlEnterReqCb wdiWowlEnterCb;
17454 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17455
17456 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017457 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017458 -------------------------------------------------------------------------*/
17459 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17460 ( NULL == pEventData->pEventData))
17461 {
17462 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17463 "%s: Invalid parameters", __FUNCTION__);
17464 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017465 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017466 }
17467
17468 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17469
17470 /*-------------------------------------------------------------------------
17471 Extract response and send it to UMAC
17472 -------------------------------------------------------------------------*/
17473 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017474 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017475
17476 /*Notify UMAC*/
17477 wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData);
17478
Jeff Johnsone7245742012-09-05 17:12:55 -070017479 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017480}/*WDI_ProcessWowlEnterRsp*/
17481
17482/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017483 @brief Process wowl exit Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017484 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017485
17486 @param pWDICtx: pointer to the WLAN DAL context
17487 pEventData: pointer to the event information structure
17488
Jeff Johnson295189b2012-06-20 16:38:30 -070017489 @see
17490 @return Result of the function call
17491*/
17492WDI_Status
17493WDI_ProcessWowlExitRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017494(
Jeff Johnson295189b2012-06-20 16:38:30 -070017495 WDI_ControlBlockType* pWDICtx,
17496 WDI_EventInfoType* pEventData
17497)
17498{
17499 WDI_Status wdiStatus;
17500 eHalStatus halStatus;
17501 WDI_WowlExitReqCb wdiWowlExitCb;
17502 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17503
17504 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017505 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017506 -------------------------------------------------------------------------*/
17507 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17508 ( NULL == pEventData->pEventData))
17509 {
17510 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17511 "%s: Invalid parameters", __FUNCTION__);
17512 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017513 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017514 }
17515
17516 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17517
17518 /*-------------------------------------------------------------------------
17519 Extract response and send it to UMAC
17520 -------------------------------------------------------------------------*/
17521 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017522 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017523
17524 /*Notify UMAC*/
17525 wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData);
17526
Jeff Johnsone7245742012-09-05 17:12:55 -070017527 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017528}/*WDI_ProcessWowlExitRsp*/
17529
17530/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017531 @brief Process Configure Apps CPU wakeup State Rsp function
Jeff Johnson295189b2012-06-20 16:38:30 -070017532 (called when a response is being received over the bus
17533 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017534
17535 @param pWDICtx: pointer to the WLAN DAL context
17536 pEventData: pointer to the event information structure
17537
Jeff Johnson295189b2012-06-20 16:38:30 -070017538 @see
17539 @return Result of the function call
17540*/
17541WDI_Status
17542WDI_ProcessConfigureAppsCpuWakeupStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017543(
Jeff Johnson295189b2012-06-20 16:38:30 -070017544 WDI_ControlBlockType* pWDICtx,
17545 WDI_EventInfoType* pEventData
17546)
17547{
17548 WDI_Status wdiStatus;
17549 eHalStatus halStatus;
17550 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17551 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17552
17553 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017554 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017555 -------------------------------------------------------------------------*/
17556 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17557 ( NULL == pEventData->pEventData))
17558 {
17559 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17560 "%s: Invalid parameters", __FUNCTION__);
17561 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017562 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017563 }
17564
17565 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17566
17567 /*-------------------------------------------------------------------------
17568 Extract response and send it to UMAC
17569 -------------------------------------------------------------------------*/
17570 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017571 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017572
17573 /*Notify UMAC*/
17574 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17575
Jeff Johnsone7245742012-09-05 17:12:55 -070017576 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017577}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17578
17579
17580/**
17581 @brief Process Nv download(called when a response
17582 is being received over the bus from HAL,will check if the responce is )
Jeff Johnsone7245742012-09-05 17:12:55 -070017583
17584 @param pWDICtx: pointer to the WLAN DAL context
17585 pEventData: pointer to the event information structure
17586
Jeff Johnson295189b2012-06-20 16:38:30 -070017587 @see
17588 @return Result of the function call
17589*/
17590WDI_Status
17591WDI_ProcessNvDownloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017592(
Jeff Johnson295189b2012-06-20 16:38:30 -070017593 WDI_ControlBlockType* pWDICtx,
17594 WDI_EventInfoType* pEventData
17595)
17596{
17597
17598 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17599 tHalNvImgDownloadRspParams halNvDownloadRsp;
17600 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17601
17602 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017603 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017604 -------------------------------------------------------------------------*/
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);
Jeff Johnsone7245742012-09-05 17:12:55 -070017611 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017612 }
17613
17614 /*-------------------------------------------------------------------------
17615 Extract response and send it to UMAC
17616 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017617 wpalMemoryCopy( &halNvDownloadRsp,
17618 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017619 sizeof(halNvDownloadRsp));
17620
17621 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17622
17623 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
Jeff Johnsone7245742012-09-05 17:12:55 -070017624 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17625 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
Jeff Johnson295189b2012-06-20 16:38:30 -070017626 {
17627 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
Jeff Johnsone7245742012-09-05 17:12:55 -070017628 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017629 }
17630 else
17631 {
17632 /*Reset the Nv related global information in WDI context information */
17633 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17634 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17635 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17636 /*call WDA callback function for last fragment */
17637 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17638 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17639 }
17640
Jeff Johnsone7245742012-09-05 17:12:55 -070017641 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017642}
17643#ifdef WLAN_FEATURE_VOWIFI_11R
17644/**
17645 @brief Process Add TSpec Rsp function (called when a response
17646 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017647
17648 @param pWDICtx: pointer to the WLAN DAL context
17649 pEventData: pointer to the event information structure
17650
Jeff Johnson295189b2012-06-20 16:38:30 -070017651 @see
17652 @return Result of the function call
17653*/
17654WDI_Status
17655WDI_ProcessAggrAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017656(
Jeff Johnson295189b2012-06-20 16:38:30 -070017657 WDI_ControlBlockType* pWDICtx,
17658 WDI_EventInfoType* pEventData
17659)
17660{
17661 WDI_Status wdiStatus;
17662 tAggrAddTsRspParams aggrAddTsRsp;
17663 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17664 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17665
17666 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017667 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017668 -------------------------------------------------------------------------*/
17669 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17670 ( NULL == pEventData->pEventData))
17671 {
17672 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17673 "%s: Invalid parameters", __FUNCTION__);
17674 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017675 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017676 }
17677
17678 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17679
17680 /*-------------------------------------------------------------------------
17681 Extract response and send it to UMAC
17682 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017683 wpalMemoryCopy( &aggrAddTsRsp,
17684 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017685 sizeof(aggrAddTsRsp));
17686
17687 /* What is the difference between status0 and status1? */
Jeff Johnsone7245742012-09-05 17:12:55 -070017688 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
Jeff Johnson295189b2012-06-20 16:38:30 -070017689
17690 /*Notify UMAC*/
17691 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17692
Jeff Johnsone7245742012-09-05 17:12:55 -070017693 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017694}/*WDI_ProcessAddTSpecRsp*/
17695#endif /* WLAN_FEATURE_VOWIFI_11R */
17696
17697/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017698 @brief WDI_ProcessHostResumeRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017699 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017700
17701 @param pWDICtx: pointer to the WLAN DAL context
17702 pEventData: pointer to the event information structure
17703
Jeff Johnson295189b2012-06-20 16:38:30 -070017704 @see
17705 @return Result of the function call
17706*/
17707WDI_Status
17708WDI_ProcessHostResumeRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017709(
Jeff Johnson295189b2012-06-20 16:38:30 -070017710 WDI_ControlBlockType* pWDICtx,
17711 WDI_EventInfoType* pEventData
17712)
17713{
17714 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17715 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17716 tHalHostResumeRspParams hostResumeRspMsg;
17717 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17718
17719 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017720 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017721 -------------------------------------------------------------------------*/
17722 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17723 ( NULL == pEventData->pEventData))
17724 {
17725 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17726 "%s: Invalid parameters", __FUNCTION__);
17727 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017728 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017729 }
17730
17731 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17732
17733 /*-------------------------------------------------------------------------
17734 Extract response and send it to UMAC
17735 -------------------------------------------------------------------------*/
17736
Jeff Johnsone7245742012-09-05 17:12:55 -070017737 wpalMemoryCopy( &hostResumeRspMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -070017738 (wpt_uint8*)pEventData->pEventData,
17739 sizeof(hostResumeRspMsg));
17740
Jeff Johnsone7245742012-09-05 17:12:55 -070017741 wdiResumeRspParams.wdiStatus =
17742 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070017743
17744 /*Notify UMAC*/
17745 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17746
17747 return WDI_STATUS_SUCCESS;
17748}
17749
17750/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017751 @brief Process Set Tx PER Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017752 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017753
17754 @param pWDICtx: pointer to the WLAN DAL context
17755 pEventData: pointer to the event information structure
17756
Jeff Johnson295189b2012-06-20 16:38:30 -070017757 @see
17758 @return Result of the function call
17759*/
17760WDI_Status
17761WDI_ProcessSetTxPerTrackingRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017762(
Jeff Johnson295189b2012-06-20 16:38:30 -070017763 WDI_ControlBlockType* pWDICtx,
17764 WDI_EventInfoType* pEventData
17765)
17766{
17767 WDI_Status wdiStatus;
17768 eHalStatus halStatus;
17769 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17770 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17771
17772 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017773 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017774 -------------------------------------------------------------------------*/
17775 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17776 ( NULL == pEventData->pEventData))
17777 {
17778 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17779 "%s: Invalid parameters", __FUNCTION__);
17780 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017781 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017782 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017783
17784 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070017785
17786 /*-------------------------------------------------------------------------
17787 Extract response and send it to UMAC
17788 -------------------------------------------------------------------------*/
17789 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017790 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017791
17792 /*Notify UMAC*/
17793 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17794
Jeff Johnsone7245742012-09-05 17:12:55 -070017795 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017796}/*WDI_ProcessSetTxPerTrackingRsp*/
17797
17798/*==========================================================================
17799 Indications from HAL
17800 ==========================================================================*/
17801/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017802 @brief Process Low RSSI Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017803 indication of this kind is being received over the bus
17804 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017805
17806 @param pWDICtx: pointer to the WLAN DAL context
17807 pEventData: pointer to the event information structure
17808
Jeff Johnson295189b2012-06-20 16:38:30 -070017809 @see
17810 @return Result of the function call
17811*/
17812WDI_Status
17813WDI_ProcessLowRSSIInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017814(
Jeff Johnson295189b2012-06-20 16:38:30 -070017815 WDI_ControlBlockType* pWDICtx,
17816 WDI_EventInfoType* pEventData
17817)
17818{
17819 WDI_LowLevelIndType wdiInd;
17820 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
17821 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17822
17823 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017824 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017825 -------------------------------------------------------------------------*/
17826 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17827 ( NULL == pEventData->pEventData))
17828 {
17829 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17830 "%s: Invalid parameters", __FUNCTION__);
17831 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017832 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017833 }
17834
17835 /*-------------------------------------------------------------------------
17836 Extract indication and send it to UMAC
17837 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017838 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
17839 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017840 sizeof(tHalRSSINotification));
17841
17842 /*Fill in the indication parameters*/
17843 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
17844 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
17845 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
17846 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
17847 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
17848 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
17849 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
17850 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
17851 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
17852 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
17853 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
17854 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
17855 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
17856
17857 /*Notify UMAC*/
17858 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017859
17860 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017861}/*WDI_ProcessLowRSSIInd*/
17862
17863
17864/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017865 @brief Process Missed Beacon Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017866 an indication of this kind is being received over the
17867 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017868
17869 @param pWDICtx: pointer to the WLAN DAL context
17870 pEventData: pointer to the event information structure
17871
Jeff Johnson295189b2012-06-20 16:38:30 -070017872 @see
17873 @return Result of the function call
17874*/
17875WDI_Status
17876WDI_ProcessMissedBeaconInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017877(
Jeff Johnson295189b2012-06-20 16:38:30 -070017878 WDI_ControlBlockType* pWDICtx,
17879 WDI_EventInfoType* pEventData
17880)
17881{
17882 WDI_Status wdiStatus;
17883 eHalStatus halStatus;
17884 WDI_LowLevelIndType wdiInd;
17885 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17886
17887 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017888 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017889 -------------------------------------------------------------------------*/
17890 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17891 ( NULL == pEventData->pEventData))
17892 {
17893 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17894 "%s: Invalid parameters", __FUNCTION__);
17895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017897 }
17898
17899 /*-------------------------------------------------------------------------
17900 Extract indication and send it to UMAC
17901 -------------------------------------------------------------------------*/
17902 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17903 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017904 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017905
17906 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017907 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
17908
Jeff Johnson295189b2012-06-20 16:38:30 -070017909 /*Notify UMAC*/
17910 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017911
17912 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017913}/*WDI_ProcessMissedBeaconInd*/
17914
17915
17916/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017917 @brief Process Unk Addr Frame Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017918 an indication of this kind is being received over the
17919 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017920
17921 @param pWDICtx: pointer to the WLAN DAL context
17922 pEventData: pointer to the event information structure
17923
Jeff Johnson295189b2012-06-20 16:38:30 -070017924 @see
17925 @return Result of the function call
17926*/
17927WDI_Status
17928WDI_ProcessUnkAddrFrameInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017929(
Jeff Johnson295189b2012-06-20 16:38:30 -070017930 WDI_ControlBlockType* pWDICtx,
17931 WDI_EventInfoType* pEventData
17932)
17933{
17934 WDI_Status wdiStatus;
17935 eHalStatus halStatus;
17936 WDI_LowLevelIndType wdiInd;
17937 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17938
17939 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017940 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017941 -------------------------------------------------------------------------*/
17942 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17943 ( NULL == pEventData->pEventData))
17944 {
17945 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17946 "%s: Invalid parameters", __FUNCTION__);
17947 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017948 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017949 }
17950
17951 /*-------------------------------------------------------------------------
17952 Extract indication and send it to UMAC
17953 -------------------------------------------------------------------------*/
17954 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17955 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017956 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017957
17958 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017959 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070017960 /* ! TO DO - fill in from HAL struct:
17961 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
17962
17963 /*Notify UMAC*/
17964 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017965
17966 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017967}/*WDI_ProcessUnkAddrFrameInd*/
17968
17969
17970/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017971 @brief Process MIC Failure Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017972 indication of this kind is being received over the bus
17973 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017974
17975 @param pWDICtx: pointer to the WLAN DAL context
17976 pEventData: pointer to the event information structure
17977
Jeff Johnson295189b2012-06-20 16:38:30 -070017978 @see
17979 @return Result of the function call
17980*/
17981WDI_Status
17982WDI_ProcessMicFailureInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017983(
Jeff Johnson295189b2012-06-20 16:38:30 -070017984 WDI_ControlBlockType* pWDICtx,
17985 WDI_EventInfoType* pEventData
17986)
17987{
17988 WDI_LowLevelIndType wdiInd;
17989 tpSirMicFailureInd pHalMicFailureInd;
17990
17991 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17992
17993 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017994 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017995 -------------------------------------------------------------------------*/
17996 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17997 ( NULL == pEventData->pEventData))
17998 {
17999 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18000 "%s: Invalid parameters", __FUNCTION__);
18001 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018002 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018003 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018004
Jeff Johnson295189b2012-06-20 16:38:30 -070018005 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
18006 /*-------------------------------------------------------------------------
18007 Extract indication and send it to UMAC
18008 -------------------------------------------------------------------------*/
18009
18010 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018011 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018012 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
18013 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
18014 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
18015 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
18016 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
18017 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
18018 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
18019 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070018020 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
Jeff Johnson295189b2012-06-20 16:38:30 -070018021 pHalMicFailureInd->info.multicast;
Jeff Johnsone7245742012-09-05 17:12:55 -070018022 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018023 pHalMicFailureInd->info.IV1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018024 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
Jeff Johnson295189b2012-06-20 16:38:30 -070018025 pHalMicFailureInd->info.keyId;
18026 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
18027 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
18028 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
18029 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
18030 /*Notify UMAC*/
18031 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018032
18033 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018034}/*WDI_ProcessMicFailureInd*/
18035
18036
18037/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018038 @brief Process Fatal Failure Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018039 an indication of this kind is being received over the
18040 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018041
18042 @param pWDICtx: pointer to the WLAN DAL context
18043 pEventData: pointer to the event information structure
18044
Jeff Johnson295189b2012-06-20 16:38:30 -070018045 @see
18046 @return Result of the function call
18047*/
18048WDI_Status
18049WDI_ProcessFatalErrorInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018050(
Jeff Johnson295189b2012-06-20 16:38:30 -070018051 WDI_ControlBlockType* pWDICtx,
18052 WDI_EventInfoType* pEventData
18053)
18054{
18055 WDI_Status wdiStatus;
18056 eHalStatus halStatus;
18057 WDI_LowLevelIndType wdiInd;
18058 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18059
18060 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018061 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018062 -------------------------------------------------------------------------*/
18063 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18064 ( NULL == pEventData->pEventData))
18065 {
18066 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18067 "%s: Invalid parameters", __FUNCTION__);
18068 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018069 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018070 }
18071
18072 /*-------------------------------------------------------------------------
18073 Extract indication and send it to UMAC
18074 -------------------------------------------------------------------------*/
18075
18076 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18077 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018078 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018079
18080 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18081 "Fatal failure received from device %d ", halStatus );
Jeff Johnsone7245742012-09-05 17:12:55 -070018082
Jeff Johnson295189b2012-06-20 16:38:30 -070018083 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018084 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18085 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018086
18087 /*Notify UMAC*/
18088 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018089
18090 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018091}/*WDI_ProcessFatalErrorInd*/
18092
18093/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018094 @brief Process Delete STA Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018095 an indication of this kind is being received over the
18096 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018097
18098 @param pWDICtx: pointer to the WLAN DAL context
18099 pEventData: pointer to the event information structure
18100
Jeff Johnson295189b2012-06-20 16:38:30 -070018101 @see
18102 @return Result of the function call
18103*/
18104WDI_Status
18105WDI_ProcessDelSTAInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018106(
Jeff Johnson295189b2012-06-20 16:38:30 -070018107 WDI_ControlBlockType* pWDICtx,
18108 WDI_EventInfoType* pEventData
18109)
18110{
18111 tDeleteStaContextParams halDelSTACtx;
18112 WDI_LowLevelIndType wdiInd;
18113 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18114
18115 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018116 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018117 -------------------------------------------------------------------------*/
18118 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18119 ( NULL == pEventData->pEventData))
18120 {
18121 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18122 "%s: Invalid parameters", __FUNCTION__);
18123 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018124 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018125 }
18126
18127 /*-------------------------------------------------------------------------
18128 Extract indication and send it to UMAC
18129 -------------------------------------------------------------------------*/
18130
18131 /* Parameters need to be unpacked according to HAL struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018132 wpalMemoryCopy( &halDelSTACtx,
18133 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018134 sizeof(halDelSTACtx));
18135
18136 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018137 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018138
18139 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
18140 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
18141 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
18142 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
18143
Jeff Johnsone7245742012-09-05 17:12:55 -070018144 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
Jeff Johnson295189b2012-06-20 16:38:30 -070018145 halDelSTACtx.assocId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018146 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070018147 halDelSTACtx.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018148 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
18149 halDelSTACtx.reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070018150
18151 /*Notify UMAC*/
18152 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018153
18154 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018155}/*WDI_ProcessDelSTAInd*/
18156
18157/**
18158*@brief Process Coex Indication function (called when
18159 an indication of this kind is being received over the
18160 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018161
18162 @param pWDICtx: pointer to the WLAN DAL context
18163 pEventData: pointer to the event information structure
18164
Jeff Johnson295189b2012-06-20 16:38:30 -070018165 @see
18166 @return Result of the function call
18167*/
18168WDI_Status
18169WDI_ProcessCoexInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018170(
Jeff Johnson295189b2012-06-20 16:38:30 -070018171 WDI_ControlBlockType* pWDICtx,
18172 WDI_EventInfoType* pEventData
18173)
18174{
18175 WDI_LowLevelIndType wdiInd;
18176 tCoexIndMsg halCoexIndMsg;
18177 wpt_uint32 index;
18178 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18179
18180 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018181 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018182 -------------------------------------------------------------------------*/
18183 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18184 ( NULL == pEventData->pEventData ))
18185 {
18186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18187 "%s: Invalid parameters", __FUNCTION__);
18188 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070018189 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018190 }
18191
18192 /*-------------------------------------------------------------------------
18193 Extract indication and send it to UMAC
18194 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018195 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
18196 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018197 sizeof(halCoexIndMsg.coexIndParams) );
18198
18199 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018200 wdiInd.wdiIndicationType = WDI_COEX_IND;
18201 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
Jeff Johnson295189b2012-06-20 16:38:30 -070018202 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
18203 {
Jeff Johnsone7245742012-09-05 17:12:55 -070018204 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
Jeff Johnson295189b2012-06-20 16:38:30 -070018205 }
18206
18207 // DEBUG
18208 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18209 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
Jeff Johnsone7245742012-09-05 17:12:55 -070018210 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
18211 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
18212 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
18213 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
18214 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -070018215
18216 /*Notify UMAC*/
18217 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018218
18219 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018220}/*WDI_ProcessCoexInd*/
18221
18222/**
18223*@brief Process Tx Complete Indication function (called when
18224 an indication of this kind is being received over the
18225 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018226
18227 @param pWDICtx: pointer to the WLAN DAL context
18228 pEventData: pointer to the event information structure
18229
Jeff Johnson295189b2012-06-20 16:38:30 -070018230 @see
18231 @return Result of the function call
18232*/
18233WDI_Status
18234WDI_ProcessTxCompleteInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018235(
Jeff Johnson295189b2012-06-20 16:38:30 -070018236 WDI_ControlBlockType* pWDICtx,
18237 WDI_EventInfoType* pEventData
18238)
18239{
18240 WDI_LowLevelIndType wdiInd;
18241 tTxComplIndMsg halTxComplIndMsg;
18242 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18243
18244 /*-------------------------------------------------------------------------
18245 Sanity check
18246 -------------------------------------------------------------------------*/
18247 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18248 ( NULL == pEventData->pEventData ))
18249 {
18250 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18251 "%s: Invalid parameters", __FUNCTION__);
18252 WDI_ASSERT( 0 );
18253 return WDI_STATUS_E_FAILURE;
18254 }
18255
18256 /*-------------------------------------------------------------------------
18257 Extract indication and send it to UMAC
18258 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018259 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
18260 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018261 sizeof(halTxComplIndMsg.txComplParams) );
18262
18263 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018264 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
18265 wdiInd.wdiIndicationData.tx_complete_status
18266 = halTxComplIndMsg.txComplParams.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070018267
18268 /*Notify UMAC*/
18269 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018270
18271 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018272}/*WDI_ProcessTxCompleteInd*/
18273
18274#ifdef WLAN_FEATURE_P2P
18275/**
18276*@brief Process Noa Attr Indication function (called when
18277 an indication of this kind is being received over the
18278 bus from HAL)
18279
18280 @param pWDICtx: pointer to the WLAN DAL context
18281 pEventData: pointer to the event information structure
18282
18283 @see
18284 @return Result of the function call
18285*/
18286WDI_Status
18287WDI_ProcessP2pNoaAttrInd
18288(
18289 WDI_ControlBlockType* pWDICtx,
18290 WDI_EventInfoType* pEventData
18291)
18292{
18293 WDI_LowLevelIndType wdiInd;
18294 tNoaAttrIndMsg halNoaAttrIndMsg;
18295 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18296
18297 /*-------------------------------------------------------------------------
18298 Sanity check
18299 -------------------------------------------------------------------------*/
18300 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18301 ( NULL == pEventData->pEventData ))
18302 {
18303 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18304 "%s: Invalid parameters", __FUNCTION__);
18305 WDI_ASSERT( 0 );
18306 return WDI_STATUS_E_FAILURE;
18307 }
18308
18309 /*-------------------------------------------------------------------------
18310 Extract indication and send it to UMAC
18311 -------------------------------------------------------------------------*/
18312 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
18313 pEventData->pEventData,
18314 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
18315
18316 /*Fill in the indication parameters*/
18317 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -070018318
Jeff Johnson295189b2012-06-20 16:38:30 -070018319 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
18320 = halNoaAttrIndMsg.noaAttrIndParams.status;
Jeff Johnsone7245742012-09-05 17:12:55 -070018321
Jeff Johnson295189b2012-06-20 16:38:30 -070018322 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
18323 = halNoaAttrIndMsg.noaAttrIndParams.index;
18324 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
18325 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
18326 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
18327 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
Jeff Johnsone7245742012-09-05 17:12:55 -070018328
Jeff Johnson295189b2012-06-20 16:38:30 -070018329 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
18330 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
18331 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
18332 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
18333 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
18334 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
18335 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
18336 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070018337
Jeff Johnson295189b2012-06-20 16:38:30 -070018338 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18339 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18340 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18341 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18342 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18343 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18344 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18345 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18346
18347 /*Notify UMAC*/
18348 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18349
18350 return WDI_STATUS_SUCCESS;
18351}/*WDI_ProcessNoaAttrInd*/
18352#endif
18353
18354/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018355 @brief Process Tx PER Hit Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018356 an indication of this kind is being received over the
18357 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018358
18359 @param pWDICtx: pointer to the WLAN DAL context
18360 pEventData: pointer to the event information structure
18361
Jeff Johnson295189b2012-06-20 16:38:30 -070018362 @see
18363 @return Result of the function call
18364*/
18365WDI_Status
18366WDI_ProcessTxPerHitInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018367(
Jeff Johnson295189b2012-06-20 16:38:30 -070018368 WDI_ControlBlockType* pWDICtx,
18369 WDI_EventInfoType* pEventData
18370)
18371{
18372 WDI_LowLevelIndType wdiInd;
18373 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070018374
Jeff Johnson295189b2012-06-20 16:38:30 -070018375 /*-------------------------------------------------------------------------
18376 Extract indication and send it to UMAC
18377 -------------------------------------------------------------------------*/
18378 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018379 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18380
Jeff Johnson295189b2012-06-20 16:38:30 -070018381 /*Notify UMAC*/
18382 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18383
Jeff Johnsone7245742012-09-05 17:12:55 -070018384 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018385}/*WDI_ProcessTxPerHitInd*/
18386
18387#ifdef ANI_MANF_DIAG
18388/**
18389 @brief WDI_ProcessFTMCommandReq
18390 Process FTM Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018391
18392 @param pWDICtx: pointer to the WLAN DAL context
18393 pEventData: pointer to the event information structure
18394
Jeff Johnson295189b2012-06-20 16:38:30 -070018395 @see
18396 @return Result of the function call
18397*/
18398WDI_Status
18399WDI_ProcessFTMCommandReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018400(
Jeff Johnson295189b2012-06-20 16:38:30 -070018401 WDI_ControlBlockType* pWDICtx,
18402 WDI_EventInfoType* pEventData
18403)
18404{
18405 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18406 wpt_uint8 *ftmCommandBuffer = NULL;
18407 wpt_uint16 dataOffset;
18408 wpt_uint16 bufferSize;
18409 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018410 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018411 -------------------------------------------------------------------------*/
18412 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18413 ( NULL == pEventData->pEventData))
18414
18415 {
18416 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18417 "%s: Invalid parameters", __FUNCTION__);
18418 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018419 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018420 }
18421
18422 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18423
18424 /* Get MSG Buffer */
18425 WDI_GetMessageBuffer(pWDICtx,
18426 WDI_FTM_CMD_REQ,
18427 ftmCommandReq->bodyLength,
18428 &ftmCommandBuffer,
18429 &dataOffset,
18430 &bufferSize);
18431
18432 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18433 ftmCommandReq->FTMCommandBody,
18434 ftmCommandReq->bodyLength);
18435
18436 /* Send MSG */
18437 return WDI_SendMsg(pWDICtx,
18438 ftmCommandBuffer,
18439 bufferSize,
18440 pEventData->pCBfnc,
18441 pEventData->pUserData,
18442 WDI_FTM_CMD_RESP);
18443}
18444
18445/**
18446 @brief WDI_ProcessFTMCommandRsp
18447 Process FTM Command Response from HAL, simply route to HDD FTM
Jeff Johnsone7245742012-09-05 17:12:55 -070018448
18449 @param pWDICtx: pointer to the WLAN DAL context
18450 pEventData: pointer to the event information structure
18451
Jeff Johnson295189b2012-06-20 16:38:30 -070018452 @see
18453 @return Result of the function call
18454*/
18455WDI_Status
18456WDI_ProcessFTMCommandRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018457(
Jeff Johnson295189b2012-06-20 16:38:30 -070018458 WDI_ControlBlockType* pWDICtx,
18459 WDI_EventInfoType* pEventData
18460)
18461{
18462 WDI_FTMCommandRspCb ftmCMDRspCb;
18463 tProcessPttRspParams *ftmCMDRspData = NULL;
18464 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18465
18466 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018467 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018468 -------------------------------------------------------------------------*/
18469 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18470 ( NULL == pEventData->pEventData))
18471 {
18472 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18473 "%s: Invalid parameters", __FUNCTION__);
18474 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018475 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018476 }
18477
18478 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18479
18480 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18481
Jeff Johnsone7245742012-09-05 17:12:55 -070018482 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18483 (void *)&ftmCMDRspData->pttMsgBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018484 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18485
18486 /*Notify UMAC*/
18487 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18488
Jeff Johnsone7245742012-09-05 17:12:55 -070018489 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018490}
18491#endif /* ANI_MANF_DIAG */
18492/**
18493 @brief WDI_ProcessHalDumpCmdReq
18494 Process hal dump Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018495
18496 @param pWDICtx: pointer to the WLAN DAL context
18497 pEventData: pointer to the event information structure
18498
Jeff Johnson295189b2012-06-20 16:38:30 -070018499 @see
18500 @return Result of the function call
18501*/
18502WDI_Status
18503WDI_ProcessHALDumpCmdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018504(
Jeff Johnson295189b2012-06-20 16:38:30 -070018505 WDI_ControlBlockType* pWDICtx,
18506 WDI_EventInfoType* pEventData
18507)
18508{
18509 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18510 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18511 wpt_uint16 usDataOffset = 0;
18512 wpt_uint16 usSendSize = 0;
18513 tHalDumpCmdReqMsg halDumpCmdReqMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070018514 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070018515
18516 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018517 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018518 -------------------------------------------------------------------------*/
18519 if (( NULL == pEventData ) ||
18520 ( NULL == pEventData->pEventData) ||
18521 ( NULL == pEventData->pCBfnc ))
18522 {
18523 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18524 "%s: Invalid parameters", __FUNCTION__);
18525 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018526 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018527 }
18528
18529 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18530 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18531
18532 /* Copying the HAL DUMP Command Information HAL Structure*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018533 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018534 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
Jeff Johnsone7245742012-09-05 17:12:55 -070018535 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018536 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018537 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018538 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
Jeff Johnsone7245742012-09-05 17:12:55 -070018539 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018540 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
Jeff Johnsone7245742012-09-05 17:12:55 -070018541 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018542 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
Jeff Johnsone7245742012-09-05 17:12:55 -070018543
Jeff Johnson295189b2012-06-20 16:38:30 -070018544 /*-----------------------------------------------------------------------
18545 Get message buffer
18546 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018547 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070018548 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18549 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070018550 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070018551 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18552 {
18553 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18554 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18555 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18556 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018557 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018558 }
18559
Jeff Johnsone7245742012-09-05 17:12:55 -070018560 wpalMemoryCopy( pSendBuffer+usDataOffset,
18561 &halDumpCmdReqMsg.dumpCmdReqParams,
18562 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070018563
18564 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070018565 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018566
18567 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018568 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018569 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018570 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18571 wdiHALDumpCmdRspCb, pEventData->pUserData,
18572 WDI_HAL_DUMP_CMD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070018573}
18574
18575/**
18576 @brief WDI_ProcessHalDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018577 Process hal Dump Command Response from HAL, simply route to HDD
18578
18579 @param pWDICtx: pointer to the WLAN DAL context
18580 pEventData: pointer to the event information structure
18581
Jeff Johnson295189b2012-06-20 16:38:30 -070018582 @see
18583 @return Result of the function call
18584*/
18585WDI_Status
18586WDI_ProcessHALDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018587(
Jeff Johnson295189b2012-06-20 16:38:30 -070018588 WDI_ControlBlockType* pWDICtx,
18589 WDI_EventInfoType* pEventData
18590)
18591{
18592 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18593 tpHalDumpCmdRspParams halDumpCmdRspParams;
18594 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18595
18596 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018597 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018598 -------------------------------------------------------------------------*/
18599 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18600 ( NULL == pEventData->pEventData))
18601 {
18602 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18603 "%s: Invalid parameters", __FUNCTION__);
18604 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018605 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018606 }
18607
Jeff Johnsone7245742012-09-05 17:12:55 -070018608 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070018609
18610 /*Initialize the WDI Response structure */
18611 wdiHALDumpCmdRsp.usBufferLen = 0;
18612 wdiHALDumpCmdRsp.pBuffer = NULL;
18613
18614 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018615
18616 wdiHALDumpCmdRsp.wdiStatus =
18617 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
Jeff Johnson295189b2012-06-20 16:38:30 -070018618
18619 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18620 (halDumpCmdRspParams->rspLength != 0))
18621 {
18622 /* Copy the response data */
18623 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18624 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
Jeff Johnsone7245742012-09-05 17:12:55 -070018625 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18626 wdiHALDumpCmdRsp.pBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018627 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18628 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018629
Jeff Johnson295189b2012-06-20 16:38:30 -070018630 /*Notify UMAC*/
18631 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18632
18633 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18634 {
18635 /* Free the allocated buffer */
18636 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18637 }
18638 return WDI_STATUS_SUCCESS;
18639}
18640
18641/*==========================================================================
18642 CONTRL TRANSPORT INTERACTION
Jeff Johnsone7245742012-09-05 17:12:55 -070018643
Jeff Johnson295189b2012-06-20 16:38:30 -070018644 Callback function registered with the control transport - for receiving
Jeff Johnsone7245742012-09-05 17:12:55 -070018645 notifications and packets
Jeff Johnson295189b2012-06-20 16:38:30 -070018646==========================================================================*/
18647/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018648 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018649 when it wishes to send up a notification like the ones
18650 mentioned above.
Jeff Johnsone7245742012-09-05 17:12:55 -070018651
Jeff Johnson295189b2012-06-20 16:38:30 -070018652 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018653
18654 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018655 wctsEvent: the event being notified
Jeff Johnsone7245742012-09-05 17:12:55 -070018656 wctsNotifyCBData: the callback data of the user
18657
Jeff Johnson295189b2012-06-20 16:38:30 -070018658 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018659
18660 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018661*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018662void
Jeff Johnson295189b2012-06-20 16:38:30 -070018663WDI_NotifyMsgCTSCB
18664(
Jeff Johnsone7245742012-09-05 17:12:55 -070018665 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018666 WCTS_NotifyEventType wctsEvent,
18667 void* wctsNotifyCBData
18668)
18669{
Jeff Johnsone7245742012-09-05 17:12:55 -070018670 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018671 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18672
18673 if (NULL == pWDICtx )
18674 {
18675 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18676 "%s: Invalid parameters", __FUNCTION__);
18677 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018678 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018679 }
18680
18681 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18682 {
18683 /* callback presumably occurred after close */
18684 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18685 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018686 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018687 }
18688
18689 if ( WCTS_EVENT_OPEN == wctsEvent )
18690 {
18691 /*Flag must be set atomically as it is checked from incoming request
18692 functions*/
18693 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018694 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018695
18696 /*Nothing to do - so try to dequeue any pending request that may have
18697 occurred while we were trying to establish this*/
18698 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070018699 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnson295189b2012-06-20 16:38:30 -070018700 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018701 else if ( WCTS_EVENT_CLOSE == wctsEvent )
Jeff Johnson295189b2012-06-20 16:38:30 -070018702 {
18703 /*Flag must be set atomically as it is checked from incoming request
18704 functions*/
18705 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018706 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018707
18708 /*No other request will be processed from now on - fail all*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018709 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070018710 wpalMutexRelease(&pWDICtx->wptMutex);
18711
18712 /*Notify that the Control Channel is closed */
18713 wpalEventSet(&pWDICtx->wctsActionEvent);
18714 }
18715
18716}/*WDI_NotifyMsgCTSCB*/
18717
18718
18719/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018720 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018721 when it wishes to send up a packet received over the
18722 bus.
Jeff Johnsone7245742012-09-05 17:12:55 -070018723
Jeff Johnson295189b2012-06-20 16:38:30 -070018724 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018725
18726 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018727 pMsg: the packet
18728 uLen: the packet length
Jeff Johnsone7245742012-09-05 17:12:55 -070018729 wctsRxMsgCBData: the callback data of the user
18730
Jeff Johnson295189b2012-06-20 16:38:30 -070018731 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018732
18733 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018734*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018735void
18736WDI_RXMsgCTSCB
Jeff Johnson295189b2012-06-20 16:38:30 -070018737(
Jeff Johnsone7245742012-09-05 17:12:55 -070018738 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018739 void* pMsg,
18740 wpt_uint32 uLen,
18741 void* wctsRxMsgCBData
18742)
18743{
Jeff Johnsone7245742012-09-05 17:12:55 -070018744 tHalMsgHeader *pHalMsgHeader;
18745 WDI_EventInfoType wdiEventData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018746 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18747 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18748
18749 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018750 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018751 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018752 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070018753 ( uLen < sizeof(tHalMsgHeader)))
18754 {
18755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18756 "%s: Invalid parameters", __FUNCTION__);
18757 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018758 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018759 }
18760
18761 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18762 {
18763 /* callback presumably occurred after close */
18764 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18765 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018766 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018767 }
18768
Jeff Johnsone7245742012-09-05 17:12:55 -070018769 /*The RX Callback is expected to be serialized in the proper control thread
Jeff Johnson295189b2012-06-20 16:38:30 -070018770 context - so no serialization is necessary here
18771 ! - revisit this assumption */
18772
18773 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18774
18775 if ( uLen != pHalMsgHeader->msgLen )
18776 {
18777 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18778 "Invalid packet received from HAL - catastrophic failure");
Jeff Johnsone7245742012-09-05 17:12:55 -070018779 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18780 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018781 }
18782
18783 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18784
18785 /*The message itself starts after the header*/
18786 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18787 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18788 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18789 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18790
18791
18792 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18793 {
18794 /*Stop the timer as the response was received */
18795 /*!UT - check for potential race conditions between stop and response */
18796 wpalTimerStop(&pWDICtx->wptResponseTimer);
18797 }
18798 /* Check if we receive a response message which is not expected */
18799 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
18800 {
18801 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18802 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
18803 WDI_getRespMsgString(wdiEventData.wdiResponse),
Jeff Johnsone7245742012-09-05 17:12:55 -070018804 wdiEventData.wdiResponse,
Jeff Johnson295189b2012-06-20 16:38:30 -070018805 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18806 pWDICtx->wdiExpectedResponse);
18807 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
18808 return;
18809 }
18810
18811 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18812 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
18813
18814 /*Post response event to the state machine*/
18815 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
18816
18817}/*WDI_RXMsgCTSCB*/
18818
18819
18820/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070018821 Internal Helper Routines
Jeff Johnson295189b2012-06-20 16:38:30 -070018822========================================================================*/
18823
18824/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018825 @brief WDI_CleanCB - internal helper routine used to clean the
Jeff Johnson295189b2012-06-20 16:38:30 -070018826 WDI Main Control Block
Jeff Johnsone7245742012-09-05 17:12:55 -070018827
Jeff Johnson295189b2012-06-20 16:38:30 -070018828 @param pWDICtx - pointer to the control block
18829
18830 @return Result of the function call
18831*/
18832WPT_INLINE WDI_Status
18833WDI_CleanCB
18834(
18835 WDI_ControlBlockType* pWDICtx
18836)
18837{
18838 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18839
18840 /*Clean the WDI Control Block*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018841 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
Jeff Johnson295189b2012-06-20 16:38:30 -070018842
Jeff Johnsone7245742012-09-05 17:12:55 -070018843 pWDICtx->uGlobalState = WDI_MAX_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070018844 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
18845 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
18846
18847 WDI_ResetAssocSessions( pWDICtx );
18848
18849 return WDI_STATUS_SUCCESS;
18850}/*WDI_CleanCB*/
18851
18852
18853/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018854 @brief Process request helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070018855
Jeff Johnsone7245742012-09-05 17:12:55 -070018856
18857 @param pWDICtx: pointer to the WLAN DAL context
18858 pEventData: pointer to the event information structure
18859
Jeff Johnson295189b2012-06-20 16:38:30 -070018860 @see
18861 @return Result of the function call
18862*/
18863WPT_INLINE WDI_Status
18864WDI_ProcessRequest
18865(
18866 WDI_ControlBlockType* pWDICtx,
18867 WDI_EventInfoType* pEventData
18868)
18869{
18870 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18871
Jeff Johnsone7245742012-09-05 17:12:55 -070018872 /*!! Skip sanity check as this is called from the FSM functionss which
Jeff Johnson295189b2012-06-20 16:38:30 -070018873 already checked these pointers*/
18874
18875 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
18876 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070018877 {
Jeff Johnson295189b2012-06-20 16:38:30 -070018878 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18879 "Calling request processing function for req %s (%d) %x",
18880 WDI_getReqMsgString(pEventData->wdiRequest),
18881 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
18882 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
18883 }
18884 else
18885 {
18886 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070018887 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070018888 pEventData->wdiRequest);
18889 return WDI_STATUS_E_NOT_IMPLEMENT;
18890 }
18891}/*WDI_ProcessRequest*/
18892
18893
18894/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018895 @brief Get message helper function - it allocates memory for a
Jeff Johnson295189b2012-06-20 16:38:30 -070018896 message that is to be sent to HAL accross the bus and
Jeff Johnsone7245742012-09-05 17:12:55 -070018897 prefixes it with a send message header
18898
18899 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018900 wdiReqType: type of the request being sent
18901 uBufferLen: message buffer len
18902 pMsgBuffer: resulting allocated buffer
18903 pusDataOffset: offset in the buffer where the caller
18904 can start copying its message data
18905 puBufferSize: the resulting buffer size (offset+buff
18906 len)
Jeff Johnsone7245742012-09-05 17:12:55 -070018907
Jeff Johnson295189b2012-06-20 16:38:30 -070018908 @see
18909 @return Result of the function call
18910*/
18911WDI_Status
18912WDI_GetMessageBuffer
Jeff Johnsone7245742012-09-05 17:12:55 -070018913(
18914 WDI_ControlBlockType* pWDICtx,
18915 WDI_RequestEnumType wdiReqType,
Jeff Johnson295189b2012-06-20 16:38:30 -070018916 wpt_uint16 usBufferLen,
Jeff Johnsone7245742012-09-05 17:12:55 -070018917 wpt_uint8** pMsgBuffer,
18918 wpt_uint16* pusDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070018919 wpt_uint16* pusBufferSize
18920)
18921{
18922 tHalMsgHeader halMsgHeader;
18923 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18924
Jeff Johnsone7245742012-09-05 17:12:55 -070018925 /*!! No sanity check here as we trust the called - ! check this assumption
Jeff Johnson295189b2012-06-20 16:38:30 -070018926 again*/
18927
18928 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018929 Try to allocate message buffer from PAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018930 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018931 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
Jeff Johnson295189b2012-06-20 16:38:30 -070018932 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
18933 if ( NULL == *pMsgBuffer )
18934 {
18935 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18936 "Unable to allocate message buffer for req %s (%d)",
18937 WDI_getReqMsgString(wdiReqType),
Jeff Johnsone7245742012-09-05 17:12:55 -070018938 wdiReqType);
Jeff Johnson295189b2012-06-20 16:38:30 -070018939 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018940 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018941 }
18942
18943 /*-------------------------------------------------------------------------
18944 Fill in the message header
18945 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018946 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
18947 /* Fill msgVersion */
18948#ifdef WLAN_FEATURE_11AC
18949 if (WDI_getFwWlanFeatCaps(DOT11AC))
18950 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1;
18951 else
18952#endif
18953 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0;
Jeff Johnson295189b2012-06-20 16:38:30 -070018954
Jeff Johnsone7245742012-09-05 17:12:55 -070018955 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
18956 *pusDataOffset = sizeof(halMsgHeader);
18957 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
18958
18959 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018960}/*WDI_GetMessageBuffer*/
18961
18962
18963/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018964 @brief Send message helper function - sends a message over the
Jeff Johnson295189b2012-06-20 16:38:30 -070018965 bus using the control tranport and saves some info in
Jeff Johnsone7245742012-09-05 17:12:55 -070018966 the CB
18967
18968 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018969 pSendBuffer: buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070018970
Jeff Johnson295189b2012-06-20 16:38:30 -070018971 usSendSize size of the buffer to be sent
18972 pRspCb: response callback - save in the WDI
18973 CB
18974 pUserData: user data associated with the
18975 callback
18976 wdiExpectedResponse: the code of the response that is
18977 expected to be rx-ed for this request
Jeff Johnsone7245742012-09-05 17:12:55 -070018978
Jeff Johnson295189b2012-06-20 16:38:30 -070018979 @see
18980 @return Result of the function call
18981*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018982WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070018983WDI_SendMsg
Jeff Johnsone7245742012-09-05 17:12:55 -070018984(
18985 WDI_ControlBlockType* pWDICtx,
18986 wpt_uint8* pSendBuffer,
18987 wpt_uint32 usSendSize,
18988 void* pRspCb,
Jeff Johnson295189b2012-06-20 16:38:30 -070018989 void* pUserData,
18990 WDI_ResponseEnumType wdiExpectedResponse
18991)
18992{
Jeff Johnsond13512a2012-07-17 11:42:19 -070018993 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018994 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18995
18996 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018997 Save needed info in the CB
Jeff Johnson295189b2012-06-20 16:38:30 -070018998 ------------------------------------------------------------------------*/
18999 pWDICtx->pRspCBUserData = pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019000 pWDICtx->pfncRspCB = pRspCb;
19001 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019002
19003 /*-----------------------------------------------------------------------
19004 Call the CTS to send this message over - free message afterwards
19005 - notify transport failure
19006 Note: CTS is reponsible for freeing the message buffer.
19007 -----------------------------------------------------------------------*/
19008 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
19009 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019010 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070019011 "Failed to send message over the bus - catastrophic failure");
19012
Jeff Johnsond13512a2012-07-17 11:42:19 -070019013 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019014 }
19015
Jeff Johnsond13512a2012-07-17 11:42:19 -070019016 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070019017 if ( NULL != pWDICtx->wdiReqStatusCB )
19018 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019019 /*Inform originator whether request went through or not*/
19020 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
19021 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070019022 pWDICtx->wdiReqStatusCB = NULL;
19023 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070019024 callback(wdiStatus, callbackContext);
19025
19026 /*For WDI requests which have registered a request callback,
19027 inform the WDA caller of the same via setting the return value
19028 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
19029 end up repeating the functonality in the req callback for the
19030 WDI_STATUS_E_FAILURE case*/
19031 if (wdiStatus == WDI_STATUS_E_FAILURE)
19032 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070019033 }
19034
Jeff Johnsond13512a2012-07-17 11:42:19 -070019035 if ( wdiStatus == WDI_STATUS_SUCCESS )
19036 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019037 /*Start timer for the expected response */
19038 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070019039 }
19040 else
19041 {
19042 /*Inform upper stack layers that a transport fatal error occured*/
19043 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19044 }
Jeff Johnson295189b2012-06-20 16:38:30 -070019045
Jeff Johnsond13512a2012-07-17 11:42:19 -070019046 return wdiStatus;
19047
Jeff Johnson295189b2012-06-20 16:38:30 -070019048}/*WDI_SendMsg*/
19049
19050
19051
19052/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019053 @brief Send indication helper function - sends a message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019054 the bus using the control transport and saves some info
19055 in the CB
Jeff Johnsone7245742012-09-05 17:12:55 -070019056
19057 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019058 pSendBuffer: buffer to be sent
19059 usSendSize: size of the buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019060
Jeff Johnson295189b2012-06-20 16:38:30 -070019061 @see
19062 @return Result of the function call
19063*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019064WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019065WDI_SendIndication
Jeff Johnsone7245742012-09-05 17:12:55 -070019066(
19067 WDI_ControlBlockType* pWDICtx,
19068 wpt_uint8* pSendBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070019069 wpt_uint32 usSendSize
19070)
19071{
19072 wpt_uint32 uStatus ;
19073 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19074
19075 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019076 Call the CTS to send this message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019077 Note: CTS is reponsible for freeing the message buffer.
19078 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019079 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070019080 (void*)pSendBuffer, usSendSize );
19081
19082 /*Inform Upper MAC about the outcome of the request*/
19083 if ( NULL != pWDICtx->wdiReqStatusCB )
19084 {
19085 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19086 "Send indication status : %d", uStatus);
19087
19088 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
Jeff Johnsone7245742012-09-05 17:12:55 -070019089 WDI_STATUS_SUCCESS,
19090 pWDICtx->pReqStatusUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070019091 }
19092
19093 /*If sending of the message failed - it is considered catastrophic and
19094 indicates an error with the device*/
19095 if ( 0 != uStatus)
19096 {
19097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019098 "Failed to send indication over the bus - catastrophic failure");
Jeff Johnson295189b2012-06-20 16:38:30 -070019099
19100 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19101 return WDI_STATUS_E_FAILURE;
19102 }
19103
Jeff Johnsone7245742012-09-05 17:12:55 -070019104 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019105}/*WDI_SendIndication*/
19106
19107
19108/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019109 @brief WDI_DetectedDeviceError - called internally by DAL when
19110 it has detected a failure in the device
19111
19112 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019113 usErrorCode: error code detected by WDI or received
19114 from HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070019115
Jeff Johnson295189b2012-06-20 16:38:30 -070019116 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019117 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019118*/
19119void
19120WDI_DetectedDeviceError
19121(
19122 WDI_ControlBlockType* pWDICtx,
19123 wpt_uint16 usErrorCode
19124)
19125{
19126 WDI_LowLevelIndType wdiInd;
19127 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19128
19129 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19130 "Device Error detected code: %d - transitioning to stopped state",
19131 usErrorCode);
19132
19133 wpalMutexAcquire(&pWDICtx->wptMutex);
19134
19135 WDI_STATableStop(pWDICtx);
19136
19137 WDI_ResetAssocSessions(pWDICtx);
19138
19139 /*Set the expected state transition to stopped - because the device
19140 experienced a failure*/
19141 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
19142
19143 /*Transition to stopped to fail all incomming requests from this point on*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019144 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
Jeff Johnson295189b2012-06-20 16:38:30 -070019145
Jeff Johnsone7245742012-09-05 17:12:55 -070019146 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070019147
19148 /*TO DO: - there should be an attempt to reset the device here*/
19149
19150 wpalMutexRelease(&pWDICtx->wptMutex);
19151
19152 /*------------------------------------------------------------------------
19153 Notify UMAC if a handler is registered
19154 ------------------------------------------------------------------------*/
19155 if (pWDICtx->wdiLowLevelIndCB)
19156 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019157 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
19158 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019159
19160 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
19161 }
19162}/*WDI_DetectedDeviceError*/
19163
19164/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019165 @brief This callback is invoked by the wpt when a timer that
Jeff Johnson295189b2012-06-20 16:38:30 -070019166 we started on send message has expire - this should
19167 never happen - it means device is stuck and cannot
Jeff Johnsone7245742012-09-05 17:12:55 -070019168 reply - trigger catastrophic failure
19169 @param
19170
Jeff Johnson295189b2012-06-20 16:38:30 -070019171 pUserData: the callback data of the user (ptr to WDI CB)
Jeff Johnsone7245742012-09-05 17:12:55 -070019172
19173 @see
19174 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019175*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019176void
Jeff Johnson295189b2012-06-20 16:38:30 -070019177WDI_ResponseTimerCB
19178(
19179 void *pUserData
19180)
19181{
19182 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
19183 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19184
19185 if (NULL == pWDICtx )
19186 {
19187 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19188 "%s: Invalid parameters", __FUNCTION__);
19189 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019190 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019191 }
19192
19193 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
19194 {
19195
19196 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19197 "Timeout occurred while waiting for %s (%d) message from device "
Jeff Johnsone7245742012-09-05 17:12:55 -070019198 " - catastrophic failure",
Jeff Johnson295189b2012-06-20 16:38:30 -070019199 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19200 pWDICtx->wdiExpectedResponse);
19201 /* WDI timeout means Riva is not responding or SMD communication to Riva
19202 * is not happening. The only possible way to recover from this error
19203 * is to initiate SSR from APPS */
19204 wpalRivaSubystemRestart();
19205 }
19206 else
19207 {
19208 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19209 "Timeout occurred but not waiting for any response %d",
19210 pWDICtx->wdiExpectedResponse);
19211 }
19212
19213 return;
19214
19215}/*WDI_ResponseTimerCB*/
19216
19217
19218/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019219 @brief Process response helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019220
Jeff Johnsone7245742012-09-05 17:12:55 -070019221
19222 @param pWDICtx: pointer to the WLAN DAL context
19223 pEventData: pointer to the event information structure
19224
Jeff Johnson295189b2012-06-20 16:38:30 -070019225 @see
19226 @return Result of the function call
19227*/
19228WPT_INLINE WDI_Status
19229WDI_ProcessResponse
19230(
19231 WDI_ControlBlockType* pWDICtx,
19232 WDI_EventInfoType* pEventData
19233)
19234{
19235 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19236
Jeff Johnsone7245742012-09-05 17:12:55 -070019237 /* Skip sanity check as this is called from the FSM functions which
Jeff Johnson295189b2012-06-20 16:38:30 -070019238 already checked these pointers
19239 ! - revisit this assumption */
19240 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
19241 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019242 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019243 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070019244 "Calling response processing function for resp %s (%d) %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070019245 WDI_getRespMsgString(pEventData->wdiResponse),
19246 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
19247 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
19248 }
19249 else
19250 {
19251 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019252 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019253 pEventData->wdiResponse);
19254 return WDI_STATUS_E_NOT_IMPLEMENT;
19255 }
19256}/*WDI_ProcessResponse*/
19257
19258
19259/*=========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019260 QUEUE SUPPORT UTILITY FUNCTIONS
Jeff Johnson295189b2012-06-20 16:38:30 -070019261=========================================================================*/
19262
19263/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019264 @brief Utility function used by the DAL Core to help queue a
19265 request that cannot be processed right away.
19266 @param
19267
Jeff Johnson295189b2012-06-20 16:38:30 -070019268 pWDICtx: - pointer to the WDI control block
19269 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019270 queued
19271
19272 @see
19273 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019274*/
19275WDI_Status
19276WDI_QueuePendingReq
19277(
19278 WDI_ControlBlockType* pWDICtx,
19279 WDI_EventInfoType* pEventData
19280)
19281{
Jeff Johnsone7245742012-09-05 17:12:55 -070019282 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019283 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
Jeff Johnsone7245742012-09-05 17:12:55 -070019284 void* pEventInfo = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019285 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19286
19287 if ( NULL == pEventDataQueue )
19288 {
19289 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019290 "Cannot allocate memory for queueing");
Jeff Johnson295189b2012-06-20 16:38:30 -070019291 WDI_ASSERT(0);
19292 return WDI_STATUS_MEM_FAILURE;
19293 }
19294
19295 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19296 pEventDataQueue->pUserData = pEventData->pUserData;
19297 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19298 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019299 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019300
19301 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
19302 {
19303 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070019304
Jeff Johnson295189b2012-06-20 16:38:30 -070019305 if ( NULL == pEventInfo )
19306 {
19307 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019308 "Cannot allocate memory for queueing event data info");
Jeff Johnson295189b2012-06-20 16:38:30 -070019309 WDI_ASSERT(0);
19310 wpalMemoryFree(pEventDataQueue);
19311 return WDI_STATUS_MEM_FAILURE;
19312 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019313
Jeff Johnson295189b2012-06-20 16:38:30 -070019314 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19315
19316 }
19317 pEventDataQueue->pEventData = pEventInfo;
19318
19319 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019320 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019321
Jeff Johnsone7245742012-09-05 17:12:55 -070019322 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019323
19324 return WDI_STATUS_SUCCESS;
19325}/*WDI_QueuePendingReq*/
19326
19327/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019328 @brief Callback function for serializing queued message
Jeff Johnson295189b2012-06-20 16:38:30 -070019329 processing in the control context
Jeff Johnsone7245742012-09-05 17:12:55 -070019330 @param
19331
19332 pMsg - pointer to the message
19333
19334 @see
19335 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019336*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019337void
Jeff Johnson295189b2012-06-20 16:38:30 -070019338WDI_PALCtrlMsgCB
19339(
19340 wpt_msg *pMsg
19341)
19342{
19343 WDI_EventInfoType* pEventData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019344 WDI_ControlBlockType* pWDICtx = NULL;
19345 WDI_Status wdiStatus;
19346 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019347 void* pUserData;
19348 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19349
19350 if (( NULL == pMsg )||
19351 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19352 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19353 {
19354 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019355 "Invalid message received on serialize ctrl context API");
Jeff Johnson295189b2012-06-20 16:38:30 -070019356 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019357 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019358 }
19359
19360 /*Transition back to the state that we had before serialization
19361 - serialization transitions us to BUSY to stop any incomming requests
19362 ! TO DO L: possible race condition here if a request comes in between the
19363 state transition and the post function*/
19364
Jeff Johnsone7245742012-09-05 17:12:55 -070019365 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
Jeff Johnson295189b2012-06-20 16:38:30 -070019366
19367 /*-----------------------------------------------------------------------
19368 Check to see what type of event we are serializing
Jeff Johnsone7245742012-09-05 17:12:55 -070019369 - responses are never expected to come through here
Jeff Johnson295189b2012-06-20 16:38:30 -070019370 -----------------------------------------------------------------------*/
19371 switch ( pEventData->wdiRequest )
19372 {
19373
Jeff Johnsone7245742012-09-05 17:12:55 -070019374 case WDI_STOP_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -070019375 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19376 break;
19377
Jeff Johnson295189b2012-06-20 16:38:30 -070019378 case WDI_NV_DOWNLOAD_REQ:
19379 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19380 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19381 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19382 {
19383 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19384 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19385 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19386 }
19387 else
19388 {
19389 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19390 }
19391
19392 break;
19393
19394 default:
19395 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19396 break;
19397 }/*switch ( pEventData->wdiRequest )*/
19398
19399 if ( WDI_STATUS_SUCCESS != wdiStatus )
19400 {
19401 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19402
19403 if ( NULL != pfnReqStatusCB )
19404 {
19405 /*Fail the request*/
19406 pfnReqStatusCB( wdiStatus, pUserData);
19407 }
19408 }
19409
19410 /* Free data - that was allocated when queueing*/
19411 if( pEventData != NULL )
19412 {
19413 if( pEventData->pEventData != NULL )
19414 {
19415 wpalMemoryFree(pEventData->pEventData);
19416 }
19417 wpalMemoryFree(pEventData);
19418 }
19419
19420 if( pMsg != NULL )
19421 {
19422 wpalMemoryFree(pMsg);
19423 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019424
Jeff Johnson295189b2012-06-20 16:38:30 -070019425}/*WDI_PALCtrlMsgCB*/
19426
19427/**
19428 @brief Utility function used by the DAL Core to help dequeue
Jeff Johnsone7245742012-09-05 17:12:55 -070019429 and schedule for execution a pending request
19430 @param
19431
Jeff Johnson295189b2012-06-20 16:38:30 -070019432 pWDICtx: - pointer to the WDI control block
19433 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019434 queued
19435
19436 @see
19437 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019438*/
19439WDI_Status
19440WDI_DequeuePendingReq
19441(
19442 WDI_ControlBlockType* pWDICtx
19443)
19444{
Jeff Johnsone7245742012-09-05 17:12:55 -070019445 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019446 WDI_EventInfoType* pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019447 wpt_msg* palMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070019448 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19449
Jeff Johnsone7245742012-09-05 17:12:55 -070019450 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019451
19452 if ( NULL == pNode )
19453 {
19454 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019455 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019456 return WDI_STATUS_SUCCESS;
19457 }
19458
19459 /*The node actually points to the 1st element inside the Event Data struct -
19460 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019461 pEventData = (WDI_EventInfoType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019462
19463 /*Serialize processing in the control thread
19464 !TO DO: - check to see if these are all the messages params that need
19465 to be filled in*/
19466 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19467
19468 if ( NULL == palMsg )
19469 {
19470 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019471 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
Jeff Johnson295189b2012-06-20 16:38:30 -070019472 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019473 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019474 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019475 palMsg->pContext = pWDICtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070019476 palMsg->callback = WDI_PALCtrlMsgCB;
19477 palMsg->ptr = pEventData;
19478
19479 /*Save the global state as we need it on the other side*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019480 palMsg->val = pWDICtx->uGlobalState;
19481
Jeff Johnson295189b2012-06-20 16:38:30 -070019482 /*Transition back to BUSY as we need to handle a queued request*/
19483 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -070019484
Jeff Johnson295189b2012-06-20 16:38:30 -070019485 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19486
19487 return WDI_STATUS_PENDING;
19488}/*WDI_DequeuePendingReq*/
19489
19490
19491/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019492 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019493 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019494 away.- The assoc requests will be queued by BSSID
19495 @param
19496
Jeff Johnson295189b2012-06-20 16:38:30 -070019497 pWDICtx: - pointer to the WDI control block
19498 pEventData: pointer to the evnt info that needs to be queued
19499 macBSSID: bssid
Jeff Johnsone7245742012-09-05 17:12:55 -070019500
19501 @see
19502 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019503*/
19504WDI_Status
19505WDI_QueueNewAssocRequest
19506(
19507 WDI_ControlBlockType* pWDICtx,
19508 WDI_EventInfoType* pEventData,
19509 wpt_macAddr macBSSID
19510)
19511{
Jeff Johnsone7245742012-09-05 17:12:55 -070019512 wpt_uint8 i;
19513 WDI_BSSSessionType* pSession = NULL;
19514 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019515 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019516 void* pEventInfo;
19517 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019518 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -070019519
Jeff Johnsone7245742012-09-05 17:12:55 -070019520
19521 /*------------------------------------------------------------------------
19522 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019523 ------------------------------------------------------------------------*/
19524 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19525 {
19526 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19527 {
19528 /*Found an empty session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019529 pSession = &pWDICtx->aBSSSessions[i];
19530 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070019531 }
19532 }
19533
19534 if ( i >= WDI_MAX_BSS_SESSIONS )
19535 {
19536 /*Cannot find any empty sessions*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019537 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019538 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019539
Jeff Johnson295189b2012-06-20 16:38:30 -070019540 /*------------------------------------------------------------------------
19541 Fill in the BSSID for this session and set the usage flag
19542 ------------------------------------------------------------------------*/
19543 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070019544 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019545
19546 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019547 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019548 ------------------------------------------------------------------------*/
19549 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19550 if ( NULL == pEventDataQueue )
19551 {
19552 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19553 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19554 WDI_ASSERT(0);
19555 return WDI_STATUS_MEM_FAILURE;
19556 }
19557
19558 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19559 if ( NULL == pSessionIdElement )
19560 {
19561 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19562 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19563 WDI_ASSERT(0);
19564 wpalMemoryFree(pEventDataQueue);
19565 return WDI_STATUS_MEM_FAILURE;
19566 }
19567
19568 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19569 if ( NULL == pEventInfo )
19570 {
19571 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19572 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19573 WDI_ASSERT(0);
19574 wpalMemoryFree(pSessionIdElement);
19575 wpalMemoryFree(pEventDataQueue);
19576 return WDI_STATUS_MEM_FAILURE;
19577 }
19578
19579 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19580 pEventDataQueue->pUserData = pEventData->pUserData;
19581 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19582 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019583 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019584
19585 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19586 pEventDataQueue->pEventData = pEventInfo;
19587
19588 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019589 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019590
19591 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019592 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019593
Jeff Johnsone7245742012-09-05 17:12:55 -070019594 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019595
19596 /*We need to maintain a separate list that keeps track of the order in which
19597 the new assoc requests are being queued such that we can start processing
19598 them in the order that they had arrived*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019599 pSessionIdElement->ucIndex = i;
19600 pNode = (wpt_list_node*)pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019601
19602 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19603 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
Jeff Johnsone7245742012-09-05 17:12:55 -070019604 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019605
19606 /*Return pending as this is what the status of the request is since it has
19607 been queued*/
19608 return WDI_STATUS_PENDING;
19609}/*WDI_QueueNewAssocRequest*/
19610
19611/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019612 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019613 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019614 away.- The assoc requests will be queued by BSSID
19615 @param
19616
Jeff Johnson295189b2012-06-20 16:38:30 -070019617 pWDICtx: - pointer to the WDI control block
19618 pSession: - session in which to queue
19619 pEventData: pointer to the event info that needs to be
19620 queued
Jeff Johnsone7245742012-09-05 17:12:55 -070019621
19622 @see
19623 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019624*/
19625WDI_Status
19626WDI_QueueAssocRequest
19627(
19628 WDI_ControlBlockType* pWDICtx,
19629 WDI_BSSSessionType* pSession,
19630 WDI_EventInfoType* pEventData
19631)
19632{
Jeff Johnsone7245742012-09-05 17:12:55 -070019633 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019634 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019635 void* pEventInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070019636 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019637
19638 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019639 Sanity check
19640 ------------------------------------------------------------------------*/
19641 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19642 {
19643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19644 "%s: Invalid parameters", __FUNCTION__);
19645
Jeff Johnsone7245742012-09-05 17:12:55 -070019646 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019647 }
19648
19649 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019650 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019651 ------------------------------------------------------------------------*/
19652 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19653 if ( NULL == pEventDataQueue )
19654 {
19655 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019656 "%s: Cannot allocate memory for queueing", __FUNCTION__);
Jeff Johnson295189b2012-06-20 16:38:30 -070019657 WDI_ASSERT(0);
19658 return WDI_STATUS_MEM_FAILURE;
19659 }
19660
19661 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19662 if ( NULL == pEventInfo )
19663 {
19664 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19665 "%s: Cannot allocate memory for queueing event data info",
19666 __FUNCTION__);
19667 WDI_ASSERT(0);
19668 wpalMemoryFree(pEventDataQueue);
19669 return WDI_STATUS_MEM_FAILURE;
19670 }
19671
19672 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19673 pEventDataQueue->pUserData = pEventData->pUserData;
19674 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19675 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019676 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019677 pEventDataQueue->pEventData = pEventInfo;
19678
19679 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19680
19681 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019682 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019683
19684 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019685 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019686
Jeff Johnsone7245742012-09-05 17:12:55 -070019687 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019688
19689 /*The result of this operation is pending because the request has been
19690 queued and it will be processed at a later moment in time */
19691 return WDI_STATUS_PENDING;
19692}/*WDI_QueueAssocRequest*/
19693
19694/**
19695 @brief Utility function used by the DAL Core to help dequeue
19696 an association request that was pending
19697 The request will be queued up in front of the main
19698 pending queue for imediate processing
Jeff Johnsone7245742012-09-05 17:12:55 -070019699 @param
19700
Jeff Johnson295189b2012-06-20 16:38:30 -070019701 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019702
19703
19704 @see
19705 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019706*/
19707WDI_Status
19708WDI_DequeueAssocRequest
19709(
19710 WDI_ControlBlockType* pWDICtx
19711)
19712{
Jeff Johnsone7245742012-09-05 17:12:55 -070019713 wpt_list_node* pNode = NULL;
19714 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019715 WDI_BSSSessionType* pSession;
19716 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019717
19718 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019719 Sanity check
19720 ------------------------------------------------------------------------*/
19721 if ( NULL == pWDICtx )
19722 {
19723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19724 "%s: Invalid parameters", __FUNCTION__);
19725
Jeff Johnsone7245742012-09-05 17:12:55 -070019726 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019727 }
19728
19729 /*------------------------------------------------------------------------
19730 An association has been completed => a new association can occur
19731 Check to see if there are any pending associations ->
19732 If so , transfer all the pending requests into the busy queue for
19733 processing
19734 These requests have arrived prior to the requests in the busy queue
19735 (bc they needed to be processed in order to be placed in this queue)
19736 => they will be placed at the front of the busy queue
19737 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019738 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019739
19740 if ( NULL == pNode )
19741 {
19742 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019743 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019744 return WDI_STATUS_SUCCESS;
19745 }
19746
19747 /*The node actually points to the 1st element inside the Session Id struct -
19748 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019749 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019750
19751 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19752 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19753
19754 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19755 {
19756 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
Jeff Johnsone7245742012-09-05 17:12:55 -070019757
Jeff Johnson295189b2012-06-20 16:38:30 -070019758 /*Transfer all the pending requests in this assoc queue to
Jeff Johnsone7245742012-09-05 17:12:55 -070019759 the front of the main waiting queue for subsequent execution*/
19760 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019761 while ( NULL != pNode )
19762 {
19763 /*Place it in front of the main pending list*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019764 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19765 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019766 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019767 pSession->bAssocReqQueued = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019768 }
19769 else
19770 {
19771 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019772 "Invalid session id queued up for assoc");
Jeff Johnson295189b2012-06-20 16:38:30 -070019773 WPAL_ASSERT(0);
19774 wpalMemoryFree(pSessionIdElement);
Jeff Johnsone7245742012-09-05 17:12:55 -070019775 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019776 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019777
Jeff Johnson295189b2012-06-20 16:38:30 -070019778 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19779 wpalMemoryFree(pSessionIdElement);
19780 return WDI_STATUS_SUCCESS;
19781}/*WDI_DequeueAssocRequest*/
19782
19783/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019784 @brief Utility function used by the DAL Core to clear any
Jeff Johnson295189b2012-06-20 16:38:30 -070019785 pending requests - all req cb will be called with
19786 failure and the queue will be emptied.
Jeff Johnsone7245742012-09-05 17:12:55 -070019787 @param
19788
Jeff Johnson295189b2012-06-20 16:38:30 -070019789 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019790
19791 @see
19792 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019793*/
19794WDI_Status
19795WDI_ClearPendingRequests
Jeff Johnsone7245742012-09-05 17:12:55 -070019796(
Jeff Johnson295189b2012-06-20 16:38:30 -070019797 WDI_ControlBlockType* pWDICtx
19798)
19799{
Jeff Johnsone7245742012-09-05 17:12:55 -070019800 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019801 WDI_EventInfoType* pEventDataQueue = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019802 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019803 void* pUserData;
19804 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19805
Jeff Johnsone7245742012-09-05 17:12:55 -070019806 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019807
19808 /*------------------------------------------------------------------------
19809 Go through all the requests and fail them - this will only be called
19810 when device is being stopped or an error was detected - either case the
Jeff Johnsone7245742012-09-05 17:12:55 -070019811 pending requests can no longer be sent down to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070019812 ------------------------------------------------------------------------*/
19813 while( pNode )
19814 {
19815 /*The node actually points to the 1st element inside the Event Data struct -
19816 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019817 pEventDataQueue = (WDI_EventInfoType*)pNode;
19818
Jeff Johnson295189b2012-06-20 16:38:30 -070019819 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
19820 if ( NULL != pfnReqStatusCB )
19821 {
19822 /*Fail the request*/
19823 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
19824 }
19825 /* Free data - that was allocated when queueing */
19826 if ( pEventDataQueue->pEventData != NULL )
19827 {
19828 wpalMemoryFree(pEventDataQueue->pEventData);
19829 }
19830 wpalMemoryFree(pEventDataQueue);
19831
19832 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
19833 {
19834 break;
19835 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019836 }
19837
Jeff Johnson295189b2012-06-20 16:38:30 -070019838 return WDI_STATUS_SUCCESS;
19839}/*WDI_ClearPendingRequests*/
19840
19841/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019842 @brief Helper routine used to init the BSS Sessions in the WDI control block
19843
19844
19845 @param pWDICtx: pointer to the WLAN DAL context
19846
Jeff Johnson295189b2012-06-20 16:38:30 -070019847 @see
19848*/
19849void
19850WDI_ResetAssocSessions
Jeff Johnsone7245742012-09-05 17:12:55 -070019851(
Jeff Johnson295189b2012-06-20 16:38:30 -070019852 WDI_ControlBlockType* pWDICtx
19853)
19854{
Jeff Johnsone7245742012-09-05 17:12:55 -070019855 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019856 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19857
19858 /*-------------------------------------------------------------------------
19859 No Sanity check
19860 -------------------------------------------------------------------------*/
19861 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19862 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019863 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
Jeff Johnson295189b2012-06-20 16:38:30 -070019864 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
19865 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
19866 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
19867 }
19868}/*WDI_ResetAssocSessions*/
19869
19870/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019871 @brief Helper routine used to find a session based on the BSSID
19872
19873
19874 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019875 macBSSID: BSSID of the session
Jeff Johnsone7245742012-09-05 17:12:55 -070019876 pSession: pointer to the session (if found)
19877
Jeff Johnson295189b2012-06-20 16:38:30 -070019878 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019879 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019880*/
19881wpt_uint8
19882WDI_FindAssocSession
Jeff Johnsone7245742012-09-05 17:12:55 -070019883(
Jeff Johnson295189b2012-06-20 16:38:30 -070019884 WDI_ControlBlockType* pWDICtx,
19885 wpt_macAddr macBSSID,
19886 WDI_BSSSessionType** ppSession
19887)
19888{
Jeff Johnsone7245742012-09-05 17:12:55 -070019889 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019890 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19891
19892 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019893 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019894 -------------------------------------------------------------------------*/
19895 if ( NULL == ppSession )
19896 {
19897 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19898 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019899 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019900 }
19901
Jeff Johnsone7245742012-09-05 17:12:55 -070019902 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019903
Jeff Johnsone7245742012-09-05 17:12:55 -070019904 /*------------------------------------------------------------------------
19905 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019906 ------------------------------------------------------------------------*/
19907 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19908 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019909 if ( eWLAN_PAL_TRUE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070019910 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
19911 {
19912 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019913 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019914 return i;
19915 }
19916 }
19917
Jeff Johnsone7245742012-09-05 17:12:55 -070019918 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019919}/*WDI_FindAssocSession*/
19920
19921/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019922 @brief Helper routine used to find a session based on the BSSID
19923
19924
19925 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019926 ucBSSIdx: BSS Index of the session
19927 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019928
Jeff Johnson295189b2012-06-20 16:38:30 -070019929 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019930 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019931*/
19932wpt_uint8
19933WDI_FindAssocSessionByBSSIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019934(
Jeff Johnson295189b2012-06-20 16:38:30 -070019935 WDI_ControlBlockType* pWDICtx,
19936 wpt_uint16 ucBSSIdx,
19937 WDI_BSSSessionType** ppSession
19938)
19939{
Jeff Johnsone7245742012-09-05 17:12:55 -070019940 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019941 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19942
19943 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019944 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019945 -------------------------------------------------------------------------*/
19946 if ( NULL == ppSession )
19947 {
19948 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19949 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019950 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019951 }
19952
Jeff Johnsone7245742012-09-05 17:12:55 -070019953 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019954
Jeff Johnsone7245742012-09-05 17:12:55 -070019955 /*------------------------------------------------------------------------
19956 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019957 ------------------------------------------------------------------------*/
19958 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19959 {
19960 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
19961 {
19962 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019963 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019964 return i;
19965 }
19966 }
19967
Jeff Johnsone7245742012-09-05 17:12:55 -070019968 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019969}/*WDI_FindAssocSessionByBSSIdx*/
19970
19971/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019972 @brief Helper routine used to find a session based on the BSSID
19973
19974
19975 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019976 ucBSSIdx: BSS Index of the session
19977 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019978
Jeff Johnson295189b2012-06-20 16:38:30 -070019979 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019980 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019981*/
19982wpt_uint8
19983WDI_FindAssocSessionByIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019984(
Jeff Johnson295189b2012-06-20 16:38:30 -070019985 WDI_ControlBlockType* pWDICtx,
19986 wpt_uint16 usIdx,
19987 WDI_BSSSessionType** ppSession
19988)
19989{
19990 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19991
19992 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019993 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019994 -------------------------------------------------------------------------*/
19995 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
19996 {
19997 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19998 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019999 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020000 }
20001
20002 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020003 *ppSession = &pWDICtx->aBSSSessions[usIdx];
Jeff Johnson295189b2012-06-20 16:38:30 -070020004
20005 return usIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020006
Jeff Johnson295189b2012-06-20 16:38:30 -070020007}/*WDI_FindAssocSessionByBSSIdx*/
20008
20009/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020010 @brief Helper routine used to find an empty session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020011 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020012
20013
20014 @param pWDICtx: pointer to the WLAN DAL context
20015 pSession: pointer to the session (if found)
20016
Jeff Johnson295189b2012-06-20 16:38:30 -070020017 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020018 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020019*/
20020wpt_uint8
20021WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -070020022(
Jeff Johnson295189b2012-06-20 16:38:30 -070020023 WDI_ControlBlockType* pWDICtx,
20024 WDI_BSSSessionType** ppSession
20025)
20026{
Jeff Johnsone7245742012-09-05 17:12:55 -070020027 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020028 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20029 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020030 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020031 -------------------------------------------------------------------------*/
20032 if ( NULL == ppSession )
20033 {
20034 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20035 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020036 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020037 }
20038
Jeff Johnsone7245742012-09-05 17:12:55 -070020039 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020040
Jeff Johnsone7245742012-09-05 17:12:55 -070020041 /*------------------------------------------------------------------------
20042 Search for a session that it is not in use
Jeff Johnson295189b2012-06-20 16:38:30 -070020043 ------------------------------------------------------------------------*/
20044 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20045 {
20046 if ( ! pWDICtx->aBSSSessions[i].bInUse )
20047 {
20048 /*Found a session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020049 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020050 return i;
20051 }
20052 }
20053
Jeff Johnsone7245742012-09-05 17:12:55 -070020054 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020055}/*WDI_FindEmptySession*/
20056
20057
20058/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020059 @brief Helper routine used to get the total count of active
Jeff Johnson295189b2012-06-20 16:38:30 -070020060 sessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020061
20062
20063 @param pWDICtx: pointer to the WLAN DAL context
20064
Jeff Johnson295189b2012-06-20 16:38:30 -070020065 @see
20066 @return Number of sessions in use
20067*/
20068wpt_uint8
20069WDI_GetActiveSessionsCount
Jeff Johnsone7245742012-09-05 17:12:55 -070020070(
Jeff Johnson295189b2012-06-20 16:38:30 -070020071 WDI_ControlBlockType* pWDICtx
20072)
20073{
Jeff Johnsone7245742012-09-05 17:12:55 -070020074 wpt_uint8 i, ucCount = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070020075 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020076
20077 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070020078 Count all sessions in use
20079 ------------------------------------------------------------------------*/
20080 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20081 {
20082 if ( pWDICtx->aBSSSessions[i].bInUse )
20083 {
20084 ucCount++;
20085 }
20086 }
20087
Jeff Johnsone7245742012-09-05 17:12:55 -070020088 return ucCount;
Jeff Johnson295189b2012-06-20 16:38:30 -070020089}/*WDI_GetActiveSessionsCount*/
20090
20091/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020092 @brief Helper routine used to delete session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020093 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020094
20095
20096 @param pWDICtx: pointer to the WLAN DAL context
20097 pSession: pointer to the session (if found)
20098
Jeff Johnson295189b2012-06-20 16:38:30 -070020099 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020100 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020101*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020102void
Jeff Johnson295189b2012-06-20 16:38:30 -070020103WDI_DeleteSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020104(
Jeff Johnson295189b2012-06-20 16:38:30 -070020105 WDI_ControlBlockType* pWDICtx,
20106 WDI_BSSSessionType* ppSession
20107)
20108{
20109 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020110 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020111 -------------------------------------------------------------------------*/
20112 if ( NULL == ppSession )
20113 {
20114 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20115 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020116 return ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020117 }
20118
Jeff Johnsone7245742012-09-05 17:12:55 -070020119 /*------------------------------------------------------------------------
20120 Reset the entries int session
Jeff Johnson295189b2012-06-20 16:38:30 -070020121 ------------------------------------------------------------------------*/
20122 wpal_list_destroy(&ppSession->wptPendingQueue);
20123 wpalMemoryZero(ppSession, sizeof(*ppSession));
Jeff Johnsone7245742012-09-05 17:12:55 -070020124 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
20125 ppSession->bInUse = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020126 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
20127 wpal_list_init(&ppSession->wptPendingQueue);
20128
20129}/*WDI_DeleteSession*/
20130
20131/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020132 @brief Utility function to add the broadcast STA to the the STA table.
Jeff Johnson295189b2012-06-20 16:38:30 -070020133 The bcast STA ID is assigned by HAL and must be valid.
Jeff Johnsone7245742012-09-05 17:12:55 -070020134 @param
20135
Jeff Johnson295189b2012-06-20 16:38:30 -070020136 WDI_AddStaParams: - pointer to the WDI Add STA params
20137 usBcastStaIdx: - Broadcast STA index passed by HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070020138
20139 @see
20140 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070020141*/
20142void
20143WDI_AddBcastSTAtoSTATable
20144(
20145 WDI_ControlBlockType* pWDICtx,
20146 WDI_AddStaParams * staParams,
20147 wpt_uint16 usBcastStaIdx
20148)
20149{
20150 WDI_AddStaParams wdiAddSTAParam = {0};
20151 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
20152 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20153
20154 /*---------------------------------------------------------------------
20155 Sanity check
20156 ---------------------------------------------------------------------*/
20157 if ( NULL == staParams )
20158 {
20159 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20160 "%s: Invalid parameters", __FUNCTION__);
20161
Jeff Johnsone7245742012-09-05 17:12:55 -070020162 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020163 }
20164
20165 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
20166 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
20167 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
20168 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
20169 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
20170 wdiAddSTAParam.dpuSig = staParams->dpuSig;
20171 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
20172 WDI_MAC_ADDR_LEN );
20173 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
20174 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
20175 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
20176 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
20177 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
20178 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
20179 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020180
Jeff Johnson295189b2012-06-20 16:38:30 -070020181 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
20182}
20183
20184/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020185 @brief NV blob will be divided into fragments of size 4kb and
20186 Sent to HAL
20187
20188 @param pWDICtx: pointer to the WLAN DAL context
20189 pEventData: pointer to the event information structure
20190
Jeff Johnson295189b2012-06-20 16:38:30 -070020191 @see
20192 @return Result of the function call
20193 */
20194
20195WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -070020196(
Jeff Johnson295189b2012-06-20 16:38:30 -070020197 WDI_ControlBlockType* pWDICtx,
20198 WDI_EventInfoType* pEventData
20199)
20200{
20201
20202 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
20203 wpt_uint8* pSendBuffer = NULL;
20204 wpt_uint16 usDataOffset = 0;
20205 wpt_uint16 usSendSize = 0;
20206 wpt_uint16 usCurrentFragmentSize =0;
20207 wpt_uint8* pSrcBuffer = NULL;
20208 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
20209 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
20210
20211 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
20212 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
20213 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
20214
Jeff Johnsone7245742012-09-05 17:12:55 -070020215 /* Sanity Check is done by the caller */
Jeff Johnson295189b2012-06-20 16:38:30 -070020216 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
20217
20218 /* Update the current Fragment Number */
20219 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
20220
20221 /*Update the HAL REQ structure */
20222 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
20223 halNvImgDownloadParam.nvImageReqParams.fragNumber =
20224 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
20225
20226 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
Jeff Johnsone7245742012-09-05 17:12:55 -070020227 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
Jeff Johnson295189b2012-06-20 16:38:30 -070020228 image will be sent to HAL*/
20229
Jeff Johnsone7245742012-09-05 17:12:55 -070020230 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
Jeff Johnson295189b2012-06-20 16:38:30 -070020231 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
Jeff Johnsone7245742012-09-05 17:12:55 -070020232 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020233 /* Taking care of boundry condition */
Jeff Johnsone7245742012-09-05 17:12:55 -070020234 if( !(usCurrentFragmentSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070020235 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
20236 usCurrentFragmentSize = FRAGMENT_SIZE;
20237
20238 /*Update the HAL REQ structure */
20239 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
20240 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
20241
20242 }
20243 else
Jeff Johnsone7245742012-09-05 17:12:55 -070020244 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020245 usCurrentFragmentSize = FRAGMENT_SIZE;
20246
20247 /*Update the HAL REQ structure */
20248 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
20249 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
20250 }
20251
20252 /*-----------------------------------------------------------------------
20253 Get message buffer
20254 -----------------------------------------------------------------------*/
20255 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
20256 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
20257 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070020258 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070020259 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
20260 {
20261 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20262 "Unable to get send buffer in NV Download req %x %x ",
20263 pEventData, pwdiNvDownloadReqParams);
20264 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070020265 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020266 }
20267
20268 /* Copying the Hal NV download REQ structure */
Jeff Johnsone7245742012-09-05 17:12:55 -070020269 wpalMemoryCopy(pSendBuffer + usDataOffset ,
Jeff Johnson295189b2012-06-20 16:38:30 -070020270 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
20271
20272 /* Appending the NV image fragment */
20273 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
20274 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
20275 usCurrentFragmentSize);
20276
20277 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070020278 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070020279
Jeff Johnsone7245742012-09-05 17:12:55 -070020280 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
20281 wdiNvDownloadRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -070020282 WDI_NV_DOWNLOAD_RESP);
20283
20284}
Jeff Johnsone7245742012-09-05 17:12:55 -070020285/*============================================================================
20286 Helper inline functions for
Jeff Johnson295189b2012-06-20 16:38:30 -070020287 ============================================================================*/
20288/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020289 @brief Helper routine used to find a session based on the BSSID
20290 @param pContext: pointer to the WLAN DAL context
20291 @param pDPContext: pointer to the Datapath context
20292
Jeff Johnson295189b2012-06-20 16:38:30 -070020293 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020294 @return
Jeff Johnson295189b2012-06-20 16:38:30 -070020295*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020296WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020297WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
20298{
20299 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20300
20301 pCB->pDPContext = pDPContext;
20302 return;
20303}
20304
20305/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020306 @brief Helper routine used to find a session based on the BSSID
20307
20308
20309 @param pContext: pointer to the WLAN DAL context
20310
Jeff Johnson295189b2012-06-20 16:38:30 -070020311 @see
20312 @return pointer to Datapath context
20313*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020314WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020315WDI_DS_GetDatapathContext (void *pContext)
20316{
20317 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20318 return pCB->pDPContext;
20319}
20320/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020321 @brief Helper routine used to find a session based on the BSSID
20322
20323
20324 @param pContext: pointer to the WLAN DAL context
20325 @param pDTDriverContext: pointer to the Transport Driver context
20326
Jeff Johnson295189b2012-06-20 16:38:30 -070020327 @see
20328 @return void
20329*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020330WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020331WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
20332{
20333 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20334
20335 pCB->pDTDriverContext = pDTDriverContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020336 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020337}
20338
20339/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020340 @brief Helper routine used to find a session based on the BSSID
20341
20342
20343 @param pWDICtx: pointer to the WLAN DAL context
20344
Jeff Johnson295189b2012-06-20 16:38:30 -070020345 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020346 @return pointer to datapath context
Jeff Johnson295189b2012-06-20 16:38:30 -070020347*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020348WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020349WDT_GetTransportDriverContext (void *pContext)
20350{
20351 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020352 return(pCB->pDTDriverContext);
Jeff Johnson295189b2012-06-20 16:38:30 -070020353}
20354
Jeff Johnsone7245742012-09-05 17:12:55 -070020355/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -070020356 Helper inline converters
20357 ============================================================================*/
20358/*Convert WDI driver type into HAL driver type*/
20359WPT_STATIC WPT_INLINE WDI_Status
20360WDI_HAL_2_WDI_STATUS
20361(
20362 eHalStatus halStatus
20363)
20364{
Jeff Johnsone7245742012-09-05 17:12:55 -070020365 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020366 the chances of getting inlined*/
20367 switch( halStatus )
20368 {
20369 case eHAL_STATUS_SUCCESS:
20370 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20371 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20372 return WDI_STATUS_SUCCESS;
20373 case eHAL_STATUS_FAILURE:
20374 return WDI_STATUS_E_FAILURE;
20375 case eHAL_STATUS_FAILED_ALLOC:
Jeff Johnsone7245742012-09-05 17:12:55 -070020376 return WDI_STATUS_MEM_FAILURE;
20377 /*The rest of the HAL error codes must be kept hidden from the UMAC as
Jeff Johnson295189b2012-06-20 16:38:30 -070020378 they refer to specific internal modules of our device*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020379 default:
20380 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20381 }
Jeff Johnson295189b2012-06-20 16:38:30 -070020382
Jeff Johnsone7245742012-09-05 17:12:55 -070020383 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020384}/*WDI_HAL_2_WDI_STATUS*/
20385
20386/*Convert WDI request type into HAL request type*/
20387WPT_STATIC WPT_INLINE tHalHostMsgType
20388WDI_2_HAL_REQ_TYPE
20389(
20390 WDI_RequestEnumType wdiReqType
20391)
20392{
Jeff Johnsone7245742012-09-05 17:12:55 -070020393 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020394 the chances of getting inlined*/
20395 switch( wdiReqType )
Jeff Johnsone7245742012-09-05 17:12:55 -070020396 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020397 case WDI_START_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020398 return WLAN_HAL_START_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020399 case WDI_STOP_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020400 return WLAN_HAL_STOP_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020401 case WDI_INIT_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020402 return WLAN_HAL_INIT_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020403 case WDI_START_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020404 return WLAN_HAL_START_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020405 case WDI_END_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020406 return WLAN_HAL_END_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020407 case WDI_FINISH_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020408 return WLAN_HAL_FINISH_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020409 case WDI_JOIN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020410 return WLAN_HAL_JOIN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020411 case WDI_CONFIG_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020412 return WLAN_HAL_CONFIG_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020413 case WDI_DEL_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020414 return WLAN_HAL_DELETE_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020415 case WDI_POST_ASSOC_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020416 return WLAN_HAL_POST_ASSOC_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020417 case WDI_DEL_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020418 return WLAN_HAL_DELETE_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020419 case WDI_SET_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020420 return WLAN_HAL_SET_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020421 case WDI_RMV_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020422 return WLAN_HAL_RMV_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020423 case WDI_SET_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020424 return WLAN_HAL_SET_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020425 case WDI_RMV_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020426 return WLAN_HAL_RMV_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020427 case WDI_SET_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020428 return WLAN_HAL_SET_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020429 case WDI_RMV_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020430 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020431 return WLAN_HAL_RMV_STAKEY_REQ;
20432 case WDI_ADD_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020433 return WLAN_HAL_ADD_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020434 case WDI_DEL_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020435 return WLAN_HAL_DEL_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020436 case WDI_UPD_EDCA_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020437 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020438 case WDI_ADD_BA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020439 return WLAN_HAL_ADD_BA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020440 case WDI_DEL_BA_REQ:
20441 return WLAN_HAL_DEL_BA_REQ;
20442#ifdef FEATURE_WLAN_CCX
20443 case WDI_TSM_STATS_REQ:
20444 return WLAN_HAL_TSM_STATS_REQ;
20445#endif
20446 case WDI_CH_SWITCH_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020447 return WLAN_HAL_CH_SWITCH_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020448 case WDI_CONFIG_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020449 return WLAN_HAL_CONFIG_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020450 case WDI_SET_LINK_ST_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020451 return WLAN_HAL_SET_LINK_ST_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020452 case WDI_GET_STATS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020453 return WLAN_HAL_GET_STATS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020454 case WDI_UPDATE_CFG_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020455 return WLAN_HAL_UPDATE_CFG_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020456 case WDI_ADD_BA_SESSION_REQ:
20457 return WLAN_HAL_ADD_BA_SESSION_REQ;
20458 case WDI_TRIGGER_BA_REQ:
20459 return WLAN_HAL_TRIGGER_BA_REQ;
20460 case WDI_UPD_BCON_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020461 return WLAN_HAL_UPDATE_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020462 case WDI_SND_BCON_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020463 return WLAN_HAL_SEND_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020464 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20465 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20466 case WDI_SET_MAX_TX_POWER_REQ:
20467 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20468#ifdef WLAN_FEATURE_P2P
20469 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20470 return WLAN_HAL_SET_P2P_GONOA_REQ;
20471#endif
20472 case WDI_ENTER_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020473 return WLAN_HAL_ENTER_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020474 case WDI_EXIT_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020475 return WLAN_HAL_EXIT_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020476 case WDI_ENTER_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020477 return WLAN_HAL_ENTER_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020478 case WDI_EXIT_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020479 return WLAN_HAL_EXIT_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020480 case WDI_ENTER_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020481 return WLAN_HAL_ENTER_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020482 case WDI_EXIT_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020483 return WLAN_HAL_EXIT_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020484 case WDI_SET_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020485 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020486 case WDI_UPDATE_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020487 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020488 case WDI_CONFIGURE_RXP_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020489 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020490 case WDI_SET_BEACON_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020491 return WLAN_HAL_ADD_BCN_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020492 case WDI_REM_BEACON_FILTER_REQ:
20493 return WLAN_HAL_REM_BCN_FILTER_REQ;
20494 case WDI_SET_RSSI_THRESHOLDS_REQ:
20495 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20496 case WDI_HOST_OFFLOAD_REQ:
20497 return WLAN_HAL_HOST_OFFLOAD_REQ;
20498 case WDI_WOWL_ADD_BC_PTRN_REQ:
20499 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20500 case WDI_WOWL_DEL_BC_PTRN_REQ:
20501 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20502 case WDI_WOWL_ENTER_REQ:
20503 return WLAN_HAL_ENTER_WOWL_REQ;
20504 case WDI_WOWL_EXIT_REQ:
20505 return WLAN_HAL_EXIT_WOWL_REQ;
20506 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20507 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20508 case WDI_NV_DOWNLOAD_REQ:
20509 return WLAN_HAL_DOWNLOAD_NV_REQ;
20510 case WDI_FLUSH_AC_REQ:
20511 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20512 case WDI_BTAMP_EVENT_REQ:
20513 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20514#ifdef WLAN_FEATURE_VOWIFI_11R
20515 case WDI_AGGR_ADD_TS_REQ:
20516 return WLAN_HAL_AGGR_ADD_TS_REQ;
20517#endif /* WLAN_FEATURE_VOWIFI_11R */
20518#ifdef ANI_MANF_DIAG
20519 case WDI_FTM_CMD_REQ:
20520 return WLAN_HAL_PROCESS_PTT_REQ;
20521#endif /* ANI_MANF_DIAG */
20522 case WDI_ADD_STA_SELF_REQ:
20523 return WLAN_HAL_ADD_STA_SELF_REQ;
20524 case WDI_DEL_STA_SELF_REQ:
20525 return WLAN_HAL_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070020526#ifdef FEATURE_OEM_DATA_SUPPORT
20527 case WDI_START_OEM_DATA_REQ:
20528 return WLAN_HAL_START_OEM_DATA_REQ;
20529#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020530 case WDI_HOST_RESUME_REQ:
20531 return WLAN_HAL_HOST_RESUME_REQ;
20532 case WDI_HOST_SUSPEND_IND:
20533 return WLAN_HAL_HOST_SUSPEND_IND;
20534 case WDI_KEEP_ALIVE_REQ:
20535 return WLAN_HAL_KEEP_ALIVE_REQ;
20536
20537#ifdef FEATURE_WLAN_SCAN_PNO
20538 case WDI_SET_PREF_NETWORK_REQ:
20539 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20540 case WDI_SET_RSSI_FILTER_REQ:
20541 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20542 case WDI_UPDATE_SCAN_PARAMS_REQ:
20543 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20544#endif // FEATURE_WLAN_SCAN_PNO
20545 case WDI_SET_TX_PER_TRACKING_REQ:
20546 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20547#ifdef WLAN_FEATURE_PACKET_FILTERING
20548 case WDI_8023_MULTICAST_LIST_REQ:
20549 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20550 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020551 return WLAN_HAL_SET_PACKET_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020552 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20553 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20554 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20555 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20556#endif // WLAN_FEATURE_PACKET_FILTERING
20557 case WDI_HAL_DUMP_CMD_REQ:
20558 return WLAN_HAL_DUMP_COMMAND_REQ;
20559#ifdef WLAN_FEATURE_GTK_OFFLOAD
20560 case WDI_GTK_OFFLOAD_REQ:
20561 return WLAN_HAL_GTK_OFFLOAD_REQ;
20562 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20563 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20564#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20565
20566 case WDI_INIT_SCAN_CON_REQ:
20567 return WLAN_HAL_INIT_SCAN_CON_REQ;
20568 case WDI_SET_POWER_PARAMS_REQ:
20569 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20570 case WDI_SET_TM_LEVEL_REQ:
20571 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20572 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20573 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020574#ifdef WLAN_FEATURE_11AC
20575 case WDI_UPDATE_VHT_OP_MODE_REQ:
20576 return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ;
20577#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020578 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020579 return WLAN_HAL_MSG_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020580 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020581
Jeff Johnson295189b2012-06-20 16:38:30 -070020582}/*WDI_2_HAL_REQ_TYPE*/
20583
20584/*Convert WDI response type into HAL response type*/
20585WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20586HAL_2_WDI_RSP_TYPE
20587(
20588 tHalHostMsgType halMsg
20589)
20590{
Jeff Johnsone7245742012-09-05 17:12:55 -070020591 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020592 the chances of getting inlined*/
20593 switch( halMsg )
20594 {
20595 case WLAN_HAL_START_RSP:
20596 return WDI_START_RESP;
20597 case WLAN_HAL_STOP_RSP:
20598 return WDI_STOP_RESP;
20599 case WLAN_HAL_INIT_SCAN_RSP:
20600 return WDI_INIT_SCAN_RESP;
20601 case WLAN_HAL_START_SCAN_RSP:
20602 return WDI_START_SCAN_RESP;
20603 case WLAN_HAL_END_SCAN_RSP:
20604 return WDI_END_SCAN_RESP;
20605 case WLAN_HAL_FINISH_SCAN_RSP:
20606 return WDI_FINISH_SCAN_RESP;
20607 case WLAN_HAL_CONFIG_STA_RSP:
20608 return WDI_CONFIG_STA_RESP;
20609 case WLAN_HAL_DELETE_STA_RSP:
20610 return WDI_DEL_STA_RESP;
20611 case WLAN_HAL_CONFIG_BSS_RSP:
20612 return WDI_CONFIG_BSS_RESP;
20613 case WLAN_HAL_DELETE_BSS_RSP:
20614 return WDI_DEL_BSS_RESP;
20615 case WLAN_HAL_JOIN_RSP:
20616 return WDI_JOIN_RESP;
20617 case WLAN_HAL_POST_ASSOC_RSP:
20618 return WDI_POST_ASSOC_RESP;
20619 case WLAN_HAL_SET_BSSKEY_RSP:
20620 return WDI_SET_BSS_KEY_RESP;
20621 case WLAN_HAL_SET_STAKEY_RSP:
20622 return WDI_SET_STA_KEY_RESP;
20623 case WLAN_HAL_RMV_BSSKEY_RSP:
20624 return WDI_RMV_BSS_KEY_RESP;
20625 case WLAN_HAL_RMV_STAKEY_RSP:
20626 return WDI_RMV_STA_KEY_RESP;
20627 case WLAN_HAL_SET_BCASTKEY_RSP:
20628 return WDI_SET_STA_BCAST_KEY_RESP;
20629 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20630 // return WDI_RMV_STA_BCAST_KEY_RESP;
20631 case WLAN_HAL_ADD_TS_RSP:
20632 return WDI_ADD_TS_RESP;
20633 case WLAN_HAL_DEL_TS_RSP:
20634 return WDI_DEL_TS_RESP;
20635 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20636 return WDI_UPD_EDCA_PRMS_RESP;
20637 case WLAN_HAL_ADD_BA_RSP:
20638 return WDI_ADD_BA_RESP;
20639 case WLAN_HAL_DEL_BA_RSP:
20640 return WDI_DEL_BA_RESP;
20641#ifdef FEATURE_WLAN_CCX
20642 case WLAN_HAL_TSM_STATS_RSP:
20643 return WDI_TSM_STATS_RESP;
20644#endif
20645 case WLAN_HAL_CH_SWITCH_RSP:
20646 return WDI_CH_SWITCH_RESP;
20647 case WLAN_HAL_SET_LINK_ST_RSP:
20648 return WDI_SET_LINK_ST_RESP;
20649 case WLAN_HAL_GET_STATS_RSP:
20650 return WDI_GET_STATS_RESP;
20651 case WLAN_HAL_UPDATE_CFG_RSP:
20652 return WDI_UPDATE_CFG_RESP;
20653 case WLAN_HAL_ADD_BA_SESSION_RSP:
20654 return WDI_ADD_BA_SESSION_RESP;
20655 case WLAN_HAL_TRIGGER_BA_RSP:
20656 return WDI_TRIGGER_BA_RESP;
20657 case WLAN_HAL_UPDATE_BEACON_RSP:
20658 return WDI_UPD_BCON_PRMS_RESP;
20659 case WLAN_HAL_SEND_BEACON_RSP:
20660 return WDI_SND_BCON_RESP;
20661 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20662 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20663 /*Indications*/
20664 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20665 return WDI_HAL_RSSI_NOTIFICATION_IND;
20666 case WLAN_HAL_MISSED_BEACON_IND:
20667 return WDI_HAL_MISSED_BEACON_IND;
20668 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20669 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20670 case WLAN_HAL_MIC_FAILURE_IND:
20671 return WDI_HAL_MIC_FAILURE_IND;
20672 case WLAN_HAL_FATAL_ERROR_IND:
20673 return WDI_HAL_FATAL_ERROR_IND;
20674 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20675 return WDI_HAL_DEL_STA_IND;
20676 case WLAN_HAL_COEX_IND:
20677 return WDI_HAL_COEX_IND;
20678 case WLAN_HAL_OTA_TX_COMPL_IND:
20679 return WDI_HAL_TX_COMPLETE_IND;
20680#ifdef WLAN_FEATURE_P2P
20681 case WLAN_HAL_P2P_NOA_ATTR_IND:
20682 return WDI_HAL_P2P_NOA_ATTR_IND;
20683#endif
20684 case WLAN_HAL_TX_PER_HIT_IND:
20685 return WDI_HAL_TX_PER_HIT_IND;
20686 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20687 return WDI_SET_MAX_TX_POWER_RESP;
20688#ifdef WLAN_FEATURE_P2P
20689 case WLAN_HAL_SET_P2P_GONOA_RSP:
20690 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20691#endif
20692 case WLAN_HAL_ENTER_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020693 return WDI_ENTER_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020694 case WLAN_HAL_EXIT_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020695 return WDI_EXIT_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020696 case WLAN_HAL_ENTER_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020697 return WDI_ENTER_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020698 case WLAN_HAL_EXIT_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020699 return WDI_EXIT_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020700 case WLAN_HAL_ENTER_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020701 return WDI_ENTER_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020702 case WLAN_HAL_EXIT_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020703 return WDI_EXIT_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020704 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020705 return WDI_SET_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020706 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020707 return WDI_UPDATE_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020708 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020709 return WDI_CONFIGURE_RXP_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020710 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20711 return WDI_SET_BEACON_FILTER_RESP;
20712 case WLAN_HAL_REM_BCN_FILTER_RSP:
20713 return WDI_REM_BEACON_FILTER_RESP;
20714 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20715 return WDI_SET_RSSI_THRESHOLDS_RESP;
20716 case WLAN_HAL_HOST_OFFLOAD_RSP:
20717 return WDI_HOST_OFFLOAD_RESP;
20718 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20719 return WDI_WOWL_ADD_BC_PTRN_RESP;
20720 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20721 return WDI_WOWL_DEL_BC_PTRN_RESP;
20722 case WLAN_HAL_ENTER_WOWL_RSP:
20723 return WDI_WOWL_ENTER_RESP;
20724 case WLAN_HAL_EXIT_WOWL_RSP:
20725 return WDI_WOWL_EXIT_RESP;
20726 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20727 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20728 case WLAN_HAL_DOWNLOAD_NV_RSP:
20729 return WDI_NV_DOWNLOAD_RESP;
20730 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20731 return WDI_FLUSH_AC_RESP;
20732 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20733 return WDI_BTAMP_EVENT_RESP;
20734#ifdef ANI_MANF_DIAG
20735 case WLAN_HAL_PROCESS_PTT_RSP:
20736 return WDI_FTM_CMD_RESP;
20737#endif /* ANI_MANF_DIAG */
20738 case WLAN_HAL_ADD_STA_SELF_RSP:
20739 return WDI_ADD_STA_SELF_RESP;
20740case WLAN_HAL_DEL_STA_SELF_RSP:
20741 return WDI_DEL_STA_SELF_RESP;
Jeff Johnsone7245742012-09-05 17:12:55 -070020742#ifdef FEATURE_OEM_DATA_SUPPORT
20743 case WLAN_HAL_START_OEM_DATA_RSP:
20744 return WDI_START_OEM_DATA_RESP;
20745#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020746 case WLAN_HAL_HOST_RESUME_RSP:
20747 return WDI_HOST_RESUME_RESP;
20748 case WLAN_HAL_KEEP_ALIVE_RSP:
20749 return WDI_KEEP_ALIVE_RESP;
20750#ifdef FEATURE_WLAN_SCAN_PNO
20751 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20752 return WDI_SET_PREF_NETWORK_RESP;
20753 case WLAN_HAL_SET_RSSI_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020754 return WDI_SET_RSSI_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020755 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20756 return WDI_UPDATE_SCAN_PARAMS_RESP;
20757 case WLAN_HAL_PREF_NETW_FOUND_IND:
20758 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20759#endif // FEATURE_WLAN_SCAN_PNO
20760 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20761 return WDI_SET_TX_PER_TRACKING_RESP;
20762#ifdef WLAN_FEATURE_PACKET_FILTERING
20763 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20764 return WDI_8023_MULTICAST_LIST_RESP;
20765 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20766 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20767 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20768 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20769 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20770 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20771#endif // WLAN_FEATURE_PACKET_FILTERING
20772
20773 case WLAN_HAL_DUMP_COMMAND_RSP:
20774 return WDI_HAL_DUMP_CMD_RESP;
20775 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20776 return WDI_SET_POWER_PARAMS_RESP;
20777#ifdef WLAN_FEATURE_VOWIFI_11R
20778 case WLAN_HAL_AGGR_ADD_TS_RSP:
20779 return WDI_AGGR_ADD_TS_RESP;
20780#endif
20781
20782#ifdef WLAN_FEATURE_GTK_OFFLOAD
20783 case WLAN_HAL_GTK_OFFLOAD_RSP:
20784 return WDI_GTK_OFFLOAD_RESP;
20785 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20786 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20787#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20788#ifdef WLAN_WAKEUP_EVENTS
20789 case WLAN_HAL_WAKE_REASON_IND:
20790 return WDI_HAL_WAKE_REASON_IND;
20791#endif // WLAN_WAKEUP_EVENTS
20792
20793 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20794 return WDI_SET_TM_LEVEL_RESP;
20795 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20796 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020797#ifdef WLAN_FEATURE_11AC
20798 case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP:
20799 return WDI_UPDATE_VHT_OP_MODE_RESP;
20800#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020801 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020802 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020803 }
20804
20805}/*HAL_2_WDI_RSP_TYPE*/
20806
20807
20808/*Convert WDI driver type into HAL driver type*/
20809WPT_STATIC WPT_INLINE tDriverType
20810WDI_2_HAL_DRV_TYPE
20811(
20812 WDI_DriverType wdiDriverType
20813)
20814{
Jeff Johnsone7245742012-09-05 17:12:55 -070020815 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020816 the chances of getting inlined*/
20817 switch( wdiDriverType )
20818 {
20819 case WDI_DRIVER_TYPE_PRODUCTION:
20820 return eDRIVER_TYPE_PRODUCTION;
20821 case WDI_DRIVER_TYPE_MFG:
20822 return eDRIVER_TYPE_MFG;
20823 case WDI_DRIVER_TYPE_DVT:
20824 return eDRIVER_TYPE_DVT;
20825 }
20826
Jeff Johnsone7245742012-09-05 17:12:55 -070020827 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020828}/*WDI_2_HAL_DRV_TYPE*/
20829
20830
20831/*Convert WDI stop reason into HAL stop reason*/
20832WPT_STATIC WPT_INLINE tHalStopType
20833WDI_2_HAL_STOP_REASON
20834(
20835 WDI_StopType wdiDriverType
20836)
20837{
Jeff Johnsone7245742012-09-05 17:12:55 -070020838 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020839 the chances of getting inlined*/
20840 switch( wdiDriverType )
20841 {
20842 case WDI_STOP_TYPE_SYS_RESET:
20843 return HAL_STOP_TYPE_SYS_RESET;
20844 case WDI_DRIVER_TYPE_MFG:
20845 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
20846 case WDI_STOP_TYPE_RF_KILL:
20847 return HAL_STOP_TYPE_RF_KILL;
20848 }
20849
Jeff Johnsone7245742012-09-05 17:12:55 -070020850 return HAL_STOP_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020851}/*WDI_2_HAL_STOP_REASON*/
20852
20853
20854/*Convert WDI scan mode type into HAL scan mode type*/
20855WPT_STATIC WPT_INLINE eHalSysMode
20856WDI_2_HAL_SCAN_MODE
20857(
20858 WDI_ScanMode wdiScanMode
20859)
20860{
Jeff Johnsone7245742012-09-05 17:12:55 -070020861 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020862 the chances of getting inlined*/
20863 switch( wdiScanMode )
20864 {
20865 case WDI_SCAN_MODE_NORMAL:
20866 return eHAL_SYS_MODE_NORMAL;
20867 case WDI_SCAN_MODE_LEARN:
20868 return eHAL_SYS_MODE_LEARN;
20869 case WDI_SCAN_MODE_SCAN:
20870 return eHAL_SYS_MODE_SCAN;
20871 case WDI_SCAN_MODE_PROMISC:
20872 return eHAL_SYS_MODE_PROMISC;
20873 case WDI_SCAN_MODE_SUSPEND_LINK:
20874 return eHAL_SYS_MODE_SUSPEND_LINK;
20875 }
20876
Jeff Johnsone7245742012-09-05 17:12:55 -070020877 return eHAL_SYS_MODE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020878}/*WDI_2_HAL_SCAN_MODE*/
20879
20880/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020881WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -070020882WDI_2_HAL_SEC_CH_OFFSET
20883(
20884 WDI_HTSecondaryChannelOffset wdiSecChOffset
20885)
20886{
Jeff Johnsone7245742012-09-05 17:12:55 -070020887 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020888 the chances of getting inlined*/
20889 switch( wdiSecChOffset )
20890 {
20891 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020892 return PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -070020893 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020894 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
Jeff Johnson295189b2012-06-20 16:38:30 -070020895 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
Jeff Johnsone7245742012-09-05 17:12:55 -070020896 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
20897#ifdef WLAN_FEATURE_11AC
20898 case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20899 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20900 case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20901 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20902 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20903 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20904 case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20905 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20906 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
20907 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20908 case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
20909 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
20910 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
20911 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
20912#endif
20913 default:
20914 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070020915 }
20916
Jeff Johnsone7245742012-09-05 17:12:55 -070020917 return PHY_CHANNEL_BONDING_STATE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020918}/*WDI_2_HAL_SEC_CH_OFFSET*/
20919
20920/*Convert WDI BSS type into HAL BSS type*/
20921WPT_STATIC WPT_INLINE tSirBssType
20922WDI_2_HAL_BSS_TYPE
20923(
20924 WDI_BssType wdiBSSType
20925)
20926{
Jeff Johnsone7245742012-09-05 17:12:55 -070020927 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020928 the chances of getting inlined*/
20929 switch( wdiBSSType )
20930 {
20931 case WDI_INFRASTRUCTURE_MODE:
20932 return eSIR_INFRASTRUCTURE_MODE;
20933 case WDI_INFRA_AP_MODE:
20934 return eSIR_INFRA_AP_MODE;
20935 case WDI_IBSS_MODE:
20936 return eSIR_IBSS_MODE;
20937 case WDI_BTAMP_STA_MODE:
20938 return eSIR_BTAMP_STA_MODE;
20939 case WDI_BTAMP_AP_MODE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020940 return eSIR_BTAMP_AP_MODE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020941 case WDI_BSS_AUTO_MODE:
20942 return eSIR_AUTO_MODE;
20943 }
20944
Jeff Johnsone7245742012-09-05 17:12:55 -070020945 return eSIR_DONOT_USE_BSS_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020946}/*WDI_2_HAL_BSS_TYPE*/
20947
20948/*Convert WDI NW type into HAL NW type*/
20949WPT_STATIC WPT_INLINE tSirNwType
20950WDI_2_HAL_NW_TYPE
20951(
20952 WDI_NwType wdiNWType
20953)
20954{
Jeff Johnsone7245742012-09-05 17:12:55 -070020955 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020956 the chances of getting inlined*/
20957 switch( wdiNWType )
20958 {
20959 case WDI_11A_NW_TYPE:
20960 return eSIR_11A_NW_TYPE;
20961 case WDI_11B_NW_TYPE:
20962 return eSIR_11B_NW_TYPE;
20963 case WDI_11G_NW_TYPE:
20964 return eSIR_11G_NW_TYPE;
20965 case WDI_11N_NW_TYPE:
20966 return eSIR_11N_NW_TYPE;
20967 }
20968
Jeff Johnsone7245742012-09-05 17:12:55 -070020969 return eSIR_DONOT_USE_NW_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020970}/*WDI_2_HAL_NW_TYPE*/
20971
20972/*Convert WDI chanel bonding type into HAL cb type*/
20973WPT_STATIC WPT_INLINE ePhyChanBondState
20974WDI_2_HAL_CB_STATE
20975(
20976 WDI_PhyChanBondState wdiCbState
20977)
20978{
Jeff Johnsone7245742012-09-05 17:12:55 -070020979 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020980 the chances of getting inlined*/
20981 switch ( wdiCbState )
20982 {
20983 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
20984 return PHY_SINGLE_CHANNEL_CENTERED;
20985 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
20986 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
20987 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
20988 return PHY_DOUBLE_CHANNEL_CENTERED;
20989 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
20990 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
Jeff Johnsone7245742012-09-05 17:12:55 -070020991#ifdef WLAN_FEATURE_11AC
20992 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20993 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20994 case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20995 return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
20996 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20997 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20998 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20999 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21000 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
21001 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
21002 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21003 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21004 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21005 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21006#endif
21007 case WDI_MAX_CB_STATE:
21008 default:
21009 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021010 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021011
Jeff Johnson295189b2012-06-20 16:38:30 -070021012 return PHY_CHANNEL_BONDING_STATE_MAX;
21013}/*WDI_2_HAL_CB_STATE*/
21014
21015/*Convert WDI chanel bonding type into HAL cb type*/
21016WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
21017WDI_2_HAL_HT_OPER_MODE
21018(
21019 WDI_HTOperatingMode wdiHTOperMode
21020)
21021{
Jeff Johnsone7245742012-09-05 17:12:55 -070021022 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021023 the chances of getting inlined*/
21024 switch ( wdiHTOperMode )
21025 {
21026 case WDI_HT_OP_MODE_PURE:
21027 return eSIR_HT_OP_MODE_PURE;
21028 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
21029 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
21030 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
21031 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
21032 case WDI_HT_OP_MODE_MIXED:
21033 return eSIR_HT_OP_MODE_MIXED;
21034 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021035
Jeff Johnson295189b2012-06-20 16:38:30 -070021036 return eSIR_HT_OP_MODE_MAX;
21037}/*WDI_2_HAL_HT_OPER_MODE*/
21038
21039/*Convert WDI mimo PS type into HAL mimo PS type*/
21040WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
21041WDI_2_HAL_MIMO_PS
21042(
21043 WDI_HTMIMOPowerSaveState wdiHTOperMode
21044)
21045{
Jeff Johnsone7245742012-09-05 17:12:55 -070021046 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021047 the chances of getting inlined*/
21048 switch ( wdiHTOperMode )
21049 {
21050 case WDI_HT_MIMO_PS_STATIC:
21051 return eSIR_HT_MIMO_PS_STATIC;
21052 case WDI_HT_MIMO_PS_DYNAMIC:
21053 return eSIR_HT_MIMO_PS_DYNAMIC;
21054 case WDI_HT_MIMO_PS_NA:
21055 return eSIR_HT_MIMO_PS_NA;
21056 case WDI_HT_MIMO_PS_NO_LIMIT:
21057 return eSIR_HT_MIMO_PS_NO_LIMIT;
21058 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021059
Jeff Johnson295189b2012-06-20 16:38:30 -070021060 return eSIR_HT_MIMO_PS_MAX;
21061}/*WDI_2_HAL_MIMO_PS*/
21062
21063/*Convert WDI ENC type into HAL ENC type*/
21064WPT_STATIC WPT_INLINE tAniEdType
21065WDI_2_HAL_ENC_TYPE
21066(
21067 WDI_EncryptType wdiEncType
21068)
21069{
Jeff Johnsone7245742012-09-05 17:12:55 -070021070 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021071 the chances of getting inlined*/
21072 switch ( wdiEncType )
21073 {
21074 case WDI_ENCR_NONE:
21075 return eSIR_ED_NONE;
21076
21077 case WDI_ENCR_WEP40:
21078 return eSIR_ED_WEP40;
21079
21080 case WDI_ENCR_WEP104:
21081 return eSIR_ED_WEP104;
21082
21083 case WDI_ENCR_TKIP:
21084 return eSIR_ED_TKIP;
21085
21086 case WDI_ENCR_CCMP:
21087 return eSIR_ED_CCMP;
21088
21089 case WDI_ENCR_AES_128_CMAC:
21090 return eSIR_ED_AES_128_CMAC;
21091#if defined(FEATURE_WLAN_WAPI)
21092 case WDI_ENCR_WPI:
21093 return eSIR_ED_WPI;
21094#endif
21095 default:
21096 return eSIR_ED_NOT_IMPLEMENTED;
21097 }
21098
21099}/*WDI_2_HAL_ENC_TYPE*/
21100
21101/*Convert WDI WEP type into HAL WEP type*/
21102WPT_STATIC WPT_INLINE tAniWepType
21103WDI_2_HAL_WEP_TYPE
21104(
21105 WDI_WepType wdiWEPType
21106)
21107{
Jeff Johnsone7245742012-09-05 17:12:55 -070021108 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021109 the chances of getting inlined*/
21110 switch ( wdiWEPType )
21111 {
21112 case WDI_WEP_STATIC:
21113 return eSIR_WEP_STATIC;
21114
21115 case WDI_WEP_DYNAMIC:
21116 return eSIR_WEP_DYNAMIC;
21117 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021118
Jeff Johnson295189b2012-06-20 16:38:30 -070021119 return eSIR_WEP_MAX;
21120}/*WDI_2_HAL_WEP_TYPE*/
21121
21122WPT_STATIC WPT_INLINE tSirLinkState
21123WDI_2_HAL_LINK_STATE
21124(
21125 WDI_LinkStateType wdiLinkState
21126)
21127{
Jeff Johnsone7245742012-09-05 17:12:55 -070021128 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021129 the chances of getting inlined*/
21130 switch ( wdiLinkState )
21131 {
21132 case WDI_LINK_IDLE_STATE:
21133 return eSIR_LINK_IDLE_STATE;
21134
21135 case WDI_LINK_PREASSOC_STATE:
21136 return eSIR_LINK_PREASSOC_STATE;
21137
21138 case WDI_LINK_POSTASSOC_STATE:
21139 return eSIR_LINK_POSTASSOC_STATE;
21140
21141 case WDI_LINK_AP_STATE:
21142 return eSIR_LINK_AP_STATE;
21143
21144 case WDI_LINK_IBSS_STATE:
21145 return eSIR_LINK_IBSS_STATE;
21146
21147 case WDI_LINK_BTAMP_PREASSOC_STATE:
21148 return eSIR_LINK_BTAMP_PREASSOC_STATE;
21149
21150 case WDI_LINK_BTAMP_POSTASSOC_STATE:
21151 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
21152
21153 case WDI_LINK_BTAMP_AP_STATE:
21154 return eSIR_LINK_BTAMP_AP_STATE;
21155
21156 case WDI_LINK_BTAMP_STA_STATE:
21157 return eSIR_LINK_BTAMP_STA_STATE;
21158
21159 case WDI_LINK_LEARN_STATE:
21160 return eSIR_LINK_LEARN_STATE;
21161
21162 case WDI_LINK_SCAN_STATE:
21163 return eSIR_LINK_SCAN_STATE;
21164
21165 case WDI_LINK_FINISH_SCAN_STATE:
21166 return eSIR_LINK_FINISH_SCAN_STATE;
21167
21168 case WDI_LINK_INIT_CAL_STATE:
21169 return eSIR_LINK_INIT_CAL_STATE;
21170
21171 case WDI_LINK_FINISH_CAL_STATE:
21172 return eSIR_LINK_FINISH_CAL_STATE;
21173
21174#ifdef WLAN_FEATURE_P2P
21175 case WDI_LINK_LISTEN_STATE:
21176 return eSIR_LINK_LISTEN_STATE;
21177#endif
21178
21179 default:
21180 return eSIR_LINK_MAX;
Jeff Johnsone7245742012-09-05 17:12:55 -070021181 }
Jeff Johnson295189b2012-06-20 16:38:30 -070021182}
21183
Jeff Johnsone7245742012-09-05 17:12:55 -070021184/*Translate a STA Context from WDI into HAL*/
21185WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -070021186void
21187WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -070021188(
Jeff Johnson295189b2012-06-20 16:38:30 -070021189 tConfigStaParams* phalConfigSta,
21190 WDI_ConfigStaReqInfoType* pwdiConfigSta
21191)
21192{
21193 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070021194#ifdef WLAN_FEATURE_11AC
21195 /* Get the Version 1 Handler */
21196 tConfigStaParams_V1* phalConfigSta_V1 = NULL;
21197 if (WDI_getFwWlanFeatCaps(DOT11AC))
21198 {
21199 phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta;
21200 }
21201#endif
21202 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021203 the chances of getting inlined*/
21204
Jeff Johnsone7245742012-09-05 17:12:55 -070021205 wpalMemoryCopy(phalConfigSta->bssId,
21206 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
21207
21208 wpalMemoryCopy(phalConfigSta->staMac,
21209 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070021210
21211 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
21212 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
21213 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
21214 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
21215 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
21216 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
21217 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
21218 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
21219 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
21220 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
21221 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
21222 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
21223 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
21224 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
21225 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
21226 phalConfigSta->action = pwdiConfigSta->wdiAction;
21227 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
21228 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
21229 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
21230 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
21231 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
21232 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
21233 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
Jeff Johnsone7245742012-09-05 17:12:55 -070021234
Jeff Johnson295189b2012-06-20 16:38:30 -070021235 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
21236
Jeff Johnsone7245742012-09-05 17:12:55 -070021237 phalConfigSta->supportedRates.opRateMode =
Jeff Johnson295189b2012-06-20 16:38:30 -070021238 pwdiConfigSta->wdiSupportedRates.opRateMode;
21239 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
21240 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021241 phalConfigSta->supportedRates.llbRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021242 pwdiConfigSta->wdiSupportedRates.llbRates[i];
21243 }
21244 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
21245 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021246 phalConfigSta->supportedRates.llaRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021247 pwdiConfigSta->wdiSupportedRates.llaRates[i];
21248 }
21249 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
21250 {
21251 phalConfigSta->supportedRates.aniLegacyRates[i] =
21252 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
21253 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021254 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070021255 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
21256 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
21257 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021258 phalConfigSta->supportedRates.supportedMCSSet[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021259 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
21260 }
21261 phalConfigSta->supportedRates.rxHighestDataRate =
21262 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
21263
Jeff Johnsone7245742012-09-05 17:12:55 -070021264#ifdef WLAN_FEATURE_11AC
21265 if(phalConfigSta_V1 != NULL)
21266 {
21267 phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap;
21268 phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate;
21269 phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap;
21270 phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate;
21271 }
21272#endif
21273
Jeff Johnson295189b2012-06-20 16:38:30 -070021274#ifdef WLAN_FEATURE_P2P
21275 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
21276#endif
21277
Jeff Johnsone7245742012-09-05 17:12:55 -070021278#ifdef WLAN_FEATURE_11AC
21279 if(phalConfigSta_V1 != NULL)
21280 {
21281 phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta;
21282 phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet;
21283 }
21284#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021285}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
Jeff Johnsone7245742012-09-05 17:12:55 -070021286
21287/*Translate a Rate set info from WDI into HAL*/
21288WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070021289WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -070021290(
Jeff Johnson295189b2012-06-20 16:38:30 -070021291 tSirMacRateSet* pHalRateSet,
21292 WDI_RateSet* pwdiRateSet
21293)
21294{
Jeff Johnsone7245742012-09-05 17:12:55 -070021295 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070021296 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21297
21298 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
21299 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
21300
21301 for ( i = 0; i < pHalRateSet->numRates; i++ )
21302 {
21303 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
21304 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021305
Jeff Johnson295189b2012-06-20 16:38:30 -070021306}/*WDI_CopyWDIRateSetToHALRateSet*/
21307
21308
21309/*Translate an EDCA Parameter Record from WDI into HAL*/
21310WPT_STATIC WPT_INLINE void
21311WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -070021312(
Jeff Johnson295189b2012-06-20 16:38:30 -070021313 tSirMacEdcaParamRecord* phalEdcaParam,
21314 WDI_EdcaParamRecord* pWDIEdcaParam
21315)
21316{
Jeff Johnsone7245742012-09-05 17:12:55 -070021317 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021318 the chances of getting inlined*/
21319
21320 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
21321 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
21322 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
21323 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
21324
21325 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
21326 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
21327 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
21328}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
21329
21330
21331/*Copy a management frame header from WDI fmt into HAL fmt*/
21332WPT_STATIC WPT_INLINE void
21333WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
21334(
21335 tSirMacMgmtHdr* pmacMgmtHdr,
21336 WDI_MacMgmtHdr* pwdiMacMgmtHdr
21337)
21338{
21339 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
21340 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
21341 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
21342 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
21343 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
21344 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
21345 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
21346 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
21347 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
21348 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
21349 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
21350
21351 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
21352 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
21353
Jeff Johnsone7245742012-09-05 17:12:55 -070021354 wpalMemoryCopy(pmacMgmtHdr->da,
Jeff Johnson295189b2012-06-20 16:38:30 -070021355 pwdiMacMgmtHdr->da, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021356 wpalMemoryCopy(pmacMgmtHdr->sa,
Jeff Johnson295189b2012-06-20 16:38:30 -070021357 pwdiMacMgmtHdr->sa, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021358 wpalMemoryCopy(pmacMgmtHdr->bssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070021359 pwdiMacMgmtHdr->bssId, 6);
21360
21361 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
21362 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
21363 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
21364
21365}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
21366
21367
21368/*Copy config bss parameters from WDI fmt into HAL fmt*/
21369WPT_STATIC WPT_INLINE void
21370WDI_CopyWDIConfigBSSToHALConfigBSS
21371(
21372 tConfigBssParams* phalConfigBSS,
21373 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
21374)
21375{
21376
21377 wpt_uint8 keyIndex = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070021378#ifdef WLAN_FEATURE_11AC
21379 /* Get the Version 1 Handler */
21380 tConfigBssParams_V1* phalConfigBSS_V1 = NULL;
21381 if (WDI_getFwWlanFeatCaps(DOT11AC))
21382 phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS;
21383#endif
21384
Jeff Johnson295189b2012-06-20 16:38:30 -070021385 wpalMemoryCopy( phalConfigBSS->bssId,
21386 pwdiConfigBSS->macBSSID,
21387 WDI_MAC_ADDR_LEN);
21388
21389#ifdef HAL_SELF_STA_PER_BSS
21390 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
21391 pwdiConfigBSS->macSelfAddr,
21392 WDI_MAC_ADDR_LEN);
21393#endif
21394
21395 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
21396
21397 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
21398 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
21399
Jeff Johnsone7245742012-09-05 17:12:55 -070021400 phalConfigBSS->shortSlotTimeSupported =
Jeff Johnson295189b2012-06-20 16:38:30 -070021401 pwdiConfigBSS->ucShortSlotTimeSupported;
21402 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
21403 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
21404 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
21405 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
21406 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070021407 phalConfigBSS->fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070021408 pwdiConfigBSS->ucTXOPProtectionFullSupport;
21409 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
21410 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
21411 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
21412 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
21413 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
21414 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
21415 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
21416 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
21417 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
21418 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
21419
Jeff Johnsone7245742012-09-05 17:12:55 -070021420 phalConfigBSS->htOperMode =
21421 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
Jeff Johnson295189b2012-06-20 16:38:30 -070021422
21423 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
21424 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
21425 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
21426 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
21427
21428#ifdef WLAN_FEATURE_VOWIFI
21429 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21430#endif
21431
21432 /*! Used 32 as magic number because that is how the ssid is declared inside the
21433 hal header - hal needs a macro for it */
Jeff Johnsone7245742012-09-05 17:12:55 -070021434 phalConfigBSS->ssId.length =
Jeff Johnson295189b2012-06-20 16:38:30 -070021435 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21436 pwdiConfigBSS->wdiSSID.ucLength : 32;
21437 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070021438 pwdiConfigBSS->wdiSSID.sSSID,
21439 phalConfigBSS->ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070021440
21441 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21442 &pwdiConfigBSS->wdiSTAContext);
Jeff Johnsone7245742012-09-05 17:12:55 -070021443
Jeff Johnson295189b2012-06-20 16:38:30 -070021444 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21445 &pwdiConfigBSS->wdiRateSet);
21446
21447 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21448
21449 if(phalConfigBSS->edcaParamsValid)
21450 {
21451 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21452 &pwdiConfigBSS->wdiBEEDCAParams);
21453 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21454 &pwdiConfigBSS->wdiBKEDCAParams);
21455 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21456 &pwdiConfigBSS->wdiVIEDCAParams);
21457 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21458 &pwdiConfigBSS->wdiVOEDCAParams);
21459 }
21460
Jeff Johnsone7245742012-09-05 17:12:55 -070021461 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
Jeff Johnson295189b2012-06-20 16:38:30 -070021462
21463 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21464
21465#ifdef WLAN_FEATURE_VOWIFI_11R
21466
Jeff Johnsone7245742012-09-05 17:12:55 -070021467 phalConfigBSS->extSetStaKeyParamValid =
Jeff Johnson295189b2012-06-20 16:38:30 -070021468 pwdiConfigBSS->bExtSetStaKeyParamValid;
Jeff Johnsone7245742012-09-05 17:12:55 -070021469
Jeff Johnson295189b2012-06-20 16:38:30 -070021470 if( phalConfigBSS->extSetStaKeyParamValid )
21471 {
21472 /*-----------------------------------------------------------------------
21473 Copy the STA Key parameters into the HAL message
21474 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021475 phalConfigBSS->extSetStaKeyParam.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021476 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21477
Jeff Johnsone7245742012-09-05 17:12:55 -070021478 phalConfigBSS->extSetStaKeyParam.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021479 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21480
21481 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21482
21483 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21484
21485 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21486
21487#ifdef WLAN_SOFTAP_FEATURE
21488 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21489 keyIndex++)
21490 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021491 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021492 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21493 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21494 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21495 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21496 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21497 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021498 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021499 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021500 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021501 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021502 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021503 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21504 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021505 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021506 WDI_MAX_KEY_LENGTH);
21507 }
21508#else
Jeff Johnsone7245742012-09-05 17:12:55 -070021509 phalConfigBSS->extSetStaKeyParam.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021510 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21511 phalConfigBSS->extSetStaKeyParam.key.unicast =
21512 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21513 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21514 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21515 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021516 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021517 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021518 phalConfigBSS->extSetStaKeyParam.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021519 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021520 phalConfigBSS->extSetStaKeyParam.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021521 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21522 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021523 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021524 WDI_MAX_KEY_LENGTH);
21525#endif
21526 }
21527 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21528 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021529 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070021530 sizeof(phalConfigBSS->extSetStaKeyParam) );
21531 }
21532
21533#endif /*WLAN_FEATURE_VOWIFI_11R*/
21534
Jeff Johnsone7245742012-09-05 17:12:55 -070021535#ifdef WLAN_FEATURE_11AC
21536 if(phalConfigBSS_V1 != NULL)
21537 {
21538 phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta;
21539 phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet;
21540 }
21541#endif
21542
Jeff Johnson295189b2012-06-20 16:38:30 -070021543}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21544
21545
Jeff Johnsone7245742012-09-05 17:12:55 -070021546/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -070021547 pointed to by user data */
21548WPT_STATIC WPT_INLINE void
21549WDI_ExtractRequestCBFromEvent
21550(
21551 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -070021552 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -070021553 void** ppUserData
21554)
21555{
21556 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21557 switch ( pEvent->wdiRequest )
21558 {
21559 case WDI_START_REQ:
21560 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21561 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21562 break;
21563 case WDI_STOP_REQ:
21564 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21565 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21566 break;
21567 case WDI_INIT_SCAN_REQ:
21568 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21569 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21570 break;
21571 case WDI_START_SCAN_REQ:
21572 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21573 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21574 break;
21575 case WDI_END_SCAN_REQ:
21576 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21577 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21578 break;
21579 case WDI_FINISH_SCAN_REQ:
21580 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21581 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21582 break;
21583 case WDI_JOIN_REQ:
21584 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21585 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21586 break;
21587 case WDI_CONFIG_BSS_REQ:
21588 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21589 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21590 break;
21591 case WDI_DEL_BSS_REQ:
21592 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21593 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21594 break;
21595 case WDI_POST_ASSOC_REQ:
21596 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21597 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21598 break;
21599 case WDI_DEL_STA_REQ:
21600 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21601 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21602 break;
21603 case WDI_DEL_STA_SELF_REQ:
21604 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21605 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21606 break;
21607
21608 case WDI_SET_BSS_KEY_REQ:
21609 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21610 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21611 break;
21612 case WDI_RMV_BSS_KEY_REQ:
21613 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21614 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21615 break;
21616 case WDI_SET_STA_KEY_REQ:
21617 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21618 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21619 break;
21620 case WDI_RMV_STA_KEY_REQ:
21621 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21622 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21623 break;
21624 case WDI_ADD_TS_REQ:
21625 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21626 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21627 break;
21628 case WDI_DEL_TS_REQ:
21629 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21630 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21631 break;
21632 case WDI_UPD_EDCA_PRMS_REQ:
21633 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21634 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21635 break;
21636 case WDI_ADD_BA_SESSION_REQ:
21637 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21638 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21639 break;
21640 case WDI_DEL_BA_REQ:
21641 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21642 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21643 break;
21644#ifdef FEATURE_WLAN_CCX
21645 case WDI_TSM_STATS_REQ:
21646 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21647 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21648 break;
21649#endif
21650 case WDI_CH_SWITCH_REQ:
21651 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21652 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21653 break;
21654 case WDI_CONFIG_STA_REQ:
21655 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21656 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21657 break;
21658 case WDI_SET_LINK_ST_REQ:
21659 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21660 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21661 break;
21662 case WDI_GET_STATS_REQ:
21663 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21664 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21665 break;
21666 case WDI_UPDATE_CFG_REQ:
21667 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21668 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21669 break;
21670 case WDI_ADD_BA_REQ:
21671 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21672 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21673 break;
21674 case WDI_TRIGGER_BA_REQ:
21675 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21676 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21677 break;
21678 case WDI_UPD_BCON_PRMS_REQ:
21679 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21680 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21681 break;
21682 case WDI_SND_BCON_REQ:
21683 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21684 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21685 break;
21686 case WDI_ENTER_BMPS_REQ:
21687 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21688 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21689 break;
21690 case WDI_EXIT_BMPS_REQ:
21691 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21692 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21693 break;
21694 case WDI_ENTER_UAPSD_REQ:
21695 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21696 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21697 break;
21698 case WDI_UPDATE_UAPSD_PARAM_REQ:
21699 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21700 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21701 break;
21702 case WDI_CONFIGURE_RXP_FILTER_REQ:
21703 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21704 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21705 break;
21706 case WDI_SET_BEACON_FILTER_REQ:
21707 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21708 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21709 break;
21710 case WDI_REM_BEACON_FILTER_REQ:
21711 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21712 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070021713 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021714 case WDI_SET_RSSI_THRESHOLDS_REQ:
21715 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21716 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21717 break;
21718 case WDI_HOST_OFFLOAD_REQ:
21719 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21720 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21721 break;
21722 case WDI_WOWL_ADD_BC_PTRN_REQ:
21723 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21724 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21725 break;
21726 case WDI_WOWL_DEL_BC_PTRN_REQ:
21727 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21728 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21729 break;
21730 case WDI_WOWL_ENTER_REQ:
21731 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21732 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21733 break;
21734 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21735 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21736 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21737 break;
21738 case WDI_FLUSH_AC_REQ:
21739 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21740 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21741 break;
21742 case WDI_BTAMP_EVENT_REQ:
21743 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21744 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21745 break;
21746 case WDI_KEEP_ALIVE_REQ:
21747 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21748 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21749 break;
21750 case WDI_SET_TX_PER_TRACKING_REQ:
21751 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21752 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21753 default:
21754 *ppfnReqCB = NULL;
21755 *ppUserData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070021756 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021757 }
21758}/*WDI_ExtractRequestCBFromEvent*/
21759
21760
21761/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021762 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
Jeff Johnson295189b2012-06-20 16:38:30 -070021763 frame xtl is enabled for a particular STA.
21764
21765 WDI_PostAssocReq must have been called.
21766
Jeff Johnsone7245742012-09-05 17:12:55 -070021767 @param uSTAIdx: STA index
21768
Jeff Johnson295189b2012-06-20 16:38:30 -070021769 @see WDI_PostAssocReq
21770 @return Result of the function call
21771*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021772wpt_boolean
Jeff Johnson295189b2012-06-20 16:38:30 -070021773WDI_IsHwFrameTxTranslationCapable
21774(
21775 wpt_uint8 uSTAIdx
21776)
21777{
Jeff Johnsone7245742012-09-05 17:12:55 -070021778 /*!! FIX ME - this must eventually be per station - for now just feedback
Jeff Johnson295189b2012-06-20 16:38:30 -070021779 uma value*/
21780 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021781 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021782 ------------------------------------------------------------------------*/
21783 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21784 {
21785 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21786 "WDI API call before module is initialized - Fail request");
21787
Jeff Johnsone7245742012-09-05 17:12:55 -070021788 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021789 }
21790
Jeff Johnsone7245742012-09-05 17:12:55 -070021791
Jeff Johnson295189b2012-06-20 16:38:30 -070021792 return gWDICb.bFrameTransEnabled;
21793}/*WDI_IsHwFrameTxTranslationCapable*/
21794
21795#ifdef FEATURE_WLAN_SCAN_PNO
21796/**
21797 @brief WDI_SetPreferredNetworkList
21798
Jeff Johnsone7245742012-09-05 17:12:55 -070021799 @param pwdiPNOScanReqParams: the Set PNO as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021800 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021801
Jeff Johnson295189b2012-06-20 16:38:30 -070021802 wdiPNOScanCb: callback for passing back the response
21803 of the Set PNO operation received from the
21804 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021805
Jeff Johnson295189b2012-06-20 16:38:30 -070021806 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021807 callback
21808
Jeff Johnson295189b2012-06-20 16:38:30 -070021809 @return Result of the function call
21810*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021811WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021812WDI_SetPreferredNetworkReq
21813(
21814 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21815 WDI_PNOScanCb wdiPNOScanCb,
21816 void* pUserData
21817)
21818{
21819 WDI_EventInfoType wdiEventData = {{0}};
21820 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21821
21822 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021823 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021824 ------------------------------------------------------------------------*/
21825 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21826 {
21827 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21828 "WDI API call before module is initialized - Fail request");
21829
Jeff Johnsone7245742012-09-05 17:12:55 -070021830 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021831 }
21832
21833 /*------------------------------------------------------------------------
21834 Fill in Event data and post to the Main FSM
21835 ------------------------------------------------------------------------*/
21836 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021837 wdiEventData.pEventData = pwdiPNOScanReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021838 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021839 wdiEventData.pCBfnc = wdiPNOScanCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021840 wdiEventData.pUserData = pUserData;
21841
21842 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21843}
21844
21845
21846/**
21847 @brief WDI_SetRssiFilterReq
21848
Jeff Johnsone7245742012-09-05 17:12:55 -070021849 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
Jeff Johnson295189b2012-06-20 16:38:30 -070021850 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021851
Jeff Johnson295189b2012-06-20 16:38:30 -070021852 wdiRssiFilterCb: callback for passing back the response
21853 of the Set RSSI Filter operation received from the
21854 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021855
Jeff Johnson295189b2012-06-20 16:38:30 -070021856 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021857 callback
21858
Jeff Johnson295189b2012-06-20 16:38:30 -070021859 @return Result of the function call
21860*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021861WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021862WDI_SetRssiFilterReq
21863(
21864 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
21865 WDI_RssiFilterCb wdiRssiFilterCb,
21866 void* pUserData
21867)
21868{
21869 WDI_EventInfoType wdiEventData = {{0}};
21870 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21871
21872 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021873 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021874 ------------------------------------------------------------------------*/
21875 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21876 {
21877 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21878 "WDI API call before module is initialized - Fail request");
21879
Jeff Johnsone7245742012-09-05 17:12:55 -070021880 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021881 }
21882
21883 /*------------------------------------------------------------------------
21884 Fill in Event data and post to the Main FSM
21885 ------------------------------------------------------------------------*/
21886 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021887 wdiEventData.pEventData = pwdiRssiFilterReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021888 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021889 wdiEventData.pCBfnc = wdiRssiFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021890 wdiEventData.pUserData = pUserData;
21891
21892 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21893}/*WDI_SetRssiFilterReq*/
21894
21895/**
21896 @brief WDI_UpdateScanParamsReq
21897
Jeff Johnsone7245742012-09-05 17:12:55 -070021898 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021899 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021900
Jeff Johnson295189b2012-06-20 16:38:30 -070021901 wdiUpdateScanParamsCb: callback for passing back the response
21902 of the Set PNO operation received from the
21903 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021904
Jeff Johnson295189b2012-06-20 16:38:30 -070021905 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021906 callback
21907
Jeff Johnson295189b2012-06-20 16:38:30 -070021908 @return Result of the function call
21909*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021910WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021911WDI_UpdateScanParamsReq
21912(
21913 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
21914 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
21915 void* pUserData
21916)
21917{
21918 WDI_EventInfoType wdiEventData = {{0}};
21919 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21920
21921 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021922 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021923 ------------------------------------------------------------------------*/
21924 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21925 {
21926 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21927 "WDI API call before module is initialized - Fail request");
21928
Jeff Johnsone7245742012-09-05 17:12:55 -070021929 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021930 }
21931
21932 /*------------------------------------------------------------------------
21933 Fill in Event data and post to the Main FSM
21934 ------------------------------------------------------------------------*/
21935 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021936 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
Jeff Johnson295189b2012-06-20 16:38:30 -070021937 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
Jeff Johnsone7245742012-09-05 17:12:55 -070021938 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021939 wdiEventData.pUserData = pUserData;
21940
21941 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21942}
21943
21944/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021945 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070021946 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070021947
21948 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070021949 pwdiPNOScanReqParams: pointer to the info received
21950 from upper layers
21951 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070021952 and its size
21953
Jeff Johnson295189b2012-06-20 16:38:30 -070021954 @return Result of the function call
21955*/
21956
21957WDI_Status
21958WDI_PackPreferredNetworkList
21959(
21960 WDI_ControlBlockType* pWDICtx,
21961 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21962 wpt_uint8** ppSendBuffer,
21963 wpt_uint16* pSize
21964)
21965{
Jeff Johnsone7245742012-09-05 17:12:55 -070021966 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070021967 wpt_uint16 usDataOffset = 0;
21968 wpt_uint16 usSendSize = 0;
21969 tPrefNetwListParams pPrefNetwListParams = {0};
21970 wpt_uint8 i;
21971 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21972
21973 /*-----------------------------------------------------------------------
21974 Get message buffer
21975 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021976 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070021977 sizeof(pPrefNetwListParams),
21978 &pSendBuffer, &usDataOffset, &usSendSize))||
21979 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21980 {
21981 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21982 "Unable to get send buffer in Set PNO req %x ",
21983 pwdiPNOScanReqParams);
21984 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070021985 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021986 }
21987
21988 /*-------------------------------------------------------------------------
21989 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21990 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021991 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070021992 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070021993 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070021994 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21995
Jeff Johnsone7245742012-09-05 17:12:55 -070021996 pPrefNetwListParams.ucNetworksCount =
21997 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070021998 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070021999 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022000 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22001
22002 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022003 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022004 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22005 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22006 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22007
22008 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22009 {
22010 /*SSID of the BSS*/
22011 pPrefNetwListParams.aNetworks[i].ssId.length
22012 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22013
22014 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22015 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22016 pPrefNetwListParams.aNetworks[i].ssId.length);
22017
22018 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022019 pPrefNetwListParams.aNetworks[i].authentication =
22020 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022021
22022 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022023 pPrefNetwListParams.aNetworks[i].encryption =
22024 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022025
Jeff Johnsone7245742012-09-05 17:12:55 -070022026 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022027 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022028 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022029 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22030
22031 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22032 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22033 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22034
22035 /*Indicates the RSSI threshold for the network to be considered*/
22036 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22037 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22038
22039 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022040 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022041 pPrefNetwListParams.aNetworks[i].ssId.length,
22042 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22043 }
22044
Jeff Johnsone7245742012-09-05 17:12:55 -070022045 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22046 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022047 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22048 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22049 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22050
22051 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022052 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022053 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22054 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22055 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22056
22057 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22058 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022059 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022060 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022061 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022062 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22063 }
22064
22065 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022066 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022067 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22068 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22069 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022070 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022071
Jeff Johnsone7245742012-09-05 17:12:55 -070022072 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22073 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22074 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022075
Jeff Johnsone7245742012-09-05 17:12:55 -070022076 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022077 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22078 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22079 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022080 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022081
Jeff Johnsone7245742012-09-05 17:12:55 -070022082 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22083 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22084 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022085
22086 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022087 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22088 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022089
22090 /*Set the output values*/
22091 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022092 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022093
22094 return WDI_STATUS_SUCCESS;
22095}/*WDI_PackPreferredNetworkList*/
22096
22097/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022098 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022099 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022100
22101 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022102 pwdiPNOScanReqParams: pointer to the info received
22103 from upper layers
22104 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022105 and its size
22106
Jeff Johnson295189b2012-06-20 16:38:30 -070022107 @return Result of the function call
22108*/
22109
22110WDI_Status
22111WDI_PackPreferredNetworkListNew
22112(
22113 WDI_ControlBlockType* pWDICtx,
22114 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22115 wpt_uint8** ppSendBuffer,
22116 wpt_uint16* pSize
22117)
22118{
Jeff Johnsone7245742012-09-05 17:12:55 -070022119 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022120 wpt_uint16 usDataOffset = 0;
22121 wpt_uint16 usSendSize = 0;
22122 tPrefNetwListParamsNew pPrefNetwListParams;
22123 wpt_uint8 i;
22124 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
22125
22126 /*-----------------------------------------------------------------------
22127 Get message buffer
22128 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022129 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022130 sizeof(pPrefNetwListParams),
22131 &pSendBuffer, &usDataOffset, &usSendSize))||
22132 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
22133 {
22134 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22135 "Unable to get send buffer in Set PNO req %x ",
22136 pwdiPNOScanReqParams);
22137 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022138 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022139 }
22140
22141 /*-------------------------------------------------------------------------
22142 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22143 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022144 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022145 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070022146 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022147 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22148
Jeff Johnsone7245742012-09-05 17:12:55 -070022149 pPrefNetwListParams.ucNetworksCount =
22150 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022151 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022152 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022153 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22154
22155 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022156 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022157 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22158 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22159 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22160
22161 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22162 {
22163 /*SSID of the BSS*/
22164 pPrefNetwListParams.aNetworks[i].ssId.length
22165 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22166
22167 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22168 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22169 pPrefNetwListParams.aNetworks[i].ssId.length);
22170
22171 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022172 pPrefNetwListParams.aNetworks[i].authentication =
22173 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022174
22175 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022176 pPrefNetwListParams.aNetworks[i].encryption =
22177 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022178
22179 /*SSID bcast type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022180 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
22181 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022182
Jeff Johnsone7245742012-09-05 17:12:55 -070022183 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022184 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022185 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022186 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22187
22188 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22189 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22190 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22191
22192 /*Indicates the RSSI threshold for the network to be considered*/
22193 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22194 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22195
22196 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022197 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022198 pPrefNetwListParams.aNetworks[i].ssId.length,
22199 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22200 }
22201
Jeff Johnsone7245742012-09-05 17:12:55 -070022202 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22203 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022204 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22205 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22206 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22207
22208 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022209 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022210 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22211 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22212 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22213
22214 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22215 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022216 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022217 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022218 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022219 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22220 }
22221
22222 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022223 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022224 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22225 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22226 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022227 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022228
Jeff Johnsone7245742012-09-05 17:12:55 -070022229 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22230 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22231 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022232
Jeff Johnsone7245742012-09-05 17:12:55 -070022233 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022234 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22235 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22236 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022237 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022238
Jeff Johnsone7245742012-09-05 17:12:55 -070022239 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22240 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22241 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022242
22243 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022244 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22245 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022246
22247 /*Set the output values*/
22248 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022249 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022250
22251 return WDI_STATUS_SUCCESS;
22252}/*WDI_PackPreferredNetworkListNew*/
22253
22254/**
22255 @brief Process Set Preferred Network List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022256
22257 @param pWDICtx: pointer to the WLAN DAL context
22258 pEventData: pointer to the event information structure
22259
Jeff Johnson295189b2012-06-20 16:38:30 -070022260 @return Result of the function call
22261*/
22262WDI_Status
22263WDI_ProcessSetPreferredNetworkReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022264(
Jeff Johnson295189b2012-06-20 16:38:30 -070022265 WDI_ControlBlockType* pWDICtx,
22266 WDI_EventInfoType* pEventData
22267)
22268{
22269 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
22270 WDI_PNOScanCb wdiPNOScanCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022271 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022272 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070022273 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022274
22275 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022276 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022277 -------------------------------------------------------------------------*/
22278 if (( NULL == pEventData ) ||
22279 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
22280 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
22281 {
22282 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22283 "%s: Invalid parameters", __FUNCTION__);
22284 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022285 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022286 }
22287
22288 /*-------------------------------------------------------------------------
22289 Pack the PNO request structure based on version
22290 -------------------------------------------------------------------------*/
22291 if ( pWDICtx->wdiPNOVersion > 0 )
22292 {
22293 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022294 "%s: PNO new version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022295 pWDICtx->wdiPNOVersion);
22296
22297 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
22298 &pSendBuffer, &usSendSize);
22299 }
22300 else
22301 {
22302 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022303 "%s: PNO old version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022304 pWDICtx->wdiPNOVersion);
22305
22306 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
22307 &pSendBuffer, &usSendSize);
22308 }
22309
22310 if (( WDI_STATUS_SUCCESS != wdiStatus )||
22311 ( NULL == pSendBuffer )||( 0 == usSendSize ))
22312 {
22313 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22314 "%s: failed to pack request parameters", __FUNCTION__);
22315 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022316 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022317 }
22318
22319 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022320 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022321
22322 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022323 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022324 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022325 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22326 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022327}
22328
22329/**
22330 @brief Process Set RSSI Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022331
22332 @param pWDICtx: pointer to the WLAN DAL context
22333 pEventData: pointer to the event information structure
22334
Jeff Johnson295189b2012-06-20 16:38:30 -070022335 @see
22336 @return Result of the function call
22337*/
22338WDI_Status
22339WDI_ProcessSetRssiFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022340(
Jeff Johnson295189b2012-06-20 16:38:30 -070022341 WDI_ControlBlockType* pWDICtx,
22342 WDI_EventInfoType* pEventData
22343)
22344{
22345 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
22346 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022347 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022348 wpt_uint16 usDataOffset = 0;
22349 wpt_uint16 usSendSize = 0;
22350 wpt_uint8 ucRssiThreshold;
22351
22352 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022353 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022354 -------------------------------------------------------------------------*/
22355 if (( NULL == pEventData ) ||
22356 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
22357 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
22358 {
22359 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22360 "%s: Invalid parameters", __FUNCTION__);
22361 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022362 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022363 }
22364
22365 /*-----------------------------------------------------------------------
22366 Get message buffer
22367 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022368 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022369 sizeof(ucRssiThreshold),
22370 &pSendBuffer, &usDataOffset, &usSendSize))||
22371 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
22372 {
22373 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22374 "Unable to get send buffer in Set PNO req %x %x %x",
22375 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
22376 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022377 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022378 }
22379
22380 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
22381
Jeff Johnsone7245742012-09-05 17:12:55 -070022382 wpalMemoryCopy( pSendBuffer+usDataOffset,
22383 &ucRssiThreshold,
22384 sizeof(ucRssiThreshold));
Jeff Johnson295189b2012-06-20 16:38:30 -070022385
22386 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022387 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022388
22389 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022390 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022391 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022392 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22393 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022394}
22395
22396
22397/**
22398 @brief Process Update Scan Params function
Jeff Johnsone7245742012-09-05 17:12:55 -070022399
22400 @param pWDICtx: pointer to the WLAN DAL context
22401 pEventData: pointer to the event information structure
22402
Jeff Johnson295189b2012-06-20 16:38:30 -070022403 @see
22404 @return Result of the function call
22405*/
22406WDI_Status
22407WDI_ProcessUpdateScanParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022408(
Jeff Johnson295189b2012-06-20 16:38:30 -070022409 WDI_ControlBlockType* pWDICtx,
22410 WDI_EventInfoType* pEventData
22411)
22412{
22413 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
22414 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022415 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022416 wpt_uint16 usDataOffset = 0;
22417 wpt_uint16 usSendSize = 0;
22418 tUpdateScanParams updateScanParams = {0};
22419
22420
22421 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022422 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022423 -------------------------------------------------------------------------*/
22424 if (( NULL == pEventData ) ||
22425 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
22426 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
22427 {
22428 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22429 "%s: Invalid parameters", __FUNCTION__);
22430 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022431 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022432 }
22433
22434 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22435 "Begin WDI Update Scan Parameters");
22436 /*-----------------------------------------------------------------------
22437 Get message buffer
22438 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022439 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022440 sizeof(updateScanParams),
22441 &pSendBuffer, &usDataOffset, &usSendSize))||
22442 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22443 {
22444 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22445 "Unable to get send buffer in Update Scan Params req %x %x %x",
22446 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22447 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022448 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022449 }
22450
22451 //
22452 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22453 //
22454
22455 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22456 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
Jeff Johnsone7245742012-09-05 17:12:55 -070022457 updateScanParams.ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022458 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22459 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22460 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22461 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22462
Jeff Johnsone7245742012-09-05 17:12:55 -070022463 wpalMemoryCopy( updateScanParams.aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022464 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22465 updateScanParams.ucChannelCount);
22466
22467 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22468 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22469 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22470 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22471 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22472
Jeff Johnsone7245742012-09-05 17:12:55 -070022473 wpalMemoryCopy( pSendBuffer+usDataOffset,
22474 &updateScanParams,
22475 sizeof(updateScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022476
22477 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022478 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022479
22480 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22481 "End Update Scan Parameters");
22482 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022483 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022484 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022485 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22486 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022487}
22488
22489/**
22490 @brief Process Preferred Network Found Indication function
Jeff Johnsone7245742012-09-05 17:12:55 -070022491
22492 @param pWDICtx: pointer to the WLAN DAL context
22493 pEventData: pointer to the event information structure
22494
Jeff Johnson295189b2012-06-20 16:38:30 -070022495 @see
22496 @return Result of the function call
22497*/
22498WDI_Status
22499WDI_ProcessPrefNetworkFoundInd
Jeff Johnsone7245742012-09-05 17:12:55 -070022500(
Jeff Johnson295189b2012-06-20 16:38:30 -070022501 WDI_ControlBlockType* pWDICtx,
22502 WDI_EventInfoType* pEventData
22503)
22504{
22505 WDI_LowLevelIndType wdiInd;
22506 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22507
22508
22509 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022510 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022511 -------------------------------------------------------------------------*/
22512 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22513 ( NULL == pEventData->pEventData ))
22514 {
22515 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22516 "%s: Invalid parameters", __FUNCTION__);
22517 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070022518 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022519 }
22520
22521 /*-------------------------------------------------------------------------
22522 Extract indication and send it to UMAC
22523 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022524 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22525 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022526 sizeof(tPrefNetwFoundParams));
22527
22528 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022529 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070022530
22531 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22532
Jeff Johnsone7245742012-09-05 17:12:55 -070022533 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070022534 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
Jeff Johnsone7245742012-09-05 17:12:55 -070022535 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
Jeff Johnson295189b2012-06-20 16:38:30 -070022536
Jeff Johnsone7245742012-09-05 17:12:55 -070022537 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22538 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022539 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22540
22541 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22542 prefNetwFoundInd.prefNetwFoundParams.rssi;
22543
22544 // DEBUG
22545 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22546 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22547 wdiInd.wdiIndicationType,
22548 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22549 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22550
22551 /*Notify UMAC*/
22552 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070022553
22554 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022555}
22556
22557/**
22558 @brief Process PNO Rsp function (called when a
22559 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022560
22561 @param pWDICtx: pointer to the WLAN DAL context
22562 pEventData: pointer to the event information structure
22563
Jeff Johnson295189b2012-06-20 16:38:30 -070022564 @see
22565 @return Result of the function call
22566*/
22567WDI_Status
22568WDI_ProcessSetPreferredNetworkRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022569(
Jeff Johnson295189b2012-06-20 16:38:30 -070022570 WDI_ControlBlockType* pWDICtx,
22571 WDI_EventInfoType* pEventData
22572)
22573{
22574 WDI_Status wdiStatus;
22575 eHalStatus halStatus;
22576 WDI_PNOScanCb wdiPNOScanCb = NULL;
22577 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22578
22579 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022580 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022581 -------------------------------------------------------------------------*/
22582 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22583 ( NULL == pEventData->pEventData ))
22584 {
22585 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22586 "%s: Invalid parameters", __FUNCTION__);
22587 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022588 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022589 }
22590
22591
Jeff Johnsone7245742012-09-05 17:12:55 -070022592 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022593
22594 /*-------------------------------------------------------------------------
22595 Extract response and send it to UMAC
22596 -------------------------------------------------------------------------*/
22597 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022598 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022599
22600 /*Notify UMAC*/
22601 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22602
Jeff Johnsone7245742012-09-05 17:12:55 -070022603 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022604}/*WDI_ProcessSetPreferredNetworkRsp*/
22605
22606/**
22607 @brief Process RSSI Filter Rsp function (called when a
22608 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022609
22610 @param pWDICtx: pointer to the WLAN DAL context
22611 pEventData: pointer to the event information structure
22612
Jeff Johnson295189b2012-06-20 16:38:30 -070022613 @see
22614 @return Result of the function call
22615*/
22616WDI_Status
22617WDI_ProcessSetRssiFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022618(
Jeff Johnson295189b2012-06-20 16:38:30 -070022619 WDI_ControlBlockType* pWDICtx,
22620 WDI_EventInfoType* pEventData
22621)
22622{
22623 WDI_Status wdiStatus;
22624 eHalStatus halStatus;
22625 WDI_RssiFilterCb wdiRssiFilterCb;
22626 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22627
22628 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022629 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022630 -------------------------------------------------------------------------*/
22631 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22632 ( NULL == pEventData->pEventData ))
22633 {
22634 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22635 "%s: Invalid parameters", __FUNCTION__);
22636 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022637 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022638 }
22639
Jeff Johnsone7245742012-09-05 17:12:55 -070022640 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022641
22642 /*-------------------------------------------------------------------------
22643 Extract response and send it to UMAC
22644 -------------------------------------------------------------------------*/
22645 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022646 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022647
22648 /*Notify UMAC*/
22649 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22650
Jeff Johnsone7245742012-09-05 17:12:55 -070022651 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022652}/*WDI_ProcessSetRssiFilterRsp*/
22653
22654/**
22655 @brief Process Update Scan Params Rsp function (called when a
22656 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022657
22658 @param pWDICtx: pointer to the WLAN DAL context
22659 pEventData: pointer to the event information structure
22660
Jeff Johnson295189b2012-06-20 16:38:30 -070022661 @see
22662 @return Result of the function call
22663*/
22664WDI_Status
22665WDI_ProcessUpdateScanParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022666(
Jeff Johnson295189b2012-06-20 16:38:30 -070022667 WDI_ControlBlockType* pWDICtx,
22668 WDI_EventInfoType* pEventData
22669)
22670{
22671 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070022672 tUpdateScanParamsResp halUpdScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022673 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022674 wpt_uint32 uStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022675 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22676
22677 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022678 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022679 -------------------------------------------------------------------------*/
22680 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22681 ( NULL == pEventData->pEventData ))
22682 {
22683 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22684 "%s: Invalid parameters", __FUNCTION__);
22685 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022686 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022687 }
22688
22689 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22690 "Process UPD scan params ptr : %x", __FUNCTION__);
22691
Jeff Johnsone7245742012-09-05 17:12:55 -070022692 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022693
22694 /*-------------------------------------------------------------------------
22695 Extract response and send it to UMAC
22696 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022697 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22698 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022699 sizeof(halUpdScanParams.status));
22700
22701 uStatus = halUpdScanParams.status;
22702
22703 /*Extract PNO version - 1st bit of the status */
Jeff Johnsone7245742012-09-05 17:12:55 -070022704 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
Jeff Johnson295189b2012-06-20 16:38:30 -070022705
22706 /*Remove version bit*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022707 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
Jeff Johnson295189b2012-06-20 16:38:30 -070022708
Jeff Johnsone7245742012-09-05 17:12:55 -070022709 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022710
22711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022712 "UPD Scan Parameters rsp with status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022713 halUpdScanParams.status);
22714
22715 /*Notify UMAC*/
22716 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22717
Jeff Johnsone7245742012-09-05 17:12:55 -070022718 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022719}
22720#endif // FEATURE_WLAN_SCAN_PNO
22721
22722#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -070022723WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022724WDI_8023MulticastListReq
22725(
22726 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22727 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22728 void* pUserData
22729)
22730{
22731 WDI_EventInfoType wdiEventData;
22732 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22733
22734 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22735 "%s", __FUNCTION__);
22736
22737 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022738 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022739 ------------------------------------------------------------------------*/
22740 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22741 {
22742 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22743 "WDI API call before module is initialized - Fail request");
22744
Jeff Johnsone7245742012-09-05 17:12:55 -070022745 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022746 }
22747
22748 /*------------------------------------------------------------------------
22749 Fill in Event data and post to the Main FSM
22750 ------------------------------------------------------------------------*/
22751 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022752 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022753 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022754 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022755 wdiEventData.pUserData = pUserData;
22756
22757 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22758}
22759
Jeff Johnsone7245742012-09-05 17:12:55 -070022760WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022761WDI_ReceiveFilterSetFilterReq
22762(
22763 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22764 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22765 void* pUserData
22766)
22767{
22768 WDI_EventInfoType wdiEventData;
22769 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22770
22771 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22772 "%s",__FUNCTION__);
22773
22774 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022775 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022776 ------------------------------------------------------------------------*/
22777 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22778 {
22779 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22780 "WDI API call before module is initialized - Fail request");
22781
Jeff Johnsone7245742012-09-05 17:12:55 -070022782 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022783 }
22784
22785 /*------------------------------------------------------------------------
22786 Fill in Event data and post to the Main FSM
22787 ------------------------------------------------------------------------*/
22788 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022789 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22790 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22791 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
Jeff Johnson295189b2012-06-20 16:38:30 -070022792 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
Jeff Johnsone7245742012-09-05 17:12:55 -070022793 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022794 wdiEventData.pUserData = pUserData;
22795
22796
22797 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22798}
22799
Jeff Johnsone7245742012-09-05 17:12:55 -070022800WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022801WDI_FilterMatchCountReq
22802(
22803 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
22804 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
22805 void* pUserData
22806)
22807{
22808 WDI_EventInfoType wdiEventData;
22809 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22810
22811 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22812 "%s",__FUNCTION__);
22813
22814 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022815 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022816 ------------------------------------------------------------------------*/
22817 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22818 {
22819 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22820 "WDI API call before module is initialized - Fail request");
22821
Jeff Johnsone7245742012-09-05 17:12:55 -070022822 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022823 }
22824
22825 /*------------------------------------------------------------------------
22826 Fill in Event data and post to the Main FSM
22827 ------------------------------------------------------------------------*/
22828 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022829 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022830 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022831 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022832 wdiEventData.pUserData = pUserData;
22833
22834
22835 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22836}
22837
Jeff Johnsone7245742012-09-05 17:12:55 -070022838WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022839WDI_ReceiveFilterClearFilterReq
22840(
22841 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
22842 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
22843 void* pUserData
22844)
22845{
22846 WDI_EventInfoType wdiEventData;
22847 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22848
22849 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22850 "%s",__FUNCTION__);
22851
22852 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022853 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022854 ------------------------------------------------------------------------*/
22855 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22856 {
22857 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22858 "WDI API call before module is initialized - Fail request");
22859
Jeff Johnsone7245742012-09-05 17:12:55 -070022860 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022861 }
22862
22863 /*------------------------------------------------------------------------
22864 Fill in Event data and post to the Main FSM
22865 ------------------------------------------------------------------------*/
22866 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022867 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022868 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022869 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022870 wdiEventData.pUserData = pUserData;
22871
22872
22873 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22874}
22875
22876/**
22877 @brief Process 8023 Multicast List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022878
22879 @param pWDICtx: pointer to the WLAN DAL context
22880 pEventData: pointer to the event information structure
22881
Jeff Johnson295189b2012-06-20 16:38:30 -070022882 @see
22883 @return Result of the function call
22884*/
22885WDI_Status
22886WDI_Process8023MulticastListReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022887(
Jeff Johnson295189b2012-06-20 16:38:30 -070022888 WDI_ControlBlockType* pWDICtx,
22889 WDI_EventInfoType* pEventData
22890)
22891{
22892 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
22893 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022894 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022895 wpt_uint16 usDataOffset = 0;
22896 wpt_uint16 usSendSize = 0;
22897 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
22898 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022899 wpt_uint8 ucCurrentBSSSesIdx = 0;
22900 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022901
22902 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22903 "%s",__FUNCTION__);
22904
22905 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022906 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022907 -------------------------------------------------------------------------*/
22908 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022909 ( NULL == (pwdiFltPktSetMcListReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070022910 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022911 ( NULL == (wdi8023MulticastListCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070022912 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
22913 {
22914 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22915 "%s: Invalid parameters", __FUNCTION__);
22916 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022917 return WDI_STATUS_E_FAILURE;
22918 }
22919
22920 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
22921 pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId,
22922 &pBSSSes);
22923 if ( NULL == pBSSSes )
22924 {
22925 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22926 " %s : Association for this BSSID does not exist",__FUNCTION__);
22927 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022928 }
22929
22930 /*-----------------------------------------------------------------------
22931 Get message buffer
22932 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022933 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22934 WDI_8023_MULTICAST_LIST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022935 sizeof(tHalRcvFltMcAddrListType),
22936 &pSendBuffer, &usDataOffset, &usSendSize))||
22937 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
22938 {
22939 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22940 "Unable to get send buffer in "
22941 "WDI_Process8023MulticastListReq() %x %x %x",
22942 pEventData, pwdiFltPktSetMcListReqParamsType,
22943 wdi8023MulticastListCb);
22944 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022945 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022946 }
22947
Jeff Johnsone7245742012-09-05 17:12:55 -070022948 rcvFltMcAddrListType.cMulticastAddr =
22949 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
Jeff Johnson295189b2012-06-20 16:38:30 -070022950 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
22951 {
22952 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
22953 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
22954 sizeof(tSirMacAddr));
22955 }
22956
Jeff Johnsone7245742012-09-05 17:12:55 -070022957 rcvFltMcAddrListType.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070022958 wpalMemoryCopy( pSendBuffer+usDataOffset,
22959 &rcvFltMcAddrListType,
22960 sizeof(rcvFltMcAddrListType));
22961
22962 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022963 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022964
22965
22966 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022967 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022968 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022969 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070022970 wdi8023MulticastListCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070022971 WDI_8023_MULTICAST_LIST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022972}
22973
22974/**
22975 @brief Process Receive Filter Set Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022976
22977 @param pWDICtx: pointer to the WLAN DAL context
22978 pEventData: pointer to the event information structure
22979
Jeff Johnson295189b2012-06-20 16:38:30 -070022980 @see
22981 @return Result of the function call
22982*/
22983WDI_Status
22984WDI_ProcessReceiveFilterSetFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022985(
Jeff Johnson295189b2012-06-20 16:38:30 -070022986 WDI_ControlBlockType* pWDICtx,
22987 WDI_EventInfoType* pEventData
22988)
22989{
22990 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
22991 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022992 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022993 wpt_uint16 usDataOffset = 0;
22994 wpt_uint16 usSendSize = 0;
22995 wpt_uint32 usRcvPktFilterCfgSize;
22996 tHalRcvPktFilterCfgType *pRcvPktFilterCfg;
22997 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022998 wpt_uint8 ucCurrentBSSSesIdx = 0;
22999 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023000
23001 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23002 "%s",__FUNCTION__);
23003
23004 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023005 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023006 -------------------------------------------------------------------------*/
23007 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023008 ( NULL == (pwdiSetRcvPktFilterReqInfo =
Jeff Johnson295189b2012-06-20 16:38:30 -070023009 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023010 ( NULL == (wdiReceiveFilterSetFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023011 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
23012 {
23013 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23014 "%s: Invalid parameters", __FUNCTION__);
23015 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023016 return WDI_STATUS_E_FAILURE;
23017 }
23018
23019 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23020 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId,
23021 &pBSSSes);
23022 if ( NULL == pBSSSes )
23023 {
23024 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23025 " %s : Association for this BSSID does not exist",__FUNCTION__);
23026 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023027 }
23028
23029 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
23030 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23031 * sizeof(tHalRcvPktFilterParams));
23032
23033 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
23034 usRcvPktFilterCfgSize);
23035
23036 if(NULL == pRcvPktFilterCfg)
23037 {
23038 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23039 "%s: Failed to allocate memory for "
23040 "tHalRcvPktFilterCfgType: %x %x %x ",
23041 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23042 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023043 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023044 }
23045
23046 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
23047
23048 /*-----------------------------------------------------------------------
23049 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070023050
Jeff Johnson295189b2012-06-20 16:38:30 -070023051 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023052 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023053 usRcvPktFilterCfgSize,
23054 &pSendBuffer, &usDataOffset, &usSendSize))||
23055 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
23056 {
23057 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23058 "Unable to get send buffer in "
23059 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23060 pEventData, pwdiSetRcvPktFilterReqInfo,
23061 wdiReceiveFilterSetFilterCb);
23062 WDI_ASSERT(0);
23063 wpalMemoryFree(pRcvPktFilterCfg);
Jeff Johnsone7245742012-09-05 17:12:55 -070023064 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023065 }
23066
23067 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023068 "UsData Off %d UsSend %d cfg %d",usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023069 usSendSize,usRcvPktFilterCfgSize);
23070
23071 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
Jeff Johnsone7245742012-09-05 17:12:55 -070023072 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023073 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070023074 pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
Jeff Johnson295189b2012-06-20 16:38:30 -070023075
Jeff Johnsone7245742012-09-05 17:12:55 -070023076 //pRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070023077
23078 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023079 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
Jeff Johnson295189b2012-06-20 16:38:30 -070023080 pRcvPktFilterCfg->filterType);
23081 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23082 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070023083 pRcvPktFilterCfg->coalesceTime);
Jeff Johnson295189b2012-06-20 16:38:30 -070023084
23085 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
23086 {
Jeff Johnsone7245742012-09-05 17:12:55 -070023087 pRcvPktFilterCfg->paramsData[i].protocolLayer =
Jeff Johnson295189b2012-06-20 16:38:30 -070023088 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
Jeff Johnsone7245742012-09-05 17:12:55 -070023089 pRcvPktFilterCfg->paramsData[i].cmpFlag =
Jeff Johnson295189b2012-06-20 16:38:30 -070023090 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
Jeff Johnsone7245742012-09-05 17:12:55 -070023091 pRcvPktFilterCfg->paramsData[i].dataOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070023092 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070023093 pRcvPktFilterCfg->paramsData[i].dataLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070023094 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
23095
23096 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
23097 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23098 8);
23099 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
23100 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23101 8);
23102
23103 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23104 "Out:Proto %d Comp Flag %d \n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023105 pRcvPktFilterCfg->paramsData[i].protocolLayer,
Jeff Johnson295189b2012-06-20 16:38:30 -070023106 pRcvPktFilterCfg->paramsData[i].cmpFlag);
23107
23108 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23109 "Data Offset %d Data Len %d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023110 pRcvPktFilterCfg->paramsData[i].dataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023111 pRcvPktFilterCfg->paramsData[i].dataLength);
23112
23113 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23114 "CData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023115 pRcvPktFilterCfg->paramsData[i].compareData[0],
23116 pRcvPktFilterCfg->paramsData[i].compareData[1],
23117 pRcvPktFilterCfg->paramsData[i].compareData[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023118 pRcvPktFilterCfg->paramsData[i].compareData[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023119 pRcvPktFilterCfg->paramsData[i].compareData[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023120 pRcvPktFilterCfg->paramsData[i].compareData[5]);
23121
23122 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23123 "MData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023124 pRcvPktFilterCfg->paramsData[i].dataMask[0],
23125 pRcvPktFilterCfg->paramsData[i].dataMask[1],
23126 pRcvPktFilterCfg->paramsData[i].dataMask[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023127 pRcvPktFilterCfg->paramsData[i].dataMask[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023128 pRcvPktFilterCfg->paramsData[i].dataMask[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023129 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
23130 }
23131
Jeff Johnsone7245742012-09-05 17:12:55 -070023132 wpalMemoryCopy( pSendBuffer+usDataOffset,
23133 pRcvPktFilterCfg,
23134 usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023135
23136
23137 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023138 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023139
23140 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23141 "%s",__FUNCTION__);
23142 wpalMemoryFree(pRcvPktFilterCfg);
23143
23144 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023145 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023146 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023147 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023148 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023149 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023150}
23151
23152/**
23153 @brief Process Packet Filter Match Count Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023154
23155 @param pWDICtx: pointer to the WLAN DAL context
23156 pEventData: pointer to the event information structure
23157
Jeff Johnson295189b2012-06-20 16:38:30 -070023158 @see
23159 @return Result of the function call
23160*/
23161WDI_Status
23162WDI_ProcessFilterMatchCountReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023163(
Jeff Johnson295189b2012-06-20 16:38:30 -070023164 WDI_ControlBlockType* pWDICtx,
23165 WDI_EventInfoType* pEventData
23166)
23167{
23168 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
23169 NULL;
23170 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
23171 NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023172 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023173 wpt_uint16 usDataOffset = 0;
23174 wpt_uint16 usSendSize = 0;
23175
23176 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23177 "%s",__FUNCTION__);
23178
23179 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023180 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023181 -------------------------------------------------------------------------*/
23182 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023183 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023184 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023185 ( NULL == (wdiFilterMatchCountCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023186 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
23187 {
23188 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23189 "%s: Invalid parameters", __FUNCTION__);
23190 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023191 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023192 }
23193
23194 /*-----------------------------------------------------------------------
23195 Get message buffer
23196 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023197 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23198 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023199 0,
23200 &pSendBuffer, &usDataOffset, &usSendSize))||
23201 ( usSendSize < usDataOffset))
23202 {
23203 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23204 "Unable to get send buffer in "
23205 "WDI_ProcessFilterMatchCountReq() %x %x %x",
23206 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
23207 wdiFilterMatchCountCb);
23208 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023209 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023210 }
23211
23212 //
23213 // Don't need to fill send buffer other than header
23214 //
23215 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023216 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023217
23218
23219 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023220 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023221 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023222 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23223 wdiFilterMatchCountCb,
23224 pEventData->pUserData,
23225 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023226}
23227
23228/**
23229 @brief Process Receive Filter Clear Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023230
23231 @param pWDICtx: pointer to the WLAN DAL context
23232 pEventData: pointer to the event information structure
23233
Jeff Johnson295189b2012-06-20 16:38:30 -070023234 @see
23235 @return Result of the function call
23236*/
23237WDI_Status
23238WDI_ProcessReceiveFilterClearFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023239(
Jeff Johnson295189b2012-06-20 16:38:30 -070023240 WDI_ControlBlockType* pWDICtx,
23241 WDI_EventInfoType* pEventData
23242)
Jeff Johnsone7245742012-09-05 17:12:55 -070023243{
Jeff Johnson295189b2012-06-20 16:38:30 -070023244 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
23245 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023246 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023247 wpt_uint16 usDataOffset = 0;
23248 wpt_uint16 usSendSize = 0;
23249 tHalRcvFltPktClearParam rcvFltPktClearParam;
Jeff Johnsone7245742012-09-05 17:12:55 -070023250 wpt_uint8 ucCurrentBSSSesIdx = 0;
23251 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023252
23253 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23254 "%s",__FUNCTION__);
23255
23256 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023257 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023258 -------------------------------------------------------------------------*/
23259 if (( NULL == pEventData ) ||
23260 ( NULL == (pwdiRcvFltPktClearReqParamsType =
23261 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023262 ( NULL == (wdiRcvFltPktClearFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023263 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
23264 {
23265 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23266 "%s: Invalid parameters", __FUNCTION__);
23267 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023268 return WDI_STATUS_E_FAILURE;
23269 }
23270
23271 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23272 pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId,
23273 &pBSSSes);
23274 if ( NULL == pBSSSes )
23275 {
23276 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23277 " %s : Association for this BSSID does not exist",__FUNCTION__);
23278 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023279 }
23280
23281 /*-----------------------------------------------------------------------
23282 Get message buffer
23283 -----------------------------------------------------------------------*/
23284 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023285 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023286 sizeof(tHalRcvFltPktClearParam),
23287 &pSendBuffer, &usDataOffset, &usSendSize))||
23288 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
23289 {
23290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23291 "Unable to get send buffer in "
23292 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
23293 pEventData, pwdiRcvFltPktClearReqParamsType,
23294 wdiRcvFltPktClearFilterCb);
23295 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023296 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023297 }
23298
23299
23300 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023301 filterClearParam.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070023302 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023303 filterClearParam.filterId;
Jeff Johnson295189b2012-06-20 16:38:30 -070023304
Jeff Johnsone7245742012-09-05 17:12:55 -070023305 rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx;
23306 wpalMemoryCopy( pSendBuffer+usDataOffset,
23307 &rcvFltPktClearParam,
23308 sizeof(rcvFltPktClearParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070023309
23310 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023311 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023312
23313
23314 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023315 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023316 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023317 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023318 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023319 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023320}
23321
23322/**
23323 @brief Process 8023 Multicast List Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023324
23325 @param pWDICtx: pointer to the WLAN DAL context
23326 pEventData: pointer to the event information structure
23327
Jeff Johnson295189b2012-06-20 16:38:30 -070023328 @see
23329 @return Result of the function call
23330*/
23331WDI_Status
23332WDI_Process8023MulticastListRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023333(
Jeff Johnson295189b2012-06-20 16:38:30 -070023334 WDI_ControlBlockType* pWDICtx,
23335 WDI_EventInfoType* pEventData
23336)
23337{
23338 WDI_Status wdiStatus;
23339 eHalStatus halStatus;
23340 WDI_8023MulticastListCb wdi8023MulticastListCb;
23341 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23342
23343 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23344 "%s",__FUNCTION__);
23345
23346 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023347 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023348 -------------------------------------------------------------------------*/
23349 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23350 ( NULL == pEventData->pEventData ))
23351 {
23352 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23353 "%s: Invalid parameters", __FUNCTION__);
23354 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023355 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023356 }
23357
Jeff Johnsone7245742012-09-05 17:12:55 -070023358 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023359
23360 /*-------------------------------------------------------------------------
23361 Extract response and send it to UMAC
23362 -------------------------------------------------------------------------*/
23363 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023364 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023365
23366 /*Notify UMAC*/
23367 wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData);
23368
Jeff Johnsone7245742012-09-05 17:12:55 -070023369 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023370}
23371
23372/**
23373 @brief Process Set Rsp function (called when a
23374 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023375
23376 @param pWDICtx: pointer to the WLAN DAL context
23377 pEventData: pointer to the event information structure
23378
Jeff Johnson295189b2012-06-20 16:38:30 -070023379 @see
23380 @return Result of the function call
23381*/
23382WDI_Status
23383WDI_ProcessReceiveFilterSetFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023384(
Jeff Johnson295189b2012-06-20 16:38:30 -070023385 WDI_ControlBlockType* pWDICtx,
23386 WDI_EventInfoType* pEventData
23387)
23388{
23389 WDI_Status wdiStatus;
23390 eHalStatus halStatus;
23391 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
23392 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23393
23394 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23395 "%s",__FUNCTION__);
23396
23397 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023398 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023399 -------------------------------------------------------------------------*/
23400 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23401 ( NULL == pEventData->pEventData ))
23402 {
23403 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23404 "%s: Invalid parameters", __FUNCTION__);
23405 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023406 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023407 }
23408
23409 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023410 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023411
23412 /*-------------------------------------------------------------------------
23413 Extract response and send it to UMAC
23414 -------------------------------------------------------------------------*/
23415 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023416 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023417
23418 /*Notify UMAC*/
23419 wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23420
Jeff Johnsone7245742012-09-05 17:12:55 -070023421 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023422}
23423
23424/**
23425 @brief Process Packet Filter Match Count Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023426
23427 @param pWDICtx: pointer to the WLAN DAL context
23428 pEventData: pointer to the event information structure
23429
Jeff Johnson295189b2012-06-20 16:38:30 -070023430 @see
23431 @return Result of the function call
23432*/
23433WDI_Status
23434WDI_ProcessFilterMatchCountRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023435(
Jeff Johnson295189b2012-06-20 16:38:30 -070023436 WDI_ControlBlockType* pWDICtx,
23437 WDI_EventInfoType* pEventData
23438)
23439{
23440 WDI_Status wdiStatus;
23441 eHalStatus halStatus;
23442
23443 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
23444
23445 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23446
23447 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23448 "%s",__FUNCTION__);
23449
23450 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023451 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023452 -------------------------------------------------------------------------*/
23453 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23454 ( NULL == pEventData->pEventData ))
23455 {
23456 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23457 "%s: Invalid parameters", __FUNCTION__);
23458 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023459 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023460 }
23461
Jeff Johnsone7245742012-09-05 17:12:55 -070023462 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023463
23464 /*-------------------------------------------------------------------------
23465 Extract response and send it to UMAC
23466 -------------------------------------------------------------------------*/
23467 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023468 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023469
23470 /*Notify UMAC*/
23471 wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData);
23472
Jeff Johnsone7245742012-09-05 17:12:55 -070023473 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023474}
23475
23476/**
23477 @brief Process Receive Filter Clear Filter Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023478
23479 @param pWDICtx: pointer to the WLAN DAL context
23480 pEventData: pointer to the event information structure
23481
Jeff Johnson295189b2012-06-20 16:38:30 -070023482 @see
23483 @return Result of the function call
23484*/
23485WDI_Status
23486WDI_ProcessReceiveFilterClearFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023487(
Jeff Johnson295189b2012-06-20 16:38:30 -070023488 WDI_ControlBlockType* pWDICtx,
23489 WDI_EventInfoType* pEventData
23490)
23491{
23492 WDI_Status wdiStatus;
23493 eHalStatus halStatus;
23494 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
23495 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23496
23497 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23498 "%s",__FUNCTION__);
23499
23500 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023501 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023502 -------------------------------------------------------------------------*/
23503 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23504 ( NULL == pEventData->pEventData ))
23505 {
23506 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23507 "%s: Invalid parameters", __FUNCTION__);
23508 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023509 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023510 }
23511
23512 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023513 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023514
23515 /*-------------------------------------------------------------------------
23516 Extract response and send it to UMAC
23517 -------------------------------------------------------------------------*/
23518 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023519 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023520
23521 /*Notify UMAC*/
23522 wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23523
Jeff Johnsone7245742012-09-05 17:12:55 -070023524 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023525}
23526#endif // WLAN_FEATURE_PACKET_FILTERING
23527
23528/**
23529 @brief Process Shutdown Rsp function
23530 There is no shutdown response comming from HAL
23531 - function just kept for simmetry
Jeff Johnsone7245742012-09-05 17:12:55 -070023532
Jeff Johnson295189b2012-06-20 16:38:30 -070023533 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnsone7245742012-09-05 17:12:55 -070023534 pEventData: pointer to the event information structure
Jeff Johnson295189b2012-06-20 16:38:30 -070023535
23536 @see
23537 @return Result of the function call
23538*/
23539WDI_Status
23540WDI_ProcessShutdownRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023541(
Jeff Johnson295189b2012-06-20 16:38:30 -070023542 WDI_ControlBlockType* pWDICtx,
23543 WDI_EventInfoType* pEventData
23544)
23545{
23546 /*There is no shutdown response comming from HAL - function just kept for
23547 simmetry */
23548 WDI_ASSERT(0);
23549 return WDI_STATUS_SUCCESS;
23550}/*WDI_ProcessShutdownRsp*/
23551
23552/**
23553 @brief WDI_SetPowerParamsReq
23554
Jeff Johnsone7245742012-09-05 17:12:55 -070023555 @param pwdiPowerParamsReqParams: the Set Power Params as
Jeff Johnson295189b2012-06-20 16:38:30 -070023556 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070023557
Jeff Johnson295189b2012-06-20 16:38:30 -070023558 wdiPowerParamsCb: callback for passing back the response
23559 of the Set Power Params operation received from the
23560 device
Jeff Johnsone7245742012-09-05 17:12:55 -070023561
Jeff Johnson295189b2012-06-20 16:38:30 -070023562 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070023563 callback
23564
Jeff Johnson295189b2012-06-20 16:38:30 -070023565 @return Result of the function call
23566*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023567WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023568WDI_SetPowerParamsReq
23569(
23570 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23571 WDI_SetPowerParamsCb wdiPowerParamsCb,
23572 void* pUserData
23573)
23574{
23575 WDI_EventInfoType wdiEventData;
23576 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23577
23578 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023579 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023580 ------------------------------------------------------------------------*/
23581 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23582 {
23583 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23584 "WDI API call before module is initialized - Fail request");
23585
Jeff Johnsone7245742012-09-05 17:12:55 -070023586 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023587 }
23588
23589 /*------------------------------------------------------------------------
23590 Fill in Event data and post to the Main FSM
23591 ------------------------------------------------------------------------*/
23592 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023593 wdiEventData.pEventData = pwdiPowerParamsReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023594 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070023595 wdiEventData.pCBfnc = wdiPowerParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070023596 wdiEventData.pUserData = pUserData;
23597
23598 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23599}/*WDI_SetPowerParamsReq*/
23600
23601/**
23602 @brief Process Set Power Params Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023603
23604 @param pWDICtx: pointer to the WLAN DAL context
23605 pEventData: pointer to the event information structure
23606
Jeff Johnson295189b2012-06-20 16:38:30 -070023607 @see
23608 @return Result of the function call
23609*/
23610WDI_Status
23611WDI_ProcessSetPowerParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023612(
Jeff Johnson295189b2012-06-20 16:38:30 -070023613 WDI_ControlBlockType* pWDICtx,
23614 WDI_EventInfoType* pEventData
23615)
23616{
23617 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
23618 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023619 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023620 wpt_uint16 usDataOffset = 0;
23621 wpt_uint16 usSendSize = 0;
23622 tSetPowerParamsType powerParams;
23623
23624 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023625 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023626 -------------------------------------------------------------------------*/
23627 if (( NULL == pEventData ) ||
23628 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
23629 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
23630 {
23631 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23632 "%s: Invalid parameters", __FUNCTION__);
23633 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023634 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023635 }
23636
23637 /*-----------------------------------------------------------------------
23638 Get message buffer
23639 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023640 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023641 sizeof(powerParams),
23642 &pSendBuffer, &usDataOffset, &usSendSize))||
23643 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
23644 {
23645 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23646 "Unable to get send buffer in Set PNO req %x %x %x",
23647 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
23648 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023649 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023650 }
23651
23652 /* Ignore DTIM */
Jeff Johnsone7245742012-09-05 17:12:55 -070023653 powerParams.uIgnoreDTIM =
Jeff Johnson295189b2012-06-20 16:38:30 -070023654 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
23655
23656 /*DTIM Period*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023657 powerParams.uDTIMPeriod =
Jeff Johnson295189b2012-06-20 16:38:30 -070023658 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
23659
23660 /* Listen Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023661 powerParams.uListenInterval=
Jeff Johnson295189b2012-06-20 16:38:30 -070023662 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
23663
23664 /* Broadcast Multicas Filter */
Jeff Johnsone7245742012-09-05 17:12:55 -070023665 powerParams.uBcastMcastFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070023666 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
23667
23668 /* Beacon Early Termination */
Jeff Johnsone7245742012-09-05 17:12:55 -070023669 powerParams.uEnableBET =
Jeff Johnson295189b2012-06-20 16:38:30 -070023670 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
23671
23672 /* Beacon Early Termination Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023673 powerParams.uBETInterval =
23674 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
Jeff Johnson295189b2012-06-20 16:38:30 -070023675
Jeff Johnsone7245742012-09-05 17:12:55 -070023676
23677 wpalMemoryCopy( pSendBuffer+usDataOffset,
23678 &powerParams,
23679 sizeof(powerParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070023680
23681 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023682 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023683
23684 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023685 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023686 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023687 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23688 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023689}
23690
23691/**
23692 @brief Process Power Params Rsp function (called when a
23693 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023694
23695 @param pWDICtx: pointer to the WLAN DAL context
23696 pEventData: pointer to the event information structure
23697
Jeff Johnson295189b2012-06-20 16:38:30 -070023698 @see
23699 @return Result of the function call
23700*/
23701WDI_Status
23702WDI_ProcessSetPowerParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023703(
Jeff Johnson295189b2012-06-20 16:38:30 -070023704 WDI_ControlBlockType* pWDICtx,
23705 WDI_EventInfoType* pEventData
23706)
23707{
23708 WDI_Status wdiStatus;
23709 eHalStatus halStatus;
23710 WDI_SetPowerParamsCb wdiPowerParamsCb;
23711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23712
23713 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023714 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023715 -------------------------------------------------------------------------*/
23716 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23717 ( NULL == pEventData->pEventData ))
23718 {
23719 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23720 "%s: Invalid parameters", __FUNCTION__);
23721 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023722 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023723 }
23724
Jeff Johnsone7245742012-09-05 17:12:55 -070023725 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023726
23727 /*-------------------------------------------------------------------------
23728 Extract response and send it to UMAC
23729 -------------------------------------------------------------------------*/
23730 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023731 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023732
23733 /*Notify UMAC*/
23734 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23735
Jeff Johnsone7245742012-09-05 17:12:55 -070023736 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023737}/*WDI_ProcessSetPowerParamsRsp*/
23738
23739#ifdef WLAN_FEATURE_GTK_OFFLOAD
23740/**
23741 @brief WDI_GTKOffloadReq will be called when the upper MAC
23742 wants to set GTK Rekey Counter while in power save. Upon
23743 the call of this API the WLAN DAL will pack and send a
23744 HAL GTK offload request message to the lower RIVA
23745 sub-system if DAL is in state STARTED.
23746
23747 In state BUSY this request will be queued. Request won't
23748 be allowed in any other state.
23749
23750 WDI_PostAssocReq must have been called.
23751
23752 @param pwdiGtkOffloadParams: the GTK offload as specified
23753 by the Device Interface
23754
23755 wdiGtkOffloadCb: callback for passing back the response
23756 of the GTK offload operation received from the device
23757
23758 pUserData: user data will be passed back with the
23759 callback
23760
23761 @see WDI_PostAssocReq
23762 @return Result of the function call
23763*/
23764WDI_Status
23765WDI_GTKOffloadReq
23766(
23767 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
23768 WDI_GtkOffloadCb wdiGtkOffloadCb,
23769 void* pUserData
23770)
23771{
23772 WDI_EventInfoType wdiEventData = {0};
23773 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23774
23775 /*------------------------------------------------------------------------
23776 Sanity Check
23777 ------------------------------------------------------------------------*/
23778 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23779 {
23780 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23781 "WDI API call before module is initialized - Fail request");
23782
23783 return WDI_STATUS_E_NOT_ALLOWED;
23784 }
23785
23786 /*------------------------------------------------------------------------
23787 Fill in Event data and post to the Main FSM
23788 ------------------------------------------------------------------------*/
23789 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
23790 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
23791 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
23792 wdiEventData.pCBfnc = wdiGtkOffloadCb;
23793 wdiEventData.pUserData = pUserData;
23794
23795 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23796}
23797
23798
23799/**
23800 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
23801 MAC wants to get GTK Rekey Counter while in power save.
23802 Upon the call of this API the WLAN DAL will pack and
23803 send a HAL GTK offload request message to the lower RIVA
23804 sub-system if DAL is in state STARTED.
23805
23806 In state BUSY this request will be queued. Request won't
23807 be allowed in any other state.
23808
23809 WDI_PostAssocReq must have been called.
23810
23811 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
23812 Information Message as specified by the
23813 Device Interface
23814
23815 wdiGtkOffloadGetInfoCb: callback for passing back the
23816 response of the GTK offload operation received from the
23817 device
23818
23819 pUserData: user data will be passed back with the
23820 callback
23821
23822 @see WDI_PostAssocReq
23823 @return Result of the function call
23824*/
23825WDI_Status
23826WDI_GTKOffloadGetInfoReq
23827(
23828 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
23829 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
23830 void* pUserData
23831)
23832{
23833 WDI_EventInfoType wdiEventData = {0};
23834 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23835
23836 /*------------------------------------------------------------------------
23837 Sanity Check
23838 ------------------------------------------------------------------------*/
23839 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23840 {
23841 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23842 "WDI API call before module is initialized - Fail request");
23843
23844 return WDI_STATUS_E_NOT_ALLOWED;
23845 }
23846
23847 /*------------------------------------------------------------------------
23848 Fill in Event data and post to the Main FSM
23849 ------------------------------------------------------------------------*/
23850 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
23851 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
23852 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
23853 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
23854 wdiEventData.pUserData = pUserData;
23855
23856 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23857}
23858
23859
23860/**
23861 @brief Process set GTK Offload Request function
23862
23863 @param pWDICtx: pointer to the WLAN DAL context
23864 pEventData: pointer to the event information structure
23865
23866 @see
23867 @return Result of the function call
23868*/
23869WDI_Status
23870WDI_ProcessGTKOffloadReq
23871(
23872 WDI_ControlBlockType* pWDICtx,
23873 WDI_EventInfoType* pEventData
23874)
23875{
23876 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
23877 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23878 wpt_uint8* pSendBuffer = NULL;
23879 wpt_uint16 usDataOffset = 0;
23880 wpt_uint16 usSendSize = 0;
23881 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
23882 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23883
23884 /*-------------------------------------------------------------------------
23885 Sanity check
23886 -------------------------------------------------------------------------*/
23887 if (( NULL == pEventData ) ||
23888 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
23889 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
23890 {
23891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23892 "%s: Invalid parameters", __FUNCTION__);
23893 WDI_ASSERT(0);
23894 return WDI_STATUS_E_FAILURE;
23895 }
23896
23897 /*-----------------------------------------------------------------------
23898 Get message buffer
23899 -----------------------------------------------------------------------*/
23900 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
23901 sizeof(gtkOffloadReqParams),
23902 &pSendBuffer, &usDataOffset, &usSendSize))||
23903 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
23904 {
23905 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23906 "Unable to get send buffer in GTK offload req %x %x %x",
23907 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
23908 WDI_ASSERT(0);
23909 return WDI_STATUS_E_FAILURE;
23910 }
23911
23912 //
23913 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
23914 //
23915 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
23916 // Copy KCK
23917 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
23918 // Copy KEK
23919 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
23920 // Copy KeyReplayCounter
23921 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
23922
23923 wpalMemoryCopy( pSendBuffer+usDataOffset,
23924 &gtkOffloadReqParams,
23925 sizeof(gtkOffloadReqParams));
23926
23927 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
23928 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
23929
23930 /*-------------------------------------------------------------------------
23931 Send Get STA Request to HAL
23932 -------------------------------------------------------------------------*/
23933 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23934 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
23935}
23936
23937
23938/**
23939 @brief Process GTK Offload Get Information Request function
23940
23941 @param pWDICtx: pointer to the WLAN DAL context
23942 pEventData: pointer to the event information structure
23943
23944 @see
23945 @return Result of the function call
23946*/
23947WDI_Status
23948WDI_ProcessGTKOffloadGetInfoReq
23949(
23950 WDI_ControlBlockType* pWDICtx,
23951 WDI_EventInfoType* pEventData
23952)
23953{
23954 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
23955 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23956 wpt_uint8* pSendBuffer = NULL;
23957 wpt_uint16 usDataOffset = 0;
23958 wpt_uint16 usSendSize = 0;
23959
23960 /*-------------------------------------------------------------------------
23961 Sanity check
23962 -------------------------------------------------------------------------*/
23963 if (( NULL == pEventData ) ||
23964 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
23965 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
23966 {
23967 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23968 "%s: Invalid parameters", __FUNCTION__);
23969 WDI_ASSERT(0);
23970 return WDI_STATUS_E_FAILURE;
23971 }
23972
23973 /*-----------------------------------------------------------------------
23974 Get message buffer
23975 -----------------------------------------------------------------------*/
23976 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
23977 0,
23978 &pSendBuffer, &usDataOffset, &usSendSize))||
23979 ( usSendSize < usDataOffset))
23980 {
23981 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23982 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
23983 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
23984 WDI_ASSERT(0);
23985 return WDI_STATUS_E_FAILURE;
23986 }
23987
23988 //
23989 // Don't need to fill send buffer other than header
23990 //
23991
23992 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
23993 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
23994
23995 /*-------------------------------------------------------------------------
23996 Send Get STA Request to HAL
23997 -------------------------------------------------------------------------*/
23998 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23999 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
24000}
24001
24002/**
24003 @brief Process host offload Rsp function (called when a
24004 response is being received over the bus from HAL)
24005
24006 @param pWDICtx: pointer to the WLAN DAL context
24007 pEventData: pointer to the event information structure
24008
24009 @see
24010 @return Result of the function call
24011*/
24012WDI_Status
24013WDI_ProcessGtkOffloadRsp
24014(
24015 WDI_ControlBlockType* pWDICtx,
24016 WDI_EventInfoType* pEventData
24017)
24018{
24019 WDI_Status wdiStatus;
24020 eHalStatus halStatus;
24021 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
24022 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24023
24024 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
24025
24026 /*-------------------------------------------------------------------------
24027 Sanity check
24028 -------------------------------------------------------------------------*/
24029 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24030 ( NULL == pEventData->pEventData))
24031 {
24032 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24033 "%s: Invalid parameters", __FUNCTION__);
24034 WDI_ASSERT(0);
24035 return WDI_STATUS_E_FAILURE;
24036 }
24037
24038 /*-------------------------------------------------------------------------
24039 Extract response and send it to UMAC
24040 -------------------------------------------------------------------------*/
24041 halStatus = *((eHalStatus*)pEventData->pEventData);
24042 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24043
24044 /*Notify UMAC*/
24045 wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
24046
24047 return WDI_STATUS_SUCCESS;
24048}
24049
24050/**
24051 @brief Process GTK Offload Get Information Response function
24052
24053 @param pWDICtx: pointer to the WLAN DAL context
24054 pEventData: pointer to the event information structure
24055
24056 @see
24057 @return Result of the function call
24058*/
24059WDI_Status
24060WDI_ProcessGTKOffloadGetInfoRsp
24061(
24062 WDI_ControlBlockType* pWDICtx,
24063 WDI_EventInfoType* pEventData
24064)
24065{
24066 WDI_Status wdiStatus;
24067 eHalStatus halStatus;
24068
24069 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
24070
24071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24072
24073 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
24074
24075 /*-------------------------------------------------------------------------
24076 Sanity check
24077 -------------------------------------------------------------------------*/
24078 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24079 ( NULL == pEventData->pEventData ))
24080 {
24081 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24082 "%s: Invalid parameters", __FUNCTION__);
24083 WDI_ASSERT(0);
24084 return WDI_STATUS_E_FAILURE;
24085 }
24086
24087 /*-------------------------------------------------------------------------
24088 Extract response and send it to UMAC
24089 -------------------------------------------------------------------------*/
24090 halStatus = *((eHalStatus*)pEventData->pEventData);
24091 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24092
24093 /*Notify UMAC*/
24094 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24095 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
24096 wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData);
24097
24098 return WDI_STATUS_SUCCESS;
24099}
24100#endif // WLAN_FEATURE_GTK_OFFLOAD
24101
24102#ifdef WLAN_WAKEUP_EVENTS
24103WDI_Status
24104WDI_ProcessWakeReasonInd
24105(
24106 WDI_ControlBlockType* pWDICtx,
24107 WDI_EventInfoType* pEventData
24108)
24109{
24110 WDI_LowLevelIndType *pWdiInd;
24111 tpWakeReasonParams pWakeReasonParams;
24112 wpt_uint32 allocSize = 0;
24113
24114 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24115 "+%s", __FUNCTION__);
24116
24117 /*-------------------------------------------------------------------------
24118 Sanity check
24119 -------------------------------------------------------------------------*/
24120 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24121 ( NULL == pEventData->pEventData ))
24122 {
24123 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24124 "%s: Invalid parameters", __FUNCTION__);
24125 WDI_ASSERT( 0 );
24126 return WDI_STATUS_E_FAILURE;
24127 }
24128
24129 /*-------------------------------------------------------------------------
24130 Extract indication and send it to UMAC
24131 -------------------------------------------------------------------------*/
24132 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
24133
24134 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
24135
24136 //Allocate memory for WDI_WakeReasonIndType structure
24137 pWdiInd = wpalMemoryAllocate(allocSize) ;
24138
24139 if(NULL == pWdiInd)
24140 {
24141 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24142 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
24143 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
24144 WDI_ASSERT(0);
24145 return WDI_STATUS_E_FAILURE;
24146 }
24147
24148 wpalMemoryZero(pWdiInd, allocSize);
24149
24150 /* Fill in the indication parameters*/
24151 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
24152 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
24153 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
24154 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
24155 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
24156 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
24157 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
24158 &(pWakeReasonParams->aDataStart[0]),
24159 pWakeReasonParams->ulStoredDataLen);
24160
24161 /*Notify UMAC*/
24162 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
24163
24164 //Free memory allocated for WDI_WakeReasonIndType structure
24165 wpalMemoryFree(pWdiInd);
24166
24167 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24168 "-%s", __FUNCTION__);
24169
24170 return WDI_STATUS_SUCCESS;
24171}
24172#endif // WLAN_WAKEUP_EVENTS
24173
24174void WDI_GetWcnssCompiledApiVersion
24175(
24176 WDI_WlanVersionType *pWcnssApiVersion
24177)
24178{
24179 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
24180 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
24181 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
24182 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
24183}
24184
24185/**
24186 @brief Process Set TM Level Rsp function (called when a
24187 response is being received over the bus from HAL)
24188
24189 @param pWDICtx: pointer to the WLAN DAL context
24190 pEventData: pointer to the event information structure
24191
24192 @see
24193 @return Result of the function call
24194*/
24195WDI_Status
24196WDI_ProcessSetTmLevelRsp
24197(
24198 WDI_ControlBlockType* pWDICtx,
24199 WDI_EventInfoType* pEventData
24200)
24201{
24202 WDI_Status wdiStatus;
24203 eHalStatus halStatus;
24204 WDI_SetTmLevelCb wdiSetTmLevelCb;
24205 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24206
24207 /*-------------------------------------------------------------------------
24208 Sanity check
24209 -------------------------------------------------------------------------*/
24210 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24211 ( NULL == pEventData->pEventData ))
24212 {
24213 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24214 "%s: Invalid parameters", __FUNCTION__);
24215 WDI_ASSERT(0);
24216 return WDI_STATUS_E_FAILURE;
24217 }
24218
24219 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
24220
24221 /*-------------------------------------------------------------------------
24222 Extract response and send it to UMAC
24223 -------------------------------------------------------------------------*/
24224 halStatus = *((eHalStatus*)pEventData->pEventData);
24225 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24226
24227 /*Notify UMAC*/
24228 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
24229
24230 return WDI_STATUS_SUCCESS;
24231}/*WDI_ProcessSetTmLevelRsp*/
24232
24233/**
24234 @brief Process Set Thermal Mitigation level Changed request
24235
24236 @param pWDICtx: pointer to the WLAN DAL context
24237 pEventData: pointer to the event information structure
24238
24239 @see
24240 @return Result of the function call
24241*/
24242WDI_Status
24243WDI_ProcessSetTmLevelReq
24244(
24245 WDI_ControlBlockType* pWDICtx,
24246 WDI_EventInfoType* pEventData
24247)
24248{
24249 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
24250 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
24251 wpt_uint8* pSendBuffer = NULL;
24252 wpt_uint16 usDataOffset = 0;
24253 wpt_uint16 usSendSize = 0;
24254 tSetThermalMitgationType halTmMsg;
24255
24256 /*-------------------------------------------------------------------------
24257 Sanity check
24258 -------------------------------------------------------------------------*/
24259 if (( NULL == pEventData ) ||
24260 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
24261 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
24262 {
24263 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24264 "%s: Invalid parameters", __FUNCTION__);
24265 WDI_ASSERT(0);
24266 return WDI_STATUS_E_FAILURE;
24267 }
24268
24269 /*-----------------------------------------------------------------------
24270 Get message buffer
24271 -----------------------------------------------------------------------*/
24272 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
24273 sizeof(halTmMsg),
24274 &pSendBuffer, &usDataOffset, &usSendSize))||
24275 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
24276 {
24277 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24278 "Unable to get send buffer in Set PNO req %x %x %x",
24279 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
24280 WDI_ASSERT(0);
24281 return WDI_STATUS_E_FAILURE;
24282 }
24283
24284 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
24285 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
24286
24287 wpalMemoryCopy( pSendBuffer+usDataOffset,
24288 &halTmMsg,
24289 sizeof(halTmMsg));
24290
24291 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
24292 pWDICtx->pfncRspCB = NULL;
24293 /*-------------------------------------------------------------------------
24294 Send Get STA Request to HAL
24295 -------------------------------------------------------------------------*/
24296 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24297 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
24298}
24299
24300/* Fill the value from the global features enabled array to the global capabilities
24301 * bitmap struct
24302 */
24303static void
24304FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
24305{
24306 wpt_int8 i;
24307 for (i=0; i<len; i++)
24308 {
24309 setFeatCaps(fCaps, enabledFeat[i]);
24310 }
24311}
24312
24313/**
24314 @brief WDI_featureCapsExchangeReq
24315 Post feature capability bitmap exchange event.
24316 Host will send its own capability to FW in this req and
24317 expect FW to send its capability back as a bitmap in Response
24318
24319 @param
24320
24321 wdiFeatureCapsExchangeCb: callback called on getting the response.
24322 It is kept to mantain similarity between WDI reqs and if needed, can
24323 be used in future. Currently, It is set to NULL
24324
24325 pUserData: user data will be passed back with the
24326 callback
24327
24328 @see
24329 @return Result of the function call
24330*/
24331WDI_Status
24332WDI_featureCapsExchangeReq
24333(
24334 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
24335 void* pUserData
24336)
24337{
24338 WDI_EventInfoType wdiEventData;
24339 wpt_int32 fCapsStructSize;
24340
24341 /*------------------------------------------------------------------------
24342 Sanity Check
24343 ------------------------------------------------------------------------*/
24344 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24345 {
24346 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24347 "WDI API call before module is initialized - Fail request");
24348
24349 return WDI_STATUS_E_NOT_ALLOWED;
24350 }
24351
24352 /* Allocate memory separately for global variable carrying FW caps */
24353 fCapsStructSize = sizeof(tWlanFeatCaps);
24354 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24355 if ( NULL == gpHostWlanFeatCaps )
24356 {
24357 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24358 "Cannot allocate memory for host capability info\n");
24359 WDI_ASSERT(0);
24360 return WDI_STATUS_MEM_FAILURE;
24361 }
24362
24363 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
24364
24365 /*------------------------------------------------------------------------
24366 Fill in Event data and post to the Main FSM
24367 ------------------------------------------------------------------------*/
24368 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
24369 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
Jeff Johnsone7245742012-09-05 17:12:55 -070024370 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24371 "Host caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024372 gpHostWlanFeatCaps->featCaps[0],
24373 gpHostWlanFeatCaps->featCaps[1],
24374 gpHostWlanFeatCaps->featCaps[2],
24375 gpHostWlanFeatCaps->featCaps[3]
24376 );
24377
24378 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
24379 wdiEventData.pEventData = gpHostWlanFeatCaps;
24380 wdiEventData.uEventDataSize = fCapsStructSize;
24381 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
24382 wdiEventData.pUserData = pUserData;
24383
24384 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24385}
24386
24387/**
24388 @brief Process Host-FW Capability Exchange Request function
24389
24390 @param pWDICtx: pointer to the WLAN DAL context
24391 pEventData: pointer to the event information structure
24392
24393 @see
24394 @return Result of the function call
24395*/
24396WDI_Status
24397WDI_ProcessFeatureCapsExchangeReq
24398(
24399 WDI_ControlBlockType* pWDICtx,
24400 WDI_EventInfoType* pEventData
24401)
24402{
24403 wpt_uint8* pSendBuffer = NULL;
24404 wpt_uint16 usDataOffset = 0;
24405 wpt_uint16 usSendSize = 0;
24406 wpt_uint16 usLen = 0;
24407
24408 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24409
24410 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24411 "%s", __FUNCTION__);
24412
24413 /*-------------------------------------------------------------------------
24414 Sanity check
24415 -------------------------------------------------------------------------*/
24416 /* Call back function is NULL since not required for cap exchange req */
24417 if (( NULL == pEventData ) ||
24418 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
24419 {
24420 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24421 "%s: Invalid parameters", __FUNCTION__);
24422 WDI_ASSERT(0);
24423 return WDI_STATUS_E_FAILURE;
24424 }
24425
24426 /*-----------------------------------------------------------------------
24427 Get message buffer
24428 -----------------------------------------------------------------------*/
24429 usLen = sizeof(tWlanFeatCaps);
24430
24431 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
24432 WDI_FEATURE_CAPS_EXCHANGE_REQ,
24433 usLen,
24434 &pSendBuffer, &usDataOffset, &usSendSize))||
24435 ( usSendSize < (usDataOffset + usLen )))
24436 {
24437 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24438 "Unable to get send buffer in feat caps exchange req %x %x",
24439 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
24440 WDI_ASSERT(0);
24441 return WDI_STATUS_E_FAILURE;
24442 }
24443
24444 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070024445 "Host Caps - %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024446 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
24447 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
24448 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
24449 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
24450 );
24451
24452 /* Copy host caps after the offset in the send buffer */
24453 wpalMemoryCopy( pSendBuffer+usDataOffset,
24454 (tWlanFeatCaps *)pEventData->pEventData,
24455 usLen);
24456
24457 /*-------------------------------------------------------------------------
24458 Send Start Request to HAL
24459 -------------------------------------------------------------------------*/
24460 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24461 (WDI_StartRspCb)pEventData->pCBfnc,
24462 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
24463
24464}/*WDI_ProcessFeatureCapsExchangeReq*/
24465
24466/**
24467 @brief Process Host-FW Capability Exchange Response function
24468
24469 @param pWDICtx: pointer to the WLAN DAL context
24470 pEventData: pointer to the event information structure
24471
24472 @see
24473 @return Result of the function call
24474*/
24475WDI_Status
24476WDI_ProcessFeatureCapsExchangeRsp
24477(
24478 WDI_ControlBlockType* pWDICtx,
24479 WDI_EventInfoType* pEventData
24480)
24481{
24482 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24483 wpt_int32 fCapsStructSize;
24484 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24485
24486 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24487 "%s", __FUNCTION__);
24488
24489 /*-------------------------------------------------------------------------
24490 Sanity check
24491 -------------------------------------------------------------------------*/
24492 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24493 ( NULL == pEventData->pEventData ))
24494 {
24495 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24496 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24497 "%s: Invalid parameters", __FUNCTION__);
24498 WDI_ASSERT(0);
24499 return WDI_STATUS_E_FAILURE;
24500 }
24501
24502 /* Allocate memory separately for global variable carrying FW caps */
24503 fCapsStructSize = sizeof(tWlanFeatCaps);
24504 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24505 if ( NULL == gpFwWlanFeatCaps )
24506 {
24507 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24508 "Cannot allocate memory for host capability info\n");
24509 WDI_ASSERT(0);
24510 return WDI_STATUS_MEM_FAILURE;
24511 }
24512
24513 /*-------------------------------------------------------------------------
24514 Unpack HAL Response Message - the header was already extracted by the
24515 main Response Handling procedure
24516 -------------------------------------------------------------------------*/
24517 /*-------------------------------------------------------------------------
24518 Extract response and send it to UMAC
24519 -------------------------------------------------------------------------*/
24520
24521 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24522 fCapsStructSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070024523 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24524 "FW caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024525 gpFwWlanFeatCaps->featCaps[0],
24526 gpFwWlanFeatCaps->featCaps[1],
24527 gpFwWlanFeatCaps->featCaps[2],
24528 gpFwWlanFeatCaps->featCaps[3]
24529 );
Jeff Johnsone7245742012-09-05 17:12:55 -070024530
Jeff Johnson295189b2012-06-20 16:38:30 -070024531 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24532
24533 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24534 if (wdiFeatureCapsExchangeCb != NULL)
24535 wdiFeatureCapsExchangeCb(NULL, NULL);
24536
24537 return WDI_STATUS_SUCCESS;
24538}
24539
Mohit Khanna4a70d262012-09-11 16:30:12 -070024540#ifdef WLAN_FEATURE_11AC
24541WDI_Status
24542WDI_ProcessUpdateVHTOpModeRsp
24543(
24544 WDI_ControlBlockType* pWDICtx,
24545 WDI_EventInfoType* pEventData
24546)
24547{
24548 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24549 WDI_Status wdiStatus;
24550 eHalStatus halStatus;
24551
24552 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24553
24554 /*-------------------------------------------------------------------------
24555 Sanity check
24556 -------------------------------------------------------------------------*/
24557 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24558 ( NULL == pEventData->pEventData))
24559 {
24560 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24561 "%s: Invalid parameters", __FUNCTION__);
24562 WDI_ASSERT(0);
24563 return WDI_STATUS_E_FAILURE;
24564 }
24565 wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc;
24566
24567 /*-------------------------------------------------------------------------
24568 Extract response and send it to UMAC
24569 -------------------------------------------------------------------------*/
24570 halStatus = *((eHalStatus*)pEventData->pEventData);
24571 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24572
24573 /*Notify UMAC*/
24574 wdiVHTOpModeCb( wdiStatus, pEventData->pUserData);
24575
24576 return WDI_STATUS_SUCCESS;
24577}
24578#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070024579/**
24580 @brief WDI_getHostWlanFeatCaps
24581 WDI API that returns whether the feature passed to it as enum value in
24582 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
24583 variable storing host capability bitmap to find this. This can be used by
24584 other moduels to decide certain things like call different APIs based on
24585 whether a particular feature is supported.
24586
24587 @param
24588
24589 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
24590
24591 @see
24592 @return
24593 0 - if the feature is NOT supported in host
24594 any non-zero value - if the feature is SUPPORTED in host.
24595*/
24596wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
24597{
24598 wpt_uint8 featSupported = 0;
24599 if (gpHostWlanFeatCaps != NULL)
24600 {
24601 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
24602 }
24603 else
24604 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024605 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024606 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024607 }
24608 return featSupported;
24609}
24610
24611/**
24612 @brief WDI_getFwWlanFeatCaps
24613 WDI API that returns whether the feature passed to it as enum value in
24614 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
24615 variable storing host capability bitmap to find this. This can be used by
24616 other moduels to decide certain things like call different APIs based on
24617 whether a particular feature is supported.
24618
24619 @param
24620
24621 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
24622 in wlan_hal_msg.h.
24623
24624 @see
24625 @return
24626 0 - if the feature is NOT supported in FW
24627 any non-zero value - if the feature is SUPPORTED in FW.
24628*/
24629wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
24630{
24631 wpt_uint8 featSupported = 0;
24632 if (gpFwWlanFeatCaps != NULL)
24633 {
24634 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
24635 }
24636 else
24637 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024638 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024639 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024640 }
24641 return featSupported;
24642}
Mohit Khanna4a70d262012-09-11 16:30:12 -070024643
24644#ifdef WLAN_FEATURE_11AC
24645WDI_Status
24646WDI_ProcessUpdateVHTOpModeReq
24647(
24648 WDI_ControlBlockType* pWDICtx,
24649 WDI_EventInfoType* pEventData
24650)
24651{
24652 WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL;
24653 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24654 wpt_uint8* pSendBuffer = NULL;
24655 wpt_uint16 usDataOffset = 0;
24656 wpt_uint16 usSendSize = 0;
24657
24658 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24659
24660 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24661 "%s", __FUNCTION__);
24662
24663 /*-------------------------------------------------------------------------
24664 Sanity check
24665 -------------------------------------------------------------------------*/
24666 if (( NULL == pEventData ) ||
24667 ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) ||
24668 ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc)))
24669 {
24670 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24671 "%s: Invalid parameters", __FUNCTION__);
24672 WDI_ASSERT(0);
24673 return WDI_STATUS_E_FAILURE;
24674 }
24675
24676 /*-----------------------------------------------------------------------
24677 Get message buffer
24678 -----------------------------------------------------------------------*/
24679 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ,
24680 sizeof(WDI_UpdateVHTOpMode),
24681 &pSendBuffer, &usDataOffset, &usSendSize))||
24682 ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) )))
24683 {
24684 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24685 "Unable to get send buffer in update vht opMode req");
24686 WDI_ASSERT(0);
24687 return WDI_STATUS_E_FAILURE;
24688 }
24689
24690 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24691 "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId);
24692
24693 wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams,
24694 sizeof(WDI_UpdateVHTOpMode));
24695
24696 /*-------------------------------------------------------------------------
24697 Send Start Request to HAL
24698 -------------------------------------------------------------------------*/
24699 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24700 wdiVHTOpModeCb,
24701 pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP);
24702
24703}
24704
24705WDI_Status
24706WDI_UpdateVHTOpModeReq
24707(
24708 WDI_UpdateVHTOpMode *pData,
24709 WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb,
24710 void* pUserData
24711)
24712{
24713 WDI_EventInfoType wdiEventData;
24714
24715 /*------------------------------------------------------------------------
24716 Sanity Check
24717 ------------------------------------------------------------------------*/
24718 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24719 {
24720 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24721 "WDI API call before module is initialized - Fail request");
24722
24723 return WDI_STATUS_E_NOT_ALLOWED;
24724 }
24725
24726 /*------------------------------------------------------------------------
24727 Fill in Event data and post to the Main FSM
24728 ------------------------------------------------------------------------*/
24729 wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ;
24730 wdiEventData.pEventData = pData;
24731 wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode);
24732 wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb;
24733 wdiEventData.pUserData = pUserData;
24734
24735 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24736 "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId);
24737
24738 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24739
24740}
24741#endif
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024742
24743/**
24744 @brief WDI_TransportChannelDebug -
24745 Display DXE Channel debugging information
24746 User may request to display DXE channel snapshot
24747 Or if host driver detects any abnormal stcuk may display
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024748
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024749 @param displaySnapshot : Dispaly DXE snapshot option
24750 @param enableStallDetect : Enable stall detect feature
24751 This feature will take effect to data performance
24752 Not integrate till fully verification
24753 @see
24754 @return none
24755*/
24756void WDI_TransportChannelDebug
24757(
24758 wpt_boolean displaySnapshot,
24759 wpt_boolean toggleStallDetect
24760)
24761{
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024762 WDTS_ChannelDebug(displaySnapshot, toggleStallDetect);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024763 return;
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -070024764}