blob: 006f58f75bacd98a97ab616be0b2640ef8ef59c1 [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;
14675 }
14676 else
14677 {
14678 //Delete the station in the table
14679 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14680 }
14681
14682 /*Notify UMAC*/
14683 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14684
Jeff Johnsone7245742012-09-05 17:12:55 -070014685 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014686}/*WDI_ProcessDelSTARsp*/
14687
14688
14689/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070014690 Security Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070014691==========================================================================*/
14692
14693/**
14694 @brief Process Set BSS Key Rsp function (called when a response
14695 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014696
14697 @param pWDICtx: pointer to the WLAN DAL context
14698 pEventData: pointer to the event information structure
14699
Jeff Johnson295189b2012-06-20 16:38:30 -070014700 @see
14701 @return Result of the function call
14702*/
14703WDI_Status
14704WDI_ProcessSetBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014705(
Jeff Johnson295189b2012-06-20 16:38:30 -070014706 WDI_ControlBlockType* pWDICtx,
14707 WDI_EventInfoType* pEventData
14708)
14709{
14710 WDI_Status wdiStatus;
14711 eHalStatus halStatus;
14712 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14713 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14714
14715 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014716 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014717 -------------------------------------------------------------------------*/
14718 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14719 ( NULL == pEventData->pEventData))
14720 {
14721 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14722 "%s: Invalid parameters", __FUNCTION__);
14723 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014724 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014725 }
14726
14727 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14728
14729 /*-------------------------------------------------------------------------
14730 Extract response and send it to UMAC
14731 -------------------------------------------------------------------------*/
14732 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014733 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014734
14735 if ( eHAL_STATUS_SUCCESS != halStatus )
14736 {
14737 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14738 "Set BSS Key failed with status %s (%d)",
14739 WDI_getHALStatusMsgString(halStatus),
14740 halStatus);
14741 /* send the status to UMAC, don't return from here*/
14742 }
14743
14744 /*Notify UMAC*/
14745 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14746
Jeff Johnsone7245742012-09-05 17:12:55 -070014747 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014748}/*WDI_ProcessSetBssKeyRsp*/
14749
14750/**
14751 @brief Process Remove BSS Key Rsp function (called when a response
14752 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014753
14754 @param pWDICtx: pointer to the WLAN DAL context
14755 pEventData: pointer to the event information structure
14756
Jeff Johnson295189b2012-06-20 16:38:30 -070014757 @see
14758 @return Result of the function call
14759*/
14760WDI_Status
14761WDI_ProcessRemoveBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014762(
Jeff Johnson295189b2012-06-20 16:38:30 -070014763 WDI_ControlBlockType* pWDICtx,
14764 WDI_EventInfoType* pEventData
14765)
14766{
14767 WDI_Status wdiStatus;
14768 eHalStatus halStatus;
14769 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14770 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14771
14772 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014773 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014774 -------------------------------------------------------------------------*/
14775 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14776 ( NULL == pEventData->pEventData))
14777 {
14778 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14779 "%s: Invalid parameters", __FUNCTION__);
14780 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014781 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014782 }
14783
14784 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14785
14786 /*-------------------------------------------------------------------------
14787 Extract response and send it to UMAC
14788 -------------------------------------------------------------------------*/
14789 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014790 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014791
14792 if ( eHAL_STATUS_SUCCESS != halStatus )
14793 {
14794 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14795 "Remove BSS Key failed with status %s (%d )",
14796 WDI_getHALStatusMsgString(halStatus),
14797 halStatus);
14798 /* send the status to UMAC, don't return from here*/
14799 }
14800
14801 /*Notify UMAC*/
14802 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14803
Jeff Johnsone7245742012-09-05 17:12:55 -070014804 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014805}/*WDI_ProcessSetBssKeyRsp*/
14806
14807
14808/**
14809 @brief Process Set STA Key Rsp function (called when a response
14810 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014811
14812 @param pWDICtx: pointer to the WLAN DAL context
14813 pEventData: pointer to the event information structure
14814
Jeff Johnson295189b2012-06-20 16:38:30 -070014815 @see
14816 @return Result of the function call
14817*/
14818WDI_Status
14819WDI_ProcessSetStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014820(
Jeff Johnson295189b2012-06-20 16:38:30 -070014821 WDI_ControlBlockType* pWDICtx,
14822 WDI_EventInfoType* pEventData
14823)
14824{
14825 WDI_Status wdiStatus;
14826 eHalStatus halStatus;
14827 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14828 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14829
14830 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014831 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014832 -------------------------------------------------------------------------*/
14833 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14834 ( NULL == pEventData->pEventData))
14835 {
14836 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14837 "%s: Invalid parameters", __FUNCTION__);
14838 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014839 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014840 }
14841
14842 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14843
14844 /*-------------------------------------------------------------------------
14845 Extract response and send it to UMAC
14846 -------------------------------------------------------------------------*/
14847 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014848 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014849
14850 if ( eHAL_STATUS_SUCCESS != halStatus )
14851 {
14852 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14853 "Set STA Key failed with status %s (%d)",
14854 WDI_getHALStatusMsgString(halStatus),
14855 halStatus);
14856 /* send the status to UMAC, don't return from here*/
14857 }
14858
14859 /*Notify UMAC*/
14860 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14861
Jeff Johnsone7245742012-09-05 17:12:55 -070014862 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014863}/*WDI_ProcessSetSTAKeyRsp*/
14864
14865/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014866 @brief Process Remove STA Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014867 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014868
14869 @param pWDICtx: pointer to the WLAN DAL context
14870 pEventData: pointer to the event information structure
14871
Jeff Johnson295189b2012-06-20 16:38:30 -070014872 @see
14873 @return Result of the function call
14874*/
14875WDI_Status
14876WDI_ProcessRemoveStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014877(
Jeff Johnson295189b2012-06-20 16:38:30 -070014878 WDI_ControlBlockType* pWDICtx,
14879 WDI_EventInfoType* pEventData
14880)
14881{
14882 WDI_Status wdiStatus;
14883 eHalStatus halStatus;
14884 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14885 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14886
14887 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014888 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014889 -------------------------------------------------------------------------*/
14890 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14891 ( NULL == pEventData->pEventData))
14892 {
14893 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14894 "%s: Invalid parameters", __FUNCTION__);
14895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014897 }
14898
14899 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14900
14901 /*-------------------------------------------------------------------------
14902 Extract response and send it to UMAC
14903 -------------------------------------------------------------------------*/
14904 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014905 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014906
14907 if ( eHAL_STATUS_SUCCESS != halStatus )
14908 {
14909 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14910 "Remove STA Key failed with status %s (%d)",
14911 WDI_getHALStatusMsgString(halStatus),
14912 halStatus);
14913 /* send the status to UMAC, don't return from here*/
14914 }
14915
14916 /*Notify UMAC*/
14917 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14918
Jeff Johnsone7245742012-09-05 17:12:55 -070014919 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014920}/*WDI_ProcessRemoveStaKeyRsp*/
14921
14922/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014923 @brief Process Set STA Bcast Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014924 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014925
14926 @param pWDICtx: pointer to the WLAN DAL context
14927 pEventData: pointer to the event information structure
14928
Jeff Johnson295189b2012-06-20 16:38:30 -070014929 @see
14930 @return Result of the function call
14931*/
14932WDI_Status
14933WDI_ProcessSetStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014934(
Jeff Johnson295189b2012-06-20 16:38:30 -070014935 WDI_ControlBlockType* pWDICtx,
14936 WDI_EventInfoType* pEventData
14937)
14938{
14939 WDI_Status wdiStatus;
14940 eHalStatus halStatus;
14941 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
14942 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14943
14944 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014945 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014946 -------------------------------------------------------------------------*/
14947 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14948 ( NULL == pEventData->pEventData))
14949 {
14950 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14951 "%s: Invalid parameters", __FUNCTION__);
14952 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014953 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014954 }
14955
14956 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14957
14958 /*-------------------------------------------------------------------------
14959 Extract response and send it to UMAC
14960 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014961 wpalMemoryCopy( &halStatus,
14962 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014963 sizeof(halStatus));
14964
Jeff Johnsone7245742012-09-05 17:12:55 -070014965 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014966
14967 if ( eHAL_STATUS_SUCCESS != halStatus )
14968 {
14969 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14970 "Set STA Key failed with status %s (%d)",
14971 WDI_getHALStatusMsgString(halStatus),
14972 halStatus);
14973 /* send the status to UMAC, don't return from here*/
14974 }
14975
14976 /*Notify UMAC*/
14977 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14978
Jeff Johnsone7245742012-09-05 17:12:55 -070014979 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014980}/*WDI_ProcessSetSTABcastKeyRsp*/
14981
14982/**
14983 @brief Process Remove STA Bcast Key Rsp function (called when a
14984 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014985
14986 @param pWDICtx: pointer to the WLAN DAL context
14987 pEventData: pointer to the event information structure
14988
Jeff Johnson295189b2012-06-20 16:38:30 -070014989 @see
14990 @return Result of the function call
14991*/
14992WDI_Status
14993WDI_ProcessRemoveStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014994(
Jeff Johnson295189b2012-06-20 16:38:30 -070014995 WDI_ControlBlockType* pWDICtx,
14996 WDI_EventInfoType* pEventData
14997)
14998{
14999 WDI_Status wdiStatus;
15000 eHalStatus halStatus;
15001 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
15002 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15003
15004 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015005 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015006 -------------------------------------------------------------------------*/
15007 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15008 ( NULL == pEventData->pEventData))
15009 {
15010 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15011 "%s: Invalid parameters", __FUNCTION__);
15012 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015013 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015014 }
15015
15016 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
15017
15018 /*-------------------------------------------------------------------------
15019 Extract response and send it to UMAC
15020 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015021 wpalMemoryCopy( &halStatus,
15022 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015023 sizeof(halStatus));
15024
Jeff Johnsone7245742012-09-05 17:12:55 -070015025 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015026
15027 if ( eHAL_STATUS_SUCCESS != halStatus )
15028 {
15029 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15030 "Remove STA Key failed with status %s (%d)",
15031 WDI_getHALStatusMsgString(halStatus),
15032 halStatus);
15033 /* send the status to UMAC, don't return from here*/
15034 }
15035
15036 /*Notify UMAC*/
15037 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15038
Jeff Johnsone7245742012-09-05 17:12:55 -070015039 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015040}/*WDI_ProcessRemoveStaBcastKeyRsp*/
15041
15042
15043/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015044 QoS and BA Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070015045==========================================================================*/
15046
15047/**
15048 @brief Process Add TSpec Rsp function (called when a response
15049 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015050
15051 @param pWDICtx: pointer to the WLAN DAL context
15052 pEventData: pointer to the event information structure
15053
Jeff Johnson295189b2012-06-20 16:38:30 -070015054 @see
15055 @return Result of the function call
15056*/
15057WDI_Status
15058WDI_ProcessAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015059(
Jeff Johnson295189b2012-06-20 16:38:30 -070015060 WDI_ControlBlockType* pWDICtx,
15061 WDI_EventInfoType* pEventData
15062)
15063{
15064 WDI_Status wdiStatus;
15065 eHalStatus halStatus;
15066 WDI_AddTsRspCb wdiAddTsRspCb;
15067 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15068
15069 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015070 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015071 -------------------------------------------------------------------------*/
15072 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15073 ( NULL == pEventData->pEventData))
15074 {
15075 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15076 "%s: Invalid parameters", __FUNCTION__);
15077 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015078 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015079 }
15080
15081 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
15082
15083 /*-------------------------------------------------------------------------
15084 Extract response and send it to UMAC
15085 -------------------------------------------------------------------------*/
15086 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015087 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015088
15089 /*Notify UMAC*/
15090 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15091
Jeff Johnsone7245742012-09-05 17:12:55 -070015092 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015093}/*WDI_ProcessAddTSpecRsp*/
15094
15095
15096/**
15097 @brief Process Del TSpec Rsp function (called when a response
15098 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015099
15100 @param pWDICtx: pointer to the WLAN DAL context
15101 pEventData: pointer to the event information structure
15102
Jeff Johnson295189b2012-06-20 16:38:30 -070015103 @see
15104 @return Result of the function call
15105*/
15106WDI_Status
15107WDI_ProcessDelTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015108(
Jeff Johnson295189b2012-06-20 16:38:30 -070015109 WDI_ControlBlockType* pWDICtx,
15110 WDI_EventInfoType* pEventData
15111)
15112{
15113 WDI_Status wdiStatus;
15114 eHalStatus halStatus;
15115 WDI_DelTsRspCb wdiDelTsRspCb;
15116 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15117
15118 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015119 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015120 -------------------------------------------------------------------------*/
15121 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15122 ( NULL == pEventData->pEventData))
15123 {
15124 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15125 "%s: Invalid parameters", __FUNCTION__);
15126 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015127 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015128 }
15129
15130 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
15131
15132 /*-------------------------------------------------------------------------
15133 Extract response and send it to UMAC
15134 -------------------------------------------------------------------------*/
15135 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015136 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015137
15138 /*Notify UMAC*/
15139 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15140
Jeff Johnsone7245742012-09-05 17:12:55 -070015141 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015142}/*WDI_ProcessDelTSpecRsp*/
15143
15144/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015145 @brief Process Update EDCA Parameters Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015146 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015147
15148 @param pWDICtx: pointer to the WLAN DAL context
15149 pEventData: pointer to the event information structure
15150
Jeff Johnson295189b2012-06-20 16:38:30 -070015151 @see
15152 @return Result of the function call
15153*/
15154WDI_Status
15155WDI_ProcessUpdateEDCAParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015156(
Jeff Johnson295189b2012-06-20 16:38:30 -070015157 WDI_ControlBlockType* pWDICtx,
15158 WDI_EventInfoType* pEventData
15159)
15160{
15161 WDI_Status wdiStatus;
15162 eHalStatus halStatus;
15163 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
15164 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15165
15166 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015167 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015168 -------------------------------------------------------------------------*/
15169 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15170 ( NULL == pEventData->pEventData))
15171 {
15172 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15173 "%s: Invalid parameters", __FUNCTION__);
15174 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015175 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015176 }
15177
15178 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
15179
15180 /*-------------------------------------------------------------------------
15181 Extract response and send it to UMAC
15182 -------------------------------------------------------------------------*/
15183 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015184 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015185
15186 /*Notify UMAC*/
15187 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15188
Jeff Johnsone7245742012-09-05 17:12:55 -070015189 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015190}/*WDI_ProcessUpdateEDCAParamsRsp*/
15191
15192
15193/**
15194 @brief Process Add BA Rsp function (called when a response
15195 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015196
15197 @param pWDICtx: pointer to the WLAN DAL context
15198 pEventData: pointer to the event information structure
15199
Jeff Johnson295189b2012-06-20 16:38:30 -070015200 @see
15201 @return Result of the function call
15202*/
15203WDI_Status
15204WDI_ProcessAddBASessionRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015205(
Jeff Johnson295189b2012-06-20 16:38:30 -070015206 WDI_ControlBlockType* pWDICtx,
15207 WDI_EventInfoType* pEventData
15208)
15209{
15210 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
15211
15212 tAddBASessionRspParams halBASessionRsp;
15213 WDI_AddBASessionRspParamsType wdiBASessionRsp;
15214
Jeff Johnsone7245742012-09-05 17:12:55 -070015215
Jeff Johnson295189b2012-06-20 16:38:30 -070015216 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15217
15218 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015219 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015220 -------------------------------------------------------------------------*/
15221 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15222 ( NULL == pEventData->pEventData))
15223 {
15224 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15225 "%s: Invalid parameters", __FUNCTION__);
15226 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015227 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015228 }
15229
15230 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
15231
15232 /*-------------------------------------------------------------------------
15233 Extract response and send it to UMAC
15234 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015235 wpalMemoryCopy( &halBASessionRsp,
15236 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015237 sizeof(halBASessionRsp));
15238
15239 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15240
Jeff Johnson43971f52012-07-17 12:26:56 -070015241 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015242 {
15243 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15244 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15245 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15246 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15247 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15248 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15249 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15250 }
15251
15252 /*Notify UMAC*/
15253 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15254
Jeff Johnsone7245742012-09-05 17:12:55 -070015255 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015256}/*WDI_ProcessAddSessionBARsp*/
15257
15258
15259/**
15260 @brief Process Del BA Rsp function (called when a response
15261 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015262
15263 @param pWDICtx: pointer to the WLAN DAL context
15264 pEventData: pointer to the event information structure
15265
Jeff Johnson295189b2012-06-20 16:38:30 -070015266 @see
15267 @return Result of the function call
15268*/
15269WDI_Status
15270WDI_ProcessDelBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015271(
Jeff Johnson295189b2012-06-20 16:38:30 -070015272 WDI_ControlBlockType* pWDICtx,
15273 WDI_EventInfoType* pEventData
15274)
15275{
15276 WDI_Status wdiStatus;
15277 eHalStatus halStatus;
15278 WDI_DelBARspCb wdiDelBARspCb;
15279 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15280
15281 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015282 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015283 -------------------------------------------------------------------------*/
15284 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15285 ( NULL == pEventData->pEventData))
15286 {
15287 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15288 "%s: Invalid parameters", __FUNCTION__);
15289 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015290 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015291 }
15292
15293 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15294
15295 /*-------------------------------------------------------------------------
15296 Extract response and send it to UMAC
15297 -------------------------------------------------------------------------*/
15298 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015299 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015300
15301 if ( eHAL_STATUS_SUCCESS == halStatus )
15302 {
15303 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15304 }
15305
15306 /*Notify UMAC*/
15307 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15308
Jeff Johnsone7245742012-09-05 17:12:55 -070015309 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015310}/*WDI_ProcessDelBARsp*/
15311
15312#ifdef FEATURE_WLAN_CCX
15313/**
15314 @brief Process TSM Stats Rsp function (called when a response
15315 is being received over the bus from HAL)
15316
15317 @param pWDICtx: pointer to the WLAN DAL context
15318 pEventData: pointer to the event information structure
15319
15320 @see
15321 @return Result of the function call
15322*/
15323WDI_Status
15324WDI_ProcessTsmStatsRsp
15325(
15326 WDI_ControlBlockType* pWDICtx,
15327 WDI_EventInfoType* pEventData
15328)
15329{
15330 WDI_TsmRspCb wdiTsmStatsRspCb;
15331 tTsmStatsRspMsg halTsmStatsRspMsg;
15332 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15333 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15334
15335 /*-------------------------------------------------------------------------
15336 Sanity check
15337 -------------------------------------------------------------------------*/
15338 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15339 ( NULL == pEventData->pEventData))
15340 {
15341 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15342 "%s: Invalid parameters", __FUNCTION__);
15343 WDI_ASSERT(0);
15344 return WDI_STATUS_E_FAILURE;
15345 }
15346
15347 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15348
15349 /*-------------------------------------------------------------------------
15350 Unpack HAL Response Message - the header was already extracted by the
15351 main Response Handling procedure
15352 -------------------------------------------------------------------------*/
15353 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15354 pEventData->pEventData,
15355 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15356
15357 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15358 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15359 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15360 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15361 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15362 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15363 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15364 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15365 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15366 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15367 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15368 halTsmStatsRspMsg.tsmStatsRspParams.status);
15369
15370 /*Notify UMAC*/
15371 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15372
15373 return WDI_STATUS_SUCCESS;
15374}/*WDI_ProcessTsmStatsRsp*/
15375
15376#endif
15377
15378
15379
15380/**
15381 @brief Process Flush AC Rsp function (called when a response
15382 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015383
15384 @param pWDICtx: pointer to the WLAN DAL context
15385 pEventData: pointer to the event information structure
15386
Jeff Johnson295189b2012-06-20 16:38:30 -070015387 @see
15388 @return Result of the function call
15389*/
15390WDI_Status
15391WDI_ProcessFlushAcRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015392(
Jeff Johnson295189b2012-06-20 16:38:30 -070015393 WDI_ControlBlockType* pWDICtx,
15394 WDI_EventInfoType* pEventData
15395)
15396{
15397 WDI_Status wdiStatus;
15398 eHalStatus halStatus;
15399 WDI_FlushAcRspCb wdiFlushAcRspCb;
15400 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15401
15402 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015403 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015404 -------------------------------------------------------------------------*/
15405 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15406 ( NULL == pEventData->pEventData))
15407 {
15408 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15409 "%s: Invalid parameters", __FUNCTION__);
15410 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015411 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015412 }
15413
15414 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15415
15416 /*-------------------------------------------------------------------------
15417 Extract response and send it to UMAC
15418 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015419 wpalMemoryCopy( &halStatus,
15420 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015421 sizeof(halStatus));
15422
Jeff Johnsone7245742012-09-05 17:12:55 -070015423 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015424
15425 /*Notify UMAC*/
15426 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15427
Jeff Johnsone7245742012-09-05 17:12:55 -070015428 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015429}/*WDI_ProcessFlushAcRsp*/
15430
15431/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015432 @brief Process BT AMP event Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015433 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015434
15435 @param pWDICtx: pointer to the WLAN DAL context
15436 pEventData: pointer to the event information structure
15437
Jeff Johnson295189b2012-06-20 16:38:30 -070015438 @see
15439 @return Result of the function call
15440*/
15441WDI_Status
15442WDI_ProcessBtAmpEventRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015443(
Jeff Johnson295189b2012-06-20 16:38:30 -070015444 WDI_ControlBlockType* pWDICtx,
15445 WDI_EventInfoType* pEventData
15446)
15447{
15448 WDI_Status wdiStatus;
15449 eHalStatus halStatus;
15450 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15451 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15452
15453 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015454 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015455 -------------------------------------------------------------------------*/
15456 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15457 ( NULL == pEventData->pEventData))
15458 {
15459 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15460 "%s: Invalid parameters", __FUNCTION__);
15461 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015462 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015463 }
15464
15465 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15466
15467 /*-------------------------------------------------------------------------
15468 Extract response and send it to UMAC
15469 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015470 wpalMemoryCopy( &halStatus,
15471 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015472 sizeof(halStatus));
15473
Jeff Johnsone7245742012-09-05 17:12:55 -070015474 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015475
15476 /*Notify UMAC*/
15477 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15478
Jeff Johnsone7245742012-09-05 17:12:55 -070015479 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015480}/*WDI_ProcessBtAmpEventRsp*/
15481
15482
15483/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015484 @brief Process ADD STA SELF Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070015485 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015486
15487 @param pWDICtx: pointer to the WLAN DAL context
15488 pEventData: pointer to the event information structure
15489
Jeff Johnson295189b2012-06-20 16:38:30 -070015490 @see
15491 @return Result of the function call
15492*/
15493WDI_Status
15494WDI_ProcessAddSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015495(
Jeff Johnson295189b2012-06-20 16:38:30 -070015496 WDI_ControlBlockType* pWDICtx,
15497 WDI_EventInfoType* pEventData
15498)
15499{
15500 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15501 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15502 tAddStaSelfRspMsg halAddStaSelfRsp;
15503 WDI_AddStaParams wdiAddSTAParam = {0};
15504 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15505
15506 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015507 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015508 -------------------------------------------------------------------------*/
15509 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15510 ( NULL == pEventData->pEventData))
15511 {
15512 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15513 "%s: Invalid parameters", __FUNCTION__);
15514 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015515 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015516 }
15517
Jeff Johnsone7245742012-09-05 17:12:55 -070015518 wdiAddSTASelfReqParamsRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070015519 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15520
15521 /*-------------------------------------------------------------------------
15522 Extract response and send it to UMAC
15523 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015524 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15525 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015526 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15527
15528
Jeff Johnsone7245742012-09-05 17:12:55 -070015529 wdiAddSTASelfParams.wdiStatus =
15530 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015531
Jeff Johnsone7245742012-09-05 17:12:55 -070015532 wdiAddSTASelfParams.ucSTASelfIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015533 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015534 wdiAddSTASelfParams.dpuIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015535 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015536 wdiAddSTASelfParams.dpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015537 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15538
15539 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15540 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15541 WDI_MAC_ADDR_LEN);
15542
15543
15544#ifdef HAL_SELF_STA_PER_BSS
15545
15546 /* At this point add the self-STA */
15547
15548 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15549 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15550 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15551
15552 //all DPU indices are the same for self STA
15553
15554 /*DPU Information*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015555 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015556 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15557 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15558 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15559 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15560 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15561
15562 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15563 WDI_MAC_ADDR_LEN);
15564
15565 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15566 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15567
Jeff Johnsone7245742012-09-05 17:12:55 -070015568 if(halAddStaSelfRsp.addStaSelfRspParams.status
Jeff Johnson295189b2012-06-20 16:38:30 -070015569 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15570 {
15571 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15572 }
15573#endif
15574
15575 /*Notify UMAC*/
15576 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15577
Jeff Johnsone7245742012-09-05 17:12:55 -070015578 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015579}/*WDI_ProcessAddSTASelfRsp*/
15580
15581
15582
15583/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015584 @brief WDI_ProcessDelSTASelfRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015585 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015586
15587 @param pWDICtx: pointer to the WLAN DAL context
15588 pEventData: pointer to the event information structure
15589
Jeff Johnson295189b2012-06-20 16:38:30 -070015590 @see
15591 @return Result of the function call
15592*/
15593WDI_Status
15594WDI_ProcessDelSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015595(
Jeff Johnson295189b2012-06-20 16:38:30 -070015596 WDI_ControlBlockType* pWDICtx,
15597 WDI_EventInfoType* pEventData
15598)
15599{
15600 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15601 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15602 tDelStaSelfRspParams delStaSelfRspParams;
15603 wpt_uint8 ucStaIdx;
15604
15605 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15606
15607 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015608 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015609 -------------------------------------------------------------------------*/
15610 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15611 ( NULL == pEventData->pEventData))
15612 {
15613 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15614 "%s: Invalid parameters", __FUNCTION__);
15615 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015616 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015617 }
15618
15619 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15620
15621 /*-------------------------------------------------------------------------
15622 Extract response and send it to UMAC
15623 -------------------------------------------------------------------------*/
15624
Jeff Johnsone7245742012-09-05 17:12:55 -070015625 wpalMemoryCopy( &delStaSelfRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070015626 (wpt_uint8*)pEventData->pEventData,
15627 sizeof(tDelStaSelfRspParams));
15628
Jeff Johnsone7245742012-09-05 17:12:55 -070015629 wdiDelStaSelfRspParams.wdiStatus =
15630 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015631
Jeff Johnsone7245742012-09-05 17:12:55 -070015632 /* delStaSelfRspParams.status is not
Jeff Johnson295189b2012-06-20 16:38:30 -070015633 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15634 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15635 {
15636 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070015637 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070015638 delStaSelfRspParams.selfMacAddr,
15639 &ucStaIdx);
15640 if(WDI_STATUS_E_FAILURE == wdiStatus)
15641 {
15642 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15643 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15644 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015645 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015646 }
15647 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15648 }
15649
15650 /*Notify UMAC*/
15651 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15652
15653 return WDI_STATUS_SUCCESS;
15654}
15655
Jeff Johnsone7245742012-09-05 17:12:55 -070015656#ifdef FEATURE_OEM_DATA_SUPPORT
15657/**
15658 @brief Start Oem Data Rsp function (called when a
15659 response is being received over the bus from HAL)
Jeff Johnson295189b2012-06-20 16:38:30 -070015660
Jeff Johnsone7245742012-09-05 17:12:55 -070015661 @param pWDICtx: pointer to the WLAN DAL context
15662 pEventData: pointer to the event information structure
15663
15664 @see
15665 @return Result of the function call
15666*/
15667#define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName)
15668
15669WDI_Status
15670WDI_ProcessStartOemDataRsp
15671(
15672 WDI_ControlBlockType* pWDICtx,
15673 WDI_EventInfoType* pEventData
15674)
15675{
15676 WDI_oemDataRspCb wdiOemDataRspCb;
15677 WDI_oemDataRspParamsType* wdiOemDataRspParams;
15678 tStartOemDataRspParams* halStartOemDataRspParams;
15679
15680 /*-------------------------------------------------------------------------
15681 Sanity check
15682 -------------------------------------------------------------------------*/
15683 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15684 ( NULL == pEventData->pEventData))
15685 {
15686 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15687 "%s: Invalid parameters", __FUNCTION__);
15688 WDI_ASSERT(0);
15689 return WDI_STATUS_E_FAILURE;
15690 }
15691
15692 wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB;
15693
15694 /*-------------------------------------------------------------------------
15695 Extract response and send it to UMAC
15696 -------------------------------------------------------------------------*/
15697 halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData;
15698
15699
15700 //It is the responsibility of the application code to check for failure
15701 //conditions!
15702
15703 //Allocate memory for WDI OEM DATA RSP structure
15704 wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ;
15705
15706 if(NULL == wdiOemDataRspParams)
15707 {
15708 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15709 "Failed to allocate memory in OEM DATA Response %x %x %x ",
15710 pWDICtx, pEventData, pEventData->pEventData);
15711 WDI_ASSERT(0);
15712 return WDI_STATUS_E_FAILURE;
15713 }
15714
15715 /* Populate WDI structure members */
15716 wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE);
15717
15718 /*Notify UMAC*/
15719 wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData);
15720
15721 //Free memory allocated for WDI OEM_DATA MEAS RSP structure
15722 wpalMemoryFree(wdiOemDataRspParams);
15723
15724 return WDI_STATUS_SUCCESS;
15725}/*WDI_PrcoessStartOemDataRsp*/
15726#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070015727
15728/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015729 Miscellaneous Control Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070015730===========================================================================*/
15731
15732/**
15733 @brief Process Channel Switch Rsp function (called when a response
15734 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015735
15736 @param pWDICtx: pointer to the WLAN DAL context
15737 pEventData: pointer to the event information structure
15738
Jeff Johnson295189b2012-06-20 16:38:30 -070015739 @see
15740 @return Result of the function call
15741*/
15742WDI_Status
15743WDI_ProcessChannelSwitchRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015744(
Jeff Johnson295189b2012-06-20 16:38:30 -070015745 WDI_ControlBlockType* pWDICtx,
15746 WDI_EventInfoType* pEventData
15747)
15748{
15749 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15750 WDI_SwitchChRspCb wdiChSwitchRspCb;
15751 tSwitchChannelRspParams halSwitchChannelRsp;
15752 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15753
15754 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015755 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015756 -------------------------------------------------------------------------*/
15757 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15758 ( NULL == pEventData->pEventData))
15759 {
15760 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15761 "%s: Invalid parameters", __FUNCTION__);
15762 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015763 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015764 }
15765
15766 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15767
15768 /*-------------------------------------------------------------------------
15769 Extract response and send it to UMAC
15770 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015771 wpalMemoryCopy( &halSwitchChannelRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -070015772 (wpt_uint8*)pEventData->pEventData,
15773 sizeof(halSwitchChannelRsp));
15774
Jeff Johnsone7245742012-09-05 17:12:55 -070015775 wdiSwitchChRsp.wdiStatus =
15776 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015777 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15778
15779#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070015780 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070015781#endif
15782
15783 /*Notify UMAC*/
15784 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15785
Jeff Johnsone7245742012-09-05 17:12:55 -070015786 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015787}/*WDI_ProcessChannelSwitchRsp*/
15788
15789
15790/**
15791 @brief Process Config STA Rsp function (called when a response
15792 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015793
15794 @param pWDICtx: pointer to the WLAN DAL context
15795 pEventData: pointer to the event information structure
15796
Jeff Johnson295189b2012-06-20 16:38:30 -070015797 @see
15798 @return Result of the function call
15799*/
15800WDI_Status
15801WDI_ProcessConfigStaRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015802(
Jeff Johnson295189b2012-06-20 16:38:30 -070015803 WDI_ControlBlockType* pWDICtx,
15804 WDI_EventInfoType* pEventData
15805)
15806{
15807 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15808 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15809 WDI_AddStaParams wdiAddSTAParam;
15810
15811 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015812 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015813
Jeff Johnsone7245742012-09-05 17:12:55 -070015814 tConfigStaRspMsg halConfigStaRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070015815 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15816
15817 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015818 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015819 -------------------------------------------------------------------------*/
15820 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15821 ( NULL == pEventData->pEventData))
15822 {
15823 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15824 "%s: Invalid parameters", __FUNCTION__);
15825 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015826 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015827 }
15828
15829 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15830
15831 /*-------------------------------------------------------------------------
15832 Extract response and send it to UMAC
15833 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015834 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15835 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015836 sizeof(halConfigStaRsp.configStaRspParams));
15837
15838
15839 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15840 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15841 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15842 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15843 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15844
15845 /* MAC Address of STA - take from cache as it does not come back in the
15846 response*/
15847 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070015848 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015849 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015850
15851 wdiCfgSTAParams.wdiStatus =
15852 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015853
15854 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15855 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15856 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15857
15858 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15859 {
15860 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15861 {
15862 /* ADD STA to table */
Jeff Johnsone7245742012-09-05 17:12:55 -070015863 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015864 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15865 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015866
Jeff Johnson295189b2012-06-20 16:38:30 -070015867 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015868 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070015869 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070015870 wdiAddSTAParam.ucHTCapable =
15871 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15872 wdiAddSTAParam.ucStaType =
15873 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15874
Jeff Johnson295189b2012-06-20 16:38:30 -070015875 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070015876 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15877 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015878 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015879
15880 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15881 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15882 WDI_MAC_ADDR_LEN);
15883
15884 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15885 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15886 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070015887
15888 if ( NULL == pBSSSes )
15889 {
15890 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15891 "Association for this BSSID is not in place");
Jeff Johnsone7245742012-09-05 17:12:55 -070015892
Jeff Johnson295189b2012-06-20 16:38:30 -070015893 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015894 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070015895 }
15896
15897 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015898 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015899 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015900 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015901 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015902 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015903 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015904 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015905 halConfigStaRsp.configStaRspParams.ucBcastSig;
15906 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15907 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015908
Jeff Johnson295189b2012-06-20 16:38:30 -070015909 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15910 }
15911 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15912 {
15913 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
15914
Jeff Johnsone7245742012-09-05 17:12:55 -070015915 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015916 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015917 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015918 halConfigStaRsp.configStaRspParams.ucBcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015919 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015920 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015921 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015922 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015923 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015924 halConfigStaRsp.configStaRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015925 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015926 halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015927 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070015928 halConfigStaRsp.configStaRspParams.ucUcastSig;
15929 }
15930 }
15931
15932 /*Notify UMAC*/
15933 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
15934
Jeff Johnsone7245742012-09-05 17:12:55 -070015935 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015936}/*WDI_ProcessConfigStaRsp*/
15937
15938
15939/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015940 @brief Process Set Link State Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015941 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015942
15943 @param pWDICtx: pointer to the WLAN DAL context
15944 pEventData: pointer to the event information structure
15945
Jeff Johnson295189b2012-06-20 16:38:30 -070015946 @see
15947 @return Result of the function call
15948*/
15949WDI_Status
15950WDI_ProcessSetLinkStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015951(
Jeff Johnson295189b2012-06-20 16:38:30 -070015952 WDI_ControlBlockType* pWDICtx,
15953 WDI_EventInfoType* pEventData
15954)
15955{
15956 WDI_Status wdiStatus;
15957 eHalStatus halStatus;
15958 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
15959
15960 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015961 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015962 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15963
15964 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015965 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015966 -------------------------------------------------------------------------*/
15967 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15968 ( NULL == pEventData->pEventData))
15969 {
15970 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15971 "%s: Invalid parameters", __FUNCTION__);
15972 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015973 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015974 }
15975
15976 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
15977
15978 wpalMutexAcquire(&pWDICtx->wptMutex);
15979
15980 /*If the link is being transitioned to idle - the BSS is to be deleted
15981 - this type of ending a session is possible when UMAC has failed an
15982 - association session during Join*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015983 if ( WDI_LINK_IDLE_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070015984 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15985 {
15986 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015987 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070015988 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015989 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15990 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
15991 &pBSSSes);
15992
Jeff Johnson295189b2012-06-20 16:38:30 -070015993 /*-----------------------------------------------------------------------
15994 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070015995 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070015996 -----------------------------------------------------------------------*/
15997 if ( NULL == pBSSSes )
15998 {
15999 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
16000 "Set link response received outside association session");
16001 }
16002 else
16003 {
16004 /* For BT AMP roles no need to delete the sessions if assoc fails. There
16005 will be del BSS coming after this to stop the beaconing & cleaning up the
16006 sessions*/
16007 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
16008 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
16009 {
16010 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016011 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070016012 -----------------------------------------------------------------------*/
16013 WDI_DeleteSession(pWDICtx, pBSSSes);
16014
16015 /*-----------------------------------------------------------------------
16016 Check to see if this association is in progress - if so disable the
16017 flag as this has ended
16018 -----------------------------------------------------------------------*/
16019 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
Jeff Johnsone7245742012-09-05 17:12:55 -070016020 {
Jeff Johnson295189b2012-06-20 16:38:30 -070016021 /*Association no longer in progress */
16022 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16023 /*Association no longer in progress - prepare pending assoc for processing*/
16024 WDI_DequeueAssocRequest(pWDICtx);
16025 }
16026 }
16027 }
16028 }
16029 /* If the link state has been set to POST ASSOC, reset the "association in
16030 progress" flag */
Jeff Johnsone7245742012-09-05 17:12:55 -070016031 if ( WDI_LINK_POSTASSOC_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016032 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16033 {
16034 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16035 WDI_DequeueAssocRequest(pWDICtx);
16036 }
16037
16038 wpalMutexRelease(&pWDICtx->wptMutex);
16039
16040 /*-------------------------------------------------------------------------
16041 Extract response and send it to UMAC
16042 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016043 wpalMemoryCopy( &halStatus,
16044 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016045 sizeof(halStatus));
16046
Jeff Johnsone7245742012-09-05 17:12:55 -070016047 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016048
16049 /*Notify UMAC*/
16050 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16051
Jeff Johnsone7245742012-09-05 17:12:55 -070016052 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016053}/*WDI_ProcessSetLinkStateRsp*/
16054
16055/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016056 @brief Process Get Stats Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016057 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016058
16059 @param pWDICtx: pointer to the WLAN DAL context
16060 pEventData: pointer to the event information structure
16061
Jeff Johnson295189b2012-06-20 16:38:30 -070016062 @see
16063 @return Result of the function call
16064*/
16065WDI_Status
16066WDI_ProcessGetStatsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016067(
Jeff Johnson295189b2012-06-20 16:38:30 -070016068 WDI_ControlBlockType* pWDICtx,
16069 WDI_EventInfoType* pEventData
16070)
16071{
16072 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
16073 WDI_GetStatsRspCb wdiGetStatsRspCb;
16074 tHalStatsRspParams* pHalStatsRspParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070016075
Jeff Johnson295189b2012-06-20 16:38:30 -070016076 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16077
16078 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016079 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016080 -------------------------------------------------------------------------*/
16081 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16082 ( NULL == pEventData->pEventData))
16083 {
16084 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16085 "%s: Invalid parameters", __FUNCTION__);
16086 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016087 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016088 }
16089
16090 /*-------------------------------------------------------------------------
16091 Extract response and send it to UMAC
16092 -------------------------------------------------------------------------*/
16093 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
16094
16095 /*allocate the stats response buffer */
16096 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
16097 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
16098 + sizeof(WDI_GetStatsRspParamsType));
16099
16100 if(NULL == wdiGetStatsRsp)
16101 {
16102 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16103 "Failed to allocate memory in Get Stats Response %x %x %x ",
16104 pWDICtx, pEventData, pEventData->pEventData);
16105 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016106 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016107 }
16108
16109 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
16110
16111 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
16112 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
16113 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
16114 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
16115 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
16116 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
16117
16118 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
16119 wpalMemoryCopy(wdiGetStatsRsp + 1,
16120 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
16121 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
16122
16123 /*Notify UMAC*/
16124 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
16125
16126 wpalMemoryFree(wdiGetStatsRsp);
16127
Jeff Johnsone7245742012-09-05 17:12:55 -070016128 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016129}/*WDI_ProcessGetStatsRsp*/
16130
16131
16132/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016133 @brief Process Update Cfg Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016134 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016135
16136 @param pWDICtx: pointer to the WLAN DAL context
16137 pEventData: pointer to the event information structure
16138
Jeff Johnson295189b2012-06-20 16:38:30 -070016139 @see
16140 @return Result of the function call
16141*/
16142WDI_Status
16143WDI_ProcessUpdateCfgRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016144(
Jeff Johnson295189b2012-06-20 16:38:30 -070016145 WDI_ControlBlockType* pWDICtx,
16146 WDI_EventInfoType* pEventData
16147)
16148{
16149 WDI_Status wdiStatus;
16150 eHalStatus halStatus;
16151 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
16152 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16153
16154 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016155 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016156 -------------------------------------------------------------------------*/
16157 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16158 ( NULL == pEventData->pEventData))
16159 {
16160 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16161 "%s: Invalid parameters", __FUNCTION__);
16162 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016163 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016164 }
16165
16166 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
16167
16168 /*-------------------------------------------------------------------------
16169 Extract response and send it to UMAC
16170 -------------------------------------------------------------------------*/
16171 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016172 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016173
16174 /*Notify UMAC*/
16175 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16176
Jeff Johnsone7245742012-09-05 17:12:55 -070016177 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016178}/*WDI_ProcessUpdateCfgRsp*/
16179
16180
16181
16182/**
16183 @brief Process Add BA Rsp function (called when a response
16184 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016185
16186 @param pWDICtx: pointer to the WLAN DAL context
16187 pEventData: pointer to the event information structure
16188
Jeff Johnson295189b2012-06-20 16:38:30 -070016189 @see
16190 @return Result of the function call
16191*/
16192WDI_Status
16193WDI_ProcessAddBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016194(
Jeff Johnson295189b2012-06-20 16:38:30 -070016195 WDI_ControlBlockType* pWDICtx,
16196 WDI_EventInfoType* pEventData
16197)
16198{
16199 WDI_AddBARspCb wdiAddBARspCb;
16200
16201 tAddBARspParams halAddBARsp;
16202 WDI_AddBARspinfoType wdiAddBARsp;
16203
16204 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16205
16206 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016207 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016208 -------------------------------------------------------------------------*/
16209 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16210 ( NULL == pEventData->pEventData))
16211 {
16212 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16213 "%s: Invalid parameters", __FUNCTION__);
16214 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016215 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016216 }
16217
16218 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
16219
16220 /*-------------------------------------------------------------------------
16221 Extract response and send it to UMAC
16222 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016223 wpalMemoryCopy( &halAddBARsp,
16224 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016225 sizeof(halAddBARsp));
16226
16227 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
16228
Jeff Johnson43971f52012-07-17 12:26:56 -070016229 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070016230 {
16231 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
16232 }
16233
16234 /*Notify UMAC*/
16235 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
16236
Jeff Johnsone7245742012-09-05 17:12:55 -070016237 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016238}/*WDI_ProcessAddSessionBARsp*/
16239
16240/**
16241 @brief Process Add BA Rsp function (called when a response
16242 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016243
16244 @param pWDICtx: pointer to the WLAN DAL context
16245 pEventData: pointer to the event information structure
16246
Jeff Johnson295189b2012-06-20 16:38:30 -070016247 @see
16248 @return Result of the function call
16249*/
16250WDI_Status
16251WDI_ProcessTriggerBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016252(
Jeff Johnson295189b2012-06-20 16:38:30 -070016253 WDI_ControlBlockType* pWDICtx,
16254 WDI_EventInfoType* pEventData
16255)
16256{
16257 WDI_TriggerBARspCb wdiTriggerBARspCb;
16258
16259 tTriggerBARspParams* halTriggerBARsp;
16260 tTriggerBaRspCandidate* halBaCandidate;
16261 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
16262 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
16263 wpt_uint16 index;
16264 wpt_uint16 TidIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016265
Jeff Johnson295189b2012-06-20 16:38:30 -070016266 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16267
16268 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016269 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016270 -------------------------------------------------------------------------*/
16271 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16272 ( NULL == pEventData->pEventData))
16273 {
16274 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16275 "%s: Invalid parameters", __FUNCTION__);
16276 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016277 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016278 }
16279
16280 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
16281
16282 /*-------------------------------------------------------------------------
16283 Extract response and send it to UMAC
16284 -------------------------------------------------------------------------*/
16285 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
16286
Jeff Johnsone7245742012-09-05 17:12:55 -070016287 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
16288 halTriggerBARsp->baCandidateCnt *
Jeff Johnson295189b2012-06-20 16:38:30 -070016289 sizeof(WDI_TriggerBARspCandidateType));
16290 if(NULL == wdiTriggerBARsp)
16291 {
16292 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16293 "Failed to allocate memory in Trigger BA Response %x %x %x ",
16294 pWDICtx, pEventData, pEventData->pEventData);
16295 wpalMemoryFree(halTriggerBARsp);
16296 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016297 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016298 }
16299
16300 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
16301
16302 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
16303 {
16304 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
Jeff Johnsone7245742012-09-05 17:12:55 -070016305 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070016306 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
16307
16308 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16309 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16310
16311 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16312 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016313 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070016314 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16315 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16316 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016317 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070016318 halBaCandidate->baInfo[TidIndex].fBaEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070016319 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
Jeff Johnson295189b2012-06-20 16:38:30 -070016320 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16321 }
16322 wdiTriggerBARspCandidate++;
16323 halBaCandidate++;
16324 }
16325 }
16326
16327 /*Notify UMAC*/
16328 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16329
16330 wpalMemoryFree(wdiTriggerBARsp);
Jeff Johnsone7245742012-09-05 17:12:55 -070016331 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016332}/*WDI_ProcessAddSessionBARsp*/
16333
16334/**
16335 @brief Process Update Beacon Params Rsp function (called when a response
16336 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016337
16338 @param pWDICtx: pointer to the WLAN DAL context
16339 pEventData: pointer to the event information structure
16340
Jeff Johnson295189b2012-06-20 16:38:30 -070016341 @see
16342 @return Result of the function call
16343*/
16344WDI_Status
16345WDI_ProcessUpdateBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016346(
Jeff Johnson295189b2012-06-20 16:38:30 -070016347 WDI_ControlBlockType* pWDICtx,
16348 WDI_EventInfoType* pEventData
16349)
16350{
16351 WDI_Status wdiStatus;
16352 eHalStatus halStatus;
16353 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16354 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16355
16356 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016357 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016358 -------------------------------------------------------------------------*/
16359 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16360 ( NULL == pEventData->pEventData))
16361 {
16362 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16363 "%s: Invalid parameters", __FUNCTION__);
16364 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016365 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016366 }
16367
16368 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16369
16370 /*-------------------------------------------------------------------------
16371 Extract response and send it to UMAC
16372 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016373 wpalMemoryCopy( &halStatus,
16374 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016375 sizeof(halStatus));
16376
Jeff Johnsone7245742012-09-05 17:12:55 -070016377 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016378
16379 /*Notify UMAC*/
16380 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16381
Jeff Johnsone7245742012-09-05 17:12:55 -070016382 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016383}/*WDI_ProcessUpdateBeaconParamsRsp*/
16384
16385/**
16386 @brief Process Send Beacon template Rsp function (called when a response
16387 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016388
16389 @param pWDICtx: pointer to the WLAN DAL context
16390 pEventData: pointer to the event information structure
16391
Jeff Johnson295189b2012-06-20 16:38:30 -070016392 @see
16393 @return Result of the function call
16394*/
16395WDI_Status
16396WDI_ProcessSendBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016397(
Jeff Johnson295189b2012-06-20 16:38:30 -070016398 WDI_ControlBlockType* pWDICtx,
16399 WDI_EventInfoType* pEventData
16400)
16401{
16402 WDI_Status wdiStatus;
16403 eHalStatus halStatus;
16404 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16405 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16406
16407 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016408 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016409 -------------------------------------------------------------------------*/
16410 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16411 ( NULL == pEventData->pEventData))
16412 {
16413 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16414 "%s: Invalid parameters", __FUNCTION__);
16415 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016416 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016417 }
16418
16419 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16420
16421 /*-------------------------------------------------------------------------
16422 Extract response and send it to UMAC
16423 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016424 wpalMemoryCopy( &halStatus,
16425 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016426 sizeof(halStatus));
16427
Jeff Johnsone7245742012-09-05 17:12:55 -070016428 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016429
16430 /*Notify UMAC*/
16431 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16432
Jeff Johnsone7245742012-09-05 17:12:55 -070016433 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016434}/*WDI_ProcessSendBeaconParamsRsp*/
16435
Jeff Johnsone7245742012-09-05 17:12:55 -070016436
Jeff Johnson295189b2012-06-20 16:38:30 -070016437/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016438 @brief Process Update Probe Resp Template Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016439 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016440
16441 @param pWDICtx: pointer to the WLAN DAL context
16442 pEventData: pointer to the event information structure
16443
Jeff Johnson295189b2012-06-20 16:38:30 -070016444 @see
16445 @return Result of the function call
16446*/
16447WDI_Status
16448WDI_ProcessUpdateProbeRspTemplateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016449(
Jeff Johnson295189b2012-06-20 16:38:30 -070016450 WDI_ControlBlockType* pWDICtx,
16451 WDI_EventInfoType* pEventData
16452)
16453{
16454 WDI_Status wdiStatus;
16455 eHalStatus halStatus;
16456 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16457 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16458
16459 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016460 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016461 -------------------------------------------------------------------------*/
16462 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16463 ( NULL == pEventData->pEventData))
16464 {
16465 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16466 "%s: Invalid parameters", __FUNCTION__);
16467 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016468 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016469 }
16470
16471 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16472
16473 /*-------------------------------------------------------------------------
16474 Extract response and send it to UMAC
16475 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016476 wpalMemoryCopy( &halStatus,
16477 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016478 sizeof(halStatus));
16479
Jeff Johnsone7245742012-09-05 17:12:55 -070016480 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016481
16482 /*Notify UMAC*/
16483 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16484
Jeff Johnsone7245742012-09-05 17:12:55 -070016485 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016486}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16487
16488 /**
16489 @brief Process Set Max Tx Power Rsp function (called when a response
16490 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016491
16492 @param pWDICtx: pointer to the WLAN DAL context
16493 pEventData: pointer to the event information structure
16494
Jeff Johnson295189b2012-06-20 16:38:30 -070016495 @see
16496 @return Result of the function call
16497*/
16498WDI_Status
16499WDI_ProcessSetMaxTxPowerRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016500(
Jeff Johnson295189b2012-06-20 16:38:30 -070016501 WDI_ControlBlockType* pWDICtx,
16502 WDI_EventInfoType* pEventData
16503)
16504{
16505 tSetMaxTxPwrRspMsg halTxpowerrsp;
Jeff Johnsone7245742012-09-05 17:12:55 -070016506
Jeff Johnson295189b2012-06-20 16:38:30 -070016507 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070016508
Jeff Johnson295189b2012-06-20 16:38:30 -070016509 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16510 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16511
16512 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016513 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016514 -------------------------------------------------------------------------*/
16515 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16516 ( NULL == pEventData->pEventData))
16517 {
16518 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16519 "%s: Invalid parameters", __FUNCTION__);
16520 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016521 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016522 }
16523
16524 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16525
16526 /*-------------------------------------------------------------------------
16527 Extract response and send it to UMAC
16528 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016529 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16530 pEventData->pEventData,
16531 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070016532
16533 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16534 {
16535 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16536 "Error status returned in Set Max Tx Power Response ");
Jeff Johnsone7245742012-09-05 17:12:55 -070016537 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16538 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016539 }
16540
Jeff Johnsone7245742012-09-05 17:12:55 -070016541 wdiSetMaxTxPowerRspMsg.wdiStatus =
Jeff Johnson295189b2012-06-20 16:38:30 -070016542 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
Jeff Johnsone7245742012-09-05 17:12:55 -070016543 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
Jeff Johnson295189b2012-06-20 16:38:30 -070016544
16545 /*Notify UMAC*/
16546 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16547
Jeff Johnsone7245742012-09-05 17:12:55 -070016548 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016549}
16550
16551#ifdef WLAN_FEATURE_P2P
16552/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016553 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016554 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016555
16556 @param pWDICtx: pointer to the WLAN DAL context
16557 pEventData: pointer to the event information structure
16558
Jeff Johnson295189b2012-06-20 16:38:30 -070016559 @see
16560 @return Result of the function call
16561*/
16562WDI_Status
16563WDI_ProcessP2PGONOARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016564(
Jeff Johnson295189b2012-06-20 16:38:30 -070016565 WDI_ControlBlockType* pWDICtx,
16566 WDI_EventInfoType* pEventData
16567)
16568{
16569 WDI_Status wdiStatus;
16570 eHalStatus halStatus;
16571 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16572 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16573
16574 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016575 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016576 -------------------------------------------------------------------------*/
16577 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16578 ( NULL == pEventData->pEventData))
16579 {
16580 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16581 "%s: Invalid parameters", __FUNCTION__);
16582 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016583 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016584 }
16585
16586 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16587
16588 /*-------------------------------------------------------------------------
16589 Extract response and send it to UMAC
16590 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016591 wpalMemoryCopy( &halStatus,
16592 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016593 sizeof(halStatus));
16594
Jeff Johnsone7245742012-09-05 17:12:55 -070016595 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016596
16597 /*Notify UMAC*/
16598 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16599
Jeff Johnsone7245742012-09-05 17:12:55 -070016600 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016601}/*WDI_ProcessP2PGONOARsp*/
16602#endif
16603/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016604 @brief Process Enter IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016605 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016606
16607 @param pWDICtx: pointer to the WLAN DAL context
16608 pEventData: pointer to the event information structure
16609
Jeff Johnson295189b2012-06-20 16:38:30 -070016610 @see
16611 @return Result of the function call
16612*/
16613WDI_Status
16614WDI_ProcessEnterImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016615(
Jeff Johnson295189b2012-06-20 16:38:30 -070016616 WDI_ControlBlockType* pWDICtx,
16617 WDI_EventInfoType* pEventData
16618)
16619{
16620 WDI_Status wdiStatus;
16621 eHalStatus halStatus;
16622 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16623 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16624
16625 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016626 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016627 -------------------------------------------------------------------------*/
16628 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16629 ( NULL == pEventData->pEventData))
16630 {
16631 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16632 "%s: Invalid parameters", __FUNCTION__);
16633 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016634 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016635 }
16636
16637 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16638
16639 /*-------------------------------------------------------------------------
16640 Extract response and send it to UMAC
16641 -------------------------------------------------------------------------*/
16642 halStatus = *((eHalStatus*)pEventData->pEventData);
16643
Jeff Johnsone7245742012-09-05 17:12:55 -070016644 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016645
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016646 /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state.
16647 * Other module states are taken care by PMC.
16648 * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails??
16649 */
16650 if (wdiStatus != WDI_STATUS_SUCCESS) {
16651
16652 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16653 "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus);
16654 /* Call Back is not required as we are putting the DXE in FULL
16655 * and riva is already in full (IMPS RSP Failed)*/
16656 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16657 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016658 /*Notify UMAC*/
16659 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16660
Jeff Johnsone7245742012-09-05 17:12:55 -070016661 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016662}/*WDI_ProcessEnterImpsRsp*/
16663
16664/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016665 @brief Process Exit IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016666 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016667
16668 @param pWDICtx: pointer to the WLAN DAL context
16669 pEventData: pointer to the event information structure
16670
Jeff Johnson295189b2012-06-20 16:38:30 -070016671 @see
16672 @return Result of the function call
16673*/
16674WDI_Status
16675WDI_ProcessExitImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016676(
Jeff Johnson295189b2012-06-20 16:38:30 -070016677 WDI_ControlBlockType* pWDICtx,
16678 WDI_EventInfoType* pEventData
16679)
16680{
16681 WDI_Status wdiStatus;
16682 eHalStatus halStatus;
16683 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16684 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16685
16686 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016687 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016688 -------------------------------------------------------------------------*/
16689 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16690 ( NULL == pEventData->pEventData))
16691 {
16692 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16693 "%s: Invalid parameters", __FUNCTION__);
16694 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016695 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016696 }
16697
16698 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16699
16700 /*-------------------------------------------------------------------------
16701 Extract response and send it to UMAC
16702 -------------------------------------------------------------------------*/
16703 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016704 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016705
16706 // notify DTS that we are entering Full power
16707 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16708
16709 /*Notify UMAC*/
16710 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16711
Jeff Johnsone7245742012-09-05 17:12:55 -070016712 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016713}/*WDI_ProcessExitImpsRsp*/
16714
16715/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016716 @brief Process Enter BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016717 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016718
16719 @param pWDICtx: pointer to the WLAN DAL context
16720 pEventData: pointer to the event information structure
16721
Jeff Johnson295189b2012-06-20 16:38:30 -070016722 @see
16723 @return Result of the function call
16724*/
16725WDI_Status
16726WDI_ProcessEnterBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016727(
Jeff Johnson295189b2012-06-20 16:38:30 -070016728 WDI_ControlBlockType* pWDICtx,
16729 WDI_EventInfoType* pEventData
16730)
16731{
16732 WDI_Status wdiStatus;
16733 eHalStatus halStatus;
16734 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16735 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16736
16737 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016738 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016739 -------------------------------------------------------------------------*/
16740 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16741 ( NULL == pEventData->pEventData))
16742 {
16743 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16744 "%s: Invalid parameters", __FUNCTION__);
16745 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016746 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016747 }
16748
16749 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
16750
16751 /*-------------------------------------------------------------------------
16752 Extract response and send it to UMAC
16753 -------------------------------------------------------------------------*/
16754 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016755 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016756
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016757 /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state.
16758 * Other module states are taken care by PMC.
16759 * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails??
16760 */
16761 if (wdiStatus != WDI_STATUS_SUCCESS) {
16762
16763 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16764 "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus);
16765 /* Call Back is not required as we are putting the DXE in FULL
16766 * and riva is already in FULL (BMPS RSP Failed)*/
16767 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16768 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16769 }
16770
Jeff Johnson295189b2012-06-20 16:38:30 -070016771 /*Notify UMAC*/
16772 wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16773
Jeff Johnsone7245742012-09-05 17:12:55 -070016774 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016775}/*WDI_ProcessEnterBmpsRsp*/
16776
16777/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016778 @brief Process Exit BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016779 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016780
16781 @param pWDICtx: pointer to the WLAN DAL context
16782 pEventData: pointer to the event information structure
16783
Jeff Johnson295189b2012-06-20 16:38:30 -070016784 @see
16785 @return Result of the function call
16786*/
16787WDI_Status
16788WDI_ProcessExitBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016789(
Jeff Johnson295189b2012-06-20 16:38:30 -070016790 WDI_ControlBlockType* pWDICtx,
16791 WDI_EventInfoType* pEventData
16792)
16793{
16794 WDI_Status wdiStatus;
16795 eHalStatus halStatus;
16796 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
16797 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16798
16799 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016800 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016801 -------------------------------------------------------------------------*/
16802 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16803 ( NULL == pEventData->pEventData))
16804 {
16805 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16806 "%s: Invalid parameters", __FUNCTION__);
16807 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016808 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016809 }
16810
16811 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16812
16813 /*-------------------------------------------------------------------------
16814 Extract response and send it to UMAC
16815 -------------------------------------------------------------------------*/
16816 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016817 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016818
16819 // notify DTS that we are entering Full power
16820 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16821
16822 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16823
16824 /*Notify UMAC*/
16825 wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16826
Jeff Johnsone7245742012-09-05 17:12:55 -070016827 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016828}/*WDI_ProcessExitBmpsRsp*/
16829
16830/**
16831 @brief Process Enter UAPSD Rsp function (called when a response
16832 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016833
16834 @param pWDICtx: pointer to the WLAN DAL context
16835 pEventData: pointer to the event information structure
16836
Jeff Johnson295189b2012-06-20 16:38:30 -070016837 @see
16838 @return Result of the function call
16839*/
16840WDI_Status
16841WDI_ProcessEnterUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016842(
Jeff Johnson295189b2012-06-20 16:38:30 -070016843 WDI_ControlBlockType* pWDICtx,
16844 WDI_EventInfoType* pEventData
16845)
16846{
16847 WDI_Status wdiStatus;
16848 eHalStatus halStatus;
16849 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
16850 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16851
16852 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016853 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016854 -------------------------------------------------------------------------*/
16855 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16856 ( NULL == pEventData->pEventData))
16857 {
16858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16859 "%s: Invalid parameters", __FUNCTION__);
16860 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016861 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016862 }
16863
16864 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16865
16866 /*-------------------------------------------------------------------------
16867 Extract response and send it to UMAC
16868 -------------------------------------------------------------------------*/
16869 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016870 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016871
16872 if(WDI_STATUS_SUCCESS == wdiStatus)
16873 {
16874 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
16875 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
16876 // the traffic to decide when to suspend the trigger frames when there is no traffic
16877 // activity on the trigger enabled ACs
16878 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
16879
16880#ifdef WLAN_PERF
16881 // Increment the BD signature to refresh the fast path BD utilization
16882 pWDICtx->uBdSigSerialNum++;
16883#endif
16884 }
16885
16886 /*Notify UMAC*/
16887 wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16888
Jeff Johnsone7245742012-09-05 17:12:55 -070016889 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016890}/*WDI_ProcessEnterUapsdRsp*/
16891
16892/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016893 @brief Process Exit UAPSD Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016894 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016895
16896 @param pWDICtx: pointer to the WLAN DAL context
16897 pEventData: pointer to the event information structure
16898
Jeff Johnson295189b2012-06-20 16:38:30 -070016899 @see
16900 @return Result of the function call
16901*/
16902WDI_Status
16903WDI_ProcessExitUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016904(
Jeff Johnson295189b2012-06-20 16:38:30 -070016905 WDI_ControlBlockType* pWDICtx,
16906 WDI_EventInfoType* pEventData
16907)
16908{
16909 WDI_Status wdiStatus;
16910 eHalStatus halStatus;
16911 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
16912 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16913
16914 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016915 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016916 -------------------------------------------------------------------------*/
16917 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16918 ( NULL == pEventData->pEventData))
16919 {
16920 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16921 "%s: Invalid parameters", __FUNCTION__);
16922 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016923 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016924 }
16925
16926 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
16927
16928 /*-------------------------------------------------------------------------
16929 Extract response and send it to UMAC
16930 -------------------------------------------------------------------------*/
16931 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016932 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016933
16934 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
16935 // directly instead of the FW WQ.
16936 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
16937
16938#ifdef WLAN_PERF
16939 // Increment the BD signature to refresh the fast path BD utilization
16940 pWDICtx->uBdSigSerialNum++;
16941#endif
16942
16943 /*Notify UMAC*/
16944 wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16945
Jeff Johnsone7245742012-09-05 17:12:55 -070016946 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016947}/*WDI_ProcessExitUapsdRsp*/
16948
16949/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016950 @brief Process set UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016951 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016952
16953 @param pWDICtx: pointer to the WLAN DAL context
16954 pEventData: pointer to the event information structure
16955
Jeff Johnson295189b2012-06-20 16:38:30 -070016956 @see
16957 @return Result of the function call
16958*/
16959WDI_Status
16960WDI_ProcessSetUapsdAcParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016961(
Jeff Johnson295189b2012-06-20 16:38:30 -070016962 WDI_ControlBlockType* pWDICtx,
16963 WDI_EventInfoType* pEventData
16964)
16965{
16966 WDI_Status wdiStatus;
16967 eHalStatus halStatus;
16968 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
16969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16970
16971 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016972 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016973 -------------------------------------------------------------------------*/
16974 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16975 ( NULL == pEventData->pEventData))
16976 {
16977 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16978 "%s: Invalid parameters", __FUNCTION__);
16979 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016980 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016981 }
16982
16983 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
16984
16985 /*-------------------------------------------------------------------------
16986 Extract response and send it to UMAC
16987 -------------------------------------------------------------------------*/
16988 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016989 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016990
16991 /*Notify UMAC*/
16992 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16993
Jeff Johnsone7245742012-09-05 17:12:55 -070016994 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016995}/*WDI_ProcessSetUapsdAcParamsRsp*/
16996
16997/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016998 @brief Process update UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016999 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017000
17001 @param pWDICtx: pointer to the WLAN DAL context
17002 pEventData: pointer to the event information structure
17003
Jeff Johnson295189b2012-06-20 16:38:30 -070017004 @see
17005 @return Result of the function call
17006*/
17007WDI_Status
17008WDI_ProcessUpdateUapsdParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017009(
Jeff Johnson295189b2012-06-20 16:38:30 -070017010 WDI_ControlBlockType* pWDICtx,
17011 WDI_EventInfoType* pEventData
17012)
17013{
17014 WDI_Status wdiStatus;
17015 eHalStatus halStatus;
17016 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
17017 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17018
17019 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017020 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017021 -------------------------------------------------------------------------*/
17022 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17023 ( NULL == pEventData->pEventData))
17024 {
17025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17026 "%s: Invalid parameters", __FUNCTION__);
17027 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017028 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017029 }
17030
17031 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
17032
17033 /*-------------------------------------------------------------------------
17034 Extract response and send it to UMAC
17035 -------------------------------------------------------------------------*/
17036 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017037 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017038
17039 /*Notify UMAC*/
17040 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17041
Jeff Johnsone7245742012-09-05 17:12:55 -070017042 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017043}/*WDI_ProcessUpdateUapsdParamsRsp*/
17044
17045/**
17046 @brief Process Configure RXP filter Rsp function (called when a
17047 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017048
17049 @param pWDICtx: pointer to the WLAN DAL context
17050 pEventData: pointer to the event information structure
17051
Jeff Johnson295189b2012-06-20 16:38:30 -070017052 @see
17053 @return Result of the function call
17054*/
17055WDI_Status
17056WDI_ProcessConfigureRxpFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017057(
Jeff Johnson295189b2012-06-20 16:38:30 -070017058 WDI_ControlBlockType* pWDICtx,
17059 WDI_EventInfoType* pEventData
17060)
17061{
17062 WDI_Status wdiStatus;
17063 eHalStatus halStatus;
17064 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
17065 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17066
17067 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017068 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017069 -------------------------------------------------------------------------*/
17070 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17071 ( NULL == pEventData->pEventData))
17072 {
17073 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17074 "%s: Invalid parameters", __FUNCTION__);
17075 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017076 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017077 }
17078
17079 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
17080
17081 /*-------------------------------------------------------------------------
17082 Extract response and send it to UMAC
17083 -------------------------------------------------------------------------*/
17084 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017085 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017086
17087 /*Notify UMAC*/
17088 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17089
Jeff Johnsone7245742012-09-05 17:12:55 -070017090 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017091}/*WDI_ProcessConfigureRxpFilterRsp*/
17092
17093/**
17094 @brief Process Set beacon filter Rsp function (called when a
17095 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017096
17097 @param pWDICtx: pointer to the WLAN DAL context
17098 pEventData: pointer to the event information structure
17099
Jeff Johnson295189b2012-06-20 16:38:30 -070017100 @see
17101 @return Result of the function call
17102*/
17103WDI_Status
17104WDI_ProcessSetBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017105(
Jeff Johnson295189b2012-06-20 16:38:30 -070017106 WDI_ControlBlockType* pWDICtx,
17107 WDI_EventInfoType* pEventData
17108)
17109{
17110 WDI_Status wdiStatus;
17111 eHalStatus halStatus;
17112 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
17113 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17114
17115 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017116 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017117 -------------------------------------------------------------------------*/
17118 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17119 ( NULL == pEventData->pEventData))
17120 {
17121 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17122 "%s: Invalid parameters", __FUNCTION__);
17123 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017124 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017125 }
17126
17127 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
17128
17129 /*-------------------------------------------------------------------------
17130 Extract response and send it to UMAC
17131 -------------------------------------------------------------------------*/
17132 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017133 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017134
17135 /*Notify UMAC*/
17136 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17137
Jeff Johnsone7245742012-09-05 17:12:55 -070017138 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017139}/*WDI_ProcessSetBeaconFilterRsp*/
17140
17141/**
17142 @brief Process remove beacon filter Rsp function (called when a
17143 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017144
17145 @param pWDICtx: pointer to the WLAN DAL context
17146 pEventData: pointer to the event information structure
17147
Jeff Johnson295189b2012-06-20 16:38:30 -070017148 @see
17149 @return Result of the function call
17150*/
17151WDI_Status
17152WDI_ProcessRemBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017153(
Jeff Johnson295189b2012-06-20 16:38:30 -070017154 WDI_ControlBlockType* pWDICtx,
17155 WDI_EventInfoType* pEventData
17156)
17157{
17158 WDI_Status wdiStatus;
17159 eHalStatus halStatus;
17160 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
17161 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17162
17163 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017164 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017165 -------------------------------------------------------------------------*/
17166 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17167 ( NULL == pEventData->pEventData))
17168 {
17169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17170 "%s: Invalid parameters", __FUNCTION__);
17171 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017172 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017173 }
17174
17175 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
17176
17177 /*-------------------------------------------------------------------------
17178 Extract response and send it to UMAC
17179 -------------------------------------------------------------------------*/
17180 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017181 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017182
17183 /*Notify UMAC*/
17184 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17185
Jeff Johnsone7245742012-09-05 17:12:55 -070017186 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017187}/*WDI_ProcessRemBeaconFilterRsp*/
17188
17189/**
17190 @brief Process set RSSI thresholds Rsp function (called when a
17191 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017192
17193 @param pWDICtx: pointer to the WLAN DAL context
17194 pEventData: pointer to the event information structure
17195
Jeff Johnson295189b2012-06-20 16:38:30 -070017196 @see
17197 @return Result of the function call
17198*/
17199WDI_Status
17200WDI_ProcessSetRSSIThresoldsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017201(
Jeff Johnson295189b2012-06-20 16:38:30 -070017202 WDI_ControlBlockType* pWDICtx,
17203 WDI_EventInfoType* pEventData
17204)
17205{
17206 WDI_Status wdiStatus;
17207 eHalStatus halStatus;
17208 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
17209 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17210
17211 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017212 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017213 -------------------------------------------------------------------------*/
17214 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17215 ( NULL == pEventData->pEventData))
17216 {
17217 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17218 "%s: Invalid parameters", __FUNCTION__);
17219 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017220 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017221 }
17222
17223 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
17224
17225 /*-------------------------------------------------------------------------
17226 Extract response and send it to UMAC
17227 -------------------------------------------------------------------------*/
17228 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017229 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017230
17231 /*Notify UMAC*/
17232 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
17233
Jeff Johnsone7245742012-09-05 17:12:55 -070017234 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017235}/*WDI_ProcessSetRSSIThresoldsRsp*/
17236
17237/**
17238 @brief Process host offload Rsp function (called when a
17239 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017240
17241 @param pWDICtx: pointer to the WLAN DAL context
17242 pEventData: pointer to the event information structure
17243
Jeff Johnson295189b2012-06-20 16:38:30 -070017244 @see
17245 @return Result of the function call
17246*/
17247WDI_Status
17248WDI_ProcessHostOffloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017249(
Jeff Johnson295189b2012-06-20 16:38:30 -070017250 WDI_ControlBlockType* pWDICtx,
17251 WDI_EventInfoType* pEventData
17252)
17253{
17254 WDI_Status wdiStatus;
17255 eHalStatus halStatus;
17256 WDI_HostOffloadCb wdiHostOffloadCb;
17257 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17258
17259 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017260 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017261 -------------------------------------------------------------------------*/
17262 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17263 ( NULL == pEventData->pEventData))
17264 {
17265 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17266 "%s: Invalid parameters", __FUNCTION__);
17267 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017268 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017269 }
17270
17271 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
17272
17273 /*-------------------------------------------------------------------------
17274 Extract response and send it to UMAC
17275 -------------------------------------------------------------------------*/
17276 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017277 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017278
17279 /*Notify UMAC*/
17280 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
17281
Jeff Johnsone7245742012-09-05 17:12:55 -070017282 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017283}/*WDI_ProcessHostOffloadRsp*/
17284
17285/**
17286 @brief Process keep alive Rsp function (called when a
17287 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017288
17289 @param pWDICtx: pointer to the WLAN DAL context
17290 pEventData: pointer to the event information structure
17291
Jeff Johnson295189b2012-06-20 16:38:30 -070017292 @see
17293 @return Result of the function call
17294*/
17295WDI_Status
17296WDI_ProcessKeepAliveRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017297(
Jeff Johnson295189b2012-06-20 16:38:30 -070017298 WDI_ControlBlockType* pWDICtx,
17299 WDI_EventInfoType* pEventData
17300)
17301{
17302 WDI_Status wdiStatus;
17303 eHalStatus halStatus;
17304 WDI_KeepAliveCb wdiKeepAliveCb;
17305 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17306 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17307 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
17308
17309
17310 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017311 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017312 -------------------------------------------------------------------------*/
17313 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17314 ( NULL == pEventData->pEventData))
17315 {
17316 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17317 "%s: Invalid parameters", __FUNCTION__);
17318 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017319 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017320 }
17321
Jeff Johnsone7245742012-09-05 17:12:55 -070017322 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
17323
Jeff Johnson295189b2012-06-20 16:38:30 -070017324 /*-------------------------------------------------------------------------
17325 Extract response and send it to UMAC
17326 -------------------------------------------------------------------------*/
17327 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017328 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017329
17330 /*Notify UMAC*/
17331 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
17332
Jeff Johnsone7245742012-09-05 17:12:55 -070017333 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017334}/*WDI_ProcessKeepAliveRsp*/
17335
17336/**
17337 @brief Process wowl add ptrn Rsp function (called when a
17338 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017339
17340 @param pWDICtx: pointer to the WLAN DAL context
17341 pEventData: pointer to the event information structure
17342
Jeff Johnson295189b2012-06-20 16:38:30 -070017343 @see
17344 @return Result of the function call
17345*/
17346WDI_Status
17347WDI_ProcessWowlAddBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017348(
Jeff Johnson295189b2012-06-20 16:38:30 -070017349 WDI_ControlBlockType* pWDICtx,
17350 WDI_EventInfoType* pEventData
17351)
17352{
17353 WDI_Status wdiStatus;
17354 eHalStatus halStatus;
17355 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
17356 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17357
17358 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017359 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017360 -------------------------------------------------------------------------*/
17361 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17362 ( NULL == pEventData->pEventData))
17363 {
17364 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17365 "%s: Invalid parameters", __FUNCTION__);
17366 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017367 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017368 }
17369
17370 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17371
17372 /*-------------------------------------------------------------------------
17373 Extract response and send it to UMAC
17374 -------------------------------------------------------------------------*/
17375 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017376 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017377
17378 /*Notify UMAC*/
17379 wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17380
Jeff Johnsone7245742012-09-05 17:12:55 -070017381 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017382}/*WDI_ProcessWowlAddBcPtrnRsp*/
17383
17384/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017385 @brief Process wowl delete ptrn Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017386 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017387
17388 @param pWDICtx: pointer to the WLAN DAL context
17389 pEventData: pointer to the event information structure
17390
Jeff Johnson295189b2012-06-20 16:38:30 -070017391 @see
17392 @return Result of the function call
17393*/
17394WDI_Status
17395WDI_ProcessWowlDelBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017396(
Jeff Johnson295189b2012-06-20 16:38:30 -070017397 WDI_ControlBlockType* pWDICtx,
17398 WDI_EventInfoType* pEventData
17399)
17400{
17401 WDI_Status wdiStatus;
17402 eHalStatus halStatus;
17403 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
17404 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17405
17406 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017407 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017408 -------------------------------------------------------------------------*/
17409 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17410 ( NULL == pEventData->pEventData))
17411 {
17412 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17413 "%s: Invalid parameters", __FUNCTION__);
17414 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017415 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017416 }
17417
17418 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17419
17420 /*-------------------------------------------------------------------------
17421 Extract response and send it to UMAC
17422 -------------------------------------------------------------------------*/
17423 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017424 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017425
17426 /*Notify UMAC*/
17427 wdiWowlDelBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17428
Jeff Johnsone7245742012-09-05 17:12:55 -070017429 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017430}/*WDI_ProcessWowlDelBcPtrnRsp*/
17431
17432/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017433 @brief Process wowl enter Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017434 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017435
17436 @param pWDICtx: pointer to the WLAN DAL context
17437 pEventData: pointer to the event information structure
17438
Jeff Johnson295189b2012-06-20 16:38:30 -070017439 @see
17440 @return Result of the function call
17441*/
17442WDI_Status
17443WDI_ProcessWowlEnterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017444(
Jeff Johnson295189b2012-06-20 16:38:30 -070017445 WDI_ControlBlockType* pWDICtx,
17446 WDI_EventInfoType* pEventData
17447)
17448{
17449 WDI_Status wdiStatus;
17450 eHalStatus halStatus;
17451 WDI_WowlEnterReqCb wdiWowlEnterCb;
17452 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17453
17454 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017455 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017456 -------------------------------------------------------------------------*/
17457 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17458 ( NULL == pEventData->pEventData))
17459 {
17460 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17461 "%s: Invalid parameters", __FUNCTION__);
17462 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017463 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017464 }
17465
17466 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17467
17468 /*-------------------------------------------------------------------------
17469 Extract response and send it to UMAC
17470 -------------------------------------------------------------------------*/
17471 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017472 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017473
17474 /*Notify UMAC*/
17475 wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData);
17476
Jeff Johnsone7245742012-09-05 17:12:55 -070017477 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017478}/*WDI_ProcessWowlEnterRsp*/
17479
17480/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017481 @brief Process wowl exit Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017482 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017483
17484 @param pWDICtx: pointer to the WLAN DAL context
17485 pEventData: pointer to the event information structure
17486
Jeff Johnson295189b2012-06-20 16:38:30 -070017487 @see
17488 @return Result of the function call
17489*/
17490WDI_Status
17491WDI_ProcessWowlExitRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017492(
Jeff Johnson295189b2012-06-20 16:38:30 -070017493 WDI_ControlBlockType* pWDICtx,
17494 WDI_EventInfoType* pEventData
17495)
17496{
17497 WDI_Status wdiStatus;
17498 eHalStatus halStatus;
17499 WDI_WowlExitReqCb wdiWowlExitCb;
17500 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17501
17502 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017503 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017504 -------------------------------------------------------------------------*/
17505 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17506 ( NULL == pEventData->pEventData))
17507 {
17508 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17509 "%s: Invalid parameters", __FUNCTION__);
17510 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017511 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017512 }
17513
17514 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17515
17516 /*-------------------------------------------------------------------------
17517 Extract response and send it to UMAC
17518 -------------------------------------------------------------------------*/
17519 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017520 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017521
17522 /*Notify UMAC*/
17523 wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData);
17524
Jeff Johnsone7245742012-09-05 17:12:55 -070017525 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017526}/*WDI_ProcessWowlExitRsp*/
17527
17528/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017529 @brief Process Configure Apps CPU wakeup State Rsp function
Jeff Johnson295189b2012-06-20 16:38:30 -070017530 (called when a response is being received over the bus
17531 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017532
17533 @param pWDICtx: pointer to the WLAN DAL context
17534 pEventData: pointer to the event information structure
17535
Jeff Johnson295189b2012-06-20 16:38:30 -070017536 @see
17537 @return Result of the function call
17538*/
17539WDI_Status
17540WDI_ProcessConfigureAppsCpuWakeupStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017541(
Jeff Johnson295189b2012-06-20 16:38:30 -070017542 WDI_ControlBlockType* pWDICtx,
17543 WDI_EventInfoType* pEventData
17544)
17545{
17546 WDI_Status wdiStatus;
17547 eHalStatus halStatus;
17548 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17549 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17550
17551 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017552 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017553 -------------------------------------------------------------------------*/
17554 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17555 ( NULL == pEventData->pEventData))
17556 {
17557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17558 "%s: Invalid parameters", __FUNCTION__);
17559 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017560 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017561 }
17562
17563 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17564
17565 /*-------------------------------------------------------------------------
17566 Extract response and send it to UMAC
17567 -------------------------------------------------------------------------*/
17568 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017569 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017570
17571 /*Notify UMAC*/
17572 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17573
Jeff Johnsone7245742012-09-05 17:12:55 -070017574 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017575}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17576
17577
17578/**
17579 @brief Process Nv download(called when a response
17580 is being received over the bus from HAL,will check if the responce is )
Jeff Johnsone7245742012-09-05 17:12:55 -070017581
17582 @param pWDICtx: pointer to the WLAN DAL context
17583 pEventData: pointer to the event information structure
17584
Jeff Johnson295189b2012-06-20 16:38:30 -070017585 @see
17586 @return Result of the function call
17587*/
17588WDI_Status
17589WDI_ProcessNvDownloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017590(
Jeff Johnson295189b2012-06-20 16:38:30 -070017591 WDI_ControlBlockType* pWDICtx,
17592 WDI_EventInfoType* pEventData
17593)
17594{
17595
17596 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17597 tHalNvImgDownloadRspParams halNvDownloadRsp;
17598 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17599
17600 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017601 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017602 -------------------------------------------------------------------------*/
17603 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17604 ( NULL == pEventData->pEventData))
17605 {
17606 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17607 "%s: Invalid parameters", __FUNCTION__);
17608 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017609 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017610 }
17611
17612 /*-------------------------------------------------------------------------
17613 Extract response and send it to UMAC
17614 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017615 wpalMemoryCopy( &halNvDownloadRsp,
17616 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017617 sizeof(halNvDownloadRsp));
17618
17619 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17620
17621 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
Jeff Johnsone7245742012-09-05 17:12:55 -070017622 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17623 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
Jeff Johnson295189b2012-06-20 16:38:30 -070017624 {
17625 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
Jeff Johnsone7245742012-09-05 17:12:55 -070017626 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017627 }
17628 else
17629 {
17630 /*Reset the Nv related global information in WDI context information */
17631 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17632 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17633 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17634 /*call WDA callback function for last fragment */
17635 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17636 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17637 }
17638
Jeff Johnsone7245742012-09-05 17:12:55 -070017639 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017640}
17641#ifdef WLAN_FEATURE_VOWIFI_11R
17642/**
17643 @brief Process Add TSpec Rsp function (called when a response
17644 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017645
17646 @param pWDICtx: pointer to the WLAN DAL context
17647 pEventData: pointer to the event information structure
17648
Jeff Johnson295189b2012-06-20 16:38:30 -070017649 @see
17650 @return Result of the function call
17651*/
17652WDI_Status
17653WDI_ProcessAggrAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017654(
Jeff Johnson295189b2012-06-20 16:38:30 -070017655 WDI_ControlBlockType* pWDICtx,
17656 WDI_EventInfoType* pEventData
17657)
17658{
17659 WDI_Status wdiStatus;
17660 tAggrAddTsRspParams aggrAddTsRsp;
17661 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17662 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17663
17664 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017665 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017666 -------------------------------------------------------------------------*/
17667 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17668 ( NULL == pEventData->pEventData))
17669 {
17670 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17671 "%s: Invalid parameters", __FUNCTION__);
17672 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017673 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017674 }
17675
17676 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17677
17678 /*-------------------------------------------------------------------------
17679 Extract response and send it to UMAC
17680 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017681 wpalMemoryCopy( &aggrAddTsRsp,
17682 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017683 sizeof(aggrAddTsRsp));
17684
17685 /* What is the difference between status0 and status1? */
Jeff Johnsone7245742012-09-05 17:12:55 -070017686 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
Jeff Johnson295189b2012-06-20 16:38:30 -070017687
17688 /*Notify UMAC*/
17689 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17690
Jeff Johnsone7245742012-09-05 17:12:55 -070017691 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017692}/*WDI_ProcessAddTSpecRsp*/
17693#endif /* WLAN_FEATURE_VOWIFI_11R */
17694
17695/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017696 @brief WDI_ProcessHostResumeRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017697 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017698
17699 @param pWDICtx: pointer to the WLAN DAL context
17700 pEventData: pointer to the event information structure
17701
Jeff Johnson295189b2012-06-20 16:38:30 -070017702 @see
17703 @return Result of the function call
17704*/
17705WDI_Status
17706WDI_ProcessHostResumeRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017707(
Jeff Johnson295189b2012-06-20 16:38:30 -070017708 WDI_ControlBlockType* pWDICtx,
17709 WDI_EventInfoType* pEventData
17710)
17711{
17712 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17713 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17714 tHalHostResumeRspParams hostResumeRspMsg;
17715 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17716
17717 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017718 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017719 -------------------------------------------------------------------------*/
17720 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17721 ( NULL == pEventData->pEventData))
17722 {
17723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17724 "%s: Invalid parameters", __FUNCTION__);
17725 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017726 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017727 }
17728
17729 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17730
17731 /*-------------------------------------------------------------------------
17732 Extract response and send it to UMAC
17733 -------------------------------------------------------------------------*/
17734
Jeff Johnsone7245742012-09-05 17:12:55 -070017735 wpalMemoryCopy( &hostResumeRspMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -070017736 (wpt_uint8*)pEventData->pEventData,
17737 sizeof(hostResumeRspMsg));
17738
Jeff Johnsone7245742012-09-05 17:12:55 -070017739 wdiResumeRspParams.wdiStatus =
17740 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070017741
17742 /*Notify UMAC*/
17743 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17744
17745 return WDI_STATUS_SUCCESS;
17746}
17747
17748/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017749 @brief Process Set Tx PER Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017750 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017751
17752 @param pWDICtx: pointer to the WLAN DAL context
17753 pEventData: pointer to the event information structure
17754
Jeff Johnson295189b2012-06-20 16:38:30 -070017755 @see
17756 @return Result of the function call
17757*/
17758WDI_Status
17759WDI_ProcessSetTxPerTrackingRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017760(
Jeff Johnson295189b2012-06-20 16:38:30 -070017761 WDI_ControlBlockType* pWDICtx,
17762 WDI_EventInfoType* pEventData
17763)
17764{
17765 WDI_Status wdiStatus;
17766 eHalStatus halStatus;
17767 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17768 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17769
17770 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017771 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017772 -------------------------------------------------------------------------*/
17773 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17774 ( NULL == pEventData->pEventData))
17775 {
17776 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17777 "%s: Invalid parameters", __FUNCTION__);
17778 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017779 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017780 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017781
17782 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070017783
17784 /*-------------------------------------------------------------------------
17785 Extract response and send it to UMAC
17786 -------------------------------------------------------------------------*/
17787 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017788 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017789
17790 /*Notify UMAC*/
17791 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17792
Jeff Johnsone7245742012-09-05 17:12:55 -070017793 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017794}/*WDI_ProcessSetTxPerTrackingRsp*/
17795
17796/*==========================================================================
17797 Indications from HAL
17798 ==========================================================================*/
17799/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017800 @brief Process Low RSSI Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017801 indication of this kind is being received over the bus
17802 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017803
17804 @param pWDICtx: pointer to the WLAN DAL context
17805 pEventData: pointer to the event information structure
17806
Jeff Johnson295189b2012-06-20 16:38:30 -070017807 @see
17808 @return Result of the function call
17809*/
17810WDI_Status
17811WDI_ProcessLowRSSIInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017812(
Jeff Johnson295189b2012-06-20 16:38:30 -070017813 WDI_ControlBlockType* pWDICtx,
17814 WDI_EventInfoType* pEventData
17815)
17816{
17817 WDI_LowLevelIndType wdiInd;
17818 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
17819 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17820
17821 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017822 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017823 -------------------------------------------------------------------------*/
17824 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17825 ( NULL == pEventData->pEventData))
17826 {
17827 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17828 "%s: Invalid parameters", __FUNCTION__);
17829 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017830 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017831 }
17832
17833 /*-------------------------------------------------------------------------
17834 Extract indication and send it to UMAC
17835 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017836 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
17837 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017838 sizeof(tHalRSSINotification));
17839
17840 /*Fill in the indication parameters*/
17841 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
17842 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
17843 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
17844 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
17845 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
17846 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
17847 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
17848 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
17849 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
17850 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
17851 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
17852 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
17853 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
17854
17855 /*Notify UMAC*/
17856 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017857
17858 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017859}/*WDI_ProcessLowRSSIInd*/
17860
17861
17862/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017863 @brief Process Missed Beacon Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017864 an indication of this kind is being received over the
17865 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017866
17867 @param pWDICtx: pointer to the WLAN DAL context
17868 pEventData: pointer to the event information structure
17869
Jeff Johnson295189b2012-06-20 16:38:30 -070017870 @see
17871 @return Result of the function call
17872*/
17873WDI_Status
17874WDI_ProcessMissedBeaconInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017875(
Jeff Johnson295189b2012-06-20 16:38:30 -070017876 WDI_ControlBlockType* pWDICtx,
17877 WDI_EventInfoType* pEventData
17878)
17879{
17880 WDI_Status wdiStatus;
17881 eHalStatus halStatus;
17882 WDI_LowLevelIndType wdiInd;
17883 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17884
17885 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017886 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017887 -------------------------------------------------------------------------*/
17888 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17889 ( NULL == pEventData->pEventData))
17890 {
17891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17892 "%s: Invalid parameters", __FUNCTION__);
17893 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017894 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017895 }
17896
17897 /*-------------------------------------------------------------------------
17898 Extract indication and send it to UMAC
17899 -------------------------------------------------------------------------*/
17900 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17901 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017902 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017903
17904 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017905 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
17906
Jeff Johnson295189b2012-06-20 16:38:30 -070017907 /*Notify UMAC*/
17908 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017909
17910 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017911}/*WDI_ProcessMissedBeaconInd*/
17912
17913
17914/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017915 @brief Process Unk Addr Frame Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017916 an indication of this kind is being received over the
17917 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017918
17919 @param pWDICtx: pointer to the WLAN DAL context
17920 pEventData: pointer to the event information structure
17921
Jeff Johnson295189b2012-06-20 16:38:30 -070017922 @see
17923 @return Result of the function call
17924*/
17925WDI_Status
17926WDI_ProcessUnkAddrFrameInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017927(
Jeff Johnson295189b2012-06-20 16:38:30 -070017928 WDI_ControlBlockType* pWDICtx,
17929 WDI_EventInfoType* pEventData
17930)
17931{
17932 WDI_Status wdiStatus;
17933 eHalStatus halStatus;
17934 WDI_LowLevelIndType wdiInd;
17935 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17936
17937 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017938 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017939 -------------------------------------------------------------------------*/
17940 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17941 ( NULL == pEventData->pEventData))
17942 {
17943 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17944 "%s: Invalid parameters", __FUNCTION__);
17945 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017946 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017947 }
17948
17949 /*-------------------------------------------------------------------------
17950 Extract indication and send it to UMAC
17951 -------------------------------------------------------------------------*/
17952 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17953 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017954 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017955
17956 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017957 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070017958 /* ! TO DO - fill in from HAL struct:
17959 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
17960
17961 /*Notify UMAC*/
17962 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017963
17964 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017965}/*WDI_ProcessUnkAddrFrameInd*/
17966
17967
17968/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017969 @brief Process MIC Failure Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017970 indication of this kind is being received over the bus
17971 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017972
17973 @param pWDICtx: pointer to the WLAN DAL context
17974 pEventData: pointer to the event information structure
17975
Jeff Johnson295189b2012-06-20 16:38:30 -070017976 @see
17977 @return Result of the function call
17978*/
17979WDI_Status
17980WDI_ProcessMicFailureInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017981(
Jeff Johnson295189b2012-06-20 16:38:30 -070017982 WDI_ControlBlockType* pWDICtx,
17983 WDI_EventInfoType* pEventData
17984)
17985{
17986 WDI_LowLevelIndType wdiInd;
17987 tpSirMicFailureInd pHalMicFailureInd;
17988
17989 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17990
17991 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017992 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017993 -------------------------------------------------------------------------*/
17994 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17995 ( NULL == pEventData->pEventData))
17996 {
17997 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17998 "%s: Invalid parameters", __FUNCTION__);
17999 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018000 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018001 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018002
Jeff Johnson295189b2012-06-20 16:38:30 -070018003 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
18004 /*-------------------------------------------------------------------------
18005 Extract indication and send it to UMAC
18006 -------------------------------------------------------------------------*/
18007
18008 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018009 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018010 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
18011 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
18012 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
18013 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
18014 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
18015 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
18016 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
18017 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070018018 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
Jeff Johnson295189b2012-06-20 16:38:30 -070018019 pHalMicFailureInd->info.multicast;
Jeff Johnsone7245742012-09-05 17:12:55 -070018020 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018021 pHalMicFailureInd->info.IV1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018022 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
Jeff Johnson295189b2012-06-20 16:38:30 -070018023 pHalMicFailureInd->info.keyId;
18024 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
18025 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
18026 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
18027 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
18028 /*Notify UMAC*/
18029 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018030
18031 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018032}/*WDI_ProcessMicFailureInd*/
18033
18034
18035/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018036 @brief Process Fatal Failure Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018037 an indication of this kind is being received over the
18038 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018039
18040 @param pWDICtx: pointer to the WLAN DAL context
18041 pEventData: pointer to the event information structure
18042
Jeff Johnson295189b2012-06-20 16:38:30 -070018043 @see
18044 @return Result of the function call
18045*/
18046WDI_Status
18047WDI_ProcessFatalErrorInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018048(
Jeff Johnson295189b2012-06-20 16:38:30 -070018049 WDI_ControlBlockType* pWDICtx,
18050 WDI_EventInfoType* pEventData
18051)
18052{
18053 WDI_Status wdiStatus;
18054 eHalStatus halStatus;
18055 WDI_LowLevelIndType wdiInd;
18056 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18057
18058 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018059 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018060 -------------------------------------------------------------------------*/
18061 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18062 ( NULL == pEventData->pEventData))
18063 {
18064 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18065 "%s: Invalid parameters", __FUNCTION__);
18066 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018067 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018068 }
18069
18070 /*-------------------------------------------------------------------------
18071 Extract indication and send it to UMAC
18072 -------------------------------------------------------------------------*/
18073
18074 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18075 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018076 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018077
18078 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18079 "Fatal failure received from device %d ", halStatus );
Jeff Johnsone7245742012-09-05 17:12:55 -070018080
Jeff Johnson295189b2012-06-20 16:38:30 -070018081 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018082 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18083 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018084
18085 /*Notify UMAC*/
18086 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018087
18088 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018089}/*WDI_ProcessFatalErrorInd*/
18090
18091/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018092 @brief Process Delete STA Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018093 an indication of this kind is being received over the
18094 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018095
18096 @param pWDICtx: pointer to the WLAN DAL context
18097 pEventData: pointer to the event information structure
18098
Jeff Johnson295189b2012-06-20 16:38:30 -070018099 @see
18100 @return Result of the function call
18101*/
18102WDI_Status
18103WDI_ProcessDelSTAInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018104(
Jeff Johnson295189b2012-06-20 16:38:30 -070018105 WDI_ControlBlockType* pWDICtx,
18106 WDI_EventInfoType* pEventData
18107)
18108{
18109 tDeleteStaContextParams halDelSTACtx;
18110 WDI_LowLevelIndType wdiInd;
18111 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18112
18113 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018114 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018115 -------------------------------------------------------------------------*/
18116 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18117 ( NULL == pEventData->pEventData))
18118 {
18119 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18120 "%s: Invalid parameters", __FUNCTION__);
18121 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018122 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018123 }
18124
18125 /*-------------------------------------------------------------------------
18126 Extract indication and send it to UMAC
18127 -------------------------------------------------------------------------*/
18128
18129 /* Parameters need to be unpacked according to HAL struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018130 wpalMemoryCopy( &halDelSTACtx,
18131 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018132 sizeof(halDelSTACtx));
18133
18134 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018135 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018136
18137 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
18138 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
18139 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
18140 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
18141
Jeff Johnsone7245742012-09-05 17:12:55 -070018142 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
Jeff Johnson295189b2012-06-20 16:38:30 -070018143 halDelSTACtx.assocId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018144 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070018145 halDelSTACtx.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018146 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
18147 halDelSTACtx.reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070018148
18149 /*Notify UMAC*/
18150 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018151
18152 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018153}/*WDI_ProcessDelSTAInd*/
18154
18155/**
18156*@brief Process Coex Indication function (called when
18157 an indication of this kind is being received over the
18158 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018159
18160 @param pWDICtx: pointer to the WLAN DAL context
18161 pEventData: pointer to the event information structure
18162
Jeff Johnson295189b2012-06-20 16:38:30 -070018163 @see
18164 @return Result of the function call
18165*/
18166WDI_Status
18167WDI_ProcessCoexInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018168(
Jeff Johnson295189b2012-06-20 16:38:30 -070018169 WDI_ControlBlockType* pWDICtx,
18170 WDI_EventInfoType* pEventData
18171)
18172{
18173 WDI_LowLevelIndType wdiInd;
18174 tCoexIndMsg halCoexIndMsg;
18175 wpt_uint32 index;
18176 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18177
18178 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018179 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018180 -------------------------------------------------------------------------*/
18181 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18182 ( NULL == pEventData->pEventData ))
18183 {
18184 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18185 "%s: Invalid parameters", __FUNCTION__);
18186 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070018187 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018188 }
18189
18190 /*-------------------------------------------------------------------------
18191 Extract indication and send it to UMAC
18192 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018193 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
18194 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018195 sizeof(halCoexIndMsg.coexIndParams) );
18196
18197 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018198 wdiInd.wdiIndicationType = WDI_COEX_IND;
18199 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
Jeff Johnson295189b2012-06-20 16:38:30 -070018200 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
18201 {
Jeff Johnsone7245742012-09-05 17:12:55 -070018202 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
Jeff Johnson295189b2012-06-20 16:38:30 -070018203 }
18204
18205 // DEBUG
18206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18207 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
Jeff Johnsone7245742012-09-05 17:12:55 -070018208 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
18209 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
18210 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
18211 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
18212 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -070018213
18214 /*Notify UMAC*/
18215 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018216
18217 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018218}/*WDI_ProcessCoexInd*/
18219
18220/**
18221*@brief Process Tx Complete Indication function (called when
18222 an indication of this kind is being received over the
18223 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018224
18225 @param pWDICtx: pointer to the WLAN DAL context
18226 pEventData: pointer to the event information structure
18227
Jeff Johnson295189b2012-06-20 16:38:30 -070018228 @see
18229 @return Result of the function call
18230*/
18231WDI_Status
18232WDI_ProcessTxCompleteInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018233(
Jeff Johnson295189b2012-06-20 16:38:30 -070018234 WDI_ControlBlockType* pWDICtx,
18235 WDI_EventInfoType* pEventData
18236)
18237{
18238 WDI_LowLevelIndType wdiInd;
18239 tTxComplIndMsg halTxComplIndMsg;
18240 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18241
18242 /*-------------------------------------------------------------------------
18243 Sanity check
18244 -------------------------------------------------------------------------*/
18245 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18246 ( NULL == pEventData->pEventData ))
18247 {
18248 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18249 "%s: Invalid parameters", __FUNCTION__);
18250 WDI_ASSERT( 0 );
18251 return WDI_STATUS_E_FAILURE;
18252 }
18253
18254 /*-------------------------------------------------------------------------
18255 Extract indication and send it to UMAC
18256 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018257 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
18258 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018259 sizeof(halTxComplIndMsg.txComplParams) );
18260
18261 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018262 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
18263 wdiInd.wdiIndicationData.tx_complete_status
18264 = halTxComplIndMsg.txComplParams.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070018265
18266 /*Notify UMAC*/
18267 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018268
18269 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018270}/*WDI_ProcessTxCompleteInd*/
18271
18272#ifdef WLAN_FEATURE_P2P
18273/**
18274*@brief Process Noa Attr Indication function (called when
18275 an indication of this kind is being received over the
18276 bus from HAL)
18277
18278 @param pWDICtx: pointer to the WLAN DAL context
18279 pEventData: pointer to the event information structure
18280
18281 @see
18282 @return Result of the function call
18283*/
18284WDI_Status
18285WDI_ProcessP2pNoaAttrInd
18286(
18287 WDI_ControlBlockType* pWDICtx,
18288 WDI_EventInfoType* pEventData
18289)
18290{
18291 WDI_LowLevelIndType wdiInd;
18292 tNoaAttrIndMsg halNoaAttrIndMsg;
18293 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18294
18295 /*-------------------------------------------------------------------------
18296 Sanity check
18297 -------------------------------------------------------------------------*/
18298 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18299 ( NULL == pEventData->pEventData ))
18300 {
18301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18302 "%s: Invalid parameters", __FUNCTION__);
18303 WDI_ASSERT( 0 );
18304 return WDI_STATUS_E_FAILURE;
18305 }
18306
18307 /*-------------------------------------------------------------------------
18308 Extract indication and send it to UMAC
18309 -------------------------------------------------------------------------*/
18310 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
18311 pEventData->pEventData,
18312 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
18313
18314 /*Fill in the indication parameters*/
18315 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -070018316
Jeff Johnson295189b2012-06-20 16:38:30 -070018317 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
18318 = halNoaAttrIndMsg.noaAttrIndParams.status;
Jeff Johnsone7245742012-09-05 17:12:55 -070018319
Jeff Johnson295189b2012-06-20 16:38:30 -070018320 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
18321 = halNoaAttrIndMsg.noaAttrIndParams.index;
18322 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
18323 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
18324 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
18325 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
Jeff Johnsone7245742012-09-05 17:12:55 -070018326
Jeff Johnson295189b2012-06-20 16:38:30 -070018327 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
18328 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
18329 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
18330 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
18331 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
18332 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
18333 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
18334 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070018335
Jeff Johnson295189b2012-06-20 16:38:30 -070018336 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18337 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18338 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18339 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18340 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18341 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18342 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18343 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18344
18345 /*Notify UMAC*/
18346 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18347
18348 return WDI_STATUS_SUCCESS;
18349}/*WDI_ProcessNoaAttrInd*/
18350#endif
18351
18352/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018353 @brief Process Tx PER Hit Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018354 an indication of this kind is being received over the
18355 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018356
18357 @param pWDICtx: pointer to the WLAN DAL context
18358 pEventData: pointer to the event information structure
18359
Jeff Johnson295189b2012-06-20 16:38:30 -070018360 @see
18361 @return Result of the function call
18362*/
18363WDI_Status
18364WDI_ProcessTxPerHitInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018365(
Jeff Johnson295189b2012-06-20 16:38:30 -070018366 WDI_ControlBlockType* pWDICtx,
18367 WDI_EventInfoType* pEventData
18368)
18369{
18370 WDI_LowLevelIndType wdiInd;
18371 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070018372
Jeff Johnson295189b2012-06-20 16:38:30 -070018373 /*-------------------------------------------------------------------------
18374 Extract indication and send it to UMAC
18375 -------------------------------------------------------------------------*/
18376 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018377 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18378
Jeff Johnson295189b2012-06-20 16:38:30 -070018379 /*Notify UMAC*/
18380 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18381
Jeff Johnsone7245742012-09-05 17:12:55 -070018382 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018383}/*WDI_ProcessTxPerHitInd*/
18384
18385#ifdef ANI_MANF_DIAG
18386/**
18387 @brief WDI_ProcessFTMCommandReq
18388 Process FTM Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018389
18390 @param pWDICtx: pointer to the WLAN DAL context
18391 pEventData: pointer to the event information structure
18392
Jeff Johnson295189b2012-06-20 16:38:30 -070018393 @see
18394 @return Result of the function call
18395*/
18396WDI_Status
18397WDI_ProcessFTMCommandReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018398(
Jeff Johnson295189b2012-06-20 16:38:30 -070018399 WDI_ControlBlockType* pWDICtx,
18400 WDI_EventInfoType* pEventData
18401)
18402{
18403 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18404 wpt_uint8 *ftmCommandBuffer = NULL;
18405 wpt_uint16 dataOffset;
18406 wpt_uint16 bufferSize;
18407 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018408 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018409 -------------------------------------------------------------------------*/
18410 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18411 ( NULL == pEventData->pEventData))
18412
18413 {
18414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18415 "%s: Invalid parameters", __FUNCTION__);
18416 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018417 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018418 }
18419
18420 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18421
18422 /* Get MSG Buffer */
18423 WDI_GetMessageBuffer(pWDICtx,
18424 WDI_FTM_CMD_REQ,
18425 ftmCommandReq->bodyLength,
18426 &ftmCommandBuffer,
18427 &dataOffset,
18428 &bufferSize);
18429
18430 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18431 ftmCommandReq->FTMCommandBody,
18432 ftmCommandReq->bodyLength);
18433
18434 /* Send MSG */
18435 return WDI_SendMsg(pWDICtx,
18436 ftmCommandBuffer,
18437 bufferSize,
18438 pEventData->pCBfnc,
18439 pEventData->pUserData,
18440 WDI_FTM_CMD_RESP);
18441}
18442
18443/**
18444 @brief WDI_ProcessFTMCommandRsp
18445 Process FTM Command Response from HAL, simply route to HDD FTM
Jeff Johnsone7245742012-09-05 17:12:55 -070018446
18447 @param pWDICtx: pointer to the WLAN DAL context
18448 pEventData: pointer to the event information structure
18449
Jeff Johnson295189b2012-06-20 16:38:30 -070018450 @see
18451 @return Result of the function call
18452*/
18453WDI_Status
18454WDI_ProcessFTMCommandRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018455(
Jeff Johnson295189b2012-06-20 16:38:30 -070018456 WDI_ControlBlockType* pWDICtx,
18457 WDI_EventInfoType* pEventData
18458)
18459{
18460 WDI_FTMCommandRspCb ftmCMDRspCb;
18461 tProcessPttRspParams *ftmCMDRspData = NULL;
18462 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18463
18464 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018465 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018466 -------------------------------------------------------------------------*/
18467 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18468 ( NULL == pEventData->pEventData))
18469 {
18470 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18471 "%s: Invalid parameters", __FUNCTION__);
18472 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018473 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018474 }
18475
18476 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18477
18478 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18479
Jeff Johnsone7245742012-09-05 17:12:55 -070018480 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18481 (void *)&ftmCMDRspData->pttMsgBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018482 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18483
18484 /*Notify UMAC*/
18485 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18486
Jeff Johnsone7245742012-09-05 17:12:55 -070018487 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018488}
18489#endif /* ANI_MANF_DIAG */
18490/**
18491 @brief WDI_ProcessHalDumpCmdReq
18492 Process hal dump Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018493
18494 @param pWDICtx: pointer to the WLAN DAL context
18495 pEventData: pointer to the event information structure
18496
Jeff Johnson295189b2012-06-20 16:38:30 -070018497 @see
18498 @return Result of the function call
18499*/
18500WDI_Status
18501WDI_ProcessHALDumpCmdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018502(
Jeff Johnson295189b2012-06-20 16:38:30 -070018503 WDI_ControlBlockType* pWDICtx,
18504 WDI_EventInfoType* pEventData
18505)
18506{
18507 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18508 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18509 wpt_uint16 usDataOffset = 0;
18510 wpt_uint16 usSendSize = 0;
18511 tHalDumpCmdReqMsg halDumpCmdReqMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070018512 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070018513
18514 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018515 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018516 -------------------------------------------------------------------------*/
18517 if (( NULL == pEventData ) ||
18518 ( NULL == pEventData->pEventData) ||
18519 ( NULL == pEventData->pCBfnc ))
18520 {
18521 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18522 "%s: Invalid parameters", __FUNCTION__);
18523 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018524 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018525 }
18526
18527 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18528 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18529
18530 /* Copying the HAL DUMP Command Information HAL Structure*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018531 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018532 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
Jeff Johnsone7245742012-09-05 17:12:55 -070018533 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018534 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018535 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018536 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
Jeff Johnsone7245742012-09-05 17:12:55 -070018537 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018538 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
Jeff Johnsone7245742012-09-05 17:12:55 -070018539 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018540 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
Jeff Johnsone7245742012-09-05 17:12:55 -070018541
Jeff Johnson295189b2012-06-20 16:38:30 -070018542 /*-----------------------------------------------------------------------
18543 Get message buffer
18544 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018545 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070018546 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18547 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070018548 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070018549 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18550 {
18551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18552 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18553 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18554 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018555 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018556 }
18557
Jeff Johnsone7245742012-09-05 17:12:55 -070018558 wpalMemoryCopy( pSendBuffer+usDataOffset,
18559 &halDumpCmdReqMsg.dumpCmdReqParams,
18560 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070018561
18562 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070018563 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018564
18565 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018566 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018567 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018568 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18569 wdiHALDumpCmdRspCb, pEventData->pUserData,
18570 WDI_HAL_DUMP_CMD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070018571}
18572
18573/**
18574 @brief WDI_ProcessHalDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018575 Process hal Dump Command Response from HAL, simply route to HDD
18576
18577 @param pWDICtx: pointer to the WLAN DAL context
18578 pEventData: pointer to the event information structure
18579
Jeff Johnson295189b2012-06-20 16:38:30 -070018580 @see
18581 @return Result of the function call
18582*/
18583WDI_Status
18584WDI_ProcessHALDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018585(
Jeff Johnson295189b2012-06-20 16:38:30 -070018586 WDI_ControlBlockType* pWDICtx,
18587 WDI_EventInfoType* pEventData
18588)
18589{
18590 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18591 tpHalDumpCmdRspParams halDumpCmdRspParams;
18592 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18593
18594 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018595 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018596 -------------------------------------------------------------------------*/
18597 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18598 ( NULL == pEventData->pEventData))
18599 {
18600 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18601 "%s: Invalid parameters", __FUNCTION__);
18602 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018603 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018604 }
18605
Jeff Johnsone7245742012-09-05 17:12:55 -070018606 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070018607
18608 /*Initialize the WDI Response structure */
18609 wdiHALDumpCmdRsp.usBufferLen = 0;
18610 wdiHALDumpCmdRsp.pBuffer = NULL;
18611
18612 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018613
18614 wdiHALDumpCmdRsp.wdiStatus =
18615 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
Jeff Johnson295189b2012-06-20 16:38:30 -070018616
18617 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18618 (halDumpCmdRspParams->rspLength != 0))
18619 {
18620 /* Copy the response data */
18621 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18622 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
Jeff Johnsone7245742012-09-05 17:12:55 -070018623 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18624 wdiHALDumpCmdRsp.pBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018625 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18626 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018627
Jeff Johnson295189b2012-06-20 16:38:30 -070018628 /*Notify UMAC*/
18629 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18630
18631 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18632 {
18633 /* Free the allocated buffer */
18634 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18635 }
18636 return WDI_STATUS_SUCCESS;
18637}
18638
18639/*==========================================================================
18640 CONTRL TRANSPORT INTERACTION
Jeff Johnsone7245742012-09-05 17:12:55 -070018641
Jeff Johnson295189b2012-06-20 16:38:30 -070018642 Callback function registered with the control transport - for receiving
Jeff Johnsone7245742012-09-05 17:12:55 -070018643 notifications and packets
Jeff Johnson295189b2012-06-20 16:38:30 -070018644==========================================================================*/
18645/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018646 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018647 when it wishes to send up a notification like the ones
18648 mentioned above.
Jeff Johnsone7245742012-09-05 17:12:55 -070018649
Jeff Johnson295189b2012-06-20 16:38:30 -070018650 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018651
18652 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018653 wctsEvent: the event being notified
Jeff Johnsone7245742012-09-05 17:12:55 -070018654 wctsNotifyCBData: the callback data of the user
18655
Jeff Johnson295189b2012-06-20 16:38:30 -070018656 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018657
18658 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018659*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018660void
Jeff Johnson295189b2012-06-20 16:38:30 -070018661WDI_NotifyMsgCTSCB
18662(
Jeff Johnsone7245742012-09-05 17:12:55 -070018663 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018664 WCTS_NotifyEventType wctsEvent,
18665 void* wctsNotifyCBData
18666)
18667{
Jeff Johnsone7245742012-09-05 17:12:55 -070018668 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018669 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18670
18671 if (NULL == pWDICtx )
18672 {
18673 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18674 "%s: Invalid parameters", __FUNCTION__);
18675 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018676 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018677 }
18678
18679 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18680 {
18681 /* callback presumably occurred after close */
18682 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18683 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018684 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018685 }
18686
18687 if ( WCTS_EVENT_OPEN == wctsEvent )
18688 {
18689 /*Flag must be set atomically as it is checked from incoming request
18690 functions*/
18691 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018692 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018693
18694 /*Nothing to do - so try to dequeue any pending request that may have
18695 occurred while we were trying to establish this*/
18696 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070018697 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnson295189b2012-06-20 16:38:30 -070018698 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018699 else if ( WCTS_EVENT_CLOSE == wctsEvent )
Jeff Johnson295189b2012-06-20 16:38:30 -070018700 {
18701 /*Flag must be set atomically as it is checked from incoming request
18702 functions*/
18703 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018704 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018705
18706 /*No other request will be processed from now on - fail all*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018707 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070018708 wpalMutexRelease(&pWDICtx->wptMutex);
18709
18710 /*Notify that the Control Channel is closed */
18711 wpalEventSet(&pWDICtx->wctsActionEvent);
18712 }
18713
18714}/*WDI_NotifyMsgCTSCB*/
18715
18716
18717/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018718 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018719 when it wishes to send up a packet received over the
18720 bus.
Jeff Johnsone7245742012-09-05 17:12:55 -070018721
Jeff Johnson295189b2012-06-20 16:38:30 -070018722 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018723
18724 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018725 pMsg: the packet
18726 uLen: the packet length
Jeff Johnsone7245742012-09-05 17:12:55 -070018727 wctsRxMsgCBData: the callback data of the user
18728
Jeff Johnson295189b2012-06-20 16:38:30 -070018729 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018730
18731 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018732*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018733void
18734WDI_RXMsgCTSCB
Jeff Johnson295189b2012-06-20 16:38:30 -070018735(
Jeff Johnsone7245742012-09-05 17:12:55 -070018736 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018737 void* pMsg,
18738 wpt_uint32 uLen,
18739 void* wctsRxMsgCBData
18740)
18741{
Jeff Johnsone7245742012-09-05 17:12:55 -070018742 tHalMsgHeader *pHalMsgHeader;
18743 WDI_EventInfoType wdiEventData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018744 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18745 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18746
18747 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018748 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018749 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018750 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070018751 ( uLen < sizeof(tHalMsgHeader)))
18752 {
18753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18754 "%s: Invalid parameters", __FUNCTION__);
18755 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018756 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018757 }
18758
18759 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18760 {
18761 /* callback presumably occurred after close */
18762 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18763 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018764 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018765 }
18766
Jeff Johnsone7245742012-09-05 17:12:55 -070018767 /*The RX Callback is expected to be serialized in the proper control thread
Jeff Johnson295189b2012-06-20 16:38:30 -070018768 context - so no serialization is necessary here
18769 ! - revisit this assumption */
18770
18771 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18772
18773 if ( uLen != pHalMsgHeader->msgLen )
18774 {
18775 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18776 "Invalid packet received from HAL - catastrophic failure");
Jeff Johnsone7245742012-09-05 17:12:55 -070018777 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18778 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018779 }
18780
18781 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18782
18783 /*The message itself starts after the header*/
18784 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18785 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18786 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18787 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18788
18789
18790 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18791 {
18792 /*Stop the timer as the response was received */
18793 /*!UT - check for potential race conditions between stop and response */
18794 wpalTimerStop(&pWDICtx->wptResponseTimer);
18795 }
18796 /* Check if we receive a response message which is not expected */
18797 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
18798 {
18799 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18800 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
18801 WDI_getRespMsgString(wdiEventData.wdiResponse),
Jeff Johnsone7245742012-09-05 17:12:55 -070018802 wdiEventData.wdiResponse,
Jeff Johnson295189b2012-06-20 16:38:30 -070018803 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18804 pWDICtx->wdiExpectedResponse);
18805 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
18806 return;
18807 }
18808
18809 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18810 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
18811
18812 /*Post response event to the state machine*/
18813 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
18814
18815}/*WDI_RXMsgCTSCB*/
18816
18817
18818/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070018819 Internal Helper Routines
Jeff Johnson295189b2012-06-20 16:38:30 -070018820========================================================================*/
18821
18822/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018823 @brief WDI_CleanCB - internal helper routine used to clean the
Jeff Johnson295189b2012-06-20 16:38:30 -070018824 WDI Main Control Block
Jeff Johnsone7245742012-09-05 17:12:55 -070018825
Jeff Johnson295189b2012-06-20 16:38:30 -070018826 @param pWDICtx - pointer to the control block
18827
18828 @return Result of the function call
18829*/
18830WPT_INLINE WDI_Status
18831WDI_CleanCB
18832(
18833 WDI_ControlBlockType* pWDICtx
18834)
18835{
18836 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18837
18838 /*Clean the WDI Control Block*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018839 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
Jeff Johnson295189b2012-06-20 16:38:30 -070018840
Jeff Johnsone7245742012-09-05 17:12:55 -070018841 pWDICtx->uGlobalState = WDI_MAX_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070018842 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
18843 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
18844
18845 WDI_ResetAssocSessions( pWDICtx );
18846
18847 return WDI_STATUS_SUCCESS;
18848}/*WDI_CleanCB*/
18849
18850
18851/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018852 @brief Process request helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070018853
Jeff Johnsone7245742012-09-05 17:12:55 -070018854
18855 @param pWDICtx: pointer to the WLAN DAL context
18856 pEventData: pointer to the event information structure
18857
Jeff Johnson295189b2012-06-20 16:38:30 -070018858 @see
18859 @return Result of the function call
18860*/
18861WPT_INLINE WDI_Status
18862WDI_ProcessRequest
18863(
18864 WDI_ControlBlockType* pWDICtx,
18865 WDI_EventInfoType* pEventData
18866)
18867{
18868 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18869
Jeff Johnsone7245742012-09-05 17:12:55 -070018870 /*!! Skip sanity check as this is called from the FSM functionss which
Jeff Johnson295189b2012-06-20 16:38:30 -070018871 already checked these pointers*/
18872
18873 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
18874 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070018875 {
Jeff Johnson295189b2012-06-20 16:38:30 -070018876 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18877 "Calling request processing function for req %s (%d) %x",
18878 WDI_getReqMsgString(pEventData->wdiRequest),
18879 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
18880 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
18881 }
18882 else
18883 {
18884 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070018885 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070018886 pEventData->wdiRequest);
18887 return WDI_STATUS_E_NOT_IMPLEMENT;
18888 }
18889}/*WDI_ProcessRequest*/
18890
18891
18892/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018893 @brief Get message helper function - it allocates memory for a
Jeff Johnson295189b2012-06-20 16:38:30 -070018894 message that is to be sent to HAL accross the bus and
Jeff Johnsone7245742012-09-05 17:12:55 -070018895 prefixes it with a send message header
18896
18897 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018898 wdiReqType: type of the request being sent
18899 uBufferLen: message buffer len
18900 pMsgBuffer: resulting allocated buffer
18901 pusDataOffset: offset in the buffer where the caller
18902 can start copying its message data
18903 puBufferSize: the resulting buffer size (offset+buff
18904 len)
Jeff Johnsone7245742012-09-05 17:12:55 -070018905
Jeff Johnson295189b2012-06-20 16:38:30 -070018906 @see
18907 @return Result of the function call
18908*/
18909WDI_Status
18910WDI_GetMessageBuffer
Jeff Johnsone7245742012-09-05 17:12:55 -070018911(
18912 WDI_ControlBlockType* pWDICtx,
18913 WDI_RequestEnumType wdiReqType,
Jeff Johnson295189b2012-06-20 16:38:30 -070018914 wpt_uint16 usBufferLen,
Jeff Johnsone7245742012-09-05 17:12:55 -070018915 wpt_uint8** pMsgBuffer,
18916 wpt_uint16* pusDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070018917 wpt_uint16* pusBufferSize
18918)
18919{
18920 tHalMsgHeader halMsgHeader;
18921 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18922
Jeff Johnsone7245742012-09-05 17:12:55 -070018923 /*!! No sanity check here as we trust the called - ! check this assumption
Jeff Johnson295189b2012-06-20 16:38:30 -070018924 again*/
18925
18926 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018927 Try to allocate message buffer from PAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018928 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018929 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
Jeff Johnson295189b2012-06-20 16:38:30 -070018930 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
18931 if ( NULL == *pMsgBuffer )
18932 {
18933 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18934 "Unable to allocate message buffer for req %s (%d)",
18935 WDI_getReqMsgString(wdiReqType),
Jeff Johnsone7245742012-09-05 17:12:55 -070018936 wdiReqType);
Jeff Johnson295189b2012-06-20 16:38:30 -070018937 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018938 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018939 }
18940
18941 /*-------------------------------------------------------------------------
18942 Fill in the message header
18943 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018944 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
18945 /* Fill msgVersion */
18946#ifdef WLAN_FEATURE_11AC
18947 if (WDI_getFwWlanFeatCaps(DOT11AC))
18948 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1;
18949 else
18950#endif
18951 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0;
Jeff Johnson295189b2012-06-20 16:38:30 -070018952
Jeff Johnsone7245742012-09-05 17:12:55 -070018953 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
18954 *pusDataOffset = sizeof(halMsgHeader);
18955 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
18956
18957 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018958}/*WDI_GetMessageBuffer*/
18959
18960
18961/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018962 @brief Send message helper function - sends a message over the
Jeff Johnson295189b2012-06-20 16:38:30 -070018963 bus using the control tranport and saves some info in
Jeff Johnsone7245742012-09-05 17:12:55 -070018964 the CB
18965
18966 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018967 pSendBuffer: buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070018968
Jeff Johnson295189b2012-06-20 16:38:30 -070018969 usSendSize size of the buffer to be sent
18970 pRspCb: response callback - save in the WDI
18971 CB
18972 pUserData: user data associated with the
18973 callback
18974 wdiExpectedResponse: the code of the response that is
18975 expected to be rx-ed for this request
Jeff Johnsone7245742012-09-05 17:12:55 -070018976
Jeff Johnson295189b2012-06-20 16:38:30 -070018977 @see
18978 @return Result of the function call
18979*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018980WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070018981WDI_SendMsg
Jeff Johnsone7245742012-09-05 17:12:55 -070018982(
18983 WDI_ControlBlockType* pWDICtx,
18984 wpt_uint8* pSendBuffer,
18985 wpt_uint32 usSendSize,
18986 void* pRspCb,
Jeff Johnson295189b2012-06-20 16:38:30 -070018987 void* pUserData,
18988 WDI_ResponseEnumType wdiExpectedResponse
18989)
18990{
Jeff Johnsond13512a2012-07-17 11:42:19 -070018991 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018992 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18993
18994 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018995 Save needed info in the CB
Jeff Johnson295189b2012-06-20 16:38:30 -070018996 ------------------------------------------------------------------------*/
18997 pWDICtx->pRspCBUserData = pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018998 pWDICtx->pfncRspCB = pRspCb;
18999 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019000
19001 /*-----------------------------------------------------------------------
19002 Call the CTS to send this message over - free message afterwards
19003 - notify transport failure
19004 Note: CTS is reponsible for freeing the message buffer.
19005 -----------------------------------------------------------------------*/
19006 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
19007 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019008 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070019009 "Failed to send message over the bus - catastrophic failure");
19010
Jeff Johnsond13512a2012-07-17 11:42:19 -070019011 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019012 }
19013
Jeff Johnsond13512a2012-07-17 11:42:19 -070019014 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070019015 if ( NULL != pWDICtx->wdiReqStatusCB )
19016 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019017 /*Inform originator whether request went through or not*/
19018 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
19019 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070019020 pWDICtx->wdiReqStatusCB = NULL;
19021 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070019022 callback(wdiStatus, callbackContext);
19023
19024 /*For WDI requests which have registered a request callback,
19025 inform the WDA caller of the same via setting the return value
19026 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
19027 end up repeating the functonality in the req callback for the
19028 WDI_STATUS_E_FAILURE case*/
19029 if (wdiStatus == WDI_STATUS_E_FAILURE)
19030 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070019031 }
19032
Jeff Johnsond13512a2012-07-17 11:42:19 -070019033 if ( wdiStatus == WDI_STATUS_SUCCESS )
19034 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019035 /*Start timer for the expected response */
19036 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070019037 }
19038 else
19039 {
19040 /*Inform upper stack layers that a transport fatal error occured*/
19041 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19042 }
Jeff Johnson295189b2012-06-20 16:38:30 -070019043
Jeff Johnsond13512a2012-07-17 11:42:19 -070019044 return wdiStatus;
19045
Jeff Johnson295189b2012-06-20 16:38:30 -070019046}/*WDI_SendMsg*/
19047
19048
19049
19050/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019051 @brief Send indication helper function - sends a message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019052 the bus using the control transport and saves some info
19053 in the CB
Jeff Johnsone7245742012-09-05 17:12:55 -070019054
19055 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019056 pSendBuffer: buffer to be sent
19057 usSendSize: size of the buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019058
Jeff Johnson295189b2012-06-20 16:38:30 -070019059 @see
19060 @return Result of the function call
19061*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019062WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019063WDI_SendIndication
Jeff Johnsone7245742012-09-05 17:12:55 -070019064(
19065 WDI_ControlBlockType* pWDICtx,
19066 wpt_uint8* pSendBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070019067 wpt_uint32 usSendSize
19068)
19069{
19070 wpt_uint32 uStatus ;
19071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19072
19073 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019074 Call the CTS to send this message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019075 Note: CTS is reponsible for freeing the message buffer.
19076 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019077 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070019078 (void*)pSendBuffer, usSendSize );
19079
19080 /*Inform Upper MAC about the outcome of the request*/
19081 if ( NULL != pWDICtx->wdiReqStatusCB )
19082 {
19083 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19084 "Send indication status : %d", uStatus);
19085
19086 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
Jeff Johnsone7245742012-09-05 17:12:55 -070019087 WDI_STATUS_SUCCESS,
19088 pWDICtx->pReqStatusUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070019089 }
19090
19091 /*If sending of the message failed - it is considered catastrophic and
19092 indicates an error with the device*/
19093 if ( 0 != uStatus)
19094 {
19095 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019096 "Failed to send indication over the bus - catastrophic failure");
Jeff Johnson295189b2012-06-20 16:38:30 -070019097
19098 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19099 return WDI_STATUS_E_FAILURE;
19100 }
19101
Jeff Johnsone7245742012-09-05 17:12:55 -070019102 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019103}/*WDI_SendIndication*/
19104
19105
19106/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019107 @brief WDI_DetectedDeviceError - called internally by DAL when
19108 it has detected a failure in the device
19109
19110 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019111 usErrorCode: error code detected by WDI or received
19112 from HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070019113
Jeff Johnson295189b2012-06-20 16:38:30 -070019114 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019115 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019116*/
19117void
19118WDI_DetectedDeviceError
19119(
19120 WDI_ControlBlockType* pWDICtx,
19121 wpt_uint16 usErrorCode
19122)
19123{
19124 WDI_LowLevelIndType wdiInd;
19125 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19126
19127 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19128 "Device Error detected code: %d - transitioning to stopped state",
19129 usErrorCode);
19130
19131 wpalMutexAcquire(&pWDICtx->wptMutex);
19132
19133 WDI_STATableStop(pWDICtx);
19134
19135 WDI_ResetAssocSessions(pWDICtx);
19136
19137 /*Set the expected state transition to stopped - because the device
19138 experienced a failure*/
19139 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
19140
19141 /*Transition to stopped to fail all incomming requests from this point on*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019142 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
Jeff Johnson295189b2012-06-20 16:38:30 -070019143
Jeff Johnsone7245742012-09-05 17:12:55 -070019144 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070019145
19146 /*TO DO: - there should be an attempt to reset the device here*/
19147
19148 wpalMutexRelease(&pWDICtx->wptMutex);
19149
19150 /*------------------------------------------------------------------------
19151 Notify UMAC if a handler is registered
19152 ------------------------------------------------------------------------*/
19153 if (pWDICtx->wdiLowLevelIndCB)
19154 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019155 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
19156 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019157
19158 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
19159 }
19160}/*WDI_DetectedDeviceError*/
19161
19162/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019163 @brief This callback is invoked by the wpt when a timer that
Jeff Johnson295189b2012-06-20 16:38:30 -070019164 we started on send message has expire - this should
19165 never happen - it means device is stuck and cannot
Jeff Johnsone7245742012-09-05 17:12:55 -070019166 reply - trigger catastrophic failure
19167 @param
19168
Jeff Johnson295189b2012-06-20 16:38:30 -070019169 pUserData: the callback data of the user (ptr to WDI CB)
Jeff Johnsone7245742012-09-05 17:12:55 -070019170
19171 @see
19172 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019173*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019174void
Jeff Johnson295189b2012-06-20 16:38:30 -070019175WDI_ResponseTimerCB
19176(
19177 void *pUserData
19178)
19179{
19180 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
19181 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19182
19183 if (NULL == pWDICtx )
19184 {
19185 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19186 "%s: Invalid parameters", __FUNCTION__);
19187 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019188 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019189 }
19190
19191 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
19192 {
19193
19194 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19195 "Timeout occurred while waiting for %s (%d) message from device "
Jeff Johnsone7245742012-09-05 17:12:55 -070019196 " - catastrophic failure",
Jeff Johnson295189b2012-06-20 16:38:30 -070019197 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19198 pWDICtx->wdiExpectedResponse);
19199 /* WDI timeout means Riva is not responding or SMD communication to Riva
19200 * is not happening. The only possible way to recover from this error
19201 * is to initiate SSR from APPS */
19202 wpalRivaSubystemRestart();
19203 }
19204 else
19205 {
19206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19207 "Timeout occurred but not waiting for any response %d",
19208 pWDICtx->wdiExpectedResponse);
19209 }
19210
19211 return;
19212
19213}/*WDI_ResponseTimerCB*/
19214
19215
19216/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019217 @brief Process response helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019218
Jeff Johnsone7245742012-09-05 17:12:55 -070019219
19220 @param pWDICtx: pointer to the WLAN DAL context
19221 pEventData: pointer to the event information structure
19222
Jeff Johnson295189b2012-06-20 16:38:30 -070019223 @see
19224 @return Result of the function call
19225*/
19226WPT_INLINE WDI_Status
19227WDI_ProcessResponse
19228(
19229 WDI_ControlBlockType* pWDICtx,
19230 WDI_EventInfoType* pEventData
19231)
19232{
19233 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19234
Jeff Johnsone7245742012-09-05 17:12:55 -070019235 /* Skip sanity check as this is called from the FSM functions which
Jeff Johnson295189b2012-06-20 16:38:30 -070019236 already checked these pointers
19237 ! - revisit this assumption */
19238 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
19239 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019240 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019241 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070019242 "Calling response processing function for resp %s (%d) %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070019243 WDI_getRespMsgString(pEventData->wdiResponse),
19244 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
19245 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
19246 }
19247 else
19248 {
19249 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019250 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019251 pEventData->wdiResponse);
19252 return WDI_STATUS_E_NOT_IMPLEMENT;
19253 }
19254}/*WDI_ProcessResponse*/
19255
19256
19257/*=========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019258 QUEUE SUPPORT UTILITY FUNCTIONS
Jeff Johnson295189b2012-06-20 16:38:30 -070019259=========================================================================*/
19260
19261/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019262 @brief Utility function used by the DAL Core to help queue a
19263 request that cannot be processed right away.
19264 @param
19265
Jeff Johnson295189b2012-06-20 16:38:30 -070019266 pWDICtx: - pointer to the WDI control block
19267 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019268 queued
19269
19270 @see
19271 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019272*/
19273WDI_Status
19274WDI_QueuePendingReq
19275(
19276 WDI_ControlBlockType* pWDICtx,
19277 WDI_EventInfoType* pEventData
19278)
19279{
Jeff Johnsone7245742012-09-05 17:12:55 -070019280 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019281 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
Jeff Johnsone7245742012-09-05 17:12:55 -070019282 void* pEventInfo = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019283 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19284
19285 if ( NULL == pEventDataQueue )
19286 {
19287 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019288 "Cannot allocate memory for queueing");
Jeff Johnson295189b2012-06-20 16:38:30 -070019289 WDI_ASSERT(0);
19290 return WDI_STATUS_MEM_FAILURE;
19291 }
19292
19293 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19294 pEventDataQueue->pUserData = pEventData->pUserData;
19295 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19296 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019297 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019298
19299 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
19300 {
19301 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070019302
Jeff Johnson295189b2012-06-20 16:38:30 -070019303 if ( NULL == pEventInfo )
19304 {
19305 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019306 "Cannot allocate memory for queueing event data info");
Jeff Johnson295189b2012-06-20 16:38:30 -070019307 WDI_ASSERT(0);
19308 wpalMemoryFree(pEventDataQueue);
19309 return WDI_STATUS_MEM_FAILURE;
19310 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019311
Jeff Johnson295189b2012-06-20 16:38:30 -070019312 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19313
19314 }
19315 pEventDataQueue->pEventData = pEventInfo;
19316
19317 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019318 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019319
Jeff Johnsone7245742012-09-05 17:12:55 -070019320 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019321
19322 return WDI_STATUS_SUCCESS;
19323}/*WDI_QueuePendingReq*/
19324
19325/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019326 @brief Callback function for serializing queued message
Jeff Johnson295189b2012-06-20 16:38:30 -070019327 processing in the control context
Jeff Johnsone7245742012-09-05 17:12:55 -070019328 @param
19329
19330 pMsg - pointer to the message
19331
19332 @see
19333 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019334*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019335void
Jeff Johnson295189b2012-06-20 16:38:30 -070019336WDI_PALCtrlMsgCB
19337(
19338 wpt_msg *pMsg
19339)
19340{
19341 WDI_EventInfoType* pEventData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019342 WDI_ControlBlockType* pWDICtx = NULL;
19343 WDI_Status wdiStatus;
19344 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019345 void* pUserData;
19346 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19347
19348 if (( NULL == pMsg )||
19349 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19350 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19351 {
19352 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019353 "Invalid message received on serialize ctrl context API");
Jeff Johnson295189b2012-06-20 16:38:30 -070019354 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019355 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019356 }
19357
19358 /*Transition back to the state that we had before serialization
19359 - serialization transitions us to BUSY to stop any incomming requests
19360 ! TO DO L: possible race condition here if a request comes in between the
19361 state transition and the post function*/
19362
Jeff Johnsone7245742012-09-05 17:12:55 -070019363 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
Jeff Johnson295189b2012-06-20 16:38:30 -070019364
19365 /*-----------------------------------------------------------------------
19366 Check to see what type of event we are serializing
Jeff Johnsone7245742012-09-05 17:12:55 -070019367 - responses are never expected to come through here
Jeff Johnson295189b2012-06-20 16:38:30 -070019368 -----------------------------------------------------------------------*/
19369 switch ( pEventData->wdiRequest )
19370 {
19371
Jeff Johnsone7245742012-09-05 17:12:55 -070019372 case WDI_STOP_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -070019373 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19374 break;
19375
Jeff Johnson295189b2012-06-20 16:38:30 -070019376 case WDI_NV_DOWNLOAD_REQ:
19377 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19378 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19379 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19380 {
19381 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19382 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19383 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19384 }
19385 else
19386 {
19387 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19388 }
19389
19390 break;
19391
19392 default:
19393 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19394 break;
19395 }/*switch ( pEventData->wdiRequest )*/
19396
19397 if ( WDI_STATUS_SUCCESS != wdiStatus )
19398 {
19399 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19400
19401 if ( NULL != pfnReqStatusCB )
19402 {
19403 /*Fail the request*/
19404 pfnReqStatusCB( wdiStatus, pUserData);
19405 }
19406 }
19407
19408 /* Free data - that was allocated when queueing*/
19409 if( pEventData != NULL )
19410 {
19411 if( pEventData->pEventData != NULL )
19412 {
19413 wpalMemoryFree(pEventData->pEventData);
19414 }
19415 wpalMemoryFree(pEventData);
19416 }
19417
19418 if( pMsg != NULL )
19419 {
19420 wpalMemoryFree(pMsg);
19421 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019422
Jeff Johnson295189b2012-06-20 16:38:30 -070019423}/*WDI_PALCtrlMsgCB*/
19424
19425/**
19426 @brief Utility function used by the DAL Core to help dequeue
Jeff Johnsone7245742012-09-05 17:12:55 -070019427 and schedule for execution a pending request
19428 @param
19429
Jeff Johnson295189b2012-06-20 16:38:30 -070019430 pWDICtx: - pointer to the WDI control block
19431 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019432 queued
19433
19434 @see
19435 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019436*/
19437WDI_Status
19438WDI_DequeuePendingReq
19439(
19440 WDI_ControlBlockType* pWDICtx
19441)
19442{
Jeff Johnsone7245742012-09-05 17:12:55 -070019443 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019444 WDI_EventInfoType* pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019445 wpt_msg* palMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070019446 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19447
Jeff Johnsone7245742012-09-05 17:12:55 -070019448 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019449
19450 if ( NULL == pNode )
19451 {
19452 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019453 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019454 return WDI_STATUS_SUCCESS;
19455 }
19456
19457 /*The node actually points to the 1st element inside the Event Data struct -
19458 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019459 pEventData = (WDI_EventInfoType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019460
19461 /*Serialize processing in the control thread
19462 !TO DO: - check to see if these are all the messages params that need
19463 to be filled in*/
19464 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19465
19466 if ( NULL == palMsg )
19467 {
19468 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019469 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
Jeff Johnson295189b2012-06-20 16:38:30 -070019470 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019471 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019472 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019473 palMsg->pContext = pWDICtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070019474 palMsg->callback = WDI_PALCtrlMsgCB;
19475 palMsg->ptr = pEventData;
19476
19477 /*Save the global state as we need it on the other side*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019478 palMsg->val = pWDICtx->uGlobalState;
19479
Jeff Johnson295189b2012-06-20 16:38:30 -070019480 /*Transition back to BUSY as we need to handle a queued request*/
19481 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -070019482
Jeff Johnson295189b2012-06-20 16:38:30 -070019483 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19484
19485 return WDI_STATUS_PENDING;
19486}/*WDI_DequeuePendingReq*/
19487
19488
19489/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019490 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019491 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019492 away.- The assoc requests will be queued by BSSID
19493 @param
19494
Jeff Johnson295189b2012-06-20 16:38:30 -070019495 pWDICtx: - pointer to the WDI control block
19496 pEventData: pointer to the evnt info that needs to be queued
19497 macBSSID: bssid
Jeff Johnsone7245742012-09-05 17:12:55 -070019498
19499 @see
19500 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019501*/
19502WDI_Status
19503WDI_QueueNewAssocRequest
19504(
19505 WDI_ControlBlockType* pWDICtx,
19506 WDI_EventInfoType* pEventData,
19507 wpt_macAddr macBSSID
19508)
19509{
Jeff Johnsone7245742012-09-05 17:12:55 -070019510 wpt_uint8 i;
19511 WDI_BSSSessionType* pSession = NULL;
19512 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019513 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019514 void* pEventInfo;
19515 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019516 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -070019517
Jeff Johnsone7245742012-09-05 17:12:55 -070019518
19519 /*------------------------------------------------------------------------
19520 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019521 ------------------------------------------------------------------------*/
19522 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19523 {
19524 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19525 {
19526 /*Found an empty session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019527 pSession = &pWDICtx->aBSSSessions[i];
19528 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070019529 }
19530 }
19531
19532 if ( i >= WDI_MAX_BSS_SESSIONS )
19533 {
19534 /*Cannot find any empty sessions*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019535 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019536 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019537
Jeff Johnson295189b2012-06-20 16:38:30 -070019538 /*------------------------------------------------------------------------
19539 Fill in the BSSID for this session and set the usage flag
19540 ------------------------------------------------------------------------*/
19541 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070019542 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019543
19544 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019545 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019546 ------------------------------------------------------------------------*/
19547 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19548 if ( NULL == pEventDataQueue )
19549 {
19550 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19551 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19552 WDI_ASSERT(0);
19553 return WDI_STATUS_MEM_FAILURE;
19554 }
19555
19556 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19557 if ( NULL == pSessionIdElement )
19558 {
19559 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19560 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19561 WDI_ASSERT(0);
19562 wpalMemoryFree(pEventDataQueue);
19563 return WDI_STATUS_MEM_FAILURE;
19564 }
19565
19566 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19567 if ( NULL == pEventInfo )
19568 {
19569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19570 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19571 WDI_ASSERT(0);
19572 wpalMemoryFree(pSessionIdElement);
19573 wpalMemoryFree(pEventDataQueue);
19574 return WDI_STATUS_MEM_FAILURE;
19575 }
19576
19577 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19578 pEventDataQueue->pUserData = pEventData->pUserData;
19579 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19580 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019581 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019582
19583 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19584 pEventDataQueue->pEventData = pEventInfo;
19585
19586 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019587 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019588
19589 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019590 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019591
Jeff Johnsone7245742012-09-05 17:12:55 -070019592 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019593
19594 /*We need to maintain a separate list that keeps track of the order in which
19595 the new assoc requests are being queued such that we can start processing
19596 them in the order that they had arrived*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019597 pSessionIdElement->ucIndex = i;
19598 pNode = (wpt_list_node*)pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019599
19600 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19601 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
Jeff Johnsone7245742012-09-05 17:12:55 -070019602 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019603
19604 /*Return pending as this is what the status of the request is since it has
19605 been queued*/
19606 return WDI_STATUS_PENDING;
19607}/*WDI_QueueNewAssocRequest*/
19608
19609/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019610 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019611 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019612 away.- The assoc requests will be queued by BSSID
19613 @param
19614
Jeff Johnson295189b2012-06-20 16:38:30 -070019615 pWDICtx: - pointer to the WDI control block
19616 pSession: - session in which to queue
19617 pEventData: pointer to the event info that needs to be
19618 queued
Jeff Johnsone7245742012-09-05 17:12:55 -070019619
19620 @see
19621 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019622*/
19623WDI_Status
19624WDI_QueueAssocRequest
19625(
19626 WDI_ControlBlockType* pWDICtx,
19627 WDI_BSSSessionType* pSession,
19628 WDI_EventInfoType* pEventData
19629)
19630{
Jeff Johnsone7245742012-09-05 17:12:55 -070019631 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019632 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019633 void* pEventInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070019634 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019635
19636 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019637 Sanity check
19638 ------------------------------------------------------------------------*/
19639 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19640 {
19641 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19642 "%s: Invalid parameters", __FUNCTION__);
19643
Jeff Johnsone7245742012-09-05 17:12:55 -070019644 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019645 }
19646
19647 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019648 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019649 ------------------------------------------------------------------------*/
19650 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19651 if ( NULL == pEventDataQueue )
19652 {
19653 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019654 "%s: Cannot allocate memory for queueing", __FUNCTION__);
Jeff Johnson295189b2012-06-20 16:38:30 -070019655 WDI_ASSERT(0);
19656 return WDI_STATUS_MEM_FAILURE;
19657 }
19658
19659 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19660 if ( NULL == pEventInfo )
19661 {
19662 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19663 "%s: Cannot allocate memory for queueing event data info",
19664 __FUNCTION__);
19665 WDI_ASSERT(0);
19666 wpalMemoryFree(pEventDataQueue);
19667 return WDI_STATUS_MEM_FAILURE;
19668 }
19669
19670 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19671 pEventDataQueue->pUserData = pEventData->pUserData;
19672 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19673 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019674 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019675 pEventDataQueue->pEventData = pEventInfo;
19676
19677 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19678
19679 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019680 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019681
19682 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019683 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019684
Jeff Johnsone7245742012-09-05 17:12:55 -070019685 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019686
19687 /*The result of this operation is pending because the request has been
19688 queued and it will be processed at a later moment in time */
19689 return WDI_STATUS_PENDING;
19690}/*WDI_QueueAssocRequest*/
19691
19692/**
19693 @brief Utility function used by the DAL Core to help dequeue
19694 an association request that was pending
19695 The request will be queued up in front of the main
19696 pending queue for imediate processing
Jeff Johnsone7245742012-09-05 17:12:55 -070019697 @param
19698
Jeff Johnson295189b2012-06-20 16:38:30 -070019699 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019700
19701
19702 @see
19703 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019704*/
19705WDI_Status
19706WDI_DequeueAssocRequest
19707(
19708 WDI_ControlBlockType* pWDICtx
19709)
19710{
Jeff Johnsone7245742012-09-05 17:12:55 -070019711 wpt_list_node* pNode = NULL;
19712 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019713 WDI_BSSSessionType* pSession;
19714 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019715
19716 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019717 Sanity check
19718 ------------------------------------------------------------------------*/
19719 if ( NULL == pWDICtx )
19720 {
19721 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19722 "%s: Invalid parameters", __FUNCTION__);
19723
Jeff Johnsone7245742012-09-05 17:12:55 -070019724 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019725 }
19726
19727 /*------------------------------------------------------------------------
19728 An association has been completed => a new association can occur
19729 Check to see if there are any pending associations ->
19730 If so , transfer all the pending requests into the busy queue for
19731 processing
19732 These requests have arrived prior to the requests in the busy queue
19733 (bc they needed to be processed in order to be placed in this queue)
19734 => they will be placed at the front of the busy queue
19735 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019736 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019737
19738 if ( NULL == pNode )
19739 {
19740 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019741 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019742 return WDI_STATUS_SUCCESS;
19743 }
19744
19745 /*The node actually points to the 1st element inside the Session Id struct -
19746 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019747 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019748
19749 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19750 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19751
19752 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19753 {
19754 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
Jeff Johnsone7245742012-09-05 17:12:55 -070019755
Jeff Johnson295189b2012-06-20 16:38:30 -070019756 /*Transfer all the pending requests in this assoc queue to
Jeff Johnsone7245742012-09-05 17:12:55 -070019757 the front of the main waiting queue for subsequent execution*/
19758 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019759 while ( NULL != pNode )
19760 {
19761 /*Place it in front of the main pending list*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019762 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19763 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019764 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019765 pSession->bAssocReqQueued = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019766 }
19767 else
19768 {
19769 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019770 "Invalid session id queued up for assoc");
Jeff Johnson295189b2012-06-20 16:38:30 -070019771 WPAL_ASSERT(0);
19772 wpalMemoryFree(pSessionIdElement);
Jeff Johnsone7245742012-09-05 17:12:55 -070019773 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019774 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019775
Jeff Johnson295189b2012-06-20 16:38:30 -070019776 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19777 wpalMemoryFree(pSessionIdElement);
19778 return WDI_STATUS_SUCCESS;
19779}/*WDI_DequeueAssocRequest*/
19780
19781/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019782 @brief Utility function used by the DAL Core to clear any
Jeff Johnson295189b2012-06-20 16:38:30 -070019783 pending requests - all req cb will be called with
19784 failure and the queue will be emptied.
Jeff Johnsone7245742012-09-05 17:12:55 -070019785 @param
19786
Jeff Johnson295189b2012-06-20 16:38:30 -070019787 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019788
19789 @see
19790 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019791*/
19792WDI_Status
19793WDI_ClearPendingRequests
Jeff Johnsone7245742012-09-05 17:12:55 -070019794(
Jeff Johnson295189b2012-06-20 16:38:30 -070019795 WDI_ControlBlockType* pWDICtx
19796)
19797{
Jeff Johnsone7245742012-09-05 17:12:55 -070019798 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019799 WDI_EventInfoType* pEventDataQueue = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019800 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019801 void* pUserData;
19802 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19803
Jeff Johnsone7245742012-09-05 17:12:55 -070019804 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019805
19806 /*------------------------------------------------------------------------
19807 Go through all the requests and fail them - this will only be called
19808 when device is being stopped or an error was detected - either case the
Jeff Johnsone7245742012-09-05 17:12:55 -070019809 pending requests can no longer be sent down to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070019810 ------------------------------------------------------------------------*/
19811 while( pNode )
19812 {
19813 /*The node actually points to the 1st element inside the Event Data struct -
19814 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019815 pEventDataQueue = (WDI_EventInfoType*)pNode;
19816
Jeff Johnson295189b2012-06-20 16:38:30 -070019817 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
19818 if ( NULL != pfnReqStatusCB )
19819 {
19820 /*Fail the request*/
19821 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
19822 }
19823 /* Free data - that was allocated when queueing */
19824 if ( pEventDataQueue->pEventData != NULL )
19825 {
19826 wpalMemoryFree(pEventDataQueue->pEventData);
19827 }
19828 wpalMemoryFree(pEventDataQueue);
19829
19830 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
19831 {
19832 break;
19833 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019834 }
19835
Jeff Johnson295189b2012-06-20 16:38:30 -070019836 return WDI_STATUS_SUCCESS;
19837}/*WDI_ClearPendingRequests*/
19838
19839/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019840 @brief Helper routine used to init the BSS Sessions in the WDI control block
19841
19842
19843 @param pWDICtx: pointer to the WLAN DAL context
19844
Jeff Johnson295189b2012-06-20 16:38:30 -070019845 @see
19846*/
19847void
19848WDI_ResetAssocSessions
Jeff Johnsone7245742012-09-05 17:12:55 -070019849(
Jeff Johnson295189b2012-06-20 16:38:30 -070019850 WDI_ControlBlockType* pWDICtx
19851)
19852{
Jeff Johnsone7245742012-09-05 17:12:55 -070019853 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019854 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19855
19856 /*-------------------------------------------------------------------------
19857 No Sanity check
19858 -------------------------------------------------------------------------*/
19859 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19860 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019861 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
Jeff Johnson295189b2012-06-20 16:38:30 -070019862 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
19863 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
19864 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
19865 }
19866}/*WDI_ResetAssocSessions*/
19867
19868/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019869 @brief Helper routine used to find a session based on the BSSID
19870
19871
19872 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019873 macBSSID: BSSID of the session
Jeff Johnsone7245742012-09-05 17:12:55 -070019874 pSession: pointer to the session (if found)
19875
Jeff Johnson295189b2012-06-20 16:38:30 -070019876 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019877 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019878*/
19879wpt_uint8
19880WDI_FindAssocSession
Jeff Johnsone7245742012-09-05 17:12:55 -070019881(
Jeff Johnson295189b2012-06-20 16:38:30 -070019882 WDI_ControlBlockType* pWDICtx,
19883 wpt_macAddr macBSSID,
19884 WDI_BSSSessionType** ppSession
19885)
19886{
Jeff Johnsone7245742012-09-05 17:12:55 -070019887 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019888 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19889
19890 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019891 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019892 -------------------------------------------------------------------------*/
19893 if ( NULL == ppSession )
19894 {
19895 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19896 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019897 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019898 }
19899
Jeff Johnsone7245742012-09-05 17:12:55 -070019900 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019901
Jeff Johnsone7245742012-09-05 17:12:55 -070019902 /*------------------------------------------------------------------------
19903 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019904 ------------------------------------------------------------------------*/
19905 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19906 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019907 if ( eWLAN_PAL_TRUE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070019908 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
19909 {
19910 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019911 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019912 return i;
19913 }
19914 }
19915
Jeff Johnsone7245742012-09-05 17:12:55 -070019916 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019917}/*WDI_FindAssocSession*/
19918
19919/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019920 @brief Helper routine used to find a session based on the BSSID
19921
19922
19923 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019924 ucBSSIdx: BSS Index of the session
19925 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019926
Jeff Johnson295189b2012-06-20 16:38:30 -070019927 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019928 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019929*/
19930wpt_uint8
19931WDI_FindAssocSessionByBSSIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019932(
Jeff Johnson295189b2012-06-20 16:38:30 -070019933 WDI_ControlBlockType* pWDICtx,
19934 wpt_uint16 ucBSSIdx,
19935 WDI_BSSSessionType** ppSession
19936)
19937{
Jeff Johnsone7245742012-09-05 17:12:55 -070019938 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019939 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19940
19941 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019942 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019943 -------------------------------------------------------------------------*/
19944 if ( NULL == ppSession )
19945 {
19946 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19947 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019948 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019949 }
19950
Jeff Johnsone7245742012-09-05 17:12:55 -070019951 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019952
Jeff Johnsone7245742012-09-05 17:12:55 -070019953 /*------------------------------------------------------------------------
19954 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019955 ------------------------------------------------------------------------*/
19956 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19957 {
19958 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
19959 {
19960 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019961 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019962 return i;
19963 }
19964 }
19965
Jeff Johnsone7245742012-09-05 17:12:55 -070019966 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019967}/*WDI_FindAssocSessionByBSSIdx*/
19968
19969/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019970 @brief Helper routine used to find a session based on the BSSID
19971
19972
19973 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019974 ucBSSIdx: BSS Index of the session
19975 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019976
Jeff Johnson295189b2012-06-20 16:38:30 -070019977 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019978 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019979*/
19980wpt_uint8
19981WDI_FindAssocSessionByIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019982(
Jeff Johnson295189b2012-06-20 16:38:30 -070019983 WDI_ControlBlockType* pWDICtx,
19984 wpt_uint16 usIdx,
19985 WDI_BSSSessionType** ppSession
19986)
19987{
19988 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19989
19990 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019991 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019992 -------------------------------------------------------------------------*/
19993 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
19994 {
19995 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19996 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019997 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019998 }
19999
20000 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020001 *ppSession = &pWDICtx->aBSSSessions[usIdx];
Jeff Johnson295189b2012-06-20 16:38:30 -070020002
20003 return usIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020004
Jeff Johnson295189b2012-06-20 16:38:30 -070020005}/*WDI_FindAssocSessionByBSSIdx*/
20006
20007/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020008 @brief Helper routine used to find an empty session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020009 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020010
20011
20012 @param pWDICtx: pointer to the WLAN DAL context
20013 pSession: pointer to the session (if found)
20014
Jeff Johnson295189b2012-06-20 16:38:30 -070020015 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020016 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020017*/
20018wpt_uint8
20019WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -070020020(
Jeff Johnson295189b2012-06-20 16:38:30 -070020021 WDI_ControlBlockType* pWDICtx,
20022 WDI_BSSSessionType** ppSession
20023)
20024{
Jeff Johnsone7245742012-09-05 17:12:55 -070020025 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020026 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20027 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020028 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020029 -------------------------------------------------------------------------*/
20030 if ( NULL == ppSession )
20031 {
20032 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20033 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020034 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020035 }
20036
Jeff Johnsone7245742012-09-05 17:12:55 -070020037 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020038
Jeff Johnsone7245742012-09-05 17:12:55 -070020039 /*------------------------------------------------------------------------
20040 Search for a session that it is not in use
Jeff Johnson295189b2012-06-20 16:38:30 -070020041 ------------------------------------------------------------------------*/
20042 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20043 {
20044 if ( ! pWDICtx->aBSSSessions[i].bInUse )
20045 {
20046 /*Found a session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020047 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020048 return i;
20049 }
20050 }
20051
Jeff Johnsone7245742012-09-05 17:12:55 -070020052 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020053}/*WDI_FindEmptySession*/
20054
20055
20056/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020057 @brief Helper routine used to get the total count of active
Jeff Johnson295189b2012-06-20 16:38:30 -070020058 sessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020059
20060
20061 @param pWDICtx: pointer to the WLAN DAL context
20062
Jeff Johnson295189b2012-06-20 16:38:30 -070020063 @see
20064 @return Number of sessions in use
20065*/
20066wpt_uint8
20067WDI_GetActiveSessionsCount
Jeff Johnsone7245742012-09-05 17:12:55 -070020068(
Jeff Johnson295189b2012-06-20 16:38:30 -070020069 WDI_ControlBlockType* pWDICtx
20070)
20071{
Jeff Johnsone7245742012-09-05 17:12:55 -070020072 wpt_uint8 i, ucCount = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070020073 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020074
20075 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070020076 Count all sessions in use
20077 ------------------------------------------------------------------------*/
20078 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20079 {
20080 if ( pWDICtx->aBSSSessions[i].bInUse )
20081 {
20082 ucCount++;
20083 }
20084 }
20085
Jeff Johnsone7245742012-09-05 17:12:55 -070020086 return ucCount;
Jeff Johnson295189b2012-06-20 16:38:30 -070020087}/*WDI_GetActiveSessionsCount*/
20088
20089/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020090 @brief Helper routine used to delete session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020091 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020092
20093
20094 @param pWDICtx: pointer to the WLAN DAL context
20095 pSession: pointer to the session (if found)
20096
Jeff Johnson295189b2012-06-20 16:38:30 -070020097 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020098 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020099*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020100void
Jeff Johnson295189b2012-06-20 16:38:30 -070020101WDI_DeleteSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020102(
Jeff Johnson295189b2012-06-20 16:38:30 -070020103 WDI_ControlBlockType* pWDICtx,
20104 WDI_BSSSessionType* ppSession
20105)
20106{
20107 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020108 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020109 -------------------------------------------------------------------------*/
20110 if ( NULL == ppSession )
20111 {
20112 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20113 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020114 return ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020115 }
20116
Jeff Johnsone7245742012-09-05 17:12:55 -070020117 /*------------------------------------------------------------------------
20118 Reset the entries int session
Jeff Johnson295189b2012-06-20 16:38:30 -070020119 ------------------------------------------------------------------------*/
20120 wpal_list_destroy(&ppSession->wptPendingQueue);
20121 wpalMemoryZero(ppSession, sizeof(*ppSession));
Jeff Johnsone7245742012-09-05 17:12:55 -070020122 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
20123 ppSession->bInUse = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020124 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
20125 wpal_list_init(&ppSession->wptPendingQueue);
20126
20127}/*WDI_DeleteSession*/
20128
20129/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020130 @brief Utility function to add the broadcast STA to the the STA table.
Jeff Johnson295189b2012-06-20 16:38:30 -070020131 The bcast STA ID is assigned by HAL and must be valid.
Jeff Johnsone7245742012-09-05 17:12:55 -070020132 @param
20133
Jeff Johnson295189b2012-06-20 16:38:30 -070020134 WDI_AddStaParams: - pointer to the WDI Add STA params
20135 usBcastStaIdx: - Broadcast STA index passed by HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070020136
20137 @see
20138 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070020139*/
20140void
20141WDI_AddBcastSTAtoSTATable
20142(
20143 WDI_ControlBlockType* pWDICtx,
20144 WDI_AddStaParams * staParams,
20145 wpt_uint16 usBcastStaIdx
20146)
20147{
20148 WDI_AddStaParams wdiAddSTAParam = {0};
20149 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
20150 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20151
20152 /*---------------------------------------------------------------------
20153 Sanity check
20154 ---------------------------------------------------------------------*/
20155 if ( NULL == staParams )
20156 {
20157 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20158 "%s: Invalid parameters", __FUNCTION__);
20159
Jeff Johnsone7245742012-09-05 17:12:55 -070020160 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020161 }
20162
20163 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
20164 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
20165 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
20166 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
20167 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
20168 wdiAddSTAParam.dpuSig = staParams->dpuSig;
20169 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
20170 WDI_MAC_ADDR_LEN );
20171 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
20172 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
20173 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
20174 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
20175 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
20176 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
20177 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020178
Jeff Johnson295189b2012-06-20 16:38:30 -070020179 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
20180}
20181
20182/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020183 @brief NV blob will be divided into fragments of size 4kb and
20184 Sent to HAL
20185
20186 @param pWDICtx: pointer to the WLAN DAL context
20187 pEventData: pointer to the event information structure
20188
Jeff Johnson295189b2012-06-20 16:38:30 -070020189 @see
20190 @return Result of the function call
20191 */
20192
20193WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -070020194(
Jeff Johnson295189b2012-06-20 16:38:30 -070020195 WDI_ControlBlockType* pWDICtx,
20196 WDI_EventInfoType* pEventData
20197)
20198{
20199
20200 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
20201 wpt_uint8* pSendBuffer = NULL;
20202 wpt_uint16 usDataOffset = 0;
20203 wpt_uint16 usSendSize = 0;
20204 wpt_uint16 usCurrentFragmentSize =0;
20205 wpt_uint8* pSrcBuffer = NULL;
20206 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
20207 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
20208
20209 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
20210 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
20211 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
20212
Jeff Johnsone7245742012-09-05 17:12:55 -070020213 /* Sanity Check is done by the caller */
Jeff Johnson295189b2012-06-20 16:38:30 -070020214 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
20215
20216 /* Update the current Fragment Number */
20217 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
20218
20219 /*Update the HAL REQ structure */
20220 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
20221 halNvImgDownloadParam.nvImageReqParams.fragNumber =
20222 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
20223
20224 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
Jeff Johnsone7245742012-09-05 17:12:55 -070020225 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
Jeff Johnson295189b2012-06-20 16:38:30 -070020226 image will be sent to HAL*/
20227
Jeff Johnsone7245742012-09-05 17:12:55 -070020228 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
Jeff Johnson295189b2012-06-20 16:38:30 -070020229 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
Jeff Johnsone7245742012-09-05 17:12:55 -070020230 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020231 /* Taking care of boundry condition */
Jeff Johnsone7245742012-09-05 17:12:55 -070020232 if( !(usCurrentFragmentSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070020233 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
20234 usCurrentFragmentSize = FRAGMENT_SIZE;
20235
20236 /*Update the HAL REQ structure */
20237 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
20238 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
20239
20240 }
20241 else
Jeff Johnsone7245742012-09-05 17:12:55 -070020242 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020243 usCurrentFragmentSize = FRAGMENT_SIZE;
20244
20245 /*Update the HAL REQ structure */
20246 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
20247 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
20248 }
20249
20250 /*-----------------------------------------------------------------------
20251 Get message buffer
20252 -----------------------------------------------------------------------*/
20253 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
20254 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
20255 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070020256 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070020257 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
20258 {
20259 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20260 "Unable to get send buffer in NV Download req %x %x ",
20261 pEventData, pwdiNvDownloadReqParams);
20262 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070020263 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020264 }
20265
20266 /* Copying the Hal NV download REQ structure */
Jeff Johnsone7245742012-09-05 17:12:55 -070020267 wpalMemoryCopy(pSendBuffer + usDataOffset ,
Jeff Johnson295189b2012-06-20 16:38:30 -070020268 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
20269
20270 /* Appending the NV image fragment */
20271 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
20272 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
20273 usCurrentFragmentSize);
20274
20275 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070020276 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070020277
Jeff Johnsone7245742012-09-05 17:12:55 -070020278 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
20279 wdiNvDownloadRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -070020280 WDI_NV_DOWNLOAD_RESP);
20281
20282}
Jeff Johnsone7245742012-09-05 17:12:55 -070020283/*============================================================================
20284 Helper inline functions for
Jeff Johnson295189b2012-06-20 16:38:30 -070020285 ============================================================================*/
20286/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020287 @brief Helper routine used to find a session based on the BSSID
20288 @param pContext: pointer to the WLAN DAL context
20289 @param pDPContext: pointer to the Datapath context
20290
Jeff Johnson295189b2012-06-20 16:38:30 -070020291 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020292 @return
Jeff Johnson295189b2012-06-20 16:38:30 -070020293*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020294WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020295WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
20296{
20297 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20298
20299 pCB->pDPContext = pDPContext;
20300 return;
20301}
20302
20303/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020304 @brief Helper routine used to find a session based on the BSSID
20305
20306
20307 @param pContext: pointer to the WLAN DAL context
20308
Jeff Johnson295189b2012-06-20 16:38:30 -070020309 @see
20310 @return pointer to Datapath context
20311*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020312WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020313WDI_DS_GetDatapathContext (void *pContext)
20314{
20315 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20316 return pCB->pDPContext;
20317}
20318/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020319 @brief Helper routine used to find a session based on the BSSID
20320
20321
20322 @param pContext: pointer to the WLAN DAL context
20323 @param pDTDriverContext: pointer to the Transport Driver context
20324
Jeff Johnson295189b2012-06-20 16:38:30 -070020325 @see
20326 @return void
20327*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020328WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020329WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
20330{
20331 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20332
20333 pCB->pDTDriverContext = pDTDriverContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020334 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020335}
20336
20337/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020338 @brief Helper routine used to find a session based on the BSSID
20339
20340
20341 @param pWDICtx: pointer to the WLAN DAL context
20342
Jeff Johnson295189b2012-06-20 16:38:30 -070020343 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020344 @return pointer to datapath context
Jeff Johnson295189b2012-06-20 16:38:30 -070020345*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020346WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020347WDT_GetTransportDriverContext (void *pContext)
20348{
20349 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020350 return(pCB->pDTDriverContext);
Jeff Johnson295189b2012-06-20 16:38:30 -070020351}
20352
Jeff Johnsone7245742012-09-05 17:12:55 -070020353/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -070020354 Helper inline converters
20355 ============================================================================*/
20356/*Convert WDI driver type into HAL driver type*/
20357WPT_STATIC WPT_INLINE WDI_Status
20358WDI_HAL_2_WDI_STATUS
20359(
20360 eHalStatus halStatus
20361)
20362{
Jeff Johnsone7245742012-09-05 17:12:55 -070020363 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020364 the chances of getting inlined*/
20365 switch( halStatus )
20366 {
20367 case eHAL_STATUS_SUCCESS:
20368 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20369 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20370 return WDI_STATUS_SUCCESS;
20371 case eHAL_STATUS_FAILURE:
20372 return WDI_STATUS_E_FAILURE;
20373 case eHAL_STATUS_FAILED_ALLOC:
Jeff Johnsone7245742012-09-05 17:12:55 -070020374 return WDI_STATUS_MEM_FAILURE;
20375 /*The rest of the HAL error codes must be kept hidden from the UMAC as
Jeff Johnson295189b2012-06-20 16:38:30 -070020376 they refer to specific internal modules of our device*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020377 default:
20378 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20379 }
Jeff Johnson295189b2012-06-20 16:38:30 -070020380
Jeff Johnsone7245742012-09-05 17:12:55 -070020381 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020382}/*WDI_HAL_2_WDI_STATUS*/
20383
20384/*Convert WDI request type into HAL request type*/
20385WPT_STATIC WPT_INLINE tHalHostMsgType
20386WDI_2_HAL_REQ_TYPE
20387(
20388 WDI_RequestEnumType wdiReqType
20389)
20390{
Jeff Johnsone7245742012-09-05 17:12:55 -070020391 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020392 the chances of getting inlined*/
20393 switch( wdiReqType )
Jeff Johnsone7245742012-09-05 17:12:55 -070020394 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020395 case WDI_START_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020396 return WLAN_HAL_START_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020397 case WDI_STOP_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020398 return WLAN_HAL_STOP_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020399 case WDI_INIT_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020400 return WLAN_HAL_INIT_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020401 case WDI_START_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020402 return WLAN_HAL_START_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020403 case WDI_END_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020404 return WLAN_HAL_END_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020405 case WDI_FINISH_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020406 return WLAN_HAL_FINISH_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020407 case WDI_JOIN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020408 return WLAN_HAL_JOIN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020409 case WDI_CONFIG_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020410 return WLAN_HAL_CONFIG_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020411 case WDI_DEL_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020412 return WLAN_HAL_DELETE_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020413 case WDI_POST_ASSOC_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020414 return WLAN_HAL_POST_ASSOC_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020415 case WDI_DEL_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020416 return WLAN_HAL_DELETE_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020417 case WDI_SET_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020418 return WLAN_HAL_SET_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020419 case WDI_RMV_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020420 return WLAN_HAL_RMV_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020421 case WDI_SET_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020422 return WLAN_HAL_SET_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020423 case WDI_RMV_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020424 return WLAN_HAL_RMV_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020425 case WDI_SET_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020426 return WLAN_HAL_SET_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020427 case WDI_RMV_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020428 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020429 return WLAN_HAL_RMV_STAKEY_REQ;
20430 case WDI_ADD_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020431 return WLAN_HAL_ADD_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020432 case WDI_DEL_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020433 return WLAN_HAL_DEL_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020434 case WDI_UPD_EDCA_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020435 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020436 case WDI_ADD_BA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020437 return WLAN_HAL_ADD_BA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020438 case WDI_DEL_BA_REQ:
20439 return WLAN_HAL_DEL_BA_REQ;
20440#ifdef FEATURE_WLAN_CCX
20441 case WDI_TSM_STATS_REQ:
20442 return WLAN_HAL_TSM_STATS_REQ;
20443#endif
20444 case WDI_CH_SWITCH_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020445 return WLAN_HAL_CH_SWITCH_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020446 case WDI_CONFIG_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020447 return WLAN_HAL_CONFIG_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020448 case WDI_SET_LINK_ST_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020449 return WLAN_HAL_SET_LINK_ST_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020450 case WDI_GET_STATS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020451 return WLAN_HAL_GET_STATS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020452 case WDI_UPDATE_CFG_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020453 return WLAN_HAL_UPDATE_CFG_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020454 case WDI_ADD_BA_SESSION_REQ:
20455 return WLAN_HAL_ADD_BA_SESSION_REQ;
20456 case WDI_TRIGGER_BA_REQ:
20457 return WLAN_HAL_TRIGGER_BA_REQ;
20458 case WDI_UPD_BCON_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020459 return WLAN_HAL_UPDATE_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020460 case WDI_SND_BCON_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020461 return WLAN_HAL_SEND_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020462 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20463 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20464 case WDI_SET_MAX_TX_POWER_REQ:
20465 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20466#ifdef WLAN_FEATURE_P2P
20467 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20468 return WLAN_HAL_SET_P2P_GONOA_REQ;
20469#endif
20470 case WDI_ENTER_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020471 return WLAN_HAL_ENTER_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020472 case WDI_EXIT_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020473 return WLAN_HAL_EXIT_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020474 case WDI_ENTER_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020475 return WLAN_HAL_ENTER_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020476 case WDI_EXIT_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020477 return WLAN_HAL_EXIT_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020478 case WDI_ENTER_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020479 return WLAN_HAL_ENTER_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020480 case WDI_EXIT_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020481 return WLAN_HAL_EXIT_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020482 case WDI_SET_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020483 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020484 case WDI_UPDATE_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020485 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020486 case WDI_CONFIGURE_RXP_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020487 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020488 case WDI_SET_BEACON_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020489 return WLAN_HAL_ADD_BCN_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020490 case WDI_REM_BEACON_FILTER_REQ:
20491 return WLAN_HAL_REM_BCN_FILTER_REQ;
20492 case WDI_SET_RSSI_THRESHOLDS_REQ:
20493 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20494 case WDI_HOST_OFFLOAD_REQ:
20495 return WLAN_HAL_HOST_OFFLOAD_REQ;
20496 case WDI_WOWL_ADD_BC_PTRN_REQ:
20497 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20498 case WDI_WOWL_DEL_BC_PTRN_REQ:
20499 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20500 case WDI_WOWL_ENTER_REQ:
20501 return WLAN_HAL_ENTER_WOWL_REQ;
20502 case WDI_WOWL_EXIT_REQ:
20503 return WLAN_HAL_EXIT_WOWL_REQ;
20504 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20505 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20506 case WDI_NV_DOWNLOAD_REQ:
20507 return WLAN_HAL_DOWNLOAD_NV_REQ;
20508 case WDI_FLUSH_AC_REQ:
20509 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20510 case WDI_BTAMP_EVENT_REQ:
20511 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20512#ifdef WLAN_FEATURE_VOWIFI_11R
20513 case WDI_AGGR_ADD_TS_REQ:
20514 return WLAN_HAL_AGGR_ADD_TS_REQ;
20515#endif /* WLAN_FEATURE_VOWIFI_11R */
20516#ifdef ANI_MANF_DIAG
20517 case WDI_FTM_CMD_REQ:
20518 return WLAN_HAL_PROCESS_PTT_REQ;
20519#endif /* ANI_MANF_DIAG */
20520 case WDI_ADD_STA_SELF_REQ:
20521 return WLAN_HAL_ADD_STA_SELF_REQ;
20522 case WDI_DEL_STA_SELF_REQ:
20523 return WLAN_HAL_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070020524#ifdef FEATURE_OEM_DATA_SUPPORT
20525 case WDI_START_OEM_DATA_REQ:
20526 return WLAN_HAL_START_OEM_DATA_REQ;
20527#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020528 case WDI_HOST_RESUME_REQ:
20529 return WLAN_HAL_HOST_RESUME_REQ;
20530 case WDI_HOST_SUSPEND_IND:
20531 return WLAN_HAL_HOST_SUSPEND_IND;
20532 case WDI_KEEP_ALIVE_REQ:
20533 return WLAN_HAL_KEEP_ALIVE_REQ;
20534
20535#ifdef FEATURE_WLAN_SCAN_PNO
20536 case WDI_SET_PREF_NETWORK_REQ:
20537 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20538 case WDI_SET_RSSI_FILTER_REQ:
20539 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20540 case WDI_UPDATE_SCAN_PARAMS_REQ:
20541 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20542#endif // FEATURE_WLAN_SCAN_PNO
20543 case WDI_SET_TX_PER_TRACKING_REQ:
20544 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20545#ifdef WLAN_FEATURE_PACKET_FILTERING
20546 case WDI_8023_MULTICAST_LIST_REQ:
20547 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20548 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020549 return WLAN_HAL_SET_PACKET_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020550 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20551 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20552 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20553 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20554#endif // WLAN_FEATURE_PACKET_FILTERING
20555 case WDI_HAL_DUMP_CMD_REQ:
20556 return WLAN_HAL_DUMP_COMMAND_REQ;
20557#ifdef WLAN_FEATURE_GTK_OFFLOAD
20558 case WDI_GTK_OFFLOAD_REQ:
20559 return WLAN_HAL_GTK_OFFLOAD_REQ;
20560 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20561 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20562#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20563
20564 case WDI_INIT_SCAN_CON_REQ:
20565 return WLAN_HAL_INIT_SCAN_CON_REQ;
20566 case WDI_SET_POWER_PARAMS_REQ:
20567 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20568 case WDI_SET_TM_LEVEL_REQ:
20569 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20570 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20571 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020572#ifdef WLAN_FEATURE_11AC
20573 case WDI_UPDATE_VHT_OP_MODE_REQ:
20574 return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ;
20575#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020576 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020577 return WLAN_HAL_MSG_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020578 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020579
Jeff Johnson295189b2012-06-20 16:38:30 -070020580}/*WDI_2_HAL_REQ_TYPE*/
20581
20582/*Convert WDI response type into HAL response type*/
20583WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20584HAL_2_WDI_RSP_TYPE
20585(
20586 tHalHostMsgType halMsg
20587)
20588{
Jeff Johnsone7245742012-09-05 17:12:55 -070020589 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020590 the chances of getting inlined*/
20591 switch( halMsg )
20592 {
20593 case WLAN_HAL_START_RSP:
20594 return WDI_START_RESP;
20595 case WLAN_HAL_STOP_RSP:
20596 return WDI_STOP_RESP;
20597 case WLAN_HAL_INIT_SCAN_RSP:
20598 return WDI_INIT_SCAN_RESP;
20599 case WLAN_HAL_START_SCAN_RSP:
20600 return WDI_START_SCAN_RESP;
20601 case WLAN_HAL_END_SCAN_RSP:
20602 return WDI_END_SCAN_RESP;
20603 case WLAN_HAL_FINISH_SCAN_RSP:
20604 return WDI_FINISH_SCAN_RESP;
20605 case WLAN_HAL_CONFIG_STA_RSP:
20606 return WDI_CONFIG_STA_RESP;
20607 case WLAN_HAL_DELETE_STA_RSP:
20608 return WDI_DEL_STA_RESP;
20609 case WLAN_HAL_CONFIG_BSS_RSP:
20610 return WDI_CONFIG_BSS_RESP;
20611 case WLAN_HAL_DELETE_BSS_RSP:
20612 return WDI_DEL_BSS_RESP;
20613 case WLAN_HAL_JOIN_RSP:
20614 return WDI_JOIN_RESP;
20615 case WLAN_HAL_POST_ASSOC_RSP:
20616 return WDI_POST_ASSOC_RESP;
20617 case WLAN_HAL_SET_BSSKEY_RSP:
20618 return WDI_SET_BSS_KEY_RESP;
20619 case WLAN_HAL_SET_STAKEY_RSP:
20620 return WDI_SET_STA_KEY_RESP;
20621 case WLAN_HAL_RMV_BSSKEY_RSP:
20622 return WDI_RMV_BSS_KEY_RESP;
20623 case WLAN_HAL_RMV_STAKEY_RSP:
20624 return WDI_RMV_STA_KEY_RESP;
20625 case WLAN_HAL_SET_BCASTKEY_RSP:
20626 return WDI_SET_STA_BCAST_KEY_RESP;
20627 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20628 // return WDI_RMV_STA_BCAST_KEY_RESP;
20629 case WLAN_HAL_ADD_TS_RSP:
20630 return WDI_ADD_TS_RESP;
20631 case WLAN_HAL_DEL_TS_RSP:
20632 return WDI_DEL_TS_RESP;
20633 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20634 return WDI_UPD_EDCA_PRMS_RESP;
20635 case WLAN_HAL_ADD_BA_RSP:
20636 return WDI_ADD_BA_RESP;
20637 case WLAN_HAL_DEL_BA_RSP:
20638 return WDI_DEL_BA_RESP;
20639#ifdef FEATURE_WLAN_CCX
20640 case WLAN_HAL_TSM_STATS_RSP:
20641 return WDI_TSM_STATS_RESP;
20642#endif
20643 case WLAN_HAL_CH_SWITCH_RSP:
20644 return WDI_CH_SWITCH_RESP;
20645 case WLAN_HAL_SET_LINK_ST_RSP:
20646 return WDI_SET_LINK_ST_RESP;
20647 case WLAN_HAL_GET_STATS_RSP:
20648 return WDI_GET_STATS_RESP;
20649 case WLAN_HAL_UPDATE_CFG_RSP:
20650 return WDI_UPDATE_CFG_RESP;
20651 case WLAN_HAL_ADD_BA_SESSION_RSP:
20652 return WDI_ADD_BA_SESSION_RESP;
20653 case WLAN_HAL_TRIGGER_BA_RSP:
20654 return WDI_TRIGGER_BA_RESP;
20655 case WLAN_HAL_UPDATE_BEACON_RSP:
20656 return WDI_UPD_BCON_PRMS_RESP;
20657 case WLAN_HAL_SEND_BEACON_RSP:
20658 return WDI_SND_BCON_RESP;
20659 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20660 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20661 /*Indications*/
20662 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20663 return WDI_HAL_RSSI_NOTIFICATION_IND;
20664 case WLAN_HAL_MISSED_BEACON_IND:
20665 return WDI_HAL_MISSED_BEACON_IND;
20666 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20667 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20668 case WLAN_HAL_MIC_FAILURE_IND:
20669 return WDI_HAL_MIC_FAILURE_IND;
20670 case WLAN_HAL_FATAL_ERROR_IND:
20671 return WDI_HAL_FATAL_ERROR_IND;
20672 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20673 return WDI_HAL_DEL_STA_IND;
20674 case WLAN_HAL_COEX_IND:
20675 return WDI_HAL_COEX_IND;
20676 case WLAN_HAL_OTA_TX_COMPL_IND:
20677 return WDI_HAL_TX_COMPLETE_IND;
20678#ifdef WLAN_FEATURE_P2P
20679 case WLAN_HAL_P2P_NOA_ATTR_IND:
20680 return WDI_HAL_P2P_NOA_ATTR_IND;
20681#endif
20682 case WLAN_HAL_TX_PER_HIT_IND:
20683 return WDI_HAL_TX_PER_HIT_IND;
20684 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20685 return WDI_SET_MAX_TX_POWER_RESP;
20686#ifdef WLAN_FEATURE_P2P
20687 case WLAN_HAL_SET_P2P_GONOA_RSP:
20688 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20689#endif
20690 case WLAN_HAL_ENTER_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020691 return WDI_ENTER_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020692 case WLAN_HAL_EXIT_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020693 return WDI_EXIT_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020694 case WLAN_HAL_ENTER_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020695 return WDI_ENTER_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020696 case WLAN_HAL_EXIT_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020697 return WDI_EXIT_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020698 case WLAN_HAL_ENTER_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020699 return WDI_ENTER_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020700 case WLAN_HAL_EXIT_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020701 return WDI_EXIT_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020702 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020703 return WDI_SET_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020704 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020705 return WDI_UPDATE_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020706 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020707 return WDI_CONFIGURE_RXP_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020708 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20709 return WDI_SET_BEACON_FILTER_RESP;
20710 case WLAN_HAL_REM_BCN_FILTER_RSP:
20711 return WDI_REM_BEACON_FILTER_RESP;
20712 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20713 return WDI_SET_RSSI_THRESHOLDS_RESP;
20714 case WLAN_HAL_HOST_OFFLOAD_RSP:
20715 return WDI_HOST_OFFLOAD_RESP;
20716 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20717 return WDI_WOWL_ADD_BC_PTRN_RESP;
20718 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20719 return WDI_WOWL_DEL_BC_PTRN_RESP;
20720 case WLAN_HAL_ENTER_WOWL_RSP:
20721 return WDI_WOWL_ENTER_RESP;
20722 case WLAN_HAL_EXIT_WOWL_RSP:
20723 return WDI_WOWL_EXIT_RESP;
20724 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20725 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20726 case WLAN_HAL_DOWNLOAD_NV_RSP:
20727 return WDI_NV_DOWNLOAD_RESP;
20728 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20729 return WDI_FLUSH_AC_RESP;
20730 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20731 return WDI_BTAMP_EVENT_RESP;
20732#ifdef ANI_MANF_DIAG
20733 case WLAN_HAL_PROCESS_PTT_RSP:
20734 return WDI_FTM_CMD_RESP;
20735#endif /* ANI_MANF_DIAG */
20736 case WLAN_HAL_ADD_STA_SELF_RSP:
20737 return WDI_ADD_STA_SELF_RESP;
20738case WLAN_HAL_DEL_STA_SELF_RSP:
20739 return WDI_DEL_STA_SELF_RESP;
Jeff Johnsone7245742012-09-05 17:12:55 -070020740#ifdef FEATURE_OEM_DATA_SUPPORT
20741 case WLAN_HAL_START_OEM_DATA_RSP:
20742 return WDI_START_OEM_DATA_RESP;
20743#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020744 case WLAN_HAL_HOST_RESUME_RSP:
20745 return WDI_HOST_RESUME_RESP;
20746 case WLAN_HAL_KEEP_ALIVE_RSP:
20747 return WDI_KEEP_ALIVE_RESP;
20748#ifdef FEATURE_WLAN_SCAN_PNO
20749 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20750 return WDI_SET_PREF_NETWORK_RESP;
20751 case WLAN_HAL_SET_RSSI_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020752 return WDI_SET_RSSI_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020753 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20754 return WDI_UPDATE_SCAN_PARAMS_RESP;
20755 case WLAN_HAL_PREF_NETW_FOUND_IND:
20756 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20757#endif // FEATURE_WLAN_SCAN_PNO
20758 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20759 return WDI_SET_TX_PER_TRACKING_RESP;
20760#ifdef WLAN_FEATURE_PACKET_FILTERING
20761 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20762 return WDI_8023_MULTICAST_LIST_RESP;
20763 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20764 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20765 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20766 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20767 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20768 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20769#endif // WLAN_FEATURE_PACKET_FILTERING
20770
20771 case WLAN_HAL_DUMP_COMMAND_RSP:
20772 return WDI_HAL_DUMP_CMD_RESP;
20773 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20774 return WDI_SET_POWER_PARAMS_RESP;
20775#ifdef WLAN_FEATURE_VOWIFI_11R
20776 case WLAN_HAL_AGGR_ADD_TS_RSP:
20777 return WDI_AGGR_ADD_TS_RESP;
20778#endif
20779
20780#ifdef WLAN_FEATURE_GTK_OFFLOAD
20781 case WLAN_HAL_GTK_OFFLOAD_RSP:
20782 return WDI_GTK_OFFLOAD_RESP;
20783 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20784 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20785#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20786#ifdef WLAN_WAKEUP_EVENTS
20787 case WLAN_HAL_WAKE_REASON_IND:
20788 return WDI_HAL_WAKE_REASON_IND;
20789#endif // WLAN_WAKEUP_EVENTS
20790
20791 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20792 return WDI_SET_TM_LEVEL_RESP;
20793 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20794 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020795#ifdef WLAN_FEATURE_11AC
20796 case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP:
20797 return WDI_UPDATE_VHT_OP_MODE_RESP;
20798#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020799 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020800 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020801 }
20802
20803}/*HAL_2_WDI_RSP_TYPE*/
20804
20805
20806/*Convert WDI driver type into HAL driver type*/
20807WPT_STATIC WPT_INLINE tDriverType
20808WDI_2_HAL_DRV_TYPE
20809(
20810 WDI_DriverType wdiDriverType
20811)
20812{
Jeff Johnsone7245742012-09-05 17:12:55 -070020813 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020814 the chances of getting inlined*/
20815 switch( wdiDriverType )
20816 {
20817 case WDI_DRIVER_TYPE_PRODUCTION:
20818 return eDRIVER_TYPE_PRODUCTION;
20819 case WDI_DRIVER_TYPE_MFG:
20820 return eDRIVER_TYPE_MFG;
20821 case WDI_DRIVER_TYPE_DVT:
20822 return eDRIVER_TYPE_DVT;
20823 }
20824
Jeff Johnsone7245742012-09-05 17:12:55 -070020825 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020826}/*WDI_2_HAL_DRV_TYPE*/
20827
20828
20829/*Convert WDI stop reason into HAL stop reason*/
20830WPT_STATIC WPT_INLINE tHalStopType
20831WDI_2_HAL_STOP_REASON
20832(
20833 WDI_StopType wdiDriverType
20834)
20835{
Jeff Johnsone7245742012-09-05 17:12:55 -070020836 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020837 the chances of getting inlined*/
20838 switch( wdiDriverType )
20839 {
20840 case WDI_STOP_TYPE_SYS_RESET:
20841 return HAL_STOP_TYPE_SYS_RESET;
20842 case WDI_DRIVER_TYPE_MFG:
20843 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
20844 case WDI_STOP_TYPE_RF_KILL:
20845 return HAL_STOP_TYPE_RF_KILL;
20846 }
20847
Jeff Johnsone7245742012-09-05 17:12:55 -070020848 return HAL_STOP_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020849}/*WDI_2_HAL_STOP_REASON*/
20850
20851
20852/*Convert WDI scan mode type into HAL scan mode type*/
20853WPT_STATIC WPT_INLINE eHalSysMode
20854WDI_2_HAL_SCAN_MODE
20855(
20856 WDI_ScanMode wdiScanMode
20857)
20858{
Jeff Johnsone7245742012-09-05 17:12:55 -070020859 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020860 the chances of getting inlined*/
20861 switch( wdiScanMode )
20862 {
20863 case WDI_SCAN_MODE_NORMAL:
20864 return eHAL_SYS_MODE_NORMAL;
20865 case WDI_SCAN_MODE_LEARN:
20866 return eHAL_SYS_MODE_LEARN;
20867 case WDI_SCAN_MODE_SCAN:
20868 return eHAL_SYS_MODE_SCAN;
20869 case WDI_SCAN_MODE_PROMISC:
20870 return eHAL_SYS_MODE_PROMISC;
20871 case WDI_SCAN_MODE_SUSPEND_LINK:
20872 return eHAL_SYS_MODE_SUSPEND_LINK;
20873 }
20874
Jeff Johnsone7245742012-09-05 17:12:55 -070020875 return eHAL_SYS_MODE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020876}/*WDI_2_HAL_SCAN_MODE*/
20877
20878/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020879WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -070020880WDI_2_HAL_SEC_CH_OFFSET
20881(
20882 WDI_HTSecondaryChannelOffset wdiSecChOffset
20883)
20884{
Jeff Johnsone7245742012-09-05 17:12:55 -070020885 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020886 the chances of getting inlined*/
20887 switch( wdiSecChOffset )
20888 {
20889 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020890 return PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -070020891 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020892 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
Jeff Johnson295189b2012-06-20 16:38:30 -070020893 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
Jeff Johnsone7245742012-09-05 17:12:55 -070020894 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
20895#ifdef WLAN_FEATURE_11AC
20896 case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20897 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20898 case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20899 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20900 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20901 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20902 case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20903 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20904 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
20905 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20906 case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
20907 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
20908 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
20909 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
20910#endif
20911 default:
20912 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070020913 }
20914
Jeff Johnsone7245742012-09-05 17:12:55 -070020915 return PHY_CHANNEL_BONDING_STATE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020916}/*WDI_2_HAL_SEC_CH_OFFSET*/
20917
20918/*Convert WDI BSS type into HAL BSS type*/
20919WPT_STATIC WPT_INLINE tSirBssType
20920WDI_2_HAL_BSS_TYPE
20921(
20922 WDI_BssType wdiBSSType
20923)
20924{
Jeff Johnsone7245742012-09-05 17:12:55 -070020925 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020926 the chances of getting inlined*/
20927 switch( wdiBSSType )
20928 {
20929 case WDI_INFRASTRUCTURE_MODE:
20930 return eSIR_INFRASTRUCTURE_MODE;
20931 case WDI_INFRA_AP_MODE:
20932 return eSIR_INFRA_AP_MODE;
20933 case WDI_IBSS_MODE:
20934 return eSIR_IBSS_MODE;
20935 case WDI_BTAMP_STA_MODE:
20936 return eSIR_BTAMP_STA_MODE;
20937 case WDI_BTAMP_AP_MODE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020938 return eSIR_BTAMP_AP_MODE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020939 case WDI_BSS_AUTO_MODE:
20940 return eSIR_AUTO_MODE;
20941 }
20942
Jeff Johnsone7245742012-09-05 17:12:55 -070020943 return eSIR_DONOT_USE_BSS_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020944}/*WDI_2_HAL_BSS_TYPE*/
20945
20946/*Convert WDI NW type into HAL NW type*/
20947WPT_STATIC WPT_INLINE tSirNwType
20948WDI_2_HAL_NW_TYPE
20949(
20950 WDI_NwType wdiNWType
20951)
20952{
Jeff Johnsone7245742012-09-05 17:12:55 -070020953 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020954 the chances of getting inlined*/
20955 switch( wdiNWType )
20956 {
20957 case WDI_11A_NW_TYPE:
20958 return eSIR_11A_NW_TYPE;
20959 case WDI_11B_NW_TYPE:
20960 return eSIR_11B_NW_TYPE;
20961 case WDI_11G_NW_TYPE:
20962 return eSIR_11G_NW_TYPE;
20963 case WDI_11N_NW_TYPE:
20964 return eSIR_11N_NW_TYPE;
20965 }
20966
Jeff Johnsone7245742012-09-05 17:12:55 -070020967 return eSIR_DONOT_USE_NW_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020968}/*WDI_2_HAL_NW_TYPE*/
20969
20970/*Convert WDI chanel bonding type into HAL cb type*/
20971WPT_STATIC WPT_INLINE ePhyChanBondState
20972WDI_2_HAL_CB_STATE
20973(
20974 WDI_PhyChanBondState wdiCbState
20975)
20976{
Jeff Johnsone7245742012-09-05 17:12:55 -070020977 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020978 the chances of getting inlined*/
20979 switch ( wdiCbState )
20980 {
20981 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
20982 return PHY_SINGLE_CHANNEL_CENTERED;
20983 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
20984 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
20985 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
20986 return PHY_DOUBLE_CHANNEL_CENTERED;
20987 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
20988 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
Jeff Johnsone7245742012-09-05 17:12:55 -070020989#ifdef WLAN_FEATURE_11AC
20990 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20991 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20992 case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20993 return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
20994 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20995 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20996 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20997 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20998 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
20999 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
21000 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21001 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21002 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21003 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21004#endif
21005 case WDI_MAX_CB_STATE:
21006 default:
21007 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021008 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021009
Jeff Johnson295189b2012-06-20 16:38:30 -070021010 return PHY_CHANNEL_BONDING_STATE_MAX;
21011}/*WDI_2_HAL_CB_STATE*/
21012
21013/*Convert WDI chanel bonding type into HAL cb type*/
21014WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
21015WDI_2_HAL_HT_OPER_MODE
21016(
21017 WDI_HTOperatingMode wdiHTOperMode
21018)
21019{
Jeff Johnsone7245742012-09-05 17:12:55 -070021020 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021021 the chances of getting inlined*/
21022 switch ( wdiHTOperMode )
21023 {
21024 case WDI_HT_OP_MODE_PURE:
21025 return eSIR_HT_OP_MODE_PURE;
21026 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
21027 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
21028 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
21029 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
21030 case WDI_HT_OP_MODE_MIXED:
21031 return eSIR_HT_OP_MODE_MIXED;
21032 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021033
Jeff Johnson295189b2012-06-20 16:38:30 -070021034 return eSIR_HT_OP_MODE_MAX;
21035}/*WDI_2_HAL_HT_OPER_MODE*/
21036
21037/*Convert WDI mimo PS type into HAL mimo PS type*/
21038WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
21039WDI_2_HAL_MIMO_PS
21040(
21041 WDI_HTMIMOPowerSaveState wdiHTOperMode
21042)
21043{
Jeff Johnsone7245742012-09-05 17:12:55 -070021044 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021045 the chances of getting inlined*/
21046 switch ( wdiHTOperMode )
21047 {
21048 case WDI_HT_MIMO_PS_STATIC:
21049 return eSIR_HT_MIMO_PS_STATIC;
21050 case WDI_HT_MIMO_PS_DYNAMIC:
21051 return eSIR_HT_MIMO_PS_DYNAMIC;
21052 case WDI_HT_MIMO_PS_NA:
21053 return eSIR_HT_MIMO_PS_NA;
21054 case WDI_HT_MIMO_PS_NO_LIMIT:
21055 return eSIR_HT_MIMO_PS_NO_LIMIT;
21056 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021057
Jeff Johnson295189b2012-06-20 16:38:30 -070021058 return eSIR_HT_MIMO_PS_MAX;
21059}/*WDI_2_HAL_MIMO_PS*/
21060
21061/*Convert WDI ENC type into HAL ENC type*/
21062WPT_STATIC WPT_INLINE tAniEdType
21063WDI_2_HAL_ENC_TYPE
21064(
21065 WDI_EncryptType wdiEncType
21066)
21067{
Jeff Johnsone7245742012-09-05 17:12:55 -070021068 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021069 the chances of getting inlined*/
21070 switch ( wdiEncType )
21071 {
21072 case WDI_ENCR_NONE:
21073 return eSIR_ED_NONE;
21074
21075 case WDI_ENCR_WEP40:
21076 return eSIR_ED_WEP40;
21077
21078 case WDI_ENCR_WEP104:
21079 return eSIR_ED_WEP104;
21080
21081 case WDI_ENCR_TKIP:
21082 return eSIR_ED_TKIP;
21083
21084 case WDI_ENCR_CCMP:
21085 return eSIR_ED_CCMP;
21086
21087 case WDI_ENCR_AES_128_CMAC:
21088 return eSIR_ED_AES_128_CMAC;
21089#if defined(FEATURE_WLAN_WAPI)
21090 case WDI_ENCR_WPI:
21091 return eSIR_ED_WPI;
21092#endif
21093 default:
21094 return eSIR_ED_NOT_IMPLEMENTED;
21095 }
21096
21097}/*WDI_2_HAL_ENC_TYPE*/
21098
21099/*Convert WDI WEP type into HAL WEP type*/
21100WPT_STATIC WPT_INLINE tAniWepType
21101WDI_2_HAL_WEP_TYPE
21102(
21103 WDI_WepType wdiWEPType
21104)
21105{
Jeff Johnsone7245742012-09-05 17:12:55 -070021106 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021107 the chances of getting inlined*/
21108 switch ( wdiWEPType )
21109 {
21110 case WDI_WEP_STATIC:
21111 return eSIR_WEP_STATIC;
21112
21113 case WDI_WEP_DYNAMIC:
21114 return eSIR_WEP_DYNAMIC;
21115 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021116
Jeff Johnson295189b2012-06-20 16:38:30 -070021117 return eSIR_WEP_MAX;
21118}/*WDI_2_HAL_WEP_TYPE*/
21119
21120WPT_STATIC WPT_INLINE tSirLinkState
21121WDI_2_HAL_LINK_STATE
21122(
21123 WDI_LinkStateType wdiLinkState
21124)
21125{
Jeff Johnsone7245742012-09-05 17:12:55 -070021126 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021127 the chances of getting inlined*/
21128 switch ( wdiLinkState )
21129 {
21130 case WDI_LINK_IDLE_STATE:
21131 return eSIR_LINK_IDLE_STATE;
21132
21133 case WDI_LINK_PREASSOC_STATE:
21134 return eSIR_LINK_PREASSOC_STATE;
21135
21136 case WDI_LINK_POSTASSOC_STATE:
21137 return eSIR_LINK_POSTASSOC_STATE;
21138
21139 case WDI_LINK_AP_STATE:
21140 return eSIR_LINK_AP_STATE;
21141
21142 case WDI_LINK_IBSS_STATE:
21143 return eSIR_LINK_IBSS_STATE;
21144
21145 case WDI_LINK_BTAMP_PREASSOC_STATE:
21146 return eSIR_LINK_BTAMP_PREASSOC_STATE;
21147
21148 case WDI_LINK_BTAMP_POSTASSOC_STATE:
21149 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
21150
21151 case WDI_LINK_BTAMP_AP_STATE:
21152 return eSIR_LINK_BTAMP_AP_STATE;
21153
21154 case WDI_LINK_BTAMP_STA_STATE:
21155 return eSIR_LINK_BTAMP_STA_STATE;
21156
21157 case WDI_LINK_LEARN_STATE:
21158 return eSIR_LINK_LEARN_STATE;
21159
21160 case WDI_LINK_SCAN_STATE:
21161 return eSIR_LINK_SCAN_STATE;
21162
21163 case WDI_LINK_FINISH_SCAN_STATE:
21164 return eSIR_LINK_FINISH_SCAN_STATE;
21165
21166 case WDI_LINK_INIT_CAL_STATE:
21167 return eSIR_LINK_INIT_CAL_STATE;
21168
21169 case WDI_LINK_FINISH_CAL_STATE:
21170 return eSIR_LINK_FINISH_CAL_STATE;
21171
21172#ifdef WLAN_FEATURE_P2P
21173 case WDI_LINK_LISTEN_STATE:
21174 return eSIR_LINK_LISTEN_STATE;
21175#endif
21176
21177 default:
21178 return eSIR_LINK_MAX;
Jeff Johnsone7245742012-09-05 17:12:55 -070021179 }
Jeff Johnson295189b2012-06-20 16:38:30 -070021180}
21181
Jeff Johnsone7245742012-09-05 17:12:55 -070021182/*Translate a STA Context from WDI into HAL*/
21183WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -070021184void
21185WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -070021186(
Jeff Johnson295189b2012-06-20 16:38:30 -070021187 tConfigStaParams* phalConfigSta,
21188 WDI_ConfigStaReqInfoType* pwdiConfigSta
21189)
21190{
21191 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070021192#ifdef WLAN_FEATURE_11AC
21193 /* Get the Version 1 Handler */
21194 tConfigStaParams_V1* phalConfigSta_V1 = NULL;
21195 if (WDI_getFwWlanFeatCaps(DOT11AC))
21196 {
21197 phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta;
21198 }
21199#endif
21200 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021201 the chances of getting inlined*/
21202
Jeff Johnsone7245742012-09-05 17:12:55 -070021203 wpalMemoryCopy(phalConfigSta->bssId,
21204 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
21205
21206 wpalMemoryCopy(phalConfigSta->staMac,
21207 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070021208
21209 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
21210 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
21211 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
21212 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
21213 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
21214 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
21215 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
21216 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
21217 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
21218 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
21219 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
21220 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
21221 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
21222 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
21223 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
21224 phalConfigSta->action = pwdiConfigSta->wdiAction;
21225 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
21226 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
21227 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
21228 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
21229 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
21230 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
21231 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
Jeff Johnsone7245742012-09-05 17:12:55 -070021232
Jeff Johnson295189b2012-06-20 16:38:30 -070021233 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
21234
Jeff Johnsone7245742012-09-05 17:12:55 -070021235 phalConfigSta->supportedRates.opRateMode =
Jeff Johnson295189b2012-06-20 16:38:30 -070021236 pwdiConfigSta->wdiSupportedRates.opRateMode;
21237 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
21238 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021239 phalConfigSta->supportedRates.llbRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021240 pwdiConfigSta->wdiSupportedRates.llbRates[i];
21241 }
21242 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
21243 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021244 phalConfigSta->supportedRates.llaRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021245 pwdiConfigSta->wdiSupportedRates.llaRates[i];
21246 }
21247 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
21248 {
21249 phalConfigSta->supportedRates.aniLegacyRates[i] =
21250 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
21251 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021252 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070021253 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
21254 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
21255 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021256 phalConfigSta->supportedRates.supportedMCSSet[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021257 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
21258 }
21259 phalConfigSta->supportedRates.rxHighestDataRate =
21260 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
21261
Jeff Johnsone7245742012-09-05 17:12:55 -070021262#ifdef WLAN_FEATURE_11AC
21263 if(phalConfigSta_V1 != NULL)
21264 {
21265 phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap;
21266 phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate;
21267 phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap;
21268 phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate;
21269 }
21270#endif
21271
Jeff Johnson295189b2012-06-20 16:38:30 -070021272#ifdef WLAN_FEATURE_P2P
21273 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
21274#endif
21275
Jeff Johnsone7245742012-09-05 17:12:55 -070021276#ifdef WLAN_FEATURE_11AC
21277 if(phalConfigSta_V1 != NULL)
21278 {
21279 phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta;
21280 phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet;
21281 }
21282#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021283}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
Jeff Johnsone7245742012-09-05 17:12:55 -070021284
21285/*Translate a Rate set info from WDI into HAL*/
21286WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070021287WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -070021288(
Jeff Johnson295189b2012-06-20 16:38:30 -070021289 tSirMacRateSet* pHalRateSet,
21290 WDI_RateSet* pwdiRateSet
21291)
21292{
Jeff Johnsone7245742012-09-05 17:12:55 -070021293 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070021294 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21295
21296 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
21297 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
21298
21299 for ( i = 0; i < pHalRateSet->numRates; i++ )
21300 {
21301 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
21302 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021303
Jeff Johnson295189b2012-06-20 16:38:30 -070021304}/*WDI_CopyWDIRateSetToHALRateSet*/
21305
21306
21307/*Translate an EDCA Parameter Record from WDI into HAL*/
21308WPT_STATIC WPT_INLINE void
21309WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -070021310(
Jeff Johnson295189b2012-06-20 16:38:30 -070021311 tSirMacEdcaParamRecord* phalEdcaParam,
21312 WDI_EdcaParamRecord* pWDIEdcaParam
21313)
21314{
Jeff Johnsone7245742012-09-05 17:12:55 -070021315 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021316 the chances of getting inlined*/
21317
21318 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
21319 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
21320 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
21321 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
21322
21323 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
21324 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
21325 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
21326}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
21327
21328
21329/*Copy a management frame header from WDI fmt into HAL fmt*/
21330WPT_STATIC WPT_INLINE void
21331WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
21332(
21333 tSirMacMgmtHdr* pmacMgmtHdr,
21334 WDI_MacMgmtHdr* pwdiMacMgmtHdr
21335)
21336{
21337 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
21338 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
21339 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
21340 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
21341 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
21342 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
21343 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
21344 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
21345 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
21346 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
21347 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
21348
21349 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
21350 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
21351
Jeff Johnsone7245742012-09-05 17:12:55 -070021352 wpalMemoryCopy(pmacMgmtHdr->da,
Jeff Johnson295189b2012-06-20 16:38:30 -070021353 pwdiMacMgmtHdr->da, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021354 wpalMemoryCopy(pmacMgmtHdr->sa,
Jeff Johnson295189b2012-06-20 16:38:30 -070021355 pwdiMacMgmtHdr->sa, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021356 wpalMemoryCopy(pmacMgmtHdr->bssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070021357 pwdiMacMgmtHdr->bssId, 6);
21358
21359 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
21360 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
21361 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
21362
21363}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
21364
21365
21366/*Copy config bss parameters from WDI fmt into HAL fmt*/
21367WPT_STATIC WPT_INLINE void
21368WDI_CopyWDIConfigBSSToHALConfigBSS
21369(
21370 tConfigBssParams* phalConfigBSS,
21371 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
21372)
21373{
21374
21375 wpt_uint8 keyIndex = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070021376#ifdef WLAN_FEATURE_11AC
21377 /* Get the Version 1 Handler */
21378 tConfigBssParams_V1* phalConfigBSS_V1 = NULL;
21379 if (WDI_getFwWlanFeatCaps(DOT11AC))
21380 phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS;
21381#endif
21382
Jeff Johnson295189b2012-06-20 16:38:30 -070021383 wpalMemoryCopy( phalConfigBSS->bssId,
21384 pwdiConfigBSS->macBSSID,
21385 WDI_MAC_ADDR_LEN);
21386
21387#ifdef HAL_SELF_STA_PER_BSS
21388 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
21389 pwdiConfigBSS->macSelfAddr,
21390 WDI_MAC_ADDR_LEN);
21391#endif
21392
21393 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
21394
21395 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
21396 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
21397
Jeff Johnsone7245742012-09-05 17:12:55 -070021398 phalConfigBSS->shortSlotTimeSupported =
Jeff Johnson295189b2012-06-20 16:38:30 -070021399 pwdiConfigBSS->ucShortSlotTimeSupported;
21400 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
21401 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
21402 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
21403 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
21404 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070021405 phalConfigBSS->fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070021406 pwdiConfigBSS->ucTXOPProtectionFullSupport;
21407 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
21408 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
21409 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
21410 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
21411 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
21412 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
21413 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
21414 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
21415 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
21416 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
21417
Jeff Johnsone7245742012-09-05 17:12:55 -070021418 phalConfigBSS->htOperMode =
21419 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
Jeff Johnson295189b2012-06-20 16:38:30 -070021420
21421 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
21422 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
21423 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
21424 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
21425
21426#ifdef WLAN_FEATURE_VOWIFI
21427 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21428#endif
21429
21430 /*! Used 32 as magic number because that is how the ssid is declared inside the
21431 hal header - hal needs a macro for it */
Jeff Johnsone7245742012-09-05 17:12:55 -070021432 phalConfigBSS->ssId.length =
Jeff Johnson295189b2012-06-20 16:38:30 -070021433 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21434 pwdiConfigBSS->wdiSSID.ucLength : 32;
21435 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070021436 pwdiConfigBSS->wdiSSID.sSSID,
21437 phalConfigBSS->ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070021438
21439 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21440 &pwdiConfigBSS->wdiSTAContext);
Jeff Johnsone7245742012-09-05 17:12:55 -070021441
Jeff Johnson295189b2012-06-20 16:38:30 -070021442 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21443 &pwdiConfigBSS->wdiRateSet);
21444
21445 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21446
21447 if(phalConfigBSS->edcaParamsValid)
21448 {
21449 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21450 &pwdiConfigBSS->wdiBEEDCAParams);
21451 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21452 &pwdiConfigBSS->wdiBKEDCAParams);
21453 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21454 &pwdiConfigBSS->wdiVIEDCAParams);
21455 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21456 &pwdiConfigBSS->wdiVOEDCAParams);
21457 }
21458
Jeff Johnsone7245742012-09-05 17:12:55 -070021459 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
Jeff Johnson295189b2012-06-20 16:38:30 -070021460
21461 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21462
21463#ifdef WLAN_FEATURE_VOWIFI_11R
21464
Jeff Johnsone7245742012-09-05 17:12:55 -070021465 phalConfigBSS->extSetStaKeyParamValid =
Jeff Johnson295189b2012-06-20 16:38:30 -070021466 pwdiConfigBSS->bExtSetStaKeyParamValid;
Jeff Johnsone7245742012-09-05 17:12:55 -070021467
Jeff Johnson295189b2012-06-20 16:38:30 -070021468 if( phalConfigBSS->extSetStaKeyParamValid )
21469 {
21470 /*-----------------------------------------------------------------------
21471 Copy the STA Key parameters into the HAL message
21472 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021473 phalConfigBSS->extSetStaKeyParam.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021474 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21475
Jeff Johnsone7245742012-09-05 17:12:55 -070021476 phalConfigBSS->extSetStaKeyParam.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021477 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21478
21479 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21480
21481 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21482
21483 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21484
21485#ifdef WLAN_SOFTAP_FEATURE
21486 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21487 keyIndex++)
21488 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021489 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021490 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21491 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21492 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21493 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21494 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21495 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021496 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021497 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021498 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021499 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021500 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021501 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21502 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021503 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021504 WDI_MAX_KEY_LENGTH);
21505 }
21506#else
Jeff Johnsone7245742012-09-05 17:12:55 -070021507 phalConfigBSS->extSetStaKeyParam.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021508 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21509 phalConfigBSS->extSetStaKeyParam.key.unicast =
21510 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21511 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21512 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21513 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021514 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021515 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021516 phalConfigBSS->extSetStaKeyParam.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021517 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021518 phalConfigBSS->extSetStaKeyParam.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021519 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21520 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021521 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021522 WDI_MAX_KEY_LENGTH);
21523#endif
21524 }
21525 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21526 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021527 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070021528 sizeof(phalConfigBSS->extSetStaKeyParam) );
21529 }
21530
21531#endif /*WLAN_FEATURE_VOWIFI_11R*/
21532
Jeff Johnsone7245742012-09-05 17:12:55 -070021533#ifdef WLAN_FEATURE_11AC
21534 if(phalConfigBSS_V1 != NULL)
21535 {
21536 phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta;
21537 phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet;
21538 }
21539#endif
21540
Jeff Johnson295189b2012-06-20 16:38:30 -070021541}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21542
21543
Jeff Johnsone7245742012-09-05 17:12:55 -070021544/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -070021545 pointed to by user data */
21546WPT_STATIC WPT_INLINE void
21547WDI_ExtractRequestCBFromEvent
21548(
21549 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -070021550 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -070021551 void** ppUserData
21552)
21553{
21554 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21555 switch ( pEvent->wdiRequest )
21556 {
21557 case WDI_START_REQ:
21558 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21559 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21560 break;
21561 case WDI_STOP_REQ:
21562 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21563 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21564 break;
21565 case WDI_INIT_SCAN_REQ:
21566 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21567 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21568 break;
21569 case WDI_START_SCAN_REQ:
21570 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21571 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21572 break;
21573 case WDI_END_SCAN_REQ:
21574 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21575 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21576 break;
21577 case WDI_FINISH_SCAN_REQ:
21578 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21579 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21580 break;
21581 case WDI_JOIN_REQ:
21582 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21583 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21584 break;
21585 case WDI_CONFIG_BSS_REQ:
21586 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21587 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21588 break;
21589 case WDI_DEL_BSS_REQ:
21590 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21591 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21592 break;
21593 case WDI_POST_ASSOC_REQ:
21594 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21595 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21596 break;
21597 case WDI_DEL_STA_REQ:
21598 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21599 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21600 break;
21601 case WDI_DEL_STA_SELF_REQ:
21602 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21603 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21604 break;
21605
21606 case WDI_SET_BSS_KEY_REQ:
21607 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21608 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21609 break;
21610 case WDI_RMV_BSS_KEY_REQ:
21611 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21612 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21613 break;
21614 case WDI_SET_STA_KEY_REQ:
21615 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21616 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21617 break;
21618 case WDI_RMV_STA_KEY_REQ:
21619 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21620 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21621 break;
21622 case WDI_ADD_TS_REQ:
21623 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21624 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21625 break;
21626 case WDI_DEL_TS_REQ:
21627 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21628 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21629 break;
21630 case WDI_UPD_EDCA_PRMS_REQ:
21631 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21632 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21633 break;
21634 case WDI_ADD_BA_SESSION_REQ:
21635 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21636 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21637 break;
21638 case WDI_DEL_BA_REQ:
21639 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21640 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21641 break;
21642#ifdef FEATURE_WLAN_CCX
21643 case WDI_TSM_STATS_REQ:
21644 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21645 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21646 break;
21647#endif
21648 case WDI_CH_SWITCH_REQ:
21649 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21650 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21651 break;
21652 case WDI_CONFIG_STA_REQ:
21653 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21654 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21655 break;
21656 case WDI_SET_LINK_ST_REQ:
21657 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21658 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21659 break;
21660 case WDI_GET_STATS_REQ:
21661 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21662 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21663 break;
21664 case WDI_UPDATE_CFG_REQ:
21665 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21666 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21667 break;
21668 case WDI_ADD_BA_REQ:
21669 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21670 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21671 break;
21672 case WDI_TRIGGER_BA_REQ:
21673 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21674 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21675 break;
21676 case WDI_UPD_BCON_PRMS_REQ:
21677 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21678 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21679 break;
21680 case WDI_SND_BCON_REQ:
21681 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21682 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21683 break;
21684 case WDI_ENTER_BMPS_REQ:
21685 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21686 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21687 break;
21688 case WDI_EXIT_BMPS_REQ:
21689 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21690 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21691 break;
21692 case WDI_ENTER_UAPSD_REQ:
21693 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21694 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21695 break;
21696 case WDI_UPDATE_UAPSD_PARAM_REQ:
21697 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21698 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21699 break;
21700 case WDI_CONFIGURE_RXP_FILTER_REQ:
21701 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21702 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21703 break;
21704 case WDI_SET_BEACON_FILTER_REQ:
21705 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21706 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21707 break;
21708 case WDI_REM_BEACON_FILTER_REQ:
21709 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21710 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070021711 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021712 case WDI_SET_RSSI_THRESHOLDS_REQ:
21713 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21714 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21715 break;
21716 case WDI_HOST_OFFLOAD_REQ:
21717 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21718 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21719 break;
21720 case WDI_WOWL_ADD_BC_PTRN_REQ:
21721 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21722 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21723 break;
21724 case WDI_WOWL_DEL_BC_PTRN_REQ:
21725 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21726 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21727 break;
21728 case WDI_WOWL_ENTER_REQ:
21729 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21730 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21731 break;
21732 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21733 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21734 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21735 break;
21736 case WDI_FLUSH_AC_REQ:
21737 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21738 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21739 break;
21740 case WDI_BTAMP_EVENT_REQ:
21741 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21742 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21743 break;
21744 case WDI_KEEP_ALIVE_REQ:
21745 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21746 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21747 break;
21748 case WDI_SET_TX_PER_TRACKING_REQ:
21749 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21750 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21751 default:
21752 *ppfnReqCB = NULL;
21753 *ppUserData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070021754 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021755 }
21756}/*WDI_ExtractRequestCBFromEvent*/
21757
21758
21759/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021760 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
Jeff Johnson295189b2012-06-20 16:38:30 -070021761 frame xtl is enabled for a particular STA.
21762
21763 WDI_PostAssocReq must have been called.
21764
Jeff Johnsone7245742012-09-05 17:12:55 -070021765 @param uSTAIdx: STA index
21766
Jeff Johnson295189b2012-06-20 16:38:30 -070021767 @see WDI_PostAssocReq
21768 @return Result of the function call
21769*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021770wpt_boolean
Jeff Johnson295189b2012-06-20 16:38:30 -070021771WDI_IsHwFrameTxTranslationCapable
21772(
21773 wpt_uint8 uSTAIdx
21774)
21775{
Jeff Johnsone7245742012-09-05 17:12:55 -070021776 /*!! FIX ME - this must eventually be per station - for now just feedback
Jeff Johnson295189b2012-06-20 16:38:30 -070021777 uma value*/
21778 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021779 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021780 ------------------------------------------------------------------------*/
21781 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21782 {
21783 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21784 "WDI API call before module is initialized - Fail request");
21785
Jeff Johnsone7245742012-09-05 17:12:55 -070021786 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021787 }
21788
Jeff Johnsone7245742012-09-05 17:12:55 -070021789
Jeff Johnson295189b2012-06-20 16:38:30 -070021790 return gWDICb.bFrameTransEnabled;
21791}/*WDI_IsHwFrameTxTranslationCapable*/
21792
21793#ifdef FEATURE_WLAN_SCAN_PNO
21794/**
21795 @brief WDI_SetPreferredNetworkList
21796
Jeff Johnsone7245742012-09-05 17:12:55 -070021797 @param pwdiPNOScanReqParams: the Set PNO as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021798 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021799
Jeff Johnson295189b2012-06-20 16:38:30 -070021800 wdiPNOScanCb: callback for passing back the response
21801 of the Set PNO operation received from the
21802 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021803
Jeff Johnson295189b2012-06-20 16:38:30 -070021804 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021805 callback
21806
Jeff Johnson295189b2012-06-20 16:38:30 -070021807 @return Result of the function call
21808*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021809WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021810WDI_SetPreferredNetworkReq
21811(
21812 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21813 WDI_PNOScanCb wdiPNOScanCb,
21814 void* pUserData
21815)
21816{
21817 WDI_EventInfoType wdiEventData = {{0}};
21818 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21819
21820 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021821 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021822 ------------------------------------------------------------------------*/
21823 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21824 {
21825 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21826 "WDI API call before module is initialized - Fail request");
21827
Jeff Johnsone7245742012-09-05 17:12:55 -070021828 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021829 }
21830
21831 /*------------------------------------------------------------------------
21832 Fill in Event data and post to the Main FSM
21833 ------------------------------------------------------------------------*/
21834 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021835 wdiEventData.pEventData = pwdiPNOScanReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021836 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021837 wdiEventData.pCBfnc = wdiPNOScanCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021838 wdiEventData.pUserData = pUserData;
21839
21840 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21841}
21842
21843
21844/**
21845 @brief WDI_SetRssiFilterReq
21846
Jeff Johnsone7245742012-09-05 17:12:55 -070021847 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
Jeff Johnson295189b2012-06-20 16:38:30 -070021848 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021849
Jeff Johnson295189b2012-06-20 16:38:30 -070021850 wdiRssiFilterCb: callback for passing back the response
21851 of the Set RSSI Filter operation received from the
21852 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021853
Jeff Johnson295189b2012-06-20 16:38:30 -070021854 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021855 callback
21856
Jeff Johnson295189b2012-06-20 16:38:30 -070021857 @return Result of the function call
21858*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021859WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021860WDI_SetRssiFilterReq
21861(
21862 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
21863 WDI_RssiFilterCb wdiRssiFilterCb,
21864 void* pUserData
21865)
21866{
21867 WDI_EventInfoType wdiEventData = {{0}};
21868 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21869
21870 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021871 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021872 ------------------------------------------------------------------------*/
21873 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21874 {
21875 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21876 "WDI API call before module is initialized - Fail request");
21877
Jeff Johnsone7245742012-09-05 17:12:55 -070021878 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021879 }
21880
21881 /*------------------------------------------------------------------------
21882 Fill in Event data and post to the Main FSM
21883 ------------------------------------------------------------------------*/
21884 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021885 wdiEventData.pEventData = pwdiRssiFilterReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021886 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021887 wdiEventData.pCBfnc = wdiRssiFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021888 wdiEventData.pUserData = pUserData;
21889
21890 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21891}/*WDI_SetRssiFilterReq*/
21892
21893/**
21894 @brief WDI_UpdateScanParamsReq
21895
Jeff Johnsone7245742012-09-05 17:12:55 -070021896 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021897 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021898
Jeff Johnson295189b2012-06-20 16:38:30 -070021899 wdiUpdateScanParamsCb: callback for passing back the response
21900 of the Set PNO operation received from the
21901 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021902
Jeff Johnson295189b2012-06-20 16:38:30 -070021903 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021904 callback
21905
Jeff Johnson295189b2012-06-20 16:38:30 -070021906 @return Result of the function call
21907*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021908WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021909WDI_UpdateScanParamsReq
21910(
21911 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
21912 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
21913 void* pUserData
21914)
21915{
21916 WDI_EventInfoType wdiEventData = {{0}};
21917 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21918
21919 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021920 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021921 ------------------------------------------------------------------------*/
21922 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21923 {
21924 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21925 "WDI API call before module is initialized - Fail request");
21926
Jeff Johnsone7245742012-09-05 17:12:55 -070021927 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021928 }
21929
21930 /*------------------------------------------------------------------------
21931 Fill in Event data and post to the Main FSM
21932 ------------------------------------------------------------------------*/
21933 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021934 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
Jeff Johnson295189b2012-06-20 16:38:30 -070021935 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
Jeff Johnsone7245742012-09-05 17:12:55 -070021936 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021937 wdiEventData.pUserData = pUserData;
21938
21939 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21940}
21941
21942/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021943 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070021944 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070021945
21946 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070021947 pwdiPNOScanReqParams: pointer to the info received
21948 from upper layers
21949 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070021950 and its size
21951
Jeff Johnson295189b2012-06-20 16:38:30 -070021952 @return Result of the function call
21953*/
21954
21955WDI_Status
21956WDI_PackPreferredNetworkList
21957(
21958 WDI_ControlBlockType* pWDICtx,
21959 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21960 wpt_uint8** ppSendBuffer,
21961 wpt_uint16* pSize
21962)
21963{
Jeff Johnsone7245742012-09-05 17:12:55 -070021964 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070021965 wpt_uint16 usDataOffset = 0;
21966 wpt_uint16 usSendSize = 0;
21967 tPrefNetwListParams pPrefNetwListParams = {0};
21968 wpt_uint8 i;
21969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21970
21971 /*-----------------------------------------------------------------------
21972 Get message buffer
21973 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021974 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070021975 sizeof(pPrefNetwListParams),
21976 &pSendBuffer, &usDataOffset, &usSendSize))||
21977 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21978 {
21979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21980 "Unable to get send buffer in Set PNO req %x ",
21981 pwdiPNOScanReqParams);
21982 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070021983 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021984 }
21985
21986 /*-------------------------------------------------------------------------
21987 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21988 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021989 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070021990 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070021991 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070021992 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21993
Jeff Johnsone7245742012-09-05 17:12:55 -070021994 pPrefNetwListParams.ucNetworksCount =
21995 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070021996 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070021997 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070021998 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21999
22000 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022001 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022002 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22003 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22004 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22005
22006 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22007 {
22008 /*SSID of the BSS*/
22009 pPrefNetwListParams.aNetworks[i].ssId.length
22010 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22011
22012 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22013 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22014 pPrefNetwListParams.aNetworks[i].ssId.length);
22015
22016 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022017 pPrefNetwListParams.aNetworks[i].authentication =
22018 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022019
22020 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022021 pPrefNetwListParams.aNetworks[i].encryption =
22022 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022023
Jeff Johnsone7245742012-09-05 17:12:55 -070022024 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022025 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022026 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022027 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22028
22029 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22030 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22031 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22032
22033 /*Indicates the RSSI threshold for the network to be considered*/
22034 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22035 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22036
22037 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022038 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022039 pPrefNetwListParams.aNetworks[i].ssId.length,
22040 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22041 }
22042
Jeff Johnsone7245742012-09-05 17:12:55 -070022043 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22044 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022045 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22046 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22047 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22048
22049 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022050 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022051 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22052 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22053 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22054
22055 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22056 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022057 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022058 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022059 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022060 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22061 }
22062
22063 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022064 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022065 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22066 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22067 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022068 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022069
Jeff Johnsone7245742012-09-05 17:12:55 -070022070 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22071 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22072 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022073
Jeff Johnsone7245742012-09-05 17:12:55 -070022074 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022075 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22076 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22077 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022078 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022079
Jeff Johnsone7245742012-09-05 17:12:55 -070022080 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22081 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22082 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022083
22084 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022085 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22086 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022087
22088 /*Set the output values*/
22089 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022090 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022091
22092 return WDI_STATUS_SUCCESS;
22093}/*WDI_PackPreferredNetworkList*/
22094
22095/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022096 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022097 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022098
22099 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022100 pwdiPNOScanReqParams: pointer to the info received
22101 from upper layers
22102 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022103 and its size
22104
Jeff Johnson295189b2012-06-20 16:38:30 -070022105 @return Result of the function call
22106*/
22107
22108WDI_Status
22109WDI_PackPreferredNetworkListNew
22110(
22111 WDI_ControlBlockType* pWDICtx,
22112 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22113 wpt_uint8** ppSendBuffer,
22114 wpt_uint16* pSize
22115)
22116{
Jeff Johnsone7245742012-09-05 17:12:55 -070022117 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022118 wpt_uint16 usDataOffset = 0;
22119 wpt_uint16 usSendSize = 0;
22120 tPrefNetwListParamsNew pPrefNetwListParams;
22121 wpt_uint8 i;
22122 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
22123
22124 /*-----------------------------------------------------------------------
22125 Get message buffer
22126 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022127 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022128 sizeof(pPrefNetwListParams),
22129 &pSendBuffer, &usDataOffset, &usSendSize))||
22130 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
22131 {
22132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22133 "Unable to get send buffer in Set PNO req %x ",
22134 pwdiPNOScanReqParams);
22135 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022136 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022137 }
22138
22139 /*-------------------------------------------------------------------------
22140 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22141 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022142 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022143 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070022144 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022145 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22146
Jeff Johnsone7245742012-09-05 17:12:55 -070022147 pPrefNetwListParams.ucNetworksCount =
22148 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022149 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022150 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022151 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22152
22153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022154 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022155 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22156 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22157 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22158
22159 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22160 {
22161 /*SSID of the BSS*/
22162 pPrefNetwListParams.aNetworks[i].ssId.length
22163 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22164
22165 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22166 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22167 pPrefNetwListParams.aNetworks[i].ssId.length);
22168
22169 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022170 pPrefNetwListParams.aNetworks[i].authentication =
22171 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022172
22173 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022174 pPrefNetwListParams.aNetworks[i].encryption =
22175 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022176
22177 /*SSID bcast type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022178 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
22179 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022180
Jeff Johnsone7245742012-09-05 17:12:55 -070022181 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022182 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022183 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022184 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22185
22186 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22187 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22188 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22189
22190 /*Indicates the RSSI threshold for the network to be considered*/
22191 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22192 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22193
22194 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022195 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022196 pPrefNetwListParams.aNetworks[i].ssId.length,
22197 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22198 }
22199
Jeff Johnsone7245742012-09-05 17:12:55 -070022200 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22201 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022202 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22203 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22204 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22205
22206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022207 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022208 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22209 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22210 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22211
22212 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22213 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022214 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022215 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022216 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022217 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22218 }
22219
22220 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022221 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022222 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22223 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22224 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022225 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022226
Jeff Johnsone7245742012-09-05 17:12:55 -070022227 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22228 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22229 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022230
Jeff Johnsone7245742012-09-05 17:12:55 -070022231 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022232 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22233 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22234 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022235 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022236
Jeff Johnsone7245742012-09-05 17:12:55 -070022237 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22238 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22239 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022240
22241 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022242 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22243 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022244
22245 /*Set the output values*/
22246 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022247 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022248
22249 return WDI_STATUS_SUCCESS;
22250}/*WDI_PackPreferredNetworkListNew*/
22251
22252/**
22253 @brief Process Set Preferred Network List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022254
22255 @param pWDICtx: pointer to the WLAN DAL context
22256 pEventData: pointer to the event information structure
22257
Jeff Johnson295189b2012-06-20 16:38:30 -070022258 @return Result of the function call
22259*/
22260WDI_Status
22261WDI_ProcessSetPreferredNetworkReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022262(
Jeff Johnson295189b2012-06-20 16:38:30 -070022263 WDI_ControlBlockType* pWDICtx,
22264 WDI_EventInfoType* pEventData
22265)
22266{
22267 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
22268 WDI_PNOScanCb wdiPNOScanCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022269 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022270 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070022271 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022272
22273 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022274 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022275 -------------------------------------------------------------------------*/
22276 if (( NULL == pEventData ) ||
22277 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
22278 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
22279 {
22280 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22281 "%s: Invalid parameters", __FUNCTION__);
22282 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022283 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022284 }
22285
22286 /*-------------------------------------------------------------------------
22287 Pack the PNO request structure based on version
22288 -------------------------------------------------------------------------*/
22289 if ( pWDICtx->wdiPNOVersion > 0 )
22290 {
22291 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022292 "%s: PNO new version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022293 pWDICtx->wdiPNOVersion);
22294
22295 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
22296 &pSendBuffer, &usSendSize);
22297 }
22298 else
22299 {
22300 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022301 "%s: PNO old version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022302 pWDICtx->wdiPNOVersion);
22303
22304 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
22305 &pSendBuffer, &usSendSize);
22306 }
22307
22308 if (( WDI_STATUS_SUCCESS != wdiStatus )||
22309 ( NULL == pSendBuffer )||( 0 == usSendSize ))
22310 {
22311 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22312 "%s: failed to pack request parameters", __FUNCTION__);
22313 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022314 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022315 }
22316
22317 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022318 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022319
22320 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022321 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022322 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022323 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22324 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022325}
22326
22327/**
22328 @brief Process Set RSSI Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022329
22330 @param pWDICtx: pointer to the WLAN DAL context
22331 pEventData: pointer to the event information structure
22332
Jeff Johnson295189b2012-06-20 16:38:30 -070022333 @see
22334 @return Result of the function call
22335*/
22336WDI_Status
22337WDI_ProcessSetRssiFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022338(
Jeff Johnson295189b2012-06-20 16:38:30 -070022339 WDI_ControlBlockType* pWDICtx,
22340 WDI_EventInfoType* pEventData
22341)
22342{
22343 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
22344 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022345 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022346 wpt_uint16 usDataOffset = 0;
22347 wpt_uint16 usSendSize = 0;
22348 wpt_uint8 ucRssiThreshold;
22349
22350 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022351 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022352 -------------------------------------------------------------------------*/
22353 if (( NULL == pEventData ) ||
22354 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
22355 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
22356 {
22357 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22358 "%s: Invalid parameters", __FUNCTION__);
22359 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022360 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022361 }
22362
22363 /*-----------------------------------------------------------------------
22364 Get message buffer
22365 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022366 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022367 sizeof(ucRssiThreshold),
22368 &pSendBuffer, &usDataOffset, &usSendSize))||
22369 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
22370 {
22371 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22372 "Unable to get send buffer in Set PNO req %x %x %x",
22373 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
22374 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022375 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022376 }
22377
22378 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
22379
Jeff Johnsone7245742012-09-05 17:12:55 -070022380 wpalMemoryCopy( pSendBuffer+usDataOffset,
22381 &ucRssiThreshold,
22382 sizeof(ucRssiThreshold));
Jeff Johnson295189b2012-06-20 16:38:30 -070022383
22384 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022385 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022386
22387 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022388 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022389 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022390 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22391 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022392}
22393
22394
22395/**
22396 @brief Process Update Scan Params function
Jeff Johnsone7245742012-09-05 17:12:55 -070022397
22398 @param pWDICtx: pointer to the WLAN DAL context
22399 pEventData: pointer to the event information structure
22400
Jeff Johnson295189b2012-06-20 16:38:30 -070022401 @see
22402 @return Result of the function call
22403*/
22404WDI_Status
22405WDI_ProcessUpdateScanParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022406(
Jeff Johnson295189b2012-06-20 16:38:30 -070022407 WDI_ControlBlockType* pWDICtx,
22408 WDI_EventInfoType* pEventData
22409)
22410{
22411 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
22412 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022413 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022414 wpt_uint16 usDataOffset = 0;
22415 wpt_uint16 usSendSize = 0;
22416 tUpdateScanParams updateScanParams = {0};
22417
22418
22419 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022420 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022421 -------------------------------------------------------------------------*/
22422 if (( NULL == pEventData ) ||
22423 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
22424 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
22425 {
22426 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22427 "%s: Invalid parameters", __FUNCTION__);
22428 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022429 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022430 }
22431
22432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22433 "Begin WDI Update Scan Parameters");
22434 /*-----------------------------------------------------------------------
22435 Get message buffer
22436 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022437 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022438 sizeof(updateScanParams),
22439 &pSendBuffer, &usDataOffset, &usSendSize))||
22440 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22441 {
22442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22443 "Unable to get send buffer in Update Scan Params req %x %x %x",
22444 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22445 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022446 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022447 }
22448
22449 //
22450 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22451 //
22452
22453 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22454 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
Jeff Johnsone7245742012-09-05 17:12:55 -070022455 updateScanParams.ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022456 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22457 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22458 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22459 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22460
Jeff Johnsone7245742012-09-05 17:12:55 -070022461 wpalMemoryCopy( updateScanParams.aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022462 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22463 updateScanParams.ucChannelCount);
22464
22465 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22466 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22467 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22468 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22469 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22470
Jeff Johnsone7245742012-09-05 17:12:55 -070022471 wpalMemoryCopy( pSendBuffer+usDataOffset,
22472 &updateScanParams,
22473 sizeof(updateScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022474
22475 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022476 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022477
22478 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22479 "End Update Scan Parameters");
22480 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022481 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022482 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022483 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22484 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022485}
22486
22487/**
22488 @brief Process Preferred Network Found Indication function
Jeff Johnsone7245742012-09-05 17:12:55 -070022489
22490 @param pWDICtx: pointer to the WLAN DAL context
22491 pEventData: pointer to the event information structure
22492
Jeff Johnson295189b2012-06-20 16:38:30 -070022493 @see
22494 @return Result of the function call
22495*/
22496WDI_Status
22497WDI_ProcessPrefNetworkFoundInd
Jeff Johnsone7245742012-09-05 17:12:55 -070022498(
Jeff Johnson295189b2012-06-20 16:38:30 -070022499 WDI_ControlBlockType* pWDICtx,
22500 WDI_EventInfoType* pEventData
22501)
22502{
22503 WDI_LowLevelIndType wdiInd;
22504 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22505
22506
22507 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022508 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022509 -------------------------------------------------------------------------*/
22510 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22511 ( NULL == pEventData->pEventData ))
22512 {
22513 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22514 "%s: Invalid parameters", __FUNCTION__);
22515 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070022516 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022517 }
22518
22519 /*-------------------------------------------------------------------------
22520 Extract indication and send it to UMAC
22521 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022522 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22523 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022524 sizeof(tPrefNetwFoundParams));
22525
22526 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022527 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070022528
22529 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22530
Jeff Johnsone7245742012-09-05 17:12:55 -070022531 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070022532 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
Jeff Johnsone7245742012-09-05 17:12:55 -070022533 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
Jeff Johnson295189b2012-06-20 16:38:30 -070022534
Jeff Johnsone7245742012-09-05 17:12:55 -070022535 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22536 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022537 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22538
22539 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22540 prefNetwFoundInd.prefNetwFoundParams.rssi;
22541
22542 // DEBUG
22543 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22544 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22545 wdiInd.wdiIndicationType,
22546 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22547 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22548
22549 /*Notify UMAC*/
22550 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070022551
22552 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022553}
22554
22555/**
22556 @brief Process PNO Rsp function (called when a
22557 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022558
22559 @param pWDICtx: pointer to the WLAN DAL context
22560 pEventData: pointer to the event information structure
22561
Jeff Johnson295189b2012-06-20 16:38:30 -070022562 @see
22563 @return Result of the function call
22564*/
22565WDI_Status
22566WDI_ProcessSetPreferredNetworkRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022567(
Jeff Johnson295189b2012-06-20 16:38:30 -070022568 WDI_ControlBlockType* pWDICtx,
22569 WDI_EventInfoType* pEventData
22570)
22571{
22572 WDI_Status wdiStatus;
22573 eHalStatus halStatus;
22574 WDI_PNOScanCb wdiPNOScanCb = NULL;
22575 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22576
22577 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022578 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022579 -------------------------------------------------------------------------*/
22580 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22581 ( NULL == pEventData->pEventData ))
22582 {
22583 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22584 "%s: Invalid parameters", __FUNCTION__);
22585 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022586 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022587 }
22588
22589
Jeff Johnsone7245742012-09-05 17:12:55 -070022590 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022591
22592 /*-------------------------------------------------------------------------
22593 Extract response and send it to UMAC
22594 -------------------------------------------------------------------------*/
22595 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022596 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022597
22598 /*Notify UMAC*/
22599 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22600
Jeff Johnsone7245742012-09-05 17:12:55 -070022601 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022602}/*WDI_ProcessSetPreferredNetworkRsp*/
22603
22604/**
22605 @brief Process RSSI Filter Rsp function (called when a
22606 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022607
22608 @param pWDICtx: pointer to the WLAN DAL context
22609 pEventData: pointer to the event information structure
22610
Jeff Johnson295189b2012-06-20 16:38:30 -070022611 @see
22612 @return Result of the function call
22613*/
22614WDI_Status
22615WDI_ProcessSetRssiFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022616(
Jeff Johnson295189b2012-06-20 16:38:30 -070022617 WDI_ControlBlockType* pWDICtx,
22618 WDI_EventInfoType* pEventData
22619)
22620{
22621 WDI_Status wdiStatus;
22622 eHalStatus halStatus;
22623 WDI_RssiFilterCb wdiRssiFilterCb;
22624 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22625
22626 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022627 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022628 -------------------------------------------------------------------------*/
22629 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22630 ( NULL == pEventData->pEventData ))
22631 {
22632 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22633 "%s: Invalid parameters", __FUNCTION__);
22634 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022635 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022636 }
22637
Jeff Johnsone7245742012-09-05 17:12:55 -070022638 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022639
22640 /*-------------------------------------------------------------------------
22641 Extract response and send it to UMAC
22642 -------------------------------------------------------------------------*/
22643 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022644 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022645
22646 /*Notify UMAC*/
22647 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22648
Jeff Johnsone7245742012-09-05 17:12:55 -070022649 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022650}/*WDI_ProcessSetRssiFilterRsp*/
22651
22652/**
22653 @brief Process Update Scan Params Rsp function (called when a
22654 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022655
22656 @param pWDICtx: pointer to the WLAN DAL context
22657 pEventData: pointer to the event information structure
22658
Jeff Johnson295189b2012-06-20 16:38:30 -070022659 @see
22660 @return Result of the function call
22661*/
22662WDI_Status
22663WDI_ProcessUpdateScanParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022664(
Jeff Johnson295189b2012-06-20 16:38:30 -070022665 WDI_ControlBlockType* pWDICtx,
22666 WDI_EventInfoType* pEventData
22667)
22668{
22669 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070022670 tUpdateScanParamsResp halUpdScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022671 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022672 wpt_uint32 uStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022673 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22674
22675 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022676 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022677 -------------------------------------------------------------------------*/
22678 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22679 ( NULL == pEventData->pEventData ))
22680 {
22681 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22682 "%s: Invalid parameters", __FUNCTION__);
22683 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022684 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022685 }
22686
22687 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22688 "Process UPD scan params ptr : %x", __FUNCTION__);
22689
Jeff Johnsone7245742012-09-05 17:12:55 -070022690 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022691
22692 /*-------------------------------------------------------------------------
22693 Extract response and send it to UMAC
22694 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022695 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22696 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022697 sizeof(halUpdScanParams.status));
22698
22699 uStatus = halUpdScanParams.status;
22700
22701 /*Extract PNO version - 1st bit of the status */
Jeff Johnsone7245742012-09-05 17:12:55 -070022702 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
Jeff Johnson295189b2012-06-20 16:38:30 -070022703
22704 /*Remove version bit*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022705 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
Jeff Johnson295189b2012-06-20 16:38:30 -070022706
Jeff Johnsone7245742012-09-05 17:12:55 -070022707 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022708
22709 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022710 "UPD Scan Parameters rsp with status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022711 halUpdScanParams.status);
22712
22713 /*Notify UMAC*/
22714 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22715
Jeff Johnsone7245742012-09-05 17:12:55 -070022716 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022717}
22718#endif // FEATURE_WLAN_SCAN_PNO
22719
22720#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -070022721WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022722WDI_8023MulticastListReq
22723(
22724 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22725 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22726 void* pUserData
22727)
22728{
22729 WDI_EventInfoType wdiEventData;
22730 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22731
22732 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22733 "%s", __FUNCTION__);
22734
22735 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022736 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022737 ------------------------------------------------------------------------*/
22738 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22739 {
22740 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22741 "WDI API call before module is initialized - Fail request");
22742
Jeff Johnsone7245742012-09-05 17:12:55 -070022743 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022744 }
22745
22746 /*------------------------------------------------------------------------
22747 Fill in Event data and post to the Main FSM
22748 ------------------------------------------------------------------------*/
22749 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022750 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022751 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022752 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022753 wdiEventData.pUserData = pUserData;
22754
22755 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22756}
22757
Jeff Johnsone7245742012-09-05 17:12:55 -070022758WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022759WDI_ReceiveFilterSetFilterReq
22760(
22761 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22762 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22763 void* pUserData
22764)
22765{
22766 WDI_EventInfoType wdiEventData;
22767 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22768
22769 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22770 "%s",__FUNCTION__);
22771
22772 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022773 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022774 ------------------------------------------------------------------------*/
22775 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22776 {
22777 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22778 "WDI API call before module is initialized - Fail request");
22779
Jeff Johnsone7245742012-09-05 17:12:55 -070022780 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022781 }
22782
22783 /*------------------------------------------------------------------------
22784 Fill in Event data and post to the Main FSM
22785 ------------------------------------------------------------------------*/
22786 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022787 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22788 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22789 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
Jeff Johnson295189b2012-06-20 16:38:30 -070022790 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
Jeff Johnsone7245742012-09-05 17:12:55 -070022791 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022792 wdiEventData.pUserData = pUserData;
22793
22794
22795 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22796}
22797
Jeff Johnsone7245742012-09-05 17:12:55 -070022798WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022799WDI_FilterMatchCountReq
22800(
22801 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
22802 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
22803 void* pUserData
22804)
22805{
22806 WDI_EventInfoType wdiEventData;
22807 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22808
22809 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22810 "%s",__FUNCTION__);
22811
22812 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022813 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022814 ------------------------------------------------------------------------*/
22815 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22816 {
22817 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22818 "WDI API call before module is initialized - Fail request");
22819
Jeff Johnsone7245742012-09-05 17:12:55 -070022820 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022821 }
22822
22823 /*------------------------------------------------------------------------
22824 Fill in Event data and post to the Main FSM
22825 ------------------------------------------------------------------------*/
22826 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022827 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022828 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022829 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022830 wdiEventData.pUserData = pUserData;
22831
22832
22833 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22834}
22835
Jeff Johnsone7245742012-09-05 17:12:55 -070022836WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022837WDI_ReceiveFilterClearFilterReq
22838(
22839 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
22840 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
22841 void* pUserData
22842)
22843{
22844 WDI_EventInfoType wdiEventData;
22845 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22846
22847 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22848 "%s",__FUNCTION__);
22849
22850 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022851 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022852 ------------------------------------------------------------------------*/
22853 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22854 {
22855 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22856 "WDI API call before module is initialized - Fail request");
22857
Jeff Johnsone7245742012-09-05 17:12:55 -070022858 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022859 }
22860
22861 /*------------------------------------------------------------------------
22862 Fill in Event data and post to the Main FSM
22863 ------------------------------------------------------------------------*/
22864 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022865 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022866 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022867 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022868 wdiEventData.pUserData = pUserData;
22869
22870
22871 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22872}
22873
22874/**
22875 @brief Process 8023 Multicast List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022876
22877 @param pWDICtx: pointer to the WLAN DAL context
22878 pEventData: pointer to the event information structure
22879
Jeff Johnson295189b2012-06-20 16:38:30 -070022880 @see
22881 @return Result of the function call
22882*/
22883WDI_Status
22884WDI_Process8023MulticastListReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022885(
Jeff Johnson295189b2012-06-20 16:38:30 -070022886 WDI_ControlBlockType* pWDICtx,
22887 WDI_EventInfoType* pEventData
22888)
22889{
22890 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
22891 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022892 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022893 wpt_uint16 usDataOffset = 0;
22894 wpt_uint16 usSendSize = 0;
22895 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
22896 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022897 wpt_uint8 ucCurrentBSSSesIdx = 0;
22898 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022899
22900 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22901 "%s",__FUNCTION__);
22902
22903 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022904 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022905 -------------------------------------------------------------------------*/
22906 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022907 ( NULL == (pwdiFltPktSetMcListReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070022908 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022909 ( NULL == (wdi8023MulticastListCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070022910 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
22911 {
22912 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22913 "%s: Invalid parameters", __FUNCTION__);
22914 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022915 return WDI_STATUS_E_FAILURE;
22916 }
22917
22918 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
22919 pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId,
22920 &pBSSSes);
22921 if ( NULL == pBSSSes )
22922 {
22923 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22924 " %s : Association for this BSSID does not exist",__FUNCTION__);
22925 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022926 }
22927
22928 /*-----------------------------------------------------------------------
22929 Get message buffer
22930 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022931 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22932 WDI_8023_MULTICAST_LIST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022933 sizeof(tHalRcvFltMcAddrListType),
22934 &pSendBuffer, &usDataOffset, &usSendSize))||
22935 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
22936 {
22937 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22938 "Unable to get send buffer in "
22939 "WDI_Process8023MulticastListReq() %x %x %x",
22940 pEventData, pwdiFltPktSetMcListReqParamsType,
22941 wdi8023MulticastListCb);
22942 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022943 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022944 }
22945
Jeff Johnsone7245742012-09-05 17:12:55 -070022946 rcvFltMcAddrListType.cMulticastAddr =
22947 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
Jeff Johnson295189b2012-06-20 16:38:30 -070022948 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
22949 {
22950 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
22951 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
22952 sizeof(tSirMacAddr));
22953 }
22954
Jeff Johnsone7245742012-09-05 17:12:55 -070022955 rcvFltMcAddrListType.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070022956 wpalMemoryCopy( pSendBuffer+usDataOffset,
22957 &rcvFltMcAddrListType,
22958 sizeof(rcvFltMcAddrListType));
22959
22960 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022961 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022962
22963
22964 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022965 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022966 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022967 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070022968 wdi8023MulticastListCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070022969 WDI_8023_MULTICAST_LIST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022970}
22971
22972/**
22973 @brief Process Receive Filter Set Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022974
22975 @param pWDICtx: pointer to the WLAN DAL context
22976 pEventData: pointer to the event information structure
22977
Jeff Johnson295189b2012-06-20 16:38:30 -070022978 @see
22979 @return Result of the function call
22980*/
22981WDI_Status
22982WDI_ProcessReceiveFilterSetFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022983(
Jeff Johnson295189b2012-06-20 16:38:30 -070022984 WDI_ControlBlockType* pWDICtx,
22985 WDI_EventInfoType* pEventData
22986)
22987{
22988 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
22989 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022990 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022991 wpt_uint16 usDataOffset = 0;
22992 wpt_uint16 usSendSize = 0;
22993 wpt_uint32 usRcvPktFilterCfgSize;
22994 tHalRcvPktFilterCfgType *pRcvPktFilterCfg;
22995 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022996 wpt_uint8 ucCurrentBSSSesIdx = 0;
22997 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022998
22999 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23000 "%s",__FUNCTION__);
23001
23002 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023003 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023004 -------------------------------------------------------------------------*/
23005 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023006 ( NULL == (pwdiSetRcvPktFilterReqInfo =
Jeff Johnson295189b2012-06-20 16:38:30 -070023007 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023008 ( NULL == (wdiReceiveFilterSetFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023009 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
23010 {
23011 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23012 "%s: Invalid parameters", __FUNCTION__);
23013 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023014 return WDI_STATUS_E_FAILURE;
23015 }
23016
23017 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23018 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId,
23019 &pBSSSes);
23020 if ( NULL == pBSSSes )
23021 {
23022 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23023 " %s : Association for this BSSID does not exist",__FUNCTION__);
23024 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023025 }
23026
23027 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
23028 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23029 * sizeof(tHalRcvPktFilterParams));
23030
23031 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
23032 usRcvPktFilterCfgSize);
23033
23034 if(NULL == pRcvPktFilterCfg)
23035 {
23036 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23037 "%s: Failed to allocate memory for "
23038 "tHalRcvPktFilterCfgType: %x %x %x ",
23039 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23040 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023041 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023042 }
23043
23044 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
23045
23046 /*-----------------------------------------------------------------------
23047 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070023048
Jeff Johnson295189b2012-06-20 16:38:30 -070023049 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023050 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023051 usRcvPktFilterCfgSize,
23052 &pSendBuffer, &usDataOffset, &usSendSize))||
23053 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
23054 {
23055 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23056 "Unable to get send buffer in "
23057 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23058 pEventData, pwdiSetRcvPktFilterReqInfo,
23059 wdiReceiveFilterSetFilterCb);
23060 WDI_ASSERT(0);
23061 wpalMemoryFree(pRcvPktFilterCfg);
Jeff Johnsone7245742012-09-05 17:12:55 -070023062 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023063 }
23064
23065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023066 "UsData Off %d UsSend %d cfg %d",usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023067 usSendSize,usRcvPktFilterCfgSize);
23068
23069 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
Jeff Johnsone7245742012-09-05 17:12:55 -070023070 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023071 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070023072 pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
Jeff Johnson295189b2012-06-20 16:38:30 -070023073
Jeff Johnsone7245742012-09-05 17:12:55 -070023074 //pRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070023075
23076 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023077 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
Jeff Johnson295189b2012-06-20 16:38:30 -070023078 pRcvPktFilterCfg->filterType);
23079 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23080 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070023081 pRcvPktFilterCfg->coalesceTime);
Jeff Johnson295189b2012-06-20 16:38:30 -070023082
23083 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
23084 {
Jeff Johnsone7245742012-09-05 17:12:55 -070023085 pRcvPktFilterCfg->paramsData[i].protocolLayer =
Jeff Johnson295189b2012-06-20 16:38:30 -070023086 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
Jeff Johnsone7245742012-09-05 17:12:55 -070023087 pRcvPktFilterCfg->paramsData[i].cmpFlag =
Jeff Johnson295189b2012-06-20 16:38:30 -070023088 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
Jeff Johnsone7245742012-09-05 17:12:55 -070023089 pRcvPktFilterCfg->paramsData[i].dataOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070023090 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070023091 pRcvPktFilterCfg->paramsData[i].dataLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070023092 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
23093
23094 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
23095 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23096 8);
23097 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
23098 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23099 8);
23100
23101 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23102 "Out:Proto %d Comp Flag %d \n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023103 pRcvPktFilterCfg->paramsData[i].protocolLayer,
Jeff Johnson295189b2012-06-20 16:38:30 -070023104 pRcvPktFilterCfg->paramsData[i].cmpFlag);
23105
23106 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23107 "Data Offset %d Data Len %d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023108 pRcvPktFilterCfg->paramsData[i].dataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023109 pRcvPktFilterCfg->paramsData[i].dataLength);
23110
23111 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23112 "CData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023113 pRcvPktFilterCfg->paramsData[i].compareData[0],
23114 pRcvPktFilterCfg->paramsData[i].compareData[1],
23115 pRcvPktFilterCfg->paramsData[i].compareData[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023116 pRcvPktFilterCfg->paramsData[i].compareData[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023117 pRcvPktFilterCfg->paramsData[i].compareData[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023118 pRcvPktFilterCfg->paramsData[i].compareData[5]);
23119
23120 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23121 "MData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023122 pRcvPktFilterCfg->paramsData[i].dataMask[0],
23123 pRcvPktFilterCfg->paramsData[i].dataMask[1],
23124 pRcvPktFilterCfg->paramsData[i].dataMask[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023125 pRcvPktFilterCfg->paramsData[i].dataMask[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023126 pRcvPktFilterCfg->paramsData[i].dataMask[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023127 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
23128 }
23129
Jeff Johnsone7245742012-09-05 17:12:55 -070023130 wpalMemoryCopy( pSendBuffer+usDataOffset,
23131 pRcvPktFilterCfg,
23132 usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023133
23134
23135 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023136 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023137
23138 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23139 "%s",__FUNCTION__);
23140 wpalMemoryFree(pRcvPktFilterCfg);
23141
23142 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023143 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023144 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023145 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023146 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023147 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023148}
23149
23150/**
23151 @brief Process Packet Filter Match Count Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023152
23153 @param pWDICtx: pointer to the WLAN DAL context
23154 pEventData: pointer to the event information structure
23155
Jeff Johnson295189b2012-06-20 16:38:30 -070023156 @see
23157 @return Result of the function call
23158*/
23159WDI_Status
23160WDI_ProcessFilterMatchCountReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023161(
Jeff Johnson295189b2012-06-20 16:38:30 -070023162 WDI_ControlBlockType* pWDICtx,
23163 WDI_EventInfoType* pEventData
23164)
23165{
23166 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
23167 NULL;
23168 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
23169 NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023170 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023171 wpt_uint16 usDataOffset = 0;
23172 wpt_uint16 usSendSize = 0;
23173
23174 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23175 "%s",__FUNCTION__);
23176
23177 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023178 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023179 -------------------------------------------------------------------------*/
23180 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023181 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023182 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023183 ( NULL == (wdiFilterMatchCountCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023184 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
23185 {
23186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23187 "%s: Invalid parameters", __FUNCTION__);
23188 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023189 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023190 }
23191
23192 /*-----------------------------------------------------------------------
23193 Get message buffer
23194 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023195 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23196 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023197 0,
23198 &pSendBuffer, &usDataOffset, &usSendSize))||
23199 ( usSendSize < usDataOffset))
23200 {
23201 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23202 "Unable to get send buffer in "
23203 "WDI_ProcessFilterMatchCountReq() %x %x %x",
23204 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
23205 wdiFilterMatchCountCb);
23206 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023207 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023208 }
23209
23210 //
23211 // Don't need to fill send buffer other than header
23212 //
23213 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023214 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023215
23216
23217 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023218 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023219 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023220 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23221 wdiFilterMatchCountCb,
23222 pEventData->pUserData,
23223 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023224}
23225
23226/**
23227 @brief Process Receive Filter Clear Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023228
23229 @param pWDICtx: pointer to the WLAN DAL context
23230 pEventData: pointer to the event information structure
23231
Jeff Johnson295189b2012-06-20 16:38:30 -070023232 @see
23233 @return Result of the function call
23234*/
23235WDI_Status
23236WDI_ProcessReceiveFilterClearFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023237(
Jeff Johnson295189b2012-06-20 16:38:30 -070023238 WDI_ControlBlockType* pWDICtx,
23239 WDI_EventInfoType* pEventData
23240)
Jeff Johnsone7245742012-09-05 17:12:55 -070023241{
Jeff Johnson295189b2012-06-20 16:38:30 -070023242 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
23243 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023244 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023245 wpt_uint16 usDataOffset = 0;
23246 wpt_uint16 usSendSize = 0;
23247 tHalRcvFltPktClearParam rcvFltPktClearParam;
Jeff Johnsone7245742012-09-05 17:12:55 -070023248 wpt_uint8 ucCurrentBSSSesIdx = 0;
23249 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023250
23251 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23252 "%s",__FUNCTION__);
23253
23254 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023255 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023256 -------------------------------------------------------------------------*/
23257 if (( NULL == pEventData ) ||
23258 ( NULL == (pwdiRcvFltPktClearReqParamsType =
23259 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023260 ( NULL == (wdiRcvFltPktClearFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023261 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
23262 {
23263 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23264 "%s: Invalid parameters", __FUNCTION__);
23265 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023266 return WDI_STATUS_E_FAILURE;
23267 }
23268
23269 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23270 pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId,
23271 &pBSSSes);
23272 if ( NULL == pBSSSes )
23273 {
23274 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23275 " %s : Association for this BSSID does not exist",__FUNCTION__);
23276 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023277 }
23278
23279 /*-----------------------------------------------------------------------
23280 Get message buffer
23281 -----------------------------------------------------------------------*/
23282 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023283 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023284 sizeof(tHalRcvFltPktClearParam),
23285 &pSendBuffer, &usDataOffset, &usSendSize))||
23286 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
23287 {
23288 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23289 "Unable to get send buffer in "
23290 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
23291 pEventData, pwdiRcvFltPktClearReqParamsType,
23292 wdiRcvFltPktClearFilterCb);
23293 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023294 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023295 }
23296
23297
23298 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023299 filterClearParam.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070023300 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023301 filterClearParam.filterId;
Jeff Johnson295189b2012-06-20 16:38:30 -070023302
Jeff Johnsone7245742012-09-05 17:12:55 -070023303 rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx;
23304 wpalMemoryCopy( pSendBuffer+usDataOffset,
23305 &rcvFltPktClearParam,
23306 sizeof(rcvFltPktClearParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070023307
23308 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023309 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023310
23311
23312 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023313 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023314 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023315 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023316 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023317 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023318}
23319
23320/**
23321 @brief Process 8023 Multicast List Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023322
23323 @param pWDICtx: pointer to the WLAN DAL context
23324 pEventData: pointer to the event information structure
23325
Jeff Johnson295189b2012-06-20 16:38:30 -070023326 @see
23327 @return Result of the function call
23328*/
23329WDI_Status
23330WDI_Process8023MulticastListRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023331(
Jeff Johnson295189b2012-06-20 16:38:30 -070023332 WDI_ControlBlockType* pWDICtx,
23333 WDI_EventInfoType* pEventData
23334)
23335{
23336 WDI_Status wdiStatus;
23337 eHalStatus halStatus;
23338 WDI_8023MulticastListCb wdi8023MulticastListCb;
23339 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23340
23341 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23342 "%s",__FUNCTION__);
23343
23344 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023345 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023346 -------------------------------------------------------------------------*/
23347 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23348 ( NULL == pEventData->pEventData ))
23349 {
23350 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23351 "%s: Invalid parameters", __FUNCTION__);
23352 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023353 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023354 }
23355
Jeff Johnsone7245742012-09-05 17:12:55 -070023356 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023357
23358 /*-------------------------------------------------------------------------
23359 Extract response and send it to UMAC
23360 -------------------------------------------------------------------------*/
23361 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023362 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023363
23364 /*Notify UMAC*/
23365 wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData);
23366
Jeff Johnsone7245742012-09-05 17:12:55 -070023367 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023368}
23369
23370/**
23371 @brief Process Set Rsp function (called when a
23372 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023373
23374 @param pWDICtx: pointer to the WLAN DAL context
23375 pEventData: pointer to the event information structure
23376
Jeff Johnson295189b2012-06-20 16:38:30 -070023377 @see
23378 @return Result of the function call
23379*/
23380WDI_Status
23381WDI_ProcessReceiveFilterSetFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023382(
Jeff Johnson295189b2012-06-20 16:38:30 -070023383 WDI_ControlBlockType* pWDICtx,
23384 WDI_EventInfoType* pEventData
23385)
23386{
23387 WDI_Status wdiStatus;
23388 eHalStatus halStatus;
23389 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
23390 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23391
23392 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23393 "%s",__FUNCTION__);
23394
23395 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023396 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023397 -------------------------------------------------------------------------*/
23398 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23399 ( NULL == pEventData->pEventData ))
23400 {
23401 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23402 "%s: Invalid parameters", __FUNCTION__);
23403 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023404 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023405 }
23406
23407 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023408 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023409
23410 /*-------------------------------------------------------------------------
23411 Extract response and send it to UMAC
23412 -------------------------------------------------------------------------*/
23413 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023414 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023415
23416 /*Notify UMAC*/
23417 wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23418
Jeff Johnsone7245742012-09-05 17:12:55 -070023419 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023420}
23421
23422/**
23423 @brief Process Packet Filter Match Count Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023424
23425 @param pWDICtx: pointer to the WLAN DAL context
23426 pEventData: pointer to the event information structure
23427
Jeff Johnson295189b2012-06-20 16:38:30 -070023428 @see
23429 @return Result of the function call
23430*/
23431WDI_Status
23432WDI_ProcessFilterMatchCountRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023433(
Jeff Johnson295189b2012-06-20 16:38:30 -070023434 WDI_ControlBlockType* pWDICtx,
23435 WDI_EventInfoType* pEventData
23436)
23437{
23438 WDI_Status wdiStatus;
23439 eHalStatus halStatus;
23440
23441 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
23442
23443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23444
23445 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23446 "%s",__FUNCTION__);
23447
23448 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023449 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023450 -------------------------------------------------------------------------*/
23451 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23452 ( NULL == pEventData->pEventData ))
23453 {
23454 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23455 "%s: Invalid parameters", __FUNCTION__);
23456 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023457 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023458 }
23459
Jeff Johnsone7245742012-09-05 17:12:55 -070023460 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023461
23462 /*-------------------------------------------------------------------------
23463 Extract response and send it to UMAC
23464 -------------------------------------------------------------------------*/
23465 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023466 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023467
23468 /*Notify UMAC*/
23469 wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData);
23470
Jeff Johnsone7245742012-09-05 17:12:55 -070023471 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023472}
23473
23474/**
23475 @brief Process Receive Filter Clear Filter Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023476
23477 @param pWDICtx: pointer to the WLAN DAL context
23478 pEventData: pointer to the event information structure
23479
Jeff Johnson295189b2012-06-20 16:38:30 -070023480 @see
23481 @return Result of the function call
23482*/
23483WDI_Status
23484WDI_ProcessReceiveFilterClearFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023485(
Jeff Johnson295189b2012-06-20 16:38:30 -070023486 WDI_ControlBlockType* pWDICtx,
23487 WDI_EventInfoType* pEventData
23488)
23489{
23490 WDI_Status wdiStatus;
23491 eHalStatus halStatus;
23492 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
23493 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23494
23495 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23496 "%s",__FUNCTION__);
23497
23498 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023499 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023500 -------------------------------------------------------------------------*/
23501 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23502 ( NULL == pEventData->pEventData ))
23503 {
23504 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23505 "%s: Invalid parameters", __FUNCTION__);
23506 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023507 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023508 }
23509
23510 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023511 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023512
23513 /*-------------------------------------------------------------------------
23514 Extract response and send it to UMAC
23515 -------------------------------------------------------------------------*/
23516 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023517 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023518
23519 /*Notify UMAC*/
23520 wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23521
Jeff Johnsone7245742012-09-05 17:12:55 -070023522 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023523}
23524#endif // WLAN_FEATURE_PACKET_FILTERING
23525
23526/**
23527 @brief Process Shutdown Rsp function
23528 There is no shutdown response comming from HAL
23529 - function just kept for simmetry
Jeff Johnsone7245742012-09-05 17:12:55 -070023530
Jeff Johnson295189b2012-06-20 16:38:30 -070023531 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnsone7245742012-09-05 17:12:55 -070023532 pEventData: pointer to the event information structure
Jeff Johnson295189b2012-06-20 16:38:30 -070023533
23534 @see
23535 @return Result of the function call
23536*/
23537WDI_Status
23538WDI_ProcessShutdownRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023539(
Jeff Johnson295189b2012-06-20 16:38:30 -070023540 WDI_ControlBlockType* pWDICtx,
23541 WDI_EventInfoType* pEventData
23542)
23543{
23544 /*There is no shutdown response comming from HAL - function just kept for
23545 simmetry */
23546 WDI_ASSERT(0);
23547 return WDI_STATUS_SUCCESS;
23548}/*WDI_ProcessShutdownRsp*/
23549
23550/**
23551 @brief WDI_SetPowerParamsReq
23552
Jeff Johnsone7245742012-09-05 17:12:55 -070023553 @param pwdiPowerParamsReqParams: the Set Power Params as
Jeff Johnson295189b2012-06-20 16:38:30 -070023554 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070023555
Jeff Johnson295189b2012-06-20 16:38:30 -070023556 wdiPowerParamsCb: callback for passing back the response
23557 of the Set Power Params operation received from the
23558 device
Jeff Johnsone7245742012-09-05 17:12:55 -070023559
Jeff Johnson295189b2012-06-20 16:38:30 -070023560 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070023561 callback
23562
Jeff Johnson295189b2012-06-20 16:38:30 -070023563 @return Result of the function call
23564*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023565WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023566WDI_SetPowerParamsReq
23567(
23568 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23569 WDI_SetPowerParamsCb wdiPowerParamsCb,
23570 void* pUserData
23571)
23572{
23573 WDI_EventInfoType wdiEventData;
23574 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23575
23576 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023577 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023578 ------------------------------------------------------------------------*/
23579 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23580 {
23581 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23582 "WDI API call before module is initialized - Fail request");
23583
Jeff Johnsone7245742012-09-05 17:12:55 -070023584 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023585 }
23586
23587 /*------------------------------------------------------------------------
23588 Fill in Event data and post to the Main FSM
23589 ------------------------------------------------------------------------*/
23590 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023591 wdiEventData.pEventData = pwdiPowerParamsReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023592 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070023593 wdiEventData.pCBfnc = wdiPowerParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070023594 wdiEventData.pUserData = pUserData;
23595
23596 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23597}/*WDI_SetPowerParamsReq*/
23598
23599/**
23600 @brief Process Set Power Params Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023601
23602 @param pWDICtx: pointer to the WLAN DAL context
23603 pEventData: pointer to the event information structure
23604
Jeff Johnson295189b2012-06-20 16:38:30 -070023605 @see
23606 @return Result of the function call
23607*/
23608WDI_Status
23609WDI_ProcessSetPowerParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023610(
Jeff Johnson295189b2012-06-20 16:38:30 -070023611 WDI_ControlBlockType* pWDICtx,
23612 WDI_EventInfoType* pEventData
23613)
23614{
23615 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
23616 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023617 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023618 wpt_uint16 usDataOffset = 0;
23619 wpt_uint16 usSendSize = 0;
23620 tSetPowerParamsType powerParams;
23621
23622 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023623 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023624 -------------------------------------------------------------------------*/
23625 if (( NULL == pEventData ) ||
23626 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
23627 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
23628 {
23629 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23630 "%s: Invalid parameters", __FUNCTION__);
23631 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023632 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023633 }
23634
23635 /*-----------------------------------------------------------------------
23636 Get message buffer
23637 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023638 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023639 sizeof(powerParams),
23640 &pSendBuffer, &usDataOffset, &usSendSize))||
23641 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
23642 {
23643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23644 "Unable to get send buffer in Set PNO req %x %x %x",
23645 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
23646 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023647 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023648 }
23649
23650 /* Ignore DTIM */
Jeff Johnsone7245742012-09-05 17:12:55 -070023651 powerParams.uIgnoreDTIM =
Jeff Johnson295189b2012-06-20 16:38:30 -070023652 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
23653
23654 /*DTIM Period*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023655 powerParams.uDTIMPeriod =
Jeff Johnson295189b2012-06-20 16:38:30 -070023656 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
23657
23658 /* Listen Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023659 powerParams.uListenInterval=
Jeff Johnson295189b2012-06-20 16:38:30 -070023660 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
23661
23662 /* Broadcast Multicas Filter */
Jeff Johnsone7245742012-09-05 17:12:55 -070023663 powerParams.uBcastMcastFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070023664 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
23665
23666 /* Beacon Early Termination */
Jeff Johnsone7245742012-09-05 17:12:55 -070023667 powerParams.uEnableBET =
Jeff Johnson295189b2012-06-20 16:38:30 -070023668 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
23669
23670 /* Beacon Early Termination Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023671 powerParams.uBETInterval =
23672 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
Jeff Johnson295189b2012-06-20 16:38:30 -070023673
Jeff Johnsone7245742012-09-05 17:12:55 -070023674
23675 wpalMemoryCopy( pSendBuffer+usDataOffset,
23676 &powerParams,
23677 sizeof(powerParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070023678
23679 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023680 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023681
23682 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023683 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023684 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023685 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23686 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023687}
23688
23689/**
23690 @brief Process Power Params Rsp function (called when a
23691 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023692
23693 @param pWDICtx: pointer to the WLAN DAL context
23694 pEventData: pointer to the event information structure
23695
Jeff Johnson295189b2012-06-20 16:38:30 -070023696 @see
23697 @return Result of the function call
23698*/
23699WDI_Status
23700WDI_ProcessSetPowerParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023701(
Jeff Johnson295189b2012-06-20 16:38:30 -070023702 WDI_ControlBlockType* pWDICtx,
23703 WDI_EventInfoType* pEventData
23704)
23705{
23706 WDI_Status wdiStatus;
23707 eHalStatus halStatus;
23708 WDI_SetPowerParamsCb wdiPowerParamsCb;
23709 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23710
23711 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023712 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023713 -------------------------------------------------------------------------*/
23714 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23715 ( NULL == pEventData->pEventData ))
23716 {
23717 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23718 "%s: Invalid parameters", __FUNCTION__);
23719 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023720 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023721 }
23722
Jeff Johnsone7245742012-09-05 17:12:55 -070023723 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023724
23725 /*-------------------------------------------------------------------------
23726 Extract response and send it to UMAC
23727 -------------------------------------------------------------------------*/
23728 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023729 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023730
23731 /*Notify UMAC*/
23732 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23733
Jeff Johnsone7245742012-09-05 17:12:55 -070023734 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023735}/*WDI_ProcessSetPowerParamsRsp*/
23736
23737#ifdef WLAN_FEATURE_GTK_OFFLOAD
23738/**
23739 @brief WDI_GTKOffloadReq will be called when the upper MAC
23740 wants to set GTK Rekey Counter while in power save. Upon
23741 the call of this API the WLAN DAL will pack and send a
23742 HAL GTK offload request message to the lower RIVA
23743 sub-system if DAL is in state STARTED.
23744
23745 In state BUSY this request will be queued. Request won't
23746 be allowed in any other state.
23747
23748 WDI_PostAssocReq must have been called.
23749
23750 @param pwdiGtkOffloadParams: the GTK offload as specified
23751 by the Device Interface
23752
23753 wdiGtkOffloadCb: callback for passing back the response
23754 of the GTK offload operation received from the device
23755
23756 pUserData: user data will be passed back with the
23757 callback
23758
23759 @see WDI_PostAssocReq
23760 @return Result of the function call
23761*/
23762WDI_Status
23763WDI_GTKOffloadReq
23764(
23765 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
23766 WDI_GtkOffloadCb wdiGtkOffloadCb,
23767 void* pUserData
23768)
23769{
23770 WDI_EventInfoType wdiEventData = {0};
23771 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23772
23773 /*------------------------------------------------------------------------
23774 Sanity Check
23775 ------------------------------------------------------------------------*/
23776 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23777 {
23778 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23779 "WDI API call before module is initialized - Fail request");
23780
23781 return WDI_STATUS_E_NOT_ALLOWED;
23782 }
23783
23784 /*------------------------------------------------------------------------
23785 Fill in Event data and post to the Main FSM
23786 ------------------------------------------------------------------------*/
23787 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
23788 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
23789 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
23790 wdiEventData.pCBfnc = wdiGtkOffloadCb;
23791 wdiEventData.pUserData = pUserData;
23792
23793 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23794}
23795
23796
23797/**
23798 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
23799 MAC wants to get GTK Rekey Counter while in power save.
23800 Upon the call of this API the WLAN DAL will pack and
23801 send a HAL GTK offload request message to the lower RIVA
23802 sub-system if DAL is in state STARTED.
23803
23804 In state BUSY this request will be queued. Request won't
23805 be allowed in any other state.
23806
23807 WDI_PostAssocReq must have been called.
23808
23809 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
23810 Information Message as specified by the
23811 Device Interface
23812
23813 wdiGtkOffloadGetInfoCb: callback for passing back the
23814 response of the GTK offload operation received from the
23815 device
23816
23817 pUserData: user data will be passed back with the
23818 callback
23819
23820 @see WDI_PostAssocReq
23821 @return Result of the function call
23822*/
23823WDI_Status
23824WDI_GTKOffloadGetInfoReq
23825(
23826 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
23827 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
23828 void* pUserData
23829)
23830{
23831 WDI_EventInfoType wdiEventData = {0};
23832 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23833
23834 /*------------------------------------------------------------------------
23835 Sanity Check
23836 ------------------------------------------------------------------------*/
23837 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23838 {
23839 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23840 "WDI API call before module is initialized - Fail request");
23841
23842 return WDI_STATUS_E_NOT_ALLOWED;
23843 }
23844
23845 /*------------------------------------------------------------------------
23846 Fill in Event data and post to the Main FSM
23847 ------------------------------------------------------------------------*/
23848 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
23849 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
23850 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
23851 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
23852 wdiEventData.pUserData = pUserData;
23853
23854 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23855}
23856
23857
23858/**
23859 @brief Process set GTK Offload Request function
23860
23861 @param pWDICtx: pointer to the WLAN DAL context
23862 pEventData: pointer to the event information structure
23863
23864 @see
23865 @return Result of the function call
23866*/
23867WDI_Status
23868WDI_ProcessGTKOffloadReq
23869(
23870 WDI_ControlBlockType* pWDICtx,
23871 WDI_EventInfoType* pEventData
23872)
23873{
23874 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
23875 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23876 wpt_uint8* pSendBuffer = NULL;
23877 wpt_uint16 usDataOffset = 0;
23878 wpt_uint16 usSendSize = 0;
23879 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
23880 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23881
23882 /*-------------------------------------------------------------------------
23883 Sanity check
23884 -------------------------------------------------------------------------*/
23885 if (( NULL == pEventData ) ||
23886 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
23887 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
23888 {
23889 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23890 "%s: Invalid parameters", __FUNCTION__);
23891 WDI_ASSERT(0);
23892 return WDI_STATUS_E_FAILURE;
23893 }
23894
23895 /*-----------------------------------------------------------------------
23896 Get message buffer
23897 -----------------------------------------------------------------------*/
23898 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
23899 sizeof(gtkOffloadReqParams),
23900 &pSendBuffer, &usDataOffset, &usSendSize))||
23901 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
23902 {
23903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23904 "Unable to get send buffer in GTK offload req %x %x %x",
23905 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
23906 WDI_ASSERT(0);
23907 return WDI_STATUS_E_FAILURE;
23908 }
23909
23910 //
23911 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
23912 //
23913 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
23914 // Copy KCK
23915 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
23916 // Copy KEK
23917 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
23918 // Copy KeyReplayCounter
23919 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
23920
23921 wpalMemoryCopy( pSendBuffer+usDataOffset,
23922 &gtkOffloadReqParams,
23923 sizeof(gtkOffloadReqParams));
23924
23925 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
23926 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
23927
23928 /*-------------------------------------------------------------------------
23929 Send Get STA Request to HAL
23930 -------------------------------------------------------------------------*/
23931 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23932 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
23933}
23934
23935
23936/**
23937 @brief Process GTK Offload Get Information Request function
23938
23939 @param pWDICtx: pointer to the WLAN DAL context
23940 pEventData: pointer to the event information structure
23941
23942 @see
23943 @return Result of the function call
23944*/
23945WDI_Status
23946WDI_ProcessGTKOffloadGetInfoReq
23947(
23948 WDI_ControlBlockType* pWDICtx,
23949 WDI_EventInfoType* pEventData
23950)
23951{
23952 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
23953 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23954 wpt_uint8* pSendBuffer = NULL;
23955 wpt_uint16 usDataOffset = 0;
23956 wpt_uint16 usSendSize = 0;
23957
23958 /*-------------------------------------------------------------------------
23959 Sanity check
23960 -------------------------------------------------------------------------*/
23961 if (( NULL == pEventData ) ||
23962 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
23963 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
23964 {
23965 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23966 "%s: Invalid parameters", __FUNCTION__);
23967 WDI_ASSERT(0);
23968 return WDI_STATUS_E_FAILURE;
23969 }
23970
23971 /*-----------------------------------------------------------------------
23972 Get message buffer
23973 -----------------------------------------------------------------------*/
23974 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
23975 0,
23976 &pSendBuffer, &usDataOffset, &usSendSize))||
23977 ( usSendSize < usDataOffset))
23978 {
23979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23980 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
23981 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
23982 WDI_ASSERT(0);
23983 return WDI_STATUS_E_FAILURE;
23984 }
23985
23986 //
23987 // Don't need to fill send buffer other than header
23988 //
23989
23990 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
23991 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
23992
23993 /*-------------------------------------------------------------------------
23994 Send Get STA Request to HAL
23995 -------------------------------------------------------------------------*/
23996 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23997 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
23998}
23999
24000/**
24001 @brief Process host offload Rsp function (called when a
24002 response is being received over the bus from HAL)
24003
24004 @param pWDICtx: pointer to the WLAN DAL context
24005 pEventData: pointer to the event information structure
24006
24007 @see
24008 @return Result of the function call
24009*/
24010WDI_Status
24011WDI_ProcessGtkOffloadRsp
24012(
24013 WDI_ControlBlockType* pWDICtx,
24014 WDI_EventInfoType* pEventData
24015)
24016{
24017 WDI_Status wdiStatus;
24018 eHalStatus halStatus;
24019 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
24020 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24021
24022 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
24023
24024 /*-------------------------------------------------------------------------
24025 Sanity check
24026 -------------------------------------------------------------------------*/
24027 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24028 ( NULL == pEventData->pEventData))
24029 {
24030 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24031 "%s: Invalid parameters", __FUNCTION__);
24032 WDI_ASSERT(0);
24033 return WDI_STATUS_E_FAILURE;
24034 }
24035
24036 /*-------------------------------------------------------------------------
24037 Extract response and send it to UMAC
24038 -------------------------------------------------------------------------*/
24039 halStatus = *((eHalStatus*)pEventData->pEventData);
24040 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24041
24042 /*Notify UMAC*/
24043 wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
24044
24045 return WDI_STATUS_SUCCESS;
24046}
24047
24048/**
24049 @brief Process GTK Offload Get Information Response function
24050
24051 @param pWDICtx: pointer to the WLAN DAL context
24052 pEventData: pointer to the event information structure
24053
24054 @see
24055 @return Result of the function call
24056*/
24057WDI_Status
24058WDI_ProcessGTKOffloadGetInfoRsp
24059(
24060 WDI_ControlBlockType* pWDICtx,
24061 WDI_EventInfoType* pEventData
24062)
24063{
24064 WDI_Status wdiStatus;
24065 eHalStatus halStatus;
24066
24067 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
24068
24069 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24070
24071 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
24072
24073 /*-------------------------------------------------------------------------
24074 Sanity check
24075 -------------------------------------------------------------------------*/
24076 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24077 ( NULL == pEventData->pEventData ))
24078 {
24079 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24080 "%s: Invalid parameters", __FUNCTION__);
24081 WDI_ASSERT(0);
24082 return WDI_STATUS_E_FAILURE;
24083 }
24084
24085 /*-------------------------------------------------------------------------
24086 Extract response and send it to UMAC
24087 -------------------------------------------------------------------------*/
24088 halStatus = *((eHalStatus*)pEventData->pEventData);
24089 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24090
24091 /*Notify UMAC*/
24092 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24093 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
24094 wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData);
24095
24096 return WDI_STATUS_SUCCESS;
24097}
24098#endif // WLAN_FEATURE_GTK_OFFLOAD
24099
24100#ifdef WLAN_WAKEUP_EVENTS
24101WDI_Status
24102WDI_ProcessWakeReasonInd
24103(
24104 WDI_ControlBlockType* pWDICtx,
24105 WDI_EventInfoType* pEventData
24106)
24107{
24108 WDI_LowLevelIndType *pWdiInd;
24109 tpWakeReasonParams pWakeReasonParams;
24110 wpt_uint32 allocSize = 0;
24111
24112 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24113 "+%s", __FUNCTION__);
24114
24115 /*-------------------------------------------------------------------------
24116 Sanity check
24117 -------------------------------------------------------------------------*/
24118 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24119 ( NULL == pEventData->pEventData ))
24120 {
24121 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24122 "%s: Invalid parameters", __FUNCTION__);
24123 WDI_ASSERT( 0 );
24124 return WDI_STATUS_E_FAILURE;
24125 }
24126
24127 /*-------------------------------------------------------------------------
24128 Extract indication and send it to UMAC
24129 -------------------------------------------------------------------------*/
24130 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
24131
24132 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
24133
24134 //Allocate memory for WDI_WakeReasonIndType structure
24135 pWdiInd = wpalMemoryAllocate(allocSize) ;
24136
24137 if(NULL == pWdiInd)
24138 {
24139 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24140 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
24141 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
24142 WDI_ASSERT(0);
24143 return WDI_STATUS_E_FAILURE;
24144 }
24145
24146 wpalMemoryZero(pWdiInd, allocSize);
24147
24148 /* Fill in the indication parameters*/
24149 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
24150 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
24151 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
24152 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
24153 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
24154 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
24155 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
24156 &(pWakeReasonParams->aDataStart[0]),
24157 pWakeReasonParams->ulStoredDataLen);
24158
24159 /*Notify UMAC*/
24160 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
24161
24162 //Free memory allocated for WDI_WakeReasonIndType structure
24163 wpalMemoryFree(pWdiInd);
24164
24165 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24166 "-%s", __FUNCTION__);
24167
24168 return WDI_STATUS_SUCCESS;
24169}
24170#endif // WLAN_WAKEUP_EVENTS
24171
24172void WDI_GetWcnssCompiledApiVersion
24173(
24174 WDI_WlanVersionType *pWcnssApiVersion
24175)
24176{
24177 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
24178 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
24179 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
24180 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
24181}
24182
24183/**
24184 @brief Process Set TM Level Rsp function (called when a
24185 response is being received over the bus from HAL)
24186
24187 @param pWDICtx: pointer to the WLAN DAL context
24188 pEventData: pointer to the event information structure
24189
24190 @see
24191 @return Result of the function call
24192*/
24193WDI_Status
24194WDI_ProcessSetTmLevelRsp
24195(
24196 WDI_ControlBlockType* pWDICtx,
24197 WDI_EventInfoType* pEventData
24198)
24199{
24200 WDI_Status wdiStatus;
24201 eHalStatus halStatus;
24202 WDI_SetTmLevelCb wdiSetTmLevelCb;
24203 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24204
24205 /*-------------------------------------------------------------------------
24206 Sanity check
24207 -------------------------------------------------------------------------*/
24208 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24209 ( NULL == pEventData->pEventData ))
24210 {
24211 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24212 "%s: Invalid parameters", __FUNCTION__);
24213 WDI_ASSERT(0);
24214 return WDI_STATUS_E_FAILURE;
24215 }
24216
24217 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
24218
24219 /*-------------------------------------------------------------------------
24220 Extract response and send it to UMAC
24221 -------------------------------------------------------------------------*/
24222 halStatus = *((eHalStatus*)pEventData->pEventData);
24223 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24224
24225 /*Notify UMAC*/
24226 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
24227
24228 return WDI_STATUS_SUCCESS;
24229}/*WDI_ProcessSetTmLevelRsp*/
24230
24231/**
24232 @brief Process Set Thermal Mitigation level Changed request
24233
24234 @param pWDICtx: pointer to the WLAN DAL context
24235 pEventData: pointer to the event information structure
24236
24237 @see
24238 @return Result of the function call
24239*/
24240WDI_Status
24241WDI_ProcessSetTmLevelReq
24242(
24243 WDI_ControlBlockType* pWDICtx,
24244 WDI_EventInfoType* pEventData
24245)
24246{
24247 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
24248 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
24249 wpt_uint8* pSendBuffer = NULL;
24250 wpt_uint16 usDataOffset = 0;
24251 wpt_uint16 usSendSize = 0;
24252 tSetThermalMitgationType halTmMsg;
24253
24254 /*-------------------------------------------------------------------------
24255 Sanity check
24256 -------------------------------------------------------------------------*/
24257 if (( NULL == pEventData ) ||
24258 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
24259 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
24260 {
24261 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24262 "%s: Invalid parameters", __FUNCTION__);
24263 WDI_ASSERT(0);
24264 return WDI_STATUS_E_FAILURE;
24265 }
24266
24267 /*-----------------------------------------------------------------------
24268 Get message buffer
24269 -----------------------------------------------------------------------*/
24270 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
24271 sizeof(halTmMsg),
24272 &pSendBuffer, &usDataOffset, &usSendSize))||
24273 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
24274 {
24275 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24276 "Unable to get send buffer in Set PNO req %x %x %x",
24277 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
24278 WDI_ASSERT(0);
24279 return WDI_STATUS_E_FAILURE;
24280 }
24281
24282 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
24283 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
24284
24285 wpalMemoryCopy( pSendBuffer+usDataOffset,
24286 &halTmMsg,
24287 sizeof(halTmMsg));
24288
24289 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
24290 pWDICtx->pfncRspCB = NULL;
24291 /*-------------------------------------------------------------------------
24292 Send Get STA Request to HAL
24293 -------------------------------------------------------------------------*/
24294 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24295 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
24296}
24297
24298/* Fill the value from the global features enabled array to the global capabilities
24299 * bitmap struct
24300 */
24301static void
24302FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
24303{
24304 wpt_int8 i;
24305 for (i=0; i<len; i++)
24306 {
24307 setFeatCaps(fCaps, enabledFeat[i]);
24308 }
24309}
24310
24311/**
24312 @brief WDI_featureCapsExchangeReq
24313 Post feature capability bitmap exchange event.
24314 Host will send its own capability to FW in this req and
24315 expect FW to send its capability back as a bitmap in Response
24316
24317 @param
24318
24319 wdiFeatureCapsExchangeCb: callback called on getting the response.
24320 It is kept to mantain similarity between WDI reqs and if needed, can
24321 be used in future. Currently, It is set to NULL
24322
24323 pUserData: user data will be passed back with the
24324 callback
24325
24326 @see
24327 @return Result of the function call
24328*/
24329WDI_Status
24330WDI_featureCapsExchangeReq
24331(
24332 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
24333 void* pUserData
24334)
24335{
24336 WDI_EventInfoType wdiEventData;
24337 wpt_int32 fCapsStructSize;
24338
24339 /*------------------------------------------------------------------------
24340 Sanity Check
24341 ------------------------------------------------------------------------*/
24342 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24343 {
24344 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24345 "WDI API call before module is initialized - Fail request");
24346
24347 return WDI_STATUS_E_NOT_ALLOWED;
24348 }
24349
24350 /* Allocate memory separately for global variable carrying FW caps */
24351 fCapsStructSize = sizeof(tWlanFeatCaps);
24352 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24353 if ( NULL == gpHostWlanFeatCaps )
24354 {
24355 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24356 "Cannot allocate memory for host capability info\n");
24357 WDI_ASSERT(0);
24358 return WDI_STATUS_MEM_FAILURE;
24359 }
24360
24361 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
24362
24363 /*------------------------------------------------------------------------
24364 Fill in Event data and post to the Main FSM
24365 ------------------------------------------------------------------------*/
24366 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
24367 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
Jeff Johnsone7245742012-09-05 17:12:55 -070024368 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24369 "Host caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024370 gpHostWlanFeatCaps->featCaps[0],
24371 gpHostWlanFeatCaps->featCaps[1],
24372 gpHostWlanFeatCaps->featCaps[2],
24373 gpHostWlanFeatCaps->featCaps[3]
24374 );
24375
24376 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
24377 wdiEventData.pEventData = gpHostWlanFeatCaps;
24378 wdiEventData.uEventDataSize = fCapsStructSize;
24379 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
24380 wdiEventData.pUserData = pUserData;
24381
24382 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24383}
24384
24385/**
24386 @brief Process Host-FW Capability Exchange Request function
24387
24388 @param pWDICtx: pointer to the WLAN DAL context
24389 pEventData: pointer to the event information structure
24390
24391 @see
24392 @return Result of the function call
24393*/
24394WDI_Status
24395WDI_ProcessFeatureCapsExchangeReq
24396(
24397 WDI_ControlBlockType* pWDICtx,
24398 WDI_EventInfoType* pEventData
24399)
24400{
24401 wpt_uint8* pSendBuffer = NULL;
24402 wpt_uint16 usDataOffset = 0;
24403 wpt_uint16 usSendSize = 0;
24404 wpt_uint16 usLen = 0;
24405
24406 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24407
24408 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24409 "%s", __FUNCTION__);
24410
24411 /*-------------------------------------------------------------------------
24412 Sanity check
24413 -------------------------------------------------------------------------*/
24414 /* Call back function is NULL since not required for cap exchange req */
24415 if (( NULL == pEventData ) ||
24416 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
24417 {
24418 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24419 "%s: Invalid parameters", __FUNCTION__);
24420 WDI_ASSERT(0);
24421 return WDI_STATUS_E_FAILURE;
24422 }
24423
24424 /*-----------------------------------------------------------------------
24425 Get message buffer
24426 -----------------------------------------------------------------------*/
24427 usLen = sizeof(tWlanFeatCaps);
24428
24429 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
24430 WDI_FEATURE_CAPS_EXCHANGE_REQ,
24431 usLen,
24432 &pSendBuffer, &usDataOffset, &usSendSize))||
24433 ( usSendSize < (usDataOffset + usLen )))
24434 {
24435 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24436 "Unable to get send buffer in feat caps exchange req %x %x",
24437 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
24438 WDI_ASSERT(0);
24439 return WDI_STATUS_E_FAILURE;
24440 }
24441
24442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070024443 "Host Caps - %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024444 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
24445 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
24446 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
24447 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
24448 );
24449
24450 /* Copy host caps after the offset in the send buffer */
24451 wpalMemoryCopy( pSendBuffer+usDataOffset,
24452 (tWlanFeatCaps *)pEventData->pEventData,
24453 usLen);
24454
24455 /*-------------------------------------------------------------------------
24456 Send Start Request to HAL
24457 -------------------------------------------------------------------------*/
24458 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24459 (WDI_StartRspCb)pEventData->pCBfnc,
24460 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
24461
24462}/*WDI_ProcessFeatureCapsExchangeReq*/
24463
24464/**
24465 @brief Process Host-FW Capability Exchange Response function
24466
24467 @param pWDICtx: pointer to the WLAN DAL context
24468 pEventData: pointer to the event information structure
24469
24470 @see
24471 @return Result of the function call
24472*/
24473WDI_Status
24474WDI_ProcessFeatureCapsExchangeRsp
24475(
24476 WDI_ControlBlockType* pWDICtx,
24477 WDI_EventInfoType* pEventData
24478)
24479{
24480 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24481 wpt_int32 fCapsStructSize;
24482 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24483
24484 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24485 "%s", __FUNCTION__);
24486
24487 /*-------------------------------------------------------------------------
24488 Sanity check
24489 -------------------------------------------------------------------------*/
24490 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24491 ( NULL == pEventData->pEventData ))
24492 {
24493 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24494 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24495 "%s: Invalid parameters", __FUNCTION__);
24496 WDI_ASSERT(0);
24497 return WDI_STATUS_E_FAILURE;
24498 }
24499
24500 /* Allocate memory separately for global variable carrying FW caps */
24501 fCapsStructSize = sizeof(tWlanFeatCaps);
24502 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24503 if ( NULL == gpFwWlanFeatCaps )
24504 {
24505 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24506 "Cannot allocate memory for host capability info\n");
24507 WDI_ASSERT(0);
24508 return WDI_STATUS_MEM_FAILURE;
24509 }
24510
24511 /*-------------------------------------------------------------------------
24512 Unpack HAL Response Message - the header was already extracted by the
24513 main Response Handling procedure
24514 -------------------------------------------------------------------------*/
24515 /*-------------------------------------------------------------------------
24516 Extract response and send it to UMAC
24517 -------------------------------------------------------------------------*/
24518
24519 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24520 fCapsStructSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070024521 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24522 "FW caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024523 gpFwWlanFeatCaps->featCaps[0],
24524 gpFwWlanFeatCaps->featCaps[1],
24525 gpFwWlanFeatCaps->featCaps[2],
24526 gpFwWlanFeatCaps->featCaps[3]
24527 );
Jeff Johnsone7245742012-09-05 17:12:55 -070024528
Jeff Johnson295189b2012-06-20 16:38:30 -070024529 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24530
24531 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24532 if (wdiFeatureCapsExchangeCb != NULL)
24533 wdiFeatureCapsExchangeCb(NULL, NULL);
24534
24535 return WDI_STATUS_SUCCESS;
24536}
24537
Mohit Khanna4a70d262012-09-11 16:30:12 -070024538#ifdef WLAN_FEATURE_11AC
24539WDI_Status
24540WDI_ProcessUpdateVHTOpModeRsp
24541(
24542 WDI_ControlBlockType* pWDICtx,
24543 WDI_EventInfoType* pEventData
24544)
24545{
24546 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24547 WDI_Status wdiStatus;
24548 eHalStatus halStatus;
24549
24550 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24551
24552 /*-------------------------------------------------------------------------
24553 Sanity check
24554 -------------------------------------------------------------------------*/
24555 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24556 ( NULL == pEventData->pEventData))
24557 {
24558 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24559 "%s: Invalid parameters", __FUNCTION__);
24560 WDI_ASSERT(0);
24561 return WDI_STATUS_E_FAILURE;
24562 }
24563 wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc;
24564
24565 /*-------------------------------------------------------------------------
24566 Extract response and send it to UMAC
24567 -------------------------------------------------------------------------*/
24568 halStatus = *((eHalStatus*)pEventData->pEventData);
24569 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24570
24571 /*Notify UMAC*/
24572 wdiVHTOpModeCb( wdiStatus, pEventData->pUserData);
24573
24574 return WDI_STATUS_SUCCESS;
24575}
24576#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070024577/**
24578 @brief WDI_getHostWlanFeatCaps
24579 WDI API that returns whether the feature passed to it as enum value in
24580 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
24581 variable storing host capability bitmap to find this. This can be used by
24582 other moduels to decide certain things like call different APIs based on
24583 whether a particular feature is supported.
24584
24585 @param
24586
24587 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
24588
24589 @see
24590 @return
24591 0 - if the feature is NOT supported in host
24592 any non-zero value - if the feature is SUPPORTED in host.
24593*/
24594wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
24595{
24596 wpt_uint8 featSupported = 0;
24597 if (gpHostWlanFeatCaps != NULL)
24598 {
24599 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
24600 }
24601 else
24602 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024603 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024604 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024605 }
24606 return featSupported;
24607}
24608
24609/**
24610 @brief WDI_getFwWlanFeatCaps
24611 WDI API that returns whether the feature passed to it as enum value in
24612 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
24613 variable storing host capability bitmap to find this. This can be used by
24614 other moduels to decide certain things like call different APIs based on
24615 whether a particular feature is supported.
24616
24617 @param
24618
24619 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
24620 in wlan_hal_msg.h.
24621
24622 @see
24623 @return
24624 0 - if the feature is NOT supported in FW
24625 any non-zero value - if the feature is SUPPORTED in FW.
24626*/
24627wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
24628{
24629 wpt_uint8 featSupported = 0;
24630 if (gpFwWlanFeatCaps != NULL)
24631 {
24632 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
24633 }
24634 else
24635 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024636 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024637 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024638 }
24639 return featSupported;
24640}
Mohit Khanna4a70d262012-09-11 16:30:12 -070024641
24642#ifdef WLAN_FEATURE_11AC
24643WDI_Status
24644WDI_ProcessUpdateVHTOpModeReq
24645(
24646 WDI_ControlBlockType* pWDICtx,
24647 WDI_EventInfoType* pEventData
24648)
24649{
24650 WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL;
24651 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24652 wpt_uint8* pSendBuffer = NULL;
24653 wpt_uint16 usDataOffset = 0;
24654 wpt_uint16 usSendSize = 0;
24655
24656 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24657
24658 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24659 "%s", __FUNCTION__);
24660
24661 /*-------------------------------------------------------------------------
24662 Sanity check
24663 -------------------------------------------------------------------------*/
24664 if (( NULL == pEventData ) ||
24665 ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) ||
24666 ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc)))
24667 {
24668 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24669 "%s: Invalid parameters", __FUNCTION__);
24670 WDI_ASSERT(0);
24671 return WDI_STATUS_E_FAILURE;
24672 }
24673
24674 /*-----------------------------------------------------------------------
24675 Get message buffer
24676 -----------------------------------------------------------------------*/
24677 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ,
24678 sizeof(WDI_UpdateVHTOpMode),
24679 &pSendBuffer, &usDataOffset, &usSendSize))||
24680 ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) )))
24681 {
24682 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24683 "Unable to get send buffer in update vht opMode req");
24684 WDI_ASSERT(0);
24685 return WDI_STATUS_E_FAILURE;
24686 }
24687
24688 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24689 "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId);
24690
24691 wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams,
24692 sizeof(WDI_UpdateVHTOpMode));
24693
24694 /*-------------------------------------------------------------------------
24695 Send Start Request to HAL
24696 -------------------------------------------------------------------------*/
24697 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24698 wdiVHTOpModeCb,
24699 pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP);
24700
24701}
24702
24703WDI_Status
24704WDI_UpdateVHTOpModeReq
24705(
24706 WDI_UpdateVHTOpMode *pData,
24707 WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb,
24708 void* pUserData
24709)
24710{
24711 WDI_EventInfoType wdiEventData;
24712
24713 /*------------------------------------------------------------------------
24714 Sanity Check
24715 ------------------------------------------------------------------------*/
24716 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24717 {
24718 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24719 "WDI API call before module is initialized - Fail request");
24720
24721 return WDI_STATUS_E_NOT_ALLOWED;
24722 }
24723
24724 /*------------------------------------------------------------------------
24725 Fill in Event data and post to the Main FSM
24726 ------------------------------------------------------------------------*/
24727 wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ;
24728 wdiEventData.pEventData = pData;
24729 wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode);
24730 wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb;
24731 wdiEventData.pUserData = pUserData;
24732
24733 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24734 "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId);
24735
24736 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24737
24738}
24739#endif
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024740
24741/**
24742 @brief WDI_TransportChannelDebug -
24743 Display DXE Channel debugging information
24744 User may request to display DXE channel snapshot
24745 Or if host driver detects any abnormal stcuk may display
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024746
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024747 @param displaySnapshot : Dispaly DXE snapshot option
24748 @param enableStallDetect : Enable stall detect feature
24749 This feature will take effect to data performance
24750 Not integrate till fully verification
24751 @see
24752 @return none
24753*/
24754void WDI_TransportChannelDebug
24755(
24756 wpt_boolean displaySnapshot,
24757 wpt_boolean toggleStallDetect
24758)
24759{
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070024760 WDTS_ChannelDebug(displaySnapshot, toggleStallDetect);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070024761 return;
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -070024762}